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,UACN0S,EAAS,MACTtC,EAAK,UACLhC,EAAS,eACTnO,EAAc,gBACdC,EAAe,WACftB,EAAU,uBACVykB,EAAsB,IACtB3C,EAAG,uBACHvgB,EAAsB,cACtBC,GACAhB,EAEJ,OACI/C,EAAAA,cAAC0G,EAAAA,OAAMxG,OAAAC,OAAA,GAAKmD,GACRtD,EAAAA,cAACC,EAAAA,KAAIC,OAAAC,OAAA,GAAKoD,GAA6BR,EAAM4D,cAC7C3G,EAAAA,cAACC,EAAAA,KAAIC,OAAAC,OAAA,GAAKqD,GACLE,EACAD,EACAM,EACAhB,EAAM8D,iBACNrF,EACAqpB,EAAiB9nB,EAAMkB,MAAM6mB,YAC7BnnB,EACAlD,GAAaD,EAAiBC,GAC9B8B,GAAcD,EAAkBC,GAChCH,GAAYD,EAAgBC,EAAUiU,EAAWtT,EAAOgR,EAAOhC,EAAWiV,EAAwB3C,EAAK/J,GACvG1W,EACAmnB,EAAsBnrB,EAAWS,EAAoBE,GACrDe,GAAeD,EAAmBC,GAClCT,EAAmBkC,EAAMkB,OAASlB,EAAMkB,MAAMnD,aAC9C+C,GAAmBrB,EAAuBqB,GAC1CC,GAA0BtB,EAAuBsB,aC5ElE8nB,EAAOC,QAAU7rB,cCAjB4rB,EAAOC,QAAUC","sources":["webpack://bju-press/./src/themes/base/views/buybox.view.tsx?0647","webpack://bju-press/./src/themes/christian-school/views/buybox.view.tsx?e537","webpack://bju-press/./src/themes/homeschool/views/buybox.view.tsx?e8a4","webpack://bju-press/./src/utilities/analytics/analytics-dispatcher.ts?75be","webpack://bju-press/./src/utilities/data-attribute-parser.ts?7345","webpack://bju-press/./src/utilities/global-constants.ts?5882","webpack://bju-press/./src/utilities/variable-replacer.ts?aee0","webpack://bju-press/./lib/buybox/module-registration.js?bcce","webpack://bju-press/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://bju-press/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://bju-press/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://bju-press/./src/modules/bulk-purchase/bulk-purchase.tsx?9fd5","webpack://bju-press/./src/modules/buybox/components/buybox-find-in-store.tsx?3ef8","webpack://bju-press/./src/modules/buybox/buybox.tsx?e22d","webpack://bju-press/./src/modules/buybox/buybox.view.tsx?376b","webpack://bju-press/./src/modules/fabrikam/views/buybox.view.tsx?aec4","webpack://bju-press/external var \"React\"?0d3b","webpack://bju-press/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\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 { 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 IBuyboxFindInStoreViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Utility imports for customizations\r\n//----------------------------------------------------------\r\nimport { convertProductAttributes } from '../../../utilities/data-attribute-parser';\r\nimport { attrNames, labelResources } from '../../../utilities/global-constants';\r\nimport { varReplace } from '../../../utilities/variable-replacer';\r\n//----------------------------------------------------------\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Added imports for additional config from\r\n// extended definition\r\n//----------------------------------------------------------\r\nimport { IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { RichText, RichTextComponent } from '@msdyn365-commerce/core';\r\nimport { IBuyboxProps } from '../definition-extensions/buybox.ext.props.autogenerated';\r\nimport { IBuyboxData } from './buybox.data';\r\n//----------------------------------------------------------\r\n\r\n// @CUSTOM: imports analytics\r\nimport { publish } from '../../../utilities/analytics/analytics-dispatcher';\r\nimport { SingleProductEvent } from '../../../utilities/analytics/analytics-events';\r\n\r\nlet sentAnalytics = false;\r\n\r\nconst BuyboxView: React.FC> = props => { // @CUSTOM: Added extended definition props and data\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 slots, // @CUSTOM: Added extended definition slots\r\n data // @CUSTOM: To get product data for description and item ID\r\n } = props;\r\n\r\n // @CUSTOM: PDP view analytics\r\n if (!sentAnalytics && typeof window !== 'undefined') {\r\n\r\n const product = props.data.product.result;\r\n\r\n setTimeout(() => {\r\n // @CUSTOM: send pdpview event here to ensure subscribe has fired\r\n if (product && !sentAnalytics) {\r\n sentAnalytics = true;\r\n\r\n const productPrice = props.data.productPrice.result;\r\n\r\n const analyticsProductData: SingleProductEvent = {\r\n itemID: product.ItemId || '',\r\n name: product.Name || '',\r\n discount: productPrice?.DiscountAmount,\r\n variant: '',\r\n quantity: 1,\r\n price: productPrice?.BasePrice || product.Price,\r\n currency: props.context.request.channel?.Currency || 'USD'\r\n };\r\n publish('productDetailView', analyticsProductData);\r\n }\r\n }, 0);\r\n }\r\n\r\n //------------------------------------------------------\r\n // @CUSTOM: Get converted product attributes\r\n //------------------------------------------------------\r\n const productSpecificationData = data?.productSpecificationData?.result;\r\n const productAttributes = productSpecificationData && convertProductAttributes(productSpecificationData);\r\n //-------------------------------------------------------\r\n\r\n // @CUSTOM: override short description field with product attribute\r\n let productDescriptionOverride;\r\n if (props.config.descriptionOverride && productAttributes) {\r\n const productDescriptionOverrideText = productAttributes[props.config.descriptionOverride];\r\n if (productDescriptionOverrideText) {\r\n productDescriptionOverride =

{productDescriptionOverrideText}

;\r\n }\r\n }\r\n\r\n //------------------------------------------------------\r\n // @CUSTOM: Getting product item ID for SKU display\r\n //------------------------------------------------------\r\n const productData = data?.product?.result;\r\n const itemId = productData?.ItemId;\r\n const skuDisplay = (\r\n
\r\n {labelResources.sku}\r\n {itemId}\r\n
\r\n );\r\n //------------------------------------------------------\r\n\r\n // @CUSTOM: backorder customization\r\n const productAvail = props.data.backorderAvail.result;\r\n\r\n // @CUSTOM: unbuyable customization\r\n const unbuyable = productAttributes && productAttributes[attrNames.notBuyable] as string;\r\n\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {title}\r\n {/* @CUSTOM: price moved to below description */}\r\n {/* @CUSTOM: PowerReviews slot */}\r\n {slots.reviewSnippet?.length && _renderSlotItems(slots.reviewSnippet)}\r\n {unitOfMeasure}\r\n {props.bulkPurchaseLink}\r\n {/* @CUSTOM: override short description field with product attribute */}\r\n {productDescriptionOverride || description}\r\n {/* @CUSTOM: Kit selector module slot */}\r\n {slots.kitSelector?.length && _renderSlotItems(slots.kitSelector)}\r\n {slots.kitCustomizer?.length && _renderSlotItems(slots.kitCustomizer)}\r\n {/* @CUSTOM: Product SKU display */}\r\n {skuDisplay}\r\n {price}\r\n {rating}\r\n {configure && _renderConfigure(configure)}\r\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {/* @CUSTOM: backorder customization */}\r\n {productAvail && _renderBackOrder(productAvail, props.config.backOrderText)}\r\n {/* @CUSTOM: Unbuyable customization */}\r\n {unbuyable && (\r\n
\r\n \r\n
\r\n )}\r\n\r\n {/* @CUSTOM: Moved elements below inside a container div */}\r\n {!unbuyable &&
\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
}\r\n {/* @CUSTOM: Blacklisted shipping areas */}\r\n {props.config.blacklistedShippingAreasText && productAttributes && productAttributes[attrNames.blacklistedShippingAreas] && (\r\n
\r\n \r\n
\r\n )}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n {productComparisonButton}\r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\r\n {slots.installmentCal?.length && _renderSlotItems(slots.installmentCal)}\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\n// @CUSTOM: backorder customization\r\nconst _renderBackOrder = (productAvailableQuantity: IProductInventoryInformation[], text: RichText | undefined): JSX.Element | null => {\r\n\r\n const isAvail = productAvailableQuantity?.find(avail => {\r\n return avail.IsProductAvailable\r\n });\r\n\r\n if (isAvail) {\r\n return null;\r\n }\r\n\r\n return (\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\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Render slot items\r\n//----------------------------------------------------------\r\nconst _renderSlotItems = (items: React.ReactNode[]): JSX.Element => {\r\n return (\r\n <>\r\n {items.map((slot: React.ReactNode, index: number) => (\r\n \r\n {slot}\r\n \r\n ))}\r\n \r\n );\r\n}\r\n//----------------------------------------------------------\r\n\r\nexport default BuyboxView;\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 { 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 IBuyboxFindInStoreViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Utility imports for customizations\r\n//----------------------------------------------------------\r\nimport { convertProductAttributes } from '../../../utilities/data-attribute-parser';\r\nimport { attrNames, labelResources } from '../../../utilities/global-constants';\r\nimport { varReplace } from '../../../utilities/variable-replacer';\r\n//----------------------------------------------------------\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Added imports for additional config from\r\n// extended definition\r\n//----------------------------------------------------------\r\nimport { IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { RichText, RichTextComponent } from '@msdyn365-commerce/core';\r\nimport { IBuyboxProps } from '../definition-extensions/buybox.ext.props.autogenerated';\r\nimport { IBuyboxData } from './buybox.data';\r\n//----------------------------------------------------------\r\n\r\n// @CUSTOM: imports analytics\r\nimport { publish } from '../../../utilities/analytics/analytics-dispatcher';\r\nimport { SingleProductEvent } from '../../../utilities/analytics/analytics-events';\r\n\r\nlet sentAnalytics = false;\r\n\r\nconst BuyboxView: React.FC> = props => { // @CUSTOM: Added extended definition props and data\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 slots, // @CUSTOM: Added extended definition slots\r\n data // @CUSTOM: To get product data for description and item ID\r\n } = props;\r\n\r\n // @CUSTOM: PDP view analytics\r\n if (!sentAnalytics && typeof window !== 'undefined') {\r\n\r\n const product = props.data.product.result;\r\n\r\n setTimeout(() => {\r\n // @CUSTOM: send pdpview event here to ensure subscribe has fired\r\n if (product && !sentAnalytics) {\r\n sentAnalytics = true;\r\n\r\n const productPrice = props.data.productPrice.result;\r\n\r\n const analyticsProductData: SingleProductEvent = {\r\n itemID: product.ItemId || '',\r\n name: product.Name || '',\r\n discount: productPrice?.DiscountAmount,\r\n variant: '',\r\n quantity: 1,\r\n price: productPrice?.BasePrice || product.Price,\r\n currency: props.context.request.channel?.Currency || 'USD'\r\n };\r\n publish('productDetailView', analyticsProductData);\r\n }\r\n }, 0);\r\n }\r\n\r\n //------------------------------------------------------\r\n // @CUSTOM: Get converted product attributes\r\n //------------------------------------------------------\r\n const productSpecificationData = data?.productSpecificationData?.result;\r\n const productAttributes = productSpecificationData && convertProductAttributes(productSpecificationData);\r\n //-------------------------------------------------------\r\n\r\n // @CUSTOM: override short description field with product attribute\r\n let productDescriptionOverride;\r\n if (props.config.descriptionOverride && productAttributes) {\r\n const productDescriptionOverrideText = productAttributes[props.config.descriptionOverride];\r\n if (productDescriptionOverrideText) {\r\n productDescriptionOverride =

{productDescriptionOverrideText}

