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A,qCAAoCD,GAChDL,GAAYO,EAAAA,EAAAA,IAAaF,EAAUG,gBAEzC,GAAIX,EACA,OAAO,IAAID,GAAmCC,GAAYQ,EAAUG,eAAeC,YAAYX,eAAWnD,EAAWqD,GAEzH,MAAM,IAAIX,MAAM,gGASbqB,eAAeC,EAClBC,EACAC,GAEA,OAAOC,QAAQC,UACVC,MAAK,KACF,MAAMC,EAA2CL,EAAMb,gBAEvD,IAAKkB,EAAe,CAChB,MAAMC,EAAuB,IAAIC,EAAAA,qBAC7BP,EAAMf,UACNe,EAAMd,eACNnD,OACAA,EACAkE,EAAQL,gBAGZ,OAAOY,EAAAA,EAAAA,oBAAmBF,EAAsBL,GAGpD,OAAOI,KAEVD,MAA+BK,IAC5B,MAAMJ,EAAsEI,EAE5E,OAAIJ,EACOK,EAAAA,oBAAAA,wBACH,CACIC,cAAeV,GAEnBI,EAAcO,SACdZ,EAAMd,UACNc,EAAMZ,WAIP,QAEVgB,MAAKN,MAAAA,IAKK,CAAEe,gBAAAA,EAAiBC,oCAJkBC,EAAAA,2BAAAA,+BAA0D,CAClGJ,cAAeV,QAKtBG,MAAK9E,IACK0F,EAAAA,EAAAA,mCAAkC1F,EAAOuF,gBAAiBvF,EAAOwF,iCAE3EG,OAAOC,IAEJ,MADAjB,EAAQkB,MAAMD,EAAME,SACd,IAAI3C,MAAM,+DAI5B,SAAe4C,EAAAA,EAAAA,IAA2B,CACtC5E,GAAI,8EACJ6E,OAAmCvB,EACnCC,MAAOR,WC7HX+B,EAAOC,QAAU/G,cCAjB8G,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/modules/mfrm-base-faqs/mfrm-base-faqs.tsx?0305","webpack://mattressfirm/./src/modules/mfrm-base-faqs/mfrm-base-faqs.view.tsx?6e4a","webpack://mattressfirm/./lib/mfrm-base-faqs/module-registration.js?7dca","webpack://mattressfirm/./src/dataActions/get-attributes-for-selected-variant.ts?e4b6","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { RichTextComponent } from '@msdyn365-commerce/core';\r\nimport AccordionItem from 'mfcl/AccordionItem';\r\nimport * as React from 'react';\r\nimport _getViewPort from '../../Utilities/get-view-port';\r\nimport { IMfrmBaseFaqsData } from './mfrm-base-faqs.data';\r\nimport { IFaqListData, IMfrmBaseFaqsProps } from './mfrm-base-faqs.props.autogenerated';\r\n\r\nexport interface IMfrmBaseFaqsViewProps extends IMfrmBaseFaqsProps {\r\n baseFaqsContent: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * MfrmBaseFaqs component\r\n * @extends {React.FC>}\r\n */\r\nclass MfrmBaseFaqs extends React.PureComponent> {\r\n constructor(props: IMfrmBaseFaqsProps) {\r\n super(props);\r\n }\r\n public render(): JSX.Element | null {\r\n const viewProps = {\r\n ...(this.props as IMfrmBaseFaqsProps),\r\n baseFaqsContent: this._showFAQAccordion()\r\n };\r\n return this.props.renderView(viewProps);\r\n }\r\n private _showFAQAccordion = (): JSX.Element | undefined => {\r\n const faqHeader = this.props.config.faqHeader;\r\n const faqAccordionContent = this.props.config.faqList;\r\n const {\r\n data: {\r\n productSpecificationData: { result }\r\n },\r\n config: { backendAttribute }\r\n } = this.props;\r\n const isAdjsutableBaseProduct =\r\n result && backendAttribute\r\n ? result.find(obj => obj.Name && obj.Name.toLowerCase().trim() === backendAttribute.toLowerCase().trim())?.TextValue\r\n : undefined;\r\n return (\r\n <>\r\n {isAdjsutableBaseProduct && isAdjsutableBaseProduct.length > 0 ? (\r\n
\r\n

{faqHeader}

