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,IAAAW,GAAdA,EAAgBxnB,YAAYumB,OC5GjC,SAASmB,EAA8Br5B,GAC1C,OAAO,IAAIs5B,EAAAA,aAAyC,UAAWt5B,EAAQ,+BDavE+2B,EAAAA,EAAAA,IAAA,CADCj8B,EAAAA,IAAM,+BAsDPi8B,EAAAA,EAAAA,IAAA,CADCj8B,EAAAA,IAAM,+BC9DX,MAIay+B,GAA6B3+B,EAAAA,EAAAA,IAA2B,CACjEE,OAA6C0+B,EAAAA,iBAC7Cx+B,MAN2CC,GACpCo+B,EAA8B,IAAInC,KAQ7C,WCxBAuC,EAAOC,QAAUp8B,cCAjBm8B,EAAOC,QAAUC","sources":["webpack://henrys-ecommerce/./src/actions/get-all-dimensions-for-product.ts?0098","webpack://henrys-ecommerce/./src/actions/get-product-promotions.action.ts?ea24","webpack://henrys-ecommerce/./src/common/radio-button-list/radio-button-list.tsx?9f8a","webpack://henrys-ecommerce/./src/common/buybox-product-configure.tsx?88cc","webpack://henrys-ecommerce/./src/common/createGoogleAnalyticsEvent.ts?b6fa","webpack://henrys-ecommerce/./src/common/pushGoogleAnalyticsEvent.tsx?9c4e","webpack://henrys-ecommerce/./src/common/sendGoogleAnalyticsEvent.ts?9ba5","webpack://henrys-ecommerce/./src/common/useGoogleAnalytics.tsx?0c00","webpack://henrys-ecommerce/./src/common/utilities/createCanonicalUrl.ts?7ccf","webpack://henrys-ecommerce/./src/common/utilities/productListExtensionHelpers.ts?5897","webpack://henrys-ecommerce/./src/modules/bazzarvoice-widget/bazzarvoice-widget.props.autogenerated.ts?6162","webpack://henrys-ecommerce/./src/modules/bazzarvoice-widget/components/Bazzarvoice.tsx?245f","webpack://henrys-ecommerce/./src/modules/hei-buybox/components/hei-buybox-find-in-store.tsx?c59e","webpack://henrys-ecommerce/./src/modules/hei-buybox/hei-buybox.tsx?dfcf","webpack://henrys-ecommerce/./src/modules/hei-buybox/hei-buybox.view.tsx?7e25","webpack://henrys-ecommerce/./src/modules/quickview/utilities/get-product-details.ts?0cc4","webpack://henrys-ecommerce/./src/modules/quickview/utilities/get-valid-product-images.ts?8145","webpack://henrys-ecommerce/./src/themes/henrys/views/components/AuthorizedDealerBadge.tsx?1105","webpack://henrys-ecommerce/./src/themes/henrys/views/components/MfrCode.tsx?bb8c","webpack://henrys-ecommerce/./src/themes/henrys/views/components/HideablePrice.tsx?c60a","webpack://henrys-ecommerce/./src/themes/henrys/views/components/ProductPromotions.tsx?7465","webpack://henrys-ecommerce/./src/themes/henrys/views/components/add-this-share.tsx?ff1a","webpack://henrys-ecommerce/./src/themes/henrys/views/components/WarrantySelection.tsx?0029","webpack://henrys-ecommerce/./src/themes/henrys/views/components/ProductWarranty.tsx?8b39","webpack://henrys-ecommerce/./src/themes/henrys/views/components/JsonLinkingData.tsx?8133","webpack://henrys-ecommerce/./src/themes/henrys/views/components/ProductBadge.tsx?d4d3","webpack://henrys-ecommerce/./src/themes/henrys/views/hei-buybox.view.tsx?471a","webpack://henrys-ecommerce/./lib/hei-buybox/module-registration.js?25c2","webpack://henrys-ecommerce/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://henrys-ecommerce/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://henrys-ecommerce/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b"],"sourcesContent":["import { createObservableDataAction, ICreateActionContext, IAction } from '@msdyn365-commerce/core';\r\nimport {\r\n IDimensionForSelectedVariant,\r\n getDimensionsForSelectedVariantAction,\r\n getSelectedProductIdFromActionInput,\r\n GetDimensionsForSelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nclass GetAllDimensionsForProductInput extends GetDimensionsForSelectedVariantInput {\r\n constructor(productId: number, channelId: number) {\r\n super(productId, channelId, []);\r\n }\r\n\r\n public getCacheObjectType = () => 'HEI-AllDimensionsForProduct';\r\n}\r\n\r\nconst createAllDimensionsForProductInput = (inputData: ICreateActionContext) => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n\r\n // process.env.NODE_ENV === 'development' &&\r\n // console.log('hei-get-all-dimensions-for-product', 'createAllDimensionsForProductInput', productId, inputData);\r\n\r\n if (productId) {\r\n return new GetAllDimensionsForProductInput(+productId, +inputData.requestContext.apiSettings.channelId);\r\n }\r\n\r\n throw new Error('Unable to create AllDimensionsForProductInput, no productId found on module config or query');\r\n};\r\n\r\nexport const getAllDimensionsForProductActionDataAction = createObservableDataAction({\r\n id: 'hei-get-all-dimensions-for-product',\r\n action: >getDimensionsForSelectedVariantAction,\r\n input: createAllDimensionsForProductInput\r\n});\r\n\r\nexport default getAllDimensionsForProductActionDataAction;\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 Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { retailAction } from '@msdyn365-commerce/retail-proxy';\r\nimport { IProductPromotion } from './DataServiceEntities.g';\r\nimport { getProductPromotionsInput } from './DataActionExtension.g';\r\n\r\n/**\r\n * GetProductPromotions Input Action\r\n */\r\nexport class GetProductPromotionsInput implements Msdyn365.IActionInput {\r\n public readonly recordId: number;\r\n public readonly distinctProductVariantId: number;\r\n\r\n constructor(recordId: number, distinctProductVariantId: number) {\r\n this.recordId = recordId;\r\n this.distinctProductVariantId = distinctProductVariantId;\r\n }\r\n\r\n public getCacheKey = () => `${this.recordId}`;\r\n public getCacheObjectType = () => 'HEI-ProductPromotions';\r\n //public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\nconst createInput = (context: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n const productId = getSelectedProductIdFromActionInput(context);\r\n if (productId) {\r\n return new GetProductPromotionsInput(+productId, +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\nasync function action(input: GetProductPromotionsInput, ctx: Msdyn365.IActionContext): Promise {\r\n var productPromotionsInput = getProductPromotionsInput({ Paging: { Top: 5 } }, input.recordId, input.distinctProductVariantId);\r\n return retailAction(productPromotionsInput, ctx);\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'hei-get-product-promotions',\r\n input: createInput\r\n // isBatched: true\r\n});\r\n","import { getPayloadObject, getTelemetryAttributes } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IDropdownItemProps, IDropdownProps, IDropdownOnSelectionChangeNotification } from '@msdyn365-commerce-modules/buybox';\r\nimport classnames from 'classnames';\r\n\r\nexport type IDropdownExtItemProps = IDropdownItemProps & { isValid?: boolean };\r\nexport type IDropdownExtOnSelectionChangeNotification = IDropdownOnSelectionChangeNotification & { isValid?: boolean };\r\n\r\nexport type IDropdownExtProps = Omit & {\r\n defaultFirstOption?: boolean;\r\n dropdownList: IDropdownExtItemProps[];\r\n onChange?(notification: IDropdownExtOnSelectionChangeNotification): Promise;\r\n};\r\n\r\nconst RadioButtonList = (props: IDropdownExtProps) => {\r\n const { telemetryContent, dropdownList, dropdownName, onChange, dropdownId, defaultFirstOption } = props;\r\n\r\n let selectedItem = dropdownList.find(item => item.isDefault);\r\n const [selectedId, setSelectedId] = React.useState(selectedItem?.id ?? '');\r\n\r\n const payLoad = React.useMemo(() => {\r\n return getPayloadObject('click', telemetryContent!, dropdownName);\r\n }, [telemetryContent, dropdownName]);\r\n\r\n const handleOnChange = React.useCallback(\r\n (item: IDropdownExtItemProps) => {\r\n setSelectedId(currentSelectedId => {\r\n if (currentSelectedId !== item.id) {\r\n if (onChange) {\r\n process.env.NODE_ENV === 'development' && console.log('RadioButtonList', 'handleOnChange', currentSelectedId, item);\r\n\r\n void onChange({\r\n dropdownId: dropdownId,\r\n isValid: item.isValid,\r\n selectId: item.id,\r\n selectedValue: item.value\r\n });\r\n }\r\n\r\n return item.id;\r\n }\r\n\r\n return currentSelectedId;\r\n });\r\n },\r\n [onChange, dropdownId, setSelectedId]\r\n );\r\n\r\n if (!selectedItem && defaultFirstOption) {\r\n selectedItem = dropdownList.find(i => i.isValid);\r\n process.env.NODE_ENV === 'development' && console.log('RadioButtonList', 'defaultFirstOption', selectedItem);\r\n }\r\n\r\n React.useEffect(() => {\r\n if (selectedItem && !selectedItem.isDefault) {\r\n void handleOnChange({\r\n id: selectedItem.id,\r\n isValid: selectedItem.isValid || false,\r\n value: selectedItem.value\r\n });\r\n }\r\n }, [selectedItem]);\r\n\r\n if (dropdownList.length === 0 && console?.warn) {\r\n console.warn(`No option for ${dropdownName}`);\r\n }\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n return (\r\n
\r\n {dropdownList.map(item => (\r\n \r\n handleOnChange(item)}\r\n />\r\n {item.value}\r\n \r\n ))}\r\n
\r\n );\r\n};\r\n\r\nexport { RadioButtonList };\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 { ICoreContext } from '@msdyn365-commerce/core-internal';\r\nimport { ProductDimension, ProductDimensionType } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n convertProductDimensionTypeToDimensionTypes,\r\n DimensionTypes,\r\n getDimensionValuesFromQuery,\r\n getInventoryLevelCodeFromDimensionValue,\r\n IDimensionForSelectedVariant,\r\n IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n ObjectExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxCommonResources,\r\n IBuyboxExtentedProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxState,\r\n IProductDetails\r\n} from '@msdyn365-commerce-modules/buybox';\r\n// eslint-disable-next-line no-duplicate-imports\r\nimport { Dropdown, IDropdownItemProps, IDropdownOnSelectionChangeNotification, SelectionType } from '@msdyn365-commerce-modules/buybox';\r\nimport { RadioButtonList, IDropdownExtOnSelectionChangeNotification } from './radio-button-list';\r\n\r\nlet telemetryContent: ITelemetryContent;\r\n\r\n/**\r\n * Dimension pre-processing info.\r\n */\r\ninterface IProductDimensionInfo {\r\n dropdownName: string;\r\n dropdownId: string;\r\n dropdownList: IDropdownItemProps[];\r\n}\r\n\r\n/**\r\n * Props for rendering a dropdown.\r\n */\r\ninterface IProductDimensionDropdownProps extends IProductDimensionInfo {\r\n resources: IBuyboxCommonResources;\r\n className: string;\r\n context: ICoreContext;\r\n\r\n configureErrors: { [configureId: string]: string | undefined };\r\n\r\n getDropdownName(dimensionType: number, resources: IBuyboxCommonResources): string;\r\n dropdownCallback(notification: IDropdownOnSelectionChangeNotification): Promise;\r\n\r\n defaultFirstOption: boolean;\r\n}\r\n\r\nconst mapProductDimensionFullToDropdownViewProps = (props: IProductDimensionDropdownProps): IBuyboxProductConfigureDropdownViewProps => {\r\n const dimensionId = Number.parseInt(props.dropdownId, 10) as ProductDimensionType;\r\n const dropdownToggleName = format(props.resources.selectDimensionFormatString, props.dropdownName);\r\n\r\n const errorMessage = props.configureErrors[props.dropdownId];\r\n\r\n let dimensionSelectionType = SelectionType.dropdown;\r\n\r\n const dimensionType = convertProductDimensionTypeToDimensionTypes(dimensionId);\r\n\r\n const dimensionsAsSwatchConfiguration = props.context.app.config.dimensionsAsSwatchType;\r\n if (\r\n ArrayExtensions.hasElements(dimensionsAsSwatchConfiguration) &&\r\n !dimensionsAsSwatchConfiguration.includes(DimensionTypes.none) &&\r\n dimensionsAsSwatchConfiguration.includes(dimensionType)\r\n ) {\r\n dimensionSelectionType = SelectionType.swatch;\r\n }\r\n\r\n const isHidden =\r\n props.defaultFirstOption &&\r\n dimensionType === DimensionTypes.size &&\r\n props.dropdownList.length === 1 &&\r\n props.dropdownList[0].value?.toLocaleLowerCase() === 'n/a';\r\n const hiddenClass = isHidden ? 'd-none' : '';\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${props.className}__dropdown ${hiddenClass}`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${props.className}__dropdown-quantity-label`,\r\n htmlFor: `${props.className}__dropown-quantity-input-${props.dropdownId}`\r\n },\r\n errors: errorMessage && (\r\n \r\n \r\n ),\r\n heading:
{props.dropdownName}
,\r\n select:\r\n dimensionSelectionType === SelectionType.swatch ? (\r\n \r\n ) : (\r\n \r\n )\r\n };\r\n};\r\n\r\nexport function getBuyboxProductConfigure(\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n productDetails?: IProductDetails,\r\n selectedDimensions?: ProductDimension[],\r\n defaultFirstOption?: boolean,\r\n allDimensions?: IDimensionForSelectedVariant[] | null\r\n): IBuyboxProductConfigureViewProps | undefined {\r\n const { resources, typeName } = props;\r\n\r\n const {\r\n errorState: { configureErrors }\r\n } = state;\r\n\r\n const { getDropdownName } = callbacks;\r\n\r\n const context = props.context as ICoreContext;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const product = props.data.product?.result ? props.data.product.result : productDetails?.product;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const productDimensionsData = props.data.productDimensions?.result ?? productDetails?.productDimensions;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\r\n const enableStockCheck = props.context.app.config.enableStockCheck;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensionsData);\r\n\r\n if (!product || !hasProductDimensions) {\r\n return undefined;\r\n }\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n telemetryContent = getTelemetryObject(context.request.telemetryPageName!, props.typeName, props.telemetry);\r\n\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n\r\n let dimensionsInfo: IProductDimensionInfo[] = [];\r\n\r\n const productDimensions = allDimensions || (productDimensionsData as IDimensionForSelectedVariant[]);\r\n\r\n const onChanged = async (notification: IDropdownExtOnSelectionChangeNotification) => {\r\n // user selected an options that's not available with other selected options\r\n const otherDimensions: { [id: number]: string } = {};\r\n if (!notification.isValid) {\r\n process.env.NODE_ENV === 'development' && console.log('buybox-product-configure', 'invalid option selected', notification);\r\n const productDimension = productDimensions.find(pd => pd.DimensionTypeValue.toString() === notification.dropdownId);\r\n const dimensionValuesWithInventory = productDimension!.dimensionValuesWithInventory!.find(\r\n dv => dv.DimensionValue?.Value === notification.selectedValue\r\n );\r\n\r\n if (dimensionValuesWithInventory) {\r\n const targetProductId = dimensionValuesWithInventory.ProductIds![0];\r\n\r\n for (const productDimensionFull of productDimensions) {\r\n if (productDimensionFull.DimensionTypeValue.toString() !== notification.dropdownId) {\r\n for (const dv of productDimensionFull.dimensionValuesWithInventory || []) {\r\n if (dv.ProductIds?.find(id => id === targetProductId)) {\r\n process.env.NODE_ENV === 'development' &&\r\n console.log('buybox-product-configure', 'update option', dv.DimensionValue?.Value?.toString());\r\n\r\n otherDimensions[dv.DimensionTypeValue!] = dv.DimensionValue!.RecordId.toString();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n await _onChanged(notification, callbacks.dimensionSelectedAsync, otherDimensions);\r\n };\r\n\r\n const matchedDimensions = selectedDimensions ?? getDimensionValuesFromQuery(context.request.url.requestUrl);\r\n\r\n const validDimensionIds = {};\r\n for (const productDimensionFull of productDimensions) {\r\n const selectedOtherDimensions = matchedDimensions.filter(md => md.DimensionTypeValue !== productDimensionFull.DimensionTypeValue);\r\n\r\n const dimensionValuesWithInventory = productDimensionFull.dimensionValuesWithInventory;\r\n if (dimensionValuesWithInventory) {\r\n for (const dv of dimensionValuesWithInventory) {\r\n let matchFound = selectedOtherDimensions.length === 0; // allow any option when none is selected\r\n if (!matchFound) {\r\n const productIds = dv.ProductIds || [];\r\n for (const productId of productIds) {\r\n if (!matchFound) {\r\n for (const currentDimension of selectedOtherDimensions) {\r\n if (!matchFound) {\r\n const currentDimensionInv =\r\n productDimensions.find(pd => pd.DimensionTypeValue === currentDimension.DimensionTypeValue)\r\n ?.dimensionValuesWithInventory || [];\r\n const cdi = currentDimensionInv.find(\r\n v =>\r\n v.DimensionValue?.Value?.toLowerCase() === currentDimension.DimensionValue?.Value?.toLowerCase()\r\n );\r\n\r\n if ((cdi?.ProductIds || []).find(val => val === productId)) {\r\n matchFound = true;\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (matchFound && dv.DimensionValue) {\r\n validDimensionIds[dv.DimensionValue.RecordId] = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n dimensionsInfo = productDimensions.map(productDimensionFull => {\r\n const dropdownName = getDropdownName(productDimensionFull.DimensionTypeValue, resources);\r\n const dropdownId = productDimensionFull.DimensionTypeValue.toString();\r\n\r\n const dimensions = (productDimensionFull.dimensionValuesWithInventory ??\r\n productDimensionFull.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n const validProductDimensionsFull = dimensions.filter(\r\n value => !ObjectExtensions.isNullOrUndefined(value.DimensionValue?.RecordId ?? value.RecordId)\r\n );\r\n\r\n const dropdownList: IDropdownItemProps[] = validProductDimensionsFull.map(dimensionValuesWithInventory => {\r\n const dimensionValue = dimensionValuesWithInventory.DimensionValue ?? dimensionValuesWithInventory;\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(dimensionValuesWithInventory, inventoryLevel);\r\n\r\n const isValid = !!validDimensionIds[dimensionValue.RecordId];\r\n const item = {\r\n value: dimensionValue.Value ?? '',\r\n id: dimensionValue.RecordId.toString(),\r\n colorHexCode: dimensionValue.ColorHexCode,\r\n imageUrl: dimensionValue.ImageUrl,\r\n isValid: isValid,\r\n isDisabled: enableStockCheck && inventoryLevelCode === InventoryLevelValues.outOfStock\r\n };\r\n\r\n process.env.NODE_ENV === 'development' && !isValid && console.log('buybox-product-configure', 'dropdownList', item);\r\n\r\n return item;\r\n });\r\n\r\n return {\r\n dropdownName,\r\n dropdownId,\r\n dropdownList\r\n };\r\n });\r\n\r\n for (const dimensionInfo of dimensionsInfo) {\r\n const currentDimensionsFromQuery = matchedDimensions.filter(\r\n dimensionFromQuery => dimensionFromQuery.DimensionTypeValue.toString() === dimensionInfo.dropdownId\r\n );\r\n if (!ArrayExtensions.hasElements(currentDimensionsFromQuery)) {\r\n continue;\r\n }\r\n const currentDimensionFromQuery = currentDimensionsFromQuery[0];\r\n const selectedDimensionItem = dimensionInfo.dropdownList.filter(\r\n dimensionItem =>\r\n dimensionItem.value.toLocaleLowerCase() === currentDimensionFromQuery.DimensionValue?.Value?.toLocaleLowerCase()\r\n );\r\n if (!ArrayExtensions.hasElements(selectedDimensionItem)) {\r\n continue;\r\n }\r\n selectedDimensionItem[0].isDefault = true;\r\n }\r\n\r\n const dropdowns: IBuyboxProductConfigureDropdownViewProps[] = dimensionsInfo.map(dimensionInfo => {\r\n return mapProductDimensionFullToDropdownViewProps({\r\n ...dimensionInfo,\r\n resources,\r\n configureErrors,\r\n getDropdownName,\r\n dropdownCallback: onChanged,\r\n defaultFirstOption: defaultFirstOption || false,\r\n className,\r\n context\r\n });\r\n });\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__configure`\r\n },\r\n dropdowns\r\n };\r\n}\r\n\r\nconst _onChanged = async (\r\n notification: IDropdownOnSelectionChangeNotification,\r\n dimensionChanged: (newValue: number, selectedDimensionValue: string, otherDimensions?: { [id: number]: string }) => Promise,\r\n otherDimensions?: { [id: number]: string }\r\n): Promise => {\r\n await dimensionChanged(+notification.dropdownId, notification.selectId, otherDimensions);\r\n};\r\n\r\nconst _getClassNamePrefix = (typeName: string): string => {\r\n return typeName.toLocaleLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\r\n};\r\n","import { CacheType, getCatalogId, IActionContext, IActionInput, ICommerceApiSettings, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { Cart, CategoryPathLookup } from '@msdyn365-commerce/retail-proxy';\r\nimport { GaEvent, GaItem, GaPayload } from './pushGoogleAnalyticsEvent';\r\nimport { getProductDetails } from '../modules/quickview/utilities';\r\n\r\nexport const buildCacheKey = (base: string, apiSettings: ICommerceApiSettings, locale?: string): string => {\r\n return `${base}-chanId:${apiSettings.channelId}-catId:${apiSettings.catalogId}${locale ? `-${locale}` : ''}`;\r\n};\r\n\r\n/**\r\n * Category path input.\r\n */\r\nexport class GetCategoryPathsInput implements IActionInput {\r\n public readonly ChannelId: number;\r\n\r\n public readonly CatalogId: number;\r\n\r\n public readonly categoryPathLooksups: CategoryPathLookup[];\r\n\r\n public readonly apiSettings: ICommerceApiSettings;\r\n\r\n private readonly locale: string;\r\n\r\n private constructedCacheKey: string;\r\n\r\n public constructor(context: IRequestContext, categoryPathLooksups: CategoryPathLookup[]) {\r\n this.ChannelId = context.apiSettings.channelId;\r\n this.CatalogId = getCatalogId(context);\r\n this.categoryPathLooksups = categoryPathLooksups;\r\n this.apiSettings = context.apiSettings;\r\n this.constructedCacheKey = '';\r\n categoryPathLooksups.forEach(categoryPath => {\r\n this.constructedCacheKey += `${categoryPath.ProductId && categoryPath.ProductId.toString()}|`;\r\n });\r\n this.constructedCacheKey += `${this.ChannelId.toString()}|`;\r\n this.constructedCacheKey += `${this.CatalogId.toString()}|`;\r\n this.locale = context.locale;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey(this.constructedCacheKey, this.apiSettings, this.locale);\r\n\r\n public getCacheObjectType = () => 'CategoryPath';\r\n\r\n public dataCacheType = (): CacheType => 'request';\r\n\r\n /**\r\n * Retrieves locale to use for the current API call.\r\n * @returns A string which represents locale.\r\n */\r\n public getLocale = (): string => this.locale;\r\n}\r\n\r\nconst createGoogleAnalyticsEvent = async (cart: Readonly, eventName: GaEvent, actionContext: IActionContext): Promise => {\r\n var channelId = actionContext.requestContext.channel?.RecordId;\r\n\r\n const items: GaItem[] = [];\r\n\r\n if (channelId && cart.CartLines) {\r\n let i = 0;\r\n for (const cartLine of cart.CartLines) {\r\n if (cartLine.ProductId) {\r\n const productDetails = await getProductDetails(cartLine.ProductId, channelId, actionContext);\r\n\r\n const product = productDetails.product;\r\n const variant = product?.Dimensions?.map(d => d.DimensionValue?.Value).join(',');\r\n\r\n process.env.NODE_ENV === 'development' &&\r\n console.log('createGoogleAnalyticsEvent', cartLine.ProductId, JSON.parse(JSON.stringify(product)));\r\n\r\n const discount = (cartLine.DiscountLines ?? []).reduce((a, b) => a + (b.Amount ?? 0), 0);\r\n\r\n var brand = product?.ExtensionProperties?.find(ep => ep.Key === 'Brand')?.Value?.StringValue;\r\n\r\n var item = {\r\n recId: cartLine.ProductId,\r\n item_id: product?.ProductNumber || product?.ItemId || cartLine.ItemId || '',\r\n item_name: product?.Name ?? '',\r\n index: i,\r\n item_variant: variant,\r\n price: (product?.Price ?? cartLine.Price ?? 0) - discount,\r\n discount: discount,\r\n pid: product?.ItemId || cartLine.ItemId || '',\r\n item_brand: brand,\r\n quantity: cartLine.Quantity ?? 0\r\n };\r\n\r\n items.push(item);\r\n }\r\n\r\n i++;\r\n }\r\n }\r\n\r\n const total = items.reduce((a, b) => a + (b.price ?? 0) * b.quantity, 0);\r\n\r\n return {\r\n event: eventName,\r\n ecommerce: {\r\n currency: 'CAD',\r\n value: total,\r\n items: items\r\n }\r\n };\r\n};\r\n\r\nexport { createGoogleAnalyticsEvent };\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { GetCategoryPathsInput } from './createGoogleAnalyticsEvent';\r\nimport { getCategoryPaths } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nexport type GaDataLayer = {\r\n push: (payload: GaPayload) => void;\r\n};\r\n\r\nexport type GaItem = {\r\n item_id: string;\r\n item_name: string;\r\n affiliation?: string;\r\n coupon?: string;\r\n discount?: number;\r\n index: number;\r\n item_brand?: string;\r\n item_category?: string;\r\n item_category2?: string;\r\n item_category3?: string;\r\n item_category4?: string;\r\n item_category5?: string;\r\n item_list_id?: string;\r\n item_list_name?: string;\r\n item_variant?: string;\r\n location_id?: string;\r\n price: number;\r\n quantity: number;\r\n pid?: string;\r\n recId?: number;\r\n};\r\n\r\nexport type GaEvent =\r\n | 'view_item'\r\n | 'view_cart'\r\n | 'purchase'\r\n | 'begin_checkout'\r\n | 'add_to_cart'\r\n | 'add_to_wishlist'\r\n | 'remove_from_cart'\r\n | 'add_shipping_info'\r\n | 'add_payment_info';\r\n\r\nexport type GaPayload = {\r\n event?: GaEvent;\r\n ecommerce?: {\r\n transaction_id?: string;\r\n currency?: string;\r\n value: number;\r\n tax?: number;\r\n shipping?: number;\r\n shipping_tier?: string;\r\n payment_type?: string;\r\n coupon?: string;\r\n items?: GaItem[];\r\n } | null;\r\n};\r\n\r\nexport const pushGoogleAnalyticsEvent = async (payload?: GaPayload, actionContext?: IActionContext) => {\r\n const dataLayer = typeof window !== 'undefined' && (window['dataLayer'] as GaDataLayer);\r\n if (dataLayer) {\r\n process.env.NODE_ENV === 'development' && console.log('pushGoogleAnalyticsEvent', payload);\r\n dataLayer.push({ ecommerce: null });\r\n if (payload) {\r\n for (const gaItem of payload?.ecommerce?.items ?? []) {\r\n if (gaItem.recId) {\r\n if (actionContext) {\r\n const categoryPaths = await getCategoryPaths(\r\n new GetCategoryPathsInput(actionContext.requestContext, [{ ProductId: +gaItem.recId }]),\r\n actionContext\r\n );\r\n\r\n if (categoryPaths.length > 0) {\r\n gaItem.item_category = categoryPaths[0].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 1) {\r\n gaItem.item_category2 = categoryPaths[1].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 2) {\r\n gaItem.item_category3 = categoryPaths[2].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 3) {\r\n gaItem.item_category4 = categoryPaths[3].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 4) {\r\n gaItem.item_category5 = categoryPaths[4].Name ?? undefined;\r\n }\r\n }\r\n\r\n delete gaItem.recId;\r\n }\r\n }\r\n\r\n dataLayer.push(payload);\r\n }\r\n }\r\n};\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { GaItem, pushGoogleAnalyticsEvent } from './pushGoogleAnalyticsEvent';\r\nimport { OrgUnitLocation, ProductsDataActions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\ninterface IAddCartLine {\r\n product: SimpleProduct;\r\n count?: number;\r\n location?: OrgUnitLocation;\r\n additionalProperties?: object;\r\n availableQuantity?: number;\r\n enableStockCheck?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPrice?: number;\r\n deliveryMode?: string;\r\n catalogId?: number;\r\n shouldSkipSiteSettings?: boolean;\r\n}\r\n\r\nexport const sendGoogleAnalyticsEvent = async (products: IAddCartLine[], actionContext: IActionContext) => {\r\n try {\r\n const apiSettings = actionContext.requestContext.apiSettings;\r\n const gaItems: GaItem[] = [];\r\n\r\n const prices = await ProductsDataActions.getActivePricesAsync(\r\n { callerContext: actionContext },\r\n {\r\n ChannelId: apiSettings.channelId,\r\n CatalogId: apiSettings.catalogId\r\n },\r\n products.map(p => p.product.RecordId),\r\n new Date(),\r\n null,\r\n null,\r\n true,\r\n null,\r\n true\r\n );\r\n\r\n for (const p of products) {\r\n const product = p.product;\r\n const variant = product.Dimensions?.map(d => d.DimensionValue?.Value).join(',');\r\n const brandFromExt = product?.ExtensionProperties?.find(p => p.Key === 'Brand')?.Value?.StringValue;\r\n\r\n const productPrice = prices.find(price => price.ProductId === p.product.RecordId);\r\n\r\n const discount = (productPrice?.DiscountLines ?? []).reduce((a, b) => a + ((b.EffectiveAmount || b.Amount) ?? 0), 0);\r\n\r\n gaItems.push({\r\n recId: product.RecordId,\r\n item_id: product.ProductNumber || product.ItemId || '',\r\n item_name: product.Name ?? '',\r\n index: gaItems.length,\r\n item_variant: variant,\r\n price: product.Price - discount,\r\n discount: discount,\r\n pid: product.ItemId || '',\r\n item_brand: brandFromExt ?? undefined,\r\n quantity: p.count ?? 0\r\n });\r\n }\r\n\r\n const totalValue = gaItems.reduce((a, b) => a + (b.price ?? 0) * b.quantity, 0);\r\n\r\n await pushGoogleAnalyticsEvent(\r\n {\r\n event: 'add_to_cart',\r\n ecommerce: {\r\n currency: 'CAD',\r\n value: totalValue,\r\n items: gaItems\r\n }\r\n },\r\n actionContext\r\n );\r\n } catch (err) {\r\n console.error(err);\r\n }\r\n};\r\n","import * as React from 'react';\r\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\r\nimport { GaPayload, pushGoogleAnalyticsEvent } from './pushGoogleAnalyticsEvent';\r\n\r\nlet lastCached = '';\r\n\r\nconst useGoogleAnalytics = (payload?: GaPayload, actionContext?: IActionContext, deps?: React.DependencyList | undefined) => {\r\n const isBrowser = MsDyn365.isBrowser;\r\n\r\n const cacheKey = React.useMemo(() => {\r\n if (payload?.event === 'view_item' && payload.ecommerce?.items) {\r\n return payload.ecommerce?.items[0]?.item_id;\r\n } else if (payload?.event === 'purchase') {\r\n return payload.ecommerce?.transaction_id;\r\n } else if (payload?.event === 'begin_checkout' && payload.ecommerce?.items) {\r\n return payload.ecommerce?.items.map(i => i.item_id).join(',');\r\n }\r\n\r\n return '';\r\n }, [payload]);\r\n\r\n if (cacheKey) {\r\n // skip if the event is unrecognized\r\n lastCached = cacheKey;\r\n }\r\n\r\n process.env.NODE_ENV === 'development' && console.log('useGoogleAnalytics', 'cacheKey', cacheKey);\r\n\r\n React.useEffect(() => {\r\n if (isBrowser) {\r\n void pushGoogleAnalyticsEvent(payload, actionContext);\r\n }\r\n }, [isBrowser, cacheKey || lastCached, ...(deps ?? [])]);\r\n};\r\n\r\nexport { useGoogleAnalytics };\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\n\r\nexport const createCanonicalUrl = (context: IActionContext, paths: string[], page: string) => {\r\n const canonicalDomain = context.requestContext.canonicalDomain;\r\n const sitePath = context.requestContext.sitePath ?? '';\r\n\r\n const url = `https://${canonicalDomain}${sitePath}/${paths\r\n .map(p => toSlug(p))\r\n .filter(s => s.length > 0)\r\n .join('/')}/${page}`;\r\n return url;\r\n};\r\n\r\nconst toSlug = (text: string) => {\r\n const slug = text\r\n .toLowerCase()\r\n .replace(/[^A-Za-z\\u00C0-\\u017F0-9]/g, '-')\r\n .replace(/--+/g, '-')\r\n .replace(/^-/, '')\r\n .replace(/-$/, '');\r\n\r\n return slug;\r\n};\r\n","import { AttributeValue, CommerceProperty, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport enum ProductStockStatusEnum {\r\n OUT_OF_STOCK,\r\n IN_STORE,\r\n ONLINE\r\n}\r\n\r\nexport interface IProductBadgeStatus {\r\n url: string;\r\n badgeName: string;\r\n}\r\n\r\n/**\r\n * Retrieves attribute from attribute list given the name of the attribute\r\n * @param attributes attribute list\r\n * @param attributeName name of the attribute to find\r\n */\r\nexport const findAttribute = (attributes: AttributeValue[] | undefined, attributeName: string): AttributeValue | undefined => {\r\n if (!attributes) {\r\n return undefined;\r\n }\r\n return attributes.find(attr => attr.Name?.toLowerCase() === attributeName.toLowerCase());\r\n};\r\n\r\nexport const findAllAttributes = (attributes: AttributeValue[] | undefined, attributeName: string): AttributeValue[] => {\r\n if (!attributes) {\r\n return [];\r\n }\r\n return attributes.filter(attr => attr.Name?.toLowerCase() === attributeName.toLowerCase());\r\n};\r\n\r\n/**\r\n * Gets value of given attribute based on its DataTypeValue enum.\r\n * @param attribute attribute to retrieve value from\r\n */\r\nexport const findAttributeValue = (attribute: AttributeValue): string | Date | number | boolean | undefined => {\r\n switch (attribute.DataTypeValue) {\r\n case 1:\r\n return attribute.CurrencyCode;\r\n case 2:\r\n return attribute.DateTimeOffsetValue;\r\n case 3:\r\n return attribute.FloatValue;\r\n case 4:\r\n return attribute.IntegerValue;\r\n case 5:\r\n return attribute.TextValue;\r\n case 6:\r\n return attribute.BooleanValue;\r\n default:\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Builds URL to the product badge\r\n * @param locale current locale\r\n * @param badgeName name of the badge\r\n * @param baseUrl base url for images\r\n */\r\nexport const buildProductBadgeUrl = (locale: string, badgeName: string, baseUrl: string, suffix?: string): string => {\r\n return `${baseUrl}Catalogs/${locale}/${badgeName.toLowerCase().replace(/ /g, '_')}_${locale}${suffix || ''}.png`;\r\n};\r\n\r\n/**\r\n * Gets the correct product badge status from the product\r\n * @param product Product to get the badge for\r\n * @param locale current locale\r\n * @param baseUrl image base url\r\n * @returns product badge url\r\n */\r\nexport const getProductBadgeUrl = (\r\n product: ProductSearchResult,\r\n locale: string,\r\n baseUrl: string,\r\n suffix?: string\r\n): IProductBadgeStatus | null => {\r\n const badgeAttributeArray = findAllAttributes(product.AttributeValues, 'Product Badge Status');\r\n let badgeStatus: IProductBadgeStatus | null = null;\r\n if (badgeAttributeArray) {\r\n badgeAttributeArray.forEach(attr => {\r\n const badgeValue = findAttributeValue(attr);\r\n if (badgeValue && typeof badgeValue === 'string' && badgeValue.toLowerCase() !== 'none') {\r\n badgeStatus = { url: buildProductBadgeUrl(locale, badgeValue, baseUrl, suffix), badgeName: badgeValue.replace(/_/, ' ') };\r\n }\r\n });\r\n }\r\n if (badgeStatus) {\r\n return badgeStatus;\r\n } else if (product.BasePrice && product.Price !== product.BasePrice) {\r\n return { url: buildProductBadgeUrl(locale, 'on_sale', baseUrl, suffix), badgeName: 'On Sale' };\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * gets product stock status value from extension properties\r\n * @param extensionProperties extension properties from product\r\n */\r\nexport const getProductStockStatus = (extensionProperties: CommerceProperty[]): ProductStockStatusEnum => {\r\n if (extensionProperties?.length) {\r\n const availableProperty = extensionProperties.find(xt => xt.Key === 'AvailabilityStatus');\r\n if (availableProperty && availableProperty.Value && availableProperty.Value.IntegerValue) {\r\n return availableProperty.Value.IntegerValue;\r\n }\r\n }\r\n return ProductStockStatusEnum.OUT_OF_STOCK;\r\n};\r\n\r\nexport const renderProductBadge = (request: Msdyn365.IRequestContext, badgeStatus: string, suffix: string) => {\r\n try {\r\n process.env.NODE_ENV === 'development' && console.log('renderProductBadge', badgeStatus, suffix);\r\n const mainImage = document?.querySelectorAll('.ms-buybox__media-gallery .msc-carousel__inner')[0];\r\n if (mainImage) {\r\n const currentBadge = mainImage.querySelector('.hei-badge');\r\n if (!currentBadge) {\r\n const badgeUrl = buildProductBadgeUrl(request.locale, badgeStatus, request.apiSettings.baseImageUrl, suffix);\r\n\r\n const badgeImage = document.createElement('img');\r\n badgeImage.src = badgeUrl;\r\n badgeImage.classList.add('msc-product__badge');\r\n badgeImage.classList.add('msc-product__badge--detail');\r\n badgeImage.classList.add('hei-badge');\r\n badgeImage.alt = badgeStatus;\r\n mainImage.appendChild(badgeImage);\r\n }\r\n\r\n return true;\r\n }\r\n } catch {\r\n return false;\r\n }\r\n\r\n return false;\r\n};\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IBazzarvoiceWidget contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum widgetType {\r\n reviews = 'reviews',\r\n questions = 'questions',\r\n rating_summary = 'rating_summary',\r\n inline_rating = 'inline_rating'\r\n}\r\n\r\nexport interface IBazzarvoiceWidgetConfig extends Msdyn365.IModuleConfig {\r\n widgetType?: widgetType;\r\n}\r\n\r\nexport interface IBazzarvoiceWidgetResources {}\r\n\r\nexport interface IBazzarvoiceWidgetProps extends Msdyn365.IModule {\r\n resources: IBazzarvoiceWidgetResources;\r\n config: IBazzarvoiceWidgetConfig;\r\n}\r\n","import * as React from 'react';\r\nimport { widgetType as WidgetType } from '../bazzarvoice-widget.props.autogenerated';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport classnames from 'classnames';\r\n\r\ntype BazzarvoiceProps = {\r\n itemId?: string;\r\n widgetType?: WidgetType;\r\n className?: string;\r\n disableSeo?: boolean;\r\n};\r\n\r\nconst Bazzarvoice = (props: BazzarvoiceProps) => {\r\n const { itemId, widgetType, className, disableSeo } = props;\r\n const divRef = React.useRef(null);\r\n const [initialized, setInitialized] = React.useState(false);\r\n\r\n const isBrowser = MsDyn365.isBrowser;\r\n React.useEffect(() => {\r\n const div = divRef.current;\r\n if (!initialized && isBrowser && div && itemId && widgetType) {\r\n setInitialized(true);\r\n\r\n div.innerHTML = `
`;\r\n }\r\n }, [isBrowser, initialized, itemId, widgetType, disableSeo, divRef]);\r\n\r\n return (\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Bazzarvoice;\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\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n AddToCartBehavior,\r\n IAddToCartFailureResult,\r\n IAddToCartResources,\r\n ItemSuccessfullyAddedToCartNotification,\r\n PriceComponent\r\n} from '@msdyn365-commerce/components';\r\nimport { getUrlSync, ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport {\r\n DeliveryOption,\r\n FeatureState,\r\n OrgUnitLocation,\r\n ProductAvailableQuantity,\r\n ProductDimension,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport {\r\n ArrayExtensions,\r\n DeliveryMode,\r\n IProductInventoryInformation,\r\n isAggregatedInventory\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getTelemetryObject, Heading, INodeProps, IPopupProps, Popup } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { BuyboxErrorBlock } from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxCallbacks, IBuyboxState } from '@msdyn365-commerce-modules/buybox';\r\nimport { getConfigureErrors, getGenericError } from '@msdyn365-commerce-modules/buybox';\r\nimport { IHeiBuyboxData } from '../hei-buybox.data';\r\nimport { IHeiBuyboxProps, IHeiBuyboxResources } from '../hei-buybox.props.autogenerated';\r\nimport { ICustomWindow } from '../../../common/utilities/helpers';\r\nimport { sendGoogleAnalyticsEvent } from '../../../common/sendGoogleAnalyticsEvent';\r\n\r\nconst modalCloseButtonReference: React.RefObject = React.createRef();\r\n\r\n/**\r\n * FindinStore failure Interface.\r\n */\r\nexport interface IFindInStoreFailureResult {\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\ninterface IAddCartLine {\r\n product: SimpleProduct;\r\n count?: number;\r\n location?: OrgUnitLocation;\r\n additionalProperties?: object;\r\n availableQuantity?: number;\r\n enableStockCheck?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPrice?: number;\r\n deliveryMode?: string;\r\n shouldSkipSiteSettings?: boolean;\r\n}\r\n\r\n/**\r\n * BuyBoxFindinStore View Props Interface.\r\n */\r\nexport interface IBuyboxFindInStoreViewProps {\r\n storeSelector?: React.ReactNode;\r\n heading?: React.ReactNode;\r\n description?: React.ReactNode;\r\n errors?: React.ReactNode;\r\n button?: React.ReactNode;\r\n productPickupOptionList?: React.ReactNode;\r\n\r\n modal?: React.ReactNode;\r\n\r\n ContainerProps: INodeProps;\r\n\r\n openFindInStoreDialog(): Promise;\r\n}\r\n\r\n/**\r\n * On click find store handler.\r\n * @param props -Buybox data.\r\n * @param state -Buybox state.\r\n * @param callbacks -Buybox callbacks.\r\n * @returns Find in store.\r\n */\r\nconst onClickFindInStoreHandler = (\r\n props: IHeiBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n) => async () => {\r\n await findInStoreOnClick(props, state, callbacks);\r\n};\r\n\r\n/**\r\n * Inventory settings based on the inventory policy for aggregated availability.\r\n */\r\ninterface IInventorySettingsProps {\r\n isSectionDisabled: boolean;\r\n description: string;\r\n buttonText: string;\r\n}\r\n\r\n/**\r\n * The function defines the settings values for a given inventory configuration.\r\n * @param context - The context.\r\n * @param isStockCheck - Flag to enable inventory validation.\r\n * @param productAvailability - The product inventory information.\r\n * @param buyboxResources - The buybox string resources.\r\n * @param isLoading - Is loading.\r\n * @returns Boolean.\r\n */\r\nfunction getFindInStoreInventorySettings(\r\n context: ICoreContext,\r\n isStockCheck: boolean,\r\n productAvailability: IProductInventoryInformation[] | undefined,\r\n buyboxResources: IHeiBuyboxResources,\r\n isLoading?: boolean\r\n): IInventorySettingsProps {\r\n // If shouldValidateAggregation is true then is required to check for the product inventory, based on this the messaging will change\r\n // and the find in store button will be ensbled or disabled\r\n\r\n let isSectionDisabled: boolean;\r\n let buttonText;\r\n let description: string;\r\n\r\n let pickupInventory: IProductInventoryInformation | undefined;\r\n\r\n if (!isStockCheck || isLoading) {\r\n return {\r\n isSectionDisabled: false,\r\n buttonText: buyboxResources.findInStoreLinkText,\r\n description: buyboxResources.findInStoreDescriptionText\r\n };\r\n }\r\n\r\n if (productAvailability) {\r\n pickupInventory = productAvailability.find(pickup => pickup.deliveryType === DeliveryMode.pickup);\r\n }\r\n\r\n // If aggregated is enabled, then we need to validate the inventor check for find in store.\r\n // If an individual is selected, then we will always show a find in store button.\r\n if (isAggregatedInventory(context.actionContext)) {\r\n if (productAvailability && pickupInventory?.IsProductAvailable) {\r\n isSectionDisabled = false;\r\n buttonText = buyboxResources.findInStoreLinkText;\r\n description = buyboxResources.findInStoreDescriptionText;\r\n } else {\r\n isSectionDisabled = true;\r\n buttonText = buyboxResources.findInStoreNotAvailableTextButton;\r\n description = buyboxResources.findInStoreNotAvailableDescription;\r\n }\r\n } else {\r\n isSectionDisabled = false;\r\n buttonText = buyboxResources.findInStoreLinkText;\r\n description = buyboxResources.findInStoreDescriptionText;\r\n }\r\n\r\n return {\r\n isSectionDisabled,\r\n description,\r\n buttonText\r\n };\r\n}\r\n\r\n/**\r\n * Method to check if we have atleast one common delivery code between product and channel.\r\n * @param productdeliveryOptions - Product DeliveryOption List.\r\n * @param storePickUpOptionList - Channel DeliveryOption List.\r\n * @returns Boolean flag.\r\n */\r\nconst matchDeliveryOptions = (\r\n productdeliveryOptions: DeliveryOption[] | undefined,\r\n storePickUpOptionList: string[] | undefined\r\n): boolean => {\r\n const deliveryOption: string[] = [];\r\n productdeliveryOptions?.map(delivery => {\r\n const pickup = storePickUpOptionList?.find(deliveryCode => deliveryCode === delivery.Code);\r\n if (pickup) {\r\n deliveryOption.push(pickup);\r\n }\r\n return deliveryOption;\r\n });\r\n\r\n return ArrayExtensions.hasElements(deliveryOption);\r\n};\r\n\r\nexport function getBuyboxFindInStore(\r\n props: IHeiBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): IBuyboxFindInStoreViewProps | undefined {\r\n const {\r\n data,\r\n slots: { storeSelector },\r\n resources: {\r\n priceFree,\r\n originalPriceText,\r\n currentPriceText,\r\n findInStoreHeaderText,\r\n buyBoxGoToCartText,\r\n buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n buyBoxSingleItemText,\r\n buyBoxMultiLineItemFormatText,\r\n buyBoxHeaderMessageText\r\n },\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n }\r\n } = props;\r\n\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const product = data?.product?.result;\r\n const price = data?.productPrice?.result;\r\n const storeSelectorStateManager = data?.storeSelectorStateManager?.result;\r\n const cart = data?.cart?.result;\r\n const deliveryOptions = data?.deliveryOptions?.result;\r\n const productAvailability = data.productAvailableQuantity?.result;\r\n const retailMulitplePickupMFeatureState = data?.featureState?.result?.find(\r\n (featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n const channelDeliveryOptionConfig = data?.channelDeliveryOptionConfig?.result;\r\n\r\n const missingDimensions = product?.Dimensions?.filter(dimension => !dimension.DimensionValue?.Value);\r\n\r\n const {\r\n errorState: { configureErrors, quantityError, otherError, errorHost },\r\n modalOpen,\r\n quantity\r\n } = state;\r\n\r\n const { isSectionDisabled, buttonText, description } = getFindInStoreInventorySettings(\r\n props.context,\r\n props.context.app.config.enableStockCheck,\r\n productAvailability,\r\n props.resources,\r\n props.data.productAvailableQuantity.status === 'LOADING' || ArrayExtensions.hasElements(missingDimensions)\r\n );\r\n\r\n if (!product || !storeSelectorStateManager || !ArrayExtensions.hasElements(storeSelector)) {\r\n return undefined;\r\n }\r\n\r\n if (!deliveryOptions || !deliveryOptions.DeliveryOptions) {\r\n return undefined;\r\n }\r\n\r\n // If no delivery options present on the product, or none of the delivery options\r\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\r\n if (retailMulitplePickupMFeatureState && channelDeliveryOptionConfig) {\r\n if (!matchDeliveryOptions(deliveryOptions.DeliveryOptions, channelDeliveryOptionConfig?.PickupDeliveryModeCodes)) {\r\n return undefined;\r\n }\r\n } else if (\r\n !PickupDeliveryModeCode ||\r\n !deliveryOptions.DeliveryOptions.find((option: DeliveryOption) => option.Code === PickupDeliveryModeCode)\r\n ) {\r\n return undefined;\r\n }\r\n\r\n const dialogStrings = {\r\n goToCartText: buyBoxGoToCartText,\r\n continueShoppingText: buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n headerItemOneText: buyBoxSingleItemText,\r\n headerItemFormatText: buyBoxMultiLineItemFormatText,\r\n headerMessageText: buyBoxHeaderMessageText,\r\n freePriceText: priceFree,\r\n originalPriceText,\r\n currentPriceText\r\n };\r\n\r\n const priceComponent = price ? (\r\n \r\n ) : (\r\n ''\r\n );\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'ms-buybox',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data.product?.result, price: props.data.productPrice?.result },\r\n dialogStrings,\r\n imageSettings: defaultImageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: quantity,\r\n priceComponent,\r\n navigationUrl: getUrlSync('cart', props.context.actionContext),\r\n modalOpen,\r\n setModalOpen: callbacks.changeModalOpen\r\n };\r\n const renderModalPopup = ;\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__find-in-store'\r\n },\r\n\r\n storeSelector: storeSelector[0],\r\n\r\n openFindInStoreDialog: onClickFindInStoreHandler(props, state, callbacks),\r\n\r\n heading: ,\r\n\r\n description:

{description}

,\r\n productPickupOptionList: null,\r\n errors: (\r\n \r\n ),\r\n\r\n button: (\r\n \r\n {buttonText}\r\n \r\n ),\r\n\r\n modal: renderModalPopup\r\n };\r\n}\r\n\r\n/**\r\n * Handler for find in store button.\r\n * @param props - BuyBox data.\r\n * @param state - BuyBox state.\r\n * @param callbacks - BuyBox callbacks.\r\n * @returns - Promise.\r\n */\r\nasync function findInStoreOnClick(props: IHeiBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): Promise {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager },\r\n cart: { result: cart },\r\n productAvailableQuantity: { result: productAvailableQuantity }\r\n },\r\n resources,\r\n context,\r\n modules\r\n } = props;\r\n\r\n const { selectedProduct, quantity } = state;\r\n\r\n let dataProduct = props.data.product.result;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const retailMulitplePickupMFeatureState = props.data?.featureState?.result?.find(\r\n (featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n\r\n if (selectedProduct) {\r\n dataProduct = (await selectedProduct) || dataProduct;\r\n }\r\n\r\n if (!dataProduct || !storeSelectorStateManager) {\r\n return;\r\n }\r\n\r\n const product = dataProduct;\r\n\r\n const missingDimensions =\r\n product.Dimensions &&\r\n product.Dimensions.filter((dimension: ProductDimension) => !(dimension.DimensionValue && dimension.DimensionValue.Value));\r\n\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n\r\n if (missingDimensions && missingDimensions.length > 0) {\r\n if (callbacks.updateErrorState) {\r\n callbacks.updateErrorState({\r\n errorHost: 'FINDINSTORE',\r\n configureErrors: getConfigureErrors(missingDimensions, resources)\r\n });\r\n }\r\n } else {\r\n storeSelectorStateManager\r\n .openDialog({\r\n product,\r\n id: storeSelectorId,\r\n parentElementRef: modalCloseButtonReference,\r\n deliveryOptions: retailMulitplePickupMFeatureState ? props.data.deliveryOptions.result : undefined,\r\n onLocationSelected: async (orgUnitLocation: OrgUnitLocation, deliveryMode: string) => {\r\n if (!cart) {\r\n return Promise.resolve();\r\n }\r\n\r\n const productsToAdd: IAddCartLine[] = [];\r\n productsToAdd.push({\r\n product: product,\r\n count: quantity,\r\n enableStockCheck: props.context.app.config.enableStockCheck,\r\n location: orgUnitLocation,\r\n deliveryMode: deliveryMode\r\n });\r\n const behavior = props.context?.app?.config?.addToCartBehavior;\r\n const customWindow: ICustomWindow = window;\r\n if (customWindow.__warranty__) {\r\n const product = customWindow.__warranty__;\r\n productsToAdd.push({\r\n product: product,\r\n count: 1,\r\n location: orgUnitLocation,\r\n deliveryMode: deliveryMode\r\n });\r\n }\r\n\r\n return cart\r\n .addProductsToCart(productsToAdd)\r\n .then(async (result: ICartActionResult) => {\r\n if (result.status === 'FAILED' && result.substatus === 'MAXQUANTITY') {\r\n callbacks.changeModalOpen(false);\r\n let productAvailability: ProductAvailableQuantity | undefined;\r\n if (state.productAvailableQuantity) {\r\n productAvailability = state.productAvailableQuantity.ProductAvailableQuantity;\r\n } else if (productAvailableQuantity && ArrayExtensions.hasElements(productAvailableQuantity)) {\r\n const shippingInventory = productAvailableQuantity.find(\r\n shipping => shipping.deliveryType === DeliveryMode.pickup\r\n );\r\n productAvailability = shippingInventory?.ProductAvailableQuantity;\r\n } else {\r\n productAvailability = undefined;\r\n }\r\n const failureResult: IAddToCartFailureResult = {\r\n failureReason: 'CARTACTIONFAILED',\r\n cartActionResult: { status: result.status, substatus: result.substatus }\r\n };\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n configureErrors: {},\r\n otherError: getGenericError(\r\n failureResult,\r\n cart,\r\n resources,\r\n context,\r\n product,\r\n productAvailability,\r\n orgUnitLocation\r\n )\r\n });\r\n } else {\r\n if (productsToAdd.length === 2) {\r\n const extensionProperties = cart.cart.ExtensionProperties || [];\r\n await cart.updateExtensionProperties({\r\n newExtensionProperties: [\r\n ...extensionProperties,\r\n {\r\n Key: `linked-${productsToAdd[0].product.RecordId}`,\r\n Value: {\r\n StringValue: `${productsToAdd[0].product.RecordId}-${productsToAdd[1].product.RecordId}`\r\n }\r\n }\r\n ]\r\n });\r\n }\r\n\r\n await sendGoogleAnalyticsEvent(productsToAdd, props.context.actionContext);\r\n\r\n callbacks.updateErrorState({\r\n configureErrors: {}\r\n });\r\n const navigationUrl = getUrlSync('cart', context.actionContext);\r\n if (behavior === undefined || behavior === AddToCartBehavior.goToCart) {\r\n if (result.status === 'SUCCESS' && navigationUrl) {\r\n window.location.assign(navigationUrl);\r\n }\r\n } else if (behavior === AddToCartBehavior.showModal) {\r\n callbacks.changeModalOpen(true);\r\n } else if (behavior === AddToCartBehavior.showNotification) {\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n const telemetryContent = getTelemetryObject(\r\n props.context.request.telemetryPageName!,\r\n props.friendlyName,\r\n props.telemetry\r\n );\r\n const dialogStrings: IAddToCartResources = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n closeNotificationLabel: resources.closeNotificationLabel,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n addedQuantityText: resources.addedQuantityText\r\n };\r\n const notification = new ItemSuccessfullyAddedToCartNotification(\r\n props.context,\r\n dialogStrings,\r\n defaultImageSettings,\r\n props.context.request.gridSettings,\r\n product,\r\n props.data.productPrice?.result,\r\n productsToAdd.length === 2 ? quantity + 1 : quantity,\r\n navigationUrl,\r\n telemetryContent,\r\n props.id,\r\n props.typeName\r\n );\r\n NotificationsManager.instance().addNotification(notification);\r\n }\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.exception(error);\r\n props.telemetry.debug('Unable to add product to cart');\r\n }\r\n });\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to find in store');\r\n }\r\n });\r\n }\r\n}\r\n","// @ts-nocheck\r\n// @ts-ignore\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\n/* eslint-disable no-duplicate-imports */\r\nimport { getCatalogId, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\r\nimport {\r\n CommerceProperty,\r\n ProductDeliveryOptions,\r\n ProductDimensionValue,\r\n ProductDimensionValueInventoryAvailability,\r\n ProductPrice,\r\n ReleasedProductType,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { BulkPurchase } from '@msdyn365-commerce-modules/bulk-purchase';\r\nimport {\r\n ArrayExtensions,\r\n DeliveryMode,\r\n FinitePromiseQueue,\r\n FinitePromiseQueueError,\r\n getDeliveryOptionsForSelectedVariant,\r\n GetDeliveryOptionsForSelectedVariantInput,\r\n getDimensionsForSelectedVariant,\r\n GetDimensionsForSelectedVariantInput,\r\n getInventoryLevelCodeFromDimensionValue,\r\n getPriceForSelectedVariant,\r\n getProductAvailabilitiesForSelectedVariant,\r\n getSelectedVariant,\r\n IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n IProductInventoryInformation,\r\n IPromiseQueue,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput,\r\n SelectedVariantInput,\r\n setDimensionValuesToQuery\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n getBuyboxAddToCart,\r\n getBuyBoxInventoryLabel,\r\n getBuyboxKeyInPrice,\r\n getBuyboxProductAddToOrderTemplate,\r\n getBuyboxProductAddToWishlist,\r\n getBuyboxProductComparisonButton,\r\n getBuyboxProductDescription,\r\n getBuyboxProductPrice,\r\n getBuyboxProductQuantity,\r\n getBuyboxProductRating,\r\n getBuyboxProductTitle,\r\n getBuyboxProductUnitOfMeasure,\r\n getBuyboxShopSimilarButton,\r\n getQuantityLimitsMessages,\r\n RetailDefaultOrderQuantityLimitsFeatureName\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { getBuyboxProductConfigure } from '../../common/buybox-product-configure';\r\nimport {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxExtentedProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IErrorState,\r\n ShopSimiliarButtonType\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { IHeiBuyboxData } from './hei-buybox.data';\r\nimport { IHeiBuyboxProps, IHeiBuyboxResources } from './hei-buybox.props.autogenerated';\r\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/hei-buybox-find-in-store';\r\nimport { RecentlyViewedState } from '@msdyn365-commerce-modules/buybox';\r\n\r\nexport interface IBuyboxViewProps extends IHeiBuyboxProps {\r\n state: IBuyboxState;\r\n ModuleProps: IModuleProps;\r\n ProductInfoContainerProps: INodeProps;\r\n MediaGalleryContainerProps: INodeProps;\r\n callbacks: IBuyboxCallbacks;\r\n mediaGallery?: React.ReactNode;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n rating?: React.ReactNode;\r\n price?: React.ReactNode;\r\n productComparisonButton?: React.ReactNode;\r\n bulkPurchaseLink?: React.ReactNode;\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\r\n addToWishlist?: IBuyboxAddToWishlistViewProps;\r\n max: number | undefined;\r\n addToCart: IBuyboxAddToCartViewProps;\r\n findInStore?: IBuyboxFindInStoreViewProps;\r\n quantity?: IBuyboxProductQuantityViewProps;\r\n configure?: IBuyboxProductConfigureViewProps;\r\n inventoryLabel?: React.ReactNode;\r\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\r\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\r\n quantityLimitsMessages: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n keyInPrice?: IBuyboxKeyInPriceViewProps;\r\n unitOfMeasure?: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Buybox Module.\r\n */\r\nclass Buybox extends React.PureComponent, IBuyboxState> {\r\n /**\r\n * A queue of tasks of processing the changes in the dimensions.\r\n * Limit to two processes:\r\n * 1 - for the current process, which is under execution at the moment.\r\n * 2 - next process, which will process the latest version of data.\r\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\r\n */\r\n private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\r\n\r\n private dimensions: { [id: number]: string } = {};\r\n\r\n private readonly buyboxCallbacks: IBuyboxCallbacks = {\r\n updateQuantity: (newQuantity: number): boolean => {\r\n const errorState = { ...this.state.errorState };\r\n errorState.quantityError = undefined;\r\n errorState.otherError = undefined;\r\n\r\n this.setState({ quantity: newQuantity, errorState });\r\n return true;\r\n },\r\n updateErrorState: (newErrorState: IErrorState): void => {\r\n this.setState({ errorState: newErrorState });\r\n },\r\n updateSelectedProduct: (\r\n newSelectedProduct: Promise,\r\n newInventory: IProductInventoryInformation | undefined,\r\n newPrice: ProductPrice | undefined,\r\n newDeliveryOptions: ProductDeliveryOptions | undefined\r\n ): void => {\r\n this.setState({\r\n selectedProduct: newSelectedProduct,\r\n productAvailableQuantity: newInventory,\r\n productDeliveryOptions: newDeliveryOptions\r\n });\r\n this._updatePrice(newPrice);\r\n },\r\n dimensionSelectedAsync: async (\r\n selectedDimensionId: number,\r\n selectedDimensionValueId: string,\r\n otherDimensions?: { [id: number]: string }\r\n ): Promise => {\r\n if (otherDimensions) {\r\n this.dimensions = {\r\n ...this.dimensions,\r\n ...otherDimensions\r\n };\r\n }\r\n\r\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\r\n\r\n process.env.NODE_ENV === 'development' && console.log('buybox-product-configure', 'dimensionSelectedAsync', this.dimensions);\r\n\r\n return this.dimensionUpdateQueue\r\n .enqueue(async () => {\r\n return this._updateDimensions();\r\n })\r\n .catch((error: unknown) => {\r\n // Ignore discarded processes.\r\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\r\n throw error;\r\n }\r\n });\r\n },\r\n getDropdownName: (dimensionType: number, resources: IHeiBuyboxResources): string => {\r\n return this._getDropdownName(dimensionType, resources);\r\n },\r\n changeModalOpen: (isModalOpen: boolean): void => {\r\n this.setState({ modalOpen: isModalOpen });\r\n },\r\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\r\n this.setState({ isUpdatingDimension });\r\n },\r\n\r\n /**\r\n * Update isUpdatingDeliveryOptions state.\r\n *\r\n * @param isUpdatingDeliveryOptions - The status of updating delivery options.\r\n */\r\n changeUpdatingDeliveryOptions: (isUpdatingDeliveryOptions: boolean): void => {\r\n this.setState({ isUpdatingDeliveryOptions });\r\n },\r\n\r\n updateKeyInPrice: (customPrice: number): void => {\r\n // Remove custom amount error when updating the custom price\r\n const errorState = { ...this.state.errorState };\r\n errorState.customAmountError = undefined;\r\n\r\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState });\r\n this._updatePrice(this.state.productPrice, customPrice);\r\n }\r\n };\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly mountCategories: { [category: string]: boolean } = {};\r\n private readonly packSizeCategories: { [category: string]: boolean } = {};\r\n\r\n public constructor(props: IHeiBuyboxProps, state: IBuyboxState) {\r\n super(props);\r\n this.state = {\r\n errorState: {\r\n configureErrors: {}\r\n },\r\n quantity: 1,\r\n min: undefined,\r\n max: undefined,\r\n selectedProduct: undefined,\r\n productPrice: undefined,\r\n productDeliveryOptions: undefined,\r\n\r\n modalOpen: false,\r\n isUpdatingDimension: false,\r\n isUpdatingDeliveryOptions: false\r\n };\r\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n\r\n if (typeof this.props.config.mountCategories === 'string') {\r\n for (const c of this.props.config.mountCategories.split('|')) {\r\n this.mountCategories[c] = true;\r\n }\r\n }\r\n\r\n if (typeof this.props.config.packSizeCategories === 'string') {\r\n for (const c of this.props.config.packSizeCategories.split('|')) {\r\n this.packSizeCategories[c] = true;\r\n }\r\n }\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n productPrice\r\n },\r\n context\r\n } = this.props;\r\n\r\n void productPrice.then(async result => {\r\n this._updatePrice(result);\r\n });\r\n\r\n if (product) {\r\n // Check if the product is service or not by product type\r\n if (product.ItemTypeValue === ReleasedProductType.Service) {\r\n this.setState({ isServiceItem: true });\r\n }\r\n await this._updateQuantitiesInState(product);\r\n }\r\n\r\n if (product && context.app.config.maxRecentlyViewedItemsCount > 0) {\r\n RecentlyViewedState.instance(this.props.context, context.app.config.maxRecentlyViewedItemsCount, product.RecordId);\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n slots: { mediaGallery, productComparisonButton },\r\n data: {\r\n product: { result: product }\r\n },\r\n config: { className = '' }\r\n } = this.props;\r\n\r\n const { max } = this.state;\r\n\r\n if (!product) {\r\n this.props.context.telemetry.error('Product content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const props = this.props as IBuyboxExtentedProps;\r\n const defaultMinimumKeyInPrice = 10;\r\n const defaultMaximumKeyInPrice = 100;\r\n\r\n const context = this.props.context as ICoreContext;\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n const dimensionValuesWithInventory = ArrayExtensions.flatten(\r\n ArrayExtensions.validValues(this.props.data.productDimensions.result?.map(value => value.dimensionValuesWithInventory))\r\n );\r\n const hasAvailableProducts =\r\n !ArrayExtensions.hasElements(dimensionValuesWithInventory) ||\r\n dimensionValuesWithInventory.some((value: unknown) => {\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(\r\n value as ProductDimensionValueInventoryAvailability,\r\n inventoryLevel\r\n );\r\n return inventoryLevelCode !== InventoryLevelValues.outOfStock;\r\n });\r\n\r\n const viewProps: IBuyboxViewProps = {\r\n ...(this.props as IHeiBuyboxProps),\r\n state: this.state,\r\n mediaGallery: mediaGallery && mediaGallery.length > 0 ? mediaGallery[0] : undefined,\r\n ModuleProps: {\r\n moduleProps: this.props,\r\n className: classnames('ms-buybox', className)\r\n },\r\n ProductInfoContainerProps: {\r\n className: 'ms-buybox__content'\r\n },\r\n MediaGalleryContainerProps: {\r\n className: 'ms-buybox__media-gallery'\r\n },\r\n telemetryContent: this.telemetryContent,\r\n callbacks: this.buyboxCallbacks,\r\n title: getBuyboxProductTitle(props),\r\n description: getBuyboxProductDescription(props),\r\n bulkPurchaseLink: this._renderBuyboxBulkPurchaseLink(),\r\n unitOfMeasure: getBuyboxProductUnitOfMeasure(props),\r\n configure: getBuyboxProductConfigure(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n undefined,\r\n undefined,\r\n this.props.config.defaultToUniqueOption,\r\n this.props.data.allDimensions.result\r\n ),\r\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\r\n price: getBuyboxProductPrice(props, this.state),\r\n addToCart: getBuyboxAddToCart(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n defaultMinimumKeyInPrice,\r\n defaultMaximumKeyInPrice,\r\n undefined,\r\n hasAvailableProducts\r\n ),\r\n productComparisonButton: ArrayExtensions.hasElements(productComparisonButton)\r\n ? getBuyboxProductComparisonButton(\r\n productComparisonButton[0],\r\n product,\r\n getCatalogId(this.props.context.request),\r\n this.state\r\n )\r\n : undefined,\r\n addToOrderTemplate: getBuyboxProductAddToOrderTemplate(props, this.state, this.buyboxCallbacks),\r\n addToWishlist: getBuyboxProductAddToWishlist(props, this.state, this.buyboxCallbacks),\r\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\r\n quantity: product.IsGiftCard ? undefined : getBuyboxProductQuantity(props, this.state, this.buyboxCallbacks),\r\n inventoryLabel: getBuyBoxInventoryLabel(props),\r\n shopSimilarLook:\r\n this.props.config.enableShopSimilarLooks && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Looks)\r\n : undefined,\r\n shopSimilarDescription:\r\n this.props.config.enableShopSimilarDescription && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description)\r\n : undefined,\r\n keyInPrice:\r\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\r\n ? getBuyboxKeyInPrice(props, this.state, this.buyboxCallbacks)\r\n : undefined,\r\n quantityLimitsMessages: getQuantityLimitsMessages(props, this.state),\r\n max\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Handles anchor click event and scrolls to the given bulk purchase module.\r\n * @param bulkPurchaseModule - Bulk purchase module.\r\n * @returns Handler.\r\n */\r\n private readonly _onBulkPurchaseLinkClick = (bulkPurchaseModule: Element) => () => {\r\n const boundingRect = bulkPurchaseModule.getBoundingClientRect();\r\n window.scrollTo(boundingRect.left, boundingRect.top);\r\n };\r\n\r\n private _renderBuyboxBulkPurchaseLink(): React.ReactNode {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Temporary switch for the feature which is under development.\r\n if (!this.props.context.app.config.isBulkPurchaseEnabled) {\r\n return null;\r\n }\r\n\r\n if (!msdyn365Commerce.isBrowser) {\r\n return null;\r\n }\r\n\r\n const bulkPurchaseModules = Array.from(document.getElementsByClassName(BulkPurchase.className));\r\n\r\n if (!ArrayExtensions.hasElements(bulkPurchaseModules)) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {this.props.resources.bulkPurchaseLinkText}\r\n \r\n );\r\n }\r\n\r\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\r\n if (this.state.isCustomPriceSelected && newPrice) {\r\n newPrice.CustomerContextualPrice = customPrice;\r\n }\r\n this.setState({ productPrice: newPrice });\r\n }\r\n\r\n private _getProductVariant(dimensionsToUpdate: { [id: number]: string }) {\r\n const {\r\n data: {\r\n product: { result: product }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n } = this.props;\r\n\r\n const productDimensions = this.props.data.productDimensions.result!;\r\n\r\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\r\n // over the information in data\r\n const mappedDimensions = productDimensions\r\n .map(dimension => {\r\n const dimensions = (dimension.dimensionValuesWithInventory ??\r\n dimension.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n return {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue:\r\n dimensions.find(\r\n value => value.DimensionValue?.RecordId.toString() === dimensionsToUpdate[dimension.DimensionTypeValue]\r\n )?.DimensionValue ?? dimension.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n };\r\n })\r\n .filter(dimension => dimension.DimensionValue);\r\n setDimensionValuesToQuery(this.props.context.actionContext.requestContext.url.requestUrl, mappedDimensions);\r\n\r\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const selectedProductPromise = getSelectedVariant(\r\n new SelectedVariantInput(\r\n product!.MasterProductId ? product!.MasterProductId : product!.RecordId,\r\n channelId,\r\n undefined,\r\n undefined,\r\n this.props.context.request\r\n ),\r\n actionContext\r\n );\r\n this.setState({ selectedProduct: selectedProductPromise });\r\n\r\n return { productVariantPromise: selectedProductPromise, mappedDimensions };\r\n }\r\n\r\n private readonly _updateDimensions = async (): Promise => {\r\n const product = this.props.data.product.result;\r\n\r\n const productDimensions = this.props.data.productDimensions.result;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensions);\r\n\r\n process.env.NODE_ENV === 'development' &&\r\n console.log('buybox-product-configure', '_updateDimensions', hasProductDimensions, this.dimensions);\r\n\r\n if (!product || !hasProductDimensions) {\r\n return;\r\n }\r\n\r\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\r\n this.setState({ isUpdatingDimension: true, isUpdatingDeliveryOptions: true });\r\n\r\n // Step 1: Clear error state to display relevant errors\r\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\r\n const clearErrorState = { ...this.state.errorState };\r\n clearErrorState.otherError = undefined;\r\n if (this.state.errorState.errorHost === 'ADDTOCART') {\r\n clearErrorState.quantityError = undefined;\r\n clearErrorState.errorHost = undefined;\r\n }\r\n this.setState({ errorState: clearErrorState });\r\n }\r\n\r\n // Step 2: Clear any errors indicating the dimension wasn't selected\r\n for (const key of Object.keys(dimensionsToUpdate)) {\r\n if (this.state.errorState.configureErrors[key]) {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.configureErrors[key] = undefined;\r\n return { errorState };\r\n });\r\n }\r\n }\r\n\r\n const data = this._getProductVariant(dimensionsToUpdate);\r\n const productVariant: SimpleProduct | null = await data.productVariantPromise;\r\n\r\n if (!productVariant) {\r\n return;\r\n }\r\n\r\n const promises: Promise[] = [\r\n this._getDimensionsForSelectedVariant(productVariant, data.mappedDimensions),\r\n this._hydrateInventoryInfo(productVariant),\r\n this._hydratePrice(productVariant),\r\n this._hydrateDeliveryOptions(productVariant),\r\n this._updateQuantitiesInState(productVariant)\r\n ];\r\n\r\n await Promise.all(promises);\r\n };\r\n\r\n private async _getDimensionsForSelectedVariant(\r\n productVariant: SimpleProduct,\r\n mappedDimensions: {\r\n /* eslint-disable @typescript-eslint/naming-convention -- Retail proxy values */\r\n DimensionTypeValue: number;\r\n DimensionValue: ProductDimensionValue | undefined;\r\n ExtensionProperties: CommerceProperty[] | undefined;\r\n /* eslint-enable @typescript-eslint/naming-convention -- Retail proxy values */\r\n }[]\r\n ): Promise {\r\n await getDimensionsForSelectedVariant(\r\n new GetDimensionsForSelectedVariantInput(\r\n productVariant.MasterProductId ? productVariant.MasterProductId : productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n mappedDimensions,\r\n this.props.context.request\r\n ),\r\n this.props.context.actionContext\r\n );\r\n }\r\n\r\n private async _hydrateInventoryInfo(productVariant: SimpleProduct): Promise {\r\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\r\n new ProductAvailabilitiesForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId),\r\n this.props.context.actionContext\r\n );\r\n\r\n const newShippingQuantity = newAvailableQuantity?.find(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (shipping: { deliveryType: any }) => shipping.deliveryType === DeliveryMode.shipping\r\n );\r\n const isCustomPriceSelected = productVariant.Dimensions?.find(\r\n dimension =>\r\n dimension.DimensionTypeValue === 4 && dimension.DimensionValue && dimension.DimensionValue.Value?.toLowerCase() === 'custom'\r\n );\r\n if (isCustomPriceSelected) {\r\n this.setState({ isCustomPriceSelected: true });\r\n } else {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.customAmountError = undefined;\r\n return { isCustomPriceSelected: false, isPriceKeyedIn: false, errorState };\r\n });\r\n }\r\n\r\n if (newShippingQuantity) {\r\n this.setState({ productAvailableQuantity: newShippingQuantity });\r\n } else {\r\n this.setState({ productAvailableQuantity: undefined });\r\n }\r\n }\r\n\r\n private async _hydratePrice(productVariant: SimpleProduct): Promise {\r\n // Step 6. Use these dimensions hydrate the product price.\r\n const newPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newPrice) {\r\n this._updatePrice(newPrice);\r\n }\r\n }\r\n\r\n private async _hydrateDeliveryOptions(productVariant: SimpleProduct): Promise {\r\n const retailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\r\n );\r\n\r\n // Step 7. Use these dimensions hydrate the product delivery options.\r\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\r\n new GetDeliveryOptionsForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n undefined,\r\n undefined,\r\n retailMultiplePickupFeatureState?.IsEnabled\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newDeliveryOptions) {\r\n this.setState({ productDeliveryOptions: newDeliveryOptions });\r\n }\r\n }\r\n\r\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\r\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\r\n if (isOrderQuantityLimitsFeatureEnabled && product) {\r\n this.setState({\r\n min: product.Behavior?.MinimumQuantity || 1,\r\n\r\n // If max by feature in default order settings is not defined then use max from site settings or default max 10.\r\n max:\r\n product.Behavior?.MaximumQuantity && product.Behavior?.MaximumQuantity > 0\r\n ? product.Behavior?.MaximumQuantity\r\n : this.props.context.app.config.maxQuantityForCartLineItem || 10\r\n });\r\n } else {\r\n this.setState({\r\n min: 1,\r\n max: this.props.context.app.config.maxQuantityForCartLineItem || 10\r\n });\r\n }\r\n }\r\n\r\n private readonly _getDropdownName = (dimensionType: number, resources: IHeiBuyboxResources): string => {\r\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\r\n\r\n const leafCategories = this.props.data.product.result?.ExtensionProperties?.find(p => p.Key === 'LeafCategories')?.Value\r\n ?.StringValue;\r\n\r\n switch (dimensionType) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColor;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfiguration;\r\n case 3: {\r\n // ProductDimensionType.Size\r\n\r\n if (leafCategories) {\r\n for (const leafCategory of leafCategories.split('|')) {\r\n if (this.mountCategories[leafCategory]) {\r\n return resources.productDimensionTypeMount;\r\n }\r\n }\r\n }\r\n\r\n return resources.productDimensionTypeSize;\r\n }\r\n case 4: {\r\n // ProductDimensionType.Style\r\n\r\n if (leafCategories) {\r\n for (const leafCategory of leafCategories.split('|')) {\r\n if (this.packSizeCategories[leafCategory]) {\r\n return resources.productDimensionTypePackSize;\r\n }\r\n }\r\n }\r\n\r\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\r\n }\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n const featureStatuses = await this.props.data.featureState;\r\n const isFeatureEnabledInHq = featureStatuses?.find(\r\n featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName\r\n )?.IsEnabled;\r\n if (!isFeatureEnabledInHq) {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n let customerInfo;\r\n try {\r\n customerInfo = await this.props.data.customerInformation;\r\n } catch (error) {\r\n this.props.telemetry.information(error);\r\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\r\n return false;\r\n }\r\n\r\n return (\r\n customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n }\r\n}\r\n\r\nexport default Buybox;\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\n/* eslint-disable no-duplicate-imports */\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxViewProps } from './hei-buybox';\r\nimport { IBuyboxFindInStoreViewProps } from './components/hei-buybox-find-in-store';\r\n\r\nconst BuyboxView: React.FC = props => {\r\n const {\r\n ModuleProps,\r\n MediaGalleryContainerProps,\r\n ProductInfoContainerProps,\r\n addToCart,\r\n addToOrderTemplate,\r\n addToWishlist,\r\n configure,\r\n description,\r\n findInStore,\r\n quantity,\r\n price,\r\n title,\r\n rating,\r\n inventoryLabel,\r\n shopSimilarLook,\r\n keyInPrice,\r\n shopSimilarDescription,\r\n unitOfMeasure,\r\n productComparisonButton\r\n } = props;\r\n\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {title}\r\n {price}\r\n {unitOfMeasure}\r\n {props.bulkPurchaseLink}\r\n {description}\r\n {rating}\r\n {configure && _renderConfigure(configure)}\r\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {quantity && _renderQuantity(quantity)}\r\n {inventoryLabel}\r\n {addToCart && _renderAddToCart(addToCart)}\r\n {findInStore && _renderFindInStore(findInStore)}\r\n {addToOrderTemplate && _renderAddToOrderTemplate(addToOrderTemplate)}\r\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n {productComparisonButton}\r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToCart;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToOrderTemplate = (addToOrderTemplate: IBuyboxAddToOrderTemplateViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToOrderTemplate;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToWishlist = (addToWishlist: IBuyboxAddToWishlistViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToWishlist;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n\r\n return {dropdowns.map(_renderConfigureDropdown)};\r\n};\r\n\r\nconst _renderSocialShare = (socialShare: React.ReactNode[]): JSX.Element | undefined => {\r\n if (!socialShare || socialShare.length === 0) {\r\n return undefined;\r\n }\r\n\r\n return <>{socialShare[0]};\r\n};\r\n\r\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {select}\r\n \r\n );\r\n};\r\n\r\nconst _renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\nconst _renderQuantity = (quantity: IBuyboxProductQuantityViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input, errors } = quantity;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\r\n\r\n return (\r\n \r\n {heading}\r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n const { ContainerProps, errors, input } = shopSimilarItem;\r\n\r\n return (\r\n \r\n {errors}\r\n {input}\r\n \r\n );\r\n};\r\nexport default BuyboxView;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { getCartStateData, GetCartStateDataInput } from '@msdyn365-commerce/global-state';\r\nimport { ProductDimension } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getDimensionsForSelectedVariant,\r\n GetDimensionsForSelectedVariantInput,\r\n getPriceForSelectedVariant,\r\n getProductAvailabilitiesForSelectedVariant,\r\n getRatingsSummary,\r\n GetRatingsSummaryInput,\r\n getRnrEndpointId,\r\n getRnrPartnerId,\r\n getSelectedVariant,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput,\r\n SelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { IProductDetails } from '@msdyn365-commerce-modules/buybox';\r\n\r\n/**\r\n * Calls the Retail API and returns the product details.\r\n * @param productId\r\n * @param channelId\r\n * @param ctx\r\n * @param selectedDimensions - Dimensions previously selected for the product variant.\r\n */\r\nexport async function getProductDetails(\r\n productId: number,\r\n channelId: number,\r\n ctx: IActionContext,\r\n selectedDimensions?: ProductDimension[]\r\n): Promise {\r\n const productDetails: IProductDetails = {};\r\n\r\n if (productId > 0 && channelId > 0) {\r\n const tenantId = getRnrPartnerId(ctx);\r\n const serviceEndPoint = getRnrEndpointId(ctx);\r\n\r\n // Get Product Details\r\n await getSelectedVariant(new SelectedVariantInput(productId, channelId, selectedDimensions, 'get'), ctx)\r\n .then(async productResult => {\r\n if (productResult) {\r\n productDetails.product = productResult;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get Product Availability\r\n await getProductAvailabilitiesForSelectedVariant(new ProductAvailabilitiesForSelectedVariantInput(productId, channelId), ctx)\r\n .then(productAvailabilities => {\r\n if (productAvailabilities) {\r\n productDetails.productAvailableQuantity = productAvailabilities;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get Product Price\r\n await getPriceForSelectedVariant(new PriceForSelectedVariantInput(productId, channelId, undefined), ctx)\r\n .then(productPrice => {\r\n if (productPrice) {\r\n productDetails.productPrice = productPrice;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get product dimensions\r\n await getDimensionsForSelectedVariant(new GetDimensionsForSelectedVariantInput(productId, channelId, selectedDimensions), ctx)\r\n .then(productDimensions => {\r\n if (productDimensions) {\r\n productDetails.productDimensions = productDimensions;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get Cart State\r\n await getCartStateData(new GetCartStateDataInput(ctx.requestContext.apiSettings), ctx)\r\n .then(cartState => {\r\n productDetails.cart = cartState;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get Product Ratings\r\n if (tenantId && serviceEndPoint) {\r\n await getRatingsSummary(new GetRatingsSummaryInput(productId.toString(), tenantId, serviceEndPoint), ctx)\r\n .then(ratingsSummaryData => {\r\n if (ratingsSummaryData) {\r\n productDetails.ratingsSummary = ratingsSummaryData;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n }\r\n }\r\n\r\n return productDetails;\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IActionContext, IImageData, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { MediaLocation, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getMediaLocationsForSelectedVariant, MediaLocationsForSelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nexport async function getValidProductImages(\r\n productId: number,\r\n channelId: number,\r\n actionContext: IActionContext,\r\n imageSettings: IImageSettings,\r\n selectedProduct?: SimpleProduct\r\n): Promise {\r\n const actionInput = new MediaLocationsForSelectedVariantInput(productId, channelId, selectedProduct);\r\n\r\n return getMediaLocationsForSelectedVariant(actionInput, actionContext)\r\n .then(mediaLocations => {\r\n if (mediaLocations) {\r\n return Promise.all(mediaLocations.map(async mediaLocation => validateMediaLocaionAsync(mediaLocation, imageSettings))).then(\r\n pairs => {\r\n return pairs.filter(pair => pair[1]).map(pair => pair[0]);\r\n }\r\n );\r\n }\r\n return [];\r\n })\r\n .catch(error => {\r\n actionContext.telemetry.exception(error);\r\n actionContext.telemetry.debug('Unable to get Media Locations for Selected Variant');\r\n return [];\r\n });\r\n}\r\n\r\nasync function validateMediaLocaionAsync(mediaLocation: MediaLocation, imageSettings: IImageSettings): Promise<[IImageData, boolean]> {\r\n const imageData = {\r\n src: mediaLocation.Uri || '',\r\n altText: mediaLocation.AltText || ''\r\n };\r\n\r\n const imageSettingsVal = imageSettings.viewports.lg!.q!.replace(/[\"']+/g, '');\r\n\r\n if (imageData.src === '') {\r\n return [imageData, false];\r\n }\r\n\r\n const imageConcatVal = `${imageData.src}` + '&' + `${imageSettingsVal}`;\r\n\r\n return new Promise<[IImageData, boolean]>(resolve => {\r\n try {\r\n const http = new XMLHttpRequest();\r\n http.open('HEAD', imageConcatVal, true);\r\n\r\n http.addEventListener('load', () => {\r\n resolve([imageData, http.status === 200 || http.status === 201]);\r\n });\r\n\r\n http.addEventListener('error', () => {\r\n resolve([imageData, false]);\r\n });\r\n\r\n http.send();\r\n } catch {\r\n resolve([imageData, false]);\r\n }\r\n });\r\n}\r\n","import React from 'react';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { generateImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nconst AuthorizedDealerBadge = ({ brand, requestContext }: { brand?: string | null; requestContext: IRequestContext }) => {\r\n if (brand && requestContext.gridSettings) {\r\n const locale = requestContext.locale;\r\n const fileName = `Catalogs/${locale}/${brand.toUpperCase()}_AuthDLR_${locale}.png`;\r\n const categoryImageUrl = generateImageUrl(fileName, requestContext.apiSettings);\r\n\r\n if (categoryImageUrl) {\r\n const ImageData: Msdyn365.IImageData = { src: categoryImageUrl };\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { AuthorizedDealerBadge };\r\n","import React from 'react';\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nconst MfrCode = ({\r\n productInfo,\r\n actionContext,\r\n mfrCodeLabel\r\n}: {\r\n productInfo?: SimpleProduct;\r\n actionContext: IActionContext;\r\n mfrCodeLabel: string;\r\n}) => {\r\n const mfrCode = productInfo?.ExtensionProperties?.find(ep => ep.Key === 'MfrCode')?.Value?.StringValue;\r\n\r\n if (mfrCode) {\r\n return (\r\n <>\r\n {' '}\r\n {mfrCodeLabel}: {mfrCode}\r\n \r\n );\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { MfrCode };\r\n","import { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\nimport React, { ReactNode, useMemo } from 'react';\r\nimport { findAttribute, findAttributeValue } from '../../../../common/utilities/productListExtensionHelpers';\r\n\r\nconst HideablePrice = ({\r\n attributeValues,\r\n price,\r\n seePriceInCartLabel\r\n}: {\r\n attributeValues?: AttributeValue[];\r\n price: ReactNode;\r\n seePriceInCartLabel: string;\r\n}) => {\r\n const hidePrice = useMemo(() => {\r\n if (attributeValues) {\r\n const hidePriceAttribute = findAttribute(attributeValues, 'See Price In Cart');\r\n if (hidePriceAttribute) {\r\n const hidePriceValue = findAttributeValue(hidePriceAttribute);\r\n if (typeof hidePriceValue === 'boolean' && hidePriceValue) {\r\n return hidePriceValue;\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n return null;\r\n }, [attributeValues]);\r\n\r\n if (hidePrice == null) {\r\n return null;\r\n }\r\n\r\n return hidePrice ?

{seePriceInCartLabel}

: <>{price};\r\n};\r\n\r\nexport { HideablePrice };\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport React, { useEffect } from 'react';\r\nimport { getProductPromotionsAsync } from '../../../../actions/DataActionExtension.g';\r\nimport { IProductPromotion } from '../../../../actions/DataServiceEntities.g';\r\n\r\nconst ProductPromotions = ({\r\n recordId,\r\n variantId,\r\n actionContext,\r\n sitePath\r\n}: {\r\n recordId?: number;\r\n variantId?: number;\r\n actionContext: IActionContext;\r\n sitePath: string;\r\n}) => {\r\n const [productPromo, setProductPromo] = React.useState([]);\r\n useEffect(() => {\r\n if (recordId) {\r\n (async () => {\r\n var productPromotionsInput = await getProductPromotionsAsync({ callerContext: actionContext }, recordId, variantId ?? 0);\r\n\r\n if (productPromotionsInput) {\r\n setProductPromo(productPromotionsInput);\r\n }\r\n })();\r\n }\r\n }, [recordId ?? 0, variantId ?? 0]);\r\n\r\n var offers = productPromo?.filter(o => o.OfferId);\r\n if (offers && offers.length > 0) {\r\n return (\r\n
    \r\n {offers.map(o => {\r\n return (\r\n
  • \r\n {o.Name}\r\n
  • \r\n );\r\n })}\r\n
\r\n );\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { ProductPromotions };\r\n","import * as React from 'react';\r\nimport Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nconst refreshAddThis = (div: HTMLDivElement, refreshed?: boolean, waitForScriptCount?: number) => {\r\n const addthis = ((window as unknown) as any).addthis;\r\n if (refreshed) {\r\n setTimeout(() => {\r\n if (!div.innerHTML) {\r\n // Content cleared, refresh again\r\n refreshAddThis(div);\r\n }\r\n }, 50);\r\n } else if (addthis) {\r\n setTimeout(() => {\r\n if (!div.innerHTML) {\r\n if (addthis.layers && addthis.layers.refresh) {\r\n addthis.layers.refresh();\r\n refreshAddThis(div, true);\r\n } else {\r\n refreshAddThis(div);\r\n }\r\n }\r\n }, 0);\r\n } else if (!waitForScriptCount || waitForScriptCount <= 50) {\r\n setTimeout(() => {\r\n refreshAddThis(div, false, (waitForScriptCount || 0) + 1);\r\n }, 50);\r\n }\r\n};\r\n\r\nexport default () => {\r\n const divRef = React.useRef(null);\r\n const [initialized, setInitialized] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n const div = divRef.current;\r\n\r\n if (!initialized && Msdyn365.isBrowser && div) {\r\n setInitialized(true);\r\n\r\n const childDiv = document.createElement('div');\r\n childDiv.className = 'addthis_inline_share_toolbox';\r\n div.appendChild(childDiv);\r\n\r\n refreshAddThis(childDiv);\r\n }\r\n }, [initialized, divRef]);\r\n\r\n return (\r\n <>\r\n
\r\n \r\n );\r\n};\r\n","import { SimpleProduct, WarrantyGroup } from '@msdyn365-commerce/retail-proxy';\r\nimport React, { Fragment } from 'react';\r\n\r\nexport interface IWarrantySelectionResources {\r\n productProtectionLabel?: string,\r\n noPlanSelectedLabel?: string,\r\n dayLabel?: string,\r\n monthLabel?: string,\r\n yearLabel?: string\r\n}\r\nexport interface IWarrantySelectionProps {\r\n warrantyGroups: WarrantyGroup[];\r\n selectedWarranty: number;\r\n formatPriceFn(price: string | number, currencyCode?: string | undefined): string;\r\n setSelectedWarranty(warranty: SimpleProduct | undefined): void;\r\n resources: IWarrantySelectionResources\r\n}\r\n\r\nexport const WarrantySelection = (props: IWarrantySelectionProps) => {\r\n const { warrantyGroups, selectedWarranty, formatPriceFn, setSelectedWarranty, resources } = props;\r\n const isWarrantyGroupValid = (): boolean => {\r\n return Boolean(warrantyGroups && Array.isArray(warrantyGroups) && warrantyGroups.length && warrantyGroups[0].Warranties);\r\n };\r\n\r\n const handleWarrantyChange = (event: React.ChangeEvent): void => {\r\n if (Number(event.target.value) !== 0) {\r\n const warranty = warrantyGroups[0].Warranties!.find(w => w.RecordId === Number(event.target.value));\r\n setSelectedWarranty(warranty as SimpleProduct);\r\n } else {\r\n setSelectedWarranty(undefined);\r\n }\r\n };\r\n\r\n const getWarrantyDurationLabel = (valueEnum: number, isPlural: boolean): string | null => {\r\n let valueLabel;\r\n switch (valueEnum) {\r\n case 1:\r\n valueLabel = resources.dayLabel!;\r\n break;\r\n case 2:\r\n valueLabel = resources.monthLabel!;\r\n break;\r\n case 3:\r\n valueLabel = resources.yearLabel!;\r\n break;\r\n default:\r\n return null;\r\n }\r\n if (isPlural) {\r\n valueLabel += 's';\r\n }\r\n return valueLabel;\r\n };\r\n\r\n return (\r\n <>\r\n
\r\n {isWarrantyGroupValid() ? (\r\n <>\r\n

{resources.productProtectionLabel}

\r\n
\r\n \r\n \r\n {warrantyGroups[0].Warranties!.map(warranty => (\r\n \r\n \r\n \r\n \r\n ))}\r\n
\r\n \r\n ) : null}\r\n
\r\n \r\n );\r\n};\r\n","import React, { useEffect } from 'react';\r\nimport { SimpleProduct, WarrantyGroup } from '@msdyn365-commerce/retail-proxy';\r\nimport MsDyn365, { ICoreContext } from '@msdyn365-commerce/core';\r\nimport { getApplicableWarrantiesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { WarrantySelection } from './WarrantySelection';\r\nimport { IHeiBuyboxResources as IBuyboxExtentionResources } from '../../definition-extensions/hei-buybox.ext.props.autogenerated';\r\nimport { ICustomWindow } from '../../../../common/utilities/helpers';\r\n\r\nconst ProductWarranty = ({\r\n context,\r\n catalogId,\r\n productId,\r\n extentionResources,\r\n setWarrantySelected\r\n}: {\r\n context: ICoreContext;\r\n catalogId: number;\r\n productId?: number;\r\n extentionResources: IBuyboxExtentionResources;\r\n setWarrantySelected: (warrantySelected: boolean) => void;\r\n}) => {\r\n const [selectedWarranty, setSelectedWarranty] = React.useState();\r\n const [warrantyGroups, setWarrantyGroups] = React.useState([]);\r\n useEffect(() => {\r\n if (productId) {\r\n (async () => {\r\n const data = await getApplicableWarrantiesAsync({ callerContext: context.actionContext }, catalogId, [productId]);\r\n setWarrantyGroups(data[0]?.WarrantyGroups ?? []);\r\n })();\r\n }\r\n }, [catalogId, productId ?? 0]);\r\n\r\n const updateSelectedWarranty = (warranty?: SimpleProduct) => {\r\n setSelectedWarranty(warranty);\r\n setWarrantySelected(!!warranty);\r\n\r\n if (MsDyn365.isBrowser) {\r\n const customWindow: ICustomWindow = window;\r\n customWindow.__warranty__ = warranty;\r\n }\r\n };\r\n\r\n if (warrantyGroups.length > 0) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { ProductWarranty };\r\n","import { AttributeValue, ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { HtmlHeadInclude } from '@msdyn365-commerce/core';\r\nimport { getProductUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { createCanonicalUrl } from '../../../../common/utilities/createCanonicalUrl';\r\n\r\nconst getProductUrl = (simpleProductData: SimpleProduct, context: IActionContext) => {\r\n let productUrl = getProductUrlSync(simpleProductData, context);\r\n const canonicalDomain = context.requestContext.canonicalDomain;\r\n if (productUrl && canonicalDomain) {\r\n return `https://${canonicalDomain}${productUrl}`.toLocaleLowerCase();\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nconst JsonLinkingData = ({\r\n productInfo,\r\n attributeValues,\r\n actionContext,\r\n productPrice\r\n}: {\r\n productInfo?: SimpleProduct;\r\n attributeValues?: AttributeValue[];\r\n actionContext: IActionContext;\r\n productPrice?: ProductPrice;\r\n}) => {\r\n const brand = productInfo?.ExtensionProperties?.find(ep => ep.Key === 'Brand')?.Value?.StringValue;\r\n const mfrCode = productInfo?.ExtensionProperties?.find(ep => ep.Key === 'MfrCode')?.Value?.StringValue;\r\n const request = actionContext.requestContext;\r\n\r\n // TODO: remove GTM data after analytics upgrade\r\n React.useEffect(() => {\r\n if (productInfo) {\r\n const gtmProduct: any = {\r\n name: productInfo.Name,\r\n id: productInfo.ItemId,\r\n price: productPrice?.CustomerContextualPrice ?? productInfo.Price\r\n };\r\n\r\n if (brand) {\r\n gtmProduct.brand = brand;\r\n }\r\n\r\n window['heiGtmProduct'] = gtmProduct;\r\n }\r\n }, [productInfo, brand]);\r\n\r\n if (!productInfo) {\r\n return null;\r\n }\r\n\r\n const canonicalUrl =\r\n createCanonicalUrl(actionContext, [productInfo.Name ?? ''], `${productInfo.RecordId}.p`) ||\r\n getProductUrl(productInfo, actionContext);\r\n const ld = {\r\n '@context': 'https://schema.org',\r\n '@type': 'Product',\r\n '@id': canonicalUrl,\r\n name: productInfo.Name || '',\r\n image: productInfo.PrimaryImageUrl && [productInfo.PrimaryImageUrl],\r\n description: productInfo.Description || undefined,\r\n sku: productInfo.ItemId,\r\n mpn: mfrCode,\r\n brand:\r\n (brand && {\r\n '@type': 'Brand',\r\n name: brand\r\n }) ||\r\n undefined,\r\n offers: {\r\n '@type': 'Offer',\r\n url: request.canonicalUrl || request.url.requestUrl,\r\n priceCurrency: request.channel?.Currency,\r\n price: productPrice?.CustomerContextualPrice ?? productInfo.Price\r\n }\r\n };\r\n\r\n return (\r\n \r\n {/* tslint:disable-next-line: react-no-dangerous-html */}\r\n \r\n \r\n );\r\n};\r\n\r\nexport { JsonLinkingData };\r\n","import React, { useMemo } from 'react';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, ProductPrice } from '@msdyn365-commerce/retail-proxy';\r\nimport { buildProductBadgeUrl, findAllAttributes, findAttributeValue } from '../../../../common/utilities/productListExtensionHelpers';\r\n\r\nconst ProductBadge = ({\r\n attributeValues,\r\n productPrice,\r\n requestContext\r\n}: {\r\n attributeValues?: AttributeValue[];\r\n requestContext: IRequestContext;\r\n productPrice?: ProductPrice;\r\n}) => {\r\n const discountAmount = productPrice?.DiscountAmount;\r\n if (discountAmount && discountAmount > 0) {\r\n process.env.NODE_ENV === 'development' && console.log('onsale', 'show', discountAmount);\r\n const badgeUrl = buildProductBadgeUrl(requestContext.locale, 'on_sale', requestContext.apiSettings.baseImageUrl, '_PDP');\r\n return ;\r\n }\r\n\r\n const badgeValue = useMemo(() => {\r\n if (discountAmount && discountAmount > 0) {\r\n process.env.NODE_ENV === 'development' && console.log('onsale', 'show', discountAmount);\r\n return 'on_sale';\r\n }\r\n\r\n const badgeAttributeArray = findAllAttributes(attributeValues, 'Product Badge Status');\r\n if (badgeAttributeArray) {\r\n for (const attr of badgeAttributeArray) {\r\n const badgeValue = findAttributeValue(attr);\r\n if (badgeValue && typeof badgeValue === 'string' && badgeValue.toLowerCase() !== 'none') {\r\n return badgeValue;\r\n }\r\n }\r\n }\r\n\r\n return '';\r\n }, [attributeValues, discountAmount]);\r\n\r\n if (badgeValue) {\r\n const badgeUrl = buildProductBadgeUrl(requestContext.locale, badgeValue, requestContext.apiSettings.baseImageUrl, '_PDP');\r\n const badgeName = badgeValue.replace(/_/, ' ');\r\n return {badgeName};\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { ProductBadge };\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 {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxFindInStoreViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IBuyboxViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { ArrayExtensions, DeliveryMode } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IncrementalQuantity, ITelemetryContent, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IHeiBuyboxData } from '../../../modules/hei-buybox';\r\n\r\nimport {\r\n IHeiBuyboxProps as IBuyboxExtentionProps,\r\n IHeiBuyboxResources as IBuyboxExtentionResources\r\n} from '../definition-extensions/hei-buybox.ext.props.autogenerated';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\nimport { AuthorizedDealerBadge } from './components/AuthorizedDealerBadge';\r\nimport { MfrCode } from './components/MfrCode';\r\nimport { HideablePrice } from './components/HideablePrice';\r\nimport { ProductPromotions } from './components/ProductPromotions';\r\nimport AddThisShare from './components/add-this-share';\r\nimport { ProductWarranty } from './components/ProductWarranty';\r\nimport Bazzarvoice from '../../../modules/bazzarvoice-widget/components/Bazzarvoice';\r\nimport { widgetType } from '../../../modules/bazzarvoice-widget/bazzarvoice-widget.props.autogenerated';\r\nimport { JsonLinkingData } from './components/JsonLinkingData';\r\nimport { ProductBadge } from './components/ProductBadge';\r\nimport { useGoogleAnalytics } from '../../../common/useGoogleAnalytics';\r\nimport { findAttribute } from '../../../common/utilities/productListExtensionHelpers';\r\nimport { GaPayload } from '../../../common/pushGoogleAnalyticsEvent';\r\n\r\nconst BuyboxView: React.FC> = props => {\r\n const {\r\n ModuleProps,\r\n MediaGalleryContainerProps,\r\n ProductInfoContainerProps,\r\n addToCart,\r\n addToOrderTemplate,\r\n addToWishlist,\r\n telemetryContent,\r\n configure,\r\n description,\r\n findInStore,\r\n quantity,\r\n price,\r\n title,\r\n callbacks,\r\n state,\r\n resources,\r\n inventoryLabel,\r\n shopSimilarLook,\r\n keyInPrice,\r\n quantityLimitsMessages,\r\n max,\r\n shopSimilarDescription,\r\n unitOfMeasure\r\n } = props;\r\n\r\n const {\r\n data: { product, productPrice, categoryPaths }\r\n } = props;\r\n\r\n const { actionContext, request } = props.context;\r\n const [warrantySelected, setWarrantySelected] = React.useState(false);\r\n\r\n const recordId = props.context.actionContext.requestContext.urlTokens.recordId;\r\n const catalogId = props.context.actionContext.requestContext.apiSettings.catalogId;\r\n const channelId = props.context.actionContext.requestContext.apiSettings.channelId;\r\n\r\n // Master product attribute values\r\n const [attributeValues, setAttributeValues] = React.useState();\r\n\r\n React.useEffect(() => {\r\n (async () => {\r\n const attributes = await getAttributeValuesAsync({ callerContext: actionContext }, Number(recordId), channelId, catalogId);\r\n setAttributeValues(attributes);\r\n })();\r\n }, [recordId]);\r\n\r\n const productInfo = product.result;\r\n const productPriceData = productPrice.result;\r\n const itemId = productInfo?.ItemId;\r\n\r\n const hasSerialNumber = productInfo?.Behavior?.HasSerialNumber || false;\r\n const variantSku = productInfo?.ProductNumber ?? productInfo?.ItemId ?? '';\r\n\r\n const brand = React.useMemo(() => {\r\n const brandFromExt = productInfo?.ExtensionProperties?.find(p => p.Key === 'Brand')?.Value?.StringValue;\r\n if (brandFromExt) {\r\n return brandFromExt;\r\n }\r\n\r\n if (attributeValues) {\r\n const bandAttribute = findAttribute(attributeValues, 'Brand') || findAttribute(attributeValues, 'Marque');\r\n return bandAttribute?.TextValue || '';\r\n }\r\n\r\n return null;\r\n }, [productInfo, attributeValues]);\r\n\r\n const gaPayload = React.useMemo(() => {\r\n if (productInfo && productPriceData && variantSku) {\r\n const hasUnselectedOption = productInfo.Dimensions?.find(d => Boolean(!d.DimensionValue));\r\n\r\n if (hasUnselectedOption) {\r\n return undefined;\r\n }\r\n\r\n const paths = categoryPaths?.result?.map(p => p.Name) ?? [];\r\n const variant = productInfo.Dimensions?.map(d => d.DimensionValue?.Value).join(',');\r\n const discount = productPriceData.DiscountAmount ?? 0;\r\n const payload: GaPayload = {\r\n event: 'view_item',\r\n ecommerce: {\r\n currency: productPriceData.CurrencyCode,\r\n value: productPriceData.CustomerContextualPrice ?? 0,\r\n items: [\r\n {\r\n item_id: variantSku,\r\n item_name: productInfo.Name ?? '',\r\n item_brand: brand ?? undefined,\r\n item_variant: variant,\r\n item_category: paths[0],\r\n item_category2: paths[1],\r\n item_category3: paths[2],\r\n item_category4: paths[3],\r\n item_category5: paths[4],\r\n price: (productPriceData.BasePrice ?? 0) - discount,\r\n discount: discount,\r\n quantity: 1,\r\n pid: productInfo.ItemId ?? '',\r\n index: 0\r\n }\r\n ]\r\n }\r\n };\r\n\r\n return payload;\r\n }\r\n\r\n return undefined;\r\n }, [variantSku, brand]);\r\n\r\n useGoogleAnalytics(gaPayload);\r\n\r\n return (\r\n \r\n
\r\n {title} \r\n
\r\n \r\n {resources.webCodeLabel}: {itemId ?? ''}\r\n \r\n \r\n
\r\n {/* TODO: Improve media gallery performace */}\r\n \r\n \r\n {props.mediaGallery}\r\n \r\n \r\n \r\n \r\n {unitOfMeasure}\r\n {/* {props.bulkPurchaseLink} */}\r\n {description}\r\n {_renderTextBlock(props.slots.textBlocks)}\r\n {/* {rating} */}\r\n \r\n {configure && _renderConfigure(configure)}\r\n \r\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {quantity &&\r\n !hasSerialNumber &&\r\n _renderQuantity(\r\n quantity,\r\n callbacks,\r\n props,\r\n state,\r\n resources,\r\n quantityLimitsMessages,\r\n max,\r\n warrantySelected,\r\n telemetryContent\r\n )}\r\n {inventoryLabel}\r\n {_renderAvailability(props)}\r\n {_renderCartAndActions(addToCart, addToOrderTemplate, addToWishlist)}\r\n {findInStore && _renderFindInStore(findInStore)}\r\n \r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\r\n \r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nconst _renderTextBlock = (textBlocks: React.ReactNode[]): JSX.Element | undefined => {\r\n if (!textBlocks || textBlocks.length === 0) {\r\n return undefined;\r\n }\r\n\r\n return <>{textBlocks[0]};\r\n};\r\n\r\nconst _renderCartAndActions = (\r\n addToCart?: IBuyboxAddToCartViewProps,\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps,\r\n addToWishlist?: IBuyboxAddToWishlistViewProps\r\n): JSX.Element | undefined => {\r\n if (!addToCart && !addToWishlist) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n
\r\n {addToCart && addToCart.errorBlock}\r\n {addToOrderTemplate && addToOrderTemplate.errorBlock}\r\n {addToWishlist && addToWishlist.errorBlock}\r\n
\r\n {addToCart && addToCart.button}\r\n {addToOrderTemplate && addToOrderTemplate.button}\r\n {addToWishlist && addToWishlist.button}\r\n
\r\n
\r\n );\r\n};\r\n\r\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n\r\n return {dropdowns.map(_renderConfigureDropdown)};\r\n};\r\n\r\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {select}\r\n \r\n );\r\n};\r\n\r\nconst _renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * On Change function.\r\n * @param callbacks -Callbacks.\r\n * @returns Update quantity.\r\n */\r\nconst onChangeHandler = (callbacks: IBuyboxCallbacks) => (newValue: number): boolean => {\r\n if (callbacks.updateQuantity) {\r\n return callbacks.updateQuantity(newValue);\r\n }\r\n return true;\r\n};\r\n\r\nconst _renderQuantity = (\r\n quantityComponent: IBuyboxProductQuantityViewProps,\r\n callbacks: IBuyboxCallbacks,\r\n props: IBuyboxProps,\r\n state: IBuyboxState,\r\n extentionResources: IBuyboxExtentionResources,\r\n quantityLimitsMessages: React.ReactNode,\r\n max: number | undefined,\r\n warrantyIsSelected: boolean,\r\n telemetryContent?: ITelemetryContent\r\n): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors } = quantityComponent;\r\n\r\n const { resources } = props;\r\n\r\n const { quantity } = state;\r\n\r\n if (warrantyIsSelected && quantity > 1) {\r\n callbacks.updateQuantity(1);\r\n }\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n\r\n \r\n {quantityLimitsMessages}\r\n \r\n );\r\n};\r\n\r\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\r\n\r\n return (\r\n \r\n {heading}\r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n const { ContainerProps, errors, input } = shopSimilarItem;\r\n\r\n return (\r\n \r\n {errors}\r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderAvailability = (props: IBuyboxExtentionProps) => {\r\n const availDate = props.data.product.result?.ExtensionProperties?.find(ep => ep.Key === 'AvailDate')?.Value?.StringValue;\r\n const productAvailableQuantity = props.data.productAvailableQuantity?.result;\r\n\r\n process.env.NODE_ENV === 'development' && console.log('_renderAvailability', availDate);\r\n\r\n if (!availDate || !productAvailableQuantity || !ArrayExtensions.hasElements(productAvailableQuantity)) {\r\n return undefined;\r\n }\r\n\r\n const shippingInventory = productAvailableQuantity.find(shipping => shipping.deliveryType === DeliveryMode.shipping);\r\n\r\n if (shippingInventory) {\r\n process.env.NODE_ENV === 'development' && console.log('_renderAvailability', shippingInventory.StockLevelCode);\r\n if (shippingInventory.StockLevelCode == 'AVAIL') {\r\n return

{`${props.resources.expectedAvailabilityLabel}: ${availDate}`}

;\r\n }\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport default BuyboxView;\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-buybox'] = {\n c: () => require('partner/modules/hei-buybox/hei-buybox.tsx'),\n $type: 'containerModule',\n da: [{name:'allDimensions', path:'actions/get-all-dimensions-for-product', runOn: 0},{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'categoryPaths', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'deliveryOptions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orderTemplates', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview', runOn: 1},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productAvailableQuantity', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant', runOn: 0},{name:'productDimensions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant', runOn: 0},{name:'productPrice', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant', runOn: 0},{name:'productPromotions', path:'actions/get-product-promotions.action', runOn: 0},{name:'ratingsSummary', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary', runOn: 1},{name:'storeSelectorStateManager', path:'@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action', runOn: 1},{name:'wishlists', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'hei-buybox',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/hei-buybox'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action';\n let dataAction = require('@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\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 = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-all-dimensions-for-product';\n let dataAction = require('partner/actions/get-all-dimensions-for-product');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-product-promotions.action';\n let dataAction = require('partner/actions/get-product-promotions.action');\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-buybox|hei-buybox'] = {\n c: () => require('partner/modules/hei-buybox/hei-buybox.view.tsx'),\n cn: '__local__-__local__-hei-buybox'\n };\nviewDictionary['__local__|__local__|themes|henrys|views|hei-buybox'] = {\n c: () => require('partner/themes/henrys/views/hei-buybox.view.tsx'),\n cn: '__local__-__local__-hei-buybox'\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 MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport {\n IListMapViewState,\n ILoadMapApiInput,\n IStoreInfo,\n IStoreSelectionStateContext,\n IStoreSelectorLocation,\n IStoreSelectorStateManager\n} from './i-store-selection-state-manager';\n\n/**\n * Abstract instance of IStoreSelectorStateManager with base implementation\n * of everything except the geoLocate function.\n */\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\n @computed public get isDialogOpen(): Readonly {\n return this._context !== undefined;\n }\n\n @computed public get context(): Readonly {\n return this._context;\n }\n\n @observable public isMapApiLoaded?: boolean;\n\n @observable public selectedStoreLocationId?: string;\n\n @observable public preferredStore?: IStoreInfo;\n\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n\n @observable public isMapModuleLoaded?: boolean;\n\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\n\n @observable protected _context?: IStoreSelectionStateContext;\n\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\n try {\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\n if (storeInfo) {\n this.preferredStore = storeInfo;\n }\n } catch {\n this.preferredStore = undefined;\n }\n }\n\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\n\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\n this._context = input;\n }\n\n @action\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\n this.selectedStoreLocationId = storeId;\n }\n\n @action\n public async setPreferredStoreLocation(\n storeId?: string,\n storeName?: string | undefined,\n writeToCookie: boolean = false,\n latitude?: number,\n longitude?: number\n ): Promise {\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\n this.preferredStore = storeInfo;\n if (writeToCookie) {\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\n }\n }\n\n @action\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\n this.lastInlineShownStoreInfo = storeInfo;\n }\n\n @action\n public async clearPreferredStore(writeToCookie: boolean): Promise {\n this.preferredStore = undefined;\n if (writeToCookie) {\n this._removeCookie(this.preferredStoreLocalStorageKey);\n }\n }\n\n @action\n public async openDialog(input: IStoreSelectionStateContext): Promise {\n if (this._context && this._context.id === input.id) {\n throw new Error('Dialog is already opened');\n }\n\n this._context = input;\n }\n\n @action\n public async closeDialog(): Promise {\n this._context = undefined;\n }\n\n private _removeCookie(key: string): void {\n if (!key) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.removeItem(key);\n }\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { action } from 'mobx';\n\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IStoreSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (\n !searchTerm ||\n !actionContext.requestContext.channel ||\n !actionContext.requestContext.channel.BingMapsApiKey ||\n !actionContext.requestContext.channel.BingMapsEnabled\n ) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl =\n actionContext.requestContext.app &&\n actionContext.requestContext.app.config &&\n actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise(resolve => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n if (window) {\n const currentWindowAPI = window.mapAPIReady;\n window.mapAPIReady = () => {\n if (currentWindowAPI) {\n currentWindowAPI();\n }\n this.isMapApiLoaded = true;\n };\n }\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\n input.market ? `&setMkt=${input.market}` : ''\n }`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IStoreSelectorStateManager } from './i-store-selection-state-manager';\nimport { MapStoreSelectorStateManager } from './map-store-selector-state-manager';\n\nexport function createStoreSelectorStateInput(result: IStoreSelectorStateManager): GenericInput {\n return new GenericInput('mapSSSM', result, 'IStoreSelectorStateManager');\n}\n\nconst createStoreSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createStoreSelectorStateInput(new MapStoreSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createStoreSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["GetAllDimensionsForProductInput","GetDimensionsForSelectedVariantInput","constructor","productId","channelId","super","getCacheObjectType","getAllDimensionsForProductActionDataAction","createObservableDataAction","id","action","getDimensionsForSelectedVariantAction","input","inputData","getSelectedProductIdFromActionInput","requestContext","apiSettings","Error","GetProductPromotionsInput","recordId","distinctProductVariantId","getCacheKey","this","dataCacheType","Msdyn365","async","ctx","productPromotionsInput","getProductPromotionsInput","Paging","Top","retailAction","context","RadioButtonList","props","_selectedItem$id","_selectedItem","_console","telemetryContent","dropdownList","dropdownName","onChange","dropdownId","defaultFirstOption","selectedItem","find","item","isDefault","selectedId","setSelectedId","React","payLoad","getPayloadObject","handleOnChange","currentSelectedId","isValid","selectId","selectedValue","value","i","length","console","warn","attribute","getTelemetryAttributes","Object","assign","className","map","key","classnames","isDisabled","type","name","checked","evt","getBuyboxProductConfigure","state","callbacks","productDetails","selectedDimensions","allDimensions","_props$data$product","_props$data$productDi","_props$data$productDi2","resources","typeName","errorState","configureErrors","getDropdownName","product","data","result","productDimensionsData","productDimensions","enableStockCheck","app","config","hasProductDimensions","ArrayExtensions","hasElements","_getClassNamePrefix","getTelemetryObject","request","telemetryPageName","telemetry","inventoryLevel","dimensionsInfo","onChanged","otherDimensions","notification","dimensionValuesWithInventory","pd","DimensionTypeValue","toString","dv","_dv$DimensionValue","DimensionValue","Value","targetProductId","ProductIds","productDimensionFull","_dv$ProductIds","RecordId","_onChanged","dimensionSelectedAsync","matchedDimensions","getDimensionValuesFromQuery","url","requestUrl","validDimensionIds","selectedOtherDimensions","filter","md","matchFound","productIds","currentDimension","_productDimensions$fi","cdi","v","_v$DimensionValue","_currentDimension$Dim","toLowerCase","val","_ref","_productDimensionFull","DimensionValues","_value$DimensionValue","_value$DimensionValue2","ObjectExtensions","isNullOrUndefined","_dimensionValuesWithI","_dimensionValue$Value","dimensionValue","inventoryLevelCode","getInventoryLevelCodeFromDimensionValue","colorHexCode","ColorHexCode","imageUrl","ImageUrl","InventoryLevelValues","outOfStock","dimensionInfo","currentDimensionsFromQuery","dimensionFromQuery","currentDimensionFromQuery","selectedDimensionItem","dimensionItem","_currentDimensionFrom","toLocaleLowerCase","dropdowns","_props$dropdownList$","dimensionId","Number","parseInt","dropdownToggleName","format","selectDimensionFormatString","errorMessage","dimensionSelectionType","SelectionType","dropdown","dimensionType","convertProductDimensionTypeToDimensionTypes","dimensionsAsSwatchConfiguration","dimensionsAsSwatchType","includes","DimensionTypes","none","swatch","hiddenClass","size","ContainerProps","LabelContainerProps","tag","htmlFor","errors","role","heading","select","dropdownCallback","Dropdown","selectionType","mapProductDimensionFullToDropdownViewProps","_objectSpread","dimensionChanged","GetCategoryPathsInput","categoryPathLooksups","buildCacheKey","base","constructedCacheKey","locale","catalogId","getLocale","ChannelId","CatalogId","getCatalogId","forEach","categoryPath","ProductId","createGoogleAnalyticsEvent","cart","eventName","actionContext","_actionContext$reques","channel","items","CartLines","cartLine","_product$Dimensions","_cartLine$DiscountLin","_product$ExtensionPro","_product$Name","_product$Price","_cartLine$Quantity","getProductDetails","variant","Dimensions","d","_d$DimensionValue","join","discount","DiscountLines","reduce","a","b","_b$Amount","Amount","brand","ExtensionProperties","ep","Key","StringValue","recId","item_id","ProductNumber","ItemId","item_name","Name","index","item_variant","price","Price","pid","item_brand","quantity","Quantity","push","event","ecommerce","currency","_b$price","pushGoogleAnalyticsEvent","payload","dataLayer","window","gaItem","_payload$ecommerce$it","_payload$ecommerce","categoryPaths","getCategoryPaths","_categoryPaths$0$Name","_categoryPaths$1$Name","_categoryPaths$2$Name","_categoryPaths$3$Name","_categoryPaths$4$Name","item_category","undefined","item_category2","item_category3","item_category4","item_category5","sendGoogleAnalyticsEvent","products","gaItems","prices","ProductsDataActions","callerContext","p","Date","_productPrice$Discoun","_p$count","brandFromExt","productPrice","EffectiveAmount","count","totalValue","err","error","lastCached","useGoogleAnalytics","deps","isBrowser","MsDyn365","cacheKey","_payload$ecommerce4","_payload$ecommerce2","_payload$ecommerce3","_payload$ecommerce5","transaction_id","createCanonicalUrl","paths","page","_context$requestConte","canonicalDomain","sitePath","toSlug","s","text","replace","ProductStockStatusEnum","findAttribute","attributes","attributeName","attr","_attr$Name","findAllAttributes","_attr$Name2","findAttributeValue","DataTypeValue","CurrencyCode","DateTimeOffsetValue","FloatValue","IntegerValue","TextValue","BooleanValue","buildProductBadgeUrl","badgeName","baseUrl","suffix","getProductBadgeUrl","badgeAttributeArray","AttributeValues","badgeStatus","badgeValue","BasePrice","getProductStockStatus","extensionProperties","availableProperty","xt","OUT_OF_STOCK","renderProductBadge","_document","mainImage","document","querySelectorAll","querySelector","badgeUrl","baseImageUrl","badgeImage","createElement","src","classList","add","alt","appendChild","_unused","widgetType","itemId","disableSeo","divRef","initialized","setInitialized","div","current","innerHTML","ref","modalCloseButtonReference","onClickFindInStoreHandler","_props$data","storeSelectorStateManager","productAvailableQuantity","modules","selectedProduct","dataProduct","multiplePickupStoreSwitchName","retailMulitplePickupMFeatureState","featureState","IsEnabled","missingDimensions","dimension","storeSelectorId","keys","storeSelector","updateErrorState","errorHost","getConfigureErrors","openDialog","parentElementRef","deliveryOptions","onLocationSelected","orgUnitLocation","deliveryMode","_props$context","Promise","resolve","productsToAdd","location","behavior","addToCartBehavior","customWindow","__warranty__","addProductsToCart","then","status","substatus","productAvailability","changeModalOpen","ProductAvailableQuantity","shippingInventory","shipping","deliveryType","DeliveryMode","pickup","failureResult","failureReason","cartActionResult","otherError","getGenericError","updateExtensionProperties","newExtensionProperties","navigationUrl","getUrlSync","AddToCartBehavior","goToCart","showModal","showNotification","_props$data$productPr2","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","friendlyName","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","closeNotificationLabel","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","addedQuantityText","ItemSuccessfullyAddedToCartNotification","gridSettings","NotificationsManager","instance","addNotification","catch","exception","debug","message","findInStoreOnClick","getBuyboxFindInStore","_data$product","_data$productPrice","_data$storeSelectorSt","_data$cart","_data$deliveryOptions","_data$productAvailabl","_data$featureState","_data$channelDelivery","_props$data$productPr","slots","findInStoreHeaderText","PickupDeliveryModeCode","channelDeliveryOptionConfig","_dimension$DimensionV","quantityError","modalOpen","isSectionDisabled","buttonText","description","isStockCheck","buyboxResources","isLoading","pickupInventory","findInStoreLinkText","findInStoreDescriptionText","isAggregatedInventory","_pickupInventory","IsProductAvailable","findInStoreNotAvailableTextButton","findInStoreNotAvailableDescription","getFindInStoreInventorySettings","DeliveryOptions","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","deliveryCode","Code","PickupDeliveryModeCodes","option","priceComponent","PriceComponent","popupProps","imageSettings","productQuantity","setModalOpen","renderModalPopup","Popup","openFindInStoreDialog","Heading","headingTag","productPickupOptionList","BuyboxErrorBlock","showError","button","onClick","color","disabled","title","modal","Buybox","dimensionUpdateQueue","FinitePromiseQueue","dimensions","buyboxCallbacks","updateQuantity","newQuantity","setState","newErrorState","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productDeliveryOptions","_updatePrice","selectedDimensionId","selectedDimensionValueId","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","_getDropdownName","isModalOpen","changeUpdatingDimension","isUpdatingDimension","changeUpdatingDeliveryOptions","isUpdatingDeliveryOptions","updateKeyInPrice","customPrice","customAmountError","isPriceKeyedIn","keyInPriceAmount","mountCategories","packSizeCategories","_onBulkPurchaseLinkClick","bulkPurchaseModule","boundingRect","getBoundingClientRect","scrollTo","left","top","dimensionsToUpdate","clearErrorState","previousState","_getProductVariant","productVariant","productVariantPromise","promises","_getDimensionsForSelectedVariant","mappedDimensions","_hydrateInventoryInfo","_hydratePrice","_hydrateDeliveryOptions","_updateQuantitiesInState","all","_this$props$data$prod","_this$props$data$prod2","isGiftCard","IsGiftCard","leafCategories","productDimensionTypeColor","productDimensionTypeConfiguration","leafCategory","split","productDimensionTypeMount","productDimensionTypeSize","productDimensionTypePackSize","productDimensionTypeAmount","productDimensionTypeStyle","min","max","c","ItemTypeValue","ReleasedProductType","Service","isServiceItem","maxRecentlyViewedItemsCount","RecentlyViewedState","render","_this$props$data$prod3","mediaGallery","productComparisonButton","flatten","validValues","hasAvailableProducts","some","viewProps","ModuleProps","moduleProps","ProductInfoContainerProps","MediaGalleryContainerProps","getBuyboxProductTitle","getBuyboxProductDescription","bulkPurchaseLink","_renderBuyboxBulkPurchaseLink","unitOfMeasure","getBuyboxProductUnitOfMeasure","configure","defaultToUniqueOption","findInStore","getBuyboxProductPrice","addToCart","getBuyboxAddToCart","getBuyboxProductComparisonButton","addToOrderTemplate","getBuyboxProductAddToOrderTemplate","addToWishlist","getBuyboxProductAddToWishlist","rating","hideRating","getBuyboxProductRating","getBuyboxProductQuantity","inventoryLabel","getBuyBoxInventoryLabel","shopSimilarLook","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","Looks","shopSimilarDescription","enableShopSimilarDescription","Description","keyInPrice","enableKeyInPrice","isCustomPriceSelected","getBuyboxKeyInPrice","quantityLimitsMessages","getQuantityLimitsMessages","renderView","isBulkPurchaseEnabled","msdyn365Commerce","bulkPurchaseModules","Array","from","getElementsByClassName","BulkPurchase","Button","bulkPurchaseLinkText","arguments","CustomerContextualPrice","_dimension$dimensionV","_dimensions$find$Dime","_dimensions$find","setDimensionValuesToQuery","selectedProductPromise","getSelectedVariant","SelectedVariantInput","MasterProductId","getDimensionsForSelectedVariant","_productVariant$Dimen","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","newShippingQuantity","getPriceForSelectedVariant","PriceForSelectedVariantInput","_this$props$data$feat","retailMultiplePickupFeatureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","_product$Behavior","_product$Behavior2","_product$Behavior3","_product$Behavior4","_isOrderQuantityLimitsFeatureEnabled","Behavior","MinimumQuantity","MaximumQuantity","maxQuantityForCartLineItem","_this$props$context","_featureStatuses$find","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","featureStatuses","RetailDefaultOrderQuantityLimitsFeatureName","customerInfo","customerInformation","information","IsB2b","_renderAddToCart","errorBlock","Node","_renderAddToOrderTemplate","_renderAddToWishlist","_renderConfigure","_renderConfigureDropdown","_renderSocialShare","socialShare","_renderFindInStore","_renderQuantity","_renderKeyInPrice","_renderShopSimilarItem","shopSimilarItem","Module","tenantId","getRnrPartnerId","serviceEndPoint","getRnrEndpointId","productResult","productAvailabilities","getCartStateData","GetCartStateDataInput","cartState","getRatingsSummary","GetRatingsSummaryInput","ratingsSummaryData","ratingsSummary","getValidProductImages","actionInput","MediaLocationsForSelectedVariantInput","getMediaLocationsForSelectedVariant","mediaLocations","mediaLocation","imageData","Uri","altText","AltText","imageSettingsVal","imageConcatVal","http","XMLHttpRequest","open","addEventListener","send","validateMediaLocaionAsync","pairs","pair","AuthorizedDealerBadge","fileName","toUpperCase","categoryImageUrl","generateImageUrl","ImageData","loadFailureBehavior","MfrCode","_productInfo$Extensio","productInfo","mfrCodeLabel","mfrCode","HideablePrice","attributeValues","seePriceInCartLabel","hidePrice","useMemo","hidePriceAttribute","hidePriceValue","ProductPromotions","variantId","productPromo","setProductPromo","useEffect","getProductPromotionsAsync","offers","o","OfferId","_o$OfferId","href","refreshAddThis","refreshed","waitForScriptCount","addthis","setTimeout","layers","refresh","childDiv","WarrantySelection","warrantyGroups","selectedWarranty","formatPriceFn","setSelectedWarranty","handleWarrantyChange","target","warranty","Warranties","Boolean","isArray","productProtectionLabel","noPlanSelectedLabel","Fragment","Duration","getWarrantyDurationLabel","valueEnum","isPlural","valueLabel","dayLabel","monthLabel","yearLabel","DurationUnitValue","AdjustedPrice","ProductWarranty","extentionResources","setWarrantySelected","setWarrantyGroups","_data$0$WarrantyGroup","_data$","getApplicableWarrantiesAsync","WarrantyGroups","updateSelectedWarranty","_selectedWarranty$Rec","cultureFormatter","formatCurrency","JsonLinkingData","_productInfo$Extensio2","_productInfo$Name","_request$channel","_productPrice$Custome2","_productPrice$Custome","gtmProduct","ld","getProductUrl","simpleProductData","productUrl","getProductUrlSync","image","PrimaryImageUrl","sku","mpn","canonicalUrl","priceCurrency","Currency","HtmlHeadInclude","dangerouslySetInnerHTML","__html","JSON","stringify","ProductBadge","discountAmount","DiscountAmount","_renderTextBlock","textBlocks","_renderCartAndActions","onChangeHandler","newValue","quantityComponent","warrantyIsSelected","IncrementalQuantity","currentCount","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","minQuantityText","maxQuantityText","_renderAvailability","_props$data$product$r","_props$data$productAv","availDate","StockLevelCode","expectedAvailabilityLabel","_productInfo$Behavior","_productInfo$ProductN","_request$sitePath","warrantySelected","urlTokens","setAttributeValues","getAttributeValuesAsync","productPriceData","hasSerialNumber","HasSerialNumber","variantSku","bandAttribute","gaPayload","_productInfo$Dimensio","_categoryPaths$result","_categoryPaths$result2","_productInfo$Dimensio2","_productPriceData$Dis","_productPriceData$Cus","_productPriceData$Bas","_productInfo$ItemId","webCodeLabel","Bazzarvoice","rating_summary","AddThisShare","binding","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","require","$type","da","path","runOn","iNM","ns","n","pdp","__bindings__","viewDictionary","cn","BaseStoreSelectorStateManager","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","isMapModuleLoaded","_readFromToCookie","storeInfo","parse","preferredStore","_context","storeId","selectedStoreLocationId","storeName","writeToCookie","StoreId","StoreName","Latitude","Longitude","_writeToCookie","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","localStorage","removeItem","setItem","cookieValue","getItem","__decorate","computed","observable","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","trim","query","encodeURI","geolocationApiUrl","script","setAttribute","remove","resourceSets","point","coordinates","body","StringExtensions","isNullOrEmpty","getElementById","currentWindowAPI","mapAPIReady","isMapApiLoaded","lang","market","reject","_document2","_document3","defer","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","getGenericAction","module","exports","ReactDOM"],"sourceRoot":""}