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./src/modules/sgi-buybox/sgi-buybox.tsx?7e35","webpack://sgi-bookstore/./src/themes/sgi-theme/views/components/buybox-add-to-order-template.tsx?bc0b","webpack://sgi-bookstore/./src/modules/sgi-buybox/sgi-buybox.view.tsx?b1de","webpack://sgi-bookstore/./lib/sgi-buybox/module-registration.js?9dc5","webpack://sgi-bookstore/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://sgi-bookstore/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://sgi-bookstore/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://sgi-bookstore/./src/dataActions/get-attributes-for-selected-variant.ts?e4b6","webpack://sgi-bookstore/external var \"React\"?0d3b","webpack://sgi-bookstore/external var \"ReactDOM\"?853b"],"sourcesContent":["/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\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 { ISgiBuyboxData } from '../sgi-buybox.data';\r\nimport { ISgiBuyboxProps, ISgiBuyboxResources } from '../sgi-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: ISgiBuyboxProps,\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: ISgiBuyboxResources,\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: ISgiBuyboxProps,\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: ISgiBuyboxProps, 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. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\r\nimport { ProductDeliveryOptions, ProductPrice, ReleasedProductType, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { BulkPurchase } from '@msdyn365-commerce-modules/bulk-purchase';\r\nimport {\r\n ArrayExtensions,\r\n DeliveryMode,\r\n FinitePromiseQueue,\r\n FinitePromiseQueueError,\r\n getDeliveryOptionsForSelectedVariant,\r\n GetDeliveryOptionsForSelectedVariantInput,\r\n getDimensionsForSelectedVariant,\r\n GetDimensionsForSelectedVariantInput,\r\n getInventoryLevelCodeFromDimensionValue,\r\n getPriceForSelectedVariant,\r\n getProductAvailabilitiesForSelectedVariant,\r\n getSelectedVariant,\r\n IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n IProductInventoryInformation,\r\n IPromiseQueue,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput,\r\n SelectedVariantInput,\r\n setDimensionValuesToQuery\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n getBuyboxAddToCart,\r\n getBuyBoxInventoryLabel,\r\n getBuyboxKeyInPrice,\r\n getBuyboxProductAddToOrderTemplate,\r\n getBuyboxProductAddToWishlist,\r\n getBuyboxProductDescription,\r\n getBuyboxProductPrice,\r\n getBuyboxProductQuantity,\r\n getBuyboxProductRating,\r\n getBuyboxProductTitle,\r\n getBuyboxProductUnitOfMeasure,\r\n getBuyboxShopSimilarButton,\r\n getQuantityLimitsMessages,\r\n RetailDefaultOrderQuantityLimitsFeatureName\r\n} from '../../common/buybox-components';\r\nimport { getBuyboxProductConfigure } from '../../common/buybox-product-configure';\r\nimport {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxExtentedProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IErrorState,\r\n ShopSimiliarButtonType\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { ISgiBuyboxData } from './sgi-buybox.data';\r\nimport { ISgiBuyboxProps, ISgiBuyboxResources } from './sgi-buybox.props.autogenerated';\r\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/sgi-buybox-find-in-store';\r\nimport { getAttributeByName } from '../../themes/sgi-theme/views/Utilities/utility';\r\nexport interface IBuyboxViewProps extends ISgiBuyboxProps {\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?: String;\r\n rating?: React.ReactNode;\r\n price?: React.ReactNode;\r\n bulkPurchaseLink?: React.ReactNode;\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\r\n addToWishlist?: IBuyboxAddToWishlistViewProps;\r\n max: number | undefined;\r\n addToCart: IBuyboxAddToCartViewProps;\r\n findInStore?: IBuyboxFindInStoreViewProps;\r\n quantity?: IBuyboxProductQuantityViewProps;\r\n configure?: IBuyboxProductConfigureViewProps;\r\n inventoryLabel?: React.ReactNode;\r\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\r\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\r\n quantityLimitsMessages: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n keyInPrice?: IBuyboxKeyInPriceViewProps;\r\n unitOfMeasure?: React.ReactNode;\r\n isAmazonPay?: boolean;\r\n renderAmazonPay?: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Buybox Module.\r\n */\r\nclass Buybox extends React.PureComponent, IBuyboxState> {\r\n /**\r\n * A queue of tasks of processing the changes in the dimensions.\r\n * Limit to two processes:\r\n * 1 - for the current process, which is under execution at the moment.\r\n * 2 - next process, which will process the latest version of data.\r\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\r\n */\r\n private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\r\n\r\n private dimensions: { [id: number]: string } = {};\r\n\r\n private readonly buyboxCallbacks: IBuyboxCallbacks = {\r\n updateQuantity: (newQuantity: number): boolean => {\r\n const errorState = { ...this.state.errorState };\r\n errorState.quantityError = undefined;\r\n errorState.otherError = undefined;\r\n\r\n this.setState({ quantity: newQuantity, errorState });\r\n return true;\r\n },\r\n updateErrorState: (newErrorState: IErrorState): void => {\r\n this.setState({ errorState: newErrorState });\r\n },\r\n updateSelectedProduct: (\r\n newSelectedProduct: Promise,\r\n newInventory: IProductInventoryInformation | undefined,\r\n newPrice: ProductPrice | undefined,\r\n newDeliveryOptions: ProductDeliveryOptions | undefined\r\n ): void => {\r\n this.setState({\r\n selectedProduct: newSelectedProduct,\r\n productAvailableQuantity: newInventory,\r\n productDeliveryOptions: newDeliveryOptions\r\n });\r\n this._updatePrice(newPrice);\r\n },\r\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\r\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\r\n return this.dimensionUpdateQueue\r\n .enqueue(async () => {\r\n return this._updateDimensions();\r\n })\r\n .catch((error: any) => {\r\n // Ignore discarded processes.\r\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\r\n throw error;\r\n }\r\n });\r\n },\r\n getDropdownName: (dimensionType: number, resources: ISgiBuyboxResources): 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 constructor(props: ISgiBuyboxProps, state: IBuyboxState) {\r\n super(props);\r\n this.state = {\r\n errorState: {\r\n configureErrors: {}\r\n },\r\n quantity: 1,\r\n min: undefined,\r\n max: undefined,\r\n selectedProduct: undefined,\r\n productPrice: undefined,\r\n productDeliveryOptions: undefined,\r\n\r\n modalOpen: false,\r\n isUpdatingDimension: false,\r\n isUpdatingDeliveryOptions: false\r\n };\r\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n productPrice\r\n }\r\n } = this.props;\r\n\r\n void productPrice.then(async result => {\r\n this._updatePrice(result);\r\n });\r\n\r\n if (product) {\r\n // Check if the product is service or not by product type\r\n if (product.ItemTypeValue === ReleasedProductType.Service) {\r\n this.setState({ isServiceItem: true });\r\n }\r\n await this._updateQuantitiesInState(product);\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n slots: { mediaGallery },\r\n data: {\r\n product: { result: product }\r\n },\r\n config: { className = '' }\r\n } = this.props;\r\n\r\n const { max } = this.state;\r\n\r\n if (!product) {\r\n this.props.context.telemetry.error('Product content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const props = this.props as IBuyboxExtentedProps;\r\n const defaultMinimumKeyInPrice = 10;\r\n const defaultMaximumKeyInPrice = 100;\r\n\r\n const context = this.props.context as ICoreContext;\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n const dimensionValuesWithInventory = ArrayExtensions.flatten(\r\n ArrayExtensions.validValues(this.props.data.productDimensions.result?.map(value => value.dimensionValuesWithInventory))\r\n );\r\n const hasAvailableProducts =\r\n !ArrayExtensions.hasElements(dimensionValuesWithInventory) ||\r\n dimensionValuesWithInventory.some(value => {\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(value, inventoryLevel);\r\n return inventoryLevelCode !== InventoryLevelValues.outOfStock;\r\n });\r\n\r\n const viewProps: IBuyboxViewProps = {\r\n ...(this.props as ISgiBuyboxProps),\r\n state: this.state,\r\n mediaGallery: mediaGallery && mediaGallery.length > 0 ? mediaGallery[0] : undefined,\r\n ModuleProps: {\r\n moduleProps: this.props,\r\n className: classnames('ms-buybox', className)\r\n },\r\n ProductInfoContainerProps: {\r\n className: 'ms-buybox__content'\r\n },\r\n MediaGalleryContainerProps: {\r\n className: 'ms-buybox__media-gallery'\r\n },\r\n telemetryContent: this.telemetryContent,\r\n callbacks: this.buyboxCallbacks,\r\n title: getBuyboxProductTitle(props),\r\n description: getBuyboxProductDescription(props),\r\n bulkPurchaseLink: this._renderBuyboxBulkPurchaseLink(),\r\n unitOfMeasure: getBuyboxProductUnitOfMeasure(props),\r\n configure: getBuyboxProductConfigure(props, this.state, this.buyboxCallbacks),\r\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\r\n price: getBuyboxProductPrice(props, this.state),\r\n addToCart: getBuyboxAddToCart(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n defaultMinimumKeyInPrice,\r\n defaultMaximumKeyInPrice,\r\n undefined,\r\n hasAvailableProducts\r\n ),\r\n addToOrderTemplate: getBuyboxProductAddToOrderTemplate(props, this.state, this.buyboxCallbacks),\r\n addToWishlist: getBuyboxProductAddToWishlist(props, this.state, this.buyboxCallbacks),\r\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\r\n quantity: product.IsGiftCard ? undefined : getBuyboxProductQuantity(props, this.state, this.buyboxCallbacks),\r\n inventoryLabel: getBuyBoxInventoryLabel(props),\r\n shopSimilarLook:\r\n this.props.config.enableShopSimilarLooks && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Looks)\r\n : undefined,\r\n shopSimilarDescription:\r\n this.props.config.enableShopSimilarDescription && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description)\r\n : undefined,\r\n keyInPrice:\r\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\r\n ? getBuyboxKeyInPrice(props, this.state, this.buyboxCallbacks)\r\n : undefined,\r\n quantityLimitsMessages: getQuantityLimitsMessages(props, this.state),\r\n max,\r\n isAmazonPay: this.isAmazonPay(),\r\n renderAmazonPay: this.renderAmazonBuy()\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Handles anchor click event and scrolls to the given bulk purchase module.\r\n * @param bulkPurchaseModule - Bulk purchase module.\r\n * @returns Handler.\r\n */\r\n private readonly _onBulkPurchaseLinkClick = (bulkPurchaseModule: Element) => () => {\r\n const boundingRect = bulkPurchaseModule.getBoundingClientRect();\r\n window.scrollTo(boundingRect.left, boundingRect.top);\r\n };\r\n\r\n private _renderBuyboxBulkPurchaseLink(): React.ReactNode {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Temporary switch for the feature which is under development.\r\n if (!this.props.context.app.config.isBulkPurchaseEnabled) {\r\n return null;\r\n }\r\n\r\n if (!msdyn365Commerce.isBrowser) {\r\n return null;\r\n }\r\n\r\n const bulkPurchaseModules = Array.from(document.getElementsByClassName(BulkPurchase.className));\r\n\r\n if (!ArrayExtensions.hasElements(bulkPurchaseModules)) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {this.props.resources.bulkPurchaseLinkText}\r\n \r\n );\r\n }\r\n\r\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\r\n if (this.state.isCustomPriceSelected && newPrice) {\r\n newPrice.CustomerContextualPrice = customPrice;\r\n }\r\n this.setState({ productPrice: newPrice });\r\n }\r\n\r\n private readonly _updateDimensions = async (): Promise => {\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 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 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 const errorState = { ...this.state.errorState };\r\n errorState.configureErrors[key] = undefined;\r\n\r\n this.setState({ errorState });\r\n }\r\n }\r\n\r\n const variantProduct: SimpleProduct | null = await this._updateProductDimensionsWithAvailabilities(dimensionsToUpdate);\r\n\r\n if (variantProduct) {\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(variantProduct.RecordId, channelId),\r\n actionContext\r\n );\r\n\r\n const newShippingQuantity = newAvailableQuantity?.find(shipping => shipping.deliveryType === DeliveryMode.shipping);\r\n const isCustompriceSelected = variantProduct.Dimensions?.find(\r\n dimension =>\r\n dimension.DimensionTypeValue === 4 &&\r\n dimension.DimensionValue &&\r\n dimension.DimensionValue.Value?.toLowerCase() === 'custom'\r\n );\r\n if (isCustompriceSelected) {\r\n this.setState({ isCustomPriceSelected: true });\r\n } else {\r\n // Remove custom amount error when unselect the custom amount\r\n const errorState = { ...this.state.errorState };\r\n errorState.customAmountError = undefined;\r\n\r\n this.setState({ isCustomPriceSelected: false, isPriceKeyedIn: false, errorState });\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 // Step 6. Use these dimensions hydrate the product price.\r\n const newPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(variantProduct.RecordId, channelId),\r\n actionContext\r\n );\r\n\r\n if (newPrice) {\r\n this._updatePrice(newPrice);\r\n }\r\n\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 variantProduct.RecordId,\r\n channelId,\r\n undefined,\r\n undefined,\r\n retailMultiplePickupFeatureState?.IsEnabled\r\n ),\r\n actionContext\r\n );\r\n\r\n if (newDeliveryOptions) {\r\n this.setState({ productDeliveryOptions: newDeliveryOptions });\r\n }\r\n\r\n await this._updateQuantitiesInState(variantProduct);\r\n }\r\n };\r\n\r\n private async _updateProductDimensionsWithAvailabilities(dimensionsToUpdate: { [id: number]: string }): Promise {\r\n const {\r\n data: {\r\n product: { result: product }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n } = this.props;\r\n\r\n const productDimensions = this.props.data.productDimensions.result!;\r\n\r\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\r\n // over the information in data\r\n const mappedDimensions = productDimensions\r\n .map(dimension => {\r\n const dimensions = (dimension.dimensionValuesWithInventory ??\r\n dimension.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n return {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue:\r\n dimensions.find(\r\n value => value.DimensionValue?.RecordId.toString() === dimensionsToUpdate[dimension.DimensionTypeValue]\r\n )?.DimensionValue ?? dimension.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n };\r\n })\r\n .filter(dimension => dimension.DimensionValue);\r\n setDimensionValuesToQuery(this.props.context.actionContext.requestContext.url.requestUrl, mappedDimensions);\r\n\r\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const selectedProductPromise = getSelectedVariant(\r\n new SelectedVariantInput(\r\n product!.MasterProductId ? product!.MasterProductId : product!.RecordId,\r\n channelId,\r\n undefined,\r\n undefined,\r\n this.props.context.request\r\n ),\r\n actionContext\r\n );\r\n this.setState({ selectedProduct: selectedProductPromise });\r\n\r\n const variantProduct = await selectedProductPromise;\r\n if (variantProduct) {\r\n await getDimensionsForSelectedVariant(\r\n new GetDimensionsForSelectedVariantInput(\r\n variantProduct.MasterProductId ? variantProduct.MasterProductId : variantProduct.RecordId,\r\n channelId,\r\n mappedDimensions,\r\n this.props.context.request\r\n ),\r\n actionContext\r\n );\r\n }\r\n\r\n return variantProduct;\r\n }\r\n\r\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\r\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\r\n if (isOrderQuantityLimitsFeatureEnabled && product) {\r\n this.setState({\r\n min: product.Behavior?.MinimumQuantity || 1,\r\n\r\n // If max by feature in default order settings is not defined then use max from site settings or default max 10.\r\n max:\r\n product.Behavior?.MaximumQuantity && product.Behavior?.MaximumQuantity > 0\r\n ? product.Behavior?.MaximumQuantity\r\n : this.props.context.app.config.maxQuantityForCartLineItem || 10\r\n });\r\n } else {\r\n this.setState({\r\n min: 1,\r\n max: this.props.context.app.config.maxQuantityForCartLineItem || 10\r\n });\r\n }\r\n }\r\n\r\n private readonly _getDropdownName = (dimensionType: number, resources: ISgiBuyboxResources): 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 defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n const featureStatuses = await this.props.data.featureState;\r\n const isFeatureEnabledInHq = featureStatuses?.find(\r\n featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName\r\n )?.IsEnabled;\r\n if (!isFeatureEnabledInHq) {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n let customerInfo;\r\n try {\r\n customerInfo = await this.props.data.customerInformation;\r\n } catch (error) {\r\n this.props.telemetry.information(error);\r\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\r\n return false;\r\n }\r\n\r\n return (\r\n customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n }\r\n\r\n private isAmazonPay = (): boolean | undefined => {\r\n const {\r\n data: {\r\n productSpecificationData: { result: productSpecificationData }\r\n }\r\n } = this.props;\r\n const attributeKeyValue = getAttributeByName(productSpecificationData, this.props.context.app.config.amazonBuyAttrKeyName)\r\n ?.TextValue;\r\n return attributeKeyValue ? true : false;\r\n };\r\n\r\n private renderAmazonBuy = (): JSX.Element | undefined => {\r\n const {\r\n data: {\r\n productSpecificationData: { result: productSpecificationData }\r\n }\r\n } = this.props;\r\n\r\n const amazonBuyAttrBasedURL = getAttributeByName(productSpecificationData, this.props.context.app.config.amazonBuyAttrKeyName)\r\n ?.TextValue;\r\n if (amazonBuyAttrBasedURL) {\r\n return (\r\n \r\n {this.props.config.amazonBuyBtnText || this.props.resources.amazonBuyBtnTextValue}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n return undefined;\r\n };\r\n}\r\n\r\nexport default Buybox;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport {\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 { getConfigureErrors, IBuyboxCallbacks, IBuyboxData, IBuyboxState } from '@msdyn365-commerce-modules/buybox';\r\nimport * as React from 'react';\r\nimport { IBuyboxViewProps } from '../../../../modules/sgi-buybox/sgi-buybox';\r\nimport {\r\n ISgiBuyboxProps as IBuyboxExtentionProps,\r\n ISgiBuyboxResources\r\n} from '../../../../modules/sgi-buybox/sgi-buybox.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: ISgiBuyboxResources): 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: ISgiBuyboxResources): 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: ISgiBuyboxResources): 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: ISgiBuyboxResources\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: ISgiBuyboxResources, 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 } = props;\r\n\r\n const { quantity } = state;\r\n\r\n const isShowButtonText = true;\r\n\r\n return (\r\n orderTemplates && (\r\n \r\n )\r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { AddToWishlistComponent, IWishlistActionErrorResult } from '@msdyn365-commerce/components';\r\nimport { AsyncResult, AttributeValue, format, ItemAvailability, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { IStoreInfo } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport { ISgiBuyboxData } from './sgi-buybox.data';\r\n\r\nimport {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonResources,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n getConfigureErrors\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nimport { IBuyboxViewProps } from './sgi-buybox';\r\nimport { IBuyboxFindInStoreViewProps } from './components/sgi-buybox-find-in-store';\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 {\r\n ISgiBuyboxProps as IBuyboxExtentionProps,\r\n ISgiBuyboxProps,\r\n ISgiBuyboxResources as IBuyboxExtentionResources\r\n} from './sgi-buybox.props.autogenerated';\r\nimport { renderAddToOrderTemplateButton } from '../../themes/sgi-theme/views/components/buybox-add-to-order-template';\r\nimport { getAttributeByName } from '../../themes/sgi-theme/views/Utilities/utility';\r\n\r\n/**\r\n * BuyBoxConstants enum.\r\n */\r\nexport enum BuyBoxConstants {\r\n zero = 0\r\n}\r\n\r\nexport interface IBuyboxDataExtend extends ISgiBuyboxData {\r\n productSpecificationData: AsyncResult;\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: ISgiBuyboxProps,\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 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 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 config: { aboutThisProductAttrKeyName },\r\n isAmazonPay,\r\n renderAmazonPay\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 productSpecificationData: AttributeValue[] | undefined = props.data.productSpecificationData.result;\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 * 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 const aboutThisProductValue = getAttributeByName(productSpecificationData, aboutThisProductAttrKeyName)?.TextValue || null;\r\n return (\r\n \r\n {props.mediaGallery}\r\n \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 {configure && renderConfigure(configure)}\r\n {keyInPrice && renderKeyInPrice(keyInPrice)}\r\n {!isAmazonPay && (\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 )}\r\n {props.config.displayStockAvailability && preferredStoreId && renderAvailabilityAtPreferredStore()}\r\n {inventoryLabel}\r\n {isAmazonPay ? renderAmazonPay : renderAddToCart(addToCart)}\r\n {findInStore && renderFindInStore(findInStore)}\r\n {addToWishlist && renderAddToWishlist(props, state, callbacks)}\r\n {addToOrderTemplate && renderAddToOrderTemplate(props, state, callbacks)}\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 {description && (\r\n \r\n
{props.resources.descriptionText}
\r\n ${description}

