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EAAMmZ,4BAAoB,IAAAP,GAAAA,GAEnD,OAAO,EAGX,GAAI5Y,EAAM8I,KAAKnX,QAAQkE,YACfmK,EAAM8I,KAAKnX,QAAQkE,WAAWgB,MAAKwhB,KAAeA,EAAUpiB,gBAAkBoiB,EAAUpiB,eAAeC,SAEvG,OAAO,EAIf,MAAMkjB,EAAyBT,GAA0B3Y,EAAMlI,SAAWkI,EAAMlI,SA9vB5D,EAgwBpB,QACIkI,EAAMqT,0BAC0C9gB,IAAhDyN,EAAMqT,oBAAoBC,mBAC1BtT,EAAMqT,oBAAoBC,mBAAqB8F,IAIjD7B,EAAuBvX,IAA4C,IAAAqZ,EACrE,OAAc,QAAdA,EAAIrZ,EAAM8I,YAAI,IAAAuQ,IAAVA,EAAY1nB,QAAQkE,aAChBmK,EAAM8I,KAAKnX,QAAQkE,WAAWgB,MAAKwhB,KAAeA,EAAUpiB,gBAAkBoiB,EAAUpiB,eAAeC,cAM1G8J,EAAM6Y,WAAc7Y,EAAM+Y,qBAAwB/Y,EAAMgZ,0BAA6BhZ,EAAMiZ,4BAQvFK,EAAwEC,EAAAA,GAAiBC,gBAClG,YAAWtL,EAAA,CACTuL,UAAW5E,GAAiCnC","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/encodeKlaviyoItemId.ts?91f4","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","export const encodeKlaviyoItemId = (id: string, prefix: string = '$custom:::$default:::') =>\r\n `${prefix}${id.replace(/[^\\w]+/g, '-').toUpperCase()}`;\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { GetCategoryPathsInput } from './createGoogleAnalyticsEvent';\r\nimport { getCategoryPaths } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { encodeKlaviyoItemId } from './encodeKlaviyoItemId';\r\n\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport { ProductsDataActions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\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 cart_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 const klaviyo = window?.klaviyo;\r\n if (payload && klaviyo) {\r\n if (payload.event === 'view_item') {\r\n const product = payload.ecommerce?.items && payload.ecommerce.items[0];\r\n if (product) {\r\n klaviyo.push([\r\n 'track',\r\n 'Viewed Product',\r\n {\r\n ProductName: product.item_name,\r\n ProductID: encodeKlaviyoItemId(product.item_id, ''),\r\n SKU: product.item_id,\r\n Price: product.price\r\n }\r\n ]);\r\n }\r\n } else if (payload.event === 'begin_checkout' && payload.ecommerce?.items?.length) {\r\n klaviyo.push([\r\n 'track',\r\n 'Started Checkout',\r\n {\r\n $event_id: `${payload.ecommerce?.cart_id}_${new Date().getTime()}`,\r\n $value: payload.ecommerce?.value,\r\n ItemNames: payload.ecommerce.items.map(p => p.item_name),\r\n Items: payload.ecommerce.items.map(product => ({\r\n ProductID: encodeKlaviyoItemId(product.item_id, ''),\r\n SKU: product.item_id,\r\n ProductName: product.item_name,\r\n Quantity: product.quantity,\r\n ItemPrice: product.price,\r\n RowTotal: product.quantity * product.price\r\n }))\r\n }\r\n ]);\r\n } else if (payload.event === 'add_to_cart' && payload.ecommerce?.items?.length && actionContext) {\r\n const cartState = await getCartState(actionContext);\r\n const allProductIds = cartState.cart.CartLines?.filter(cl => !!cl.ProductId!).map(cl => cl.ProductId!) ?? [];\r\n if (allProductIds.length > 0) {\r\n const allProducts = await ProductsDataActions.getByIdsAsync(\r\n { callerContext: actionContext },\r\n actionContext.requestContext.channel?.RecordId ?? 0,\r\n allProductIds\r\n );\r\n\r\n const allProductLookup: { [id: string]: SimpleProduct } = {};\r\n allProducts.forEach(p => (allProductLookup[p.RecordId] = p));\r\n\r\n var allItemsInCart =\r\n cartState.cart.CartLines?.map(cl => {\r\n const product = allProductLookup[cl.ProductId ?? 0];\r\n if (product) {\r\n return {\r\n ProductID: encodeKlaviyoItemId(product.ProductNumber ?? product.ItemId ?? '', ''),\r\n SKU: product.ProductNumber ?? product.ItemId ?? '',\r\n ProductName: product.Name ?? '',\r\n Quantity: cl.Quantity ?? 1,\r\n ItemPrice: cl.Price ?? 0,\r\n RowTotal: (cl.Quantity ?? 1) * (cl.Price ?? 0)\r\n };\r\n }\r\n\r\n return null;\r\n })\r\n .filter(p => !!p)\r\n .map(p => p!) ?? [];\r\n\r\n if (allItemsInCart.length > 0) {\r\n const itemNames = allItemsInCart.map(p => p.ProductName);\r\n let cartTotal = 0;\r\n allItemsInCart.forEach(p => {\r\n cartTotal += p.RowTotal;\r\n });\r\n\r\n payload.ecommerce?.items.forEach(addedItem => {\r\n klaviyo.push([\r\n 'track',\r\n 'Added to Cart',\r\n {\r\n $value: cartTotal,\r\n\r\n AddedItemProductName: addedItem.item_name,\r\n AddedItemProductID: encodeKlaviyoItemId(addedItem.item_id, ''),\r\n AddedItemSKU: addedItem.item_id,\r\n AddedItemPrice: addedItem.price,\r\n AddedItemQuantity: addedItem.quantity,\r\n ItemNames: itemNames,\r\n Items: allItemsInCart\r\n }\r\n ]);\r\n });\r\n }\r\n }\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 { IActionContext } from '@msdyn365-commerce/core';\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 ProductsDataActions,\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 context: IActionContext;\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 Promise.resolve();\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 const bonusLines = relatedLines.filter(l => !l.IsWarrantyLine);\r\n\r\n const inStockAtStore: { [id: number]: boolean } = {};\r\n\r\n if (bonusLines.length > 0) {\r\n const warehouseAvailability = await ProductsDataActions.getEstimatedProductWarehouseAvailabilityAsync(\r\n {\r\n callerContext: props.context\r\n },\r\n bonusLines.map(p => ({\r\n ProductId: p.ProductId!,\r\n InventLocationId: orgUnitLocation.InventoryLocationId,\r\n DataAreaId: props.context.requestContext.channel?.InventLocationDataAreaId ?? 'hei'\r\n })),\r\n null\r\n );\r\n\r\n for (const availablity of warehouseAvailability.AggregatedProductInventoryAvailabilities ?? []) {\r\n inStockAtStore[availablity.ProductId!] = availablity.PhysicalAvailableInventoryLevelCode === 'INSTOCK';\r\n }\r\n\r\n process.env.NODE_ENV === 'development' &&\r\n console.log('updateCartLinePickupLocation', relatedLines, bonusLines, warehouseAvailability);\r\n }\r\n\r\n for (const relatedLine of relatedLines) {\r\n if (relatedLine.IsWarrantyLine || inStockAtStore[relatedLine.ProductId!]) {\r\n await cartState.updateCartLinePickupLocation({\r\n cartLineId: relatedLine.LineId!,\r\n location: orgUnitLocation,\r\n deliveryMode\r\n });\r\n } else {\r\n await cartState.clearCartLinePickupLocation({\r\n cartLineId: relatedLine.LineId!\r\n });\r\n }\r\n }\r\n }\r\n\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n\r\n return Promise.resolve();\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: async (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 = (\r\n bonusProducts: (SimpleProduct & { shipped?: boolean })[],\r\n context: ICoreContext,\r\n className: string,\r\n shippedLabel?: string\r\n) => {\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 {bonusProduct.shipped && (\r\n {shippedLabel ?? 'will be shipped'}\r\n )}\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","encodeKlaviyoItemId","id","prefix","arguments","length","replace","toUpperCase","pushGoogleAnalyticsEvent","payload","_window","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","item_category","item_category2","item_category3","item_category4","item_category5","klaviyo","_payload$ecommerce3","_payload$ecommerce6","_payload$ecommerce2","ProductName","ProductID","SKU","_payload$ecommerce4","_payload$ecommerce5","$event_id","cart_id","Date","getTime","$value","ItemNames","p","Items","ItemPrice","RowTotal","_cartState$cart$CartL","_cartState$cart$CartL2","getCartState","allProductIds","filter","cl","_actionContext$reques2","_cartState$cart$CartL3","_cartState$cart$CartL4","allProducts","allProductLookup","allItemsInCart","_cl$ProductId","_product$ProductNumbe","_ref2","_product$ProductNumbe2","_cl$Quantity","_cl$Price","_cl$Quantity2","_cl$Price2","_payload$ecommerce7","itemNames","cartTotal","addedItem","AddedItemProductName","AddedItemProductID","AddedItemSKU","AddedItemPrice","AddedItemQuantity","sendGoogleAnalyticsEvent","products","gaItems","prices","_productPrice$Discoun","_p$count","brandFromExt","EffectiveAmount","count","totalValue","err","console","ProductStockStatusEnum","findAttribute","attributes","attributeName","attr","_attr$Name","toLowerCase","findAllAttributes","_attr$Name2","findAttributeValue","attribute","DataTypeValue","CurrencyCode","DateTimeOffsetValue","FloatValue","IntegerValue","TextValue","BooleanValue","buildProductBadgeUrl","badgeName","baseUrl","suffix","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","linkedCartLine","WarrantableLineNumber","getRelatedCartLines","productCartLine","cartLinesToRemove","LineNumber","productLineId","cartLines","_cartLine$ExtensionPr2","TotalAmount","ex","_ex$Value","PickUpInStore","_toggleBOPIS","storeSelectorStateManager","cartline","storeSelectorModuleId","isBopisSelected","openDialog","alreadySelectedLocation","OrgUnitNumber","FulfillmentStoreId","deliveryOptions","onLocationSelected","orgUnitLocation","deliveryMode","Promise","resolve","result","updateCartLinePickupLocation","cartLineId","location","status","relatedLines","bonusLines","l","IsWarrantyLine","inStockAtStore","warehouseAvailability","_props$context$reques","_props$context$reques2","InventLocationId","InventoryLocationId","DataAreaId","InventLocationDataAreaId","availablity","_warehouseAvailabilit","AggregatedProductInventoryAvailabilities","PhysicalAvailableInventoryLevelCode","relatedLine","clearCartLinePickupLocation","locationChangedHandler","_onLocationChangedCallback","DeliveryMode","ShippingAddress","_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","shippedLabel","bonusProduct","idx","reducedDimensions","originalPriceText","cultureFormatter","formatCurrency","AdjustedPrice","shipped","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","_props$quantity","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","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","_props$selectedWarran","productLine","updatedCartLinesObject","warrantyLine","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":""}