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AAO,IAE/KC,KAAK,EACLC,GAAI,YACJC,EAAG,uBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,oCAOAnB,EAF4B,0EACXQ,EAAQ,KAQzBR,EAF4B,2BACXQ,EAAQ,MAMjCY,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAavB,QAAOwB,EAAAA,EAAA,GACpBF,OAAOC,aAAavB,SAAW,IAC/BD,EAAQC,SAGXsB,OAAOC,aAAatB,YAAWuB,EAAAA,EAAA,GAC5BF,OAAOC,aAAatB,aAAe,IACnCF,EAAQE,aAEY,MAAMwB,EAAiB,GAC9BA,EAAe,yEAA2E,CAClGhB,EAAGA,IAAMC,EAAQ,MACjBgB,GAAI,4CAEpBJ,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaE,eAAcD,EAAAA,EAAA,GACPF,OAAOC,aAAaE,gBAAkB,IACtCA,UC1F3BE,EAAOC,QAAUpD,cCAjBmD,EAAOC,QAAUC","sources":["webpack://henrys-ecommerce/./src/actions/get-product-info.ts?e5bc","webpack://henrys-ecommerce/./src/modules/hei-product-included/hei-product-included.tsx?3e43","webpack://henrys-ecommerce/./src/modules/hei-product-included/hei-product-included.view.tsx?f907","webpack://henrys-ecommerce/./lib/hei-product-included/module-registration.js?96ad","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b"],"sourcesContent":["import {\r\n createObservableDataAction,\r\n IAction,\r\n ICreateActionContext,\r\n IActionContext,\r\n CacheType,\r\n IActionInput\r\n} from '@msdyn365-commerce/core';\r\nimport { ProductsDataActions, retailAction } from '@msdyn365-commerce/retail-proxy';\r\nimport { getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IProductInfo } from './DataServiceEntities.g';\r\nimport { getProductInfoInput } from './DataActionExtension.g';\r\n\r\n/**\r\n * GetProductInfoInput\r\n */\r\nclass GetProductInfoInput implements IActionInput {\r\n public readonly productId: number;\r\n\r\n constructor(productId: number) {\r\n this.productId = productId;\r\n }\r\n\r\n public getCacheKey = () => `${this.productId}`;\r\n public getCacheObjectType = () => 'HEI-ProductInfo';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nasync function action(input: GetProductInfoInput, ctx: IActionContext): Promise {\r\n const product = await ProductsDataActions.getByIdAsync(\r\n { callerContext: ctx },\r\n input.productId,\r\n ctx.requestContext.apiSettings.channelId\r\n );\r\n\r\n let itemId = product?.ItemId;\r\n const newSkuInfo = product.ExtensionProperties?.find(ep => ep.Key === 'NewSku')?.Value?.StringValue;\r\n if (newSkuInfo) {\r\n const newProductSku = newSkuInfo.split(':')[1];\r\n if (newProductSku) {\r\n itemId = newProductSku;\r\n }\r\n }\r\n\r\n if (!itemId) {\r\n throw new Error('Unable to get product SKU');\r\n }\r\n\r\n const ProductInfoInput = getProductInfoInput(itemId);\r\n return retailAction(ProductInfoInput, ctx);\r\n}\r\n\r\n/**\r\n * Get Warranty Info Data Action\r\n */\r\nexport default createObservableDataAction({\r\n action: >action,\r\n input: (context: ICreateActionContext) => {\r\n const productId = getSelectedProductIdFromActionInput(context);\r\n if (productId) {\r\n return new GetProductInfoInput(+productId);\r\n } else {\r\n throw new Error('Unable to create GetProductInfoInput, no productId found on module config or query');\r\n }\r\n }\r\n});\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\n\r\nimport * as React from 'react';\r\n\r\nimport { IHeiProductIncludedData } from './hei-product-included.data';\r\nimport { IHeiProductIncludedProps } from './hei-product-included.props.autogenerated';\r\n\r\nexport interface IHeiProductIncludedViewProps extends IHeiProductIncludedProps {}\r\n\r\n/**\r\n *\r\n * HeiProductIncluded component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass HeiProductIncluded extends React.PureComponent> {\r\n public render(): JSX.Element | null {\r\n const {\r\n data: { productInfo }\r\n } = this.props;\r\n\r\n const html = productInfo.result?.IncludedHtml;\r\n if (!html) {\r\n return null;\r\n }\r\n\r\n return this.props.renderView(this.props);\r\n }\r\n}\r\n\r\nexport default HeiProductIncluded;\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\n\r\nimport * as React from 'react';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { IHeiProductIncludedViewProps } from './hei-product-included';\r\nimport InnerHTML from 'dangerously-set-html-content';\r\n\r\nexport default (props: IHeiProductIncludedViewProps) => {\r\n const {\r\n data: { productInfo, product },\r\n config: { heading },\r\n resources\r\n } = props;\r\n\r\n const html = productInfo.result?.IncludedHtml;\r\n\r\n if (!html) {\r\n return null;\r\n }\r\n\r\n const itemId = product?.result?.ItemId;\r\n const isUsedGood = itemId && (itemId.startsWith('Z') || itemId?.startsWith('U'));\r\n\r\n return (\r\n
\r\n {heading?.text && }\r\n {!isUsedGood && }\r\n {isUsedGood &&

{resources.usedGoodDisclaimer}

}\r\n
\r\n );\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['hei-product-included'] = {\n c: () => require('partner/modules/hei-product-included/hei-product-included.tsx'),\n $type: 'contentModule',\n da: [{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productInfo', path:'actions/get-product-info', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'hei-product-included',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/hei-product-included'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-product-info';\n let dataAction = require('partner/actions/get-product-info');\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|hei-product-included|hei-product-included'] = {\n c: () => require('partner/modules/hei-product-included/hei-product-included.view.tsx'),\n cn: '__local__-__local__-hei-product-included'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["GetProductInfoInput","constructor","productId","getCacheKey","this","getCacheObjectType","dataCacheType","createObservableDataAction","action","async","input","ctx","_product$ExtensionPro","product","ProductsDataActions","callerContext","requestContext","apiSettings","channelId","itemId","ItemId","newSkuInfo","ExtensionProperties","find","ep","Key","Value","StringValue","newProductSku","split","Error","ProductInfoInput","getProductInfoInput","retailAction","context","getSelectedProductIdFromActionInput","HeiProductIncluded","React","render","_productInfo$result","data","productInfo","props","result","IncludedHtml","renderView","_product$result","_heading$tag","config","heading","resources","html","isUsedGood","startsWith","className","text","Msdyn365","tag","InnerHTML","usedGoodDisclaimer","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","id","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","window","__bindings__","_objectSpread","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}