`\r\n }}\r\n />\r\n
\r\n )}\r\n {aboutThisProductValue && (\r\n \r\n
\r\n {props.config.aboutThisProductTitle || props.resources.aboutProductText}\r\n
\r\n ${aboutThisProductValue}

`\r\n }}\r\n />\r\n
\r\n )}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default BuyboxView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['sgi-buybox'] = {\n c: () => require('partner/modules/sgi-buybox/sgi-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:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'deliveryOptions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orderTemplates', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview', runOn: 1},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productAvailableQuantity', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant', runOn: 0},{name:'productDimensions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant', runOn: 0},{name:'productPrice', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant', runOn: 0},{name:'productSpecificationData', path:'@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-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: 'sgi-buybox',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/sgi-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/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/product-specification/dist/lib/dataActions/get-attributes-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|sgi-buybox|sgi-buybox'] = {\n c: () => require('partner/modules/sgi-buybox/sgi-buybox.view.tsx'),\n cn: '__local__-__local__-sgi-buybox'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport {\n IListMapViewState,\n ILoadMapApiInput,\n IStoreInfo,\n IStoreSelectionStateContext,\n IStoreSelectorLocation,\n IStoreSelectorStateManager\n} from './i-store-selection-state-manager';\n\n/**\n * Abstract instance of IStoreSelectorStateManager with base implementation\n * of everything except the geoLocate function.\n */\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\n @computed public get isDialogOpen(): Readonly {\n return this._context !== undefined;\n }\n\n @computed public get context(): Readonly {\n return this._context;\n }\n\n @observable public isMapApiLoaded?: boolean;\n\n @observable public selectedStoreLocationId?: string;\n\n @observable public preferredStore?: IStoreInfo;\n\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n\n @observable public isMapModuleLoaded?: boolean;\n\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\n\n @observable protected _context?: IStoreSelectionStateContext;\n\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\n try {\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\n if (storeInfo) {\n this.preferredStore = storeInfo;\n }\n } catch {\n this.preferredStore = undefined;\n }\n }\n\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\n\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\n this._context = input;\n }\n\n @action\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\n this.selectedStoreLocationId = storeId;\n }\n\n @action\n public async setPreferredStoreLocation(\n storeId?: string,\n storeName?: string | undefined,\n writeToCookie: boolean = false,\n latitude?: number,\n longitude?: number\n ): Promise {\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\n this.preferredStore = storeInfo;\n if (writeToCookie) {\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\n }\n }\n\n @action\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\n this.lastInlineShownStoreInfo = storeInfo;\n }\n\n @action\n public async clearPreferredStore(writeToCookie: boolean): Promise {\n this.preferredStore = undefined;\n if (writeToCookie) {\n this._removeCookie(this.preferredStoreLocalStorageKey);\n }\n }\n\n @action\n public async openDialog(input: IStoreSelectionStateContext): Promise {\n if (this._context && this._context.id === input.id) {\n throw new Error('Dialog is already opened');\n }\n\n this._context = input;\n }\n\n @action\n public async closeDialog(): Promise {\n this._context = undefined;\n }\n\n private _removeCookie(key: string): void {\n if (!key) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.removeItem(key);\n }\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { action } from 'mobx';\n\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IStoreSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (\n !searchTerm ||\n !actionContext.requestContext.channel ||\n !actionContext.requestContext.channel.BingMapsApiKey ||\n !actionContext.requestContext.channel.BingMapsEnabled\n ) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl =\n actionContext.requestContext.app &&\n actionContext.requestContext.app.config &&\n actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise(resolve => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n if (window) {\n const currentWindowAPI = window.mapAPIReady;\n window.mapAPIReady = () => {\n if (currentWindowAPI) {\n currentWindowAPI();\n }\n this.isMapApiLoaded = true;\n };\n }\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\n input.market ? `&setMkt=${input.market}` : ''\n }`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IStoreSelectorStateManager } from './i-store-selection-state-manager';\nimport { MapStoreSelectorStateManager } from './map-store-selector-state-manager';\n\nexport function createStoreSelectorStateInput(result: IStoreSelectorStateManager): GenericInput {\n return new GenericInput('mapSSSM', result, 'IStoreSelectorStateManager');\n}\n\nconst createStoreSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createStoreSelectorStateInput(new MapStoreSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createStoreSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { AttributeValue, ProductsDataActions, SimpleProduct, StoreOperationsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport {\n getAttributeValuesByConfiguration,\n getSelectedProductIdFromActionInput,\n getSelectedVariant,\n SelectedVariantInput\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Chains getting the SelectedVariant with GetActivePrice.\n */\nexport class AttributesForSelectedVariantInput implements IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public catalogId: number;\n\n public selectedProduct: SimpleProduct | undefined;\n\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\n this.productId = productId;\n this.channelId = channelId;\n this.selectedProduct = selectedProduct;\n this.catalogId = catalogId || 0;\n }\n\n public getCacheKey = () => 'AttributesForSelectedVariant';\n\n public getCacheObjectType = () => 'ProductAttributeValue';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport const createAttributesForSelectedVariantInput = (\n inputData: ICreateActionContext>\n): AttributesForSelectedVariantInput => {\n const productId = getSelectedProductIdFromActionInput(inputData);\n const catalogId = getCatalogId(inputData.requestContext);\n\n if (productId) {\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId, undefined, catalogId);\n }\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\n};\n\n/**\n * Calls the Retail API a get a list of dimension values for a given product.\n * @param input - The input.\n * @param context - The context.\n * @returns The attribute values.\n */\nexport async function getAttributesForSelectedVariantAction(\n input: AttributesForSelectedVariantInput,\n context: IActionContext\n): Promise {\n return Promise.resolve()\n .then(() => {\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\n\n if (!activeProduct) {\n const selectedVariantInput = new SelectedVariantInput(\n input.productId,\n input.channelId,\n undefined,\n undefined,\n context.requestContext\n );\n\n return getSelectedVariant(selectedVariantInput, context);\n }\n\n return activeProduct;\n })\n .then((productResult: SimpleProduct | null) => {\n const activeProduct: SimpleProduct | undefined = productResult;\n\n if (activeProduct) {\n return ProductsDataActions.getAttributeValuesAsync(\n {\n callerContext: context\n },\n activeProduct.RecordId,\n input.channelId,\n input.catalogId\n );\n }\n\n return null;\n })\n .then(async (attributeValues: AttributeValue[] | null) => {\n const channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({\n callerContext: context\n });\n\n return { attributeValues, channelInventoryConfiguration };\n })\n .then(result => {\n return getAttributeValuesByConfiguration(result.attributeValues, result.channelInventoryConfiguration);\n })\n .catch((error: Error) => {\n context.trace(error.message);\n throw new Error('[getPriceForSelectedVariantAction]Error executing action');\n });\n}\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\n action: >getAttributesForSelectedVariantAction,\n input: createAttributesForSelectedVariantInput\n});\n","module.exports = React;","module.exports = ReactDOM;"],"names":["modalCloseButtonReference","React","onClickFindInStoreHandler","props","state","callbacks","async","_props$data","data","storeSelectorStateManager","result","cart","productAvailableQuantity","resources","context","modules","selectedProduct","quantity","dataProduct","product","multiplePickupStoreSwitchName","retailMulitplePickupMFeatureState","featureState","find","Name","IsEnabled","missingDimensions","Dimensions","filter","dimension","DimensionValue","Value","storeSelectorId","Object","keys","length","storeSelector","id","updateErrorState","errorHost","configureErrors","getConfigureErrors","openDialog","parentElementRef","deliveryOptions","undefined","onLocationSelected","orgUnitLocation","deliveryMode","_props$context","Promise","resolve","behavior","app","config","addToCartBehavior","addProductToCart","count","location","then","status","substatus","productAvailability","changeModalOpen","ProductAvailableQuantity","ArrayExtensions","hasElements","shippingInventory","shipping","deliveryType","DeliveryMode","pickup","failureResult","failureReason","cartActionResult","otherError","getGenericError","navigationUrl","getUrlSync","actionContext","AddToCartBehavior","goToCart","window","assign","showModal","showNotification","_props$data$productPr2","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","telemetryContent","getTelemetryObject","request","telemetryPageName","friendlyName","telemetry","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","closeNotificationLabel","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","addedQuantityText","notification","ItemSuccessfullyAddedToCartNotification","gridSettings","productPrice","typeName","NotificationsManager","instance","addNotification","catch","error","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","channel","PickupDeliveryModeCode","price","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","PriceComponent","popupProps","className","imageSettings","productQuantity","setModalOpen","renderModalPopup","Popup","ContainerProps","openFindInStoreDialog","heading","Heading","headingTag","text","productPickupOptionList","item","Description","key","errors","BuyboxErrorBlock","showError","button","onClick","color","ref","disabled","modal","Buybox","constructor","super","dimensionUpdateQueue","FinitePromiseQueue","dimensions","buyboxCallbacks","updateQuantity","newQuantity","_objectSpread","this","setState","newErrorState","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productDeliveryOptions","_updatePrice","dimensionSelectedAsync","selectedDimensionId","selectedDimensionValueId","enqueue","_updateDimensions","FinitePromiseQueueError","ProcessWasDiscardedFromTheQueue","getDropdownName","dimensionType","_getDropdownName","isModalOpen","changeUpdatingDimension","isUpdatingDimension","changeUpdatingDeliveryOptions","isUpdatingDeliveryOptions","updateKeyInPrice","customPrice","customAmountError","isPriceKeyedIn","keyInPriceAmount","_onBulkPurchaseLinkClick","bulkPurchaseModule","boundingRect","getBoundingClientRect","scrollTo","left","top","apiSettings","channelId","productDimensions","hasProductDimensions","dimensionsToUpdate","clearErrorState","variantProduct","_updateProductDimensionsWithAvailabilities","_variantProduct$Dimen","_this$props$data$feat","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","RecordId","newShippingQuantity","DimensionTypeValue","toLowerCase","isCustomPriceSelected","getPriceForSelectedVariant","PriceForSelectedVariantInput","retailMultiplePickupFeatureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","_updateQuantitiesInState","_this$props$data$prod","isGiftCard","IsGiftCard","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","isAmazonPay","_getAttributeByName","productSpecificationData","getAttributeByName","amazonBuyAttrKeyName","TextValue","renderAmazonBuy","_getAttributeByName2","amazonBuyAttrBasedURL","Button","href","target","title","amazonBuyBtnText","amazonBuyBtnTitleValue","amazonBuyBtnTextValue","min","max","ItemTypeValue","ReleasedProductType","Service","isServiceItem","render","_this$props$data$prod2","mediaGallery","inventoryLevel","dimensionValuesWithInventory","flatten","validValues","value","hasAvailableProducts","some","getInventoryLevelCodeFromDimensionValue","InventoryLevelValues","outOfStock","viewProps","ModuleProps","moduleProps","classnames","ProductInfoContainerProps","MediaGalleryContainerProps","getBuyboxProductTitle","getBuyboxProductDescription","bulkPurchaseLink","_renderBuyboxBulkPurchaseLink","unitOfMeasure","getBuyboxProductUnitOfMeasure","configure","getBuyboxProductConfigure","findInStore","getBuyboxProductPrice","addToCart","getBuyboxAddToCart","addToOrderTemplate","getBuyboxProductAddToOrderTemplate","addToWishlist","getBuyboxProductAddToWishlist","rating","hideRating","getBuyboxProductRating","getBuyboxProductQuantity","inventoryLabel","getBuyBoxInventoryLabel","shopSimilarLook","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","Looks","shopSimilarDescription","enableShopSimilarDescription","keyInPrice","enableKeyInPrice","getBuyboxKeyInPrice","quantityLimitsMessages","getQuantityLimitsMessages","renderAmazonPay","renderView","isBulkPurchaseEnabled","msdyn365Commerce","isBrowser","bulkPurchaseModules","Array","from","document","getElementsByClassName","BulkPurchase","bulkPurchaseLinkText","arguments","CustomerContextualPrice","mappedDimensions","_ref","_dimension$dimensionV","_dimensions$find$Dime","_dimensions$find","DimensionValues","_value$DimensionValue","toString","ExtensionProperties","setDimensionValuesToQuery","requestContext","url","requestUrl","selectedProductPromise","getSelectedVariant","SelectedVariantInput","MasterProductId","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","_product$Behavior","_product$Behavior2","_product$Behavior3","_product$Behavior4","_isOrderQuantityLimitsFeatureEnabled","Behavior","MinimumQuantity","MaximumQuantity","maxQuantityForCartLineItem","_this$props$context","_featureStatuses$find","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","featureStatuses","RetailDefaultOrderQuantityLimitsFeatureName","customerInfo","customerInformation","information","IsB2b","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","AddToOrderTemplateComponent","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","onError","shouldShowButtonFailedTooltip","showButtonTooltip","showButtonText","Node","errorBlock","onAddToWishlistFailed","renderAddToWishlist","wishlistButton","renderAddtoWishlistButton","wishlists","AddToWishlistComponent","addToWishlistButtonText","removeFromWishlistButtonText","addToWishlistMessage","removedFromWishlistMessage","addItemToWishlistError","removeItemFromWishlistError","nameOfWishlist","ariaRole","getSelectedProduct","renderShopSimilarItem","shopSimilarItem","input","renderConfigureDropdown","dropdown","LabelContainerProps","select","_props$data$product$r","_props$data$storeSele","_props$data$product$r3","appConfig","aboutThisProductAttrKeyName","skuText","ItemId","preferredStoreInfo","preferredStore","preferredStoreId","StoreId","preferredStoreName","StoreName","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","format","availabilityAtPreferredStoreText","displayStockAvailability","reaction","_props$data$storeSele2","selectedStoreLocationId","aboutThisProductValue","Module","priceText","dropdowns","renderConfigure","renderKeyInPrice","renderQuantity","quantityComponent","extentionResources","IncrementalQuantity","currentCount","onChange","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","minQuantityText","maxQuantityText","renderAvailabilityAtPreferredStore","_props$data$product$r4","_props$data$product$r5","tag","renderAddToCart","renderFindInStore","socialShare","_renderSocialShare","descriptionText","dangerouslySetInnerHTML","__html","aboutThisProductTitle","aboutProductText","binding","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","BaseStoreSelectorStateManager","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","isMapModuleLoaded","_readFromToCookie","storeInfo","JSON","parse","_unused","_context","storeId","storeName","writeToCookie","Latitude","Longitude","_writeToCookie","stringify","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","MsDyn365","localStorage","removeItem","setItem","cookieValue","getItem","__decorate","computed","observable","action","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","trim","query","encodeURI","geolocationApiUrl","script","createElement","setAttribute","remove","resourceSets","point","coordinates","body","appendChild","_document","StringExtensions","isNullOrEmpty","getElementById","currentWindowAPI","mapAPIReady","isMapApiLoaded","lang","market","reject","_document2","_document3","type","defer","src","addEventListener","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","createObservableDataAction","getGenericAction","inputData","AttributesForSelectedVariantInput","productId","catalogId","getCacheKey","getCacheObjectType","dataCacheType","createAttributesForSelectedVariantInput","getSelectedProductIdFromActionInput","getCatalogId","getAttributesForSelectedVariantAction","activeProduct","selectedVariantInput","productResult","ProductsDataActions","callerContext","attributeValues","channelInventoryConfiguration","StoreOperationsDataActions","getAttributeValuesByConfiguration","trace","module","exports","ReactDOM"],"sourceRoot":""}