;\r\n }\r\n }\r\n\r\n //------------------------------------------------------\r\n // @CUSTOM: Getting product item ID for SKU display\r\n //------------------------------------------------------\r\n const productData = data?.product?.result;\r\n const itemId = productData?.ItemId;\r\n const skuDisplay = (\r\n
\r\n {labelResources.sku}\r\n {itemId}\r\n
\r\n );\r\n //------------------------------------------------------\r\n\r\n // @CUSTOM: backorder customization\r\n const productAvail = props.data.backorderAvail.result;\r\n\r\n // @CUSTOM: unbuyable customization\r\n const unbuyable = productAttributes && productAttributes[attrNames.notBuyable] as string;\r\n\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {title}\r\n {/* @CUSTOM: price moved to below description */}\r\n {/* @CUSTOM: PowerReviews slot */}\r\n {slots.reviewSnippet?.length && _renderSlotItems(slots.reviewSnippet)}\r\n {unitOfMeasure}\r\n {props.bulkPurchaseLink}\r\n {/* @CUSTOM: override short description field with product attribute */}\r\n {productDescriptionOverride || description}\r\n {/* @CUSTOM: Kit selector module slot */}\r\n {slots.kitSelector?.length && _renderSlotItems(slots.kitSelector)}\r\n {slots.kitCustomizer?.length && _renderSlotItems(slots.kitCustomizer)}\r\n {/* @CUSTOM: Product SKU display */}\r\n {skuDisplay}\r\n {price}\r\n {rating}\r\n {configure && _renderConfigure(configure)}\r\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {/* @CUSTOM: backorder customization */}\r\n {productAvail && _renderBackOrder(productAvail, props.config.backOrderText)}\r\n {/* @CUSTOM: Unbuyable customization */}\r\n {unbuyable && (\r\n
\r\n \r\n
\r\n )}\r\n\r\n {/* @CUSTOM: Moved elements below inside a container div */}\r\n {!unbuyable &&
\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
}\r\n {/* @CUSTOM: Blacklisted shipping areas */}\r\n {props.config.blacklistedShippingAreasText && productAttributes && productAttributes[attrNames.blacklistedShippingAreas] && (\r\n
\r\n \r\n
\r\n )}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n {productComparisonButton}\r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\r\n {slots.installmentCal?.length && _renderSlotItems(slots.installmentCal)}\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\n// @CUSTOM: backorder customization\r\nconst _renderBackOrder = (productAvailableQuantity: IProductInventoryInformation[], text: RichText | undefined): JSX.Element | null => {\r\n\r\n const isAvail = productAvailableQuantity?.find(avail => {\r\n return avail.IsProductAvailable\r\n });\r\n\r\n if (isAvail) {\r\n return null;\r\n }\r\n\r\n return (\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\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Render slot items\r\n//----------------------------------------------------------\r\nconst _renderSlotItems = (items: React.ReactNode[]): JSX.Element => {\r\n return (\r\n <>\r\n {items.map((slot: React.ReactNode, index: number) => (\r\n \r\n {slot}\r\n \r\n ))}\r\n \r\n );\r\n}\r\n//----------------------------------------------------------\r\n\r\nexport default BuyboxView;\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 { 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 IBuyboxFindInStoreViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Utility imports for customizations\r\n//----------------------------------------------------------\r\nimport { convertProductAttributes } from '../../../utilities/data-attribute-parser';\r\nimport { attrNames, labelResources } from '../../../utilities/global-constants';\r\nimport { varReplace } from '../../../utilities/variable-replacer';\r\n//----------------------------------------------------------\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Added imports for additional config from\r\n// extended definition\r\n//----------------------------------------------------------\r\nimport { IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { RichText, RichTextComponent } from '@msdyn365-commerce/core';\r\nimport { IBuyboxProps } from '../definition-extensions/buybox.ext.props.autogenerated';\r\nimport { IBuyboxData } from './buybox.data';\r\n//----------------------------------------------------------\r\n\r\n// @CUSTOM: imports analytics\r\nimport { publish } from '../../../utilities/analytics/analytics-dispatcher';\r\nimport { SingleProductEvent } from '../../../utilities/analytics/analytics-events';\r\n\r\nlet sentAnalytics = false;\r\n\r\nconst BuyboxView: React.FC> = props => { // @CUSTOM: Added extended definition props and data\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 slots, // @CUSTOM: Added extended definition slots\r\n data // @CUSTOM: To get product data for description and item ID\r\n } = props;\r\n\r\n // @CUSTOM: PDP view analytics\r\n if (!sentAnalytics && typeof window !== 'undefined') {\r\n\r\n const product = props.data.product.result;\r\n\r\n setTimeout(() => {\r\n // @CUSTOM: send pdpview event here to ensure subscribe has fired\r\n if (product && !sentAnalytics) {\r\n sentAnalytics = true;\r\n\r\n const productPrice = props.data.productPrice.result;\r\n\r\n const analyticsProductData: SingleProductEvent = {\r\n itemID: product.ItemId || '',\r\n name: product.Name || '',\r\n discount: productPrice?.DiscountAmount,\r\n variant: '',\r\n quantity: 1,\r\n price: productPrice?.BasePrice || product.Price,\r\n currency: props.context.request.channel?.Currency || 'USD'\r\n };\r\n publish('productDetailView', analyticsProductData);\r\n }\r\n }, 0);\r\n }\r\n\r\n //------------------------------------------------------\r\n // @CUSTOM: Get converted product attributes\r\n //------------------------------------------------------\r\n const productSpecificationData = data?.productSpecificationData?.result;\r\n const productAttributes = productSpecificationData && convertProductAttributes(productSpecificationData);\r\n //-------------------------------------------------------\r\n\r\n // @CUSTOM: override short description field with product attribute\r\n let productDescriptionOverride;\r\n if (props.config.descriptionOverride && productAttributes) {\r\n const productDescriptionOverrideText = productAttributes[props.config.descriptionOverride];\r\n if (productDescriptionOverrideText) {\r\n productDescriptionOverride =

{productDescriptionOverrideText}

