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/common/utilities/get-product-details.ts?0bb5","webpack://henrys-ecommerce/./src/common/createGoogleAnalyticsEvent.ts?b6fa","webpack://henrys-ecommerce/./src/common/pushGoogleAnalyticsEvent.tsx?9c4e","webpack://henrys-ecommerce/./src/common/sendGoogleAnalyticsEvent.ts?9ba5","webpack://henrys-ecommerce/./src/common/utilities/productListExtensionHelpers.ts?5897","webpack://henrys-ecommerce/./src/modules/bazzarvoice-widget/bazzarvoice-widget.props.autogenerated.ts?6162","webpack://henrys-ecommerce/./src/modules/bazzarvoice-widget/components/Bazzarvoice.tsx?245f","webpack://henrys-ecommerce/./src/modules/cart/components/cart-pick-up-in-store.tsx?7be5","webpack://henrys-ecommerce/./src/modules/hei-buybox/components/Popup.tsx?9e06","webpack://henrys-ecommerce/./src/modules/hei-buybox/components/add-to-cart.component.tsx?7602"],"sourcesContent":["/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { getCartStateData, GetCartStateDataInput } from '@msdyn365-commerce/global-state';\r\nimport { ProductsDataActions } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getDimensionsForSelectedVariant,\r\n GetDimensionsForSelectedVariantInput,\r\n getPriceForSelectedVariant,\r\n getProductAvailabilitiesForSelectedVariant,\r\n getRatingsSummary,\r\n GetRatingsSummaryInput,\r\n getRnrEndpointId,\r\n getRnrPartnerId,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { IProductDetails } from '@msdyn365-commerce-modules/buybox';\r\n\r\n/**\r\n * Calls the Retail API and returns the product details.\r\n * @param productId\r\n * @param channelId\r\n * @param ctx\r\n * @param selectedDimensions - Dimensions previously selected for the product variant.\r\n */\r\nexport async function getProductDetails(productId: number, channelId: number, ctx: IActionContext): Promise {\r\n const productDetails: IProductDetails = {};\r\n\r\n if (productId > 0 && channelId > 0) {\r\n const tenantId = getRnrPartnerId(ctx);\r\n const serviceEndPoint = getRnrEndpointId(ctx);\r\n\r\n // Get Product Details\r\n const productResult = await ProductsDataActions.getByIdAsync({ callerContext: ctx }, productId, channelId);\r\n if (productResult) {\r\n productDetails.product = productResult;\r\n }\r\n\r\n // Get Product Availability\r\n await getProductAvailabilitiesForSelectedVariant(new ProductAvailabilitiesForSelectedVariantInput(productId, channelId), ctx)\r\n .then(productAvailabilities => {\r\n if (productAvailabilities) {\r\n productDetails.productAvailableQuantity = productAvailabilities;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get Product Price\r\n await getPriceForSelectedVariant(new PriceForSelectedVariantInput(productId, channelId, undefined), ctx)\r\n .then(productPrice => {\r\n if (productPrice) {\r\n productDetails.productPrice = productPrice;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get product dimensions\r\n await getDimensionsForSelectedVariant(new GetDimensionsForSelectedVariantInput(productId, channelId), ctx)\r\n .then(productDimensions => {\r\n if (productDimensions) {\r\n productDetails.productDimensions = productDimensions;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get Cart State\r\n await getCartStateData(new GetCartStateDataInput(ctx.requestContext.apiSettings), ctx)\r\n .then(cartState => {\r\n productDetails.cart = cartState;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n\r\n // Get Product Ratings\r\n if (tenantId && serviceEndPoint) {\r\n await getRatingsSummary(new GetRatingsSummaryInput(productId.toString(), tenantId, serviceEndPoint), ctx)\r\n .then(ratingsSummaryData => {\r\n if (ratingsSummaryData) {\r\n productDetails.ratingsSummary = ratingsSummaryData;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n });\r\n }\r\n }\r\n\r\n return productDetails;\r\n}\r\n","import { CacheType, getCatalogId, IActionContext, IActionInput, ICommerceApiSettings, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { Cart, CategoryPathLookup } from '@msdyn365-commerce/retail-proxy';\r\nimport { GaEvent, GaItem, GaPayload } from './pushGoogleAnalyticsEvent';\r\nimport { getProductDetails } from './utilities/get-product-details';\r\n\r\nexport const buildCacheKey = (base: string, apiSettings: ICommerceApiSettings, locale?: string): string => {\r\n return `${base}-chanId:${apiSettings.channelId}-catId:${apiSettings.catalogId}${locale ? `-${locale}` : ''}`;\r\n};\r\n\r\n/**\r\n * Category path input.\r\n */\r\nexport class GetCategoryPathsInput implements IActionInput {\r\n public readonly ChannelId: number;\r\n\r\n public readonly CatalogId: number;\r\n\r\n public readonly categoryPathLooksups: CategoryPathLookup[];\r\n\r\n public readonly apiSettings: ICommerceApiSettings;\r\n\r\n private readonly locale: string;\r\n\r\n private constructedCacheKey: string;\r\n\r\n public constructor(context: IRequestContext, categoryPathLooksups: CategoryPathLookup[]) {\r\n this.ChannelId = context.apiSettings.channelId;\r\n this.CatalogId = getCatalogId(context);\r\n this.categoryPathLooksups = categoryPathLooksups;\r\n this.apiSettings = context.apiSettings;\r\n this.constructedCacheKey = '';\r\n categoryPathLooksups.forEach(categoryPath => {\r\n this.constructedCacheKey += `${categoryPath.ProductId && categoryPath.ProductId.toString()}|`;\r\n });\r\n this.constructedCacheKey += `${this.ChannelId.toString()}|`;\r\n this.constructedCacheKey += `${this.CatalogId.toString()}|`;\r\n this.locale = context.locale;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey(this.constructedCacheKey, this.apiSettings, this.locale);\r\n\r\n public getCacheObjectType = () => 'CategoryPath';\r\n\r\n public dataCacheType = (): CacheType => 'request';\r\n\r\n /**\r\n * Retrieves locale to use for the current API call.\r\n * @returns A string which represents locale.\r\n */\r\n public getLocale = (): string => this.locale;\r\n}\r\n\r\nconst createGoogleAnalyticsEvent = async (cart: Readonly, eventName: GaEvent, actionContext: IActionContext): Promise => {\r\n var channelId = actionContext.requestContext.channel?.RecordId;\r\n\r\n const items: GaItem[] = [];\r\n\r\n if (channelId && cart.CartLines) {\r\n let i = 0;\r\n for (const cartLine of cart.CartLines) {\r\n if (cartLine.ProductId) {\r\n const productDetails = await getProductDetails(cartLine.ProductId, channelId, actionContext);\r\n\r\n const product = productDetails.product;\r\n const variant = product?.Dimensions?.map(d => d.DimensionValue?.Value).join(',');\r\n\r\n process.env.NODE_ENV === 'development' &&\r\n console.log('createGoogleAnalyticsEvent', cartLine.ProductId, JSON.parse(JSON.stringify(product)));\r\n\r\n const discount = (cartLine.DiscountLines ?? []).reduce((a, b) => a + (b.Amount ?? 0), 0);\r\n\r\n var brand = product?.ExtensionProperties?.find(ep => ep.Key === 'Brand')?.Value?.StringValue;\r\n\r\n var item = {\r\n recId: cartLine.ProductId,\r\n item_id: product?.ProductNumber || product?.ItemId || cartLine.ItemId || '',\r\n item_name: product?.Name ?? '',\r\n index: i,\r\n item_variant: variant,\r\n price: (product?.Price ?? cartLine.Price ?? 0) - discount,\r\n discount: discount,\r\n pid: product?.ItemId || cartLine.ItemId || '',\r\n item_brand: brand,\r\n quantity: cartLine.Quantity ?? 0\r\n };\r\n\r\n items.push(item);\r\n }\r\n\r\n i++;\r\n }\r\n }\r\n\r\n const total = items.reduce((a, b) => a + (b.price ?? 0) * b.quantity, 0);\r\n\r\n return {\r\n event: eventName,\r\n ecommerce: {\r\n currency: 'CAD',\r\n value: total,\r\n items: items\r\n }\r\n };\r\n};\r\n\r\nexport { createGoogleAnalyticsEvent };\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { GetCategoryPathsInput } from './createGoogleAnalyticsEvent';\r\nimport { getCategoryPaths } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nexport type GaDataLayer = {\r\n push: (payload: GaPayload) => void;\r\n};\r\n\r\nexport type GaItem = {\r\n item_id: string;\r\n item_name: string;\r\n affiliation?: string;\r\n coupon?: string;\r\n discount?: number;\r\n index: number;\r\n item_brand?: string;\r\n item_category?: string;\r\n item_category2?: string;\r\n item_category3?: string;\r\n item_category4?: string;\r\n item_category5?: string;\r\n item_list_id?: string;\r\n item_list_name?: string;\r\n item_variant?: string;\r\n location_id?: string;\r\n price: number;\r\n quantity: number;\r\n pid?: string;\r\n recId?: number;\r\n};\r\n\r\nexport type GaEvent =\r\n | 'view_item'\r\n | 'view_cart'\r\n | 'purchase'\r\n | 'begin_checkout'\r\n | 'add_to_cart'\r\n | 'add_to_wishlist'\r\n | 'remove_from_cart'\r\n | 'add_shipping_info'\r\n | 'add_payment_info';\r\n\r\nexport type GaPayload = {\r\n event?: GaEvent;\r\n ecommerce?: {\r\n transaction_id?: string;\r\n currency?: string;\r\n value: number;\r\n tax?: number;\r\n shipping?: number;\r\n shipping_tier?: string;\r\n payment_type?: string;\r\n coupon?: string;\r\n items?: GaItem[];\r\n } | null;\r\n};\r\n\r\nexport const pushGoogleAnalyticsEvent = async (payload?: GaPayload, actionContext?: IActionContext) => {\r\n const dataLayer = typeof window !== 'undefined' && (window['dataLayer'] as GaDataLayer);\r\n if (dataLayer) {\r\n process.env.NODE_ENV === 'development' && console.log('pushGoogleAnalyticsEvent', payload);\r\n dataLayer.push({ ecommerce: null });\r\n if (payload) {\r\n for (const gaItem of payload?.ecommerce?.items ?? []) {\r\n if (gaItem.recId) {\r\n if (actionContext) {\r\n const categoryPaths = await getCategoryPaths(\r\n new GetCategoryPathsInput(actionContext.requestContext, [{ ProductId: +gaItem.recId }]),\r\n actionContext\r\n );\r\n\r\n if (categoryPaths.length > 0) {\r\n gaItem.item_category = categoryPaths[0].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 1) {\r\n gaItem.item_category2 = categoryPaths[1].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 2) {\r\n gaItem.item_category3 = categoryPaths[2].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 3) {\r\n gaItem.item_category4 = categoryPaths[3].Name ?? undefined;\r\n }\r\n if (categoryPaths.length > 4) {\r\n gaItem.item_category5 = categoryPaths[4].Name ?? undefined;\r\n }\r\n }\r\n\r\n delete gaItem.recId;\r\n }\r\n }\r\n\r\n dataLayer.push(payload);\r\n }\r\n }\r\n};\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { GaItem, pushGoogleAnalyticsEvent } from './pushGoogleAnalyticsEvent';\r\nimport { OrgUnitLocation, ProductsDataActions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\ninterface IAddCartLine {\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 deliveryMode?: string;\r\n catalogId?: number;\r\n shouldSkipSiteSettings?: boolean;\r\n}\r\n\r\nexport const sendGoogleAnalyticsEvent = async (products: IAddCartLine[], actionContext: IActionContext) => {\r\n try {\r\n const apiSettings = actionContext.requestContext.apiSettings;\r\n const gaItems: GaItem[] = [];\r\n\r\n const prices = await ProductsDataActions.getActivePricesAsync(\r\n { callerContext: actionContext },\r\n {\r\n ChannelId: apiSettings.channelId,\r\n CatalogId: apiSettings.catalogId\r\n },\r\n products.map(p => p.product.RecordId),\r\n new Date(),\r\n null,\r\n null,\r\n true,\r\n null,\r\n true\r\n );\r\n\r\n for (const p of products) {\r\n const product = p.product;\r\n const variant = product.Dimensions?.map(d => d.DimensionValue?.Value).join(',');\r\n const brandFromExt = product?.ExtensionProperties?.find(p => p.Key === 'Brand')?.Value?.StringValue;\r\n\r\n const productPrice = prices.find(price => price.ProductId === p.product.RecordId);\r\n\r\n const discount = (productPrice?.DiscountLines ?? []).reduce((a, b) => a + ((b.EffectiveAmount || b.Amount) ?? 0), 0);\r\n\r\n gaItems.push({\r\n recId: product.RecordId,\r\n item_id: product.ProductNumber || product.ItemId || '',\r\n item_name: product.Name ?? '',\r\n index: gaItems.length,\r\n item_variant: variant,\r\n price: product.Price - discount,\r\n discount: discount,\r\n pid: product.ItemId || '',\r\n item_brand: brandFromExt ?? undefined,\r\n quantity: p.count ?? 0\r\n });\r\n }\r\n\r\n const totalValue = gaItems.reduce((a, b) => a + (b.price ?? 0) * b.quantity, 0);\r\n\r\n await pushGoogleAnalyticsEvent(\r\n {\r\n event: 'add_to_cart',\r\n ecommerce: {\r\n currency: 'CAD',\r\n value: totalValue,\r\n items: gaItems\r\n }\r\n },\r\n actionContext\r\n );\r\n } catch (err) {\r\n console.error(err);\r\n }\r\n};\r\n","import { AttributeValue, CommerceProperty, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport enum ProductStockStatusEnum {\r\n OUT_OF_STOCK,\r\n IN_STORE,\r\n ONLINE\r\n}\r\n\r\nexport interface IProductBadgeStatus {\r\n url: string;\r\n badgeName: string;\r\n}\r\n\r\n/**\r\n * Retrieves attribute from attribute list given the name of the attribute\r\n * @param attributes attribute list\r\n * @param attributeName name of the attribute to find\r\n */\r\nexport const findAttribute = (attributes: AttributeValue[] | undefined, attributeName: string): AttributeValue | undefined => {\r\n if (!attributes) {\r\n return undefined;\r\n }\r\n return attributes.find(attr => attr.Name?.toLowerCase() === attributeName.toLowerCase());\r\n};\r\n\r\nexport const findAllAttributes = (attributes: AttributeValue[] | undefined, attributeName: string): AttributeValue[] => {\r\n if (!attributes) {\r\n return [];\r\n }\r\n return attributes.filter(attr => attr.Name?.toLowerCase() === attributeName.toLowerCase());\r\n};\r\n\r\n/**\r\n * Gets value of given attribute based on its DataTypeValue enum.\r\n * @param attribute attribute to retrieve value from\r\n */\r\nexport const findAttributeValue = (attribute: AttributeValue): string | Date | number | boolean | undefined => {\r\n switch (attribute.DataTypeValue) {\r\n case 1:\r\n return attribute.CurrencyCode;\r\n case 2:\r\n return attribute.DateTimeOffsetValue;\r\n case 3:\r\n return attribute.FloatValue;\r\n case 4:\r\n return attribute.IntegerValue;\r\n case 5:\r\n return attribute.TextValue;\r\n case 6:\r\n return attribute.BooleanValue;\r\n default:\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * Builds URL to the product badge\r\n * @param locale current locale\r\n * @param badgeName name of the badge\r\n * @param baseUrl base url for images\r\n */\r\nexport const buildProductBadgeUrl = (locale: string, badgeName: string, baseUrl: string, suffix?: string): string => {\r\n return `${baseUrl}Catalogs/${locale}/${badgeName.toLowerCase().replace(/ /g, '_')}_${locale}${suffix || ''}.png`;\r\n};\r\n\r\n/**\r\n * Gets the correct product badge status from the product\r\n * @param product Product to get the badge for\r\n * @param locale current locale\r\n * @param baseUrl image base url\r\n * @returns product badge url\r\n */\r\nexport const getProductBadgeUrl = (\r\n product: ProductSearchResult,\r\n locale: string,\r\n baseUrl: string,\r\n suffix?: string\r\n): IProductBadgeStatus | null => {\r\n const badgeAttributeArray = findAllAttributes(product.AttributeValues, 'Product Badge Status');\r\n let badgeStatus: IProductBadgeStatus | null = null;\r\n if (badgeAttributeArray) {\r\n badgeAttributeArray.forEach(attr => {\r\n const badgeValue = findAttributeValue(attr);\r\n if (badgeValue && typeof badgeValue === 'string' && badgeValue.toLowerCase() !== 'none') {\r\n badgeStatus = { url: buildProductBadgeUrl(locale, badgeValue, baseUrl, suffix), badgeName: badgeValue.replace(/_/, ' ') };\r\n }\r\n });\r\n }\r\n if (badgeStatus) {\r\n return badgeStatus;\r\n } else if (product.BasePrice && product.Price !== product.BasePrice) {\r\n return { url: buildProductBadgeUrl(locale, 'on_sale', baseUrl, suffix), badgeName: 'On Sale' };\r\n }\r\n return null;\r\n};\r\n\r\n/**\r\n * gets product stock status value from extension properties\r\n * @param extensionProperties extension properties from product\r\n */\r\nexport const getProductStockStatus = (extensionProperties: CommerceProperty[]): ProductStockStatusEnum => {\r\n if (extensionProperties?.length) {\r\n const availableProperty = extensionProperties.find(xt => xt.Key === 'AvailabilityStatus');\r\n if (availableProperty && availableProperty.Value && availableProperty.Value.IntegerValue) {\r\n return availableProperty.Value.IntegerValue;\r\n }\r\n }\r\n return ProductStockStatusEnum.OUT_OF_STOCK;\r\n};\r\n\r\nexport const renderProductBadge = (request: Msdyn365.IRequestContext, badgeStatus: string, suffix: string) => {\r\n try {\r\n process.env.NODE_ENV === 'development' && console.log('renderProductBadge', badgeStatus, suffix);\r\n const mainImage = document?.querySelectorAll('.ms-buybox__media-gallery .msc-carousel__inner')[0];\r\n if (mainImage) {\r\n const currentBadge = mainImage.querySelector('.hei-badge');\r\n if (!currentBadge) {\r\n const badgeUrl = buildProductBadgeUrl(request.locale, badgeStatus, request.apiSettings.baseImageUrl, suffix);\r\n\r\n const badgeImage = document.createElement('img');\r\n badgeImage.src = badgeUrl;\r\n badgeImage.classList.add('msc-product__badge');\r\n badgeImage.classList.add('msc-product__badge--detail');\r\n badgeImage.classList.add('hei-badge');\r\n badgeImage.alt = badgeStatus;\r\n mainImage.appendChild(badgeImage);\r\n }\r\n\r\n return true;\r\n }\r\n } catch {\r\n return false;\r\n }\r\n\r\n return false;\r\n};\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IBazzarvoiceWidget contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum widgetType {\r\n reviews = 'reviews',\r\n questions = 'questions',\r\n rating_summary = 'rating_summary',\r\n inline_rating = 'inline_rating'\r\n}\r\n\r\nexport interface IBazzarvoiceWidgetConfig extends Msdyn365.IModuleConfig {\r\n widgetType?: widgetType;\r\n}\r\n\r\nexport interface IBazzarvoiceWidgetResources {}\r\n\r\nexport interface IBazzarvoiceWidgetProps extends Msdyn365.IModule {\r\n resources: IBazzarvoiceWidgetResources;\r\n config: IBazzarvoiceWidgetConfig;\r\n}\r\n","import * as React from 'react';\r\nimport { widgetType as WidgetType } from '../bazzarvoice-widget.props.autogenerated';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport classnames from 'classnames';\r\n\r\ntype BazzarvoiceProps = {\r\n itemId?: string;\r\n widgetType?: WidgetType;\r\n className?: string;\r\n disableSeo?: boolean;\r\n};\r\n\r\nconst Bazzarvoice = (props: BazzarvoiceProps) => {\r\n const { itemId, widgetType, className, disableSeo } = props;\r\n const divRef = React.useRef(null);\r\n const [initialized, setInitialized] = React.useState(false);\r\n\r\n const isBrowser = MsDyn365.isBrowser;\r\n React.useEffect(() => {\r\n const div = divRef.current;\r\n if (!initialized && isBrowser && div && itemId && widgetType) {\r\n setInitialized(true);\r\n\r\n div.innerHTML = `
`;\r\n }\r\n }, [isBrowser, initialized, itemId, widgetType, disableSeo, divRef]);\r\n\r\n return (\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Bazzarvoice;\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 { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n DeliveryOption,\r\n OrgUnitLocation,\r\n ProductDeliveryOptions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IPickUpInStoreViewProps {\r\n callbacks: {\r\n toggleBopis(isBopisSelected: boolean): void;\r\n };\r\n defaultComponent?: React.ReactNode;\r\n orgUnitName?: string;\r\n isBopisSelected: boolean;\r\n ContainerProps: INodeProps;\r\n deliveryOption?: string;\r\n}\r\n\r\nexport interface IPickUpInStoreProps {\r\n cartline: CartLine;\r\n product: SimpleProduct;\r\n shipitText: string;\r\n pickUpInStoreText: string;\r\n changeStoreText: string;\r\n cartState: ICartState | undefined;\r\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\r\n orgUnitLocations?: OrgUnitLocation[] | undefined;\r\n deliveryOptions?: ProductDeliveryOptions;\r\n pickupDeliveryModeCode?: string;\r\n storeSelectorModuleId?: string;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n retailMulitplePickupFeatureState?: boolean;\r\n locationChangedHandler(): void;\r\n}\r\n\r\nexport const getLineIdFromExtProps = (cartLine: CartLine): [string, boolean] => {\r\n let lineId = cartLine.ExtensionProperties?.find(ep => ep.Key === 'line-id')?.Value?.StringValue;\r\n if (lineId) {\r\n return [lineId, false];\r\n }\r\n\r\n if (!cartLine.ExtensionProperties) {\r\n cartLine.ExtensionProperties = [];\r\n }\r\n\r\n // save the line id in ext properies incase the line id changed due to login\r\n lineId = cartLine.LineId ?? '';\r\n cartLine.ExtensionProperties.push({\r\n Key: 'line-id',\r\n Value: {\r\n StringValue: lineId\r\n }\r\n });\r\n\r\n return [lineId, true];\r\n};\r\n\r\nexport const getWarrantyLine = (productLineNumber: number, cartState?: ICartState) => {\r\n const cartLines = cartState?.cart.CartLines ?? [];\r\n const linkedCartLine = cartLines.find(cl => {\r\n return cl.WarrantableLineNumber === productLineNumber;\r\n });\r\n return linkedCartLine ?? null;\r\n};\r\n\r\nexport const getRelatedCartLines = (productCartLine: CartLine, cartState?: ICartState) => {\r\n const cartLinesToRemove: CartLine[] = [];\r\n const linkedCartLine = getWarrantyLine(productCartLine.LineNumber!, cartState);\r\n if (linkedCartLine) {\r\n cartLinesToRemove.push(linkedCartLine);\r\n }\r\n\r\n const [productLineId] = getLineIdFromExtProps(productCartLine);\r\n\r\n const cartLines = cartState?.cart.CartLines ?? [];\r\n for (const cartLine of cartLines) {\r\n if (\r\n cartLine.TotalAmount === 0 &&\r\n cartLine.ExtensionProperties?.find(ex => ex.Key === 'bonus-for-line-id' && ex.Value?.StringValue === productLineId)\r\n ) {\r\n cartLinesToRemove.push(cartLine);\r\n }\r\n }\r\n\r\n return cartLinesToRemove;\r\n};\r\n\r\nexport const PickUpInStore = (props: IPickUpInStoreProps): IPickUpInStoreViewProps | undefined => {\r\n const _onLocationChangedCallback = async (\r\n orgUnitLocation: OrgUnitLocation,\r\n cartState: ICartState | undefined,\r\n cartline: CartLine,\r\n deliveryMode?: string\r\n ) => {\r\n if (!cartState) {\r\n return;\r\n }\r\n\r\n const result = await cartState.updateCartLinePickupLocation({\r\n cartLineId: cartline.LineId!,\r\n location: orgUnitLocation,\r\n deliveryMode\r\n });\r\n\r\n process.env.NODE_ENV === 'development' && console.log('updateCartLinePickupLocation', result);\r\n if (result.status === 'SUCCESS') {\r\n const relatedLines = getRelatedCartLines(cartline, cartState);\r\n process.env.NODE_ENV === 'development' && console.log('updateCartLinePickupLocation', relatedLines);\r\n for (const relatedLine of relatedLines) {\r\n await cartState.updateCartLinePickupLocation({\r\n cartLineId: relatedLine.LineId!,\r\n location: orgUnitLocation,\r\n deliveryMode\r\n });\r\n }\r\n }\r\n\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n };\r\n\r\n const _toggleBOPIS = async (isBopisSelected: boolean) => {\r\n const { storeSelectorStateManager, product, cartline, cartState, storeSelectorModuleId } = props;\r\n\r\n if (isBopisSelected) {\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n storeSelectorStateManager\r\n .openDialog({\r\n id: storeSelectorModuleId,\r\n product,\r\n alreadySelectedLocation: {\r\n OrgUnitNumber: cartline.FulfillmentStoreId\r\n },\r\n deliveryOptions: props.deliveryOptions,\r\n onLocationSelected: (orgUnitLocation, deliveryMode: string | undefined) => {\r\n return _onLocationChangedCallback(orgUnitLocation, cartState, cartline, deliveryMode);\r\n }\r\n })\r\n .catch(error => {});\r\n } else {\r\n if (!cartState) {\r\n return;\r\n }\r\n cartline.DeliveryMode = '';\r\n cartline.FulfillmentStoreId = '';\r\n cartline.ShippingAddress = {};\r\n const result = await cartState.clearCartLinePickupLocation({ cartLineId: cartline.LineId! });\r\n\r\n if (result.status === 'SUCCESS') {\r\n const relatedLines = getRelatedCartLines(cartline, cartState);\r\n process.env.NODE_ENV === 'development' && console.log('PickUpInStore', relatedLines);\r\n for (const relatedLine of relatedLines) {\r\n relatedLine.DeliveryMode = '';\r\n relatedLine.FulfillmentStoreId = '';\r\n relatedLine.ShippingAddress = {};\r\n await cartState.clearCartLinePickupLocation({\r\n cartLineId: relatedLine.LineId!\r\n });\r\n }\r\n }\r\n\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n }\r\n };\r\n\r\n const _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\r\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\r\n return '';\r\n }\r\n\r\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\r\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\r\n });\r\n\r\n if (foundLocation) {\r\n return foundLocation.OrgUnitName;\r\n }\r\n return fulfillmentStoreId;\r\n };\r\n\r\n const _renderShippingMethod = (\r\n cartLine: CartLine,\r\n shipItText: string,\r\n pickupInStoretext: string,\r\n changeStoreText: string,\r\n orgUnitLocations: OrgUnitLocation[] | undefined\r\n ): JSX.Element => {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, orgUnitLocations);\r\n const bopisSelected = !!cartLine.FulfillmentStoreId;\r\n\r\n const toggleBOPIS = (isBopisSelected: boolean) => {\r\n return () => {\r\n void _toggleBOPIS(isBopisSelected);\r\n };\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n {cartLine.FulfillmentStoreId ? (\r\n
\r\n {orgUnitName}\r\n \r\n
\r\n ) : null}\r\n \r\n );\r\n };\r\n\r\n const _getDeliveryOption = (pickupStore: IPickUpInStoreProps, deliveryOptions: ProductDeliveryOptions) => {\r\n const delivery = deliveryOptions?.DeliveryOptions?.find(option => option.Code === pickupStore.pickupDeliveryModeCode);\r\n return delivery?.Description;\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\n const 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\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 (!props.deliveryOptions || !props.deliveryOptions.DeliveryOptions) {\r\n return undefined;\r\n }\r\n\r\n if (props.retailMulitplePickupFeatureState && props.channelDeliveryOptionConfig) {\r\n if (!matchDeliveryOptions(props.deliveryOptions.DeliveryOptions, props.channelDeliveryOptionConfig?.PickupDeliveryModeCodes)) {\r\n return undefined;\r\n }\r\n } else if (\r\n !props.pickupDeliveryModeCode ||\r\n !props.deliveryOptions.DeliveryOptions.find(option => option.Code === props.pickupDeliveryModeCode)\r\n ) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n callbacks: {\r\n toggleBopis: _toggleBOPIS\r\n },\r\n defaultComponent: _renderShippingMethod(\r\n props.cartline,\r\n props.shipitText,\r\n props.pickUpInStoreText,\r\n props.changeStoreText,\r\n props.orgUnitLocations\r\n ),\r\n orgUnitName: _getOrgUnitName(props.cartline.FulfillmentStoreId, props.orgUnitLocations),\r\n isBopisSelected: !!props.cartline.FulfillmentStoreId,\r\n deliveryOption: _getDeliveryOption(props, props.deliveryOptions),\r\n ContainerProps: {\r\n className: 'msc-cart-line__bopis-container'\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 { ICoreContext, IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\r\nimport { ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n Modal,\r\n ModalBody,\r\n ModalFooter,\r\n ModalHeader\r\n} from '@msdyn365-commerce-modules/utilities';\r\n\r\nexport interface IPopupProps\r\n extends IComponentProps<{\r\n product: SimpleProduct | undefined;\r\n price: ProductPrice | undefined;\r\n bonusProducts: SimpleProduct[] | undefined;\r\n }> {\r\n dialogStrings?: {\r\n goToCartText: string;\r\n continueShoppingText: string;\r\n headerItemOneText: string;\r\n headerItemFormatText: string;\r\n headerMessageText: string;\r\n freePriceText: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n };\r\n\r\n className: string;\r\n imageSettings?: IImageSettings;\r\n gridSettings: IGridSettings | undefined;\r\n productQuantity: number;\r\n priceComponent: React.ReactNode;\r\n navigationUrl?: string;\r\n modalOpen: boolean | undefined;\r\n telemetryContent?: ITelemetryContent;\r\n setModalOpen(newValue: boolean): void;\r\n}\r\n\r\nconst getDimensionsText = (product: SimpleProduct) => {\r\n return product.Dimensions\r\n ? product.Dimensions.reduce((str, productDimension) => {\r\n if (productDimension.DimensionValue && productDimension.DimensionValue.Value) {\r\n if (str) {\r\n return `${str}, ${productDimension.DimensionValue.Value}`;\r\n }\r\n\r\n return `${productDimension.DimensionValue.Value}`;\r\n }\r\n\r\n return str;\r\n }, '')\r\n : '';\r\n};\r\n\r\nexport const renderBonusItemLines = (bonusProducts: SimpleProduct[], context: ICoreContext, className: string) => {\r\n return (\r\n bonusProducts &&\r\n bonusProducts.map((bonusProduct, idx) => {\r\n const reducedDimensions = getDimensionsText(bonusProduct);\r\n const originalPriceText = context.cultureFormatter.formatCurrency(bonusProduct.AdjustedPrice);\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n {bonusProduct.Name}\r\n {reducedDimensions ? `, ${reducedDimensions}` : ''}\r\n \r\n
\r\n
\r\n Bonus!\r\n {originalPriceText}\r\n $0.00\r\n
\r\n
\r\n );\r\n })\r\n );\r\n};\r\n\r\nexport const Popup = (popupProps: IPopupProps) => {\r\n const {\r\n dialogStrings,\r\n className,\r\n imageSettings,\r\n gridSettings,\r\n data: { product, price, bonusProducts },\r\n productQuantity,\r\n priceComponent,\r\n navigationUrl,\r\n modalOpen,\r\n telemetryContent,\r\n setModalOpen,\r\n context\r\n } = popupProps;\r\n const closeModal = React.useCallback(() => {\r\n setModalOpen(false);\r\n }, [setModalOpen]);\r\n if (!dialogStrings || !product) {\r\n return null;\r\n }\r\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.ContinueShopping);\r\n const continueShoppingAttribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n payLoad.contentAction.etext = TelemetryConstant.ViewBagAndCheckout;\r\n const viewBagAttribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n const fallbackImageUrl = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n const quantity = (productQuantity !== undefined ? productQuantity : 1) + (bonusProducts?.length ?? 0);\r\n const itemsString =\r\n quantity === 1 ? dialogStrings.headerItemOneText : dialogStrings.headerItemFormatText.replace('{0}', quantity.toString());\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n const shouldDisplayUnitOfMeasure =\r\n context.app.config?.unitOfMeasureDisplayType && context.app.config.unitOfMeasureDisplayType !== 'none';\r\n\r\n const reducedDimensions: string = getDimensionsText(product);\r\n\r\n return (\r\n \r\n \r\n {itemsString}\r\n {dialogStrings.headerMessageText}\r\n \r\n \r\n \r\n {product.Name}\r\n {reducedDimensions !== '' ?
{reducedDimensions}
: ''}\r\n {price ?
{priceComponent}
: ''}\r\n {product.DefaultUnitOfMeasure && shouldDisplayUnitOfMeasure ? (\r\n
\r\n {product.DefaultUnitOfMeasure}\r\n
\r\n ) : (\r\n ''\r\n )}\r\n {bonusProducts && renderBonusItemLines(bonusProducts, context, className)}\r\n
\r\n \r\n \r\n {dialogStrings.goToCartText}\r\n \r\n \r\n {dialogStrings.continueShoppingText}\r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default Popup;\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 MsDyn365, {\r\n getCatalogId,\r\n IActionContext,\r\n IComponent,\r\n IComponentProps,\r\n IGridSettings,\r\n IImageSettings,\r\n msdyn365Commerce,\r\n TelemetryEvent\r\n} from '@msdyn365-commerce/core';\r\nimport { getCartState, ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n CartLine,\r\n CartLineValidationResults,\r\n CartsDataActions,\r\n format,\r\n OrgUnitLocation,\r\n ProductAvailableQuantity,\r\n ProductDimension,\r\n ProductPrice,\r\n ProductsDataActions,\r\n ProductSearchCriteria,\r\n ProductType,\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, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React, { useState } from 'react';\r\n\r\nimport {\r\n PriceComponent,\r\n IItemsAddedToCartResources,\r\n ItemsAddedToCartDialogComponent,\r\n ItemSuccessfullyAddedToCartNotification,\r\n MultiItemsSuccessfullyAddedToCartNotification,\r\n OrderDetailsProduct\r\n} from '@msdyn365-commerce/components';\r\n\r\nimport Popup, { IPopupProps } from './Popup';\r\nimport { sendGoogleAnalyticsEvent } from '../../../common/sendGoogleAnalyticsEvent';\r\nimport { getLineIdFromExtProps } from '../../cart/components/cart-pick-up-in-store';\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 }[];\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 selectedWarranty: SimpleProduct | null;\r\n bonusItemIds?: number[];\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\ninterface IAddCartLine {\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 deliveryMode?: string;\r\n catalogId?: number;\r\n shouldSkipSiteSettings?: boolean;\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\nexport const getBonusItemsForAddToCart = async (props: {\r\n context: { actionContext: IActionContext };\r\n bonusItemIds?: number[];\r\n quantity?: number;\r\n catalogId?: number;\r\n}) => {\r\n const productsToAdd: {\r\n product: SimpleProduct;\r\n count: number;\r\n catalogId: number | undefined;\r\n }[] = [];\r\n\r\n // add bonus items\r\n if (props.bonusItemIds && props.bonusItemIds.length > 0) {\r\n const actionContext = props.context.actionContext;\r\n const apiSettings = actionContext.requestContext.apiSettings;\r\n const bonusProducts = await ProductsDataActions.getByIdsAsync(\r\n { callerContext: actionContext },\r\n apiSettings.channelId,\r\n props.bonusItemIds\r\n );\r\n\r\n const productAvailabilities = await ProductsDataActions.getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n {\r\n ProductIds: props.bonusItemIds,\r\n DefaultWarehouseOnly: true\r\n }\r\n );\r\n\r\n process.env.NODE_ENV === 'development' && console.log('BuyboxView', 'addProductsToCart', productAvailabilities);\r\n\r\n for (const p of bonusProducts) {\r\n const avail = productAvailabilities.AggregatedProductInventoryAvailabilities?.find(a => a.ProductId === p.RecordId);\r\n if (avail?.PhysicalAvailableInventoryLevelCode && avail.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n productsToAdd.push({\r\n product: p,\r\n count: props.quantity ?? defaultQuantity,\r\n catalogId: props.catalogId\r\n });\r\n }\r\n }\r\n }\r\n\r\n return productsToAdd;\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\nconst getAddToCartInputFromProps = async (props: IAddToCartComponentProps) => {\r\n const products = props.orderDetailsProducts?.filter(product => !ObjectExtensions.isNullOrUndefined(product.simpleProduct));\r\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n const input = products?.map(product => {\r\n const deliveryOption = product.salesLine.DeliveryMode;\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 isAddEmailDeliveryItemToCart: deliveryOption && deliveryOption === emailDeliveryModeCode\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 catalogId = props.catalogId ?? getCatalogId(props.context.actionContext.requestContext);\r\n validateCatalogId(catalogId);\r\n\r\n const searchCriteriaInput: ProductSearchCriteria = {\r\n Context: {\r\n ChannelId: apiSettings.channelId,\r\n CatalogId: catalogId\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 };\r\n });\r\n }\r\n\r\n // add from PDP\r\n if (props.data?.product) {\r\n const productsToAdd = [\r\n {\r\n product: props.data.product,\r\n count: props.quantity ?? defaultQuantity,\r\n catalogId: props.catalogId\r\n }\r\n ];\r\n\r\n // add selected warranty\r\n if (props.selectedWarranty) {\r\n const warrantyProduct = props.selectedWarranty;\r\n\r\n productsToAdd.push({\r\n product: warrantyProduct,\r\n count: props.quantity ?? defaultQuantity,\r\n catalogId: props.catalogId\r\n });\r\n }\r\n\r\n // add bonus items\r\n if (props.bonusItemIds && props.bonusItemIds.length > 0) {\r\n const bonusItems = await getBonusItemsForAddToCart(props);\r\n for (const p of bonusItems) {\r\n productsToAdd.push(p);\r\n }\r\n }\r\n\r\n return productsToAdd;\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 const cartState = await getCartState(props.context.actionContext);\r\n\r\n const productsToAdd: IAddCartLine[] = [\r\n {\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 }\r\n ];\r\n\r\n if (addToCartInput.length > 1) {\r\n for (let i = 1; i < addToCartInput.length; ++i) {\r\n const addToCartItem = addToCartInput[i];\r\n productsToAdd.push({\r\n ...addToCartItem,\r\n count: addToCartItem.count\r\n });\r\n }\r\n }\r\n\r\n const currentCartLinesCount = cartState.cart.CartLines?.length ?? 0;\r\n const addToCartResult = await cartState.addProductsToCart(productsToAdd);\r\n\r\n if (addToCartResult.status === 'SUCCESS') {\r\n const cartLines = cartState.cart.CartLines ?? [];\r\n const itemsAdded = cartLines.length - currentCartLinesCount;\r\n\r\n process.env.NODE_ENV === 'development' && console.log('BuyboxView', 'addProductsToCart', addToCartResult, itemsAdded);\r\n\r\n if (itemsAdded > 1) {\r\n const productLine = cartLines[currentCartLinesCount];\r\n const updatedCartLinesObject: CartLine[] = [];\r\n\r\n // Link warranty if selected\r\n const warrantyLine = cartLines[currentCartLinesCount + 1];\r\n if (productLine && warrantyLine?.ProductId === props.selectedWarranty?.RecordId) {\r\n warrantyLine.WarrantableLineNumber = productLine.LineNumber;\r\n warrantyLine.IsWarrantyLine = true;\r\n\r\n const [productLineId, productLineUpdated] = getLineIdFromExtProps(productLine);\r\n\r\n if (!warrantyLine.ExtensionProperties) {\r\n warrantyLine.ExtensionProperties = [];\r\n }\r\n\r\n warrantyLine.ExtensionProperties.push({\r\n Key: 'warrantable-line-id',\r\n Value: {\r\n StringValue: productLineId\r\n }\r\n });\r\n\r\n updatedCartLinesObject.push(warrantyLine);\r\n\r\n if (productLineUpdated) {\r\n updatedCartLinesObject.push(productLine);\r\n }\r\n }\r\n\r\n // check if there's bonus item\r\n for (let idx = currentCartLinesCount + 1; idx < cartLines.length; idx++) {\r\n const bonusCartLine = cartLines[idx];\r\n if (!bonusCartLine.IsWarrantyLine) {\r\n if (!bonusCartLine.ExtensionProperties) {\r\n bonusCartLine.ExtensionProperties = [];\r\n }\r\n\r\n const [productLineId, productLineUpdated] = getLineIdFromExtProps(productLine);\r\n\r\n bonusCartLine.ExtensionProperties.push({\r\n Key: 'bonus-for-line-id',\r\n Value: {\r\n StringValue: productLineId\r\n }\r\n });\r\n\r\n updatedCartLinesObject.push(bonusCartLine);\r\n\r\n if (productLineUpdated) {\r\n updatedCartLinesObject.push(productLine);\r\n }\r\n }\r\n }\r\n\r\n if (updatedCartLinesObject.length > 0) {\r\n await cartState.updateCartLines({ updatedCartLinesObject });\r\n }\r\n }\r\n\r\n await sendGoogleAnalyticsEvent(productsToAdd, props.context.actionContext);\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\nconst 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: {\r\n product: addToCartInput[0]?.product,\r\n price: props.data?.price,\r\n bonusProducts: addToCartInput\r\n ?.filter((p, i) => i > 0 && p.product.RecordId && !!props.bonusItemIds?.find(id => id === p.product.RecordId))\r\n .map(p => p.product)\r\n },\r\n dialogStrings: props.dialogStrings,\r\n imageSettings: props.imageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: addToCartInput[0]?.count !== undefined ? addToCartInput[0]?.count : 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 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 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 return false;\r\n }\r\n }\r\n\r\n const includedQuantityNumber = includeCurrentQuantity && props.quantity ? props.quantity : defaultQuantity;\r\n\r\n return !(\r\n props.productAvailability &&\r\n props.productAvailability.AvailableQuantity !== undefined &&\r\n props.productAvailability.AvailableQuantity >= includedQuantityNumber\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// @ts-expect-error\r\nexport const AddToCartComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\r\n 'AddToCart',\r\n { component: AddToCartFunctionalComponent, ...AddToCartComponentActions }\r\n);\r\n"],"names":["async","getProductDetails","productId","channelId","ctx","productDetails","tenantId","getRnrPartnerId","serviceEndPoint","getRnrEndpointId","productResult","ProductsDataActions","callerContext","product","getProductAvailabilitiesForSelectedVariant","ProductAvailabilitiesForSelectedVariantInput","then","productAvailabilities","productAvailableQuantity","catch","error","telemetry","exception","getPriceForSelectedVariant","PriceForSelectedVariantInput","undefined","productPrice","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","productDimensions","getCartStateData","GetCartStateDataInput","requestContext","apiSettings","cartState","cart","getRatingsSummary","GetRatingsSummaryInput","toString","ratingsSummaryData","ratingsSummary","GetCategoryPathsInput","constructor","context","categoryPathLooksups","getCacheKey","buildCacheKey","base","this","constructedCacheKey","locale","catalogId","getCacheObjectType","dataCacheType","getLocale","ChannelId","CatalogId","getCatalogId","forEach","categoryPath","ProductId","createGoogleAnalyticsEvent","eventName","actionContext","_actionContext$reques","channel","RecordId","items","CartLines","i","cartLine","_product$Dimensions","_cartLine$DiscountLin","_product$ExtensionPro","_product$Name","_ref","_product$Price","_cartLine$Quantity","variant","Dimensions","map","d","_d$DimensionValue","DimensionValue","Value","join","discount","DiscountLines","reduce","a","b","_b$Amount","Amount","brand","ExtensionProperties","find","ep","Key","StringValue","item","recId","item_id","ProductNumber","ItemId","item_name","Name","index","item_variant","price","Price","pid","item_brand","quantity","Quantity","push","event","ecommerce","currency","value","_b$price","pushGoogleAnalyticsEvent","payload","dataLayer","window","gaItem","_payload$ecommerce$it","_payload$ecommerce","categoryPaths","getCategoryPaths","_categoryPaths$0$Name","_categoryPaths$1$Name","_categoryPaths$2$Name","_categoryPaths$3$Name","_categoryPaths$4$Name","length","item_category","item_category2","item_category3","item_category4","item_category5","sendGoogleAnalyticsEvent","products","gaItems","prices","p","Date","_productPrice$Discoun","_p$count","brandFromExt","EffectiveAmount","count","totalValue","err","console","ProductStockStatusEnum","findAttribute","attributes","attributeName","attr","_attr$Name","toLowerCase","findAllAttributes","filter","_attr$Name2","findAttributeValue","attribute","DataTypeValue","CurrencyCode","DateTimeOffsetValue","FloatValue","IntegerValue","TextValue","BooleanValue","buildProductBadgeUrl","badgeName","baseUrl","suffix","replace","getProductBadgeUrl","badgeAttributeArray","AttributeValues","badgeStatus","badgeValue","url","BasePrice","getProductStockStatus","extensionProperties","availableProperty","xt","OUT_OF_STOCK","widgetType","props","itemId","className","disableSeo","divRef","React","initialized","setInitialized","isBrowser","MsDyn365","div","current","innerHTML","classnames","ref","getLineIdFromExtProps","_cartLine$ExtensionPr","_cartLine$LineId","lineId","LineId","getWarrantyLine","productLineNumber","_cartState$cart$CartL","linkedCartLine","cl","WarrantableLineNumber","getRelatedCartLines","productCartLine","_cartState$cart$CartL2","cartLinesToRemove","LineNumber","productLineId","cartLines","_cartLine$ExtensionPr2","TotalAmount","ex","_ex$Value","PickUpInStore","_toggleBOPIS","storeSelectorStateManager","cartline","storeSelectorModuleId","isBopisSelected","openDialog","id","alreadySelectedLocation","OrgUnitNumber","FulfillmentStoreId","deliveryOptions","onLocationSelected","orgUnitLocation","deliveryMode","result","updateCartLinePickupLocation","cartLineId","location","status","relatedLines","relatedLine","locationChangedHandler","_onLocationChangedCallback","DeliveryMode","ShippingAddress","clearCartLinePickupLocation","_getOrgUnitName","fulfillmentStoreId","orgUnitLocations","foundLocation","OrgUnitName","DeliveryOptions","_props$channelDeliver","retailMulitplePickupFeatureState","channelDeliveryOptionConfig","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","pickup","deliveryCode","Code","ArrayExtensions","hasElements","PickupDeliveryModeCodes","pickupDeliveryModeCode","option","callbacks","toggleBopis","defaultComponent","_renderShippingMethod","shipItText","pickupInStoretext","changeStoreText","orgUnitName","bopisSelected","toggleBOPIS","type","name","onChange","checked","key","onClick","shipitText","pickUpInStoreText","_getDeliveryOption","pickupStore","_deliveryOptions$Deli","Description","ContainerProps","getDimensionsText","str","productDimension","renderBonusItemLines","bonusProducts","bonusProduct","idx","reducedDimensions","originalPriceText","cultureFormatter","formatCurrency","AdjustedPrice","popupProps","_bonusProducts$length","_context$app$config","dialogStrings","imageSettings","gridSettings","data","productQuantity","priceComponent","navigationUrl","modalOpen","telemetryContent","setModalOpen","closeModal","payLoad","getPayloadObject","TelemetryConstant","ContinueShopping","continueShoppingAttribute","getTelemetryAttributes","contentAction","etext","ViewBagAndCheckout","viewBagAttribute","fallbackImageUrl","getFallbackImageUrl","cropFocalRegion","itemsString","headerItemOneText","headerItemFormatText","shouldDisplayUnitOfMeasure","app","config","unitOfMeasureDisplayType","Modal","isOpen","onClosed","toggle","ModalHeader","headerMessageText","ModalBody","Image","src","PrimaryImageUrl","fallBackSrc","altText","loadFailureBehavior","DefaultUnitOfMeasure","ModalFooter","Button","Object","assign","href","goToCartText","continueShoppingText","AddToCartBehavior","propagateResult","onAdd","propagateError","onError","getBonusItemsForAddToCart","productsToAdd","bonusItemIds","ProductIds","DefaultWarehouseOnly","_productAvailabilitie","avail","AggregatedProductInventoryAvailabilities","_props$quantity","PhysicalAvailableInventoryLevelCode","getAddToCartInputFromProps","_props$orderDetailsPr","_props$context$action","_props$data","orderDetailsProducts","ObjectExtensions","isNullOrUndefined","simpleProduct","emailDeliveryModeCode","EmailDeliveryModeCode","input","salesLine","isAddEmailDeliveryItemToCart","_props$catalogId","validateCatalogId","searchCriteriaInput","Context","IncludeAttributes","Ids","productSearchResultsWithImages","productSearchResult","newProductSearchResult","_objectSpread","newImageUrl","generateProductImageUrl","productData","_productData$BasePric","ProductTypeValue","ProductType","Variant","_props$quantity2","selectedWarranty","_props$quantity3","warrantyProduct","bonusItems","addItemsToCart","setDisabled","setItemsAddedToCartDialogOpen","setErrorMessage","addToCartInput","getCartState","addToCartResult","addProductsToCart","_validationResult$Val","_props$dialogStrings2","_props$dialogStrings3","_props$dialogStrings$2","_props$dialogStrings4","errorCount","CartsDataActions","bypassCache","Id","Version","ValidationFailuresByCartLines","errorText","oneErrorText","multiErrorsText","errorMessage","format","validationErrorMessage","addToCartBehavior","showModal","showNotification","_props$dialogStrings$3","itemsAddedResource","viewCartButtonText","closeButtonLabel","closeNotificationLabel","itemsAddedToCartHeaderText","itemsAddedToCartFormatText","linesAddedToCartFormatText","headerLinesFormatText","itemsAddedValidationErrorMessage","notification","MultiItemsSuccessfullyAddedToCartNotification","typeName","NotificationsManager","instance","addNotification","isNavigationToCartPageDisabled","goToCart","handleAddItemsToCartSuccess","_props$dialogStrings5","_props$dialogStrings$4","_addToCartResult$erro3","_addToCartResult$erro4","_props$dialogStrings$5","_props$dialogStrings6","buyAgainNotificationTitle","ErrorNotification","buyAgainNotificationCloseAriaLabel","errorDetails","LocalizedMessage","failureReason","cartActionResult","AddToCartComponentActions","_event","openModal","cartError","addToCartError","hasOrderDetailsProducts","hasProducts","hasMultipleProducts","shouldSkipSiteSettings","_props$productAvailab","availableQuantity","productAvailability","AvailableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","isOrderQuantityLimitsFeatureEnabled","enableStockCheck","isPriceKeyedIn","customPrice","customPriceAmount","addToCartItem","currentCartLinesCount","_cartState$cart$CartL3","_props$selectedWarran","productLine","updatedCartLinesObject","warrantyLine","IsWarrantyLine","productLineUpdated","bonusCartLine","updateCartLines","ItemSuccessfullyAddedToCartNotification","_addToCartResult$erro","_addToCartResult$erro2","_props$dialogStrings$","_props$dialogStrings","addOneItemToCart","AddToCartFunctionalComponent","_props$data2","_props$dialogStrings7","_props$dialogStrings8","_props$dialogStrings9","_addToCartInput$","_props$data3","_addToCartInput$2","_addToCartInput$3","_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","isItemsAddedToCartDialogOpen","setAddToCartInput","closeItemsAddedToCartDialog","PriceComponent","freePriceText","currentPriceText","_props$bonusItemIds","request","renderModalPopup","Popup","label","getLinkText","TelemetryEvent","AddToCart","buttonClassName","retrievedInput","retrieveAddToCartInput","addToCartArialLabel","title","isIntermediateState","shouldShowOutOfStock","ItemsAddedToCartDialogComponent","isModalOpen","onClose","defaultProps","outOfStockText","addToCartText","isCustomPriceSelected","maximumKeyInPrice","minimumKeyInPrice","defaultMaximumKeyInPrice","defaultMinimumKeyInPrice","missingDimensions","dimension","_productAvailability$","defaultAvailableQuantity","stockLeft","Math","max","includeCurrentQuantity","_props$hasAvailablePr","isLoading","isProductQuantityLoading","isUpdatingDimension","isLoadingDeliveryOptions","isUpdatingDeliveryOptions","isAddServiceItemToCart","hasAvailableProducts","includedQuantityNumber","_props$data4","AddToCartComponent","msdyn365Commerce","createComponent","component"],"sourceRoot":""}