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,EAAY,KAkPTD,CAAmB5pB,EAAM8P,OAAS9P,EAAM8P,MAAM+Z,aAC/C3xB,EAAAA,cAAA,OAAKgK,UAAU,gCAAgClC,EAAM5C,UAAUy1B,UAC/D36B,EAAAA,cAAC4e,EAAAA,KAAI,CAAC5U,UAAU,gCACXme,GAAmBqO,EAAsBrO,GACzCK,GAA0BgO,EAAsBhO,KAEnD1gB,EAAMvD,OAAOuiB,iBAAmB9mB,EAAAA,cAAC4e,EAAAA,KAAI,CAAC5U,UAAU,mCAC9ChK,EAAAA,cAAA,OAAKgK,UAAU,wCAAwClC,EAAM5C,UAAU01B,iBACtEriB,GAEJnF,EAAAA,gBAAgBC,YAAYvL,EAAM8P,MAAMijB,sBACrC76B,EAAAA,cAAC4e,EAAAA,KAAI,CAAC5U,UAAU,qCAAqClC,EAAM8P,MAAMijB,qBAAqB,IACtF","sources":["webpack://bestseller.commerce.online/external var \"React\"?0d3b","webpack://bestseller.commerce.online/external var \"ReactDOM\"?853b","webpack://bestseller.commerce.online/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://bestseller.commerce.online/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://bestseller.commerce.online/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://bestseller.commerce.online/./src/shared/functions/get-commercial-name.ts?6aba","webpack://bestseller.commerce.online/./src/shared/components/price.component.tsx?0789","webpack://bestseller.commerce.online/./src/shared/components/modal-panel.component.tsx?2c38","webpack://bestseller.commerce.online/./lib/ext-buybox/module-registration.js?db97","webpack://bestseller.commerce.online/./src/modules/ext-buybox/components/ext-buybox-find-in-store.tsx?bc24","webpack://bestseller.commerce.online/./src/modules/ext-buybox/ext-buybox.tsx?a7de","webpack://bestseller.commerce.online/./src/actions/get-selected-variant.ts?43b0","webpack://bestseller.commerce.online/./src/modules/ext-buybox/ext-buybox.view.tsx?db6f","webpack://bestseller.commerce.online/./src/themes/only/views/components/buybox-add-to-order-template.tsx?346b","webpack://bestseller.commerce.online/./src/themes/only/views/ext-buybox.view.tsx?aac9"],"sourcesContent":["module.exports = React;","module.exports = ReactDOM;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport {\n IListMapViewState,\n ILoadMapApiInput,\n IStoreInfo,\n IStoreSelectionStateContext,\n IStoreSelectorLocation,\n IStoreSelectorStateManager\n} from './i-store-selection-state-manager';\n\n/**\n * Abstract instance of IStoreSelectorStateManager with base implementation\n * of everything except the geoLocate function.\n */\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\n @computed public get isDialogOpen(): Readonly {\n return this._context !== undefined;\n }\n\n @computed public get context(): Readonly {\n return this._context;\n }\n\n @observable public isMapApiLoaded?: boolean;\n\n @observable public selectedStoreLocationId?: string;\n\n @observable public preferredStore?: IStoreInfo;\n\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n\n @observable public isMapModuleLoaded?: boolean;\n\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\n\n @observable protected _context?: IStoreSelectionStateContext;\n\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\n try {\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\n if (storeInfo) {\n this.preferredStore = storeInfo;\n }\n } catch {\n this.preferredStore = undefined;\n }\n }\n\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\n\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\n this._context = input;\n }\n\n @action\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\n this.selectedStoreLocationId = storeId;\n }\n\n @action\n public async setPreferredStoreLocation(\n storeId?: string,\n storeName?: string | undefined,\n writeToCookie: boolean = false,\n latitude?: number,\n longitude?: number\n ): Promise {\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\n this.preferredStore = storeInfo;\n if (writeToCookie) {\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\n }\n }\n\n @action\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\n this.lastInlineShownStoreInfo = storeInfo;\n }\n\n @action\n public async clearPreferredStore(writeToCookie: boolean): Promise {\n this.preferredStore = undefined;\n if (writeToCookie) {\n this._removeCookie(this.preferredStoreLocalStorageKey);\n }\n }\n\n @action\n public async openDialog(input: IStoreSelectionStateContext): Promise {\n if (this._context && this._context.id === input.id) {\n throw new Error('Dialog is already opened');\n }\n\n this._context = input;\n }\n\n @action\n public async closeDialog(): Promise {\n this._context = undefined;\n }\n\n private _removeCookie(key: string): void {\n if (!key) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.removeItem(key);\n }\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { action } from 'mobx';\n\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IStoreSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (\n !searchTerm ||\n !actionContext.requestContext.channel ||\n !actionContext.requestContext.channel.BingMapsApiKey ||\n !actionContext.requestContext.channel.BingMapsEnabled\n ) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl =\n actionContext.requestContext.app &&\n actionContext.requestContext.app.config &&\n actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise(resolve => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n if (window) {\n const currentWindowAPI = window.mapAPIReady;\n window.mapAPIReady = () => {\n if (currentWindowAPI) {\n currentWindowAPI();\n }\n this.isMapApiLoaded = true;\n };\n }\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\n input.market ? `&setMkt=${input.market}` : ''\n }`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IStoreSelectorStateManager } from './i-store-selection-state-manager';\nimport { MapStoreSelectorStateManager } from './map-store-selector-state-manager';\n\nexport function createStoreSelectorStateInput(result: IStoreSelectorStateManager): GenericInput {\n return new GenericInput('mapSSSM', result, 'IStoreSelectorStateManager');\n}\n\nconst createStoreSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createStoreSelectorStateInput(new MapStoreSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createStoreSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","/**\r\n * Centralised location for checkout generic data updates\r\n */\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * Gets the CommercialName from a list of attributes - returns the product name if no commercial name attribute is present\r\n * @param attributes\r\n * @param productName\r\n * @param commercialStyleNameAttribute\r\n * @returns\r\n */\r\nexport const getCommercialName = (\r\n attributes: AttributeValue[] = [],\r\n productName: string = '',\r\n commercialStyleNameAttribute: string = 'CommercialStyleName'\r\n): string => {\r\n var styleName = attributes.find(x => x.Name === commercialStyleNameAttribute);\r\n var productBrand = productName?.split(' ')[0] ?? '';\r\n if (styleName?.TextValue) {\r\n return `${productBrand} ${styleName?.TextValue}`;\r\n }\r\n\r\n return productName;\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ProductPrice, ProductType, SalesAgreementPriceLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { Button, format, ICollapseProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nconst defaultPrice: number = 0;\r\nconst freePrice: number = 0;\r\n\r\n/**\r\n * Interface for price component resources.\r\n * @param {string} priceRangeSeparator - The price range separator.\r\n */\r\nexport interface IPriceComponentResources {\r\n priceRangeSeparator?: string;\r\n salesAgreementPricePrompt?: string;\r\n salesAgreementExpirationDatePrompt?: string;\r\n salesAgreementCommittedQuantityPrompt?: string;\r\n salesAgreementRemainingQuantityPrompt?: string;\r\n memberPriceMessage?: string;\r\n saleMessage?: string;\r\n}\r\n\r\n/**\r\n * Interface for price component props.\r\n * @param {boolean} isPriceMinMaxEnabled - Whether the price range feature is enabled or not.\r\n * @param {IPriceComponentResources} priceResources - The price range resources.\r\n */\r\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\r\n className?: string;\r\n product?: SimpleProduct;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n isSalesAgreementPriceFeatureEnabled?: boolean;\r\n salesAgreementLineId?: number;\r\n priceResources?: IPriceComponentResources;\r\n salesAgreementDetailCollapseProps?: ICollapseProps;\r\n currencyCode?: string;\r\n showDiscountBox?: boolean;\r\n salesAgreementDetailOnClick?(event: React.MouseEvent | React.KeyboardEvent): void;\r\n}\r\n\r\n/**\r\n * The interface of price component.\r\n */\r\nexport interface IPriceComponent extends IComponent {}\r\n\r\nconst priceComponentActions = {};\r\n\r\n/**\r\n * Get the original price from price component props.\r\n * @param props - The IPriceComponentProps.\r\n * @returns The original price.\r\n */\r\nconst getOriginalPrice = (props: IPriceComponentProps): number => {\r\n return Math.max(\r\n props.data.price.BasePrice || defaultPrice,\r\n props.data.price.TradeAgreementPrice || defaultPrice,\r\n props.data.price.AdjustedPrice || defaultPrice\r\n );\r\n};\r\n\r\nconst getActivePrice = (props: IPriceComponentProps): number => {\r\n if (showPriceRangeForMasterProduct(props) && props.data.price.MinVariantPrice !== undefined) {\r\n return props.data.price.MinVariantPrice;\r\n }\r\n\r\n if (props.data.price.CustomerContextualPrice !== undefined) {\r\n return props.data.price.CustomerContextualPrice;\r\n }\r\n\r\n return getOriginalPrice(props);\r\n};\r\n\r\n/**\r\n * Get the formatted currency.\r\n * @param props - The props.\r\n * @param price - The price.\r\n * @param shouldUseFreePriceText - The shouldUseFreePriceText.\r\n * @returns The formatted currency.\r\n */\r\nconst formatCurrency = (\r\n props: IPriceComponentProps,\r\n price: number | undefined,\r\n shouldUseFreePriceText: boolean | undefined,\r\n currencyCode?: string | undefined\r\n): string => {\r\n if (price === undefined) {\r\n return '';\r\n }\r\n\r\n if (shouldUseFreePriceText && price === freePrice && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(price, currencyCode);\r\n};\r\n\r\nconst showPriceRangeForMasterProduct = (props: IPriceComponentProps): boolean => {\r\n return (\r\n (props.isPriceMinMaxEnabled ?? false) &&\r\n (props.product?.ProductTypeValue === ProductType.Master || props.product?.ProductTypeValue === ProductType.KitMaster) &&\r\n props.data.price.MinVariantPrice !== undefined &&\r\n props.data.price.MaxVariantPrice !== undefined\r\n );\r\n};\r\n\r\n/**\r\n * ShowStrikethroughPricing.\r\n * @param props - The props.\r\n * @returns True if showStrikethroughPricing, false otherwise.\r\n */\r\nconst showStrikethroughPricing = (props: IPriceComponentProps): boolean => {\r\n const originalSalesPrice = getOriginalPrice(props);\r\n const activeSalesPrice = showPriceRangeForMasterProduct(props)\r\n ? props.data.price.MinVariantPrice\r\n : props.data.price.CustomerContextualPrice;\r\n\r\n if (activeSalesPrice && originalSalesPrice) {\r\n return activeSalesPrice < originalSalesPrice;\r\n }\r\n\r\n return false;\r\n};\r\n\r\n/**\r\n * Render current price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst renderCurrentPrice = (\r\n props: IPriceComponentProps,\r\n priceClass: string = 'msc-price__actual',\r\n isMemberDiscount: boolean = false\r\n): JSX.Element => {\r\n const maxVariantPrice: string = formatCurrency(props, props.data.price.MaxVariantPrice, false, props.currencyCode);\r\n const minVariantPrice: string = formatCurrency(props, props.data.price.MinVariantPrice, false, props.currencyCode);\r\n if (\r\n props.isPriceMinMaxEnabled &&\r\n props.data.price.MaxVariantPrice &&\r\n props.data.price.MinVariantPrice &&\r\n props.data.price.MaxVariantPrice > props.data.price.MinVariantPrice\r\n ) {\r\n return (\r\n \r\n \r\n {minVariantPrice}\r\n \r\n \r\n {props.priceResources?.priceRangeSeparator}\r\n \r\n \r\n {maxVariantPrice}\r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n {isMemberDiscount && !props.showDiscountBox && `${props.priceResources?.memberPriceMessage} `}\r\n {formatCurrency(props, getActivePrice(props), true, props.currencyCode)}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render active sales price with original sales price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element => {\r\n const initialPrice: string = formatCurrency(props, getOriginalPrice(props), true);\r\n return (\r\n <>\r\n \r\n {` `}\r\n {props.originalPriceText}\r\n {` `}\r\n {initialPrice}\r\n {` `}\r\n {props.currentPriceText}\r\n {` `}\r\n {renderCurrentPrice(props, 'msc-price__discount')}\r\n \r\n \r\n \r\n {props.savingsText && {props.savingsText}}\r\n \r\n );\r\n};\r\n\r\nconst renderSalesAgreementDetail = (props: IPriceComponentProps): JSX.Element => {\r\n // In most cases there should be only one sales agreement line.\r\n // If there are more than one, only the first one will be shown.\r\n const firstPriceLine: SalesAgreementPriceLine = (props.data.price.AttainablePriceLines ?? [])[0] as SalesAgreementPriceLine;\r\n return (\r\n

\r\n

\r\n {/* Available date */}\r\n {` · ${format(\r\n props.priceResources?.salesAgreementExpirationDatePrompt ?? '',\r\n props.context.cultureFormatter.formatDate(firstPriceLine.EffectiveDate as Date),\r\n props.context.cultureFormatter.formatDate(firstPriceLine.ExpirationDate as Date)\r\n )}`}\r\n

\r\n

\r\n {/* Quantity commitment */}\r\n {` · ${format(props.priceResources?.salesAgreementCommittedQuantityPrompt ?? '', firstPriceLine.CommittedQuantity)}`}\r\n

\r\n

\r\n {/* Remaining quantity to qualify */}\r\n {` · ${format(props.priceResources?.salesAgreementRemainingQuantityPrompt ?? '', firstPriceLine.RemainingQuantity)}`}\r\n

\r\n

