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ypB,aAAa9uB,SAAW,IAC/BwtB,EAAQxtB,SAGXqF,OAAOypB,aAAarB,YAAWxe,EAAAA,EAAA,GAC5B5J,OAAOypB,aAAarB,aAAe,IACnCD,EAAQC,aAEY,MAAMsB,EAAiB,GAC9BA,EAAe,qDAAuD,CAC9Ed,EAAGA,IAAMC,EAAQ,MACjBc,GAAI,kCAEpBD,EAAe,6DAA+D,CAC9Dd,EAAGA,IAAMC,EAAQ,MACjBc,GAAI,kCAEpB3pB,OAAOypB,aAAezpB,OAAOypB,cAAgB,GAC7CzpB,OAAOypB,aAAaC,eAAc9f,EAAAA,EAAA,GACP5J,OAAOypB,aAAaC,gBAAkB,IACtCA,UCvM3BE,EAAOC,QAAUhwB,cCAjB+vB,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online.Memx/./src/modules/mmx-buybox/components/mmx-buybox-find-in-store.tsx?d711","webpack://Msdyn365.Commerce.Online.Memx/./src/modules/mmx-buybox/mmx-buybox.tsx?514e","webpack://Msdyn365.Commerce.Online.Memx/./src/modules/mmx-buybox/mmx-buybox.view.tsx?e89e","webpack://Msdyn365.Commerce.Online.Memx/./src/themes/memoryexpress/views/components/mmx-buybox-add-to-order-template.tsx?b9df","webpack://Msdyn365.Commerce.Online.Memx/./src/themes/memoryexpress/views/mmx-buybox.view.tsx?b010","webpack://Msdyn365.Commerce.Online.Memx/./src/utilities/warranty/utils.ts?03a2","webpack://Msdyn365.Commerce.Online.Memx/./lib/mmx-buybox/module-registration.js?7680","webpack://Msdyn365.Commerce.Online.Memx/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online.Memx/external var \"ReactDOM\"?853b"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\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\n//mmx-feature: imports --start\r\n/*\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport { DeliveryOption, FeatureState, OrgUnitLocation, ProductAvailableQuantity, ProductDimension } from '@msdyn365-commerce/retail-proxy';\r\n*/\r\nimport { Cart, DeliveryOption, FeatureState, OrgUnitLocation, ProductAvailableQuantity, ProductDimension } from '@msdyn365-commerce/retail-proxy';\r\nimport { ICartActionResult, getCartState, ICartState } from '@msdyn365-commerce/global-state';\r\n//mmx-feature: imports --end\r\nimport { NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport {\r\n //mmx-feature: imports --start\r\n getOrgUnitLocationsByArea,\r\n GetOrgUnitLocationsByAreaInput,\r\n //mmx-feature: imports --end\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\n// mmx-feature: default configuration --begin\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 { IBuyboxData } from '../buybox.data';\r\nimport { IBuyboxProps, IBuyboxResources } from '../buybox.props.autogenerated';\r\n*/\r\nimport { BuyboxErrorBlock } from '../common/buybox-components';\r\nimport { IBuyboxCallbacks, IBuyboxState } from '../common/buyboxInterface';\r\nimport { getConfigureErrors, getGenericError } from '../common/utilities/error-utilities';\r\nimport { IMmxBuyboxData } from '../mmx-buybox.data';\r\nimport { IMmxBuyboxProps, IMmxBuyboxResources } from '../mmx-buybox.props.autogenerated';\r\n// mmx-feature default configuration --end\r\n\r\nconst modalCloseButtonReference: React.RefObject = React.createRef();\r\n\r\n// mmx-feature: addtocart override imports --begin\r\n//import { IItemsAddedToCartResources, ItemsAddedToCartDialogComponent, MultiItemsSuccessfullyAddedToCartNotification, OrderDetailsProduct } from '@msdyn365-commerce/components';\r\nimport { CartLine } from '@msdyn365-commerce/retail-proxy/';\r\nimport { updateWarrantySelectionsAsync } from '../../../actions/DataActionExtension.g';\r\nimport productWarrantyStateAction, { ProductWarrantyStateInput } from '../../../actions/state-data-actions/product-warranty-state.action';\r\nimport { IWarrantyOption } from '../../../actions/DataServiceEntities.g';\r\nimport { getSelectedProductIdFromActionInput } from '../../../utilities/utils';\r\n// @ts-ignore\r\nimport { MapStoreSelectorStateManager } from '../../../../modules/mmx-store-selector/state-manager/map-store-selector-state-manager';\r\n// mmx-feature: addtocart override imports --end\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 = (props: IMmxBuyboxProps, state: IBuyboxState, callbacks: IBuyboxCallbacks) => 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: IMmxBuyboxResources,\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: IMmxBuyboxProps,\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 //mmx-feature: atc dialog --start\r\n /*\r\n className: 'ms-buybox',\r\n */\r\n className: 'msc-add-to-cart',\r\n //mmx-feature: atc dialog --end\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: IMmxBuyboxProps, 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 //mmx-feature: single location check --start\r\n /*\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 */\r\n const onLocationSelected = async (orgUnitLocation: OrgUnitLocation, deliveryMode: string) => {\r\n //mmx-feature: --end\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 // mmx-feature: store selector --begin\r\n const cartState = await getCartState(props.context.actionContext);\r\n\r\n // creates a state clone of the cart state that will NOT be updated\r\n const staticCartLines = Object.assign(cartState.cart.CartLines ?? []);\r\n // mmx-feature: store selector --end\r\n\r\n return cart\r\n .addProductToCart({ product, count: quantity, location: orgUnitLocation, deliveryMode })\r\n //mmx-feature: store selector --start\r\n /*\r\n .then((result: ICartActionResult) => {\r\n */\r\n .then(async (result: ICartActionResult) => {\r\n //mmx-feature: store selector --end\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\r\n // mmx-feature: store selector --begin\r\n const newCartState: ICartState = await getCartState(props.context.actionContext);\r\n\r\n if (newCartState.cart.CartLines) {\r\n const productId = getSelectedProductIdFromActionInput(props.context.actionContext);\r\n if (productId) {\r\n let selectedWarrantyOption: IWarrantyOption = await productWarrantyStateAction(\r\n new ProductWarrantyStateInput(+productId),\r\n props.context.actionContext\r\n );\r\n if (selectedWarrantyOption && selectedWarrantyOption.Period && selectedWarrantyOption.Period > 0) {\r\n const newCartLine = getNewCartLine(newCartState.cart.CartLines, staticCartLines, selectedWarrantyOption.WarrantableProduct);\r\n\r\n await updateWarrantySelectionsAsync({ callerContext: props.context.actionContext }, cartState.cart, [\r\n { WarrantableCartLine: newCartLine, Option: selectedWarrantyOption }\r\n ]).then((cart: Cart) => {\r\n newCartState.refreshCart({});\r\n });\r\n }\r\n }\r\n }\r\n // mmx-feature: store selector --end\r\n\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 //mmx-feature: single location --start\r\n };\r\n const locations = await getOrgUnitLocationsByArea(\r\n new GetOrgUnitLocationsByAreaInput(undefined, undefined, 0, 0, true),\r\n props.context.actionContext\r\n );\r\n if (locations && locations.length) {\r\n if (locations.length > 1) {\r\n await storeSelectorStateManager.openDialog({\r\n product,\r\n id: storeSelectorId,\r\n parentElementRef: modalCloseButtonReference,\r\n deliveryOptions: retailMulitplePickupMFeatureState ? props.data.deliveryOptions.result : undefined,\r\n onLocationSelected: onLocationSelected\r\n //mmx-feature: single location --end\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 //mmx-feature: single location --start\r\n } else {\r\n if (locations[0].OrgUnitAvailability?.OrgUnitLocation) {\r\n const deliveryOptions = retailMulitplePickupMFeatureState ? props.data.deliveryOptions.result : undefined;\r\n const defaultDeliveryOption = deliveryOptions?.DeliveryOptions ? deliveryOptions.DeliveryOptions[0].Code : undefined;\r\n if (defaultDeliveryOption) {\r\n onLocationSelected(locations[0].OrgUnitAvailability.OrgUnitLocation, defaultDeliveryOption);\r\n return Promise.resolve(undefined);\r\n } else {\r\n return Promise.reject('Could not find value delivery options');\r\n }\r\n } else {\r\n return Promise.reject('No valid org unit availability object');\r\n }\r\n }\r\n } else {\r\n return Promise.reject('No location found');\r\n }\r\n cart;\r\n productAvailableQuantity;\r\n //mmx-feature: single location --end\r\n }\r\n\r\n // mmx-feature: store selector --begin\r\n const getNewCartLine = (newCartLines: CartLine[], oldCartLines: CartLine[], productId?: number): CartLine | undefined => {\r\n let newCartLine;\r\n newCartLines.map(newcl => {\r\n var newclIsUnique = true;\r\n oldCartLines.map((scl: CartLine) => {\r\n if (scl.LineId === newcl.LineId) {\r\n //check to see if the productids match\r\n newclIsUnique = false;\r\n }\r\n });\r\n if (newclIsUnique) {\r\n if (!productId || newcl.ProductId === productId) {\r\n newCartLine = newcl;\r\n //exits the map function, NOT the getNewCartLine function\r\n return;\r\n }\r\n }\r\n });\r\n //this one is the one that returns from getNewCartLine\r\n return newCartLine;\r\n };\r\n // mmx-feature: store selector --end\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getCatalogId, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\r\nimport {\r\n // mmx-feature: default configuration --begin\r\n AsyncResult,\r\n // mmx-feature: default configuration --end\r\n CommerceProperty,\r\n ProductCatalog,\r\n ProductDeliveryOptions,\r\n ProductDimensionValue,\r\n ProductDimensionValueInventoryAvailability,\r\n ProductPrice,\r\n ReleasedProductType,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { BulkPurchase } from '@msdyn365-commerce-modules/bulk-purchase';\r\nimport {\r\n // mmx-feature: default configuration --begin\r\n ISelectedProduct,\r\n // mmx-feature: default configuration --end\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 validateCatalogId\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getTelemetryObject,\r\n IModuleProps,\r\n INodeProps,\r\n ITelemetryContent,\r\n updateMaxQuantityForCartLineItem\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n getBuyboxAddToCart,\r\n getBuyBoxInventoryLabel,\r\n getBuyboxKeyInPrice,\r\n getBuyboxProductAddToOrderTemplate,\r\n getBuyboxProductAddToWishlist,\r\n getBuyboxProductComparisonButton,\r\n getBuyboxProductDescription,\r\n getBuyboxProductPrice,\r\n getBuyboxProductQuantity,\r\n getBuyboxProductRating,\r\n getBuyboxProductTitle,\r\n getBuyboxProductUnitOfMeasure,\r\n getBuyboxShopSimilarButton,\r\n getQuantityLimitsMessages,\r\n RetailDefaultOrderQuantityLimitsFeatureName,\r\n EcommerceQuantityLimitConfigurationsFeatureName,\r\n RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName\r\n // mmx-feature: default configuration --begin\r\n/*\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { getBuyboxProductConfigure } from '@msdyn365-commerce-modules/buybox';\r\n*/\r\n} from './common/buybox-components';\r\nimport { getBuyboxProductConfigure } from './common/buybox-product-configure';\r\n// mmx-feature: default configuration --end\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// mmx-feature: default configuration --begin\r\n/*\r\n} from '@msdyn365-commerce-modules/buybox';\r\n*/\r\n} from './common/buyboxInterface';\r\nimport { IMmxBuyboxData } from './mmx-buybox.data';\r\nimport { IMmxBuyboxProps, IMmxBuyboxResources } from './mmx-buybox.props.autogenerated';\r\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/mmx-buybox-find-in-store';\r\nimport { RecentlyViewedState } from '@msdyn365-commerce-modules/buybox';\r\nimport { IProductDefaultVariant } from '../../actions/DataServiceEntities.g';\r\nimport { getByIdAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n// mmx-feature: default configuration --end\r\n\r\nexport interface IBuyboxViewProps extends IMmxBuyboxProps {\r\n state: IBuyboxState;\r\n ModuleProps: IModuleProps;\r\n ProductInfoContainerProps: INodeProps;\r\n MediaGalleryContainerProps: INodeProps;\r\n callbacks: IBuyboxCallbacks;\r\n mediaGallery?: React.ReactNode;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n rating?: React.ReactNode;\r\n price?: React.ReactNode;\r\n productComparisonButton?: React.ReactNode;\r\n bulkPurchaseLink?: React.ReactNode;\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\r\n addToWishlist?: IBuyboxAddToWishlistViewProps;\r\n min?: number | undefined;\r\n max: number | undefined;\r\n addToCart: IBuyboxAddToCartViewProps;\r\n findInStore?: IBuyboxFindInStoreViewProps;\r\n quantity?: IBuyboxProductQuantityViewProps;\r\n configure?: IBuyboxProductConfigureViewProps;\r\n inventoryLabel?: React.ReactNode;\r\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\r\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\r\n quantityLimitsMessages: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n keyInPrice?: IBuyboxKeyInPriceViewProps;\r\n unitOfMeasure?: React.ReactNode;\r\n catalogs?: ProductCatalog[] | undefined;\r\n isChannelMultipleCatalogsFeatureEnabled?: boolean;\r\n currentCatalogId?: number;\r\n applyDefaultOrderSettings?: boolean;\r\n}\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 //mmx-feature --start\r\n /*\r\n private initializedDimensions: Set = new Set();\r\n */\r\n //mmx-feature --end\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 //mmx-feature --start\r\n /*\r\n initializeDimension: (initializedDimension: string): void => {\r\n if (initializedDimension) {\r\n this.initializedDimensions.add(initializedDimension);\r\n }\r\n },\r\n */\r\n //mmx-feature --end\r\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\r\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\r\n //mmx-feature --start\r\n /*\r\n // Only trigger _updateDimensions when all dimensions are initialized\r\n if (this.initializedDimensions.size === (this.props.data.product.result?.Dimensions?.length || 0)) {\r\n */\r\n //mmx-feature --end\r\n return this.dimensionUpdateQueue\r\n .enqueue(async () => {\r\n return this._updateDimensions();\r\n })\r\n .catch((error: unknown) => {\r\n // Ignore discarded processes.\r\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\r\n throw error;\r\n }\r\n });\r\n //mmx-feature --start\r\n /*\r\n }\r\n */\r\n //mmx-feature --end\r\n },\r\n getDropdownName: (dimensionType: number, resources: IMmxBuyboxResources): string => {\r\n return this._getDropdownName(dimensionType, resources);\r\n },\r\n changeModalOpen: (isModalOpen: boolean): void => {\r\n this.setState({ modalOpen: isModalOpen });\r\n },\r\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\r\n this.setState({ isUpdatingDimension });\r\n },\r\n\r\n /**\r\n * Update isUpdatingDeliveryOptions state.\r\n *\r\n * @param isUpdatingDeliveryOptions - The status of updating delivery options.\r\n */\r\n changeUpdatingDeliveryOptions: (isUpdatingDeliveryOptions: boolean): void => {\r\n this.setState({ isUpdatingDeliveryOptions });\r\n },\r\n\r\n updateKeyInPrice: (customPrice: number): void => {\r\n // Remove custom amount error when updating the custom price\r\n const errorState = { ...this.state.errorState };\r\n errorState.customAmountError = undefined;\r\n\r\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState });\r\n this._updatePrice(this.state.productPrice, customPrice);\r\n }\r\n };\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n public constructor(props: IMmxBuyboxProps, 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 isPriceApiCalled: 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 // mmx-feature: default configuration --begin\r\n productDimensions: { result: productDimensions },\r\n productDefaultVariant,\r\n // mmx-feature: default configuration --end\r\n product: { result: product },\r\n productPrice\r\n },\r\n context\r\n } = this.props;\r\n\r\n // There are multiple sources triggering the callback function dimensionSelectedAsync calling the GetActivePrice api before componentDidMount and after componentDidMount.\r\n // Set isPriceApiCalled to false here to prevent redundant API call after componentDidMount:\r\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\r\n // We will skip calling RS API in this case as the price data has already been fetched via module data action in node server.\r\n this.setState({ isPriceApiCalled: false });\r\n\r\n // mmx-feature: default configuration --begin\r\n await this.props.data.productDefaultVariant;\r\n // @ts-ignore\r\n const defaultVariant: IProductDefaultVariant = await productDefaultVariant[0];\r\n\r\n if (defaultVariant) {\r\n if (defaultVariant.DimensionId) {\r\n if (productDimensions) {\r\n const productDimValue: ProductDimensionValue | undefined = productDimensions[0].DimensionValues?.find(\r\n (dim: any) => dim.DimensionId === defaultVariant.DimensionId\r\n );\r\n if (productDimValue && productDimValue.RecordId) {\r\n await this.buyboxCallbacks.dimensionSelectedAsync(2, productDimValue.RecordId.toString());\r\n }\r\n }\r\n }\r\n var newProduct;\r\n newProduct = new Promise(async (resolve, reject) => {\r\n const selectedVariant = await getSelectedVariant(\r\n new SelectedVariantInput(defaultVariant.DefaultProductId, this.props.context.request.apiSettings.channelId),\r\n this.props.context.actionContext\r\n );\r\n resolve(selectedVariant);\r\n });\r\n this.setState({\r\n selectedProduct: newProduct\r\n });\r\n }\r\n // mmx-feature: default configuration --end\r\n\r\n productPrice.then(async result => {\r\n this._updatePrice(result);\r\n });\r\n\r\n if (product) {\r\n // Check if the product is service or not by product type\r\n if (product.ItemTypeValue === ReleasedProductType.Service) {\r\n this.setState({ isServiceItem: true });\r\n }\r\n await this._updateQuantitiesInState(product);\r\n }\r\n\r\n if (product && context.app.config.maxRecentlyViewedItemsCount > 0) {\r\n RecentlyViewedState.instance(this.props.context, context.app.config.maxRecentlyViewedItemsCount, product.RecordId);\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n slots: { mediaGallery, productComparisonButton },\r\n data: {\r\n product: { result: product }\r\n },\r\n config: { className = '' }\r\n } = this.props;\r\n\r\n const { min, max } = this.state;\r\n\r\n if (!product) {\r\n this.props.context.telemetry.error('Product content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const props = this.props as IBuyboxExtentedProps;\r\n const defaultMinimumKeyInPrice = 10;\r\n const defaultMaximumKeyInPrice = 100;\r\n\r\n const context = this.props.context as ICoreContext;\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n const dimensionValuesWithInventory = ArrayExtensions.flatten(\r\n ArrayExtensions.validValues(this.props.data.productDimensions.result?.map(value => value.dimensionValuesWithInventory))\r\n );\r\n const applyDefaultOrderSettings =\r\n (this.props.data.featureState?.result?.find(featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName)\r\n ?.IsEnabled ??\r\n false) &&\r\n (this.props.data.cartConfiguration?.result?.ValidateDefaultOrderSettingsPerLine ?? false);\r\n const hasAvailableProducts =\r\n !ArrayExtensions.hasElements(dimensionValuesWithInventory) ||\r\n dimensionValuesWithInventory.some((value: unknown) => {\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(\r\n value as ProductDimensionValueInventoryAvailability,\r\n inventoryLevel\r\n );\r\n return inventoryLevelCode !== InventoryLevelValues.outOfStock;\r\n });\r\n const catalogId = getCatalogId(this.props.context.request);\r\n validateCatalogId(catalogId);\r\n\r\n const viewProps: IBuyboxViewProps = {\r\n ...(this.props as IMmxBuyboxProps),\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 productComparisonButton: ArrayExtensions.hasElements(productComparisonButton)\r\n ? getBuyboxProductComparisonButton(\r\n productComparisonButton[0],\r\n product,\r\n getCatalogId(this.props.context.request),\r\n this.state\r\n )\r\n : undefined,\r\n addToOrderTemplate: getBuyboxProductAddToOrderTemplate(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n this._isChannelMultipleCatalogsFeatureEnabled(),\r\n catalogId\r\n ),\r\n addToWishlist: getBuyboxProductAddToWishlist(props, this.state, this.buyboxCallbacks),\r\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\r\n quantity: product.IsGiftCard ? undefined : getBuyboxProductQuantity(props, this.state, this.buyboxCallbacks),\r\n inventoryLabel: getBuyBoxInventoryLabel(props),\r\n shopSimilarLook:\r\n this.props.config.enableShopSimilarLooks && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Looks)\r\n : undefined,\r\n shopSimilarDescription:\r\n this.props.config.enableShopSimilarDescription && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description)\r\n : undefined,\r\n keyInPrice:\r\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\r\n ? getBuyboxKeyInPrice(props, this.state, this.buyboxCallbacks)\r\n : undefined,\r\n quantityLimitsMessages: getQuantityLimitsMessages(props, this.state),\r\n min: applyDefaultOrderSettings ? min : 1,\r\n max,\r\n applyDefaultOrderSettings: applyDefaultOrderSettings,\r\n isChannelMultipleCatalogsFeatureEnabled: this._isChannelMultipleCatalogsFeatureEnabled(),\r\n currentCatalogId: catalogId,\r\n catalogs: this._validateCatalogDetails(catalogId)\r\n };\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 const scrollX = boundingRect.left + window.pageXOffset;\r\n const scrollY = boundingRect.top + window.pageYOffset;\r\n\r\n window.scrollTo(scrollX, scrollY);\r\n };\r\n private readonly _isChannelMultipleCatalogsFeatureEnabled = (): boolean => {\r\n let isMultipleCatalogFeatureEnabledInHq = false;\r\n if (this.props.data.featureState) {\r\n isMultipleCatalogFeatureEnabledInHq =\r\n this.props.data.featureState.result?.find(\r\n feature => feature.Name === 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature'\r\n )?.IsEnabled || false;\r\n }\r\n return isMultipleCatalogFeatureEnabledInHq;\r\n };\r\n\r\n private _renderBuyboxBulkPurchaseLink(): React.ReactNode {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Temporary switch for the feature which is under development.\r\n if (!this.props.context.app.config.isBulkPurchaseEnabled) {\r\n return null;\r\n }\r\n\r\n if (!msdyn365Commerce.isBrowser) {\r\n return null;\r\n }\r\n\r\n const bulkPurchaseModules = Array.from(document.getElementsByClassName(BulkPurchase.className));\r\n\r\n if (!ArrayExtensions.hasElements(bulkPurchaseModules)) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {this.props.resources.bulkPurchaseLinkText}\r\n \r\n );\r\n }\r\n\r\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\r\n if (this.state.isCustomPriceSelected && newPrice) {\r\n newPrice.CustomerContextualPrice = customPrice;\r\n }\r\n this.setState({ productPrice: newPrice });\r\n }\r\n\r\n // mmx-feature: product warranty (added data) --begin\r\n /*\r\n private _getProductVariant(dimensionsToUpdate: { [id: number]: string }) {\r\n */\r\n private async _getProductVariant(defaultVariant: IProductDefaultVariant, dimensionsToUpdate: { [id: number]: string }) {\r\n // mmx-feature: product warranty (added data) --end\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 // mmx-feature: default product variant --begin\r\n /*\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 */\r\n let selectedProductPromise: AsyncResult;\r\n if (defaultVariant.DefaultProductId) {\r\n const defaultProduct = await getByIdAsync({ callerContext: actionContext }, defaultVariant.DefaultProductId, channelId);\r\n selectedProductPromise = getSelectedVariant(\r\n new SelectedVariantInput(\r\n defaultProduct.MasterProductId ?? defaultProduct.RecordId,\r\n channelId,\r\n mappedDimensions\r\n ),\r\n actionContext\r\n );\r\n } else {\r\n selectedProductPromise = getSelectedVariant(\r\n new SelectedVariantInput(\r\n product!.MasterProductId ?? product!.RecordId,\r\n channelId,\r\n mappedDimensions\r\n ),\r\n actionContext\r\n );\r\n }\r\n // mmx-feature: default product variant --end\r\n this.setState({ selectedProduct: selectedProductPromise });\r\n\r\n return { productVariantPromise: selectedProductPromise, mappedDimensions };\r\n }\r\n\r\n private readonly _updateDimensions = async (): Promise => {\r\n const product = this.props.data.product.result;\r\n\r\n //mmx-feature: product default variant --begin\r\n const {\r\n data: { productDefaultVariant }\r\n } = this.props;\r\n //mmx-feature: product default variant --end\r\n\r\n const productDimensions = this.props.data.productDimensions.result;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensions);\r\n\r\n if (!product || !hasProductDimensions) {\r\n return;\r\n }\r\n\r\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\r\n\r\n this.setState({ isUpdatingDimension: true, isUpdatingDeliveryOptions: true });\r\n\r\n // Step 1: Clear error state to display relevant errors\r\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\r\n const clearErrorState = { ...this.state.errorState };\r\n clearErrorState.otherError = undefined;\r\n if (this.state.errorState.errorHost === 'ADDTOCART') {\r\n clearErrorState.quantityError = undefined;\r\n clearErrorState.errorHost = undefined;\r\n }\r\n this.setState({ errorState: clearErrorState });\r\n }\r\n\r\n // Step 2: Clear any errors indicating the dimension wasn't selected\r\n for (const key of Object.keys(dimensionsToUpdate)) {\r\n if (this.state.errorState.configureErrors[key]) {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.configureErrors[key] = undefined;\r\n return { errorState };\r\n });\r\n }\r\n }\r\n\r\n // mmx-feature: default product configuration --begin\r\n /*\r\n const data = this._getProductVariant(dimensionsToUpdate);\r\n */\r\n // @ts-ignore\r\n const defaultVariant: IProductDefaultVariant = await productDefaultVariant[0];\r\n\r\n if (!defaultVariant) {\r\n return;\r\n }\r\n\r\n const data = await this._getProductVariant(defaultVariant, dimensionsToUpdate);\r\n // mmx-feature: default product configuration --end\r\n const productVariant: SimpleProduct | null = await data.productVariantPromise;\r\n\r\n if (!productVariant) {\r\n return;\r\n }\r\n\r\n const promises: Promise[] = [\r\n // mmx-feature: default product configuration --begin\r\n /*\r\n this._getDimensionsForSelectedVariant(productVariant, data.mappedDimensions),\r\n */\r\n this._getDimensionsForSelectedVariant(productVariant, defaultVariant, data.mappedDimensions),\r\n // mmx-feature: default product configuration --end\r\n this._hydrateInventoryInfo(productVariant),\r\n this._hydratePrice(productVariant),\r\n this._hydrateDeliveryOptions(productVariant),\r\n this._updateQuantitiesInState(productVariant)\r\n ];\r\n\r\n await Promise.all(promises);\r\n };\r\n\r\n private async _getDimensionsForSelectedVariant(\r\n productVariant: SimpleProduct,\r\n // mmx-feature: default product configuration --begin\r\n defaultVariant: IProductDefaultVariant,\r\n // mmx-feature: default product configuration --end\r\n mappedDimensions: {\r\n /* eslint-disable @typescript-eslint/naming-convention -- Retail proxy values */\r\n DimensionTypeValue: number;\r\n DimensionValue: ProductDimensionValue | undefined;\r\n ExtensionProperties: CommerceProperty[] | undefined;\r\n /* eslint-enable @typescript-eslint/naming-convention -- Retail proxy values */\r\n }[]\r\n ): Promise {\r\n await getDimensionsForSelectedVariant(\r\n new GetDimensionsForSelectedVariantInput(\r\n // mmx-feature: default product configuration --begin\r\n /*\r\n productVariant.MasterProductId ? productVariant.MasterProductId : productVariant.RecordId,\r\n */\r\n defaultVariant.DefaultProductId ?? productVariant.MasterProductId ?? productVariant.RecordId,\r\n // mmx-feature: default product configuration --end\r\n this.props.context.request.apiSettings.channelId,\r\n mappedDimensions,\r\n this.props.context.request\r\n ),\r\n this.props.context.actionContext\r\n );\r\n }\r\n\r\n private async _hydrateInventoryInfo(productVariant: SimpleProduct): Promise {\r\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\r\n new ProductAvailabilitiesForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n productVariant\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n const newShippingQuantity = newAvailableQuantity?.find(\r\n // @ts-expect-error\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (shipping: { deliveryType: any }) => shipping.deliveryType === DeliveryMode.shipping\r\n );\r\n const isCustomPriceSelected = productVariant.Dimensions?.find(\r\n dimension =>\r\n dimension.DimensionTypeValue === 4 && dimension.DimensionValue && dimension.DimensionValue.Value?.toLowerCase() === 'custom'\r\n );\r\n if (isCustomPriceSelected) {\r\n this.setState({ isCustomPriceSelected: true });\r\n } else {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.customAmountError = undefined;\r\n return { isCustomPriceSelected: false, isPriceKeyedIn: false, errorState };\r\n });\r\n }\r\n\r\n if (newShippingQuantity) {\r\n this.setState({ productAvailableQuantity: newShippingQuantity });\r\n } else {\r\n this.setState({ productAvailableQuantity: undefined });\r\n }\r\n }\r\n\r\n private async _hydratePrice(productVariant: SimpleProduct): Promise {\r\n // This function is invoked when dimensionSelectedAsync get called.\r\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\r\n // We will skip calling RS API in this case as the price data has already been fetched via module data action in node server.\r\n if (!this.state.isPriceApiCalled) {\r\n this.setState({ isPriceApiCalled: true });\r\n return;\r\n }\r\n\r\n // Step 6. Use these dimensions hydrate the product price.\r\n const newPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId, productVariant),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newPrice) {\r\n this._updatePrice(newPrice);\r\n }\r\n }\r\n\r\n private async _hydrateDeliveryOptions(productVariant: SimpleProduct): Promise {\r\n const retailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\r\n //mmx-feature: error fix --start\r\n /*\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\r\n */\r\n (featureState: any) => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\r\n //mmx-feature: error fix --end\r\n );\r\n\r\n // Step 7. Use these dimensions hydrate the product delivery options.\r\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\r\n new GetDeliveryOptionsForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n productVariant,\r\n undefined,\r\n retailMultiplePickupFeatureState?.IsEnabled\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newDeliveryOptions) {\r\n this.setState({ productDeliveryOptions: newDeliveryOptions });\r\n }\r\n }\r\n\r\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\r\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\r\n const isChannelLimitsFeatureEnabled = await this._isChannelLimitsFeatureEnabled();\r\n\r\n const min: number = this._getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled, product);\r\n const max: number = this._getMaxQuantityForCartLineItem(\r\n isChannelLimitsFeatureEnabled || isOrderQuantityLimitsFeatureEnabled,\r\n product\r\n );\r\n let quantity: number = this._getQuantity(product, isOrderQuantityLimitsFeatureEnabled);\r\n quantity = Math.max(quantity, min);\r\n\r\n this.setState({\r\n min,\r\n max,\r\n quantity\r\n });\r\n }\r\n\r\n private _getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\r\n if (isOrderQuantityLimitsFeatureEnabled && product?.Behavior?.MinimumQuantity && product.Behavior.MinimumQuantity > 0) {\r\n return product.Behavior.MinimumQuantity;\r\n }\r\n\r\n return 1;\r\n }\r\n\r\n private _getMaxQuantityForCartLineItem(isQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\r\n if (isQuantityLimitsFeatureEnabled && product?.Behavior?.MaximumQuantity && product.Behavior.MaximumQuantity > 0) {\r\n return product.Behavior.MaximumQuantity;\r\n }\r\n\r\n return updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem);\r\n }\r\n\r\n private _getQuantity(product: SimpleProduct, isOrderQuantityLimitsFeatureEnabled: boolean): number {\r\n const { quantity } = this.state;\r\n let defaultQuantity = 1;\r\n\r\n if (quantity !== defaultQuantity || !isOrderQuantityLimitsFeatureEnabled) {\r\n return quantity;\r\n }\r\n\r\n const cartConfiguration = this.props.data.cartConfiguration;\r\n const applyDefaultOrderSettingsForCartLine = cartConfiguration?.result?.ValidateDefaultOrderSettingsPerLine ?? false;\r\n if (!applyDefaultOrderSettingsForCartLine) {\r\n return quantity;\r\n }\r\n\r\n if (product?.Behavior?.DefaultQuantity && product.Behavior.DefaultQuantity > 0) {\r\n defaultQuantity = product.Behavior.DefaultQuantity;\r\n }\r\n\r\n return defaultQuantity;\r\n }\r\n\r\n private readonly _getDropdownName = (dimensionType: number, resources: IMmxBuyboxResources): string => {\r\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\r\n\r\n switch (dimensionType) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColor;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfiguration;\r\n case 3: // ProductDimensionType.Size\r\n return resources.productDimensionTypeSize;\r\n case 4: // ProductDimensionType.Style\r\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isFeatureEnabledInHq = featureStatuses?.find(\r\n featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName\r\n )?.IsEnabled;\r\n if (!isFeatureEnabledInHq) {\r\n return false;\r\n }\r\n const useSiteBuilderSettings = featureStatuses?.find(\r\n featureState => featureState.Name === RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName\r\n )?.IsEnabled;\r\n\r\n if (useSiteBuilderSettings) {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n let customerInfo;\r\n try {\r\n customerInfo = await this.props.data.customerInformation;\r\n } catch (error) {\r\n //mmx-feature: need ts ignore for error declaration --start\r\n /*\r\n this.props.telemetry.information(error);\r\n */\r\n //@ts-ignore\r\n this.props.telemetry.information(error);\r\n //mmx-feature: need ts ignore for error declaration --end\r\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\r\n return false;\r\n }\r\n\r\n return (\r\n customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n } else {\r\n const cartConfiguration = await this.props.data.cartConfiguration;\r\n return !(cartConfiguration?.IgnoreOrderSettings ?? false);\r\n }\r\n }\r\n\r\n private _validateCatalogDetails(catalogId: number): ProductCatalog[] | undefined {\r\n const catalogs = this.props.data.catalogs?.result?.filter(item => item.RecordId === catalogId);\r\n if (ArrayExtensions.hasElements(catalogs) && catalogs[0].RecordId === 0) {\r\n return;\r\n }\r\n\r\n return catalogs;\r\n }\r\n\r\n private async _isChannelLimitsFeatureEnabled(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isChannelLimitsFeatureEnabledInHq = featureStatuses?.find(\r\n featureState => featureState.Name === EcommerceQuantityLimitConfigurationsFeatureName\r\n )?.IsEnabled;\r\n\r\n return isChannelLimitsFeatureEnabledInHq ?? false;\r\n }\r\n}\r\n\r\nexport default Buybox;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxKeyInPriceViewProps,\r\n //mmx-feature: imports --start\r\n /*\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n */\r\n //mmx-feature: imports --end\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps\r\n// mmx-feature: default configuration --start\r\n/*\r\n} from '@msdyn365-commerce-modules/buybox';\r\n*/\r\n} from './common';\r\n// mmx-feature: default configuration --end\r\nimport { IBuyboxViewProps } from './mmx-buybox';\r\nimport { IBuyboxFindInStoreViewProps } from './components/mmx-buybox-find-in-store';\r\n\r\nconst BuyboxView: React.FC = props => {\r\n const {\r\n ModuleProps,\r\n MediaGalleryContainerProps,\r\n ProductInfoContainerProps,\r\n addToCart,\r\n addToOrderTemplate,\r\n addToWishlist,\r\n //mmx-feature: default configuration --begin\r\n /*\r\n configure,\r\n */\r\n //mmx-feature: default configuration --end\r\n description,\r\n findInStore,\r\n quantity,\r\n price,\r\n title,\r\n rating,\r\n inventoryLabel,\r\n shopSimilarLook,\r\n keyInPrice,\r\n shopSimilarDescription,\r\n unitOfMeasure,\r\n productComparisonButton\r\n } = props;\r\n\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {title}\r\n {price}\r\n {unitOfMeasure}\r\n {props.bulkPurchaseLink}\r\n {description}\r\n {rating}\r\n {/*\r\n //mmx-feature: default configuration --begin\r\n {configure && _renderConfigure(configure)}\r\n //mmx-feature: default configuration --end\r\n */}\r\n {keyInPrice && _renderKeyInPrice(keyInPrice)}\r\n {quantity && _renderQuantity(quantity)}\r\n {inventoryLabel}\r\n {addToCart && _renderAddToCart(addToCart)}\r\n {findInStore && _renderFindInStore(findInStore)}\r\n {addToOrderTemplate && _renderAddToOrderTemplate(addToOrderTemplate)}\r\n {addToWishlist && _renderAddToWishlist(addToWishlist)}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n {productComparisonButton}\r\n {shopSimilarLook && _renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && _renderShopSimilarItem(shopSimilarDescription)}\r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToCart;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToOrderTemplate = (addToOrderTemplate: IBuyboxAddToOrderTemplateViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToOrderTemplate;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\nconst _renderAddToWishlist = (addToWishlist: IBuyboxAddToWishlistViewProps): JSX.Element => {\r\n const { ContainerProps, errorBlock, button } = addToWishlist;\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n};\r\n\r\n// mmx-feature: default configuration --begin\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// mmx-feature: default configuration --end\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// mmx-feature: default configuration --begin\r\n/*\r\nconst _renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {select}\r\n \r\n );\r\n};\r\n*/\r\n// mmx-feature: default configuration --end\r\n\r\nconst _renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\nconst _renderQuantity = (quantity: IBuyboxProductQuantityViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input, errors } = quantity;\r\n\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderKeyInPrice = (keyInPrice: IBuyboxKeyInPriceViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, input } = keyInPrice;\r\n\r\n return (\r\n \r\n {heading}\r\n {input}\r\n \r\n );\r\n};\r\n\r\nconst _renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n const { ContainerProps, errors, input } = shopSimilarItem;\r\n\r\n return (\r\n \r\n {errors}\r\n {input}\r\n \r\n );\r\n};\r\nexport default BuyboxView;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n AddToOrderTemplateComponent,\r\n IAddToOrderTemplateDialogResources,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n IOrderTemplateActionErrorResult,\r\n IOrderTemplateNameDialogResources\r\n} from '@msdyn365-commerce/components';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n//mmx-feature: buybox extension --start\r\nimport {\r\n getConfigureErrors,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonResources,\r\n /*\r\n IBuyboxData,\r\n IBuyboxState,\r\n IBuyboxViewProps\r\n */\r\n IBuyboxState\r\n} from '@msdyn365-commerce-modules/buybox';\r\n\r\nimport {\r\n IMmxBuyboxData as IBuyboxData,\r\n IBuyboxViewProps\r\n} from '../../../../modules/mmx-buybox';\r\n//mmx-feature: buybox extension --end\r\nimport * as React from 'react';\r\n\r\n//mmx-feature: buybox extension --start\r\n/*\r\nimport { IBuyboxProps as IBuyboxExtentionProps } from '../../definition-extensions/buybox.ext.props.autogenerated';\r\n*/\r\nimport { IMmxBuyboxProps as IBuyboxExtentionProps } from '../../definition-extensions/mmx-buybox.ext.props.autogenerated';\r\n//mmx-feature: buybox extension --end\r\n\r\n/**\r\n * To generate AddToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of AddToOrderTemplateDialog resources..\r\n */\r\nfunction generateAddToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IAddToOrderTemplateDialogResources {\r\n return {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText\r\n };\r\n}\r\n\r\n/**\r\n * To generate OrderTemplateNameDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of OrderTemplateNameDialog resources..\r\n */\r\nfunction generateOrderTemplateNameDialogResources(resources: IBuyboxCommonResources): IOrderTemplateNameDialogResources {\r\n return {\r\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\r\n orderTemplateTitleLabel: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n orderTemplateDescription: resources.createOrderTemplateDescription,\r\n\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n\r\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\r\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\r\n };\r\n}\r\n\r\n/**\r\n * To generate ItemAddedToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of ItemAddedToOrderTemplateDialog resources..\r\n */\r\nfunction generateItemAddedToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IItemAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n}\r\n\r\n/**\r\n * To generate DuplicateItemsWhenAddingToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of DuplicateItemsWhenAddingToOrderTemplateDialog resources..\r\n */\r\nfunction generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\r\n resources: IBuyboxCommonResources\r\n): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\r\n return {\r\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\r\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\r\n updateQuantityButtonText: resources.updateQuantityButtonText,\r\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\r\n };\r\n}\r\n\r\n/**\r\n * Add to wishlist failed function.\r\n * @param callbacks -Buybox callbacks.\r\n * @param resources -Buybox resources.\r\n * @param product -Simple product.\r\n * @returns Update error state.\r\n */\r\nconst onAddToOrderTemplateFailed = (callbacks: IBuyboxCallbacks, resources: IBuyboxCommonResources, product: SimpleProduct | undefined) => (\r\n result: IOrderTemplateActionErrorResult\r\n) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'ORDER_TEMPLATE',\r\n configureErrors:\r\n result.status === 'MISSING_DIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n};\r\n\r\n/**\r\n * RenderAddToOrderTemplateButton.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @param product - Product data.\r\n * @returns -- Returns JSX element.\r\n */\r\nexport const renderAddToOrderTemplateButton = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n product: SimpleProduct\r\n): React.ReactNode => {\r\n const {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from module file.\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n resources,\r\n config\r\n } = props;\r\n\r\n const { quantity } = state;\r\n\r\n const isShowButtonText = true;\r\n const isMultipleCatalogsFeatureEnabled = props.isChannelMultipleCatalogsFeatureEnabled || false;\r\n return (\r\n orderTemplates && (\r\n \r\n )\r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { AddToWishlistComponent, IWishlistActionErrorResult } from '@msdyn365-commerce/components';\r\nimport { format, ItemAvailability, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { IStoreInfo } from '@msdyn365-commerce-modules/bopis-utilities';\r\n\r\n//mmx-feature: updated imports --start\r\nimport {\r\n getConfigureErrors,\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonResources,\r\n /*\r\n IBuyboxData,\r\n IBuyboxFindInStoreViewProps,\r\n */\r\n IBuyboxKeyInPriceViewProps,\r\n /*\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n */\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxResources as IBuyboxExtentionResources,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState\r\n /*\r\n IBuyboxState,\r\n IBuyboxViewProps\r\n */\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxFindInStoreViewProps, IBuyboxViewProps } from '../../../modules/mmx-buybox';\r\nimport { IMmxBuyboxData as IBuyboxData } from '../../../modules/mmx-buybox/mmx-buybox.data';\r\nimport { ProductWarrantyStateInput } from '../../../actions/state-data-actions/product-warranty-state.action';\r\nimport { getSelectedProductIdFromActionInput } from '../../../utilities/utils';\r\nimport { getEmptyWarrantyOption } from '../../../utilities/warranty/utils';\r\nimport { IWarrantyOption } from '../../../actions/DataServiceEntities.g';\r\n//mmx-feature: updated imports --end\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\n//mmx-feature: updated imports --start\r\n/*\r\nimport { IBuyboxProps as IBuyboxExtentionProps, IBuyboxProps } from '../definition-extensions/buybox.ext.props.autogenerated';\r\nimport { renderAddToOrderTemplateButton } from './components/buybox-add-to-order-template';\r\n*/\r\nimport { IMmxBuyboxProps as IBuyboxExtentionProps, IMmxBuyboxProps } from '../definition-extensions/mmx-buybox.ext.props.autogenerated';\r\nimport { renderAddToOrderTemplateButton } from './components/mmx-buybox-add-to-order-template';\r\nimport { ProductQuantityStateInput } from '../../../actions/state-data-actions/product-quantity-state.action';\r\n//mmx-feature: updated imports --end\r\n\r\n/**\r\n * BuyBoxConstants enum.\r\n */\r\nexport enum BuyBoxConstants {\r\n zero = 0\r\n}\r\n\r\n/**\r\n * On Change function.\r\n * @param callbacks -Callbacks.\r\n * @returns Update quantity.\r\n */\r\nconst onChangeHandler = (callbacks: IBuyboxCallbacks) => (newValue: number): boolean => {\r\n if (callbacks.updateQuantity) {\r\n return callbacks.updateQuantity(newValue);\r\n }\r\n return true;\r\n};\r\n\r\n// mmx-feature: product warranty selector --begin\r\nconst _renderWarrantySelectorModuleByQuantity = (\r\n warrantySelector: React.ReactNode[],\r\n props: IMmxBuyboxProps,\r\n state: IBuyboxState,\r\n isMultipleQuantity: boolean,\r\n setIsMultipleQuantity: any\r\n): JSX.Element | undefined => {\r\n if (props?.context.app.config.disableWarrantyOnMultipleQuantityProducts && state.quantity > 1) {\r\n if (!isMultipleQuantity) {\r\n let productId = getSelectedProductIdFromActionInput(props.context.actionContext);\r\n if (productId) {\r\n const currentWarrantyOptionState = props.context.actionContext.get('IWarrantyOption', `ProductWarrantyState-${productId}`);\r\n //@ts-ignore-error\r\n const currentWarrantyOption = currentWarrantyOptionState?.result?.Type\r\n let emptyWarranty: IWarrantyOption | undefined;\r\n if (currentWarrantyOption) {\r\n emptyWarranty = getEmptyWarrantyOption(+productId, undefined, currentWarrantyOption.Type);\r\n }\r\n props.context.actionContext.update(new ProductQuantityStateInput(+productId), 2);\r\n props.context.actionContext.update(new ProductWarrantyStateInput(+productId), emptyWarranty);\r\n }\r\n setIsMultipleQuantity(true);\r\n }\r\n return {_renderWarrantySelectorModule(warrantySelector)};\r\n } else {\r\n if (props?.context.app.config.disableWarrantyOnMultipleQuantityProducts && isMultipleQuantity) {\r\n let productId = getSelectedProductIdFromActionInput(props.context.actionContext);\r\n if (productId) {\r\n props.context.actionContext.update(new ProductQuantityStateInput(+productId), 1);\r\n }\r\n setIsMultipleQuantity(false);\r\n }\r\n return {_renderWarrantySelectorModule(warrantySelector)};\r\n }\r\n};\r\n\r\nconst _renderWarrantySelectorModule = (warrantySelector: React.ReactNode[]): JSX.Element | undefined => {\r\n if (!warrantySelector || warrantySelector.length === 0) {\r\n return undefined;\r\n }\r\n\r\n return <>{warrantySelector[0]};\r\n};\r\n// mmx-feature: product warranty selector --end\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 //mmx-feature: product warranty selector --start\r\n /*\r\n props: IBuyboxProps,\r\n */\r\n props: IMmxBuyboxProps,\r\n //mmx-feature: product warranty selector --end\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 min: number | undefined,\r\n max: number | undefined,\r\n applyDefaultOrderSettings?: boolean,\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 //mmx-feature: multiple quantity disable --start\r\n if (\r\n props?.context.app.config.disableWarrantyOnMultipleQuantityProducts &&\r\n props.data.productWarrantyState.result?.Period &&\r\n props.data.productWarrantyState.result?.Period > 0\r\n ) {\r\n //@ts-expect-error\r\n const quantity = props?.state?.quantity;\r\n return (\r\n \r\n <>Quantity: {quantity}\r\n \r\n );\r\n }\r\n //mmx-feature: multiple quantity disable --end\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\n//mmx-feature: store selector --start\r\n/*\r\nconst renderAddToCart = (addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n*/\r\nconst renderAddToCart = (addToCart: IBuyboxAddToCartViewProps, storeSelector?: React.ReactNode): JSX.Element => {\r\n //mmx-feature: store selector --end\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 //mmx-feature: --start\r\n /*\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n */\r\n\r\n return (\r\n \r\n {errorBlock}\r\n {storeSelector}\r\n {button}\r\n \r\n );\r\n //mmx-feature: --end\r\n};\r\n\r\n/**\r\n * RenderFindInStore.\r\n * @param findInStore - FindInStore.\r\n * @returns -- Returns.\r\n */\r\n//mmx-feature: find in store pickup only --start\r\n/*\r\nconst renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n*/\r\nconst renderFindInStore = (props: IMmxBuyboxProps, findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n //mmx-feature: find in store pickup only --end\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 //mmx-feature: delivery config --start\r\n const deliveryOptionContext = props.data.deliveryOptionContext.result;\r\n //mmx-feature: delivery config --end\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {/* mmx-feature: delivery config --start */\r\n /*\r\n {button}\r\n */\r\n deliveryOptionContext?.isShippingEnabled && deliveryOptionContext?.isPickupEnabled && button\r\n /* mmx-feature: delivery config --end */}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderAddToOrderTemplate.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToOrderTemplate = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): JSX.Element | null => {\r\n const product = props.data.product.result;\r\n if (!props.addToOrderTemplate || !product) {\r\n return null;\r\n }\r\n\r\n const orderTemplateButton = renderAddToOrderTemplateButton(props, state, callbacks, product);\r\n\r\n return (\r\n \r\n {props.addToOrderTemplate.errorBlock}\r\n {orderTemplateButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Add to wishlist failed function.\r\n * @param callbacks -Buybox callbacks.\r\n * @param resources -Buybox resources.\r\n * @param product -Simple product.\r\n * @returns Update error state.\r\n */\r\nconst onAddToWishlistFailed = (callbacks: IBuyboxCallbacks, resources: IBuyboxCommonResources, product: SimpleProduct | undefined) => (\r\n result: IWishlistActionErrorResult\r\n) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'WISHLIST',\r\n configureErrors:\r\n result.status === 'MISSINGDIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n};\r\n\r\n/**\r\n * RenderAddToWishlist.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @param product - Product data.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddtoWishlistButton = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n product: SimpleProduct\r\n): React.ReactNode => {\r\n const { context, resources } = props;\r\n const wishlists = props.data.wishlists.result;\r\n const isShowWishlitButtonText = true;\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderAddToWishlist.\r\n * @param props - Buybox viewprops.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToWishlist = (\r\n props: IBuyboxViewProps & IBuyboxExtentionProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): JSX.Element | null => {\r\n const product = props.data.product.result;\r\n if (!props.addToWishlist || !product) {\r\n return null;\r\n }\r\n\r\n if (!props.config.enableWishlist) {\r\n return null;\r\n }\r\n\r\n const wishlistButton = renderAddtoWishlistButton(props, state, callbacks, product);\r\n return (\r\n \r\n {props.addToWishlist.errorBlock}\r\n {wishlistButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RRenderShopSimilarItem.\r\n * @param shopSimilarItem - ShopSimilarItem.\r\n * @returns -- Returns.\r\n */\r\nconst renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const { ContainerProps, errors, input } = shopSimilarItem;\r\n\r\n return (\r\n \r\n {errors}\r\n {input}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderSocialShare.\r\n * @param socialShare - Social share react node array.\r\n * @returns -- Returns.\r\n */\r\nconst _renderSocialShare = (socialShare: React.ReactNode[]): JSX.Element | undefined => {\r\n if (!socialShare || socialShare.length === 0) {\r\n return undefined;\r\n }\r\n\r\n return <>{socialShare[0]};\r\n};\r\n\r\n//mmx-feature: remove configure --start\r\n/**\r\n * RenderConfigureDropdown.\r\n * @param dropdown - Buybox product configure dropdown view props.\r\n * @returns -- Returns JSX.Element.\r\n */\r\n/*\r\nconst renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n\r\n return (\r\n \r\n {heading}\r\n {select}\r\n {errors}\r\n \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\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//mmx-feature: remove configure --end\r\n\r\n/**\r\n * BuyboxView.\r\n * @param props - Props.\r\n * @returns -- Returns.\r\n */\r\nconst BuyboxView: React.FC> = props => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const {\r\n ModuleProps,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n MediaGalleryContainerProps,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n ProductInfoContainerProps,\r\n addToCart,\r\n addToOrderTemplate,\r\n addToWishlist,\r\n productComparisonButton,\r\n //mmx-feature: remove configure --start\r\n /*\r\n configure,\r\n */\r\n //mmx-feature: remove configure --end\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 min,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n max,\r\n applyDefaultOrderSettings,\r\n unitOfMeasure,\r\n callbacks,\r\n state,\r\n resources,\r\n quantityLimitsMessages,\r\n telemetryContent,\r\n app: { config: appConfig },\r\n catalogs\r\n } = props;\r\n let skuText: string = props.resources.skuText;\r\n skuText += props.data.product.result?.ItemId;\r\n const preferredStoreInfo: IStoreInfo | undefined = props.data.storeSelectorStateManager.result?.preferredStore;\r\n const preferredStoreId = preferredStoreInfo?.StoreId ? preferredStoreInfo.StoreId : '';\r\n const preferredStoreName = preferredStoreInfo?.StoreName ? preferredStoreInfo.StoreName : '';\r\n\r\n const [availability, setAvailability] = React.useState('');\r\n const [isStoreChange, setIsStoreChange] = React.useState(false);\r\n //mmx-feature: selected warranty disable function --start\r\n const [isMultipleQuantity, setIsMultipleQuantity] = React.useState(false);\r\n //mmx-feature: selected warranty disable function --end\r\n\r\n /**\r\n * GetStockInventoryLabel.\r\n * @param availabilityWithHours - Stock availability with hours.\r\n * @returns -- Returns.\r\n */\r\n const getStockInventoryLabel = (availabilityWithHours: IFullOrgUnitAvailability | undefined): string | undefined => {\r\n if (availabilityWithHours && ArrayExtensions.hasElements(availabilityWithHours.ProductInventoryInformation)) {\r\n for (const productInventoryInformation of availabilityWithHours.ProductInventoryInformation) {\r\n if (\r\n availabilityWithHours.OrgUnitAvailability?.OrgUnitLocation?.InventoryLocationId ===\r\n productInventoryInformation.InventLocationId\r\n ) {\r\n return productInventoryInformation.StockLevelLabel;\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n const getInventory = React.useCallback(async () => {\r\n const input = new GetFullAvailableInventoryNearbyInput(\r\n props.data.product.result?.RecordId,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n true\r\n );\r\n\r\n /**\r\n * IsProductInStock.\r\n * @param itemAvailabilities - Item availability array.\r\n * @returns -- Returns.\r\n */\r\n const isProductInStock = (itemAvailabilities: ItemAvailability[] | undefined): boolean => {\r\n if (!appConfig.enableStockCheck) {\r\n return true;\r\n }\r\n\r\n if (ArrayExtensions.hasElements(itemAvailabilities)) {\r\n return itemAvailabilities[BuyBoxConstants.zero].AvailableQuantity! > BuyBoxConstants.zero;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n await getFullAvailableInventoryNearby(input, props.context.actionContext)\r\n .catch((error: Error) => {\r\n props.telemetry.error(error.message);\r\n })\r\n .then(response => {\r\n if (response && ArrayExtensions.hasElements(response)) {\r\n const isPreferredStore = (value: IFullOrgUnitAvailability) =>\r\n value.OrgUnitAvailability?.OrgUnitLocation?.OrgUnitNumber === preferredStoreId;\r\n const filteredFullOrgUnitAvailability = response.filter(isPreferredStore);\r\n const preferredStoreAvailability = ArrayExtensions.hasElements(filteredFullOrgUnitAvailability)\r\n ? filteredFullOrgUnitAvailability[BuyBoxConstants.zero]\r\n : undefined;\r\n const stockStatusLabel: string | undefined = getStockInventoryLabel(preferredStoreAvailability);\r\n const isInStock = isProductInStock(preferredStoreAvailability?.OrgUnitAvailability?.ItemAvailabilities);\r\n const resourceLabel = isInStock ? props.resources.inStockText : props.resources.outOfStockText;\r\n const stockText: string | undefined = stockStatusLabel ? stockStatusLabel : resourceLabel;\r\n const preferredStoreAvailabilityText = `${format(\r\n props.resources.availabilityAtPreferredStoreText,\r\n preferredStoreName\r\n )} ${stockText}`;\r\n setAvailability(preferredStoreAvailabilityText);\r\n }\r\n });\r\n\r\n setIsStoreChange(false);\r\n }, [\r\n props.data.product.result?.RecordId,\r\n appConfig.enableStockCheck,\r\n preferredStoreId,\r\n preferredStoreName,\r\n props.context.actionContext,\r\n props.resources.availabilityAtPreferredStoreText,\r\n props.resources.inStockText,\r\n props.resources.outOfStockText,\r\n props.telemetry\r\n ]);\r\n\r\n React.useEffect(() => {\r\n if (props.config.displayStockAvailability) {\r\n getInventory().catch((error: Error) => {\r\n props.telemetry.error(error.message);\r\n });\r\n }\r\n }, [getInventory, isStoreChange, props.telemetry, props.config.displayStockAvailability]);\r\n\r\n reaction(\r\n () => props.data.storeSelectorStateManager.result?.selectedStoreLocationId,\r\n () => {\r\n setIsStoreChange(true);\r\n }\r\n );\r\n\r\n /**\r\n * RenderAvailabiltyAtPreferredStore.\r\n * @returns -- Returns.\r\n */\r\n const renderAvailabilityAtPreferredStore = (): JSX.Element | undefined => {\r\n const hasProductDimensions = ArrayExtensions.hasElements(props.data.product.result?.Dimensions);\r\n if (hasProductDimensions && props.data.product.result?.MasterProductId === undefined) {\r\n return undefined;\r\n }\r\n const containerProps: INodeProps = {\r\n className: 'ms-buybox__preferred-store-availability',\r\n tag: 'span'\r\n };\r\n\r\n return {availability};\r\n };\r\n return (\r\n \r\n {props.mediaGallery}\r\n \r\n {//mmx-feature: catalog display --start\r\n /*\r\n {catalogs && catalogs[0].Name}\r\n */\r\n props.config.displayProductCatalog && catalogs && catalogs[0].Name\r\n /*mmx-feature: catalog display --end*/}\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 {//mmx-feature: catalog display --start\r\n /*\r\n {configure && renderConfigure(configure)}\r\n */\r\n props.context.app.config.productWarrantyEnabled\r\n ? _renderWarrantySelectorModuleByQuantity(\r\n props.slots && props.slots.warrantySelector,\r\n props,\r\n props.state,\r\n isMultipleQuantity,\r\n setIsMultipleQuantity)\r\n : <>\r\n /*mmx-feature: catalog display --end*/}\r\n {keyInPrice && renderKeyInPrice(keyInPrice)}\r\n \r\n
\r\n {quantity &&\r\n renderQuantity(\r\n quantity,\r\n callbacks,\r\n props,\r\n state,\r\n resources,\r\n quantityLimitsMessages,\r\n min,\r\n max,\r\n applyDefaultOrderSettings,\r\n telemetryContent,\r\n unitOfMeasure\r\n )}\r\n {props.bulkPurchaseLink}\r\n
\r\n
\r\n {props.config.displayStockAvailability && preferredStoreId && renderAvailabilityAtPreferredStore()}\r\n {inventoryLabel}\r\n {//mmx-feature: store selector --start\r\n /*\r\n {renderAddToCart(addToCart)}\r\n {findInStore && renderFindInStore(findInStore)}\r\n */\r\n }\r\n {renderAddToCart(addToCart, props.slots.storeSelector)}\r\n {findInStore && renderFindInStore(props, findInStore)}\r\n {/*mmx-feature: store selector --end*/}\r\n {addToWishlist && renderAddToWishlist(props, state, callbacks)}\r\n {productComparisonButton}\r\n {addToOrderTemplate && renderAddToOrderTemplate(props, state, callbacks)}\r\n {findInStore?.productPickupOptionList ? (\r\n
{findInStore.productPickupOptionList}
\r\n ) : null}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n
{props.resources.shopText}
\r\n \r\n {shopSimilarLook && renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && renderShopSimilarItem(shopSimilarDescription)}\r\n \r\n \r\n
{props.resources.descriptionText}
\r\n {description}\r\n
\r\n {ArrayExtensions.hasElements(props.slots.productSpecification) ? (\r\n {props.slots.productSpecification[0]}\r\n ) : null}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default BuyboxView;\r\n","import { IProductWarranties, IWarrantyOption } from '../../actions/DataServiceEntities.g';\r\nimport { CommerceProperty, CommercePropertyValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport interface IPairedWarrantyLine {\r\n item: T;\r\n warranty: T | undefined;\r\n}\r\n\r\ninterface ILineItem {\r\n data?: any;\r\n}\r\n\r\nexport enum WarrantyLineDataType {\r\n ICartlinesViewProps = 'cartline',\r\n IFlyoutCartLineItemViewProps = 'cartline',\r\n ISalesLine = 'salesLine'\r\n}\r\n\r\nexport enum WarrantyLineCommerceProperties {\r\n isWarrantyLine = 'Memx_IsWarrantyLine',\r\n warrantableLineNumber = 'Memx_WarrantableLineNumber',\r\n warrantyPeriod = 'Memx_WarrantyPeriod'\r\n}\r\n\r\n/**\r\n * Determins if an item line is a warranty line.\r\n * @param itemLines the itemLine to evaluate.\r\n * @param lineDataType the data item within the object. This should be the WarrantyLineCommerceProperty where the name matches the value of T.\r\n */\r\nexport function getIsWarrantyLine(itemLine: T, lineDataType: WarrantyLineDataType): boolean {\r\n return getWarrantyLineProperty(itemLine, lineDataType, WarrantyLineCommerceProperties.isWarrantyLine)?.BooleanValue ?? false;\r\n}\r\n\r\n/**\r\n * Retreives a warranty line property from an item line.\r\n * @param itemLines the itemLine to evaluate.\r\n * @param lineDataType the data item within the object. This should be the WarrantyLineCommerceProperty where the name matches the value of T.\r\n * @param commercePropName The name of the commerce property to search for.\r\n */\r\nexport function getWarrantyLineProperty(\r\n itemLine: T,\r\n lineDataType: WarrantyLineDataType,\r\n commercePropName: WarrantyLineCommerceProperties\r\n): CommercePropertyValue {\r\n return itemLine.data[lineDataType].ExtensionProperties?.find((commerceProp: CommerceProperty) => commerceProp.Key === commercePropName)\r\n ?.Value;\r\n}\r\n\r\n/**\r\n * Determines if item line number matches value provided.\r\n * @param value The number to compare to the provided itemLine's line number.\r\n * @param itemLines the itemLine to compare the value to.\r\n * @param lineDataType the data item within the object. This should be the WarrantyLineCommerceProperty where the name matches the value of T.\r\n */\r\nexport function getDoesValueMatchLineNumber(\r\n value: number | undefined,\r\n itemLine: T,\r\n lineDataType: WarrantyLineDataType\r\n) {\r\n return itemLine.data[lineDataType].LineNumber === value;\r\n}\r\n\r\n/**\r\n * Given a set of Line items, returns a list of paired line items,\r\n * where cart line items are paired with their associated warranties.\r\n * @param itemLines the list of itemLines to pair.\r\n * @param lineDataType the data item within the object. This should be the WarrantyLineCommerceProperty where the name matches the value of T.\r\n */\r\nexport function pairWarrantyItemLines(itemLines: T[], lineDataType: WarrantyLineDataType): IPairedWarrantyLine[] {\r\n const pairedItemLines: IPairedWarrantyLine[] = [];\r\n const warrantyItemLines: T[] = [];\r\n\r\n let lastItemLine: T | undefined;\r\n\r\n itemLines.forEach(function(itemLine) {\r\n const isWarranty: boolean = getIsWarrantyLine(itemLine, lineDataType);\r\n if (isWarranty) {\r\n if (\r\n lastItemLine &&\r\n itemLine.data &&\r\n getDoesValueMatchLineNumber(\r\n getWarrantyLineProperty(itemLine, lineDataType, WarrantyLineCommerceProperties.warrantableLineNumber)?.DecimalValue,\r\n itemLine,\r\n lineDataType\r\n )\r\n ) {\r\n pairedItemLines.push({ item: lastItemLine, warranty: itemLine });\r\n lastItemLine = undefined;\r\n } else {\r\n warrantyItemLines.push(itemLine);\r\n }\r\n } else {\r\n if (lastItemLine) {\r\n pairedItemLines.push({ item: lastItemLine, warranty: undefined });\r\n }\r\n lastItemLine = itemLine;\r\n }\r\n });\r\n\r\n if (lastItemLine) {\r\n pairedItemLines.push({ item: lastItemLine, warranty: undefined });\r\n }\r\n\r\n warrantyItemLines.forEach(function(warrantyItemLine) {\r\n if (warrantyItemLine.data) {\r\n const warrantableLineNumber = getWarrantyLineProperty(\r\n warrantyItemLine,\r\n lineDataType,\r\n WarrantyLineCommerceProperties.warrantableLineNumber\r\n );\r\n const warrantableItemLineIndex = pairedItemLines.findIndex(\r\n pairedItemLines =>\r\n pairedItemLines.item.data &&\r\n getDoesValueMatchLineNumber(warrantableLineNumber?.DecimalValue, pairedItemLines.item, lineDataType)\r\n );\r\n if (warrantableItemLineIndex >= 0) {\r\n const pairedItemLine = pairedItemLines[warrantableItemLineIndex];\r\n pairedItemLines[warrantableItemLineIndex] = { item: pairedItemLine.item, warranty: warrantyItemLine };\r\n }\r\n }\r\n });\r\n\r\n return pairedItemLines;\r\n}\r\n\r\n/**\r\n * Searches the provided list of cartlines for the provided item to determine what its\r\n * currently selected warranty is.\r\n * @param recordId Id of the product which\r\n * @param pairedCartLine The warranty in this item/warranty pair contains the list on which the\r\n * selected item is searched.\r\n * @param productWarrantiesForCartline The list of active product warranties in the cart. Most modules that\r\n * concern the cart have this in their data actions.\r\n */\r\nexport function findSelectedWarranty(\r\n recordId: number,\r\n pairedItemLine: IPairedWarrantyLine,\r\n productWarrantiesForItemLine: IProductWarranties | undefined,\r\n lineDataType: WarrantyLineDataType\r\n): IWarrantyOption | undefined {\r\n if (\r\n productWarrantiesForItemLine &&\r\n productWarrantiesForItemLine.WarrantyGroups &&\r\n productWarrantiesForItemLine?.WarrantyGroups[0].WarrantyOptions &&\r\n productWarrantiesForItemLine?.WarrantyGroups[0].WarrantyOptions.length > 0\r\n ) {\r\n let selectedWarranty = productWarrantiesForItemLine?.WarrantyGroups[0].WarrantyOptions.find(\r\n warrantyOption =>\r\n warrantyOption.Period ===\r\n pairedItemLine.warranty?.data[lineDataType].ExtensionProperties?.find(\r\n (commerceProp: CommerceProperty) => commerceProp.Key === WarrantyLineCommerceProperties.warrantyPeriod\r\n )?.Value?.IntegerValue\r\n );\r\n if (selectedWarranty) {\r\n return selectedWarranty;\r\n }\r\n return getEmptyWarrantyOption(recordId ?? 0, productWarrantiesForItemLine?.WarrantyGroups[0].WarrantyOptions);\r\n }\r\n return undefined;\r\n}\r\n\r\n/**\r\n * Returns a full warranty option from the provided list based on the provided term name.\r\n *\r\n * @param warrantyOptions A list of warranty options for a product.\r\n * @param period The duration the warranty is valid for, in string or number format. (note that warranty options have no unique id)\r\n */\r\nexport function getWarrantyOptionByPeriod(warrantyOptions: IWarrantyOption[], period: string | number): IWarrantyOption | undefined {\r\n if (typeof period === 'string') {\r\n period = parseInt(period, 10);\r\n }\r\n if (period === 0) {\r\n return getEmptyWarrantyOption(0, warrantyOptions);\r\n } else {\r\n return getWarrantyOptionsInternal(warrantyOptions, period);\r\n }\r\n}\r\n\r\n/*\r\n * Internal function. Returns a full warranty option from the provided list based on the provided term name.\r\n *\r\n * @param warrantyOptions - A list of warranty options for a product.\r\n * @param period - The duration the warranty is valid for. (note that warranty options have no unique id)\r\n */\r\nfunction getWarrantyOptionsInternal(warrantyOptions: IWarrantyOption[], period: number): IWarrantyOption | undefined {\r\n return warrantyOptions.find(option => {\r\n return option.Period === period;\r\n });\r\n}\r\n\r\n/**\r\n * Returns a warranty with a period of 0. This function can be called without warranty options, but this is not recommended.\r\n *\r\n * @param warrantyOptions A list of warranty options for a product.\r\n * @param period The duration the warranty is valid for, in string or number format. (note that warranty options have no unique id)\r\n * @param warrantyType The associated warrranty type (e.g. EW/IPR).\r\n */\r\nexport function getEmptyWarrantyOption(\r\n warrantableProduct: number,\r\n warrantyOptions?: IWarrantyOption[],\r\n warrantyType?: string\r\n): IWarrantyOption | undefined {\r\n let emptyWarranty: IWarrantyOption | undefined;\r\n if (warrantyOptions) {\r\n emptyWarranty = getWarrantyOptionsInternal(warrantyOptions, 0);\r\n }\r\n if (!emptyWarranty) {\r\n const emptyWarrantyType = warrantyType ?? (warrantyOptions ? warrantyOptions[0].Type : undefined);\r\n emptyWarranty = {\r\n Charge: 0,\r\n Description: 'None',\r\n Period: 0,\r\n Product: 0,\r\n Rate: 0,\r\n RecordId: 1,\r\n TermName: `${emptyWarrantyType} None`,\r\n Type: emptyWarrantyType,\r\n WarrantableProduct: +warrantableProduct,\r\n WarrantableProductPrice: 0\r\n };\r\n }\r\n return emptyWarranty;\r\n}\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['mmx-buybox'] = {\n c: () => require('partner/modules/mmx-buybox/mmx-buybox.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'cartConfiguration', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration', runOn: 0},{name:'catalogs', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'deliveryOptionContext', path:'actions/get-delivery-option-context.action', 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:'productDefaultVariant', path:'actions/get-product-default-variant.action', runOn: 0},{name:'productDimensions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant', runOn: 0},{name:'productPrice', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant', runOn: 0},{name:'ratingsSummary', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary', runOn: 1},{name:'storeSelectorStateManager', path:'@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action', runOn: 1},{name:'wishlists', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mmx-buybox',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mmx-buybox'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action';\n let dataAction = require('@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-delivery-option-context.action';\n let dataAction = require('partner/actions/get-delivery-option-context.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-product-default-variant.action';\n let dataAction = require('partner/actions/get-product-default-variant.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|mmx-buybox|mmx-buybox'] = {\n c: () => require('partner/modules/mmx-buybox/mmx-buybox.view.tsx'),\n cn: '__local__-__local__-mmx-buybox'\n };\nviewDictionary['__local__|__local__|themes|memoryexpress|views|mmx-buybox'] = {\n c: () => require('partner/themes/memoryexpress/views/mmx-buybox.view.tsx'),\n cn: '__local__-__local__-mmx-buybox'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\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","onLocationSelected","orgUnitLocation","deliveryMode","_props$context","_cartState$cart$CartL","Promise","resolve","behavior","app","config","addToCartBehavior","cartState","getCartState","actionContext","staticCartLines","assign","CartLines","addProductToCart","count","location","then","status","substatus","productAvailability","changeModalOpen","ProductAvailableQuantity","ArrayExtensions","hasElements","shippingInventory","shipping","deliveryType","DeliveryMode","pickup","undefined","failureResult","failureReason","cartActionResult","otherError","getGenericError","navigationUrl","getUrlSync","newCartState","productId","getSelectedProductIdFromActionInput","selectedWarrantyOption","productWarrantyStateAction","ProductWarrantyStateInput","Period","newCartLine","getNewCartLine","WarrantableProduct","updateWarrantySelectionsAsync","callerContext","WarrantableCartLine","Option","refreshCart","AddToCartBehavior","goToCart","window","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","locations","getOrgUnitLocationsByArea","GetOrgUnitLocationsByAreaInput","reject","_locations$0$OrgUnitA","OrgUnitAvailability","OrgUnitLocation","deliveryOptions","defaultDeliveryOption","DeliveryOptions","Code","openDialog","parentElementRef","message","newCartLines","oldCartLines","map","newcl","newclIsUnique","scl","LineId","ProductId","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","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","deliveryCode","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","title","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","scrollX","left","pageXOffset","scrollY","top","pageYOffset","scrollTo","_isChannelMultipleCatalogsFeatureEnabled","isMultipleCatalogFeatureEnabledInHq","_this$props$data$feat","feature","productDefaultVariant","productDimensions","hasProductDimensions","dimensionsToUpdate","clearErrorState","previousState","defaultVariant","_getProductVariant","productVariant","productVariantPromise","promises","_getDimensionsForSelectedVariant","mappedDimensions","_hydrateInventoryInfo","_hydratePrice","_hydrateDeliveryOptions","_updateQuantitiesInState","all","_this$props$data$prod","isGiftCard","IsGiftCard","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","min","max","isPriceApiCalled","DimensionId","_productDimensions$0$","productDimValue","DimensionValues","dim","RecordId","toString","newProduct","getSelectedVariant","SelectedVariantInput","DefaultProductId","apiSettings","channelId","ItemTypeValue","ReleasedProductType","Service","isServiceItem","maxRecentlyViewedItemsCount","RecentlyViewedState","render","_this$props$data$prod2","_this$props$data$feat2","_this$props$data$feat3","_this$props$data$cart","_this$props$data$cart2","mediaGallery","productComparisonButton","inventoryLevel","dimensionValuesWithInventory","flatten","validValues","value","applyDefaultOrderSettings","RetailDefaultOrderQuantityLimitsFeatureName","cartConfiguration","ValidateDefaultOrderSettingsPerLine","hasAvailableProducts","some","getInventoryLevelCodeFromDimensionValue","InventoryLevelValues","outOfStock","catalogId","getCatalogId","validateCatalogId","viewProps","ModuleProps","moduleProps","classnames","ProductInfoContainerProps","MediaGalleryContainerProps","getBuyboxProductTitle","getBuyboxProductDescription","bulkPurchaseLink","_renderBuyboxBulkPurchaseLink","unitOfMeasure","getBuyboxProductUnitOfMeasure","configure","getBuyboxProductConfigure","findInStore","getBuyboxProductPrice","addToCart","getBuyboxAddToCart","getBuyboxProductComparisonButton","addToOrderTemplate","getBuyboxProductAddToOrderTemplate","addToWishlist","getBuyboxProductAddToWishlist","rating","hideRating","getBuyboxProductRating","getBuyboxProductQuantity","inventoryLabel","getBuyBoxInventoryLabel","shopSimilarLook","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","Looks","shopSimilarDescription","enableShopSimilarDescription","keyInPrice","enableKeyInPrice","isCustomPriceSelected","getBuyboxKeyInPrice","quantityLimitsMessages","getQuantityLimitsMessages","isChannelMultipleCatalogsFeatureEnabled","currentCatalogId","catalogs","_validateCatalogDetails","renderView","isBulkPurchaseEnabled","msdyn365Commerce","isBrowser","bulkPurchaseModules","Array","from","document","getElementsByClassName","BulkPurchase","Button","bulkPurchaseLinkText","arguments","CustomerContextualPrice","_ref","_dimension$dimensionV","_dimensions$find$Dime","_dimensions$find","DimensionTypeValue","_value$DimensionValue","ExtensionProperties","selectedProductPromise","setDimensionValuesToQuery","requestContext","url","requestUrl","_defaultProduct$Maste","defaultProduct","getByIdAsync","MasterProductId","_product$MasterProduc","_ref2","_defaultVariant$Defau","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","_productVariant$Dimen","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","newShippingQuantity","toLowerCase","getPriceForSelectedVariant","PriceForSelectedVariantInput","_this$props$data$feat4","retailMultiplePickupFeatureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","isOrderQuantityLimitsFeatureEnabled","_isOrderQuantityLimitsFeatureEnabled","isChannelLimitsFeatureEnabled","_isChannelLimitsFeatureEnabled","_getMinQuantityForCartLineItem","_getMaxQuantityForCartLineItem","_getQuantity","Math","_product$Behavior","Behavior","MinimumQuantity","isQuantityLimitsFeatureEnabled","_product$Behavior2","MaximumQuantity","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","_cartConfiguration$re","_cartConfiguration$re2","_product$Behavior3","defaultQuantity","DefaultQuantity","_featureStatuses$find","_featureStatuses$find2","featureStatuses","RevertToSiteBuilderOrderQuantityLimitsSettingsCRTFeatureName","_this$props$context","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","customerInformation","information","IsB2b","_cartConfiguration$Ig","IgnoreOrderSettings","_this$props$data$cata","_featureStatuses$find3","isChannelLimitsFeatureEnabledInHq","EcommerceQuantityLimitConfigurationsFeatureName","_renderAddToCart","errorBlock","Node","_renderAddToOrderTemplate","_renderAddToWishlist","_renderSocialShare","socialShare","_renderFindInStore","_renderQuantity","LabelContainerProps","input","_renderKeyInPrice","_renderShopSimilarItem","shopSimilarItem","Module","generateAddToOrderTemplateDialogResources","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","generateOrderTemplateNameDialogResources","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","generateItemAddedToOrderTemplateDialogResources","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","generateDuplicateItemsWhenAddingToOrderTemplateDialogResources","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","onAddToOrderTemplateFailed","BuyBoxConstants","onChangeHandler","newValue","_renderWarrantySelectorModule","warrantySelector","renderAddToOrderTemplate","orderTemplateButton","renderAddToOrderTemplateButton","orderTemplates","isMultipleCatalogsFeatureEnabled","AddToOrderTemplateComponent","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","onError","shouldShowButtonFailedTooltip","showButtonTooltip","showButtonText","onAddToWishlistFailed","renderAddToWishlist","enableWishlist","wishlistButton","renderAddtoWishlistButton","wishlists","AddToWishlistComponent","addToWishlistButtonText","removeFromWishlistButtonText","addToWishlistMessage","removedFromWishlistMessage","addItemToWishlistError","removeItemFromWishlistError","nameOfWishlist","ariaRole","getSelectedProduct","renderShopSimilarItem","_props$data$product$r","_props$data$storeSele","_props$data$product$r3","appConfig","skuText","ItemId","preferredStoreInfo","preferredStore","preferredStoreId","StoreId","preferredStoreName","StoreName","availability","setAvailability","isStoreChange","setIsStoreChange","isMultipleQuantity","setIsMultipleQuantity","getInventory","_props$data$product$r2","GetFullAvailableInventoryNearbyInput","zero","getFullAvailableInventoryNearby","response","_preferredStoreAvaila","isPreferredStore","_value$OrgUnitAvailab","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","displayProductCatalog","priceText","productWarrantyEnabled","_renderWarrantySelectorModuleByQuantity","disableWarrantyOnMultipleQuantityProducts","_currentWarrantyOptio","currentWarrantyOptionState","get","currentWarrantyOption","Type","emptyWarranty","getEmptyWarrantyOption","update","ProductQuantityStateInput","renderKeyInPrice","renderQuantity","quantityComponent","extentionResources","_props$data$productWa","_props$data$productWa2","productWarrantyState","_props$state","IncrementalQuantity","currentCount","onChange","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","minQuantityText","maxQuantityText","renderAvailabilityAtPreferredStore","_props$data$product$r4","_props$data$product$r5","tag","renderAddToCart","renderFindInStore","deliveryOptionContext","isShippingEnabled","isPickupEnabled","shopText","descriptionText","productSpecification","WarrantyLineDataType","WarrantyLineCommerceProperties","getIsWarrantyLine","itemLine","lineDataType","_getWarrantyLinePrope","_getWarrantyLinePrope2","getWarrantyLineProperty","isWarrantyLine","BooleanValue","commercePropName","_itemLine$data$lineDa","commerceProp","Key","getDoesValueMatchLineNumber","LineNumber","pairWarrantyItemLines","itemLines","pairedItemLines","warrantyItemLines","lastItemLine","forEach","_getWarrantyLinePrope3","warrantableLineNumber","DecimalValue","warranty","warrantyItemLine","warrantableItemLineIndex","findIndex","pairedItemLine","findSelectedWarranty","recordId","productWarrantiesForItemLine","WarrantyGroups","WarrantyOptions","selectedWarranty","warrantyOption","_pairedItemLine$warra","warrantyPeriod","IntegerValue","getWarrantyOptionByPeriod","warrantyOptions","period","parseInt","getWarrantyOptionsInternal","warrantableProduct","warrantyType","emptyWarrantyType","Charge","Product","Rate","TermName","WarrantableProductPrice","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","module","exports","ReactDOM"],"sourceRoot":""}