;\r\n }\r\n }\r\n\r\n //------------------------------------------------------\r\n // @CUSTOM: Getting product item ID for SKU display\r\n //------------------------------------------------------\r\n const productData = data?.product?.result;\r\n const itemId = productData?.ItemId;\r\n const skuDisplay = (\r\n
\r\n {labelResources.sku}\r\n {itemId}\r\n
\r\n );\r\n //------------------------------------------------------\r\n\r\n // @CUSTOM: backorder customization\r\n const productAvail = props.data.backorderAvail.result;\r\n\r\n // @CUSTOM: unbuyable customization\r\n const unbuyable = productAttributes && productAttributes[attrNames.notBuyable] as string;\r\n\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {title}\r\n {/* @CUSTOM: price moved to below description */}\r\n {/* @CUSTOM: PowerReviews slot */}\r\n {slots.reviewSnippet?.length && _renderSlotItems(slots.reviewSnippet)}\r\n {unitOfMeasure}\r\n {props.bulkPurchaseLink}\r\n {/* @CUSTOM: override short description field with product attribute */}\r\n {productDescriptionOverride || description}\r\n {/* @CUSTOM: Kit selector module slot */}\r\n {slots.kitSelector?.length && _renderSlotItems(slots.kitSelector)}\r\n {slots.kitCustomizer?.length && _renderSlotItems(slots.kitCustomizer)}\r\n {/* @CUSTOM: Product SKU display */}\r\n {skuDisplay}\r\n {price}\r\n {rating}\r\n {configure && _renderConfigure(configure)}\r\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {/* @CUSTOM: backorder customization */}\r\n {productAvail && _renderBackOrder(productAvail, props.config.backOrderText)}\r\n {/* @CUSTOM: Unbuyable customization */}\r\n {unbuyable && (\r\n
\r\n \r\n
\r\n )}\r\n\r\n {/* @CUSTOM: Moved elements below inside a container div */}\r\n {!unbuyable &&
\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
}\r\n {/* @CUSTOM: Blacklisted shipping areas */}\r\n {props.config.blacklistedShippingAreasText && productAttributes && productAttributes[attrNames.blacklistedShippingAreas] && (\r\n
\r\n \r\n
\r\n )}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n {productComparisonButton}\r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\r\n {slots.installmentCal?.length && _renderSlotItems(slots.installmentCal)}\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\n// @CUSTOM: backorder customization\r\nconst _renderBackOrder = (productAvailableQuantity: IProductInventoryInformation[], text: RichText | undefined): JSX.Element | null => {\r\n\r\n const isAvail = productAvailableQuantity?.find(avail => {\r\n return avail.IsProductAvailable\r\n });\r\n\r\n if (isAvail) {\r\n return null;\r\n }\r\n\r\n return (\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\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Render slot items\r\n//----------------------------------------------------------\r\nconst _renderSlotItems = (items: React.ReactNode[]): JSX.Element => {\r\n return (\r\n <>\r\n {items.map((slot: React.ReactNode, index: number) => (\r\n \r\n {slot}\r\n \r\n ))}\r\n \r\n );\r\n}\r\n//----------------------------------------------------------\r\n\r\nexport default BuyboxView;\r\n","//==============================================================================\r\n// Analytics Event Dispatcher (Simple Pub-Sub system)\r\n//\r\n// This module receives events and forwards them to the appropriate handlers\r\n// Subscriptions are managed using a subscriber ID to aid in unsubscribing\r\n//\r\n// NOTE: Singletons aren't compatible with SSR. This module acts as a singleton,\r\n// maintaining its data as a global. Modules MUST call subscribe on the client\r\n// ONLY (via componentDidMount).\r\n//\r\n// @TODO: Currently, only client-side events will be processed. Events generated\r\n// during server-side renders will be lost. If we move data to a data action\r\n// it can be persisted from server to client. That will allow us to queue up\r\n// events generated on the server or before subscriptions occur, and emit\r\n// them immediately upon subscription.\r\n//==============================================================================\r\nimport { EventHandler } from \"./analytics-events\";\r\n\r\n//==============================================================================\r\n// INTERFACES\r\n//==============================================================================\r\n\r\n// List of subscribers to a single event\r\ninterface EventSubscribers {\r\n [subscriber: string]: EventHandler;\r\n}\r\n\r\n//==============================================================================\r\n// GLOBALS\r\n//==============================================================================\r\n\r\n// List of subscriptions, organized by event name and then subscriber name\r\nconst subscriptions: { [eventName: string]: EventSubscribers } = {};\r\n\r\n//==============================================================================\r\n// FUNCTIONS\r\n//==============================================================================\r\n\r\n//==========================================================\r\n// Called by event emitters when an event occurs\r\n//\r\n// NOTE: This should only be called on the client! Events on\r\n// the server will be lost. They should instead be queued\r\n// via a data action cache.\r\n//==========================================================\r\nexport function publish(eventName: string, eventData: unknown): void {\r\n\r\n // Get the list of subscribers for this event\r\n const subscribers = Object.keys(subscriptions[eventName] || {});\r\n\r\n // Notify each subscriber\r\n subscribers.forEach(subscriber => subscriptions[eventName][subscriber](eventData));\r\n}\r\n\r\n//==========================================================\r\n// Called by event handlers when they self-register for events\r\n//==========================================================\r\nexport function subscribe(subscriber: string, eventName: string, handler: EventHandler): void {\r\n\r\n // If it's a new event, create an entry\r\n subscriptions[eventName] = subscriptions[eventName] || {};\r\n\r\n // Ensure this subscriber isn't already subscribed to this event\r\n if (subscriptions[eventName][subscriber]) {\r\n throw new Error(`Duplicate subscription request for ${subscriber}: ${eventName}`);\r\n }\r\n\r\n // Add the subscription\r\n subscriptions[eventName][subscriber] = handler;\r\n}\r\n\r\n//==========================================================\r\n// Unsubscribe from a single event\r\n//==========================================================\r\nexport function unsubscribe(subscriber: string, eventName: string): void {\r\n if (subscriptions[eventName] && subscriptions[eventName][subscriber]) {\r\n delete subscriptions[eventName][subscriber];\r\n }\r\n}\r\n","//==============================================================================\r\n// D365 OData Attribute Parser\r\n//\r\n// In creating this, it became clear that \"attributes\" is a general term.\r\n//\r\n// Product attributes are a first-class entity. They have their own dedicated\r\n// fields and schema.\r\n//\r\n// The more generic term \"attributes\" is used as a generic extension system.\r\n// Almost every entity (including Product Attributes) has an ExtensionProperties\r\n// field for jamming extra information into. In some cases, D365 handles these\r\n// natively, such as sales order line and header attributes, or customer\r\n// attributes. Attributes using ExtensionProperties use the\r\n// CommerceProperty and CommercePropertyValue types.\r\n//\r\n// A major note about ExtensionProperty-based attributes: they have fields\r\n// for many different data types, but there's no indicator as to which\r\n// of the fields is actually used. The consumer of the data is expected to\r\n// know the data type ahead of time. In the case of D365-native attribute users\r\n// such as customers and sales orders, only the string type appears to work.\r\n//\r\n// This module includes parsers for generic ExtensionProperties-based attributes\r\n// and Product Attributes. Though different Product Attribute retail server\r\n// calls use the same AttributeValue entity to transmit the data, they appear\r\n// to return different fields from that entity. Because of this, two different\r\n// parser calls are included here. They currently share the same implementation,\r\n// but by including different call signatures we have the ability to diverge\r\n// the implementations if the need arises.\r\n//\r\n// A note about Product Attributes: These contain both a friendly name,\r\n// displayed to users in back office, and an internal name. The internal name\r\n// can be the same as the friendly name, but by convention we've been pushing\r\n// for a PascalCase scheme. At present, the searchByCriteria call returns only\r\n// the unfriendly name, and the GetAttributeValues call returns only the\r\n// friendly name. We don't have a known method of correlating the two. That may\r\n// be an argument for keeping the friendly and unfriendly names identical.\r\n//==============================================================================\r\nimport {\r\n CommerceProperty, // Generic attributes stored in ExtensionProperties\r\n CommercePropertyValue, // Generic attributes stored in AttributeValue\r\n AttributeValue, AttributeDataType, // Product attributes or Product Search Result attributes\r\n CustomerAttribute, // Customer attributes\r\n IDictionary,\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\n//==============================================================================\r\n// INTERFACES AND CONSTANTS\r\n//==============================================================================\r\nexport type CommerceValueTypes = string | number | boolean | Date;\r\n\r\n// This is me giving up on proper typing. If doing this in TypeScript is possible, I don't know how.\r\n// For the key \"meta\", the type should be a hash of strings.\r\n// For all other keys, the type is a CommerceValueType.\r\nexport type AttributesWithMetadata = {\r\n [key: string]: CommerceValueTypes | IDictionary\r\n};\r\n\r\n// Type to support both internal and friendly name for attributes\r\nexport type AttributesLocalized = {\r\n [key: string]: {\r\n friendlyName?: string,\r\n value?: CommerceValueTypes | IDictionary\r\n }\r\n};\r\n\r\n// Return type for getTypeInfo()\r\ntype TypeData = {\r\n source: keyof AttributeValue,\r\n type: string,\r\n\r\n customerSource?: keyof CommercePropertyValue,\r\n};\r\n\r\n//==============================================================================\r\n// FUNCTIONS\r\n//==============================================================================\r\n\r\n//----------------------------------------------------------\r\n// This version handles ExtensionProperties conversion.\r\n//\r\n// While these have a bunch of potential fields, the value\r\n// is always stored within StringValue.\r\n// There isn't a data type field, so if the content wasn't\r\n// in StringValue we wouldn't know where to find it.\r\n//----------------------------------------------------------\r\nexport function convertExtensionProperties(attributeList: CommerceProperty[]): IDictionary {\r\n const output = {};\r\n\r\n attributeList.forEach(entry => {\r\n if (entry.Key) {\r\n output[entry.Key] = entry.Value?.StringValue; // Ecommerce seems to always use strings.\r\n }\r\n });\r\n\r\n return output;\r\n}\r\n\r\n//----------------------------------------------------------\r\n// For these attributes, the Name is always the friendly\r\n// name.\r\n// KeyName and ExtensionProperties aren't defined.\r\n//\r\n// These results seem to be missing CurrencyValue,\r\n// FloatValue, DateTimeOffsetValue\r\n// I don't know if those data types aren't allowed here.\r\n//\r\n// Return value: Hash of key: property values with variable\r\n// types. There is also a \"meta\" key containing a hash of\r\n// all the attribute keys and their corresponding types.\r\n//\r\n// Example:\r\n// {\r\n// flavor: 'bland',\r\n// calories: 5300,\r\n// meta: {\r\n// flavor: 'string',\r\n// calories: 'number'\r\n// }\r\n// }\r\n//----------------------------------------------------------\r\nexport function convertProductAttributes(attributeList: AttributeValue[]): AttributesWithMetadata {\r\n const output = {\r\n meta: {}\r\n };\r\n\r\n attributeList.forEach(attribute => {\r\n // These should always be present, but TypeScript insists they can be undefined.\r\n if (attribute.Name && attribute.DataTypeValue) {\r\n const typeData = getTypeInfo(attribute.DataTypeValue);\r\n output[attribute.Name] = attribute[typeData.source]; // Ecommerce seems to require strings\r\n output.meta[attribute.Name] = typeData.type;\r\n }\r\n });\r\n\r\n return output;\r\n}\r\n\r\n//----------------------------------------------------------\r\n// For these attributes, the Name is the friendly\r\n// name while KeyName is the internal name.\r\n//\r\n// This makes use of combined attributes containing both\r\n// internal and friendly name to support localization.\r\n//\r\n// Return value: Hash of internal name keys containing an object with both the\r\n// friendly name and attribute value There is also a \"meta\" key containing a\r\n// hash of all the attribute keys and their corresponding types.\r\n//\r\n// Example:\r\n// {\r\n// flavor: {\r\n// friendlyName: Flavor,\r\n// value: 'bland'\r\n// },\r\n// calories: {\r\n// friendlyName: Calories,\r\n// value: 5300\r\n// },\r\n// meta: {\r\n// flavor: 'string',\r\n// calories: 'number'\r\n// }\r\n// }\r\n//----------------------------------------------------------\r\nexport function convertProductAttributesLocalized(attributeList: AttributeValue[]): AttributesLocalized {\r\n const output = {\r\n meta: {}\r\n };\r\n\r\n attributeList.forEach(attribute => {\r\n if (attribute.KeyName && attribute.DataTypeValue) {\r\n const typeData = getTypeInfo(attribute.DataTypeValue);\r\n output[attribute.KeyName] = {\r\n friendlyName: attribute.Name,\r\n value: attribute[typeData.source]\r\n };\r\n output.meta[attribute.KeyName] = typeData.type;\r\n }\r\n });\r\n\r\n return output;\r\n}\r\n\r\n//----------------------------------------------------------\r\n// For these attributes, the\r\n// Name/KeyName/ExtensionProperties is always the unfriendly\r\n// name.\r\n//\r\n// These results are only missing the Swatches field.\r\n//\r\n// Though the returned value is a bit different, at present\r\n// the implementation for convertProductAttributes works for\r\n// search results.\r\n// If they diverge in the future, extend this function.\r\n//----------------------------------------------------------\r\nexport function convertSearchAttributes(attributeList: AttributeValue[]): AttributesWithMetadata {\r\n return convertProductAttributes(attributeList);\r\n}\r\n\r\n//----------------------------------------------------------\r\n// For these attributes, the Name is always the friendly\r\n// name. Value is always Text, and DataTypeValue is not\r\n// present here.\r\n//----------------------------------------------------------\r\nexport function convertCartAttributes(attributeList: AttributeValue[]): AttributesWithMetadata {\r\n const output = {};\r\n\r\n attributeList.forEach(attribute => {\r\n if (attribute.Name) {\r\n output[attribute.Name] = attribute.TextValue;\r\n }\r\n });\r\n\r\n return output;\r\n}\r\n\r\n//----------------------------------------------------------\r\n//----------------------------------------------------------\r\nexport function convertCustomerAttributes(attributeList: CustomerAttribute[] | undefined): AttributesWithMetadata {\r\n const output = {\r\n meta: {}\r\n };\r\n\r\n attributeList?.forEach(attribute => {\r\n // These should always be present, but TypeScript insists they can be undefined.\r\n if (attribute.Name && attribute.DataTypeValue) {\r\n const typeData = getTypeInfo(attribute.DataTypeValue);\r\n output[attribute.Name] = attribute.AttributeValue && typeData.customerSource && attribute.AttributeValue[typeData.customerSource];\r\n output.meta[attribute.Name] = typeData.type;\r\n }\r\n });\r\n\r\n return output;\r\n}\r\n\r\n//----------------------------------------------------------\r\n// Finds the source field and type for an attribute\r\n//\r\n// This should probably be extended to better support\r\n// currency, which seems to be two fields glued together.\r\n//----------------------------------------------------------\r\nfunction getTypeInfo(type: AttributeDataType): TypeData {\r\n\r\n // Awkward, but this helps TypeScript enforce strict type checking\r\n type TypeMapType = {\r\n [key in AttributeDataType]: TypeData\r\n };\r\n\r\n const typeMap: TypeMapType = {\r\n [AttributeDataType.None]: {source: 'TextValue', type: 'string'}, // We need to choose something\r\n [AttributeDataType.Currency]: {source: 'CurrencyValue', type: 'number'}, // Should also include CurrencyCode, which is a string?\r\n [AttributeDataType.DateTime]: {source: 'DateTimeOffsetValue', type: 'Date'},\r\n [AttributeDataType.Decimal]: {source: 'FloatValue', type: 'number'},\r\n [AttributeDataType.Integer]: {source: 'IntegerValue', type: 'number', customerSource: 'IntegerValue'},\r\n [AttributeDataType.Text]: {source: 'TextValue', type: 'string', customerSource: 'StringValue'},\r\n [AttributeDataType.TrueFalse]: {source: 'BooleanValue', type: 'boolean', customerSource: 'BooleanValue'},\r\n [AttributeDataType.Video]: {source: 'TextValue', type: 'string'},\r\n [AttributeDataType.Image]: {source: 'TextValue', type: 'string'}\r\n };\r\n\r\n return typeMap[type];\r\n}\r\n","//==============================================================================\r\n// Global Constants\r\n//\r\n// Consolidated list of constants reused across different modules and extensions\r\n//==============================================================================\r\n\r\n//----------------------------------------------------------\r\n// Attribute names list\r\n//----------------------------------------------------------\r\nexport const attrNames = {\r\n productType: 'Item Type',\r\n lineAttributes: 'LineAttributes',\r\n blacklistedShippingAreas: 'Embargoed shipping locations',\r\n kitConfigurator: 'KitConfigurator',\r\n kitContents: 'eCommBurstoutKitContents',\r\n kitFormats: 'eCommBurstoutKitFormats',\r\n kitElectives: 'eCommBurstoutKitElectives',\r\n kitSubstitutions: 'eCommBurstoutKitSubstitutions',\r\n kitLineSubstitutions: 'eCommBurstoutKitLineDetails',\r\n kitLineParentAssociation: 'eCommBurstoutKitOrderLineParentAssociation',\r\n kitLineChildAssociation: 'eCommBurstoutKitOrderLineChildAssociation',\r\n instructors: 'eCommInstructors',\r\n consultantCartAttribute: 'eCommConsultantId',\r\n isInstallmentEligible: 'eCommItemIsPPEligible',\r\n cashForCollege: 'eCommCash4College',\r\n dropShip: 'eCommDropShip',\r\n scoringType: 'TestScoring',\r\n studentId: 'eCommPTEStudentId',\r\n schoolIdPP: 'eCommPPSchoolId',\r\n testCoordinator: 'PTETestCoordinator',\r\n testEnrollment: 'PTESchoolEnrollment',\r\n testType: 'Test Type',\r\n testFormat: 'Test Format',\r\n testDate: 'eCommPTETestDate',\r\n testDateId: 'eCommPTETestDateId',\r\n testAdmin: 'eCommPTEAdminCustAccount',\r\n testProctorEmail: 'PTEProctorEmail',\r\n testProctorName: 'PTEProctorName',\r\n testProctorPhone: 'PTEProctorPhone',\r\n testProctorTimeZone: 'PTEProctorTimeZone',\r\n userAgreement: 'eCommUserAgreement',\r\n umbrellaGroup: 'UmbrellaGroupID',\r\n gradeLvl: 'Grade level',\r\n isNotTest: 'Other',\r\n onlineTest: 'Online test',\r\n purchaseItemType: 'TestBklt',\r\n notBuyable: 'Not Buyable',\r\n billingCountry: 'eCommBillingCountryCode',\r\n billingZipCode: 'eCommBillingZipPostalCode',\r\n paymentScheduleName: 'PaymentScheduleName'\r\n};\r\n\r\n//----------------------------------------------------------\r\n// Global label resources\r\n//----------------------------------------------------------\r\nexport const labelResources = {\r\n sku: 'SKU'\r\n};\r\n","//==============================================================================\r\n// Variable Replacer\r\n//\r\n// General purpose tool to replace variables within a string\r\n//==============================================================================\r\n\r\nexport function varReplace(text: string, vars: {[key: string]: string}): string {\r\n return text.replace(/{(.+?)}/g, (_, match) => vars[match] || '');\r\n}\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['buybox'] = {\n c: () => require('@msdyn365-commerce-modules/buybox/dist/lib/modules/buybox/buybox'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'catalogs', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs', 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:'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: 0}],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'buybox',\n p: 'buybox',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/buybox/dist/lib/modules/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-catalogs';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs');\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 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__|themes|base|views|buybox'] = {\n c: () => require('partner/themes/base/views/buybox.view.tsx'),\n cn: '__local__-__local__-buybox'\n };\nviewDictionary['__local__|__local__|themes|christian-school|views|buybox'] = {\n c: () => require('partner/themes/christian-school/views/buybox.view.tsx'),\n cn: '__local__-__local__-buybox'\n };\nviewDictionary['__local__|__local__|themes|homeschool|views|buybox'] = {\n c: () => require('partner/themes/homeschool/views/buybox.view.tsx'),\n cn: '__local__-__local__-buybox'\n };\nviewDictionary['@msdyn365-commerce-modules|buybox|modules|buybox|buybox'] = {\n c: () => require('@msdyn365-commerce-modules/buybox/dist/lib/modules/buybox/buybox.view.js'),\n cn: '@msdyn365-commerce-modules-buybox-buybox'\n };\nviewDictionary['@msdyn365-commerce-modules|fabrikam-design-kit|modules|fabrikam|views|buybox'] = {\n c: () => require('@msdyn365-commerce-modules/fabrikam-design-kit/dist/lib/modules/fabrikam/views/buybox.view.js'),\n cn: '@msdyn365-commerce-modules-fabrikam-design-kit-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","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductDimensionsWithAvailabilitiesFull } from '@msdyn365-commerce/commerce-entities';\nimport { ProductDimensionsMatrix } from '@msdyn365-commerce/components';\nimport { RichTextComponent } from '@msdyn365-commerce/core';\nimport { ICoreContext } from '@msdyn365-commerce/core-internal';\nimport { ArrayExtensions, IDimensionsApp } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Collapse, IModuleProps, isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IBulkPurchaseData } from './bulk-purchase.data';\nimport { IBulkPurchaseProps } from './bulk-purchase.props.autogenerated';\n\n/**\n * Additional optional props for the bulk purchase.\n */\nexport interface IBulkPurchaseExtendedProps extends IBulkPurchaseProps {\n productDimensions?: IProductDimensionsWithAvailabilitiesFull[];\n}\n\n/**\n * View for the bulk purchase module.\n */\nexport interface IBulkPurchaseViewProps extends IBulkPurchaseProps {\n container: IModuleProps;\n content: React.ReactElement;\n}\n\n/**\n * View for the bulk purchase module.\n */\nexport interface IBulkPurchaseState {\n isExpanded: boolean;\n}\n\n/**\n * Bulk-purchase module.\n */\nexport class BulkPurchase extends React.PureComponent {\n public static readonly className = 'ms-bulk-purchase';\n\n public constructor(props: IBulkPurchaseExtendedProps) {\n super(props);\n\n this.state = {\n isExpanded: false\n };\n }\n\n public render(): React.ReactElement | null {\n const hasDimensionsInProps = ArrayExtensions.hasElements(this.props.productDimensions);\n const hasDimensionsInData = ArrayExtensions.hasElements(this.props.data.productDimensions?.result);\n if (!hasDimensionsInProps && !hasDimensionsInData) {\n return null;\n }\n\n const viewProps: IBulkPurchaseViewProps = {\n ...this.props,\n container: {\n moduleProps: this.props,\n className: classnames(BulkPurchase.className, this.props.config.className)\n },\n content: this._renderCollapseContent(`${BulkPurchase.className}__content`)\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _renderCollapseContent(className: string): React.ReactElement {\n return (\n
\n {this._renderCollapseButton(`${className}__collapse-button`)}\n {this._renderCollapse(`${className}__collapse`)}\n
\n );\n }\n\n private _renderCollapseButton(className: string): React.ReactElement {\n return (\n \n {this.props.resources.bulkPurchaseHeaderTitle}\n \n );\n }\n\n private _renderCollapse(className: string): React.ReactElement {\n return (\n \n {this._renderMainContent(`${className}__main-content`)}\n \n );\n }\n\n private _renderMainContent(className: string): React.ReactElement {\n const isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n\n return (\n
\n {!isMobileDevice && (\n
\n \n
\n )}\n {this._renderMatrix(`${className}__matrix-container`)}\n
\n );\n }\n\n private _renderMatrix(className: string): React.ReactElement {\n const hasDimensionsInProps = ArrayExtensions.hasElements(this.props.productDimensions);\n\n return (\n }\n data={{\n dimensions: hasDimensionsInProps ? this.props.productDimensions! : this.props.data.productDimensions!.result!,\n orderTemplates: this.props.data.orderTemplates?.result,\n customerInformation: this.props.data.customerInformation?.result\n }}\n resources={this.props.resources}\n />\n );\n }\n\n /**\n * Callback which toggles collapse mode.\n */\n private readonly _toggleCollapse = () => {\n this.setState(state => ({\n isExpanded: !state.isExpanded\n }));\n };\n}\n\nexport default BulkPurchase;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n AddToCartBehavior,\n IAddToCartFailureResult,\n IAddToCartResources,\n ItemSuccessfullyAddedToCartNotification,\n PriceComponent\n} from '@msdyn365-commerce/components';\nimport { getUrlSync, ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\nimport { DeliveryOption, FeatureState, OrgUnitLocation, ProductAvailableQuantity, ProductDimension } from '@msdyn365-commerce/retail-proxy';\nimport { NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\nimport {\n ArrayExtensions,\n DeliveryMode,\n IProductInventoryInformation,\n isAggregatedInventory\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, Heading, INodeProps, IPopupProps, Popup } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { BuyboxErrorBlock } from '../../../common/buybox-components';\nimport { IBuyboxCallbacks, IBuyboxState } from '../../../common/buyboxInterface';\nimport { getConfigureErrors, getGenericError } from '../../../common/utilities/error-utilities';\nimport { IBuyboxData } from '../buybox.data';\nimport { IBuyboxProps, IBuyboxResources } from '../buybox.props.autogenerated';\n\nconst modalCloseButtonReference: React.RefObject = React.createRef();\n\n/**\n * FindinStore failure Interface.\n */\nexport interface IFindInStoreFailureResult {\n missingDimensions?: ProductDimension[];\n}\n\n/**\n * BuyBoxFindinStore View Props Interface.\n */\nexport interface IBuyboxFindInStoreViewProps {\n storeSelector?: React.ReactNode;\n heading?: React.ReactNode;\n description?: React.ReactNode;\n errors?: React.ReactNode;\n button?: React.ReactNode;\n productPickupOptionList?: React.ReactNode;\n\n modal?: React.ReactNode;\n\n ContainerProps: INodeProps;\n\n openFindInStoreDialog(): Promise;\n}\n\n/**\n * On click find store handler.\n * @param props -Buybox data.\n * @param state -Buybox state.\n * @param callbacks -Buybox callbacks.\n * @returns Find in store.\n */\nconst onClickFindInStoreHandler = (props: IBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks) => async () => {\n await findInStoreOnClick(props, state, callbacks);\n};\n\n/**\n * Inventory settings based on the inventory policy for aggregated availability.\n */\ninterface IInventorySettingsProps {\n isSectionDisabled: boolean;\n description: string;\n buttonText: string;\n}\n\n/**\n * The function defines the settings values for a given inventory configuration.\n * @param context - The context.\n * @param isStockCheck - Flag to enable inventory validation.\n * @param productAvailability - The product inventory information.\n * @param buyboxResources - The buybox string resources.\n * @param isLoading - Is loading.\n * @returns Boolean.\n */\nfunction getFindInStoreInventorySettings(\n context: ICoreContext,\n isStockCheck: boolean,\n productAvailability: IProductInventoryInformation[] | undefined,\n buyboxResources: IBuyboxResources,\n isLoading?: boolean\n): IInventorySettingsProps {\n // If shouldValidateAggregation is true then is required to check for the product inventory, based on this the messaging will change\n // and the find in store button will be ensbled or disabled\n\n let isSectionDisabled: boolean;\n let buttonText;\n let description: string;\n\n let pickupInventory: IProductInventoryInformation | undefined;\n\n if (!isStockCheck || isLoading) {\n return {\n isSectionDisabled: false,\n buttonText: buyboxResources.findInStoreLinkText,\n description: buyboxResources.findInStoreDescriptionText\n };\n }\n\n if (productAvailability) {\n pickupInventory = productAvailability.find(pickup => pickup.deliveryType === DeliveryMode.pickup);\n }\n\n // If aggregated is enabled, then we need to validate the inventor check for find in store.\n // If an individual is selected, then we will always show a find in store button.\n if (isAggregatedInventory(context.actionContext)) {\n if (productAvailability && pickupInventory?.IsProductAvailable) {\n isSectionDisabled = false;\n buttonText = buyboxResources.findInStoreLinkText;\n description = buyboxResources.findInStoreDescriptionText;\n } else {\n isSectionDisabled = true;\n buttonText = buyboxResources.findInStoreNotAvailableTextButton;\n description = buyboxResources.findInStoreNotAvailableDescription;\n }\n } else {\n isSectionDisabled = false;\n buttonText = buyboxResources.findInStoreLinkText;\n description = buyboxResources.findInStoreDescriptionText;\n }\n\n return {\n isSectionDisabled,\n description,\n buttonText\n };\n}\n\n/**\n * Method to check if we have atleast one common delivery code between product and channel.\n * @param productdeliveryOptions - Product DeliveryOption List.\n * @param storePickUpOptionList - Channel DeliveryOption List.\n * @returns Boolean flag.\n */\nconst matchDeliveryOptions = (\n productdeliveryOptions: DeliveryOption[] | undefined,\n storePickUpOptionList: string[] | undefined\n): boolean => {\n const deliveryOption: string[] = [];\n productdeliveryOptions?.map(delivery => {\n const pickup = storePickUpOptionList?.find(deliveryCode => deliveryCode === delivery.Code);\n if (pickup) {\n deliveryOption.push(pickup);\n }\n return deliveryOption;\n });\n\n return ArrayExtensions.hasElements(deliveryOption);\n};\n\nexport function getBuyboxFindInStore(\n props: IBuyboxProps,\n state: IBuyboxState,\n callbacks: IBuyboxCallbacks\n): IBuyboxFindInStoreViewProps | undefined {\n const {\n data,\n slots: { storeSelector },\n resources: {\n priceFree,\n originalPriceText,\n currentPriceText,\n findInStoreHeaderText,\n buyBoxGoToCartText,\n buyBoxContinueShoppingText,\n closeNotificationLabel,\n buyBoxSingleItemText,\n buyBoxMultiLineItemFormatText,\n buyBoxHeaderMessageText,\n descriptionTextToShowAllPickupOptions\n },\n context: {\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\n }\n } = props;\n\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const product = data?.product?.result;\n const price = data?.productPrice?.result;\n const cart = data?.cart?.result;\n const deliveryOptions = data?.deliveryOptions?.result;\n const productAvailability = data.productAvailableQuantity?.result;\n const retailMulitplePickupMFeatureState = data?.featureState?.result?.find(\n (featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName\n )?.IsEnabled;\n const channelDeliveryOptionConfig = data?.channelDeliveryOptionConfig?.result;\n\n const missingDimensions = product?.Dimensions?.filter(dimension => !dimension.DimensionValue?.Value);\n\n const {\n errorState: { configureErrors, quantityError, otherError, errorHost },\n modalOpen,\n quantity\n } = state;\n\n const { isSectionDisabled, buttonText, description } = getFindInStoreInventorySettings(\n props.context,\n props.context.app.config.enableStockCheck,\n productAvailability,\n props.resources,\n props.data.productAvailableQuantity.status === 'LOADING' || ArrayExtensions.hasElements(missingDimensions)\n );\n\n if (!product || !ArrayExtensions.hasElements(storeSelector)) {\n return undefined;\n }\n\n if (!deliveryOptions || !deliveryOptions.DeliveryOptions) {\n return undefined;\n }\n\n // If no delivery options present on the product, or none of the delivery options\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\n if (retailMulitplePickupMFeatureState && channelDeliveryOptionConfig) {\n if (!matchDeliveryOptions(deliveryOptions.DeliveryOptions, channelDeliveryOptionConfig?.PickupDeliveryModeCodes)) {\n return undefined;\n }\n } else if (\n !PickupDeliveryModeCode ||\n !deliveryOptions.DeliveryOptions.find((option: DeliveryOption) => option.Code === PickupDeliveryModeCode)\n ) {\n return undefined;\n }\n\n const dialogStrings = {\n goToCartText: buyBoxGoToCartText,\n continueShoppingText: buyBoxContinueShoppingText,\n closeNotificationLabel,\n headerItemOneText: buyBoxSingleItemText,\n headerItemFormatText: buyBoxMultiLineItemFormatText,\n headerMessageText: buyBoxHeaderMessageText,\n freePriceText: priceFree,\n originalPriceText,\n currentPriceText\n };\n\n const priceComponent = price ? (\n \n ) : (\n ''\n );\n\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n\n const popupProps: IPopupProps = {\n context: props.context,\n className: 'ms-buybox',\n id: props.id,\n typeName: props.typeName,\n data: { product: props.data.product?.result, price: props.data.productPrice?.result },\n dialogStrings,\n imageSettings: defaultImageSettings,\n gridSettings: props.context.request.gridSettings,\n productQuantity: quantity,\n priceComponent,\n navigationUrl: getUrlSync('cart', props.context.actionContext),\n modalOpen,\n setModalOpen: callbacks.changeModalOpen\n };\n const renderModalPopup = ;\n\n return {\n ContainerProps: {\n className: 'ms-buybox__find-in-store'\n },\n\n storeSelector: storeSelector[0],\n\n openFindInStoreDialog: onClickFindInStoreHandler(props, state, callbacks),\n\n heading: ,\n\n description:

{description}

,\n productPickupOptionList:\n retailMulitplePickupMFeatureState && !isSectionDisabled ? (\n <>\n

{descriptionTextToShowAllPickupOptions}

\n
    \n {deliveryOptions.DeliveryOptions.map((item: DeliveryOption) => {\n return (\n
  • \n {item.Description}\n
  • \n );\n })}\n
\n \n ) : null,\n errors: (\n \n ),\n\n button: (\n \n {buttonText}\n \n ),\n\n modal: renderModalPopup\n };\n}\n\n/**\n * Handler for find in store button.\n * @param props - BuyBox data.\n * @param state - BuyBox state.\n * @param callbacks - BuyBox callbacks.\n * @returns - Promise.\n */\nasync function findInStoreOnClick(props: IBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): Promise {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager },\n cart: { result: cart },\n productAvailableQuantity: { result: productAvailableQuantity }\n },\n resources,\n context,\n modules\n } = props;\n\n const { selectedProduct, quantity } = state;\n\n let dataProduct = props.data.product.result;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const retailMulitplePickupMFeatureState = props.data?.featureState?.result?.find(\n (featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName\n )?.IsEnabled;\n\n if (selectedProduct) {\n dataProduct = (await selectedProduct) || dataProduct;\n }\n\n if (!dataProduct || !storeSelectorStateManager) {\n return;\n }\n\n const product = dataProduct;\n\n const missingDimensions =\n product.Dimensions &&\n product.Dimensions.filter((dimension: ProductDimension) => !(dimension.DimensionValue && dimension.DimensionValue.Value));\n\n let storeSelectorId: string = '';\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\n storeSelectorId = modules.storeSelector[0].id;\n }\n\n if (missingDimensions && missingDimensions.length > 0) {\n if (callbacks.updateErrorState) {\n callbacks.updateErrorState({\n errorHost: 'FINDINSTORE',\n configureErrors: getConfigureErrors(missingDimensions, resources)\n });\n }\n } else {\n storeSelectorStateManager\n .openDialog({\n product,\n id: storeSelectorId,\n parentElementRef: modalCloseButtonReference,\n deliveryOptions: retailMulitplePickupMFeatureState ? props.data.deliveryOptions.result : undefined,\n onLocationSelected: async (orgUnitLocation: OrgUnitLocation, deliveryMode: string) => {\n if (!cart) {\n return Promise.resolve();\n }\n\n const behavior = props.context?.app?.config?.addToCartBehavior;\n\n return cart\n .addProductToCart({ product, count: quantity, location: orgUnitLocation, deliveryMode })\n .then((result: ICartActionResult) => {\n if (result.status === 'FAILED' && result.substatus === 'MAXQUANTITY') {\n callbacks.changeModalOpen(false);\n let productAvailability: ProductAvailableQuantity | undefined;\n if (state.productAvailableQuantity) {\n productAvailability = state.productAvailableQuantity.ProductAvailableQuantity;\n } else if (productAvailableQuantity && ArrayExtensions.hasElements(productAvailableQuantity)) {\n const shippingInventory = productAvailableQuantity.find(\n shipping => shipping.deliveryType === DeliveryMode.pickup\n );\n productAvailability = shippingInventory?.ProductAvailableQuantity;\n } else {\n productAvailability = undefined;\n }\n const failureResult: IAddToCartFailureResult = {\n failureReason: 'CARTACTIONFAILED',\n cartActionResult: { status: result.status, substatus: result.substatus }\n };\n callbacks.updateErrorState({\n errorHost: 'ADDTOCART',\n configureErrors: {},\n otherError: getGenericError(\n failureResult,\n cart,\n resources,\n context,\n product,\n productAvailability,\n orgUnitLocation\n )\n });\n } else {\n callbacks.updateErrorState({\n configureErrors: {}\n });\n const navigationUrl = getUrlSync('cart', context.actionContext);\n if (behavior === undefined || behavior === AddToCartBehavior.goToCart) {\n if (result.status === 'SUCCESS' && navigationUrl) {\n window.location.assign(navigationUrl);\n }\n } else if (behavior === AddToCartBehavior.showModal) {\n callbacks.changeModalOpen(true);\n } else if (behavior === AddToCartBehavior.showNotification) {\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n const telemetryContent = getTelemetryObject(\n props.context.request.telemetryPageName!,\n props.friendlyName,\n props.telemetry\n );\n const dialogStrings: IAddToCartResources = {\n goToCartText: resources.buyBoxGoToCartText,\n continueShoppingText: resources.buyBoxContinueShoppingText,\n closeNotificationLabel: resources.closeNotificationLabel,\n headerItemOneText: resources.buyBoxSingleItemText,\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\n headerMessageText: resources.buyBoxHeaderMessageText,\n freePriceText: resources.priceFree,\n originalPriceText: resources.originalPriceText,\n currentPriceText: resources.currentPriceText,\n addedQuantityText: resources.addedQuantityText\n };\n const notification = new ItemSuccessfullyAddedToCartNotification(\n props.context,\n dialogStrings,\n defaultImageSettings,\n props.context.request.gridSettings,\n product,\n props.data.productPrice?.result,\n quantity,\n navigationUrl,\n telemetryContent,\n props.id,\n props.typeName\n );\n NotificationsManager.instance().addNotification(notification);\n }\n }\n })\n .catch((error: Error) => {\n if (props.telemetry) {\n props.telemetry.exception(error);\n props.telemetry.debug('Unable to add product to cart');\n }\n });\n }\n })\n .catch((error: Error) => {\n if (props.telemetry) {\n props.telemetry.error(error.message);\n props.telemetry.debug('Unable to find in store');\n }\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 { getCatalogId, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\nimport {\n CommerceProperty,\n ProductCatalog,\n ProductDeliveryOptions,\n ProductDimensionValue,\n ProductDimensionValueInventoryAvailability,\n ProductPrice,\n ReleasedProductType,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { BulkPurchase } from '@msdyn365-commerce-modules/bulk-purchase';\nimport {\n ArrayExtensions,\n DeliveryMode,\n FinitePromiseQueue,\n FinitePromiseQueueError,\n getDeliveryOptionsForSelectedVariant,\n GetDeliveryOptionsForSelectedVariantInput,\n getDimensionsForSelectedVariant,\n GetDimensionsForSelectedVariantInput,\n getInventoryLevelCodeFromDimensionValue,\n getPriceForSelectedVariant,\n getProductAvailabilitiesForSelectedVariant,\n getSelectedVariant,\n IDimensionsApp,\n IDimensionValueForSelectedVariant,\n InventoryLevelValues,\n IProductInventoryInformation,\n IPromiseQueue,\n PriceForSelectedVariantInput,\n ProductAvailabilitiesForSelectedVariantInput,\n SelectedVariantInput,\n setDimensionValuesToQuery\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getTelemetryObject,\n IModuleProps,\n INodeProps,\n ITelemetryContent,\n updateMaxQuantityForCartLineItem\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport {\n getBuyboxAddToCart,\n getBuyBoxInventoryLabel,\n getBuyboxKeyInPrice,\n getBuyboxProductAddToOrderTemplate,\n getBuyboxProductAddToWishlist,\n getBuyboxProductComparisonButton,\n getBuyboxProductDescription,\n getBuyboxProductPrice,\n getBuyboxProductQuantity,\n getBuyboxProductRating,\n getBuyboxProductTitle,\n getBuyboxProductUnitOfMeasure,\n getBuyboxShopSimilarButton,\n getQuantityLimitsMessages,\n RetailDefaultOrderQuantityLimitsFeatureName\n} from '../../common/buybox-components';\nimport { getBuyboxProductConfigure } from '../../common/buybox-product-configure';\nimport {\n IBuyboxAddToCartViewProps,\n IBuyboxAddToOrderTemplateViewProps,\n IBuyboxAddToWishlistViewProps,\n IBuyboxCallbacks,\n IBuyboxCommonData,\n IBuyboxExtentedProps,\n IBuyboxKeyInPriceViewProps,\n IBuyboxProductConfigureViewProps,\n IBuyboxProductQuantityViewProps,\n IBuyboxShopSimilarLookViewProps,\n IBuyboxState,\n IErrorState,\n ShopSimiliarButtonType\n} from '../../common/buyboxInterface';\nimport { IBuyboxData } from './buybox.data';\nimport { IBuyboxProps, IBuyboxResources } from './buybox.props.autogenerated';\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/buybox-find-in-store';\nimport { RecentlyViewedState } from '../recently-viewed';\n\nexport interface IBuyboxViewProps extends IBuyboxProps {\n state: IBuyboxState;\n ModuleProps: IModuleProps;\n ProductInfoContainerProps: INodeProps;\n MediaGalleryContainerProps: INodeProps;\n callbacks: IBuyboxCallbacks;\n mediaGallery?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n rating?: React.ReactNode;\n price?: React.ReactNode;\n productComparisonButton?: React.ReactNode;\n bulkPurchaseLink?: React.ReactNode;\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\n addToWishlist?: IBuyboxAddToWishlistViewProps;\n max: number | undefined;\n addToCart: IBuyboxAddToCartViewProps;\n findInStore?: IBuyboxFindInStoreViewProps;\n quantity?: IBuyboxProductQuantityViewProps;\n configure?: IBuyboxProductConfigureViewProps;\n inventoryLabel?: React.ReactNode;\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\n quantityLimitsMessages: React.ReactNode;\n telemetryContent?: ITelemetryContent;\n keyInPrice?: IBuyboxKeyInPriceViewProps;\n unitOfMeasure?: React.ReactNode;\n catalogs?: ProductCatalog[] | undefined;\n}\n\n/**\n * Buybox Module.\n */\nclass Buybox extends React.PureComponent, IBuyboxState> {\n /**\n * A queue of tasks of processing the changes in the dimensions.\n * Limit to two processes:\n * 1 - for the current process, which is under execution at the moment.\n * 2 - next process, which will process the latest version of data.\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\n */\n private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\n\n private dimensions: { [id: number]: string } = {};\n\n private readonly buyboxCallbacks: IBuyboxCallbacks = {\n updateQuantity: (newQuantity: number): boolean => {\n const errorState = { ...this.state.errorState };\n errorState.quantityError = undefined;\n errorState.otherError = undefined;\n\n this.setState({ quantity: newQuantity, errorState });\n return true;\n },\n updateErrorState: (newErrorState: IErrorState): void => {\n this.setState({ errorState: newErrorState });\n },\n updateSelectedProduct: (\n newSelectedProduct: Promise,\n newInventory: IProductInventoryInformation | undefined,\n newPrice: ProductPrice | undefined,\n newDeliveryOptions: ProductDeliveryOptions | undefined\n ): void => {\n this.setState({\n selectedProduct: newSelectedProduct,\n productAvailableQuantity: newInventory,\n productDeliveryOptions: newDeliveryOptions\n });\n this._updatePrice(newPrice);\n },\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\n return this.dimensionUpdateQueue\n .enqueue(async () => {\n return this._updateDimensions();\n })\n .catch((error: unknown) => {\n // Ignore discarded processes.\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\n throw error;\n }\n });\n },\n getDropdownName: (dimensionType: number, resources: IBuyboxResources): string => {\n return this._getDropdownName(dimensionType, resources);\n },\n changeModalOpen: (isModalOpen: boolean): void => {\n this.setState({ modalOpen: isModalOpen });\n },\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\n this.setState({ isUpdatingDimension });\n },\n\n /**\n * Update isUpdatingDeliveryOptions state.\n *\n * @param isUpdatingDeliveryOptions - The status of updating delivery options.\n */\n changeUpdatingDeliveryOptions: (isUpdatingDeliveryOptions: boolean): void => {\n this.setState({ isUpdatingDeliveryOptions });\n },\n\n updateKeyInPrice: (customPrice: number): void => {\n // Remove custom amount error when updating the custom price\n const errorState = { ...this.state.errorState };\n errorState.customAmountError = undefined;\n\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState });\n this._updatePrice(this.state.productPrice, customPrice);\n }\n };\n\n private readonly telemetryContent: ITelemetryContent;\n\n public constructor(props: IBuyboxProps, state: IBuyboxState) {\n super(props);\n this.state = {\n errorState: {\n configureErrors: {}\n },\n quantity: 1,\n min: undefined,\n max: undefined,\n selectedProduct: undefined,\n productPrice: undefined,\n productDeliveryOptions: undefined,\n\n modalOpen: false,\n isUpdatingDimension: false,\n isUpdatingDeliveryOptions: false\n };\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\n }\n\n public async componentDidMount(): Promise {\n const {\n data: {\n product: { result: product },\n productPrice\n },\n context\n } = this.props;\n\n productPrice.then(async result => {\n this._updatePrice(result);\n });\n\n if (product) {\n // Check if the product is service or not by product type\n if (product.ItemTypeValue === ReleasedProductType.Service) {\n this.setState({ isServiceItem: true });\n }\n await this._updateQuantitiesInState(product);\n }\n\n if (product && context.app.config.maxRecentlyViewedItemsCount > 0) {\n RecentlyViewedState.instance(this.props.context, context.app.config.maxRecentlyViewedItemsCount, product.RecordId);\n }\n }\n\n public render(): JSX.Element | null {\n const {\n slots: { mediaGallery, productComparisonButton },\n data: {\n product: { result: product }\n },\n config: { className = '' }\n } = this.props;\n\n const { max } = this.state;\n\n if (!product) {\n this.props.context.telemetry.error('Product content is empty, module wont render');\n return null;\n }\n\n const props = this.props as IBuyboxExtentedProps;\n const defaultMinimumKeyInPrice = 10;\n const defaultMaximumKeyInPrice = 100;\n\n const context = this.props.context as ICoreContext;\n const inventoryLevel = context.app.config.inventoryLevel;\n const dimensionValuesWithInventory = ArrayExtensions.flatten(\n ArrayExtensions.validValues(this.props.data.productDimensions.result?.map(value => value.dimensionValuesWithInventory))\n );\n const hasAvailableProducts =\n !ArrayExtensions.hasElements(dimensionValuesWithInventory) ||\n dimensionValuesWithInventory.some((value: unknown) => {\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(\n value as ProductDimensionValueInventoryAvailability,\n inventoryLevel\n );\n return inventoryLevelCode !== InventoryLevelValues.outOfStock;\n });\n const catalogId = getCatalogId(this.props.context.request);\n\n const viewProps: IBuyboxViewProps = {\n ...(this.props as IBuyboxProps),\n state: this.state,\n mediaGallery: mediaGallery && mediaGallery.length > 0 ? mediaGallery[0] : undefined,\n ModuleProps: {\n moduleProps: this.props,\n className: classnames('ms-buybox', className)\n },\n ProductInfoContainerProps: {\n className: 'ms-buybox__content'\n },\n MediaGalleryContainerProps: {\n className: 'ms-buybox__media-gallery'\n },\n telemetryContent: this.telemetryContent,\n callbacks: this.buyboxCallbacks,\n title: getBuyboxProductTitle(props),\n description: getBuyboxProductDescription(props),\n bulkPurchaseLink: this._renderBuyboxBulkPurchaseLink(),\n unitOfMeasure: getBuyboxProductUnitOfMeasure(props),\n configure: getBuyboxProductConfigure(props, this.state, this.buyboxCallbacks),\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\n price: getBuyboxProductPrice(props, this.state),\n addToCart: getBuyboxAddToCart(\n props,\n this.state,\n this.buyboxCallbacks,\n defaultMinimumKeyInPrice,\n defaultMaximumKeyInPrice,\n undefined,\n hasAvailableProducts\n ),\n productComparisonButton: ArrayExtensions.hasElements(productComparisonButton)\n ? getBuyboxProductComparisonButton(\n productComparisonButton[0],\n product,\n getCatalogId(this.props.context.request),\n this.state\n )\n : undefined,\n addToOrderTemplate: getBuyboxProductAddToOrderTemplate(props, this.state, this.buyboxCallbacks),\n addToWishlist: getBuyboxProductAddToWishlist(props, this.state, this.buyboxCallbacks),\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\n quantity: product.IsGiftCard ? undefined : getBuyboxProductQuantity(props, this.state, this.buyboxCallbacks),\n inventoryLabel: getBuyBoxInventoryLabel(props),\n shopSimilarLook:\n this.props.config.enableShopSimilarLooks && !product.IsGiftCard\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Looks)\n : undefined,\n shopSimilarDescription:\n this.props.config.enableShopSimilarDescription && !product.IsGiftCard\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description)\n : undefined,\n keyInPrice:\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\n ? getBuyboxKeyInPrice(props, this.state, this.buyboxCallbacks)\n : undefined,\n quantityLimitsMessages: getQuantityLimitsMessages(props, this.state),\n max,\n catalogs: this.props.data.catalogs?.result?.filter(item => item.RecordId === catalogId)\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Handles anchor click event and scrolls to the given bulk purchase module.\n * @param bulkPurchaseModule - Bulk purchase module.\n * @returns Handler.\n */\n private readonly _onBulkPurchaseLinkClick = (bulkPurchaseModule: Element) => () => {\n const boundingRect = bulkPurchaseModule.getBoundingClientRect();\n window.scrollTo(boundingRect.left, boundingRect.top);\n };\n\n private _renderBuyboxBulkPurchaseLink(): React.ReactNode {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Temporary switch for the feature which is under development.\n if (!this.props.context.app.config.isBulkPurchaseEnabled) {\n return null;\n }\n\n if (!msdyn365Commerce.isBrowser) {\n return null;\n }\n\n const bulkPurchaseModules = Array.from(document.getElementsByClassName(BulkPurchase.className));\n\n if (!ArrayExtensions.hasElements(bulkPurchaseModules)) {\n return null;\n }\n\n return (\n \n {this.props.resources.bulkPurchaseLinkText}\n \n );\n }\n\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\n if (this.state.isCustomPriceSelected && newPrice) {\n newPrice.CustomerContextualPrice = customPrice;\n }\n this.setState({ productPrice: newPrice });\n }\n\n private _getProductVariant(dimensionsToUpdate: { [id: number]: string }) {\n const {\n data: {\n product: { result: product }\n },\n context: {\n actionContext,\n request: {\n apiSettings: { channelId }\n }\n }\n } = this.props;\n\n const productDimensions = this.props.data.productDimensions.result!;\n\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\n // over the information in data\n const mappedDimensions = productDimensions\n .map(dimension => {\n const dimensions = (dimension.dimensionValuesWithInventory ??\n dimension.DimensionValues ??\n []) as IDimensionValueForSelectedVariant[];\n return {\n DimensionTypeValue: dimension.DimensionTypeValue,\n DimensionValue:\n dimensions.find(\n value => value.DimensionValue?.RecordId.toString() === dimensionsToUpdate[dimension.DimensionTypeValue]\n )?.DimensionValue ?? dimension.DimensionValue,\n ExtensionProperties: dimension.ExtensionProperties\n };\n })\n .filter(dimension => dimension.DimensionValue);\n setDimensionValuesToQuery(this.props.context.actionContext.requestContext.url.requestUrl, mappedDimensions);\n\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\n // so that places like add to cart can await it\n const selectedProductPromise = getSelectedVariant(\n new SelectedVariantInput(\n product!.MasterProductId ? product!.MasterProductId : product!.RecordId,\n channelId,\n undefined,\n undefined,\n this.props.context.request\n ),\n actionContext\n );\n this.setState({ selectedProduct: selectedProductPromise });\n\n return { productVariantPromise: selectedProductPromise, mappedDimensions };\n }\n\n private readonly _updateDimensions = async (): Promise => {\n const product = this.props.data.product.result;\n\n const productDimensions = this.props.data.productDimensions.result;\n\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensions);\n\n if (!product || !hasProductDimensions) {\n return;\n }\n\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\n this.setState({ isUpdatingDimension: true, isUpdatingDeliveryOptions: true });\n\n // Step 1: Clear error state to display relevant errors\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\n const clearErrorState = { ...this.state.errorState };\n clearErrorState.otherError = undefined;\n if (this.state.errorState.errorHost === 'ADDTOCART') {\n clearErrorState.quantityError = undefined;\n clearErrorState.errorHost = undefined;\n }\n this.setState({ errorState: clearErrorState });\n }\n\n // Step 2: Clear any errors indicating the dimension wasn't selected\n for (const key of Object.keys(dimensionsToUpdate)) {\n if (this.state.errorState.configureErrors[key]) {\n this.setState(previousState => {\n const errorState = previousState.errorState;\n errorState.configureErrors[key] = undefined;\n return { errorState };\n });\n }\n }\n\n const data = this._getProductVariant(dimensionsToUpdate);\n const productVariant: SimpleProduct | null = await data.productVariantPromise;\n\n if (!productVariant) {\n return;\n }\n\n const promises: Promise[] = [\n this._getDimensionsForSelectedVariant(productVariant, data.mappedDimensions),\n this._hydrateInventoryInfo(productVariant),\n this._hydratePrice(productVariant),\n this._hydrateDeliveryOptions(productVariant),\n this._updateQuantitiesInState(productVariant)\n ];\n\n await Promise.all(promises);\n };\n\n private async _getDimensionsForSelectedVariant(\n productVariant: SimpleProduct,\n mappedDimensions: {\n /* eslint-disable @typescript-eslint/naming-convention -- Retail proxy values */\n DimensionTypeValue: number;\n DimensionValue: ProductDimensionValue | undefined;\n ExtensionProperties: CommerceProperty[] | undefined;\n /* eslint-enable @typescript-eslint/naming-convention -- Retail proxy values */\n }[]\n ): Promise {\n await getDimensionsForSelectedVariant(\n new GetDimensionsForSelectedVariantInput(\n productVariant.MasterProductId ? productVariant.MasterProductId : productVariant.RecordId,\n this.props.context.request.apiSettings.channelId,\n mappedDimensions,\n this.props.context.request\n ),\n this.props.context.actionContext\n );\n }\n\n private async _hydrateInventoryInfo(productVariant: SimpleProduct): Promise {\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\n // so that places like add to cart can await it\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\n new ProductAvailabilitiesForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId),\n this.props.context.actionContext\n );\n\n const newShippingQuantity = newAvailableQuantity?.find(\n // @ts-expect-error\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (shipping: { deliveryType: any }) => shipping.deliveryType === DeliveryMode.shipping\n );\n const isCustomPriceSelected = productVariant.Dimensions?.find(\n dimension =>\n dimension.DimensionTypeValue === 4 && dimension.DimensionValue && dimension.DimensionValue.Value?.toLowerCase() === 'custom'\n );\n if (isCustomPriceSelected) {\n this.setState({ isCustomPriceSelected: true });\n } else {\n this.setState(previousState => {\n const errorState = previousState.errorState;\n errorState.customAmountError = undefined;\n return { isCustomPriceSelected: false, isPriceKeyedIn: false, errorState };\n });\n }\n\n if (newShippingQuantity) {\n this.setState({ productAvailableQuantity: newShippingQuantity });\n } else {\n this.setState({ productAvailableQuantity: undefined });\n }\n }\n\n private async _hydratePrice(productVariant: SimpleProduct): Promise {\n // Step 6. Use these dimensions hydrate the product price.\n const newPrice = await getPriceForSelectedVariant(\n new PriceForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId),\n this.props.context.actionContext\n );\n\n if (newPrice) {\n this._updatePrice(newPrice);\n }\n }\n\n private async _hydrateDeliveryOptions(productVariant: SimpleProduct): Promise {\n const retailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n );\n\n // Step 7. Use these dimensions hydrate the product delivery options.\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\n new GetDeliveryOptionsForSelectedVariantInput(\n productVariant.RecordId,\n this.props.context.request.apiSettings.channelId,\n undefined,\n undefined,\n retailMultiplePickupFeatureState?.IsEnabled\n ),\n this.props.context.actionContext\n );\n\n if (newDeliveryOptions) {\n this.setState({ productDeliveryOptions: newDeliveryOptions });\n }\n }\n\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\n if (isOrderQuantityLimitsFeatureEnabled && product) {\n this.setState({\n min: product.Behavior?.MinimumQuantity || 1,\n\n // If max by feature in default order settings is not defined then use max from site settings or default max 10.\n max:\n product.Behavior?.MaximumQuantity && product.Behavior?.MaximumQuantity > 0\n ? product.Behavior?.MaximumQuantity\n : updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem)\n });\n } else {\n this.setState({\n min: 1,\n max: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem)\n });\n }\n }\n\n private readonly _getDropdownName = (dimensionType: number, resources: IBuyboxResources): string => {\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\n\n switch (dimensionType) {\n case 1: // ProductDimensionType.Color\n return resources.productDimensionTypeColor;\n case 2: // ProductDimensionType.Configuration\n return resources.productDimensionTypeConfiguration;\n case 3: // ProductDimensionType.Size\n return resources.productDimensionTypeSize;\n case 4: // ProductDimensionType.Style\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\n default:\n return '';\n }\n };\n\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\n return false;\n }\n\n const featureStatuses = await this.props.data.featureState;\n const isFeatureEnabledInHq = featureStatuses?.find(\n featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName\n )?.IsEnabled;\n if (!isFeatureEnabledInHq) {\n return false;\n }\n\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n return true;\n }\n let customerInfo;\n try {\n customerInfo = await this.props.data.customerInformation;\n } catch (error) {\n this.props.telemetry.information(error);\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\n return false;\n }\n\n return (\n customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\n );\n }\n}\n\nexport default Buybox;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport {\n IBuyboxAddToCartViewProps,\n IBuyboxAddToOrderTemplateViewProps,\n IBuyboxAddToWishlistViewProps,\n IBuyboxKeyInPriceViewProps,\n IBuyboxProductConfigureDropdownViewProps,\n IBuyboxProductConfigureViewProps,\n IBuyboxProductQuantityViewProps,\n IBuyboxShopSimilarLookViewProps\n} from '../../common';\nimport { IBuyboxViewProps } from './buybox';\nimport { IBuyboxFindInStoreViewProps } from './components/buybox-find-in-store';\n\nconst BuyboxView: React.FC = props => {\n const {\n ModuleProps,\n MediaGalleryContainerProps,\n ProductInfoContainerProps,\n addToCart,\n addToOrderTemplate,\n addToWishlist,\n configure,\n description,\n findInStore,\n quantity,\n price,\n title,\n rating,\n inventoryLabel,\n shopSimilarLook,\n keyInPrice,\n shopSimilarDescription,\n unitOfMeasure,\n productComparisonButton\n } = props;\n\n return (\n \n {props.mediaGallery}\n \n {title}\n {price}\n {unitOfMeasure}\n {props.bulkPurchaseLink}\n {description}\n {rating}\n {configure && _renderConfigure(configure)}\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\n {quantity && _renderQuantity(quantity)}\n {inventoryLabel}\n {addToCart && _renderAddToCart(addToCart)}\n {findInStore && _renderFindInStore(findInStore)}\n {addToOrderTemplate && _renderAddToOrderTemplate(addToOrderTemplate)}\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\n {_renderSocialShare(props.slots && props.slots.socialShare)}\n {productComparisonButton}\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\n \n \n );\n};\n\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\n const { ContainerProps, errorBlock, button } = addToCart;\n\n return (\n \n {errorBlock}\n {button}\n \n );\n};\n\nconst _renderAddToOrderTemplate = (addToOrderTemplate: IBuyboxAddToOrderTemplateViewProps): JSX.Element => {\n const { ContainerProps, errorBlock, button } = addToOrderTemplate;\n\n return (\n \n {errorBlock}\n {button}\n \n );\n};\n\nconst _renderAddToWishlist = (addToWishlist: IBuyboxAddToWishlistViewProps): JSX.Element => {\n const { ContainerProps, errorBlock, button } = addToWishlist;\n\n return (\n \n {errorBlock}\n {button}\n \n );\n};\n\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\n const { ContainerProps, dropdowns } = configure;\n\n return {dropdowns.map(_renderConfigureDropdown)};\n};\n\nconst _renderSocialShare = (socialShare: React.ReactNode[]): JSX.Element | undefined => {\n if (!socialShare || socialShare.length === 0) {\n return undefined;\n }\n\n return <>{socialShare[0]};\n};\n\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\n\n return (\n \n \n {heading}\n {errors}\n \n {select}\n \n );\n};\n\nconst _renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\n\n return (\n \n {storeSelector}\n {heading}\n {productPickupOptionList}\n {description}\n {errors}\n {button}\n {modal}\n \n );\n};\n\nconst _renderQuantity = (quantity: IBuyboxProductQuantityViewProps): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, input, errors } = quantity;\n\n return (\n \n \n {heading}\n {errors}\n \n {input}\n \n );\n};\n\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\n\n return (\n \n {heading}\n {input}\n \n );\n};\n\nconst _renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\n const { ContainerProps, errors, input } = shopSimilarItem;\n\n return (\n \n {errors}\n {input}\n \n );\n};\nexport default BuyboxView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n IBuyboxAddToCartViewProps,\n IBuyboxAddToOrderTemplateViewProps,\n IBuyboxAddToWishlistViewProps,\n IBuyboxCallbacks,\n IBuyboxData,\n IBuyboxFindInStoreViewProps,\n IBuyboxKeyInPriceViewProps,\n IBuyboxProductConfigureDropdownViewProps,\n IBuyboxProductConfigureViewProps,\n IBuyboxProductQuantityViewProps,\n IBuyboxProps,\n IBuyboxShopSimilarLookViewProps,\n IBuyboxState,\n IBuyboxViewProps\n} from '@msdyn365-commerce-modules/buybox';\nimport { IncrementalQuantity, ITelemetryContent, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport {\n IBuyboxProps as IBuyboxExtentionProps,\n IBuyboxResources as IBuyboxExtentionResources\n} from '../definition-extensions/buybox.ext.props.autogenerated';\n\nconst BuyboxView: React.FC> = props => {\n const {\n ModuleProps,\n MediaGalleryContainerProps,\n ProductInfoContainerProps,\n addToCart,\n addToOrderTemplate,\n addToWishlist,\n telemetryContent,\n configure,\n description,\n findInStore,\n quantity,\n price,\n title,\n rating,\n callbacks,\n state,\n resources,\n inventoryLabel,\n shopSimilarLook,\n keyInPrice,\n quantityLimitsMessages,\n max,\n shopSimilarDescription,\n unitOfMeasure\n } = props;\n\n return (\n \n {props.mediaGallery}\n \n {title}\n {price}\n {unitOfMeasure}\n {props.bulkPurchaseLink}\n {description}\n {_renderTextBlock(props.slots.textBlocks)}\n {rating}\n {configure && _renderConfigure(configure)}\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\n {quantity && _renderQuantity(quantity, callbacks, props, state, resources, quantityLimitsMessages, max, telemetryContent)}\n {inventoryLabel}\n {_renderCartAndActions(addToCart, addToOrderTemplate, addToWishlist)}\n {findInStore && _renderFindInStore(findInStore)}\n {_renderSocialShare(props.slots && props.slots.socialShare)}\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\n \n \n );\n};\n\nconst _renderTextBlock = (textBlocks: React.ReactNode[]): JSX.Element | undefined => {\n if (!textBlocks || textBlocks.length === 0) {\n return undefined;\n }\n\n return <>{textBlocks[0]};\n};\n\nconst _renderSocialShare = (socialShare: React.ReactNode[]): JSX.Element | undefined => {\n if (!socialShare || socialShare.length === 0) {\n return undefined;\n }\n\n return <>{socialShare[0]};\n};\n\nconst _renderCartAndActions = (\n addToCart?: IBuyboxAddToCartViewProps,\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps,\n addToWishlist?: IBuyboxAddToWishlistViewProps\n): JSX.Element | undefined => {\n if (!addToCart && !addToWishlist) {\n return undefined;\n }\n\n return (\n
\n {addToCart && addToCart.errorBlock}\n {addToOrderTemplate && addToOrderTemplate.errorBlock}\n {addToWishlist && addToWishlist.errorBlock}\n
\n {addToCart && addToCart.button}\n {addToOrderTemplate && addToOrderTemplate.button}\n {addToWishlist && addToWishlist.button}\n
\n
\n );\n};\n\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\n const { ContainerProps, dropdowns } = configure;\n\n return {dropdowns.map(_renderConfigureDropdown)};\n};\n\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\n\n return (\n \n \n {heading}\n {errors}\n \n {select}\n \n );\n};\n\nconst _renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\n\n return (\n \n {storeSelector}\n {heading}\n {productPickupOptionList}\n {description}\n {errors}\n {button}\n {modal}\n \n );\n};\n\n/**\n * On Change function.\n * @param callbacks -Callbacks.\n * @returns Update quantity.\n */\nconst onChangeHandler = (callbacks: IBuyboxCallbacks) => (newValue: number): boolean => {\n if (callbacks.updateQuantity) {\n return callbacks.updateQuantity(newValue);\n }\n return true;\n};\n\nconst _renderQuantity = (\n quantityComponent: IBuyboxProductQuantityViewProps,\n callbacks: IBuyboxCallbacks,\n props: IBuyboxProps,\n state: IBuyboxState,\n extentionResources: IBuyboxExtentionResources,\n quantityLimitsMessages: React.ReactNode,\n max: number | undefined,\n telemetryContent?: ITelemetryContent\n): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, errors } = quantityComponent;\n\n const { resources } = props;\n\n const { quantity } = state;\n\n return (\n \n \n {heading}\n {errors}\n \n\n \n {quantityLimitsMessages}\n \n );\n};\n\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\n\n return (\n \n {heading}\n {input}\n \n );\n};\n\nconst _renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\n const { ContainerProps, errors, input } = shopSimilarItem;\n\n return (\n \n {errors}\n {input}\n \n );\n};\n\nexport default BuyboxView;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["sentAnalytics","_renderAddToCart","addToCart","ContainerProps","errorBlock","button","React","Node","Object","assign","_renderAddToOrderTemplate","addToOrderTemplate","_renderAddToWishlist","addToWishlist","_renderConfigure","configure","dropdowns","map","_renderConfigureDropdown","_renderSocialShare","socialShare","length","dropdown","LabelContainerProps","heading","errors","select","_renderFindInStore","findInStore","storeSelector","description","modal","productPickupOptionList","_renderBackOrder","productAvailableQuantity","text","find","avail","IsProductAvailable","RichTextComponent","className","_renderQuantity","quantity","input","_renderKeyInPrice","keyInPrice","_renderShopSimilarItem","shopSimilarItem","_renderSlotItems","items","slot","index","key","props","_data$productSpecific","_data$product","_slots$reviewSnippet","_slots$kitSelector","_slots$kitCustomizer","_slots$installmentCal","ModuleProps","MediaGalleryContainerProps","ProductInfoContainerProps","price","title","rating","inventoryLabel","shopSimilarLook","shopSimilarDescription","unitOfMeasure","productComparisonButton","slots","data","window","product","result","setTimeout","_props$context$reques","productPrice","analyticsProductData","itemID","ItemId","name","Name","discount","DiscountAmount","variant","BasePrice","Price","currency","context","request","channel","Currency","publish","productSpecificationData","productAttributes","convertProductAttributes","productDescriptionOverride","config","descriptionOverride","productDescriptionOverrideText","productData","itemId","skuDisplay","labelResources","sku","productAvail","backorderAvail","unbuyable","attrNames","notBuyable","Module","mediaGallery","reviewSnippet","bulkPurchaseLink","kitSelector","kitCustomizer","backOrderText","blacklistedShippingAreasText","blacklistedShippingAreas","varReplace","areas","installmentCal","subscriptions","eventName","eventData","keys","forEach","subscriber","subscribe","handler","Error","attributeList","output","meta","attribute","DataTypeValue","typeData","getTypeInfo","source","type","convertCartAttributes","TextValue","AttributeDataType","None","DateTime","Decimal","Integer","customerSource","Text","TrueFalse","Video","Image","productType","lineAttributes","kitConfigurator","kitContents","kitFormats","kitElectives","kitSubstitutions","kitLineSubstitutions","kitLineParentAssociation","kitLineChildAssociation","instructors","consultantCartAttribute","isInstallmentEligible","cashForCollege","dropShip","scoringType","studentId","schoolIdPP","testCoordinator","testEnrollment","testType","testFormat","testDate","testDateId","testAdmin","testProctorEmail","testProctorName","testProctorPhone","testProctorTimeZone","userAgreement","umbrellaGroup","gradeLvl","isNotTest","onlineTest","purchaseItemType","billingCountry","billingZipCode","paymentScheduleName","vars","replace","_","match","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","id","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","_objectSpread","viewDictionary","cn","BaseStoreSelectorStateManager","constructor","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","this","isMapModuleLoaded","value","_readFromToCookie","storeInfo","JSON","parse","undefined","preferredStore","_unused","_context","storeId","selectedStoreLocationId","storeName","writeToCookie","arguments","StoreId","StoreName","Latitude","Longitude","_writeToCookie","stringify","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","MsDyn365","isBrowser","localStorage","removeItem","setItem","cookieValue","getItem","__decorate","computed","observable","action","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","actionContext","requestContext","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","trim","query","encodeURI","geolocationApiUrl","app","requestUrl","Promise","resolve","script","document","createElement","setAttribute","remove","resourceSets","resources","point","coordinates","body","appendChild","_document","StringExtensions","isNullOrEmpty","getElementById","url","lang","market","reject","_document2","_document3","async","defer","src","mapAPIReady","isMapApiLoaded","addEventListener","error","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","createObservableDataAction","getGenericAction","inputData","BulkPurchase","super","_toggleCollapse","setState","state","isExpanded","render","_this$props$data$prod","hasDimensionsInProps","ArrayExtensions","hasElements","productDimensions","hasDimensionsInData","viewProps","container","moduleProps","classnames","content","_renderCollapseContent","renderView","_renderCollapseButton","_renderCollapse","Button","onClick","bulkPurchaseHeaderTitle","Collapse","isOpen","_renderMainContent","isMobileDevice","isMobile","VariantType","Viewport","bulkPurchaseDescriptionText","_renderMatrix","_this$props$data$orde","_this$props$data$cust","ProductDimensionsMatrix","dimensions","orderTemplates","customerInformation","modalCloseButtonReference","onClickFindInStoreHandler","callbacks","_props$data","storeSelectorStateManager","cart","selectedProduct","dataProduct","multiplePickupStoreSwitchName","retailMulitplePickupMFeatureState","featureState","IsEnabled","missingDimensions","Dimensions","filter","dimension","DimensionValue","Value","storeSelectorId","updateErrorState","errorHost","configureErrors","getConfigureErrors","openDialog","parentElementRef","deliveryOptions","onLocationSelected","orgUnitLocation","deliveryMode","_props$context","behavior","addToCartBehavior","addProductToCart","count","location","then","status","substatus","productAvailability","changeModalOpen","ProductAvailableQuantity","shippingInventory","shipping","deliveryType","DeliveryMode","pickup","failureResult","failureReason","cartActionResult","otherError","getGenericError","navigationUrl","getUrlSync","AddToCartBehavior","goToCart","showModal","showNotification","_props$data$productPr2","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","telemetryContent","getTelemetryObject","telemetryPageName","friendlyName","telemetry","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","closeNotificationLabel","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","addedQuantityText","notification","ItemSuccessfullyAddedToCartNotification","gridSettings","typeName","NotificationsManager","instance","addNotification","catch","exception","debug","message","findInStoreOnClick","getBuyboxFindInStore","_data$productPrice","_data$cart","_data$deliveryOptions","_data$productAvailabl","_data$featureState","_data$channelDelivery","_product$Dimensions","_props$data$product","_props$data$productPr","findInStoreHeaderText","descriptionTextToShowAllPickupOptions","PickupDeliveryModeCode","channelDeliveryOptionConfig","_dimension$DimensionV","errorState","quantityError","modalOpen","isSectionDisabled","buttonText","isStockCheck","buyboxResources","isLoading","pickupInventory","findInStoreLinkText","findInStoreDescriptionText","isAggregatedInventory","_pickupInventory","findInStoreNotAvailableTextButton","findInStoreNotAvailableDescription","getFindInStoreInventorySettings","enableStockCheck","DeliveryOptions","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","deliveryCode","Code","push","PickupDeliveryModeCodes","option","priceComponent","PriceComponent","popupProps","imageSettings","productQuantity","setModalOpen","renderModalPopup","Popup","openFindInStoreDialog","Heading","headingTag","item","Description","BuyboxErrorBlock","showError","color","ref","disabled","Buybox","dimensionUpdateQueue","FinitePromiseQueue","buyboxCallbacks","updateQuantity","newQuantity","newErrorState","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productDeliveryOptions","_updatePrice","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","getDropdownName","dimensionType","_getDropdownName","isModalOpen","changeUpdatingDimension","isUpdatingDimension","changeUpdatingDeliveryOptions","isUpdatingDeliveryOptions","updateKeyInPrice","customPrice","customAmountError","isPriceKeyedIn","keyInPriceAmount","_onBulkPurchaseLinkClick","bulkPurchaseModule","boundingRect","getBoundingClientRect","scrollTo","left","top","hasProductDimensions","dimensionsToUpdate","clearErrorState","previousState","_getProductVariant","productVariant","productVariantPromise","promises","_getDimensionsForSelectedVariant","mappedDimensions","_hydrateInventoryInfo","_hydratePrice","_hydrateDeliveryOptions","_updateQuantitiesInState","all","isGiftCard","IsGiftCard","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","min","max","ItemTypeValue","ReleasedProductType","Service","isServiceItem","maxRecentlyViewedItemsCount","RecentlyViewedState","RecordId","_this$props$data$prod2","_this$props$data$cata","inventoryLevel","dimensionValuesWithInventory","flatten","validValues","hasAvailableProducts","some","getInventoryLevelCodeFromDimensionValue","InventoryLevelValues","outOfStock","catalogId","getCatalogId","getBuyboxProductTitle","getBuyboxProductDescription","_renderBuyboxBulkPurchaseLink","getBuyboxProductUnitOfMeasure","getBuyboxProductConfigure","getBuyboxProductPrice","getBuyboxAddToCart","getBuyboxProductComparisonButton","getBuyboxProductAddToOrderTemplate","getBuyboxProductAddToWishlist","hideRating","getBuyboxProductRating","getBuyboxProductQuantity","getBuyBoxInventoryLabel","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","Looks","enableShopSimilarDescription","enableKeyInPrice","isCustomPriceSelected","getBuyboxKeyInPrice","quantityLimitsMessages","getQuantityLimitsMessages","catalogs","isBulkPurchaseEnabled","msdyn365Commerce","bulkPurchaseModules","Array","from","getElementsByClassName","bulkPurchaseLinkText","CustomerContextualPrice","apiSettings","channelId","_ref","_dimension$dimensionV","_dimensions$find$Dime","_dimensions$find","DimensionValues","DimensionTypeValue","_value$DimensionValue","toString","ExtensionProperties","setDimensionValuesToQuery","selectedProductPromise","getSelectedVariant","SelectedVariantInput","MasterProductId","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","_productVariant$Dimen","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","newShippingQuantity","toLowerCase","getPriceForSelectedVariant","PriceForSelectedVariantInput","_this$props$data$feat","retailMultiplePickupFeatureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","_product$Behavior","_product$Behavior2","_product$Behavior3","_product$Behavior4","_isOrderQuantityLimitsFeatureEnabled","Behavior","MinimumQuantity","MaximumQuantity","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","_this$props$context","_featureStatuses$find","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","featureStatuses","RetailDefaultOrderQuantityLimitsFeatureName","customerInfo","information","IsB2b","_renderTextBlock","textBlocks","_renderCartAndActions","onChangeHandler","newValue","quantityComponent","extentionResources","IncrementalQuantity","currentCount","onChange","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","minQuantityText","maxQuantityText","module","exports","ReactDOM"],"sourceRoot":""}