\r\n );\r\n};\r\n\r\n/**\r\n * Render member price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst renderMemberPrice = (props: IPriceComponentProps): JSX.Element => {\r\n const initialPrice: string = formatCurrency(props, getOriginalPrice(props), true);\r\n //No strikethrough in member price\r\n return (\r\n <>\r\n \r\n {` `}\r\n {props.originalPriceText}\r\n {` `}\r\n {initialPrice}\r\n {` `}\r\n {props.currentPriceText}\r\n {` `}\r\n {renderCurrentPrice(props, 'msc-price__discount__member', true)}\r\n \r\n \r\n \r\n {props.savingsText && {props.savingsText}}\r\n \r\n );\r\n};\r\n\r\nfunction renderDiscountBox(props: IPriceComponentProps, isMemberDiscount: boolean) {\r\n var discount = 0;\r\n if (props.data.price.CustomerContextualPrice !== undefined && props.data.price.BasePrice !== undefined) {\r\n var diff = props.data.price.CustomerContextualPrice - props.data.price.BasePrice;\r\n discount = (diff / props.data.price.BasePrice) * 100;\r\n }\r\n if (props.data.price?.BasePrice !== props.data.price?.CustomerContextualPrice) {\r\n if (isMemberDiscount) {\r\n return (\r\n
\r\n

{`${props.priceResources?.memberPriceMessage} `}

\r\n
\r\n );\r\n } else {\r\n return (\r\n
\r\n

{`${props.priceResources?.saleMessage}${Math.abs(discount).toFixed(0)}%`}

\r\n
\r\n );\r\n }\r\n } else {\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * Price.\r\n * @param props - The props.\r\n * @returns The JSX.Element.\r\n */\r\nconst Price: React.FC = (props: IPriceComponentProps): JSX.Element | null => {\r\n // CustomerContextualPrice could be zero\r\n if (props.data.price.CustomerContextualPrice === undefined) {\r\n return null;\r\n }\r\n\r\n //TODO: Not a priority - but should be fixed\r\n var isMemberDiscount = false;\r\n props.data.price.DiscountLines?.forEach(discount => {\r\n if (discount.OfferName?.toLowerCase().includes(props.context.request.app.config.loyaltyDiscountIdentifier)) {\r\n isMemberDiscount = true;\r\n }\r\n });\r\n\r\n // Determine if contract price is avaiable/applied by:\r\n // isFeatureEnabled and SA price != 0, for PDP.\r\n // SA line id != 0, for cart line.\r\n if (props.isSalesAgreementPriceFeatureEnabled && props.data.price.SalesAgreementPrice !== 0) {\r\n const [isExpanded, setIsExpanded] = React.useState(false);\r\n const toggle = () => {\r\n setIsExpanded(!isExpanded);\r\n };\r\n return (\r\n \r\n \r\n

\r\n {formatCurrency(props, props.data.price.SalesAgreementPrice ?? props.data.price.CustomerContextualPrice, true)}\r\n

\r\n \r\n {props.priceResources?.salesAgreementPricePrompt}\r\n \r\n {isExpanded && renderSalesAgreementDetail(props)}\r\n
\r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n {isMemberDiscount ? (\r\n {renderMemberPrice(props)}\r\n ) : (\r\n \r\n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\r\n \r\n )}\r\n {props.showDiscountBox && renderDiscountBox(props, isMemberDiscount)}\r\n
\r\n );\r\n};\r\n\r\n/**\r\n * The PriceComponent.\r\n */\r\nexport const PriceComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'Price',\r\n { component: Price, ...priceComponentActions }\r\n);\r\n\r\nexport default PriceComponent;\r\n","import React from 'react';\r\nexport enum Position {\r\n RIGHT = 'right',\r\n BOTTOM = 'bottom',\r\n POPUP_RELATIVE = 'popup-relative',\r\n POPUP_CENTERED = 'popup-centered'\r\n}\r\nexport interface ModalPanelConfiguration {\r\n isOpen?: boolean;\r\n position?: Position;\r\n toggle?: any;\r\n children?: React.ReactNode;\r\n}\r\n\r\nconst ModalPanel = ({ isOpen, position, toggle, children }: ModalPanelConfiguration) => {\r\n const innerClassname = `panel ${position} ${isOpen ? 'open' : 'closed'}`;\r\n return (\r\n
\r\n {isOpen &&
}\r\n
{children}
\r\n
\r\n );\r\n};\r\nexport default ModalPanel;\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['ext-buybox'] = {\n c: () => require('partner/modules/ext-buybox/ext-buybox.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'cartConfiguration', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration', 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:'actions/get-selected-variant', runOn: 1},{name:'productAvailableQuantity', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant', runOn: 1},{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: false,\n ns: '__local__',\n n: 'ext-buybox',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/ext-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-cart-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration');\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-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-selected-variant';\n let dataAction = require('partner/actions/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|ext-buybox|ext-buybox'] = {\n c: () => require('partner/modules/ext-buybox/ext-buybox.view.tsx'),\n cn: '__local__-__local__-ext-buybox'\n };\nviewDictionary['__local__|__local__|themes|only|views|ext-buybox'] = {\n c: () => require('partner/themes/only/views/ext-buybox.view.tsx'),\n cn: '__local__-__local__-ext-buybox'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n AddToCartBehavior,\r\n IAddToCartFailureResult,\r\n IAddToCartResources,\r\n ItemSuccessfullyAddedToCartNotification,\r\n PriceComponent\r\n} from '@msdyn365-commerce/components';\r\nimport { getUrlSync, ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport { DeliveryOption, FeatureState, OrgUnitLocation, ProductAvailableQuantity, ProductDimension } from '@msdyn365-commerce/retail-proxy';\r\nimport { NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport {\r\n ArrayExtensions,\r\n DeliveryMode,\r\n IProductInventoryInformation,\r\n isAggregatedInventory\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getTelemetryObject, Heading, INodeProps, IPopupProps, Popup } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { BuyboxErrorBlock } from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxCallbacks, IBuyboxState } from '@msdyn365-commerce-modules/buybox';\r\nimport { getConfigureErrors, getGenericError } from '@msdyn365-commerce-modules/buybox';\r\nimport { IExtBuyboxData } from '../ext-buybox.data';\r\nimport { IExtBuyboxProps, IExtBuyboxResources } from '../ext-buybox.props.autogenerated';\r\n\r\nconst modalCloseButtonReference: React.RefObject = React.createRef();\r\n\r\n/**\r\n * FindinStore failure Interface.\r\n */\r\nexport interface IFindInStoreFailureResult {\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\n/**\r\n * BuyBoxFindinStore View Props Interface.\r\n */\r\nexport interface IBuyboxFindInStoreViewProps {\r\n storeSelector?: React.ReactNode;\r\n heading?: React.ReactNode;\r\n description?: React.ReactNode;\r\n errors?: React.ReactNode;\r\n button?: React.ReactNode;\r\n productPickupOptionList?: React.ReactNode;\r\n\r\n modal?: React.ReactNode;\r\n\r\n ContainerProps: INodeProps;\r\n\r\n openFindInStoreDialog(): Promise;\r\n}\r\n\r\n/**\r\n * On click find store handler.\r\n * @param props -Buybox data.\r\n * @param state -Buybox state.\r\n * @param callbacks -Buybox callbacks.\r\n * @returns Find in store.\r\n */\r\nconst onClickFindInStoreHandler = (\r\n props: IExtBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n) => async () => {\r\n await findInStoreOnClick(props, state, callbacks);\r\n};\r\n\r\n/**\r\n * Inventory settings based on the inventory policy for aggregated availability.\r\n */\r\ninterface IInventorySettingsProps {\r\n isSectionDisabled: boolean;\r\n description: string;\r\n buttonText: string;\r\n}\r\n\r\n/**\r\n * The function defines the settings values for a given inventory configuration.\r\n * @param context - The context.\r\n * @param isStockCheck - Flag to enable inventory validation.\r\n * @param productAvailability - The product inventory information.\r\n * @param buyboxResources - The buybox string resources.\r\n * @param isLoading - Is loading.\r\n * @returns Boolean.\r\n */\r\nfunction getFindInStoreInventorySettings(\r\n context: ICoreContext,\r\n isStockCheck: boolean,\r\n productAvailability: IProductInventoryInformation[] | undefined,\r\n buyboxResources: IExtBuyboxResources,\r\n isLoading?: boolean\r\n): IInventorySettingsProps {\r\n // If shouldValidateAggregation is true then is required to check for the product inventory, based on this the messaging will change\r\n // and the find in store button will be ensbled or disabled\r\n\r\n let isSectionDisabled: boolean;\r\n let buttonText;\r\n let description: string;\r\n\r\n let pickupInventory: IProductInventoryInformation | undefined;\r\n\r\n if (!isStockCheck || isLoading) {\r\n return {\r\n isSectionDisabled: false,\r\n buttonText: buyboxResources.findInStoreLinkText,\r\n description: buyboxResources.findInStoreDescriptionText\r\n };\r\n }\r\n\r\n if (productAvailability) {\r\n pickupInventory = productAvailability.find(pickup => pickup.deliveryType === DeliveryMode.pickup);\r\n }\r\n\r\n // If aggregated is enabled, then we need to validate the inventor check for find in store.\r\n // If an individual is selected, then we will always show a find in store button.\r\n if (isAggregatedInventory(context.actionContext)) {\r\n if (productAvailability && pickupInventory?.IsProductAvailable) {\r\n isSectionDisabled = false;\r\n buttonText = buyboxResources.findInStoreLinkText;\r\n description = buyboxResources.findInStoreDescriptionText;\r\n } else {\r\n isSectionDisabled = true;\r\n buttonText = buyboxResources.findInStoreNotAvailableTextButton;\r\n description = buyboxResources.findInStoreNotAvailableDescription;\r\n }\r\n } else {\r\n isSectionDisabled = false;\r\n buttonText = buyboxResources.findInStoreLinkText;\r\n description = buyboxResources.findInStoreDescriptionText;\r\n }\r\n\r\n return {\r\n isSectionDisabled,\r\n description,\r\n buttonText\r\n };\r\n}\r\n\r\n/**\r\n * Method to check if we have atleast one common delivery code between product and channel.\r\n * @param productdeliveryOptions - Product DeliveryOption List.\r\n * @param storePickUpOptionList - Channel DeliveryOption List.\r\n * @returns Boolean flag.\r\n */\r\nconst matchDeliveryOptions = (\r\n productdeliveryOptions: DeliveryOption[] | undefined,\r\n storePickUpOptionList: string[] | undefined\r\n): boolean => {\r\n const deliveryOption: string[] = [];\r\n productdeliveryOptions?.map(delivery => {\r\n const pickup = storePickUpOptionList?.find(deliveryCode => deliveryCode === delivery.Code);\r\n if (pickup) {\r\n deliveryOption.push(pickup);\r\n }\r\n return deliveryOption;\r\n });\r\n\r\n return ArrayExtensions.hasElements(deliveryOption);\r\n};\r\n\r\nexport function getBuyboxFindInStore(\r\n props: IExtBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): IBuyboxFindInStoreViewProps | undefined {\r\n const {\r\n data,\r\n slots: { storeSelector },\r\n resources: {\r\n priceFree,\r\n originalPriceText,\r\n currentPriceText,\r\n findInStoreHeaderText,\r\n buyBoxGoToCartText,\r\n buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n buyBoxSingleItemText,\r\n buyBoxMultiLineItemFormatText,\r\n buyBoxHeaderMessageText,\r\n descriptionTextToShowAllPickupOptions\r\n },\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n }\r\n } = props;\r\n\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const product = data?.product?.result;\r\n const price = data?.productPrice?.result;\r\n const cart = data?.cart?.result;\r\n const deliveryOptions = data?.deliveryOptions?.result;\r\n const productAvailability = data.productAvailableQuantity?.result;\r\n const retailMulitplePickupMFeatureState = data?.featureState?.result?.find(\r\n (featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n const channelDeliveryOptionConfig = data?.channelDeliveryOptionConfig?.result;\r\n\r\n const missingDimensions = product?.Dimensions?.filter(dimension => !dimension.DimensionValue?.Value);\r\n\r\n const {\r\n errorState: { configureErrors, quantityError, otherError, errorHost },\r\n modalOpen,\r\n quantity\r\n } = state;\r\n\r\n const { isSectionDisabled, buttonText, description } = getFindInStoreInventorySettings(\r\n props.context,\r\n props.context.app.config.enableStockCheck,\r\n productAvailability,\r\n props.resources,\r\n props.data.productAvailableQuantity.status === 'LOADING' || ArrayExtensions.hasElements(missingDimensions)\r\n );\r\n\r\n if (!product || !ArrayExtensions.hasElements(storeSelector)) {\r\n return undefined;\r\n }\r\n\r\n if (!deliveryOptions || !deliveryOptions.DeliveryOptions) {\r\n return undefined;\r\n }\r\n\r\n // If no delivery options present on the product, or none of the delivery options\r\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\r\n if (retailMulitplePickupMFeatureState && channelDeliveryOptionConfig) {\r\n if (!matchDeliveryOptions(deliveryOptions.DeliveryOptions, channelDeliveryOptionConfig?.PickupDeliveryModeCodes)) {\r\n return undefined;\r\n }\r\n } else if (\r\n !PickupDeliveryModeCode ||\r\n !deliveryOptions.DeliveryOptions.find((option: DeliveryOption) => option.Code === PickupDeliveryModeCode)\r\n ) {\r\n return undefined;\r\n }\r\n\r\n const dialogStrings = {\r\n goToCartText: buyBoxGoToCartText,\r\n continueShoppingText: buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n headerItemOneText: buyBoxSingleItemText,\r\n headerItemFormatText: buyBoxMultiLineItemFormatText,\r\n headerMessageText: buyBoxHeaderMessageText,\r\n freePriceText: priceFree,\r\n originalPriceText,\r\n currentPriceText\r\n };\r\n\r\n const priceComponent = price ? (\r\n \r\n ) : (\r\n ''\r\n );\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'ms-buybox',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data.product?.result, price: props.data.productPrice?.result },\r\n dialogStrings,\r\n imageSettings: defaultImageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: quantity,\r\n priceComponent,\r\n navigationUrl: getUrlSync('cart', props.context.actionContext),\r\n modalOpen,\r\n setModalOpen: callbacks.changeModalOpen\r\n };\r\n const renderModalPopup = ;\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__find-in-store'\r\n },\r\n\r\n storeSelector: storeSelector[0],\r\n\r\n openFindInStoreDialog: onClickFindInStoreHandler(props, state, callbacks),\r\n\r\n heading: ,\r\n\r\n description:

