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cAC7ClM,EAAAA,cAACC,EAAAA,KAAIC,OAAAC,OAAA,GAAKsJ,GACL5G,EACA6G,EACAK,EACAxI,EAAM6K,iBACNpK,EACA+qB,EAAiBxrB,EAAMgL,MAAMygB,YAC7BrjB,EACAlJ,GAAaD,EAAiBC,GAC9B8B,GAAcD,EAAkBC,GAChCH,GAAYD,EAAgBC,EAAUyJ,EAAWtK,EAAOyU,EAAO/N,EAAW6gB,EAAwBzC,EAAKlK,GACvGvS,EACAqjB,EAAsBrtB,EAAWS,EAAoBE,GACrDuB,GAAeD,EAAmBC,GAClCf,EAAmBQ,EAAMgL,OAAShL,EAAMgL,MAAMvL,aAC9C6I,GAAmBrH,EAAuBqH,GAC1CC,GAA0BtH,EAAuBsH,aC5ElE+jB,EAAOC,QAAU9tB,cCAjB6tB,EAAOC,QAAUC","sources":["webpack://united-malt/./src/themes/country-malt-group/views/buybox.view.tsx?9d4b","webpack://united-malt/./src/themes/cryer-malt/views/buybox.view.tsx?99c4","webpack://united-malt/./src/utilities/data-attribute-parser.ts?7345","webpack://united-malt/./lib/buybox/module-registration.js?bcce","webpack://united-malt/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://united-malt/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://united-malt/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://united-malt/./src/modules/bulk-purchase/bulk-purchase.tsx?9fd5","webpack://united-malt/./src/modules/buybox/components/buybox-find-in-store.tsx?3ef8","webpack://united-malt/./src/modules/buybox/buybox.tsx?e22d","webpack://united-malt/./src/modules/buybox/buybox.view.tsx?376b","webpack://united-malt/./src/modules/fabrikam/views/buybox.view.tsx?aec4","webpack://united-malt/external var \"React\"?0d3b","webpack://united-malt/external var \"ReactDOM\"?853b"],"sourcesContent":["/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport classnames from 'classnames'; //@CUSTOM\r\n// @CUSTOM\r\n/* ----------------------------------------------------------------------- */\r\nimport { getCatalogId } from '@msdyn365-commerce/core';\r\nimport { IBuyboxAddToCartViewProps, IBuyboxAddToOrderTemplateViewProps, IBuyboxAddToWishlistViewProps,\r\n IBuyboxKeyInPriceViewProps, IBuyboxProductConfigureDropdownViewProps, IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps, IBuyboxShopSimilarLookViewProps, IBuyboxViewProps, IBuyboxFindInStoreViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nimport { IBuyboxProps } from '../definition-extensions/buybox.ext.props.autogenerated';\r\nimport { IBuyboxData } from './buybox.data';\r\n\r\nimport { SimpleProduct, ProductAvailableQuantity } from '@msdyn365-commerce/retail-proxy';\r\nimport { ProductAvailabilitiesForSelectedVariantInput, getProductAvailabilitiesForSelectedVariant } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { getCartState, ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport { HiddenVariant, MillingOptions, MillingOption, CartLineCombineTable, WarehousesNoMill } from '../../../settings/app.settings';\r\n\r\nimport { convertProductAttributesLocalized, convertCustomerAttributes, AttributesLocalized } from '../../../utilities/data-attribute-parser';\r\nimport { CartUtilities } from '../../../utilities/cart-utils';\r\nimport { productPropertiesMatch } from '../../base/views/components/addtocart.component';\r\nimport { addOverridesToCartState, AddProductsToCartWithAttribs } from '../../../utilities/cart-attribute-helpers';\r\n\r\nimport { publish } from '../../../utilities/analytics/analytics-dispatcher';\r\nimport { PDPVisitEvent } from '../../../utilities/analytics/analytics-events';\r\n\r\n/* ----------------------------------------------------------------------- */\r\n// @CUSTOM: Attribute Names for pallet info\r\nconst palletAttributes = {\r\n details: 'PalletDetails',\r\n variant: 'PalletVariant'\r\n};\r\n\r\nlet palletId: string | undefined;\r\nlet palletUnits: string;\r\nlet palletWeight: string;\r\nlet palletMessage: string;\r\nlet palletQty = '1';\r\nlet palletAvailability: ProductAvailableQuantity | undefined;\r\n\r\nlet buyboxPops: IBuyboxViewProps & IBuyboxProps;\r\n\r\nlet sentAnalytics = false;\r\n\r\n// @CUSTOM: Product extension property id for milling option\r\nconst millGradeId = 'CartLineMillGrade';\r\n\r\n// @CUSTOM: Retains milling option selected between product variant changes\r\nlet millSelected: string;\r\n\r\n// @CUSTOM: variable to track timeout to avoid multiple instances\r\nlet clearErrorsTimeOut: NodeJS.Timeout;\r\nconst defaultTimeout = 5000;\r\n\r\nconst BuyboxView: React.FC> = props => {\r\n const { ModuleProps, MediaGalleryContainerProps, ProductInfoContainerProps, addToCart, addToOrderTemplate, addToWishlist, configure, description, findInStore, quantity, price, title, rating, inventoryLabel, shopSimilarLook, keyInPrice,\r\n shopSimilarDescription, unitOfMeasure } = props;\r\n\r\n buyboxPops = props;\r\n\r\n // @CUSTOM: Only show price and add to cart for logged in users\r\n const user = ModuleProps.moduleProps.context.request.user;\r\n const isLoggedIn = !!(user && user.customerAccountNumber);\r\n\r\n // @CUSTOM: Only show milling if customer's warehouse supports it\r\n const customerAttributes = convertCustomerAttributes(props.data.customerInformation.result?.Attributes);\r\n const customerWarehouse = customerAttributes.CusDefaultWH as string;\r\n const warehouseTable: WarehousesNoMill = props.context.app.config.warehouseTable;\r\n const warehouseCanMill = customerWarehouse && !warehouseTable.find(warehouse => {\r\n return warehouse.value === customerWarehouse;\r\n });\r\n\r\n // @CUSTOM: Set milling options from global config\r\n const millingOptions: MillingOptions = props.context.app.config.millingOptions || [];\r\n const productAttributes = convertProductAttributesLocalized(props.data.productSpecificationData.result || []);\r\n\r\n // @CUSTOM: get pallet details and variant inventory\r\n _getPalletInfo(productAttributes);\r\n\r\n const product = props.data.product.result;\r\n\r\n // @CUSTOM: Set hidden variant from global config\r\n const hiddenVariant: HiddenVariant = props.context.app.config.hiddenVariant || {};\r\n\r\n // need to set milling option to product when variant changes\r\n if (millSelected && product) {\r\n _updateMilling(product);\r\n }\r\n\r\n // @CUSTOM: clear error messages that are overlaying on content\r\n clearTimeout(clearErrorsTimeOut);\r\n clearErrorsTimeOut = setTimeout(() => {\r\n\r\n // @CUSTOM: send pdpview event here to ensure subscribe has fired\r\n if (product && !sentAnalytics) {\r\n\r\n const gaData: PDPVisitEvent = {\r\n itemID: product.ItemId || '',\r\n recordID: product.MasterProductId || product.RecordId,\r\n variant: product.RecordId.toString(),\r\n name: product.Name || '',\r\n quantity: 0,\r\n price: 0,\r\n discount: 0,\r\n currency: props.context.request.channel?.Currency || 'USD',\r\n unitOfMeasure: product.DefaultUnitOfMeasure,\r\n attributes: {}\r\n };\r\n\r\n publish('productDetailView', gaData);\r\n\r\n sentAnalytics = true;\r\n\r\n }\r\n\r\n props.callbacks.updateErrorState({configureErrors: {}});\r\n }, props.config.errorMessageTimeout || defaultTimeout);\r\n\r\n // @CUSTOM: Re-organized TSX for theme\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {productAttributes.Brand &&
{productAttributes.Brand.value}
}\r\n {title}\r\n {unitOfMeasure}\r\n {props.bulkPurchaseLink}\r\n {description}\r\n {rating}\r\n {/* @CUSTOM: Add hidden variant from global config to pass through configurators */}\r\n {configure && hiddenVariant && _renderConfigure(configure, hiddenVariant)}\r\n {warehouseCanMill && productAttributes.IsMillable?.value && product && _renderMillingOptions(millingOptions, product, props.resources.millingTitle)}\r\n {isLoggedIn && keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {isLoggedIn && price}\r\n {inventoryLabel}\r\n
\r\n {quantity && _renderQuantity(quantity)}\r\n {isLoggedIn && addToCart && _renderAddToCart(addToCart)}\r\n {findInStore && _renderFindInStore(findInStore)}\r\n {addToOrderTemplate && _renderAddToOrderTemplate(addToOrderTemplate)}\r\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\r\n {_renderPalletBuybox(isLoggedIn, props.resources.palletButtonTextCta, props.resources.palletButtonTextUnit)/*@CUSTOM*/}\r\n
\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\r\n
\r\n
\r\n );\r\n};\r\n\r\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToCart;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToOrderTemplate = (addToOrderTemplate: IBuyboxAddToOrderTemplateViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToOrderTemplate;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToWishlist = (addToWishlist: IBuyboxAddToWishlistViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToWishlist;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\n// @CUSTOM: Add Hidden Variant from global config to pass through as parameter\r\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps, variant: HiddenVariant): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n\r\n return (\r\n \r\n {dropdowns.map(dropdown => _renderConfigureDropdown(dropdown, variant))}\r\n \r\n );\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\n// @CUSTOM: Add Hidden Variant from global config to pass through as parameter\r\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps, variant: HiddenVariant): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n\r\n // By default ReactNodes can be strings, which cannot take props, so have to\r\n // properly type-guard as a valid React element first to access props\r\n const selectName = React.isValidElement(select) && select.props.dropdownName;\r\n\r\n // If select name matches the hidden variant name, and if the hidden variant\r\n // default value is set up, add a class to hide the dropdown container\r\n let isHidden = false;\r\n if ((selectName === variant.name) && variant.defaultValue) {\r\n isHidden = true;\r\n }\r\n\r\n return (\r\n // Adding class to hide dropdown container for hidden variant\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {select}\r\n \r\n );\r\n};\r\n\r\nconst _renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\nconst _renderQuantity = (quantity: IBuyboxProductQuantityViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input, errors } = quantity;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\r\n\r\n return (\r\n \r\n {heading}\r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n const { ContainerProps, errors, input } = shopSimilarItem;\r\n\r\n return (\r\n \r\n {errors}\r\n {input}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * CUSTOM EXTENSON: Milling Options\r\n * Adds milling options to pdp\r\n */\r\nconst _renderMillingOptions = (millingOptions: MillingOptions, product: SimpleProduct, title: string): JSX.Element => {\r\n return (\r\n
\r\n
{title}
\r\n
\r\n
\r\n {millingOptions.map((option) => {\r\n return _renderMillingOption(option, product);\r\n })}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\n/**\r\n * CUSTOM EXTENSON: Milling Options\r\n * Renders milling option defined from global config millingOptions\r\n */\r\nconst _renderMillingOption = (option: MillingOption, product: SimpleProduct): JSX.Element => {\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * CUSTOM EXTENSON: Milling Options\r\n * Updates mill selected to option clicked\r\n */\r\nconst _onMillingChange = (event: React.MouseEvent, product: SimpleProduct): void => {\r\n const target = event.currentTarget as HTMLInputElement;\r\n if (target) {\r\n millSelected = target.value;\r\n _updateMilling(product);\r\n }\r\n};\r\n\r\n/**\r\n * CUSTOM EXTENSON: Milling Options\r\n * Updates product extension property for milling\r\n * Unorthodox solution to pass extension property to add-to-cart-component by changing product record in cache\r\n */\r\nconst _updateMilling = (product: SimpleProduct) => {\r\n const lineAttributes = product.ExtensionProperties?.find((attribute) => {\r\n return attribute.Key === 'LineAttributes';\r\n });\r\n if (lineAttributes && lineAttributes.Value) {\r\n lineAttributes.Value[millGradeId] = millSelected;\r\n } else {\r\n // forcing extra layer into extension properties for selected adding to cart line attributes\r\n // @ts-expect-error\r\n product.ExtensionProperties?.push({ Key: 'LineAttributes', Value: { CartLineMillGrade: millSelected } });\r\n }\r\n};\r\n\r\nconst _renderPalletBuybox = (isLoggedIn: boolean, palletButtonTextCta: string, palletButtonTextUnit: string): JSX.Element | null => {\r\n\r\n if (palletId && palletUnits && palletWeight) {\r\n return (\r\n
\r\n
\r\n \r\n \r\n \r\n {palletButtonTextCta}\r\n \r\n \r\n {`${palletUnits} X ${palletWeight} ${palletButtonTextUnit}`}\r\n \r\n \r\n
{palletMessage}
\r\n
\r\n );\r\n }\r\n return null;\r\n};\r\n\r\nconst _updateQty = (e: React.ChangeEvent): void => {\r\n palletQty = e.target.value;\r\n};\r\n\r\nconst _addPalletToCart = async(): Promise => {\r\n if (palletId) {\r\n const productId = parseFloat(palletId);\r\n const addToCartQty = parseFloat(palletQty);\r\n\r\n await _getPalletavailability(palletId);\r\n\r\n // @CUSTOM: get catalog id for compare on cart line merging\r\n const catalogId = getCatalogId(buyboxPops.ModuleProps.moduleProps.context.actionContext.requestContext);\r\n\r\n // grab current product for base attributes vs making call for variant product\r\n const product = await buyboxPops.data.product;\r\n _updateMilling(product);\r\n\r\n // @CUSTOM: checks if item is already in cart and updates quantity instead of creating a new line\r\n const cartState = await getCartState(buyboxPops.context.actionContext);\r\n addOverridesToCartState(cartState);\r\n\r\n let addToCartResult: ICartActionResult;\r\n\r\n // check for custom attributes passed through extension properties\r\n const customAttributes = product.ExtensionProperties?.find(atr => {\r\n return atr.Key === 'LineAttributes';\r\n });\r\n\r\n // get all cart lines with the same id as item being added\r\n // and matching catalog id\r\n const productMatches = cartState.cart.CartLines?.filter(cartLine => {\r\n return cartLine.ProductId === productId && cartLine.CatalogId === catalogId && cartLine.UnitOfMeasureSymbol === 'PL';\r\n });\r\n\r\n const cartCombineTable = buyboxPops.context.app.config.cartLineCombineTable as CartLineCombineTable || [];\r\n\r\n // check to see if item already in cart\r\n const itemInCart = productMatches?.find(cartLine => productPropertiesMatch(cartCombineTable, cartLine, customAttributes));\r\n\r\n // check if product already in cart and if so update cart line instead\r\n if (itemInCart) {\r\n addToCartResult = await CartUtilities.addToExistingLine(cartState, itemInCart, buyboxPops.context, addToCartQty, palletAvailability);\r\n } else {\r\n addToCartResult = await cartState.addProductToCart({\r\n product: {\r\n AdjustedPrice: 0,\r\n BasePrice: 0,\r\n Price: 0,\r\n ProductTypeValue: product.ProductTypeValue,\r\n RecordId: productId,\r\n DefaultUnitOfMeasure: 'PL',\r\n ExtensionProperties: product.ExtensionProperties\r\n },\r\n count: addToCartQty,\r\n availableQuantity: palletAvailability?.AvailableQuantity,\r\n enableStockCheck: buyboxPops.context.app.config.enableStockCheck,\r\n customAttributes: customAttributes?.Value\r\n } as AddProductsToCartWithAttribs);\r\n }\r\n if (addToCartResult.status === 'SUCCESS') {\r\n palletMessage = '';\r\n return;\r\n }\r\n\r\n }\r\n\r\n palletMessage = buyboxPops.resources.palletErrorMessage;\r\n\r\n};\r\n\r\n/**\r\n * CUSTOM EXTENSON: Pallets\r\n * Sets Pallet units and weight for display\r\n */\r\nconst _getPalletInfo = (productAttributes: AttributesLocalized): void => {\r\n // sets pallet id found in the target product's attributes\r\n palletId = productAttributes[palletAttributes.variant]?.value?.toString();\r\n\r\n if (palletId) {\r\n\r\n // pallet details are in a string separated by semi-colons;\r\n // breaks up details by the separator and removes spaces as\r\n // details include numbers that will be used for calculating\r\n // availability\r\n const palletDetails = productAttributes[palletAttributes.details] ? productAttributes[palletAttributes.details].value?.toString().replace(/\\s+/g, '').split(';') : null;\r\n if (palletDetails && palletDetails.length === 2) {\r\n palletUnits = palletDetails[0];\r\n palletWeight = `${palletDetails[1]}`;\r\n }\r\n\r\n }\r\n};\r\n\r\n/**\r\n * CUSTOM EXTENSON: Pallets\r\n * Calculates pallet availability\r\n */\r\nconst _getPalletavailability = async(productId: string): Promise => {\r\n const input = new ProductAvailabilitiesForSelectedVariantInput(productId, buyboxPops.context.request.apiSettings.channelId);\r\n const inventory = await getProductAvailabilitiesForSelectedVariant(input, buyboxPops.context.actionContext);\r\n const productAvailableQuantity = inventory && inventory[0] ? inventory[0].ProductAvailableQuantity : undefined;\r\n\r\n if (productAvailableQuantity?.AvailableQuantity && palletUnits) {\r\n productAvailableQuantity.AvailableQuantity = Math.floor(productAvailableQuantity.AvailableQuantity / parseFloat(palletUnits));\r\n palletAvailability = productAvailableQuantity;\r\n } else {\r\n palletAvailability = undefined;\r\n }\r\n};\r\n\r\nexport default BuyboxView;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport classnames from 'classnames';\r\n\r\nimport { IBuyboxAddToCartViewProps, IBuyboxAddToOrderTemplateViewProps, IBuyboxAddToWishlistViewProps,\r\n IBuyboxKeyInPriceViewProps, IBuyboxProductConfigureDropdownViewProps, IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps, IBuyboxShopSimilarLookViewProps, IBuyboxViewProps, IBuyboxFindInStoreViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nimport { IBuyboxProps } from '../definition-extensions/buybox.ext.props.autogenerated';\r\nimport { IBuyboxData } from './buybox.data';\r\n\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { HiddenVariant, MillingOptions, MillingOption } from '../../../settings/app.settings';\r\n\r\nimport { convertProductAttributes } from '../../../utilities/data-attribute-parser';\r\n\r\n// @CUSTOM: Product extension property id for milling option\r\nconst millGradeId = 'CartLineMillGrade';\r\n\r\n// @CUSTOM: Retains milling option selected between product variant changes\r\nlet millSelected: string;\r\n\r\n// @CUSTOM: variable to track timeout to avoid multiple instances\r\nlet clearErrorsTimeOut: NodeJS.Timeout;\r\nconst defaultTimeout = 5000;\r\n\r\nconst BuyboxView: React.FC> = props => {\r\n const { ModuleProps, MediaGalleryContainerProps, ProductInfoContainerProps, addToCart, addToOrderTemplate, addToWishlist, configure, description, findInStore, quantity, price, title, rating, inventoryLabel, shopSimilarLook, keyInPrice,\r\n shopSimilarDescription, unitOfMeasure } = props;\r\n\r\n // @CUSTOM: Only show price and add to cart for logged in users\r\n const user = ModuleProps.moduleProps.context.request.user;\r\n const isLoggedIn = !!(user && user.customerAccountNumber);\r\n\r\n // @CUSTOM: Set milling options from global config\r\n const millingOptions: MillingOptions = props.context.app.config.millingOptions || [];\r\n const productAttributes = convertProductAttributes(props.data.productSpecificationData.result || []);\r\n const product = props.data.product.result;\r\n\r\n // @CUSTOM: Set hidden variant from global config\r\n const hiddenVariant: HiddenVariant = props.context.app.config.hiddenVariant || {};\r\n\r\n // need to set milling option to product when variant changes\r\n if (millSelected && product) {\r\n _updateMilling(product);\r\n }\r\n\r\n // @CUSTOM: clear error messages that are overlaying on content\r\n clearTimeout(clearErrorsTimeOut);\r\n clearErrorsTimeOut = setTimeout(() => {\r\n props.callbacks.updateErrorState({configureErrors: {}});\r\n }, props.config.errorMessageTimeout || defaultTimeout);\r\n\r\n // @CUSTOM: Re-organized TSX for theme\r\n return (\r\n \r\n \r\n {props.mediaGallery}\r\n \r\n \r\n {productAttributes.Brand &&
{productAttributes.Brand}
}\r\n {title}\r\n {unitOfMeasure}\r\n {props.bulkPurchaseLink}\r\n {description}\r\n {rating}\r\n {/* @CUSTOM: Add hidden variant from global config to pass through configurators */}\r\n {configure && hiddenVariant && _renderConfigure(configure, hiddenVariant)}\r\n {productAttributes['Is Millable'] && product && _renderMillingOptions(millingOptions, product, props.resources.millingTitle)}\r\n {isLoggedIn && keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {isLoggedIn && price}\r\n {inventoryLabel}\r\n
\r\n {quantity && _renderQuantity(quantity)}\r\n {isLoggedIn && addToCart && _renderAddToCart(addToCart)}\r\n {findInStore && _renderFindInStore(findInStore)}\r\n {addToOrderTemplate && _renderAddToOrderTemplate(addToOrderTemplate)}\r\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\r\n
\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\r\n
\r\n
\r\n );\r\n};\r\n\r\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToCart;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToOrderTemplate = (addToOrderTemplate: IBuyboxAddToOrderTemplateViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToOrderTemplate;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToWishlist = (addToWishlist: IBuyboxAddToWishlistViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToWishlist;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\n// @CUSTOM: Add Hidden Variant from global config to pass through as parameter\r\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps, variant: HiddenVariant): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n\r\n return (\r\n \r\n {dropdowns.map(dropdown => _renderConfigureDropdown(dropdown, variant))}\r\n \r\n );\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 (\r\n <>\r\n {socialShare[0]}\r\n \r\n );\r\n};\r\n\r\n// @CUSTOM: Add Hidden Variant from global config to pass through as parameter\r\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps, variant: HiddenVariant): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n\r\n // By default ReactNodes can be strings, which cannot take props, so have to\r\n // properly type-guard as a valid React element first to access props\r\n const selectName = React.isValidElement(select) && select.props.dropdownName;\r\n\r\n // If select name matches the hidden variant name, and if the hidden variant\r\n // default value is set up, add a class to hide the dropdown container\r\n let isHidden = false;\r\n if ((selectName === variant.name) && variant.defaultValue) {\r\n isHidden = true;\r\n }\r\n\r\n return (\r\n // Adding class to hide dropdown container for hidden variant\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {select}\r\n \r\n );\r\n};\r\n\r\nconst _renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\nconst _renderQuantity = (quantity: IBuyboxProductQuantityViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input, errors } = quantity;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n \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 EXTENSON: Milling Options\r\n * Adds milling options to pdp\r\n */\r\nconst _renderMillingOptions = (millingOptions: MillingOptions, product: SimpleProduct, title: string): JSX.Element => {\r\n return (\r\n
\r\n
{title}
\r\n
\r\n
\r\n {millingOptions.map((option) => {\r\n return _renderMillingOption(option, product);\r\n })}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\n/**\r\n * CUSTOM EXTENSON: Milling Options\r\n * Renders milling option defined from global config millingOptions\r\n */\r\nconst _renderMillingOption = (option: MillingOption, product: SimpleProduct): JSX.Element => {\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * CUSTOM EXTENSON: Milling Options\r\n * Updates mill selected to option clicked\r\n */\r\nconst _onMillingChange = (event: React.MouseEvent, product: SimpleProduct): void => {\r\n const target = event.currentTarget as HTMLInputElement;\r\n if (target) {\r\n millSelected = target.value;\r\n _updateMilling(product);\r\n }\r\n};\r\n\r\n/**\r\n * CUSTOM EXTENSON: Milling Options\r\n * Updates product extension property for milling\r\n * Unorthodox solution to pass extension property to add-to-cart-component by changing product record in cache\r\n */\r\nconst _updateMilling = (product: SimpleProduct) => {\r\n const lineAttributes = product.ExtensionProperties?.find((attribute) => {\r\n return attribute.Key === 'LineAttributes';\r\n });\r\n if (lineAttributes && lineAttributes.Value) {\r\n lineAttributes.Value[millGradeId] = millSelected;\r\n } else {\r\n // forcing extra layer into extension properties for selected adding to cart line attributes\r\n // @ts-expect-error\r\n product.ExtensionProperties?.push({ Key: 'LineAttributes', Value: { CartLineMillGrade: millSelected } });\r\n }\r\n};\r\n\r\nexport default BuyboxView;\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\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 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//----------------------------------------------------------\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","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|country-malt-group|views|buybox'] = {\n c: () => require('partner/themes/country-malt-group/views/buybox.view.tsx'),\n cn: '__local__-__local__-buybox'\n };\nviewDictionary['__local__|__local__|themes|cryer-malt|views|buybox'] = {\n c: () => require('partner/themes/cryer-malt/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, getCatalogId } from '@msdyn365-commerce/core-internal';\nimport { ArrayExtensions, IDimensionsApp, validateCatalogId } 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 { FeatureState } from '@msdyn365-commerce/retail-proxy';\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 private readonly collapseRef: React.RefObject = React.createRef();\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 /**\n *This function is being used to handel variant change dropdown.\n */\n private _dimensionDropDownChange = () => {\n this.collapseRef.current?.reEvaluateHeight();\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 const channelMultipleCatalogsFeature = 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature';\n const { featureState } = this.props.data;\n const isMultipleCatalogsFeatureEnabled =\n featureState?.result?.find((item: FeatureState) => item.Name === channelMultipleCatalogsFeature)?.IsEnabled || false;\n const catalogId = getCatalogId(this.props.context.request);\n validateCatalogId(catalogId);\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 dimensionOnChange={this._dimensionDropDownChange}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogsFeatureEnabled}\n catalogId={catalogId}\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 validateCatalogId\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 EcommerceQuantityLimitConfigurationsFeatureName\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 isChannelMultipleCatalogsFeatureEnabled?: boolean;\n currentCatalogId?: number;\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 isPriceApiCalled: 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 // There are multiple sources triggering the callback function dimensionSelectedAsync calling the GetActivePrice api before componentDidMount and after componentDidMount.\n // Set isPriceApiCalled to false here to prevent redundant API call after componentDidMount:\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\n // We will skip calling RS API in this case as the price data has already been fetched via module data action in node server.\n this.setState({ isPriceApiCalled: false });\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 validateCatalogId(catalogId);\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(\n props,\n this.state,\n this.buyboxCallbacks,\n this._isChannelMultipleCatalogsFeatureEnabled(),\n catalogId\n ),\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 isChannelMultipleCatalogsFeatureEnabled: this._isChannelMultipleCatalogsFeatureEnabled(),\n currentCatalogId: catalogId,\n catalogs: this._validateCatalogDetails(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 const scrollX = boundingRect.left + window.pageXOffset;\n const scrollY = boundingRect.top + window.pageYOffset;\n\n window.scrollTo(scrollX, scrollY);\n };\n private readonly _isChannelMultipleCatalogsFeatureEnabled = (): boolean => {\n let isMultipleCatalogFeatureEnabledInHq = false;\n if (this.props.data.featureState) {\n isMultipleCatalogFeatureEnabledInHq =\n this.props.data.featureState.result?.find(\n feature => feature.Name === 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature'\n )?.IsEnabled || false;\n }\n return isMultipleCatalogFeatureEnabledInHq;\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\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 // This function is invoked when dimensionSelectedAsync get called.\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\n // We will skip calling RS API in this case as the price data has already been fetched via module data action in node server.\n if (!this.state.isPriceApiCalled) {\n this.setState({ isPriceApiCalled: true });\n return;\n }\n\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 const isChannelLimitsFeatureEnabled = await this._isChannelLimitsFeatureEnabled();\n\n const min: number = this._getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled, product);\n const max: number = this._getMaxQuantityForCartLineItem(\n isChannelLimitsFeatureEnabled || isOrderQuantityLimitsFeatureEnabled,\n product\n );\n\n this.setState({\n min,\n max\n });\n }\n\n private _getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\n if (isOrderQuantityLimitsFeatureEnabled && product?.Behavior?.MinimumQuantity && product.Behavior.MinimumQuantity > 0) {\n return product.Behavior.MinimumQuantity;\n }\n\n return 1;\n }\n\n private _getMaxQuantityForCartLineItem(isQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\n if (isQuantityLimitsFeatureEnabled && product?.Behavior?.MaximumQuantity && product.Behavior.MaximumQuantity > 0) {\n return product.Behavior.MaximumQuantity;\n }\n\n return updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem);\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 private _validateCatalogDetails(catalogId: number): ProductCatalog[] | undefined {\n const catalogs = this.props.data.catalogs?.result?.filter(item => item.RecordId === catalogId);\n if (ArrayExtensions.hasElements(catalogs) && catalogs[0].RecordId === 0) {\n return;\n }\n\n return catalogs;\n }\n\n private async _isChannelLimitsFeatureEnabled(): Promise {\n const featureStatuses = await this.props.data.featureState;\n\n const isChannelLimitsFeatureEnabledInHq = featureStatuses?.find(\n featureState => featureState.Name === EcommerceQuantityLimitConfigurationsFeatureName\n )?.IsEnabled;\n\n return isChannelLimitsFeatureEnabledInHq ?? false;\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":["palletAttributes","palletId","palletUnits","palletWeight","palletMessage","palletAvailability","buyboxPops","palletQty","sentAnalytics","millSelected","clearErrorsTimeOut","_renderAddToCart","addToCart","ContainerProps","errorBlock","button","React","Node","Object","assign","_renderAddToOrderTemplate","addToOrderTemplate","_renderAddToWishlist","addToWishlist","_renderConfigure","configure","variant","dropdowns","map","dropdown","_renderConfigureDropdown","_renderSocialShare","socialShare","length","LabelContainerProps","heading","errors","select","isHidden","props","dropdownName","name","defaultValue","className","classnames","_renderFindInStore","findInStore","storeSelector","description","modal","productPickupOptionList","_renderQuantity","quantity","input","_renderKeyInPrice","keyInPrice","_renderShopSimilarItem","shopSimilarItem","_renderMillingOptions","millingOptions","product","title","autoComplete","option","_renderMillingOption","type","value","defaultChecked","isDefault","onClick","e","_onMillingChange","label","event","target","currentTarget","_updateMilling","_product$ExtensionPro","lineAttributes","ExtensionProperties","find","attribute","Key","_product$ExtensionPro2","Value","push","CartLineMillGrade","_renderPalletBuybox","isLoggedIn","palletButtonTextCta","palletButtonTextUnit","onChange","_updateQty","disabled","_addPalletToCart","async","_product$ExtensionPro3","_cartState$cart$CartL","productId","parseFloat","addToCartQty","_getPalletavailability","catalogId","getCatalogId","ModuleProps","moduleProps","context","actionContext","requestContext","data","cartState","getCartState","addToCartResult","addOverridesToCartState","customAttributes","atr","productMatches","cart","CartLines","filter","cartLine","ProductId","CatalogId","UnitOfMeasureSymbol","cartCombineTable","app","config","cartLineCombineTable","itemInCart","productPropertiesMatch","_palletAvailability","CartUtilities","addToExistingLine","addProductToCart","AdjustedPrice","BasePrice","Price","ProductTypeValue","RecordId","DefaultUnitOfMeasure","count","availableQuantity","AvailableQuantity","enableStockCheck","status","resources","palletErrorMessage","_getPalletInfo","productAttributes","_productAttributes$pa","toString","_productAttributes$pa2","palletDetails","replace","split","ProductAvailabilitiesForSelectedVariantInput","request","apiSettings","channelId","inventory","getProductAvailabilitiesForSelectedVariant","productAvailableQuantity","ProductAvailableQuantity","undefined","Math","floor","_props$data$customerI","_productAttributes$Is","MediaGalleryContainerProps","ProductInfoContainerProps","price","rating","inventoryLabel","shopSimilarLook","shopSimilarDescription","unitOfMeasure","user","customerAccountNumber","customerWarehouse","convertCustomerAttributes","customerInformation","result","Attributes","CusDefaultWH","warehouseTable","warehouseCanMill","warehouse","convertProductAttributesLocalized","productSpecificationData","hiddenVariant","clearTimeout","setTimeout","_props$context$reques","gaData","itemID","ItemId","recordID","MasterProductId","Name","discount","currency","channel","Currency","attributes","publish","callbacks","updateErrorState","configureErrors","errorMessageTimeout","Module","mediaGallery","Brand","bulkPurchaseLink","IsMillable","millingTitle","slots","convertProductAttributes","attributeList","output","meta","forEach","DataTypeValue","typeData","getTypeInfo","source","KeyName","friendlyName","AttributeValue","customerSource","AttributeDataType","None","DateTime","Decimal","Integer","Text","TrueFalse","Video","Image","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","id","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","window","__bindings__","_objectSpread","viewDictionary","cn","BaseStoreSelectorStateManager","constructor","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","this","isMapModuleLoaded","_readFromToCookie","storeInfo","JSON","parse","preferredStore","_unused","_context","storeId","selectedStoreLocationId","storeName","writeToCookie","arguments","StoreId","StoreName","Latitude","Longitude","_writeToCookie","stringify","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","key","MsDyn365","isBrowser","localStorage","removeItem","setItem","cookieValue","getItem","__decorate","computed","observable","action","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","trim","query","encodeURI","geolocationApiUrl","requestUrl","Promise","resolve","script","document","createElement","setAttribute","remove","resourceSets","point","coordinates","body","appendChild","_document","StringExtensions","isNullOrEmpty","getElementById","url","lang","market","reject","_document2","_document3","defer","src","mapAPIReady","isMapApiLoaded","addEventListener","error","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","createObservableDataAction","getGenericAction","inputData","BulkPurchase","super","collapseRef","_dimensionDropDownChange","_this$collapseRef$cur","current","reEvaluateHeight","_toggleCollapse","setState","state","isExpanded","render","_this$props$data$prod","hasDimensionsInProps","ArrayExtensions","hasElements","productDimensions","hasDimensionsInData","viewProps","container","content","_renderCollapseContent","renderView","_renderCollapseButton","_renderCollapse","Button","bulkPurchaseHeaderTitle","Collapse","isOpen","ref","_renderMainContent","isMobileDevice","isMobile","VariantType","Viewport","RichTextComponent","text","bulkPurchaseDescriptionText","_renderMatrix","_featureState$result","_this$props$data$orde","_this$props$data$cust","featureState","isMultipleCatalogsFeatureEnabled","item","IsEnabled","validateCatalogId","ProductDimensionsMatrix","dimensions","orderTemplates","dimensionOnChange","isMultipleCatalogFeatureEnabledInHq","modalCloseButtonReference","onClickFindInStoreHandler","_props$data","storeSelectorStateManager","selectedProduct","dataProduct","multiplePickupStoreSwitchName","retailMulitplePickupMFeatureState","missingDimensions","Dimensions","dimension","DimensionValue","storeSelectorId","keys","errorHost","getConfigureErrors","openDialog","parentElementRef","deliveryOptions","onLocationSelected","orgUnitLocation","deliveryMode","_props$context","behavior","addToCartBehavior","location","then","substatus","productAvailability","changeModalOpen","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","telemetry","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","closeNotificationLabel","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","addedQuantityText","notification","ItemSuccessfullyAddedToCartNotification","gridSettings","productPrice","typeName","NotificationsManager","instance","addNotification","catch","exception","debug","message","findInStoreOnClick","getBuyboxFindInStore","_data$product","_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","IsProductAvailable","findInStoreNotAvailableTextButton","findInStoreNotAvailableDescription","getFindInStoreInventorySettings","DeliveryOptions","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","deliveryCode","Code","PickupDeliveryModeCodes","priceComponent","PriceComponent","popupProps","imageSettings","productQuantity","setModalOpen","renderModalPopup","Popup","openFindInStoreDialog","Heading","headingTag","Description","BuyboxErrorBlock","showError","color","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","scrollX","left","pageXOffset","scrollY","top","pageYOffset","scrollTo","_isChannelMultipleCatalogsFeatureEnabled","_this$props$data$feat","feature","hasProductDimensions","dimensionsToUpdate","clearErrorState","previousState","_getProductVariant","productVariant","productVariantPromise","promises","_getDimensionsForSelectedVariant","mappedDimensions","_hydrateInventoryInfo","_hydratePrice","_hydrateDeliveryOptions","_updateQuantitiesInState","all","isGiftCard","IsGiftCard","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","min","max","isPriceApiCalled","ItemTypeValue","ReleasedProductType","Service","isServiceItem","maxRecentlyViewedItemsCount","RecentlyViewedState","_this$props$data$prod2","productComparisonButton","inventoryLevel","dimensionValuesWithInventory","flatten","validValues","hasAvailableProducts","some","getInventoryLevelCodeFromDimensionValue","InventoryLevelValues","outOfStock","getBuyboxProductTitle","getBuyboxProductDescription","_renderBuyboxBulkPurchaseLink","getBuyboxProductUnitOfMeasure","getBuyboxProductConfigure","getBuyboxProductPrice","getBuyboxAddToCart","getBuyboxProductComparisonButton","getBuyboxProductAddToOrderTemplate","getBuyboxProductAddToWishlist","hideRating","getBuyboxProductRating","getBuyboxProductQuantity","getBuyBoxInventoryLabel","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","Looks","enableShopSimilarDescription","enableKeyInPrice","isCustomPriceSelected","getBuyboxKeyInPrice","quantityLimitsMessages","getQuantityLimitsMessages","isChannelMultipleCatalogsFeatureEnabled","currentCatalogId","catalogs","_validateCatalogDetails","isBulkPurchaseEnabled","msdyn365Commerce","bulkPurchaseModules","Array","from","getElementsByClassName","bulkPurchaseLinkText","CustomerContextualPrice","_ref","_dimension$dimensionV","_dimensions$find$Dime","_dimensions$find","DimensionValues","DimensionTypeValue","_value$DimensionValue","setDimensionValuesToQuery","selectedProductPromise","getSelectedVariant","SelectedVariantInput","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","_productVariant$Dimen","newAvailableQuantity","newShippingQuantity","toLowerCase","getPriceForSelectedVariant","PriceForSelectedVariantInput","_this$props$data$feat2","retailMultiplePickupFeatureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","isOrderQuantityLimitsFeatureEnabled","_isOrderQuantityLimitsFeatureEnabled","isChannelLimitsFeatureEnabled","_isChannelLimitsFeatureEnabled","_getMinQuantityForCartLineItem","_getMaxQuantityForCartLineItem","_product$Behavior","Behavior","MinimumQuantity","isQuantityLimitsFeatureEnabled","_product$Behavior2","MaximumQuantity","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","_this$props$context","_featureStatuses$find","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","featureStatuses","RetailDefaultOrderQuantityLimitsFeatureName","customerInfo","information","IsB2b","_this$props$data$cata","_featureStatuses$find2","isChannelLimitsFeatureEnabledInHq","EcommerceQuantityLimitConfigurationsFeatureName","_renderTextBlock","textBlocks","_renderCartAndActions","onChangeHandler","newValue","quantityComponent","extentionResources","IncrementalQuantity","currentCount","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","minQuantityText","maxQuantityText","module","exports","ReactDOM"],"sourceRoot":""}