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AAA,CADCh8B,EAAAA,IAAM,+BC9DX,MAIau+B,GAA6Bz+B,EAAAA,EAAAA,IAA2B,CACjEE,OAA6Cw+B,EAAAA,iBAC7Ct+B,MAN2CC,GACpCk+B,EAA8B,IAAIlC,KAQ7C,WCxBAsC,EAAOC,QAAUl8B,cCAjBi8B,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};\r\n\r\nconst Bazzarvoice = (props: BazzarvoiceProps) => {\r\n const { itemId, widgetType, className } = 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, 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 // 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","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","lang","market","reject","_document2","_document3","defer","mapAPIReady","isMapApiLoaded","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","getGenericAction","module","exports","ReactDOM"],"sourceRoot":""}