{description}

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

{descriptionTextToShowAllPickupOptions}

\r\n
    \r\n {deliveryOptions.DeliveryOptions.map((item: DeliveryOption) => {\r\n return (\r\n
  • \r\n {item.Description}\r\n
  • \r\n );\r\n })}\r\n
\r\n \r\n ) : null,\r\n errors: (\r\n \r\n ),\r\n\r\n button: (\r\n \r\n {buttonText}\r\n \r\n ),\r\n\r\n modal: renderModalPopup\r\n };\r\n}\r\n\r\n/**\r\n * Handler for find in store button.\r\n * @param props - BuyBox data.\r\n * @param state - BuyBox state.\r\n * @param callbacks - BuyBox callbacks.\r\n * @returns - Promise.\r\n */\r\nasync function findInStoreOnClick(props: IExtBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks): Promise {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager },\r\n cart: { result: cart },\r\n productAvailableQuantity: { result: productAvailableQuantity }\r\n },\r\n resources,\r\n context,\r\n modules\r\n } = props;\r\n\r\n const { selectedProduct, quantity } = state;\r\n\r\n let dataProduct = props.data.product.result;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const retailMulitplePickupMFeatureState = props.data?.featureState?.result?.find(\r\n (featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n\r\n if (selectedProduct) {\r\n dataProduct = (await selectedProduct) || dataProduct;\r\n }\r\n\r\n if (!dataProduct || !storeSelectorStateManager) {\r\n return;\r\n }\r\n\r\n const product = dataProduct;\r\n\r\n const missingDimensions =\r\n product.Dimensions &&\r\n product.Dimensions.filter((dimension: ProductDimension) => !(dimension.DimensionValue && dimension.DimensionValue.Value));\r\n\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n\r\n if (missingDimensions && missingDimensions.length > 0) {\r\n if (callbacks.updateErrorState) {\r\n callbacks.updateErrorState({\r\n errorHost: 'FINDINSTORE',\r\n configureErrors: getConfigureErrors(missingDimensions, resources)\r\n });\r\n }\r\n } else {\r\n storeSelectorStateManager\r\n .openDialog({\r\n product,\r\n id: storeSelectorId,\r\n parentElementRef: modalCloseButtonReference,\r\n deliveryOptions: retailMulitplePickupMFeatureState ? props.data.deliveryOptions.result : undefined,\r\n onLocationSelected: async (orgUnitLocation: OrgUnitLocation, deliveryMode: string) => {\r\n if (!cart) {\r\n return Promise.resolve();\r\n }\r\n\r\n const behavior = props.context?.app?.config?.addToCartBehavior;\r\n\r\n return cart\r\n .addProductToCart({ product, count: quantity, location: orgUnitLocation, deliveryMode })\r\n .then((result: ICartActionResult) => {\r\n if (result.status === 'FAILED' && result.substatus === 'MAXQUANTITY') {\r\n callbacks.changeModalOpen(false);\r\n let productAvailability: ProductAvailableQuantity | undefined;\r\n if (state.productAvailableQuantity) {\r\n productAvailability = state.productAvailableQuantity.ProductAvailableQuantity;\r\n } else if (productAvailableQuantity && ArrayExtensions.hasElements(productAvailableQuantity)) {\r\n const shippingInventory = productAvailableQuantity.find(\r\n shipping => shipping.deliveryType === DeliveryMode.pickup\r\n );\r\n productAvailability = shippingInventory?.ProductAvailableQuantity;\r\n } else {\r\n productAvailability = undefined;\r\n }\r\n const failureResult: IAddToCartFailureResult = {\r\n failureReason: 'CARTACTIONFAILED',\r\n cartActionResult: { status: result.status, substatus: result.substatus }\r\n };\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n configureErrors: {},\r\n otherError: getGenericError(\r\n failureResult,\r\n cart,\r\n resources,\r\n context,\r\n product,\r\n productAvailability,\r\n orgUnitLocation\r\n )\r\n });\r\n } else {\r\n callbacks.updateErrorState({\r\n configureErrors: {}\r\n });\r\n const navigationUrl = getUrlSync('cart', context.actionContext);\r\n if (behavior === undefined || behavior === AddToCartBehavior.goToCart) {\r\n if (result.status === 'SUCCESS' && navigationUrl) {\r\n window.location.assign(navigationUrl);\r\n }\r\n } else if (behavior === AddToCartBehavior.showModal) {\r\n callbacks.changeModalOpen(true);\r\n } else if (behavior === AddToCartBehavior.showNotification) {\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n const telemetryContent = getTelemetryObject(\r\n props.context.request.telemetryPageName!,\r\n props.friendlyName,\r\n props.telemetry\r\n );\r\n const dialogStrings: IAddToCartResources = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n closeNotificationLabel: resources.closeNotificationLabel,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n addedQuantityText: resources.addedQuantityText\r\n };\r\n const notification = new ItemSuccessfullyAddedToCartNotification(\r\n props.context,\r\n dialogStrings,\r\n defaultImageSettings,\r\n props.context.request.gridSettings,\r\n product,\r\n props.data.productPrice?.result,\r\n quantity,\r\n navigationUrl,\r\n telemetryContent,\r\n props.id,\r\n props.typeName\r\n );\r\n NotificationsManager.instance().addNotification(notification);\r\n }\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.exception(error);\r\n props.telemetry.debug('Unable to add product to cart');\r\n }\r\n });\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to find in store');\r\n }\r\n });\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\n/* eslint-disable security/detect-object-injection */\r\nimport { getCatalogId, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\r\nimport {\r\n CommerceProperty,\r\n ProductCatalog,\r\n ProductDeliveryOptions,\r\n ProductDimensionValue,\r\n ProductDimensionValueInventoryAvailability,\r\n ProductPrice,\r\n ReleasedProductType,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { BulkPurchase } from '@msdyn365-commerce-modules/bulk-purchase';\r\nimport {\r\n ArrayExtensions,\r\n DeliveryMode,\r\n FinitePromiseQueue,\r\n FinitePromiseQueueError,\r\n getDeliveryOptionsForSelectedVariant,\r\n GetDeliveryOptionsForSelectedVariantInput,\r\n getDimensionsForSelectedVariant,\r\n GetDimensionsForSelectedVariantInput,\r\n getInventoryLevelCodeFromDimensionValue,\r\n getPriceForSelectedVariant,\r\n getProductAvailabilitiesForSelectedVariant,\r\n IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n IProductInventoryInformation,\r\n IPromiseQueue,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput,\r\n SelectedVariantInput,\r\n setDimensionValuesToQuery,\r\n validateCatalogId\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getTelemetryObject,\r\n IModuleProps,\r\n INodeProps,\r\n ITelemetryContent,\r\n Node,\r\n updateMaxQuantityForCartLineItem,\r\n isMobile,\r\n VariantType\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { getSelectedVariantActionDataAction } from '../../actions/get-selected-variant';\r\n\r\nimport {\r\n getBuyboxAddToCart,\r\n getBuyBoxInventoryLabel,\r\n getBuyboxKeyInPrice,\r\n getBuyboxProductAddToOrderTemplate,\r\n getBuyboxProductAddToWishlist,\r\n getBuyboxProductComparisonButton,\r\n getBuyboxProductDescription,\r\n getBuyboxProductQuantity,\r\n getBuyboxProductRating,\r\n getBuyboxProductTitle,\r\n getBuyboxProductUnitOfMeasure,\r\n getBuyboxShopSimilarButton,\r\n getQuantityLimitsMessages,\r\n RetailDefaultOrderQuantityLimitsFeatureName,\r\n EcommerceQuantityLimitConfigurationsFeatureName,\r\n RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName,\r\n IBuyboxProductConfigureDropdownViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { getBuyboxProductConfigure } from '@msdyn365-commerce-modules/buybox';\r\nimport {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxExtentedProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IErrorState,\r\n ShopSimiliarButtonType\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { IExtBuyboxData } from './ext-buybox.data';\r\nimport { IExtBuyboxProps, IExtBuyboxResources } from './ext-buybox.props.autogenerated';\r\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/ext-buybox-find-in-store';\r\nimport { RecentlyViewedState } from '@msdyn365-commerce-modules/buybox';\r\nimport PriceComponent from '../../shared/components/price.component';\r\nimport ModalPanel, { Position } from '../../shared/components/modal-panel.component';\r\n\r\nexport interface IBuyboxViewProps extends IExtBuyboxProps {\r\n state: IBuyboxState;\r\n ModuleProps: IModuleProps;\r\n ProductInfoContainerProps: INodeProps;\r\n MediaGalleryContainerProps: INodeProps;\r\n callbacks: IBuyboxCallbacks;\r\n mediaGallery?: React.ReactNode;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n rating?: React.ReactNode;\r\n price?: React.ReactNode;\r\n productComparisonButton?: React.ReactNode;\r\n bulkPurchaseLink?: React.ReactNode;\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\r\n addToWishlist?: IBuyboxAddToWishlistViewProps;\r\n min?: number | undefined;\r\n max: number | undefined;\r\n addToCart: IBuyboxAddToCartViewProps;\r\n findInStore?: IBuyboxFindInStoreViewProps;\r\n quantity?: IBuyboxProductQuantityViewProps;\r\n configure?: IBuyboxProductConfigureViewProps;\r\n inventoryLabel?: React.ReactNode;\r\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\r\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\r\n quantityLimitsMessages: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n keyInPrice?: IBuyboxKeyInPriceViewProps;\r\n unitOfMeasure?: React.ReactNode;\r\n catalogs?: ProductCatalog[] | undefined;\r\n isChannelMultipleCatalogsFeatureEnabled?: boolean;\r\n currentCatalogId?: number;\r\n applyDefaultOrderSettings?: boolean;\r\n variantColorName?: string;\r\n sizeModal?: React.ReactNode;\r\n newConfigure?: React.ReactNode;\r\n}\r\n\r\nexport interface IExtBuyboxState extends IBuyboxState {\r\n sizeModalOpen?: boolean;\r\n}\r\n\r\n/**\r\n * Buybox Module.\r\n */\r\nclass Buybox extends React.PureComponent, IExtBuyboxState> {\r\n /**\r\n * A queue of tasks of processing the changes in the dimensions.\r\n * Limit to two processes:\r\n * 1 - for the current process, which is under execution at the moment.\r\n * 2 - next process, which will process the latest version of data.\r\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\r\n */\r\n private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\r\n\r\n private dimensions: { [id: number]: string } = {};\r\n private initializedDimensions: Set = new Set();\r\n\r\n private readonly buyboxCallbacks: IBuyboxCallbacks = {\r\n updateQuantity: (newQuantity: number): boolean => {\r\n const errorState = { ...this.state.errorState };\r\n errorState.quantityError = undefined;\r\n errorState.otherError = undefined;\r\n\r\n this.setState({ quantity: newQuantity, errorState });\r\n return true;\r\n },\r\n updateErrorState: (newErrorState: IErrorState): void => {\r\n //BS CUSTOM - open the size modal if the size is not selected (this triggers on all size related errors)\r\n if (newErrorState.configureErrors && newErrorState.configureErrors[3]) {\r\n this.setState({ sizeModalOpen: true });\r\n }\r\n this.setState({ errorState: newErrorState });\r\n },\r\n updateSelectedProduct: (\r\n newSelectedProduct: Promise,\r\n newInventory: IProductInventoryInformation | undefined,\r\n newPrice: ProductPrice | undefined,\r\n newDeliveryOptions: ProductDeliveryOptions | undefined\r\n ): void => {\r\n this.setState({\r\n selectedProduct: newSelectedProduct,\r\n productAvailableQuantity: newInventory,\r\n productDeliveryOptions: newDeliveryOptions\r\n });\r\n this._updatePrice(newPrice);\r\n },\r\n initializeDimension: (initializedDimension: string): void => {\r\n if (initializedDimension) {\r\n this.initializedDimensions.add(initializedDimension);\r\n }\r\n },\r\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\r\n //BS CUSTOM - close the size modal\r\n this.setState({ sizeModalOpen: false });\r\n\r\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\r\n // Only trigger _updateDimensions when all dimensions are initialized\r\n if (this.initializedDimensions.size === (this.props.data.product.result?.Dimensions?.length || 0)) {\r\n return this.dimensionUpdateQueue\r\n .enqueue(async () => {\r\n return this._updateDimensions();\r\n })\r\n .catch((error: unknown) => {\r\n // Ignore discarded processes.\r\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\r\n throw error;\r\n }\r\n });\r\n }\r\n },\r\n getDropdownName: (dimensionType: number, resources: IExtBuyboxResources): string => {\r\n return this._getDropdownName(dimensionType, resources);\r\n },\r\n changeModalOpen: (isModalOpen: boolean): void => {\r\n this.setState({ modalOpen: isModalOpen });\r\n },\r\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\r\n this.setState({ isUpdatingDimension });\r\n },\r\n\r\n /**\r\n * Update isUpdatingDeliveryOptions state.\r\n *\r\n * @param isUpdatingDeliveryOptions - The status of updating delivery options.\r\n */\r\n changeUpdatingDeliveryOptions: (isUpdatingDeliveryOptions: boolean): void => {\r\n this.setState({ isUpdatingDeliveryOptions });\r\n },\r\n\r\n updateKeyInPrice: (customPrice: number): void => {\r\n // Remove custom amount error when updating the custom price\r\n const errorState = { ...this.state.errorState };\r\n errorState.customAmountError = undefined;\r\n\r\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState });\r\n this._updatePrice(this.state.productPrice, customPrice);\r\n }\r\n };\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n public constructor(props: IExtBuyboxProps, state: IExtBuyboxState) {\r\n super(props);\r\n this.state = {\r\n errorState: {\r\n configureErrors: {}\r\n },\r\n quantity: 1,\r\n min: undefined,\r\n max: undefined,\r\n selectedProduct: undefined,\r\n productPrice: undefined,\r\n productDeliveryOptions: undefined,\r\n\r\n modalOpen: false,\r\n isUpdatingDimension: false,\r\n isUpdatingDeliveryOptions: false,\r\n isPriceApiCalled: false,\r\n sizeModalOpen: false\r\n };\r\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n productPrice\r\n },\r\n context\r\n } = this.props;\r\n\r\n // Sets the gender to be male if the product is from SONS - so we can target the correct audience\r\n if (this.props.config.targetGender && product && product.ItemId?.startsWith('22')) {\r\n const url = new URL(location.href);\r\n if (url.searchParams.get('gender') !== 'm') {\r\n url.searchParams.set('gender', 'm');\r\n //This refreshes the page so that the target can apply\r\n window.location.search = url.searchParams.toString();\r\n }\r\n }\r\n\r\n // There are multiple sources triggering the callback function dimensionSelectedAsync calling the GetActivePrice api before componentDidMount and after componentDidMount.\r\n // Set isPriceApiCalled to false here to prevent redundant API call after componentDidMount:\r\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\r\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.\r\n this.setState({ isPriceApiCalled: false });\r\n // eslint-disable-next-line\r\n productPrice.then(async result => {\r\n this._updatePrice(result);\r\n });\r\n\r\n if (product) {\r\n // Check if the product is service or not by product type\r\n if (product.ItemTypeValue === ReleasedProductType.Service) {\r\n this.setState({ isServiceItem: true });\r\n }\r\n await this._updateQuantitiesInState(product);\r\n }\r\n\r\n //Customization that defaults to the first available color if no color is selected (DimensionValue 1 is Color dimension) - or the first color if no colors are available\r\n if (!this.dimensions[1]) {\r\n //TOOD: should be information telemetry\r\n this.props.telemetry.warning('No color dimension, finding default color');\r\n if (this.props.data.productDimensions.status === 'SUCCESS') {\r\n var colorDimension = this.props.data.productDimensions.result?.find(x => x.DimensionTypeValue === 1);\r\n if (colorDimension && colorDimension.dimensionValuesWithInventory) {\r\n for (const element of colorDimension.dimensionValuesWithInventory) {\r\n if (element.TotalAvailableInventoryLevelCode === 'AVAIL' && element?.DimensionValue) {\r\n this.dimensions[1] = element?.DimensionValue?.RecordId.toString();\r\n this._updateDimensions();\r\n break;\r\n }\r\n }\r\n //If no colors are in stock - default to first color\r\n //TOOD: should be information telemetry\r\n this.props.telemetry.warning('No color dimension, no colors available');\r\n this.dimensions[1] = colorDimension?.dimensionValuesWithInventory[0]?.DimensionValue?.RecordId.toString() ?? '';\r\n this._updateDimensions();\r\n }\r\n }\r\n }\r\n\r\n if (product && context.app.config.maxRecentlyViewedItemsCount > 0) {\r\n RecentlyViewedState.instance(this.props.context, context.app.config.maxRecentlyViewedItemsCount, product.RecordId);\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n slots: { mediaGallery, productComparisonButton },\r\n data: {\r\n product: { result: product }\r\n },\r\n config: { className = '' }\r\n } = this.props;\r\n\r\n const { min, max } = this.state;\r\n\r\n if (!product) {\r\n this.props.context.telemetry.error('Product content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const props = this.props as IBuyboxExtentedProps;\r\n const defaultMinimumKeyInPrice = 10;\r\n const defaultMaximumKeyInPrice = 100;\r\n\r\n const context = this.props.context as ICoreContext;\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n const dimensionValuesWithInventory = ArrayExtensions.flatten(\r\n ArrayExtensions.validValues(this.props.data.productDimensions.result?.map(value => value.dimensionValuesWithInventory))\r\n );\r\n const applyDefaultOrderSettings =\r\n (this.props.data.featureState?.result?.find(featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName)\r\n ?.IsEnabled ??\r\n false) &&\r\n (this.props.data.cartConfiguration?.result?.ValidateDefaultOrderSettingsPerLine ?? false);\r\n const hasAvailableProducts =\r\n !ArrayExtensions.hasElements(dimensionValuesWithInventory) ||\r\n dimensionValuesWithInventory.some((value: unknown) => {\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(\r\n value as ProductDimensionValueInventoryAvailability,\r\n inventoryLevel\r\n );\r\n return inventoryLevelCode !== InventoryLevelValues.outOfStock;\r\n });\r\n const catalogId = getCatalogId(this.props.context.request);\r\n validateCatalogId(catalogId);\r\n\r\n //Get variant color name\r\n var variantColorName;\r\n if (\r\n this.props.config.showColorName &&\r\n this.props.data.productDimensions.status === 'SUCCESS' &&\r\n this.props.data.productDimensions.result\r\n ) {\r\n const productColor = product?.Dimensions?.find(item => {\r\n return item.DimensionTypeValue === 1;\r\n });\r\n const dimension = this.props.data.productDimensions.result.find(item => {\r\n return item.DimensionTypeValue === 1;\r\n });\r\n const color = dimension?.DimensionValues?.find(item => {\r\n return item.Value === productColor?.DimensionValue?.Value;\r\n });\r\n if (color?.RefinerGroup && productColor?.DimensionValue?.Value) {\r\n variantColorName = `${color?.RefinerGroup} / ${productColor?.DimensionValue?.Value}`;\r\n }\r\n }\r\n //BS CUSTOM - get size dropdown\r\n const isMobileCheck = isMobile({ variant: VariantType.Browser, context: context.actionContext.requestContext });\r\n const isMobileView = isMobileCheck === 'xs' || isMobileCheck === 'sm';\r\n var configure = getBuyboxProductConfigure(props, this.state, this.buyboxCallbacks);\r\n var newConfigure;\r\n if (this.props.config.expandedSizeSelector && configure) {\r\n var sizeSelector;\r\n if (configure?.dropdowns && configure.dropdowns[0]) {\r\n sizeSelector = { ...configure };\r\n sizeSelector.dropdowns = [configure.dropdowns[0]]; //Only show the first dropdown\r\n sizeSelector = this.renderConfigure(sizeSelector);\r\n newConfigure = this.renderConfigure(configure, true);\r\n }\r\n }\r\n\r\n const viewProps: IBuyboxViewProps = {\r\n ...(this.props as IExtBuyboxProps),\r\n state: this.state,\r\n mediaGallery: mediaGallery && mediaGallery.length > 0 ? mediaGallery[0] : undefined,\r\n ModuleProps: {\r\n moduleProps: this.props,\r\n className: classnames('ms-buybox', className)\r\n },\r\n ProductInfoContainerProps: {\r\n className: 'ms-buybox__content'\r\n },\r\n MediaGalleryContainerProps: {\r\n className: 'ms-buybox__media-gallery'\r\n },\r\n telemetryContent: this.telemetryContent,\r\n callbacks: this.buyboxCallbacks,\r\n title: getBuyboxProductTitle(props),\r\n description: !this.props.config.hideDescription ? undefined : getBuyboxProductDescription(props),\r\n bulkPurchaseLink: this._renderBuyboxBulkPurchaseLink(),\r\n unitOfMeasure: getBuyboxProductUnitOfMeasure(props),\r\n configure,\r\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\r\n price: this._getBuyboxProductPrice(this.props, this.state),\r\n addToCart: getBuyboxAddToCart(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n defaultMinimumKeyInPrice,\r\n defaultMaximumKeyInPrice,\r\n undefined,\r\n hasAvailableProducts\r\n ),\r\n productComparisonButton: ArrayExtensions.hasElements(productComparisonButton)\r\n ? getBuyboxProductComparisonButton(\r\n productComparisonButton[0],\r\n product,\r\n getCatalogId(this.props.context.request),\r\n this.state\r\n )\r\n : undefined,\r\n addToOrderTemplate: getBuyboxProductAddToOrderTemplate(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n this._isChannelMultipleCatalogsFeatureEnabled(),\r\n catalogId\r\n ),\r\n addToWishlist: getBuyboxProductAddToWishlist(props, this.state, this.buyboxCallbacks),\r\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\r\n quantity: product.IsGiftCard ? undefined : getBuyboxProductQuantity(props, this.state, this.buyboxCallbacks),\r\n inventoryLabel: getBuyBoxInventoryLabel(props),\r\n shopSimilarLook:\r\n this.props.config.enableShopSimilarLooks && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Looks)\r\n : undefined,\r\n shopSimilarDescription:\r\n this.props.config.enableShopSimilarDescription && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description)\r\n : undefined,\r\n keyInPrice:\r\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\r\n ? getBuyboxKeyInPrice(props, this.state, this.buyboxCallbacks)\r\n : undefined,\r\n quantityLimitsMessages: getQuantityLimitsMessages(props, this.state),\r\n min: applyDefaultOrderSettings ? min : 1,\r\n max,\r\n applyDefaultOrderSettings: applyDefaultOrderSettings,\r\n isChannelMultipleCatalogsFeatureEnabled: this._isChannelMultipleCatalogsFeatureEnabled(),\r\n currentCatalogId: catalogId,\r\n catalogs: this._validateCatalogDetails(catalogId),\r\n variantColorName: variantColorName,\r\n sizeModal: (\r\n \r\n {sizeSelector}\r\n \r\n ),\r\n newConfigure\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n //BS CUSTOM\r\n private toggleModal = () => {\r\n this.setState({ sizeModalOpen: !this.state.sizeModalOpen });\r\n };\r\n\r\n //Imported from the buybox components in order to use shared price component - note that it uses the extended props unlike all the others\r\n private _getBuyboxProductPrice(props: IExtBuyboxProps, state: IBuyboxState): React.ReactElement | undefined {\r\n const { id, typeName, context, resources } = props;\r\n\r\n // bs extension - use price from the module data action if state is not initialized to remove layout shift\r\n const productPrice = state.productPrice ?? props.data.productPrice.result;\r\n\r\n return (\r\n productPrice && (\r\n featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n )?.IsEnabled\r\n }\r\n isSalesAgreementPriceFeatureEnabled={\r\n props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSalesAgreementPriceSupportFeature'\r\n )?.IsEnabled\r\n }\r\n priceResources={{\r\n priceRangeSeparator: resources.priceRangeSeparator,\r\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\r\n salesAgreementExpirationDatePrompt: resources.salesAgreementExpirationDatePrompt,\r\n salesAgreementCommittedQuantityPrompt: resources.salesAgreementCommittedQuantityPrompt,\r\n salesAgreementRemainingQuantityPrompt: resources.salesAgreementRemainingQuantityPrompt,\r\n memberPriceMessage: resources.memberPriceMessage,\r\n saleMessage: resources.saleMessage\r\n }}\r\n freePriceText={resources.priceFree}\r\n originalPriceText={resources.originalPriceText}\r\n currentPriceText={resources.currentPriceText}\r\n showDiscountBox={false}\r\n />\r\n )\r\n );\r\n }\r\n //BS CUSTOM - imported from view - renders the standard dropdowns\r\n private renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n return (\r\n \r\n {heading}\r\n {select}\r\n {errors}\r\n \r\n );\r\n };\r\n //BS CUSTOM - renders the size dropdown that goes on the page with expanded size selector\r\n private renderSizeDropdown = (size: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors } = size;\r\n const dimension = this.props.data.product.result?.Dimensions?.find(item => {\r\n return item.DimensionTypeValue === 3;\r\n });\r\n\r\n return (\r\n \r\n {heading}\r\n {\r\n {\r\n e.preventDefault();\r\n this.toggleModal();\r\n }}\r\n className='bs-size-dropdown'\r\n >\r\n \r\n \r\n }\r\n {errors}\r\n \r\n );\r\n };\r\n\r\n //BS CUSTOM - imported from view - supports using both standard and custom size dropdown\r\n private renderConfigure = (configure: IBuyboxProductConfigureViewProps, customSize?: boolean): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n var index = 0;\r\n return (\r\n \r\n {dropdowns.map(item => {\r\n if (customSize) {\r\n const element = index === 0 ? this.renderSizeDropdown(item) : this.renderConfigureDropdown(item);\r\n index++;\r\n return element;\r\n } else {\r\n return this.renderConfigureDropdown(item);\r\n }\r\n })}\r\n \r\n );\r\n };\r\n\r\n /**\r\n * Handles anchor click event and scrolls to the given bulk purchase module.\r\n * @param bulkPurchaseModule - Bulk purchase module.\r\n * @returns Handler.\r\n */\r\n private readonly _onBulkPurchaseLinkClick = (bulkPurchaseModule: Element) => () => {\r\n const boundingRect = bulkPurchaseModule.getBoundingClientRect();\r\n const scrollX = boundingRect.left + window.pageXOffset;\r\n const scrollY = boundingRect.top + window.pageYOffset;\r\n\r\n window.scrollTo(scrollX, scrollY);\r\n };\r\n private readonly _isChannelMultipleCatalogsFeatureEnabled = (): boolean => {\r\n let isMultipleCatalogFeatureEnabledInHq = false;\r\n if (this.props.data.featureState) {\r\n isMultipleCatalogFeatureEnabledInHq =\r\n this.props.data.featureState.result?.find(\r\n feature => feature.Name === 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature'\r\n )?.IsEnabled || false;\r\n }\r\n return isMultipleCatalogFeatureEnabledInHq;\r\n };\r\n\r\n private _renderBuyboxBulkPurchaseLink(): React.ReactNode {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Temporary switch for the feature which is under development.\r\n if (!this.props.context.app.config.isBulkPurchaseEnabled) {\r\n return null;\r\n }\r\n\r\n if (!msdyn365Commerce.isBrowser) {\r\n return null;\r\n }\r\n\r\n const bulkPurchaseModules = Array.from(document.getElementsByClassName(BulkPurchase.className));\r\n\r\n if (!ArrayExtensions.hasElements(bulkPurchaseModules)) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {this.props.resources.bulkPurchaseLinkText}\r\n \r\n );\r\n }\r\n\r\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\r\n if (this.state.isCustomPriceSelected && newPrice) {\r\n newPrice.CustomerContextualPrice = customPrice;\r\n }\r\n this.setState({ productPrice: newPrice });\r\n }\r\n\r\n private _getProductVariant(dimensionsToUpdate: { [id: number]: string }) {\r\n const {\r\n data: {\r\n product: { result: product }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n } = this.props;\r\n\r\n const productDimensions = this.props.data.productDimensions.result!;\r\n\r\n //Always default the \"Style\" dimension (4) to None\r\n dimensionsToUpdate[4] = productDimensions\r\n .find(dimension => dimension.DimensionTypeValue === 4)\r\n ?.DimensionValues![0]?.RecordId.toString()!;\r\n\r\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\r\n // over the information in data\r\n const mappedDimensions = productDimensions\r\n .map(dimension => {\r\n const dimensions = (dimension.dimensionValuesWithInventory ??\r\n dimension.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n return {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue:\r\n dimensions.find(\r\n value => value.DimensionValue?.RecordId.toString() === dimensionsToUpdate[dimension.DimensionTypeValue]\r\n )?.DimensionValue ?? dimension.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n };\r\n })\r\n .filter(dimension => dimension.DimensionValue);\r\n setDimensionValuesToQuery(this.props.context.actionContext.requestContext.url.requestUrl, mappedDimensions);\r\n\r\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const selectedProductPromise = getSelectedVariantActionDataAction(\r\n new SelectedVariantInput(\r\n product!.MasterProductId ? product!.MasterProductId : product!.RecordId,\r\n channelId,\r\n undefined,\r\n undefined,\r\n this.props.context.request\r\n ),\r\n actionContext\r\n );\r\n this.setState({ selectedProduct: selectedProductPromise });\r\n\r\n return { productVariantPromise: selectedProductPromise, mappedDimensions };\r\n }\r\n\r\n private readonly _updateDimensions = async (): Promise => {\r\n const product = this.props.data.product.result;\r\n\r\n const productDimensions = this.props.data.productDimensions.result;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensions);\r\n\r\n if (!product || !hasProductDimensions) {\r\n return;\r\n }\r\n\r\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\r\n\r\n this.setState({ isUpdatingDimension: true, isUpdatingDeliveryOptions: true });\r\n\r\n // Step 1: Clear error state to display relevant errors\r\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\r\n const clearErrorState = { ...this.state.errorState };\r\n clearErrorState.otherError = undefined;\r\n if (this.state.errorState.errorHost === 'ADDTOCART') {\r\n clearErrorState.quantityError = undefined;\r\n clearErrorState.errorHost = undefined;\r\n }\r\n this.setState({ errorState: clearErrorState });\r\n }\r\n\r\n // Step 2: Clear any errors indicating the dimension wasn't selected\r\n for (const key of Object.keys(dimensionsToUpdate)) {\r\n if (this.state.errorState.configureErrors[key]) {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.configureErrors[key] = undefined;\r\n return { errorState };\r\n });\r\n }\r\n }\r\n\r\n const data = this._getProductVariant(dimensionsToUpdate);\r\n const productVariant: SimpleProduct | null = await data.productVariantPromise;\r\n\r\n if (!productVariant) {\r\n return;\r\n }\r\n\r\n const promises: Promise[] = [\r\n this._getDimensionsForSelectedVariant(productVariant, data.mappedDimensions),\r\n this._hydrateInventoryInfo(productVariant),\r\n this._hydratePrice(productVariant),\r\n this._hydrateDeliveryOptions(productVariant),\r\n this._updateQuantitiesInState(productVariant)\r\n ];\r\n\r\n await Promise.all(promises);\r\n };\r\n\r\n private async _getDimensionsForSelectedVariant(\r\n productVariant: SimpleProduct,\r\n mappedDimensions: {\r\n /* eslint-disable @typescript-eslint/naming-convention -- Retail proxy values */\r\n DimensionTypeValue: number;\r\n DimensionValue: ProductDimensionValue | undefined;\r\n ExtensionProperties: CommerceProperty[] | undefined;\r\n /* eslint-enable @typescript-eslint/naming-convention -- Retail proxy values */\r\n }[]\r\n ): Promise {\r\n await getDimensionsForSelectedVariant(\r\n new GetDimensionsForSelectedVariantInput(\r\n productVariant.MasterProductId ? productVariant.MasterProductId : productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n mappedDimensions,\r\n this.props.context.request\r\n ),\r\n this.props.context.actionContext\r\n );\r\n }\r\n\r\n private async _hydrateInventoryInfo(productVariant: SimpleProduct): Promise {\r\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\r\n new ProductAvailabilitiesForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n productVariant\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n const newShippingQuantity = newAvailableQuantity?.find(\r\n // @ts-expect-error\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (shipping: { deliveryType: any }) => shipping.deliveryType === DeliveryMode.shipping\r\n );\r\n const isCustomPriceSelected = productVariant.Dimensions?.find(\r\n dimension =>\r\n dimension.DimensionTypeValue === 4 && dimension.DimensionValue && dimension.DimensionValue.Value?.toLowerCase() === 'custom'\r\n );\r\n if (isCustomPriceSelected) {\r\n this.setState({ isCustomPriceSelected: true });\r\n } else {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.customAmountError = undefined;\r\n return { isCustomPriceSelected: false, isPriceKeyedIn: false, errorState };\r\n });\r\n }\r\n\r\n if (newShippingQuantity) {\r\n this.setState({ productAvailableQuantity: newShippingQuantity });\r\n } else {\r\n this.setState({ productAvailableQuantity: undefined });\r\n }\r\n }\r\n\r\n private async _hydratePrice(productVariant: SimpleProduct): Promise {\r\n // This function is invoked when dimensionSelectedAsync get called.\r\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\r\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.\r\n if (!this.state.isPriceApiCalled) {\r\n this.setState({ isPriceApiCalled: true });\r\n return;\r\n }\r\n\r\n // Step 6. Use these dimensions hydrate the product price.\r\n const newPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId, productVariant),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newPrice) {\r\n this._updatePrice(newPrice);\r\n }\r\n }\r\n\r\n private async _hydrateDeliveryOptions(productVariant: SimpleProduct): Promise {\r\n const retailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\r\n );\r\n\r\n // Step 7. Use these dimensions hydrate the product delivery options.\r\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\r\n new GetDeliveryOptionsForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n productVariant,\r\n undefined,\r\n retailMultiplePickupFeatureState?.IsEnabled\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newDeliveryOptions) {\r\n this.setState({ productDeliveryOptions: newDeliveryOptions });\r\n }\r\n }\r\n\r\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\r\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\r\n const isChannelLimitsFeatureEnabled = await this._isChannelLimitsFeatureEnabled();\r\n\r\n const min: number = this._getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled, product);\r\n const max: number = this._getMaxQuantityForCartLineItem(\r\n isChannelLimitsFeatureEnabled || isOrderQuantityLimitsFeatureEnabled,\r\n product\r\n );\r\n let quantity: number = this._getQuantity(product, isOrderQuantityLimitsFeatureEnabled);\r\n quantity = Math.max(quantity, min);\r\n\r\n this.setState({\r\n min,\r\n max,\r\n quantity\r\n });\r\n }\r\n\r\n private _getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\r\n if (isOrderQuantityLimitsFeatureEnabled && product?.Behavior?.MinimumQuantity && product.Behavior.MinimumQuantity > 0) {\r\n return product.Behavior.MinimumQuantity;\r\n }\r\n\r\n return 1;\r\n }\r\n\r\n private _getMaxQuantityForCartLineItem(isQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\r\n if (isQuantityLimitsFeatureEnabled && product?.Behavior?.MaximumQuantity && product.Behavior.MaximumQuantity > 0) {\r\n return product.Behavior.MaximumQuantity;\r\n }\r\n\r\n return updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem);\r\n }\r\n\r\n private _getQuantity(product: SimpleProduct, isOrderQuantityLimitsFeatureEnabled: boolean): number {\r\n const { quantity } = this.state;\r\n let defaultQuantity = 1;\r\n\r\n if (quantity !== defaultQuantity || !isOrderQuantityLimitsFeatureEnabled) {\r\n return quantity;\r\n }\r\n\r\n const cartConfiguration = this.props.data.cartConfiguration;\r\n const applyDefaultOrderSettingsForCartLine = cartConfiguration?.result?.ValidateDefaultOrderSettingsPerLine ?? false;\r\n if (!applyDefaultOrderSettingsForCartLine) {\r\n return quantity;\r\n }\r\n\r\n if (product?.Behavior?.DefaultQuantity && product.Behavior.DefaultQuantity > 0) {\r\n defaultQuantity = product.Behavior.DefaultQuantity;\r\n }\r\n\r\n return defaultQuantity;\r\n }\r\n\r\n private readonly _getDropdownName = (dimensionType: number, resources: IExtBuyboxResources): string => {\r\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\r\n\r\n switch (dimensionType) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColor;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfiguration;\r\n case 3: // ProductDimensionType.Size\r\n return resources.productDimensionTypeSize;\r\n case 4: // ProductDimensionType.Style\r\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isFeatureEnabledInHq = featureStatuses?.find(\r\n featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName\r\n )?.IsEnabled;\r\n if (!isFeatureEnabledInHq) {\r\n return false;\r\n }\r\n const useSiteBuilderSettings = featureStatuses?.find(\r\n featureState => featureState.Name === RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName\r\n )?.IsEnabled;\r\n\r\n if (useSiteBuilderSettings) {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n let customerInfo;\r\n try {\r\n customerInfo = await this.props.data.customerInformation;\r\n } catch (error) {\r\n this.props.telemetry.information(error);\r\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\r\n return false;\r\n }\r\n\r\n return (\r\n customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n } else {\r\n const cartConfiguration = await this.props.data.cartConfiguration;\r\n return !(cartConfiguration?.IgnoreOrderSettings ?? false);\r\n }\r\n }\r\n\r\n private _validateCatalogDetails(catalogId: number): ProductCatalog[] | undefined {\r\n const catalogs = this.props.data.catalogs?.result?.filter(item => item.RecordId === catalogId);\r\n if (ArrayExtensions.hasElements(catalogs) && catalogs[0].RecordId === 0) {\r\n return;\r\n }\r\n\r\n return catalogs;\r\n }\r\n\r\n private async _isChannelLimitsFeatureEnabled(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isChannelLimitsFeatureEnabledInHq = featureStatuses?.find(\r\n featureState => featureState.Name === EcommerceQuantityLimitConfigurationsFeatureName\r\n )?.IsEnabled;\r\n\r\n return isChannelLimitsFeatureEnabledInHq ?? false;\r\n }\r\n}\r\n\r\nexport default Buybox;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IProductDimensionsWithAvailabilitiesFull } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getCatalogId,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n BypassCache,\r\n ProductDimension,\r\n ProductDimensionAvailabilitySearchCriteria,\r\n ProductsDataActions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n QueryResultSettingsProxy,\r\n generateProductImageUrl,\r\n getDimensionValuesFromQuery,\r\n getSelectedProductIdFromActionInput,\r\n createInventoryAvailabilitySearchCriteria\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getCommercialName } from '../shared/functions/get-commercial-name';\r\n\r\n/**\r\n * Stores data about the selected product.\r\n */\r\nexport interface ISelectedProduct extends SimpleProduct {\r\n productVariant?: SimpleProduct;\r\n}\r\n\r\n/**\r\n * Get selected variant action input class.\r\n */\r\nexport class SelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public matchingDimensionValues?: ProductDimension[];\r\n\r\n public bypassCache?: BypassCache;\r\n\r\n public catalogId?: number;\r\n\r\n public constructor(\r\n productId: number,\r\n channelId: number,\r\n matchingDimensionValues?: ProductDimension[],\r\n bypassCache?: BypassCache,\r\n requestContext?: IRequestContext\r\n ) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.matchingDimensionValues = matchingDimensionValues;\r\n this.bypassCache = bypassCache;\r\n\r\n if (requestContext) {\r\n this.catalogId = getCatalogId(requestContext);\r\n }\r\n }\r\n\r\n /**\r\n * Cache key.\r\n * @returns String.\r\n */\r\n public getCacheKey: () => string = () => 'SelectedVariant';\r\n\r\n /**\r\n * Cache object type.\r\n * @returns String.\r\n */\r\n public getCacheObjectType: () => string = () => 'SimpleProduct';\r\n\r\n /**\r\n * Cache type.\r\n * @returns String.\r\n */\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the getSelectedVariant data action.\r\n * @param inputData - The input data passed to the createInput method.\r\n * @returns The input for the ata action getSelectedVariantNewAction.\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): SelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n\r\n if (productId) {\r\n return new SelectedVariantInput(\r\n +productId,\r\n +inputData.requestContext.apiSettings.channelId,\r\n undefined,\r\n undefined,\r\n inputData.requestContext\r\n );\r\n }\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Checks if given product has any unmatched dimensions.\r\n * Modifies product entity to use matched dimension values.\r\n * @param product - The product to analyze and modify.\r\n * @param matchingDimensionValues - Matched dimensions.\r\n * @returns True if has any unmatched dimension, false if all dimensions are specified.\r\n */\r\nconst checkIfHasUnmatchedDimensions = (product: SimpleProduct, matchingDimensionValues: ProductDimension[]): boolean => {\r\n let hasUnmatchedDimension: boolean = false;\r\n if (product.Dimensions) {\r\n product.Dimensions = product.Dimensions.map(dimension => {\r\n return { ...dimension };\r\n });\r\n for (const dimension of product.Dimensions) {\r\n const matchedTargetDimension = matchingDimensionValues.find(\r\n targetDimension => targetDimension.DimensionTypeValue === dimension.DimensionTypeValue\r\n );\r\n\r\n if (matchedTargetDimension) {\r\n dimension.DimensionValue = matchedTargetDimension.DimensionValue;\r\n } else {\r\n hasUnmatchedDimension = true;\r\n }\r\n }\r\n }\r\n return hasUnmatchedDimension;\r\n};\r\n\r\n/**\r\n * Retrieves product dimensions with availabilities.\r\n * @param product - Product for which the dimensions need to be retrieved.\r\n * @param matchingDimensionValues - Selected dimensions - filter criteria for the dimensions API.\r\n * @param context - Action context.\r\n * @param catalogId - Catalog id.\r\n * @returns Array of dimensions.\r\n */\r\nconst getFullDimensions = async (\r\n product: SimpleProduct,\r\n matchingDimensionValues: ProductDimension[],\r\n context: IActionContext,\r\n catalogId?: number\r\n) => {\r\n let fullDimensions: IProductDimensionsWithAvailabilitiesFull[] = [];\r\n const fullDimensionPromises = (product.Dimensions ?? []).map(dimension => {\r\n const shippingInventoryConfiguration = createInventoryAvailabilitySearchCriteria(context, [], true, undefined, undefined);\r\n const searchCriteria: ProductDimensionAvailabilitySearchCriteria = {\r\n RequestedDimensionTypeValue: dimension.DimensionTypeValue,\r\n MatchingDimensionValues: matchingDimensionValues,\r\n DefaultWarehouseOnly: shippingInventoryConfiguration.DefaultWarehouseOnly,\r\n FilterByChannelFulfillmentGroup: shippingInventoryConfiguration.FilterByChannelFulfillmentGroup,\r\n DeliveryModeTypeFilterValue: shippingInventoryConfiguration.DeliveryModeTypeFilterValue,\r\n CatalogId: catalogId\r\n };\r\n const dimensionValuesPromise = ProductsDataActions.getDimensionValuesWithEstimatedAvailabilitiesAsync(\r\n { callerContext: context, queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context) },\r\n product.MasterProductId ? product.MasterProductId : product.RecordId,\r\n searchCriteria\r\n );\r\n\r\n return dimensionValuesPromise.then(dimensionValues => {\r\n const fullDimension: IProductDimensionsWithAvailabilitiesFull = {\r\n ...dimension,\r\n dimensionValuesWithInventory: dimensionValues\r\n };\r\n return fullDimension;\r\n });\r\n });\r\n fullDimensions = await Promise.all(fullDimensionPromises);\r\n return fullDimensions;\r\n};\r\n\r\n/**\r\n * Retrieves product variant for the given input or undefined if not found.\r\n * @param input - Action input.\r\n * @param context - Action context.\r\n * @param fullDimensions - Product dimensions with availabilities.\r\n * @returns A product variant that is available or undefined.\r\n */\r\nconst getProductVariant = async (\r\n input: SelectedVariantInput,\r\n context: IActionContext,\r\n fullDimensions: IProductDimensionsWithAvailabilitiesFull[]\r\n) => {\r\n let productVariant: SimpleProduct | undefined;\r\n if (\r\n ArrayExtensions.hasElements(fullDimensions) &&\r\n ArrayExtensions.hasElements(fullDimensions[0].dimensionValuesWithInventory) &&\r\n ArrayExtensions.hasElements(fullDimensions[0].dimensionValuesWithInventory[0].ProductIds)\r\n ) {\r\n const variantProductId = fullDimensions[0].dimensionValuesWithInventory[0].ProductIds[0];\r\n const result = await ProductsDataActions.getByIdsAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context),\r\n bypassCache: input.bypassCache\r\n },\r\n input.channelId,\r\n [variantProductId],\r\n null,\r\n input.catalogId ?? 0\r\n );\r\n productVariant = result[0];\r\n productVariant = { ...productVariant };\r\n const variantImageUrl = generateProductImageUrl(productVariant, context.requestContext.apiSettings);\r\n\r\n if (variantImageUrl) {\r\n productVariant.PrimaryImageUrl = variantImageUrl;\r\n }\r\n\r\n if (productVariant && context.requestContext.app.config?.useCommercialStyleName) {\r\n var attributes = await ProductsDataActions.getAttributeValuesAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\r\n },\r\n productVariant.RecordId,\r\n input.channelId,\r\n input.catalogId ?? 0\r\n );\r\n productVariant.Name = getCommercialName(\r\n attributes,\r\n productVariant.Name,\r\n context.requestContext.app.config?.commercialStyleNameAttribute\r\n );\r\n }\r\n }\r\n\r\n return productVariant;\r\n};\r\n\r\n/**\r\n * Action method for the getSelectedVariant data action.\r\n * @param input - The action input class.\r\n * @param context - The action context.\r\n * @returns Simple product.\r\n */\r\nasync function getSelectedVariantAction(input: SelectedVariantInput, context: IActionContext): Promise {\r\n const matchingDimensionValues = input.matchingDimensionValues ?? getDimensionValuesFromQuery(context.requestContext.url.requestUrl);\r\n\r\n const result = await ProductsDataActions.getByIdsAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context),\r\n bypassCache: input.bypassCache\r\n },\r\n input.channelId,\r\n [input.productId],\r\n null,\r\n input.catalogId ?? 0\r\n );\r\n let product = result[0];\r\n\r\n // Need to dereference this before editing it. Otherwise we might not\r\n // properly get the mobx events because if things aren't properly observable\r\n // they won't fire when you set them, and then if you don't deref the value in\r\n // the cache will match the value when you try to save it, so it won't detect any\r\n // changes there either\r\n product = { ...product };\r\n\r\n const hasUnmatchedDimension = checkIfHasUnmatchedDimensions(product, matchingDimensionValues);\r\n\r\n const newImageUrl = generateProductImageUrl(product, context.requestContext.apiSettings);\r\n\r\n if (newImageUrl) {\r\n product.PrimaryImageUrl = newImageUrl;\r\n }\r\n\r\n const fullDimensions: IProductDimensionsWithAvailabilitiesFull[] = await getFullDimensions(\r\n product,\r\n matchingDimensionValues,\r\n context,\r\n input.catalogId\r\n );\r\n\r\n // Retrieve product variants only if matching dimensions are provided.\r\n const productVariant: SimpleProduct | undefined = ArrayExtensions.hasElements(matchingDimensionValues)\r\n ? await getProductVariant(input, context, fullDimensions)\r\n : undefined;\r\n\r\n // Update dimension value back to the one that comes from API since the URL query might have a different format for the dimension values.\r\n if (productVariant?.Dimensions && product.Dimensions) {\r\n for (const dimension of product.Dimensions) {\r\n const matchedTargetDimensionFromApi = productVariant.Dimensions.find(\r\n targetDimension => targetDimension.DimensionTypeValue === dimension.DimensionTypeValue\r\n );\r\n const matchedTargetDimensionFromSearch = matchingDimensionValues.find(\r\n targetDimension => targetDimension.DimensionTypeValue === dimension.DimensionTypeValue\r\n );\r\n\r\n if (matchedTargetDimensionFromSearch && matchedTargetDimensionFromApi) {\r\n dimension.DimensionValue = matchedTargetDimensionFromApi.DimensionValue;\r\n }\r\n }\r\n }\r\n\r\n if (!hasUnmatchedDimension && ArrayExtensions.hasElements(matchingDimensionValues) && productVariant) {\r\n return productVariant;\r\n }\r\n\r\n if (product && context.requestContext.app.config?.useCommercialStyleName) {\r\n var attributes = await ProductsDataActions.getAttributeValuesAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\r\n },\r\n product.RecordId,\r\n input.channelId,\r\n input.catalogId ?? 0\r\n );\r\n product.Name = getCommercialName(attributes, product.Name, context.requestContext.app.config?.commercialStyleNameAttribute);\r\n }\r\n\r\n const selectedProduct: ISelectedProduct = product;\r\n selectedProduct.productVariant = productVariant;\r\n return selectedProduct;\r\n}\r\n\r\n/**\r\n * The complete getSelectedVariant data action.\r\n */\r\nexport const getSelectedVariantActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-selected-variant',\r\n action: getSelectedVariantAction as IAction,\r\n input: createInput\r\n});\r\n\r\nexport default getSelectedVariantActionDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxViewProps } from './ext-buybox';\r\nimport { IBuyboxFindInStoreViewProps } from './components/ext-buybox-find-in-store';\r\n\r\nconst BuyboxView: React.FC = props => {\r\n const {\r\n ModuleProps,\r\n MediaGalleryContainerProps,\r\n ProductInfoContainerProps,\r\n addToCart,\r\n addToOrderTemplate,\r\n addToWishlist,\r\n configure,\r\n description,\r\n findInStore,\r\n quantity,\r\n price,\r\n title,\r\n rating,\r\n inventoryLabel,\r\n shopSimilarLook,\r\n keyInPrice,\r\n shopSimilarDescription,\r\n unitOfMeasure,\r\n productComparisonButton,\r\n variantColorName\r\n } = props;\r\n\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {title}\r\n {price}\r\n {unitOfMeasure}\r\n {props.bulkPurchaseLink}\r\n {description}\r\n {rating}\r\n {props.config.showColorName && variantColorName && {variantColorName}}\r\n {configure && _renderConfigure(configure)}\r\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {quantity && _renderQuantity(quantity)}\r\n {inventoryLabel}\r\n {addToCart && _renderAddToCart(addToCart)}\r\n {findInStore && _renderFindInStore(findInStore)}\r\n {addToOrderTemplate && _renderAddToOrderTemplate(addToOrderTemplate)}\r\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n {productComparisonButton}\r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToCart;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToOrderTemplate = (addToOrderTemplate: IBuyboxAddToOrderTemplateViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToOrderTemplate;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToWishlist = (addToWishlist: IBuyboxAddToWishlistViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToWishlist;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n\r\n return {dropdowns.map(_renderConfigureDropdown)};\r\n};\r\n\r\nconst _renderSocialShare = (socialShare: React.ReactNode[]): JSX.Element | undefined => {\r\n if (!socialShare || socialShare.length === 0) {\r\n return undefined;\r\n }\r\n\r\n return <>{socialShare[0]};\r\n};\r\n\r\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {select}\r\n \r\n );\r\n};\r\n\r\nconst _renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\nconst _renderQuantity = (quantity: IBuyboxProductQuantityViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input, errors } = quantity;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\r\n\r\n return (\r\n \r\n {heading}\r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n const { ContainerProps, errors, input } = shopSimilarItem;\r\n\r\n return (\r\n \r\n {errors}\r\n {input}\r\n \r\n );\r\n};\r\nexport default BuyboxView;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n AddToOrderTemplateComponent,\r\n IAddToOrderTemplateDialogResources,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n IOrderTemplateActionErrorResult,\r\n IOrderTemplateNameDialogResources\r\n} from '@msdyn365-commerce/components';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getConfigureErrors,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonResources,\r\n IBuyboxData,\r\n IBuyboxState,\r\n IBuyboxViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport * as React from 'react';\r\n\r\nimport { IBuyboxProps as IBuyboxExtentionProps } from '../../definition-extensions/buybox.ext.props.autogenerated';\r\n\r\n/**\r\n * To generate AddToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of AddToOrderTemplateDialog resources..\r\n */\r\nfunction generateAddToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IAddToOrderTemplateDialogResources {\r\n return {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText\r\n };\r\n}\r\n\r\n/**\r\n * To generate OrderTemplateNameDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of OrderTemplateNameDialog resources..\r\n */\r\nfunction generateOrderTemplateNameDialogResources(resources: IBuyboxCommonResources): IOrderTemplateNameDialogResources {\r\n return {\r\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\r\n orderTemplateTitleLabel: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n orderTemplateDescription: resources.createOrderTemplateDescription,\r\n\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n\r\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\r\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\r\n };\r\n}\r\n\r\n/**\r\n * To generate ItemAddedToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of ItemAddedToOrderTemplateDialog resources..\r\n */\r\nfunction generateItemAddedToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IItemAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n}\r\n\r\n/**\r\n * To generate DuplicateItemsWhenAddingToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of DuplicateItemsWhenAddingToOrderTemplateDialog resources..\r\n */\r\nfunction generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\r\n resources: IBuyboxCommonResources\r\n): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\r\n return {\r\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\r\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\r\n updateQuantityButtonText: resources.updateQuantityButtonText,\r\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\r\n };\r\n}\r\n\r\n/**\r\n * Add to wishlist failed function.\r\n * @param callbacks -Buybox callbacks.\r\n * @param resources -Buybox resources.\r\n * @param product -Simple product.\r\n * @returns Update error state.\r\n */\r\nconst onAddToOrderTemplateFailed = (callbacks: IBuyboxCallbacks, resources: IBuyboxCommonResources, product: SimpleProduct | undefined) => (\r\n result: IOrderTemplateActionErrorResult\r\n) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'ORDER_TEMPLATE',\r\n configureErrors:\r\n result.status === 'MISSING_DIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n};\r\n\r\n/**\r\n * RenderAddToOrderTemplateButton.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @param product - Product data.\r\n * @returns -- Returns JSX element.\r\n */\r\nexport const renderAddToOrderTemplateButton = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n product: SimpleProduct\r\n): React.ReactNode => {\r\n const {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from module file.\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n resources,\r\n config\r\n } = props;\r\n\r\n const { quantity } = state;\r\n\r\n const isShowButtonText = true;\r\n const isMultipleCatalogsFeatureEnabled = props.isChannelMultipleCatalogsFeatureEnabled || false;\r\n return (\r\n orderTemplates && (\r\n \r\n )\r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { AddToWishlistComponent, IWishlistActionErrorResult } from '@msdyn365-commerce/components';\r\nimport { format, ItemAvailability, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { IStoreInfo } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport {\r\n getConfigureErrors,\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonResources,\r\n IBuyboxData,\r\n IBuyboxFindInStoreViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxResources as IBuyboxExtentionResources,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport {\r\n ArrayExtensions,\r\n getFullAvailableInventoryNearby,\r\n GetFullAvailableInventoryNearbyInput,\r\n IFullOrgUnitAvailability\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IncrementalQuantity, INodeProps, ITelemetryContent, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { reaction } from 'mobx';\r\nimport * as React from 'react';\r\n\r\nimport { IBuyboxProps as IBuyboxExtentionProps, IBuyboxProps } from '../definition-extensions/buybox.ext.props.autogenerated';\r\nimport { renderAddToOrderTemplateButton } from './components/buybox-add-to-order-template';\r\nimport { IExtBuyboxProps } from '../definition-extensions/ext-buybox.ext.props.autogenerated';\r\nimport { IBuyboxViewProps } from '../../../modules/ext-buybox';\r\n\r\n/**\r\n * BuyBoxConstants enum.\r\n */\r\nexport enum BuyBoxConstants {\r\n zero = 0\r\n}\r\n\r\n/**\r\n * On Change function.\r\n * @param callbacks -Callbacks.\r\n * @returns Update quantity.\r\n */\r\nconst onChangeHandler = (callbacks: IBuyboxCallbacks) => (newValue: number): boolean => {\r\n if (callbacks.updateQuantity) {\r\n return callbacks.updateQuantity(newValue);\r\n }\r\n return true;\r\n};\r\n\r\n/**\r\n * RenderQuantity.\r\n * @param quantityComponent - QuantityComponent.\r\n * @param callbacks - Callbacks.\r\n * @param props - Props.\r\n * @param state - State.\r\n * @param extentionResources - ExtentionResources.\r\n * @param quantityLimitsMessages - QuantityLimitsMessages.\r\n * @param max - Max.\r\n * @param telemetryContent - TelemetryContent.\r\n * @param unitOfMeasure - Unit Of Measure.\r\n * @returns -- Returns.\r\n */\r\nconst renderQuantity = (\r\n quantityComponent: IBuyboxProductQuantityViewProps,\r\n callbacks: IBuyboxCallbacks,\r\n props: IBuyboxProps,\r\n state: IBuyboxState,\r\n extentionResources: IBuyboxExtentionResources,\r\n quantityLimitsMessages: React.ReactNode,\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n max: number | undefined,\r\n telemetryContent?: ITelemetryContent,\r\n unitOfMeasure?: React.ReactNode\r\n): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const { ContainerProps, LabelContainerProps, heading, errors } = quantityComponent;\r\n\r\n const { resources } = props;\r\n\r\n const { quantity } = state;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n\r\n \r\n {unitOfMeasure}\r\n {quantityLimitsMessages}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Render key in price function.\r\n * @param keyInPrice - KeyInPrice.\r\n * @returns -- Returns.\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\n/**\r\n * RenderAddToCart.\r\n * @param addToCart - AddToCart.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\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\n/**\r\n * RenderFindInStore.\r\n * @param findInStore - FindInStore.\r\n * @returns -- Returns.\r\n */\r\nconst renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderAddToOrderTemplate.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToOrderTemplate = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): JSX.Element | null => {\r\n const product = props.data.product.result;\r\n if (!props.addToOrderTemplate || !product) {\r\n return null;\r\n }\r\n\r\n const orderTemplateButton = renderAddToOrderTemplateButton(props, state, callbacks, product);\r\n\r\n return (\r\n \r\n {props.addToOrderTemplate.errorBlock}\r\n {orderTemplateButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Add to wishlist failed function.\r\n * @param callbacks -Buybox callbacks.\r\n * @param resources -Buybox resources.\r\n * @param product -Simple product.\r\n * @returns Update error state.\r\n */\r\nconst onAddToWishlistFailed = (callbacks: IBuyboxCallbacks, resources: IBuyboxCommonResources, product: SimpleProduct | undefined) => (\r\n result: IWishlistActionErrorResult\r\n) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'WISHLIST',\r\n configureErrors:\r\n result.status === 'MISSINGDIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n};\r\n\r\n/**\r\n * RenderAddToWishlist.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @param product - Product data.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddtoWishlistButton = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n product: SimpleProduct\r\n): React.ReactNode => {\r\n const { context, resources } = props;\r\n const wishlists = props.data.wishlists.result;\r\n const isShowWishlitButtonText = true;\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderAddToWishlist.\r\n * @param props - Buybox viewprops.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToWishlist = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): JSX.Element | null => {\r\n const product = props.data.product.result;\r\n if (!props.addToWishlist || !product) {\r\n return null;\r\n }\r\n\r\n if (!props.config.enableWishlist) {\r\n return null;\r\n }\r\n\r\n const wishlistButton = renderAddtoWishlistButton(props, state, callbacks, product);\r\n return (\r\n \r\n {props.addToWishlist.errorBlock}\r\n {wishlistButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RRenderShopSimilarItem.\r\n * @param shopSimilarItem - ShopSimilarItem.\r\n * @returns -- Returns.\r\n */\r\nconst renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\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 * RenderSocialShare.\r\n * @param socialShare - Social share react node array.\r\n * @returns -- Returns.\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/**\r\n * RenderConfigureDropdown.\r\n * @param dropdown - Buybox product configure dropdown view props.\r\n * @returns -- Returns JSX.Element.\r\n */\r\nconst renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n\r\n return (\r\n \r\n {heading}\r\n {select}\r\n {errors}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderConfigure.\r\n * @param configure - Buybox product configure view props.\r\n * @returns -- Returns JSX.Element.\r\n */\r\nconst renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n\r\n return {dropdowns.map(renderConfigureDropdown)};\r\n};\r\n\r\n/**\r\n * BuyboxView.\r\n * @param props - Props.\r\n * @returns -- Returns.\r\n */\r\nconst BuyboxView: React.FC> = props => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const {\r\n ModuleProps,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n MediaGalleryContainerProps,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n ProductInfoContainerProps,\r\n addToCart,\r\n addToOrderTemplate,\r\n addToWishlist,\r\n productComparisonButton,\r\n configure,\r\n description,\r\n findInStore,\r\n quantity,\r\n price,\r\n title,\r\n rating,\r\n inventoryLabel,\r\n shopSimilarLook,\r\n keyInPrice,\r\n shopSimilarDescription,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n max,\r\n unitOfMeasure,\r\n callbacks,\r\n state,\r\n resources,\r\n quantityLimitsMessages,\r\n telemetryContent,\r\n app: { config: appConfig },\r\n catalogs,\r\n variantColorName,\r\n sizeModal,\r\n newConfigure,\r\n config: { expandedSizeSelector }\r\n } = props;\r\n let skuText: string = props.resources.skuText;\r\n skuText += props.data.product.result?.ItemId;\r\n const preferredStoreInfo: IStoreInfo | undefined = props.data.storeSelectorStateManager.result?.preferredStore;\r\n const preferredStoreId = preferredStoreInfo?.StoreId ? preferredStoreInfo.StoreId : '';\r\n const preferredStoreName = preferredStoreInfo?.StoreName ? preferredStoreInfo.StoreName : '';\r\n\r\n const [availability, setAvailability] = React.useState('');\r\n const [isStoreChange, setIsStoreChange] = React.useState(false);\r\n\r\n /**\r\n * GetStockInventoryLabel.\r\n * @param availabilityWithHours - Stock availability with hours.\r\n * @returns -- Returns.\r\n */\r\n const getStockInventoryLabel = (availabilityWithHours: IFullOrgUnitAvailability | undefined): string | undefined => {\r\n if (availabilityWithHours && ArrayExtensions.hasElements(availabilityWithHours.ProductInventoryInformation)) {\r\n for (const productInventoryInformation of availabilityWithHours.ProductInventoryInformation) {\r\n if (\r\n availabilityWithHours.OrgUnitAvailability?.OrgUnitLocation?.InventoryLocationId ===\r\n productInventoryInformation.InventLocationId\r\n ) {\r\n return productInventoryInformation.StockLevelLabel;\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n const getInventory = React.useCallback(async () => {\r\n const input = new GetFullAvailableInventoryNearbyInput(\r\n props.data.product.result?.RecordId,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n true\r\n );\r\n\r\n /**\r\n * IsProductInStock.\r\n * @param itemAvailabilities - Item availability array.\r\n * @returns -- Returns.\r\n */\r\n const isProductInStock = (itemAvailabilities: ItemAvailability[] | undefined): boolean => {\r\n if (!appConfig.enableStockCheck) {\r\n return true;\r\n }\r\n\r\n if (ArrayExtensions.hasElements(itemAvailabilities)) {\r\n return itemAvailabilities[BuyBoxConstants.zero].AvailableQuantity! > BuyBoxConstants.zero;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n await getFullAvailableInventoryNearby(input, props.context.actionContext)\r\n .catch((error: Error) => {\r\n props.telemetry.error(error.message);\r\n })\r\n .then(response => {\r\n if (response && ArrayExtensions.hasElements(response)) {\r\n const isPreferredStore = (value: IFullOrgUnitAvailability) =>\r\n value.OrgUnitAvailability?.OrgUnitLocation?.OrgUnitNumber === preferredStoreId;\r\n const filteredFullOrgUnitAvailability = response.filter(isPreferredStore);\r\n const preferredStoreAvailability = ArrayExtensions.hasElements(filteredFullOrgUnitAvailability)\r\n ? filteredFullOrgUnitAvailability[BuyBoxConstants.zero]\r\n : undefined;\r\n const stockStatusLabel: string | undefined = getStockInventoryLabel(preferredStoreAvailability);\r\n const isInStock = isProductInStock(preferredStoreAvailability?.OrgUnitAvailability?.ItemAvailabilities);\r\n const resourceLabel = isInStock ? props.resources.inStockText : props.resources.outOfStockText;\r\n const stockText: string | undefined = stockStatusLabel ? stockStatusLabel : resourceLabel;\r\n const preferredStoreAvailabilityText = `${format(\r\n props.resources.availabilityAtPreferredStoreText,\r\n preferredStoreName\r\n )} ${stockText}`;\r\n setAvailability(preferredStoreAvailabilityText);\r\n }\r\n });\r\n\r\n setIsStoreChange(false);\r\n }, [\r\n props.data.product.result?.RecordId,\r\n appConfig.enableStockCheck,\r\n preferredStoreId,\r\n preferredStoreName,\r\n props.context.actionContext,\r\n props.resources.availabilityAtPreferredStoreText,\r\n props.resources.inStockText,\r\n props.resources.outOfStockText,\r\n props.telemetry\r\n ]);\r\n\r\n React.useEffect(() => {\r\n if (props.config.displayStockAvailability) {\r\n getInventory().catch((error: Error) => {\r\n props.telemetry.error(error.message);\r\n });\r\n }\r\n }, [getInventory, isStoreChange, props.telemetry, props.config.displayStockAvailability]);\r\n\r\n reaction(\r\n () => props.data.storeSelectorStateManager.result?.selectedStoreLocationId,\r\n () => {\r\n setIsStoreChange(true);\r\n }\r\n );\r\n\r\n /**\r\n * RenderAvailabiltyAtPreferredStore.\r\n * @returns -- Returns.\r\n */\r\n const renderAvailabilityAtPreferredStore = (): JSX.Element | undefined => {\r\n const hasProductDimensions = ArrayExtensions.hasElements(props.data.product.result?.Dimensions);\r\n if (hasProductDimensions && props.data.product.result?.MasterProductId === undefined) {\r\n return undefined;\r\n }\r\n const containerProps: INodeProps = {\r\n className: 'ms-buybox__preferred-store-availability',\r\n tag: 'span'\r\n };\r\n\r\n return {availability};\r\n };\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {catalogs && catalogs[0].Name}\r\n {title}\r\n \r\n
{skuText}
\r\n {rating}\r\n
\r\n \r\n
{props.resources.priceText}
\r\n {price}\r\n
\r\n {expandedSizeSelector ? <>{sizeModal}{newConfigure} : configure && renderConfigure(configure) }\r\n {props.config.showColorName && {variantColorName}}\r\n {keyInPrice && renderKeyInPrice(keyInPrice)}\r\n \r\n
\r\n {quantity &&\r\n renderQuantity(\r\n quantity,\r\n callbacks,\r\n props,\r\n state,\r\n resources,\r\n quantityLimitsMessages,\r\n max,\r\n telemetryContent,\r\n unitOfMeasure\r\n )}\r\n {props.bulkPurchaseLink}\r\n
\r\n
\r\n {props.config.displayStockAvailability && preferredStoreId && renderAvailabilityAtPreferredStore()}\r\n {inventoryLabel}\r\n {renderAddToCart(addToCart)}\r\n {findInStore && renderFindInStore(findInStore)}\r\n {addToWishlist && renderAddToWishlist(props, state, callbacks)}\r\n {productComparisonButton}\r\n {addToOrderTemplate && renderAddToOrderTemplate(props, state, callbacks)}\r\n {findInStore?.productPickupOptionList ? (\r\n
{findInStore.productPickupOptionList}
\r\n ) : null}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n
{props.resources.shopText}
\r\n \r\n {shopSimilarLook && renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && renderShopSimilarItem(shopSimilarDescription)}\r\n \r\n {!props.config.hideDescription && \r\n
{props.resources.descriptionText}
\r\n {description}\r\n
}\r\n {ArrayExtensions.hasElements(props.slots.productSpecification) ? (\r\n {props.slots.productSpecification[0]}\r\n ) : null}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default BuyboxView;\r\n"],"names":["module","exports","React","ReactDOM","BaseStoreSelectorStateManager","constructor","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","this","isMapModuleLoaded","value","_readFromToCookie","storeInfo","JSON","parse","undefined","preferredStore","_unused","_context","input","storeId","selectedStoreLocationId","storeName","writeToCookie","arguments","length","StoreId","StoreName","Latitude","Longitude","_writeToCookie","stringify","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","id","Error","key","MsDyn365","isBrowser","window","localStorage","removeItem","setItem","cookieValue","getItem","__decorate","computed","observable","action","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","actionContext","requestContext","channel","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","trim","query","encodeURI","geolocationApiUrl","app","config","requestUrl","Promise","resolve","script","document","createElement","setAttribute","data","remove","resourceSets","resources","point","coordinates","body","appendChild","_document","StringExtensions","isNullOrEmpty","getElementById","currentWindowAPI","mapAPIReady","isMapApiLoaded","url","lang","market","reject","_document2","_document3","type","async","defer","src","addEventListener","error","createStoreSelectorStateInput","result","GenericInput","getGenericActionDataAction","createObservableDataAction","getGenericAction","inputData","getCommercialName","_productName$split$","attributes","productName","commercialStyleNameAttribute","styleName","find","x","Name","productBrand","split","TextValue","getOriginalPrice","props","Math","max","price","BasePrice","TradeAgreementPrice","AdjustedPrice","getActivePrice","showPriceRangeForMasterProduct","MinVariantPrice","CustomerContextualPrice","formatCurrency","shouldUseFreePriceText","currencyCode","freePriceText","context","cultureFormatter","_props$isPriceMinMaxE","_props$product","_props$product2","isPriceMinMaxEnabled","product","ProductTypeValue","ProductType","Master","KitMaster","MaxVariantPrice","renderCurrentPrice","_props$priceResources2","priceClass","isMemberDiscount","maxVariantPrice","minVariantPrice","_props$priceResources","className","itemProp","priceResources","priceRangeSeparator","showDiscountBox","memberPriceMessage","PriceComponent","msdyn365Commerce","createComponentOverride","_objectSpread","component","_props$data$price$Dis","DiscountLines","forEach","discount","_discount$OfferName","OfferName","toLowerCase","includes","request","loyaltyDiscountIdentifier","isSalesAgreementPriceFeatureEnabled","SalesAgreementPrice","_props$data$price$Sal","_props$priceResources11","_props$priceResources12","isExpanded","setIsExpanded","toggle","classnames","Button","salesAgreementPricePrompt","onClick","tabIndex","_props$data$price$Att","_props$priceResources3","_props$priceResources4","_props$priceResources5","_props$priceResources6","_props$priceResources7","_props$priceResources8","firstPriceLine","AttainablePriceLines","format","salesAgreementExpirationDatePrompt","formatDate","EffectiveDate","ExpirationDate","salesAgreementCommittedQuantityPrompt","CommittedQuantity","salesAgreementRemainingQuantityPrompt","RemainingQuantity","renderSalesAgreementDetail","initialPrice","originalPriceText","currentPriceText","savingsText","renderMemberPrice","originalSalesPrice","activeSalesPrice","showStrikethroughPricing","renderCurrentPriceWithOriginalPrice","_props$data$price","_props$data$price2","_props$priceResources9","_props$priceResources10","saleMessage","abs","toFixed","renderDiscountBox","Position","_ref","isOpen","position","children","innerClassname","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","modalCloseButtonReference","onClickFindInStoreHandler","state","callbacks","_props$data","storeSelectorStateManager","cart","productAvailableQuantity","selectedProduct","quantity","dataProduct","multiplePickupStoreSwitchName","retailMulitplePickupMFeatureState","featureState","IsEnabled","missingDimensions","Dimensions","filter","dimension","DimensionValue","Value","storeSelectorId","Object","keys","storeSelector","updateErrorState","errorHost","configureErrors","getConfigureErrors","openDialog","parentElementRef","deliveryOptions","onLocationSelected","orgUnitLocation","deliveryMode","_props$context","behavior","addToCartBehavior","addProductToCart","count","location","then","status","substatus","productAvailability","changeModalOpen","ProductAvailableQuantity","ArrayExtensions","hasElements","shippingInventory","shipping","deliveryType","DeliveryMode","pickup","failureResult","failureReason","cartActionResult","otherError","getGenericError","navigationUrl","getUrlSync","AddToCartBehavior","goToCart","assign","showModal","showNotification","_props$data$productPr2","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","telemetryContent","getTelemetryObject","telemetryPageName","friendlyName","telemetry","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","closeNotificationLabel","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","priceFree","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","slots","findInStoreHeaderText","descriptionTextToShowAllPickupOptions","PickupDeliveryModeCode","channelDeliveryOptionConfig","_dimension$DimensionV","errorState","quantityError","modalOpen","isSectionDisabled","buttonText","description","isStockCheck","buyboxResources","isLoading","pickupInventory","findInStoreLinkText","findInStoreDescriptionText","isAggregatedInventory","_pickupInventory","IsProductAvailable","findInStoreNotAvailableTextButton","findInStoreNotAvailableDescription","getFindInStoreInventorySettings","enableStockCheck","DeliveryOptions","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","map","delivery","deliveryCode","Code","push","PickupDeliveryModeCodes","option","priceComponent","popupProps","imageSettings","productQuantity","setModalOpen","renderModalPopup","Popup","ContainerProps","openFindInStoreDialog","heading","Heading","headingTag","text","productPickupOptionList","item","Description","errors","BuyboxErrorBlock","showError","button","color","ref","disabled","title","modal","Buybox","super","dimensionUpdateQueue","FinitePromiseQueue","dimensions","initializedDimensions","Set","buyboxCallbacks","updateQuantity","newQuantity","setState","newErrorState","sizeModalOpen","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productDeliveryOptions","_updatePrice","initializeDimension","initializedDimension","add","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","_this$props$data$prod","size","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","getDropdownName","dimensionType","_getDropdownName","isModalOpen","changeUpdatingDimension","isUpdatingDimension","changeUpdatingDeliveryOptions","isUpdatingDeliveryOptions","updateKeyInPrice","customPrice","customAmountError","isPriceKeyedIn","keyInPriceAmount","toggleModal","renderConfigureDropdown","dropdown","LabelContainerProps","select","Node","renderSizeDropdown","_this$props$data$prod2","DimensionTypeValue","onMouseDown","e","preventDefault","selected","sizeSelectionHeading","renderConfigure","configure","customSize","dropdowns","index","element","_onBulkPurchaseLinkClick","bulkPurchaseModule","boundingRect","getBoundingClientRect","scrollX","left","pageXOffset","scrollY","top","pageYOffset","scrollTo","_isChannelMultipleCatalogsFeatureEnabled","isMultipleCatalogFeatureEnabledInHq","_this$props$data$feat","feature","productDimensions","hasProductDimensions","dimensionsToUpdate","clearErrorState","previousState","_getProductVariant","productVariant","productVariantPromise","promises","_getDimensionsForSelectedVariant","mappedDimensions","_hydrateInventoryInfo","_hydratePrice","_hydrateDeliveryOptions","_updateQuantitiesInState","all","_this$props$data$prod3","isGiftCard","IsGiftCard","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","min","isPriceApiCalled","_product$ItemId","targetGender","ItemId","startsWith","URL","href","searchParams","get","set","search","toString","ItemTypeValue","ReleasedProductType","Service","isServiceItem","warning","_this$props$data$prod4","colorDimension","dimensionValuesWithInventory","_colorDimension$dimen","_colorDimension$dimen2","TotalAvailableInventoryLevelCode","_element$DimensionVal","RecordId","maxRecentlyViewedItemsCount","RecentlyViewedState","render","_this$props$data$prod5","_this$props$data$feat2","_this$props$data$feat3","_this$props$data$cart","_this$props$data$cart2","mediaGallery","productComparisonButton","inventoryLevel","flatten","validValues","applyDefaultOrderSettings","RetailDefaultOrderQuantityLimitsFeatureName","cartConfiguration","ValidateDefaultOrderSettingsPerLine","hasAvailableProducts","some","getInventoryLevelCodeFromDimensionValue","InventoryLevelValues","outOfStock","catalogId","getCatalogId","variantColorName","validateCatalogId","showColorName","_dimension$DimensionV2","_productColor$Dimensi2","productColor","DimensionValues","_productColor$Dimensi","_productColor$Dimensi3","RefinerGroup","isMobileCheck","isMobile","variant","VariantType","Browser","isMobileView","newConfigure","sizeSelector","getBuyboxProductConfigure","expandedSizeSelector","viewProps","ModuleProps","moduleProps","ProductInfoContainerProps","MediaGalleryContainerProps","getBuyboxProductTitle","hideDescription","getBuyboxProductDescription","bulkPurchaseLink","_renderBuyboxBulkPurchaseLink","unitOfMeasure","getBuyboxProductUnitOfMeasure","findInStore","_getBuyboxProductPrice","addToCart","getBuyboxAddToCart","getBuyboxProductComparisonButton","addToOrderTemplate","getBuyboxProductAddToOrderTemplate","addToWishlist","getBuyboxProductAddToWishlist","rating","hideRating","getBuyboxProductRating","getBuyboxProductQuantity","inventoryLabel","getBuyBoxInventoryLabel","shopSimilarLook","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","Looks","shopSimilarDescription","enableShopSimilarDescription","keyInPrice","enableKeyInPrice","isCustomPriceSelected","getBuyboxKeyInPrice","quantityLimitsMessages","getQuantityLimitsMessages","isChannelMultipleCatalogsFeatureEnabled","currentCatalogId","catalogs","_validateCatalogDetails","sizeModal","ModalPanel","BOTTOM","POPUP_RELATIVE","renderView","_state$productPrice","_props$data$featureSt","_props$data$featureSt2","isBulkPurchaseEnabled","bulkPurchaseModules","Array","from","getElementsByClassName","BulkPurchase","bulkPurchaseLinkText","_productDimensions$fi","apiSettings","channelId","_dimension$dimensionV","_dimensions$find$Dime","_dimensions$find","_value$DimensionValue","ExtensionProperties","setDimensionValuesToQuery","selectedProductPromise","getSelectedVariantActionDataAction","SelectedVariantInput","MasterProductId","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","_productVariant$Dimen","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","newShippingQuantity","_dimension$DimensionV3","getPriceForSelectedVariant","PriceForSelectedVariantInput","_this$props$data$feat4","retailMultiplePickupFeatureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","isOrderQuantityLimitsFeatureEnabled","_isOrderQuantityLimitsFeatureEnabled","isChannelLimitsFeatureEnabled","_isChannelLimitsFeatureEnabled","_getMinQuantityForCartLineItem","_getMaxQuantityForCartLineItem","_getQuantity","_product$Behavior","Behavior","MinimumQuantity","isQuantityLimitsFeatureEnabled","_product$Behavior2","MaximumQuantity","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","_cartConfiguration$re","_cartConfiguration$re2","_product$Behavior3","defaultQuantity","DefaultQuantity","_featureStatuses$find","_featureStatuses$find2","featureStatuses","RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName","_this$props$context","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","customerInformation","information","IsB2b","_cartConfiguration$Ig","IgnoreOrderSettings","_this$props$data$cata","_featureStatuses$find3","isChannelLimitsFeatureEnabledInHq","EcommerceQuantityLimitConfigurationsFeatureName","productId","matchingDimensionValues","bypassCache","getCacheKey","getCacheObjectType","dataCacheType","_input$matchingDimens","_input$catalogId3","_context$requestConte3","getDimensionValuesFromQuery","ProductsDataActions","callerContext","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","hasUnmatchedDimension","checkIfHasUnmatchedDimensions","matchedTargetDimension","targetDimension","newImageUrl","generateProductImageUrl","PrimaryImageUrl","fullDimensions","fullDimensionPromises","shippingInventoryConfiguration","createInventoryAvailabilitySearchCriteria","searchCriteria","RequestedDimensionTypeValue","MatchingDimensionValues","DefaultWarehouseOnly","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","CatalogId","dimensionValues","getFullDimensions","ProductIds","_input$catalogId","_context$requestConte","variantProductId","variantImageUrl","useCommercialStyleName","_input$catalogId2","_context$requestConte2","getProductVariant","matchedTargetDimensionFromApi","_input$catalogId4","_context$requestConte4","getSelectedProductIdFromActionInput","_renderAddToCart","errorBlock","_renderAddToOrderTemplate","_renderAddToWishlist","_renderConfigure","_renderConfigureDropdown","_renderSocialShare","socialShare","_renderFindInStore","_renderQuantity","_renderKeyInPrice","_renderShopSimilarItem","shopSimilarItem","Module","generateAddToOrderTemplateDialogResources","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","generateOrderTemplateNameDialogResources","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","generateItemAddedToOrderTemplateDialogResources","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","generateDuplicateItemsWhenAddingToOrderTemplateDialogResources","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","onAddToOrderTemplateFailed","BuyBoxConstants","onChangeHandler","newValue","renderAddToOrderTemplate","orderTemplateButton","renderAddToOrderTemplateButton","orderTemplates","isMultipleCatalogsFeatureEnabled","AddToOrderTemplateComponent","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","onError","shouldShowButtonFailedTooltip","showButtonTooltip","showButtonText","onAddToWishlistFailed","renderAddToWishlist","enableWishlist","wishlistButton","renderAddtoWishlistButton","wishlists","AddToWishlistComponent","addToWishlistButtonText","removeFromWishlistButtonText","addToWishlistMessage","removedFromWishlistMessage","addItemToWishlistError","removeItemFromWishlistError","nameOfWishlist","ariaRole","getSelectedProduct","renderShopSimilarItem","_props$data$product$r","_props$data$storeSele","_props$data$product$r3","appConfig","skuText","preferredStoreInfo","preferredStoreId","preferredStoreName","availability","setAvailability","isStoreChange","setIsStoreChange","getInventory","_props$data$product$r2","GetFullAvailableInventoryNearbyInput","zero","getFullAvailableInventoryNearby","response","_preferredStoreAvaila","isPreferredStore","_value$OrgUnitAvailab","OrgUnitAvailability","OrgUnitLocation","OrgUnitNumber","filteredFullOrgUnitAvailability","preferredStoreAvailability","stockStatusLabel","availabilityWithHours","ProductInventoryInformation","productInventoryInformation","_availabilityWithHour","InventoryLocationId","InventLocationId","StockLevelLabel","getStockInventoryLabel","resourceLabel","itemAvailabilities","ItemAvailabilities","AvailableQuantity","inStockText","outOfStockText","stockText","preferredStoreAvailabilityText","availabilityAtPreferredStoreText","displayStockAvailability","reaction","_props$data$storeSele2","priceText","renderKeyInPrice","renderQuantity","quantityComponent","extentionResources","IncrementalQuantity","currentCount","onChange","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","minQuantityText","maxQuantityText","renderAvailabilityAtPreferredStore","_props$data$product$r4","_props$data$product$r5","tag","renderAddToCart","renderFindInStore","shopText","descriptionText","productSpecification"],"sourceRoot":""}