\r\n
\r\n {faqAccordionContent &&\r\n faqAccordionContent.length &&\r\n faqAccordionContent.map((item: IFaqListData, index: number) => (\r\n }\r\n focused={0}\r\n />\r\n ))}\r\n
\r\n
\r\n ) : null}\r\n \r\n );\r\n };\r\n}\r\n\r\nexport default MfrmBaseFaqs;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IMfrmBaseFaqsViewProps } from './mfrm-base-faqs';\r\n\r\nexport default (props: IMfrmBaseFaqsViewProps) => {\r\n const { baseFaqsContent } = props;\r\n return {baseFaqsContent};\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['mfrm-base-faqs'] = {\n c: () => require('partner/modules/mfrm-base-faqs/mfrm-base-faqs.tsx'),\n $type: 'contentModule',\n da: [{name:'productSpecificationData', path:'@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-base-faqs',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-base-faqs'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|mfrm-base-faqs|mfrm-base-faqs'] = {\n c: () => require('partner/modules/mfrm-base-faqs/mfrm-base-faqs.view.tsx'),\n cn: '__local__-__local__-mfrm-base-faqs'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { AttributeValue, ProductsDataActions, SimpleProduct, StoreOperationsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport {\n getAttributeValuesByConfiguration,\n getSelectedProductIdFromActionInput,\n getSelectedVariant,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Chains getting the SelectedVariant with GetActivePrice.\n */\nexport class AttributesForSelectedVariantInput implements IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public catalogId: number;\n\n public selectedProduct: SimpleProduct | undefined;\n\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\n this.productId = productId;\n this.channelId = channelId;\n this.selectedProduct = selectedProduct;\n this.catalogId = catalogId || 0;\n }\n\n public getCacheKey = () => 'AttributesForSelectedVariant';\n\n public getCacheObjectType = () => 'ProductAttributeValue';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport const createAttributesForSelectedVariantInput = (\n inputData: ICreateActionContext>\n): AttributesForSelectedVariantInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n const catalogId = getCatalogId(inputData.requestContext);\n\n if (productId) {\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId, undefined, catalogId);\n }\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * Calls the Retail API a get a list of dimension values for a given product.\n * @param input - The input.\n * @param context - The context.\n * @returns The attribute values.\n */\nexport async function getAttributesForSelectedVariantAction(\n input: AttributesForSelectedVariantInput,\n context: IActionContext\n): Promise {\n return Promise.resolve()\n .then(() => {\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\n\n if (!activeProduct) {\n const selectedVariantInput = new SelectedVariantInput(\n input.productId,\n input.channelId,\n undefined,\n undefined,\n context.requestContext\n );\n\n return getSelectedVariant(selectedVariantInput, context);\n }\n\n return activeProduct;\n })\n .then((productResult: SimpleProduct | null) => {\n const activeProduct: SimpleProduct | undefined = productResult;\n\n if (activeProduct) {\n return ProductsDataActions.getAttributeValuesAsync(\n {\n callerContext: context\n },\n activeProduct.RecordId,\n input.channelId,\n input.catalogId\n );\n }\n\n return null;\n })\n .then(async (attributeValues: AttributeValue[] | null) => {\n const channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({\n callerContext: context\n });\n\n return { attributeValues, channelInventoryConfiguration };\n })\n .then(result => {\n return getAttributeValuesByConfiguration(result.attributeValues, result.channelInventoryConfiguration);\n })\n .catch((error: Error) => {\n context.trace(error.message);\n throw new Error('[getPriceForSelectedVariantAction]Error executing action');\n });\n}\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\n action: >getAttributesForSelectedVariantAction,\n input: createAttributesForSelectedVariantInput\n});\n","module.exports = React;","module.exports = ReactDOM;"],"names":["MfrmBaseFaqs","React","constructor","props","super","_showFAQAccordion","_result$find","faqHeader","this","config","faqAccordionContent","faqList","data","productSpecificationData","result","backendAttribute","isAdjsutableBaseProduct","find","obj","Name","toLowerCase","trim","TextValue","undefined","length","className","map","item","index","AccordionItem","key","title","faqQuestion","id","content","RichTextComponent","text","faqAnswer","focused","render","viewProps","_objectSpread","baseFaqsContent","renderView","Node","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","window","__bindings__","viewDictionary","cn","AttributesForSelectedVariantInput","productId","channelId","selectedProduct","catalogId","getCacheKey","getCacheObjectType","dataCacheType","createAttributesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","getCatalogId","requestContext","apiSettings","async","getAttributesForSelectedVariantAction","input","context","Promise","resolve","then","activeProduct","selectedVariantInput","SelectedVariantInput","getSelectedVariant","productResult","ProductsDataActions","callerContext","RecordId","attributeValues","channelInventoryConfiguration","StoreOperationsDataActions","getAttributeValuesByConfiguration","catch","error","trace","message","createObservableDataAction","action","module","exports","ReactDOM"],"sourceRoot":""}