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B,EAAyBT,GAA0B/X,EAAMhG,SAAWgG,EAAMhG,SA9vB5D,EAgwBpB,QACIgG,EAAMwS,0BAC0C/d,IAAhDuL,EAAMwS,oBAAoBC,mBAC1BzS,EAAMwS,oBAAoBC,mBAAqB+F,IAIjD7B,EAAuB3W,IAA4C,IAAAyY,EACrE,OAAc,QAAdA,EAAIzY,EAAM+H,YAAI,IAAA0Q,IAAVA,EAAY5kB,QAAQkE,aAChBiI,EAAM+H,KAAKlU,QAAQkE,WAAWgB,MAAK0e,KAAeA,EAAUtf,gBAAkBsf,EAAUtf,eAAeC,cAM1G4H,EAAMiY,WAAcjY,EAAMmY,qBAAwBnY,EAAMoY,0BAA6BpY,EAAMqY,4BAQvFK,EAAwEC,EAAAA,GAAiBC,gBAClG,YAAWxL,EAAA,CACTyL,UAAW3E,GAAiCrC","sources":["webpack://henrys-ecommerce/./src/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 === 'INSTOCK' || avail?.PhysicalAvailableInventoryLevelCode === 'AVAIL') {\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","renderProductBadge","request","_document","mainImage","document","querySelectorAll","querySelector","badgeUrl","baseImageUrl","badgeImage","createElement","src","classList","add","alt","appendChild","_unused","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","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","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":""}