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,sBAAsB,CAACC,mBAAoBN,IAKxD,+BACHnT,EACA0T,EACAjW,EACA8B,EACA+G,GAIA,MAAMqN,EAAwBlW,EAAQ4K,QAAQ1G,IAAIC,OAAOgS,2BACnDC,EAAqBpW,EAAQ4K,QAAQ1G,IAAIC,OAAOkF,iBAChDgN,GAAoBJ,EAAczW,UAAY,GAAMsC,EAC1D,OAAIoU,GAAiBG,EAAmBH,GAGpCE,KAAgBvN,GAAuBwN,GAAoBxN,EAAoBI,mBAAqB,IAF7F,CAAEtG,OAAQ,SAAU2T,UAAW,sBAOpC/T,EAAUgU,uBAAuB,CAACC,WAAYP,EAAcX,OAASmB,YAAaJ,IACjF,CAAE1T,OAAQ","sources":["webpack://united-malt/./src/actions/shared-availability-state.ts?3c71","webpack://united-malt/./src/themes/base/views/components/addtocart.component.tsx?f69e","webpack://united-malt/./src/utilities/analytics/analytics-dispatcher.ts?75be","webpack://united-malt/./src/utilities/cart-attribute-helpers.ts?c7b6","webpack://united-malt/./src/utilities/cart-utils.ts?119d"],"sourcesContent":["//==============================================================================\r\n// Extremely simple shared state\r\n//\r\n// This version allows sharing of availability information across modules\r\n//==============================================================================\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n//==============================================================================\r\n//==============================================================================\r\n\r\n//==========================================================\r\n// Input Action\r\n//==========================================================\r\nexport class SharedAvailabilityInput implements Msdyn365.IActionInput {\r\n\r\n //----------------------------------------------------------\r\n // Caching Stuff\r\n //----------------------------------------------------------\r\n public getCacheKey = () => `SharedAvailability`;\r\n public getCacheObjectType = () => 'SharedAvailability';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n//==========================================================\r\n//==========================================================\r\nexport function createInput(actionContext: Msdyn365.ICreateActionContext): Msdyn365.IActionInput {\r\n return new SharedAvailabilityInput();\r\n}\r\n\r\n//==========================================================\r\n// Insanely simple class to hold a single variable\r\n//==========================================================\r\nexport class SharedAvailability {\r\n public isAvailable: Boolean = true;\r\n}\r\n\r\n//==========================================================\r\n//==========================================================\r\nexport async function sharedAvailabilityAction(input: SharedAvailabilityInput, ctx?: Msdyn365.IActionContext): Promise {\r\n return new SharedAvailability();\r\n}\r\n\r\n//==============================================================================\r\n//==============================================================================\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >sharedAvailabilityAction,\r\n input: createInput\r\n});","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport MsDyn365, { getCatalogId, IActionContext, IComponent, IComponentProps, IGridSettings, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core'; // @CUSTOM: Added IActionContext\r\nimport { getCartState, ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n AttributeTextValue,\r\n CartLine,\r\n CartLineValidationResults,\r\n CartsDataActions,\r\n CommerceProperty,\r\n format,\r\n ProductAvailableQuantity,\r\n ProductDimension,\r\n ProductPrice,\r\n ProductsDataActions,\r\n ProductSearchCriteria,\r\n ProductType,\r\n ReleasedProductType, // @CUSTOM: Imports 'ReleasedProductType' interface from retail proxy to be used for determining item type\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { ErrorNotification, NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport { ArrayExtensions, generateProductImageUrl, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, IPopupProps, ITelemetryContent, Popup } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React, { useState } from 'react';\r\n\r\nimport { PriceComponent, IItemsAddedToCartResources, ItemsAddedToCartDialogComponent, ItemSuccessfullyAddedToCartNotification, OrderDetailsProduct, MultiItemsSuccessfullyAddedToCartNotification } from '@msdyn365-commerce/components';\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Import shared state helpers\r\n//----------------------------------------------------------\r\nimport { CartUtilities } from '../../../../utilities/cart-utils';\r\nimport { CartLineCombineTable } from '../../../../settings/app.settings';\r\nimport { addOverridesToCartState, AddProductsToCartWithAttribs } from '../../../../utilities/cart-attribute-helpers';\r\nimport { SharedAvailabilityInput, SharedAvailability } from '../../../../actions/shared-availability-state';\r\nimport { publish } from '../../../../utilities/analytics/analytics-dispatcher';\r\nimport { AddToCartEvent } from '../../../../utilities/analytics/analytics-events';\r\n//----------------------------------------------------------\r\n\r\n// @CUSTOM: Product extension property id for milling option\r\nconst millGradeId = 'CartLineMillGrade';\r\n\r\n/**\r\n * Interface for add to cart resources.\r\n */\r\nexport interface IAddToCartResources {\r\n goToCartText: string;\r\n continueShoppingText: string;\r\n closeNotificationLabel: string;\r\n headerItemOneText: string;\r\n headerItemFormatText: string;\r\n headerLinesFormatText?: string;\r\n headerMessageText: string;\r\n freePriceText: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n addedQuantityText: string;\r\n buyAgainNotificationTitle?: string;\r\n buyAgainNotificationCloseAriaLabel?: string;\r\n validationErrorMessage?: string;\r\n oneErrorText?: string;\r\n multiErrorsText?: string;\r\n}\r\n\r\n/**\r\n * Interface for add to cart components props.\r\n */\r\nexport interface IAddToCartComponentProps extends IComponentProps<{ product: SimpleProduct; price?: ProductPrice } | undefined> {\r\n className?: string;\r\n addToCartText: string;\r\n outOfStockText?: string;\r\n disabled?: boolean;\r\n quantity?: number;\r\n navigationUrl?: string;\r\n productAvailability?: ProductAvailableQuantity;\r\n getSelectedProduct?: Promise;\r\n isNavigationToCartPageDisabled?: boolean;\r\n shouldSkipSiteSettings?: boolean;\r\n addToCartArialLabel?: string;\r\n products?: {\r\n productId: number;\r\n quantity: number;\r\n catalogId?: number;\r\n UOM?: string;\r\n }[];\r\n orderDetailsProducts?: OrderDetailsProduct[];\r\n hasAvailableProducts?: boolean;\r\n imageSettings?: IImageSettings;\r\n gridSettings?: IGridSettings;\r\n\r\n isLoading?: boolean;\r\n isUpdatingDimension?: boolean;\r\n isLoadingDeliveryOptions?: boolean;\r\n isUpdatingDeliveryOptions?: boolean;\r\n isAddServiceItemToCart?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPriceAmount?: number;\r\n isOrderQuantityLimitsFeatureEnabled?: boolean;\r\n\r\n dialogStrings?: IAddToCartResources;\r\n\r\n telemetryContent?: ITelemetryContent;\r\n\r\n catalogId?: number;\r\n\r\n isCustomPriceSelected?: boolean;\r\n maximumKeyInPrice?: number;\r\n minimumKeyInPrice?: number;\r\n defaultMaximumKeyInPrice?: number;\r\n defaultMinimumKeyInPrice?: number;\r\n isProductQuantityLoading?: boolean;\r\n\r\n onAdd?(result: ICartActionResult): void;\r\n onError?(result: IAddToCartFailureResult): void;\r\n changeUpdatingDimension?(isUpdatingDimension: boolean): void;\r\n changeUpdatingDeliveryOptions?(isUpdatingDeliveryOptions: boolean): void;\r\n}\r\n\r\n/**\r\n * Cart action Failure reason type.\r\n */\r\nexport declare type ICartActionFailureReason =\r\n | 'EMPTYINPUT'\r\n | 'MISSINGDIMENSION'\r\n | 'OUTOFSTOCK'\r\n | 'CARTACTIONFAILED'\r\n | 'INVALIDCUSTOMAMOUNT';\r\n\r\n/**\r\n * Interface for add to cart failure result.\r\n */\r\nexport interface IAddToCartFailureResult {\r\n failureReason: ICartActionFailureReason;\r\n\r\n stockLeft?: number;\r\n cartActionResult?: ICartActionResult;\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\n/**\r\n * This setting defines the experience when a product is added to cart. Corresponds to the configuration in Fabrikam.\r\n */\r\nexport enum AddToCartBehavior {\r\n /**\r\n * Navigate to cart page.\r\n */\r\n goToCart = 'goToCart',\r\n\r\n /**\r\n * Show item added to cart popup.\r\n */\r\n showModal = 'showModal',\r\n\r\n /**\r\n * Show mini cart popup.\r\n */\r\n showMiniCart = 'showMiniCart',\r\n\r\n /**\r\n * Show item added to cart notification.\r\n */\r\n showNotification = 'showNotification',\r\n\r\n /**\r\n * Do nothing and stay on the page.\r\n */\r\n nothing = 'nothing'\r\n}\r\n\r\nconst zero = 0;\r\nconst defaultQuantity = 1;\r\n\r\n/**\r\n * The propagate result.\r\n * @param props -- The add to cart component props.\r\n * @param result -- The cart action result.\r\n */\r\nconst propagateResult = (props: IAddToCartComponentProps, result: ICartActionResult): void => {\r\n if (props.onAdd) {\r\n props.onAdd(result);\r\n }\r\n};\r\n\r\n/**\r\n * The propagate error.\r\n * @param props -- The add to cart component props.\r\n * @param result -- The add to cart failure result.\r\n */\r\nconst propagateError = (props: IAddToCartComponentProps, result: IAddToCartFailureResult): void => {\r\n if (props.onError) {\r\n props.onError(result);\r\n }\r\n};\r\n\r\n/**\r\n * Retrieves add to cart input from the component props.\r\n * @param props - Add to cart component props.\r\n * @returns Add to cart input.\r\n */\r\n const getAddToCartInputFromProps = async (props: IAddToCartComponentProps) => {\r\n\r\n // @CUSTOM: filters out buying again service items\r\n const products = props.orderDetailsProducts?.filter(product => {\r\n return !ObjectExtensions.isNullOrUndefined(product.simpleProduct) && product.simpleProduct.ItemTypeValue !== ReleasedProductType.Service;\r\n });\r\n\r\n // Custome end\r\n\r\n const input = products?.map(product => {\r\n\r\n // @CUSTOM: set extension properties with milling attribute from sales line\r\n const milledAttribute = product.salesLine.AttributeValues?.find(attribute => {\r\n return attribute.Name === millGradeId;\r\n }) as AttributeTextValue;\r\n\r\n if (milledAttribute?.TextValue) {\r\n // forcing extra layer into extension properties for selected adding to cart line attributes\r\n // @ts-expect-error\r\n product.simpleProduct?.ExtensionProperties?.push({ Key: 'LineAttributes', Value: { CartLineMillGrade: milledAttribute.TextValue } });\r\n }\r\n\r\n return {\r\n product: product.simpleProduct!,\r\n count: ObjectExtensions.isNullOrUndefined(product.salesLine.Quantity) ? defaultQuantity : product.salesLine.Quantity,\r\n catalogId: product.salesLine.CatalogId,\r\n UOM: product.salesLine.UnitOfMeasureSymbol // @CUSTOM: added UOM\r\n };\r\n });\r\n\r\n if (ArrayExtensions.hasElements(input)) {\r\n return input;\r\n }\r\n\r\n if (ArrayExtensions.hasElements(props.products)) {\r\n const actionContext = props.context.actionContext;\r\n const apiSettings = actionContext.requestContext.apiSettings;\r\n\r\n const searchCriteriaInput: ProductSearchCriteria = {\r\n Context: {\r\n ChannelId: apiSettings.channelId,\r\n CatalogId: props.catalogId ?? getCatalogId(props.context.actionContext.requestContext)\r\n },\r\n IncludeAttributes: false,\r\n Ids: props.products.map(product => product.productId)\r\n };\r\n\r\n const searchResult = await ProductsDataActions.searchByCriteriaAsync({ callerContext: actionContext }, searchCriteriaInput);\r\n const productSearchResultsWithImages = searchResult.map(productSearchResult => {\r\n const newProductSearchResult = { ...productSearchResult };\r\n const newImageUrl = generateProductImageUrl(newProductSearchResult, apiSettings);\r\n\r\n if (newImageUrl) {\r\n newProductSearchResult.PrimaryImageUrl = newImageUrl;\r\n }\r\n\r\n return newProductSearchResult;\r\n });\r\n\r\n return props.products.map(item => {\r\n const productData = productSearchResultsWithImages.find(product => product.RecordId === item.productId);\r\n let simpleProduct: SimpleProduct;\r\n if (productData) {\r\n simpleProduct = {\r\n ...productData,\r\n ProductTypeValue: ProductType.Variant,\r\n AdjustedPrice: productData.Price,\r\n BasePrice: productData.BasePrice ?? productData.Price\r\n };\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Cast to simple product since only record id is available.\r\n simpleProduct = {\r\n RecordId: item.productId\r\n } as SimpleProduct;\r\n }\r\n\r\n return {\r\n product: simpleProduct,\r\n count: item.quantity,\r\n catalogId: item.catalogId,\r\n UOM: item.UOM // @CUSTOM: added UOM\r\n };\r\n });\r\n }\r\n\r\n if (props.data?.product) {\r\n return [\r\n {\r\n product: props.data.product,\r\n count: props.quantity ?? defaultQuantity,\r\n catalogId: props.catalogId,\r\n UOM: props.data.product.DefaultUnitOfMeasure // @CUSTOM: added UOM\r\n }\r\n ];\r\n }\r\n\r\n return [];\r\n};\r\n\r\n/**\r\n * Add one item to cart when it is not buy again.\r\n * @param props -- The props.\r\n * @param setDisabled -- The set disable call back.\r\n * @param openModal -- The open modal call back.\r\n */\r\nconst addOneItemToCart = async (\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n openModal: (opened: boolean) => void\r\n): Promise => {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\r\n const addToCartBehavior = props.context.app.config.addToCartBehavior;\r\n const data = props.data;\r\n\r\n const addToCartInput = await getAddToCartInputFromProps(props);\r\n const product = addToCartInput[0].product;\r\n const quantity = addToCartInput[0].count;\r\n\r\n // @CUSTOM: added UOM\r\n const UOM = addToCartInput[0].UOM;\r\n product.DefaultUnitOfMeasure = UOM;\r\n\r\n // @CUSTOM: get catalog id for compare on cart line merging\r\n const catalogId = addToCartInput[0].catalogId || 0;\r\n\r\n const cartState = await getCartState(props.context.actionContext);\r\n\r\n // @CUSTOM: checks if item is already in cart and updates quantity instead of creating a new line\r\n addOverridesToCartState(cartState);\r\n let addToCartResult: ICartActionResult;\r\n\r\n // check for custom attributes passed through extension properties\r\n const customAttributes = product.ExtensionProperties?.find(atr => {\r\n return atr.Key === 'LineAttributes';\r\n });\r\n\r\n // get all cart lines with the same id as item being added\r\n // and matching catalog id\r\n const productMatches = cartState.cart.CartLines?.filter(cartLine => {\r\n return cartLine.ProductId === product.RecordId && cartLine.CatalogId === catalogId && cartLine.UnitOfMeasureSymbol === UOM;\r\n });\r\n\r\n const cartCombineTable = props.context.app.config.cartLineCombineTable as CartLineCombineTable || [];\r\n\r\n // check to see if item already in cart\r\n const itemInCart = productMatches?.find(cartLine => productPropertiesMatch(cartCombineTable, cartLine, customAttributes));\r\n\r\n // if item match found then we can just update the line qty\r\n if (props.quantity && itemInCart) {\r\n addToCartResult = await CartUtilities.addToExistingLine(cartState, itemInCart, props.context, props.quantity, props.productAvailability);\r\n } else {\r\n\r\n // include custom attributes in the input\r\n const productToAddInput: AddProductsToCartWithAttribs = {\r\n product,\r\n count: quantity,\r\n availableQuantity: props.productAvailability?.AvailableQuantity,\r\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: props.isOrderQuantityLimitsFeatureEnabled },\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\r\n enableStockCheck: props.context.app.config.enableStockCheck,\r\n isPriceKeyedIn: props.isPriceKeyedIn,\r\n customPrice: props.isPriceKeyedIn ? props.customPriceAmount : undefined,\r\n isAddEmailDeliveryItemToCart: props.isAddEmailDeliveryItemToCart,\r\n shouldSkipSiteSettings: props.shouldSkipSiteSettings,\r\n catalogId: addToCartInput[0].catalogId,\r\n customAttributes: customAttributes?.Value // @CUSTOM\r\n };\r\n\r\n addToCartResult = await cartState.addProductToCart(productToAddInput);\r\n }\r\n // Customization end\r\n if (addToCartResult.status === 'SUCCESS') {\r\n\r\n\r\n // @CUSTOM: publish add to cart for analytics\r\n const formattedAttribs = {};\r\n\r\n for (var key in customAttributes?.Value) {\r\n if (customAttributes?.Value[key]) {\r\n formattedAttribs[key] = customAttributes.Value[key];\r\n }\r\n }\r\n\r\n const gaData: AddToCartEvent = {\r\n itemID: product.ItemId || '',\r\n recordID: product.MasterProductId || product.RecordId,\r\n variant: product.RecordId.toString(),\r\n name: product.Name || '',\r\n quantity: quantity,\r\n price: props.data?.price?.CustomerContextualPrice || 0,\r\n discount: props.data?.price?.DiscountAmount,\r\n currency: props.context.request.channel?.Currency || 'USD',\r\n unitOfMeasure: UOM,\r\n attributes: formattedAttribs\r\n };\r\n\r\n publish('addToCart', gaData);\r\n\r\n if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal) {\r\n setDisabled(false);\r\n openModal(true);\r\n } else if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showNotification) {\r\n setDisabled(false);\r\n const notification = new ItemSuccessfullyAddedToCartNotification(\r\n props.context,\r\n props.dialogStrings,\r\n props.imageSettings,\r\n props.gridSettings,\r\n product,\r\n data?.price,\r\n quantity,\r\n props.navigationUrl,\r\n props.telemetryContent!,\r\n props.id,\r\n props.typeName\r\n );\r\n NotificationsManager.instance().addNotification(notification);\r\n } else if (\r\n MsDyn365.isBrowser &&\r\n props.navigationUrl &&\r\n !props.isNavigationToCartPageDisabled &&\r\n (addToCartBehavior === undefined || addToCartBehavior === AddToCartBehavior.goToCart)\r\n ) {\r\n window.location.assign(props.navigationUrl);\r\n } else {\r\n setDisabled(false);\r\n }\r\n propagateResult(props, addToCartResult);\r\n } else {\r\n NotificationsManager.instance().addNotification(\r\n new ErrorNotification(\r\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\r\n props.dialogStrings?.closeNotificationLabel ?? ''\r\n )\r\n );\r\n\r\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult });\r\n setDisabled(false);\r\n }\r\n};\r\n\r\n/**\r\n * Callback to handle success of adding to cart.\r\n * @param props - Add to cart component props.\r\n * @param setDisabled - Callback to update disabled state of the component.\r\n * @param setItemsAddedToCartDialogOpen - Callback to update disabled state of the component.\r\n * @param setErrorMessage - Callback to update error message state of the component.\r\n * @param cartState - Current cart state.\r\n * @param addToCartInput - Input used for adding to cart.\r\n * @param addToCartResult - Result of adding to cart.\r\n */\r\nconst handleAddItemsToCartSuccess = async (\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\r\n setErrorMessage: (message: string) => void,\r\n cartState: ICartState,\r\n addToCartInput: {\r\n product: SimpleProduct;\r\n count: number;\r\n }[],\r\n addToCartResult: ICartActionResult\r\n) => {\r\n // Validate cart for line errors.\r\n const validationResult: CartLineValidationResults = await CartsDataActions.validateForCheckoutAsync(\r\n { callerContext: props.context.actionContext, bypassCache: 'none' },\r\n cartState.cart.Id,\r\n cartState.cart.Version\r\n );\r\n const errorCount = (validationResult.ValidationFailuresByCartLines ?? []).length;\r\n const singleErrorCount = 1;\r\n const errorText = errorCount === singleErrorCount ? props.dialogStrings?.oneErrorText : props.dialogStrings?.multiErrorsText;\r\n const errorMessage =\r\n errorCount > zero ? format(props.dialogStrings?.validationErrorMessage ?? '', errorCount.toString(), errorText) : '';\r\n\r\n setErrorMessage(errorMessage);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\r\n const addToCartBehavior = props.context.app.config.addToCartBehavior;\r\n\r\n if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal) {\r\n setDisabled(false);\r\n setItemsAddedToCartDialogOpen(true);\r\n } else if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showNotification) {\r\n setDisabled(false);\r\n const itemsAddedResource: IItemsAddedToCartResources = {\r\n viewCartButtonText: props.dialogStrings.goToCartText,\r\n closeButtonLabel: props.dialogStrings.closeNotificationLabel,\r\n itemsAddedToCartHeaderText: props.dialogStrings.headerMessageText,\r\n itemsAddedToCartFormatText: props.dialogStrings.headerItemFormatText,\r\n linesAddedToCartFormatText: props.dialogStrings.headerLinesFormatText ?? '{0}',\r\n itemsAddedValidationErrorMessage: errorMessage\r\n };\r\n\r\n const notification = new MultiItemsSuccessfullyAddedToCartNotification(\r\n props.context,\r\n itemsAddedResource,\r\n props.imageSettings,\r\n props.gridSettings,\r\n addToCartInput,\r\n props.navigationUrl,\r\n props.telemetryContent!,\r\n props.id,\r\n props.typeName\r\n );\r\n NotificationsManager.instance().addNotification(notification);\r\n } else if (\r\n MsDyn365.isBrowser &&\r\n props.navigationUrl &&\r\n !props.isNavigationToCartPageDisabled &&\r\n (addToCartBehavior === undefined || addToCartBehavior === AddToCartBehavior.goToCart)\r\n ) {\r\n window.location.assign(props.navigationUrl);\r\n } else {\r\n setDisabled(false);\r\n }\r\n propagateResult(props, addToCartResult);\r\n};\r\n\r\n/**\r\n * Add one or multi item to cart from buy again.\r\n * @param props -- The props.\r\n * @param setDisabled -- The set disable call back.\r\n * @param setItemsAddedToCartDialogOpen -- The open modal call back.\r\n * @param setErrorMessage -- The set error message call back.\r\n */\r\nconst addItemsToCart = async (\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\r\n setErrorMessage: (message: string) => void\r\n): Promise => {\r\n const addToCartInput = await getAddToCartInputFromProps(props);\r\n\r\n if (!ArrayExtensions.hasElements(addToCartInput)) {\r\n return;\r\n }\r\n\r\n const cartState = await getCartState(props.context.actionContext);\r\n const addToCartResult = await cartState.addProductsToCart(addToCartInput);\r\n\r\n if (addToCartResult.status === 'SUCCESS') {\r\n await handleAddItemsToCartSuccess(\r\n props,\r\n setDisabled,\r\n setItemsAddedToCartDialogOpen,\r\n setErrorMessage,\r\n cartState,\r\n addToCartInput,\r\n addToCartResult\r\n );\r\n } else {\r\n if (props.dialogStrings?.buyAgainNotificationTitle) {\r\n // For buy again show simple error notification.\r\n NotificationsManager.instance().addNotification(\r\n new ErrorNotification(\r\n props.dialogStrings.buyAgainNotificationTitle,\r\n props.dialogStrings.buyAgainNotificationCloseAriaLabel ?? ''\r\n )\r\n );\r\n } else {\r\n NotificationsManager.instance().addNotification(\r\n new ErrorNotification(\r\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\r\n props.dialogStrings?.closeNotificationLabel ?? ''\r\n )\r\n );\r\n }\r\n\r\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult });\r\n setDisabled(false);\r\n }\r\n};\r\n\r\n/**\r\n * Interface for add to cart component.\r\n */\r\nexport interface IAddtoCartComponent extends IComponent {\r\n onClick(): (event: React.MouseEvent, props: IAddToCartComponentProps) => void;\r\n}\r\n\r\n/**\r\n * On click function.\r\n * @param _event - The mouse event.\r\n * @param props - The props.\r\n * @param setDisabled - Flag to define whether the element is disabled.\r\n * @param openModal - Flag to specify if it should open in a modal window.\r\n * @param setItemsAddedToCartDialogOpen - Sets items added to cart while dialog is open.\r\n * @param setErrorMessage - Error message.\r\n */\r\nconst onClick = async (\r\n _event: React.MouseEvent,\r\n props: IAddToCartComponentProps,\r\n setDisabled: (disabled: boolean) => void,\r\n openModal: (opened: boolean) => void,\r\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\r\n setErrorMessage: (message: string) => void\r\n): Promise => {\r\n if (!ArrayExtensions.hasElements(props.products)) {\r\n const cartError = addToCartError(props);\r\n\r\n if (cartError) {\r\n propagateError(props, cartError);\r\n return;\r\n }\r\n\r\n setDisabled(true);\r\n }\r\n\r\n const hasOrderDetailsProducts =\r\n ArrayExtensions.hasElements(props.orderDetailsProducts) && props.orderDetailsProducts.length > defaultQuantity;\r\n const hasProducts = ArrayExtensions.hasElements(props.products) && props.products.length > defaultQuantity;\r\n\r\n const hasMultipleProducts = hasOrderDetailsProducts || hasProducts;\r\n\r\n if (props.shouldSkipSiteSettings && hasMultipleProducts) {\r\n await addItemsToCart(props, setDisabled, setItemsAddedToCartDialogOpen, setErrorMessage);\r\n } else {\r\n await addOneItemToCart(props, setDisabled, openModal);\r\n }\r\n};\r\n\r\n/**\r\n * Add to cart component action constant.\r\n */\r\n const AddToCartComponentActions = {\r\n onClick\r\n};\r\n\r\n/**\r\n * Add to cart component.\r\n * @param props - The props.\r\n * @returns - The add to cart component.\r\n */\r\nexport const AddToCartFunctionalComponent: React.FC = (props: IAddToCartComponentProps) => {\r\n const [disabled, setDisabled] = useState(false);\r\n const [modalOpen, setModalOpen] = useState(false);\r\n const [isItemsAddedToCartDialogOpen, setItemsAddedToCartDialogOpen] = useState(false);\r\n const [errorMessage, setErrorMessage] = useState('');\r\n const [addToCartInput, setAddToCartInput] = useState<\r\n {\r\n product: SimpleProduct;\r\n count: number;\r\n }[]\r\n >([]);\r\n\r\n const onClickHandler = async (event: React.MouseEvent) => {\r\n await AddToCartComponentActions.onClick(event, props, setDisabled, setModalOpen, setItemsAddedToCartDialogOpen, setErrorMessage);\r\n };\r\n\r\n /**\r\n * Close dialog.\r\n */\r\n const closeItemsAddedToCartDialog = React.useCallback(() => {\r\n setItemsAddedToCartDialogOpen(false);\r\n }, []);\r\n\r\n const priceComponent = props.data?.price ? (\r\n \r\n ) : (\r\n ''\r\n );\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'msc-add-to-cart',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data?.product, price: props.data?.price },\r\n dialogStrings: props.dialogStrings,\r\n imageSettings: props.imageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: props.quantity !== undefined ? props.quantity : defaultQuantity,\r\n priceComponent,\r\n navigationUrl: props.navigationUrl,\r\n modalOpen,\r\n setModalOpen,\r\n telemetryContent: props.telemetryContent\r\n };\r\n\r\n const itemsAddedResource: IItemsAddedToCartResources = {\r\n viewCartButtonText: props.dialogStrings?.goToCartText ?? '',\r\n closeButtonLabel: props.dialogStrings?.closeNotificationLabel ?? 'Close',\r\n itemsAddedToCartHeaderText: props.dialogStrings?.headerMessageText ?? '',\r\n itemsAddedToCartFormatText: props.dialogStrings?.headerItemFormatText ?? '',\r\n linesAddedToCartFormatText: props.dialogStrings?.headerLinesFormatText ?? '{0}',\r\n itemsAddedValidationErrorMessage: errorMessage\r\n };\r\n\r\n const renderModalPopup = ;\r\n const label = getLinkText(props);\r\n const payload = getPayloadObject(TelemetryEvent.AddToCart, props.telemetryContent!, label, '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\r\n const buttonClassName = props.shouldSkipSiteSettings ? '' : 'msc-add-to-cart ';\r\n\r\n React.useEffect(() => {\r\n /**\r\n * Retrieves add to cart input and updates the state.\r\n */\r\n const retrieveAddToCartInput = async () => {\r\n const retrievedInput = await getAddToCartInputFromProps(props);\r\n setAddToCartInput(retrievedInput);\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call async method as per the documentation of react useEffect.\r\n retrieveAddToCartInput();\r\n }, [props, setAddToCartInput]);\r\n\r\n return (\r\n <>\r\n {renderModalPopup}\r\n \r\n {label}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\n// Set default props\r\nAddToCartFunctionalComponent.defaultProps = {\r\n quantity: defaultQuantity\r\n};\r\n\r\n/**\r\n * Resolves whether product is in stock.\r\n * @param props - The add to cart component props.\r\n * @returns Gets the link text.\r\n */\r\nconst getLinkText = (props: IAddToCartComponentProps): string => {\r\n return shouldShowOutOfStock(props, false) && props.outOfStockText ? props.outOfStockText : props.addToCartText;\r\n};\r\n\r\n/**\r\n * Resolves whether product is in stock.\r\n * @param props - The add to cart component props.\r\n * @returns The add to cart failure result.\r\n */\r\nconst addToCartError = (props: IAddToCartComponentProps): IAddToCartFailureResult | undefined => {\r\n const {\r\n data,\r\n productAvailability,\r\n isCustomPriceSelected,\r\n customPriceAmount,\r\n maximumKeyInPrice,\r\n minimumKeyInPrice,\r\n defaultMaximumKeyInPrice = 100,\r\n defaultMinimumKeyInPrice = 10\r\n } = props;\r\n\r\n if (!data || !data.product.RecordId) {\r\n // No product exists, won't be able to add to cart\r\n return { failureReason: 'EMPTYINPUT' };\r\n }\r\n\r\n if (data.product.Dimensions) {\r\n const missingDimensions = data.product.Dimensions.filter(\r\n dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value)\r\n );\r\n\r\n if (ArrayExtensions.hasElements(missingDimensions)) {\r\n // At least one dimension with no value exists on the product, won't be able to add to cart\r\n return { failureReason: 'MISSINGDIMENSION', missingDimensions };\r\n }\r\n }\r\n\r\n if (shouldShowOutOfStock(props, true)) {\r\n const defaultAvailableQuantity = 0; // Showing as out of stock if no available products found.\r\n const availableQuantity = productAvailability?.AvailableQuantity ?? defaultAvailableQuantity;\r\n const stockLeft = Math.max(availableQuantity, defaultAvailableQuantity);\r\n\r\n return { failureReason: 'OUTOFSTOCK', stockLeft };\r\n }\r\n\r\n // When Custom price is selected, if there is no keyed-in price or keyed-in price is out of limit, should return error.\r\n if (\r\n isCustomPriceSelected &&\r\n (!customPriceAmount ||\r\n customPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice) ||\r\n customPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice))\r\n ) {\r\n return { failureReason: 'INVALIDCUSTOMAMOUNT' };\r\n }\r\n\r\n // Only allow adding to cart if not showing out of stock\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Resolves whether product is in stock.\r\n * @param props - The add to cart component props.\r\n * @param includeCurrentQuantity - Flag to specify whether current quantity should be included.\r\n * @returns The dialog element.\r\n */\r\nconst shouldShowOutOfStock = (props: IAddToCartComponentProps, includeCurrentQuantity: boolean): boolean => {\r\n if (props.context.app.config.enableStockCheck === undefined || props.context.app.config.enableStockCheck === false) {\r\n return false;\r\n }\r\n\r\n // When skip site settings do not need show out of stock on adding to cart\r\n if (props.shouldSkipSiteSettings) {\r\n emitAvailability(true, props.context.actionContext); // @CUSTOM: Emit result\r\n return false;\r\n }\r\n\r\n if (\r\n props.isLoading ||\r\n props.isProductQuantityLoading ||\r\n props.isUpdatingDimension ||\r\n props.isLoadingDeliveryOptions ||\r\n props.isUpdatingDeliveryOptions ||\r\n props.isAddServiceItemToCart\r\n ) {\r\n // Out of stock turn off, don't bother showing out of stock\r\n return false;\r\n }\r\n\r\n if (!props.data || !props.data.product.RecordId) {\r\n // No product exists, don't bother showing out of stock\r\n return false;\r\n }\r\n\r\n const hasAvailableProducts = props.hasAvailableProducts ?? true;\r\n if (!hasAvailableProducts) {\r\n emitAvailability(false, props.context.actionContext); // @CUSTOM: Emit result\r\n return true;\r\n }\r\n\r\n if (props.data.product.Dimensions) {\r\n if (props.data.product.Dimensions.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\r\n // At least one dimension with no value exists on the product, so also don't show out of stock\r\n emitAvailability(true, props.context.actionContext); // @CUSTOM: Emit result\r\n return false;\r\n }\r\n }\r\n\r\n const includedQuantityNumber = includeCurrentQuantity && props.quantity ? props.quantity : defaultQuantity;\r\n\r\n //----------------------------------------------------------\r\n // @CUSTOM: Emit result before returning it\r\n //----------------------------------------------------------\r\n const result = !((props.productAvailability &&\r\n props.productAvailability.AvailableQuantity !== undefined &&\r\n props.productAvailability.AvailableQuantity >= includedQuantityNumber));\r\n\r\n emitAvailability(!result, props.context.actionContext);\r\n return result;\r\n //----------------------------------------------------------\r\n};\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Updates the shared state in the cache,\r\n// which is being Observed elsewhere\r\n//----------------------------------------------------------\r\nconst emitAvailability = (isAvailable: Boolean, ctx: IActionContext): void => {\r\n const newValue: SharedAvailability = { isAvailable };\r\n ctx.update(new SharedAvailabilityInput(), newValue);\r\n};\r\n//----------------------------------------------------------\r\n\r\nconst isIntermediateState = (props: IAddToCartComponentProps): boolean => {\r\n if (props.data?.product.Dimensions) {\r\n if (props.data.product.Dimensions.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\r\n // At least one dimension with no value exists on the product, so also not in intermediate state\r\n return false;\r\n }\r\n }\r\n\r\n if (!props.isLoading && !props.isUpdatingDimension && !props.isLoadingDeliveryOptions && !props.isUpdatingDeliveryOptions) {\r\n return false;\r\n }\r\n\r\n return true;\r\n};\r\n\r\n/**\r\n * @CUSTOM: addtocart component\r\n * Checks if all attribute values listed in global config match between item in cart and item being added\r\n */\r\nexport const productPropertiesMatch = (cartLineCombineTable: CartLineCombineTable, productMatch: CartLine, productAttr: CommerceProperty | undefined): boolean => {\r\n\r\n let isMatch = true;\r\n\r\n const cartItemAttrs: AttributeTextValue[] = productMatch?.AttributeValues || [];\r\n const productToAddAttrs = productAttr?.Value || {};\r\n\r\n cartLineCombineTable.forEach(extension => {\r\n\r\n // checks attributes only listed in global config\r\n const cartAttr = cartItemAttrs.find(cartAttr => cartAttr.Name === extension.id);\r\n const cartAttrValue = cartAttr?.TextValue;\r\n\r\n const addedProductAttrValue = productToAddAttrs[extension.id] ? productToAddAttrs[extension.id] : undefined;\r\n\r\n // if the attribute value on cart doesnt match the product being added then does not need combining\r\n if (cartAttrValue !== addedProductAttrValue) {\r\n isMatch = false;\r\n }\r\n\r\n });\r\n\r\n return isMatch;\r\n\r\n};\r\n\r\n// @ts-expect-error\r\nexport const AddToCartComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'AddToCart',\r\n { component: AddToCartFunctionalComponent, ...AddToCartComponentActions }\r\n);\r\n\r\nexport default AddToCartComponent;","//==============================================================================\r\n// Analytics Event Dispatcher (Simple Pub-Sub system)\r\n//\r\n// This module receives events and forwards them to the appropriate handlers\r\n// Subscriptions are managed using a subscriber ID to aid in unsubscribing\r\n//\r\n// NOTE: Singletons aren't compatible with SSR. This module acts as a singleton,\r\n// maintaining its data as a global. Modules MUST call subscribe on the client\r\n// ONLY (via componentDidMount).\r\n//\r\n// @TODO: Currently, only client-side events will be processed. Events generated\r\n// during server-side renders will be lost. If we move data to a data action\r\n// it can be persisted from server to client. That will allow us to queue up\r\n// events generated on the server or before subscriptions occur, and emit\r\n// them immediately upon subscription.\r\n//==============================================================================\r\nimport { EventHandler } from \"./analytics-events\";\r\n\r\n//==============================================================================\r\n// INTERFACES\r\n//==============================================================================\r\n\r\n// List of subscribers to a single event\r\ninterface EventSubscribers {\r\n [subscriber: string]: EventHandler;\r\n}\r\n\r\n//==============================================================================\r\n// GLOBALS\r\n//==============================================================================\r\n\r\n// List of subscriptions, organized by event name and then subscriber name\r\nconst subscriptions: { [eventName: string]: EventSubscribers } = {};\r\n\r\n//==============================================================================\r\n// FUNCTIONS\r\n//==============================================================================\r\n\r\n//==========================================================\r\n// Called by event emitters when an event occurs\r\n//\r\n// NOTE: This should only be called on the client! Events on\r\n// the server will be lost. They should instead be queued\r\n// via a data action cache.\r\n//==========================================================\r\nexport function publish(eventName: string, eventData: unknown): void {\r\n\r\n // Get the list of subscribers for this event\r\n const subscribers = Object.keys(subscriptions[eventName] || {});\r\n\r\n // Notify each subscriber\r\n subscribers.forEach(subscriber => subscriptions[eventName][subscriber](eventData));\r\n}\r\n\r\n//==========================================================\r\n// Called by event handlers when they self-register for events\r\n//==========================================================\r\nexport function subscribe(subscriber: string, eventName: string, handler: EventHandler): void {\r\n\r\n // If it's a new event, create an entry\r\n subscriptions[eventName] = subscriptions[eventName] || {};\r\n\r\n // Ensure this subscriber isn't already subscribed to this event\r\n if (subscriptions[eventName][subscriber]) {\r\n throw new Error(`Duplicate subscription request for ${subscriber}: ${eventName}`);\r\n }\r\n\r\n // Add the subscription\r\n subscriptions[eventName][subscriber] = handler;\r\n}\r\n\r\n//==========================================================\r\n// Unsubscribe from a single event\r\n//==========================================================\r\nexport function unsubscribe(subscriber: string, eventName: string): void {\r\n if (subscriptions[eventName] && subscriptions[eventName][subscriber]) {\r\n delete subscriptions[eventName][subscriber];\r\n }\r\n}\r\n","//==============================================================================\r\n// Tools to help read, write, and process cart header and line attributes\r\n//\r\n// There is currently no OOTB way to add attributes to cart lines when adding\r\n// products to the cart. We would have to add to the cart, then modify the\r\n// newly created line, using two separate retail server calls. Alternately,\r\n// low-level retail server calls could be used, followed by a cart refresh.\r\n// This optimizes the process by allowing a single call, even though the method\r\n// is not ideal.\r\n//==============================================================================\r\n\r\nimport { getCatalogId } from '@msdyn365-commerce/core';\r\nimport { CartLine, OrgUnitLocation, ReleasedProductType, SimpleProduct } from \"@msdyn365-commerce/retail-proxy\";\r\nimport { ICartActionResult, ICartState, BaseCartState, addProductToCartInternal, addProductsToCartInternal } from '@msdyn365-commerce/global-state';\r\n\r\n//==============================================================================\r\n// INTERFACES\r\n//==============================================================================\r\n\r\nexport interface AddProductsToCartWithAttribs {\r\n product: SimpleProduct;\r\n count?: number;\r\n location?: OrgUnitLocation;\r\n additionalProperties?: object;\r\n availableQuantity?: number;\r\n enableStockCheck?: boolean;\r\n isAddEmailDeliveryItemToCart?: boolean;\r\n isPriceKeyedIn?: boolean;\r\n customPrice?: number;\r\n shouldSkipSiteSettings?: boolean;\r\n catalogId?: number;\r\n deliveryMode?: string;\r\n customAttributes?: {};\r\n}\r\n\r\nexport interface SalesOrderAttribute {\r\n '@odata.type': \"#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue\",\r\n Name: string,\r\n TextValue: string,\r\n TextValueTranslations: [],\r\n ExtensionProperties: []\r\n}\r\n\r\n// Custon Extension: Product extension property id for milling service\r\nconst millingServiceId = \"MILLSERVICE\";\r\n\r\n//==============================================================================\r\n// Public Functions\r\n//==============================================================================\r\n\r\n//==========================================================\r\n// This replaces base functionality with our extended version\r\n//\r\n// Old school extensions like this are rightly frowned upon.\r\n// Any other method would be preferred, but there doesn't\r\n// appear to be a reasonable option at this time.\r\n//==========================================================\r\nexport function addOverridesToCartState(cartState: ICartState) {\r\n const extendedState = cartState as CustomBaseCartState;\r\n if (!extendedState.wasInjected) {\r\n extendedState.wasInjected = true;\r\n\r\n extendedState.addProductsToCart = CustomBaseCartState.prototype.addProductsToCartWithAttribs;\r\n extendedState.addProductToCart = CustomBaseCartState.prototype.addProductToCartWithAttribs;\r\n extendedState.baseRemoveCartLines = extendedState.removeCartLines;\r\n extendedState.removeCartLines = CustomBaseCartState.prototype.removeCartLinesOverride;\r\n\r\n }\r\n}\r\n\r\n//==========================================================\r\n// format custom attributes into attribute value structure\r\n//==========================================================\r\nfunction formatCustomAttributes(attributes: {}): SalesOrderAttribute[] {\r\n const formattedAttribs: SalesOrderAttribute[] = [];\r\n\r\n for (var key in attributes) {\r\n if (attributes[key]) {\r\n formattedAttribs.push({\r\n \"@odata.type\": \"#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue\",\r\n \"Name\": key,\r\n \"TextValue\": attributes[key],\r\n \"TextValueTranslations\": [],\r\n \"ExtensionProperties\": []\r\n });\r\n }\r\n }\r\n\r\n return formattedAttribs;\r\n}\r\n\r\n//==============================================================================\r\n// BaseCartState Overrides\r\n//==============================================================================\r\n\r\n//==========================================================\r\n// This is a direct replacement for CartState.addProduct(s)ToCart\r\n// that accepts line-level attributes\r\n//\r\n// TODO: When upgrading to newer versions of the SSK, be sure\r\n// to update this function!\r\n//==========================================================\r\nclass CustomBaseCartState extends BaseCartState {\r\n public wasInjected = false;\r\n\r\n public baseRemoveCartLines = this.removeCartLines;\r\n\r\n //----------------------------------------------------------\r\n //----------------------------------------------------------\r\n public async addProductsToCartWithAttribs(input: {\r\n product: SimpleProduct; count?: number; location?: OrgUnitLocation; additionalProperties?: object; availableQuantity?: number;\r\n enableStockCheck?: boolean; isAddEmailDeliveryItemToCart?: boolean; isPriceKeyedIn?: boolean; customPrice?: number; deliveryMode?: string; catalogId?: number; customAttributes?: {};\r\n }[]): Promise {\r\n\r\n return this._doAsyncAction(async () => {\r\n const internalInput: {\r\n cartLineToAdd: CartLine;\r\n availableQuantity?: number;\r\n isStockCheckEnabled?: boolean;\r\n isAddServiceItemToCart?: boolean;\r\n }[] = [];\r\n\r\n for (const inputItem of input) {\r\n const attributeValues = inputItem.customAttributes && formatCustomAttributes(inputItem.customAttributes);\r\n const cartLine: CartLine = {\r\n CatalogId: inputItem.catalogId ?? getCatalogId(this.actionContext.requestContext),\r\n Description: inputItem.product.Description,\r\n\r\n // TODO: Investigate this value and what it represents\r\n EntryMethodTypeValue: 3,\r\n ItemId: inputItem.product.ItemId,\r\n ProductId: inputItem.product.RecordId,\r\n Quantity: inputItem.count || 1,\r\n TrackingId: '',\r\n UnitOfMeasureSymbol: inputItem.product.DefaultUnitOfMeasure,\r\n IsPriceKeyedIn: inputItem.isPriceKeyedIn,\r\n IsGiftCardLine: inputItem.product.IsGiftCard,\r\n Price: inputItem.customPrice ? inputItem.customPrice : inputItem.product.Price,\r\n AttributeValues: attributeValues\r\n };\r\n\r\n if (inputItem.location) {\r\n if (!this.actionContext.requestContext.channel) {\r\n return { status: 'FAILED' };\r\n }\r\n\r\n // If curbside pick is not available use the default one\r\n if (inputItem.deliveryMode !== undefined) {\r\n cartLine.DeliveryMode = inputItem.deliveryMode;\r\n } else {\r\n cartLine.DeliveryMode = this.actionContext.requestContext.channel.PickupDeliveryModeCode;\r\n }\r\n\r\n cartLine.FulfillmentStoreId = inputItem.location.OrgUnitNumber;\r\n cartLine.WarehouseId = inputItem.location.InventoryLocationId;\r\n // @ts-expect-error\r\n cartLine.ShippingAddress = this._buildAddressFromOrgUnitLocation(inputItem.location);\r\n }\r\n\r\n if (inputItem.isAddEmailDeliveryItemToCart) {\r\n cartLine.DeliveryMode = this.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n }\r\n\r\n // Check if the product is service or not by product type\r\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\r\n const isAddServiceItemToCart = inputItem.product.ItemTypeValue === PRODUCTASSERVICE;\r\n\r\n internalInput.push({\r\n cartLineToAdd: cartLine,\r\n availableQuantity: inputItem.availableQuantity,\r\n isStockCheckEnabled: inputItem.enableStockCheck,\r\n isAddServiceItemToCart\r\n });\r\n }\r\n\r\n // @ts-expect-error\r\n return this._doCartOperationWithRetry(() => addProductsToCartInternal(\r\n this.cart,\r\n this.actionContext,\r\n internalInput\r\n ));\r\n });\r\n }\r\n\r\n //----------------------------------------------------------\r\n //----------------------------------------------------------\r\n public async addProductToCartWithAttribs(input: {\r\n product: SimpleProduct; count?: number; location?: OrgUnitLocation; additionalProperties?: object; availableQuantity?: number;\r\n enableStockCheck?: boolean; isAddEmailDeliveryItemToCart?: boolean; isPriceKeyedIn?: boolean; customPrice?: number; deliveryMode?: string;\r\n shouldSkipSiteSettings?: boolean; catalogId?: number; customAttributes?: {};\r\n }): Promise {\r\n\r\n return this._doAsyncAction(async () => {\r\n const attributeValues = input.customAttributes && formatCustomAttributes(input.customAttributes);\r\n const cartLine: CartLine = {\r\n CatalogId: input.catalogId ?? getCatalogId(this.actionContext.requestContext),\r\n Description: input.product.Description,\r\n\r\n // TODO: Investigate this value and what it represents\r\n EntryMethodTypeValue: 3,\r\n ItemId: input.product.ItemId,\r\n ProductId: input.product.RecordId,\r\n Quantity: input.count || 1,\r\n TrackingId: '',\r\n UnitOfMeasureSymbol: input.product.DefaultUnitOfMeasure,\r\n IsPriceKeyedIn: input.isPriceKeyedIn,\r\n IsGiftCardLine: input.product.IsGiftCard,\r\n Price: input.customPrice ? input.customPrice : input.product.Price,\r\n AttributeValues: attributeValues\r\n };\r\n\r\n if (input.location) {\r\n if (!this.actionContext.requestContext.channel) {\r\n return { status: 'FAILED' };\r\n }\r\n\r\n // If curbside pick is not available use the default one\r\n if (input.deliveryMode !== undefined) {\r\n cartLine.DeliveryMode = input.deliveryMode;\r\n } else {\r\n cartLine.DeliveryMode = this.actionContext.requestContext.channel.PickupDeliveryModeCode;\r\n }\r\n\r\n cartLine.FulfillmentStoreId = input.location.OrgUnitNumber;\r\n cartLine.WarehouseId = input.location.InventoryLocationId;\r\n // @ts-expect-error\r\n cartLine.ShippingAddress = this._buildAddressFromOrgUnitLocation(input.location);\r\n }\r\n\r\n if (input.isAddEmailDeliveryItemToCart) {\r\n if (!this.actionContext.requestContext.channel) {\r\n return { status: 'FAILED' };\r\n }\r\n\r\n cartLine.DeliveryMode = this.actionContext.requestContext.channel.EmailDeliveryModeCode;\r\n }\r\n\r\n // Check if the product is service or not by product type\r\n const isAddServiceItemToCart = input.product.ItemTypeValue === ReleasedProductType.Service;\r\n\r\n // @ts-expect-error\r\n const orderQuantityLimitsFeatureIsEnabled: boolean = !!input.additionalProperties?.orderQuantityLimitsFeatureIsEnabled;\r\n const isMaxByQuantityValidationFeatureDefined: boolean = !!input.product.Behavior?.MaximumQuantity;\r\n\r\n // @ts-expect-error\r\n return this._doCartOperationWithRetry(() => addProductToCartInternal(\r\n this.cart,\r\n cartLine,\r\n this.actionContext,\r\n orderQuantityLimitsFeatureIsEnabled,\r\n input.availableQuantity,\r\n input.enableStockCheck,\r\n isAddServiceItemToCart,\r\n isMaxByQuantityValidationFeatureDefined,\r\n input.shouldSkipSiteSettings\r\n ));\r\n });\r\n }\r\n\r\n //----------------------------------------------------------\r\n //----------------------------------------------------------\r\n public async removeCartLinesOverride(input: { cartLineIds: string[]}): Promise {\r\n\r\n // filter out milling service cart line as only allowed to be removed by CSU\r\n input.cartLineIds = input.cartLineIds.filter(id => {\r\n\r\n const itemToRemove = this.cart.CartLines?.find((line: CartLine) => {\r\n return line.LineId === id;\r\n });\r\n\r\n const isMillingGrade = itemToRemove?.ItemId === millingServiceId;\r\n\r\n return !isMillingGrade;\r\n\r\n });\r\n\r\n return this.baseRemoveCartLines(\r\n input\r\n );\r\n }\r\n}\r\n","import { IActionContext, ICoreContext, IDictionary } from '@msdyn365-commerce/core';\r\nimport { ICartState, ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport { CartLine, ProductAvailableQuantity } from '@msdyn365-commerce/retail-proxy';\r\n\r\n//==============================================================================\r\n// INTERFACES\r\n//==============================================================================\r\n\r\nexport interface CartAttributeValues {\r\n '@odata.type': \"#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue\",\r\n Name: string,\r\n TextValue: string,\r\n TextValueTranslations: [],\r\n ExtensionProperties: []\r\n}\r\n\r\n//==============================================================================\r\n// CLASS DEFINITION\r\n//==============================================================================\r\n/**\r\n * Util for edits to cart\r\n */\r\n//==============================================================================\r\nexport class CartUtilities {\r\n\r\n protected actionContext: IActionContext;\r\n protected cart: ICartState;\r\n\r\n //==========================================================================\r\n // PUBLIC METHODS\r\n //==========================================================================\r\n\r\n //------------------------------------------------------\r\n // Constructor\r\n //------------------------------------------------------\r\n constructor(actionContext: IActionContext, cart: ICartState) {\r\n this.actionContext = actionContext;\r\n this.cart = cart;\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n public static async editCartAttributeValues(cartState: ICartState, context: ICoreContext, attributeUpdates: IDictionary): Promise {\r\n if (!cartState || !cartState.cart) {\r\n context.telemetry.error('[CartUtilities.updateAttributeValues] Failed to load cart');\r\n return;\r\n }\r\n\r\n const currentAttributes = cartState.cart.AttributeValues || [];\r\n\r\n // Shallow clone so we don't modify the current internal reference\r\n const newAttributes = [...currentAttributes] as CartAttributeValues[];\r\n\r\n Object.keys(attributeUpdates).forEach(commerceKey => {\r\n const newValue = attributeUpdates[commerceKey];\r\n\r\n // Check to see if the attribute already exists\r\n const existingAttribute = newAttributes.find(entry => entry.Name === commerceKey);\r\n\r\n if (existingAttribute) {\r\n existingAttribute.TextValue = newValue;\r\n } else {\r\n newAttributes.push({\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue',\r\n Name: commerceKey,\r\n TextValue: newValue,\r\n TextValueTranslations: [],\r\n ExtensionProperties: []\r\n });\r\n }\r\n });\r\n\r\n await cartState.updateAttributeValues({newAttributeValues: newAttributes});\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n public static async addToExistingLine(\r\n cartState: ICartState,\r\n cartItemMatch: CartLine,\r\n context: ICoreContext,\r\n quantity: number,\r\n productAvailability: ProductAvailableQuantity | undefined\r\n ): Promise {\r\n\r\n // Don't continue if QTY is greater then max quantity or product available\r\n const quantityLimit: number = context.request.app.config.maxQuantityForCartLineItem;\r\n const checkStock: number = context.request.app.config.enableStockCheck;\r\n const quantityCombined = (cartItemMatch.Quantity || 0) + (quantity);\r\n if (quantityLimit && quantityCombined > quantityLimit) {\r\n return { status: 'FAILED', substatus: 'MAXQUANTITY' };\r\n }\r\n if (checkStock && (!productAvailability || quantityCombined > (productAvailability.AvailableQuantity || 0))) {\r\n return { status: 'FAILED', substatus: 'MAXQUANTITY' };\r\n }\r\n\r\n // Update Quantity\r\n await cartState.updateCartLineQuantity({cartLineId: cartItemMatch.LineId!, newQuantity: quantityCombined});\r\n return { status: 'SUCCESS' };\r\n }\r\n}"],"names":["SharedAvailabilityInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","createInput","actionContext","SharedAvailability","isAvailable","async","sharedAvailabilityAction","input","ctx","Msdyn365","action","AddToCartBehavior","propagateResult","props","result","onAdd","propagateError","onError","getAddToCartInputFromProps","_props$orderDetailsPr","_props$data","products","orderDetailsProducts","filter","product","ObjectExtensions","isNullOrUndefined","simpleProduct","ItemTypeValue","ReleasedProductType","Service","map","_product$salesLine$At","milledAttribute","salesLine","AttributeValues","find","attribute","Name","_product$simpleProduc","TextValue","ExtensionProperties","push","Key","Value","CartLineMillGrade","count","Quantity","catalogId","CatalogId","UOM","UnitOfMeasureSymbol","ArrayExtensions","hasElements","_props$catalogId","context","apiSettings","requestContext","searchCriteriaInput","Context","ChannelId","channelId","getCatalogId","IncludeAttributes","Ids","productId","productSearchResultsWithImages","ProductsDataActions","callerContext","productSearchResult","newProductSearchResult","_objectSpread","newImageUrl","generateProductImageUrl","PrimaryImageUrl","item","productData","RecordId","_productData$BasePric","ProductTypeValue","ProductType","Variant","AdjustedPrice","Price","BasePrice","quantity","_props$quantity","data","DefaultUnitOfMeasure","addItemsToCart","setDisabled","setItemsAddedToCartDialogOpen","setErrorMessage","addToCartInput","cartState","getCartState","addToCartResult","addProductsToCart","status","_validationResult$Val","_props$dialogStrings2","_props$dialogStrings3","_props$dialogStrings$2","_props$dialogStrings4","errorCount","CartsDataActions","bypassCache","cart","Id","Version","ValidationFailuresByCartLines","length","errorText","dialogStrings","oneErrorText","multiErrorsText","errorMessage","format","validationErrorMessage","toString","addToCartBehavior","app","config","showModal","showNotification","_props$dialogStrings$3","itemsAddedResource","viewCartButtonText","goToCartText","closeButtonLabel","closeNotificationLabel","itemsAddedToCartHeaderText","headerMessageText","itemsAddedToCartFormatText","headerItemFormatText","linesAddedToCartFormatText","headerLinesFormatText","itemsAddedValidationErrorMessage","notification","MultiItemsSuccessfullyAddedToCartNotification","imageSettings","gridSettings","navigationUrl","telemetryContent","id","typeName","NotificationsManager","instance","addNotification","MsDyn365","isBrowser","isNavigationToCartPageDisabled","undefined","goToCart","window","location","assign","handleAddItemsToCartSuccess","_props$dialogStrings5","_props$dialogStrings$4","_addToCartResult$erro3","_addToCartResult$erro4","_props$dialogStrings$5","_props$dialogStrings6","buyAgainNotificationTitle","ErrorNotification","buyAgainNotificationCloseAriaLabel","errorDetails","LocalizedMessage","failureReason","cartActionResult","AddToCartComponentActions","onClick","_event","openModal","cartError","addToCartError","hasOrderDetailsProducts","hasProducts","hasMultipleProducts","shouldSkipSiteSettings","_product$ExtensionPro","_cartState$cart$CartL","addOverridesToCartState","customAttributes","atr","productMatches","CartLines","cartLine","ProductId","cartCombineTable","cartLineCombineTable","itemInCart","productPropertiesMatch","CartUtilities","addToExistingLine","productAvailability","_props$productAvailab","productToAddInput","availableQuantity","AvailableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","isOrderQuantityLimitsFeatureEnabled","enableStockCheck","isPriceKeyedIn","customPrice","customPriceAmount","isAddEmailDeliveryItemToCart","addProductToCart","_props$data2","_props$data3","_props$context$reques","formattedAttribs","key","gaData","itemID","ItemId","recordID","MasterProductId","variant","name","price","CustomerContextualPrice","discount","DiscountAmount","currency","request","channel","Currency","unitOfMeasure","attributes","publish","ItemSuccessfullyAddedToCartNotification","_addToCartResult$erro","_addToCartResult$erro2","_props$dialogStrings$","_props$dialogStrings","addOneItemToCart","AddToCartFunctionalComponent","_props$data4","_props$dialogStrings7","_props$dialogStrings8","_props$dialogStrings9","_props$data5","_props$data6","_props$dialogStrings$6","_props$dialogStrings10","_props$dialogStrings$7","_props$dialogStrings11","_props$dialogStrings$8","_props$dialogStrings12","_props$dialogStrings$9","_props$dialogStrings13","_props$dialogStrings$10","_props$dialogStrings14","_props$addToCartArial","_props$addToCartArial2","disabled","useState","modalOpen","setModalOpen","isItemsAddedToCartDialogOpen","setAddToCartInput","closeItemsAddedToCartDialog","React","priceComponent","PriceComponent","freePriceText","originalPriceText","currentPriceText","popupProps","className","productQuantity","renderModalPopup","Popup","Object","label","getLinkText","payload","getPayloadObject","TelemetryEvent","AddToCart","getTelemetryAttributes","buttonClassName","retrievedInput","retrieveAddToCartInput","classnames","addToCartArialLabel","title","event","isIntermediateState","shouldShowOutOfStock","ItemsAddedToCartDialogComponent","isModalOpen","onClose","defaultProps","outOfStockText","addToCartText","isCustomPriceSelected","maximumKeyInPrice","minimumKeyInPrice","defaultMaximumKeyInPrice","defaultMinimumKeyInPrice","Dimensions","missingDimensions","dimension","DimensionValue","_productAvailability$","defaultAvailableQuantity","stockLeft","Math","max","includeCurrentQuantity","_props$hasAvailablePr","emitAvailability","isLoading","isProductQuantityLoading","isUpdatingDimension","isLoadingDeliveryOptions","isUpdatingDeliveryOptions","isAddServiceItemToCart","hasAvailableProducts","includedQuantityNumber","newValue","update","_props$data7","productMatch","productAttr","isMatch","cartItemAttrs","productToAddAttrs","forEach","extension","cartAttr","AddToCartComponent","msdyn365Commerce","createComponentOverride","component","subscriptions","eventName","eventData","keys","subscriber","subscribe","handler","Error","extendedState","wasInjected","CustomBaseCartState","prototype","addProductsToCartWithAttribs","addProductToCartWithAttribs","baseRemoveCartLines","removeCartLines","removeCartLinesOverride","formatCustomAttributes","BaseCartState","this","_doAsyncAction","internalInput","inputItem","_inputItem$catalogId","attributeValues","Description","EntryMethodTypeValue","TrackingId","IsPriceKeyedIn","IsGiftCardLine","IsGiftCard","deliveryMode","DeliveryMode","PickupDeliveryModeCode","FulfillmentStoreId","OrgUnitNumber","WarehouseId","InventoryLocationId","ShippingAddress","_buildAddressFromOrgUnitLocation","_this$actionContext$r","EmailDeliveryModeCode","PRODUCTASSERVICE","cartLineToAdd","isStockCheckEnabled","_doCartOperationWithRetry","addProductsToCartInternal","_input$catalogId","_input$additionalProp","_input$product$Behavi","isMaxByQuantityValidationFeatureDefined","Behavior","MaximumQuantity","addProductToCartInternal","cartLineIds","_this$cart$CartLines","itemToRemove","line","LineId","attributeUpdates","telemetry","error","newAttributes","commerceKey","existingAttribute","entry","TextValueTranslations","updateAttributeValues","newAttributeValues","cartItemMatch","quantityLimit","maxQuantityForCartLineItem","checkStock","quantityCombined","substatus","updateCartLineQuantity","cartLineId","newQuantity"],"sourceRoot":""}