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,cCAjBsY,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/get-product-unit-of-measure-options.action.ts?bc1e","webpack://Msdyn365.Commerce.Online/./src/components/common/product-inventory-utils.ts?8daa","webpack://Msdyn365.Commerce.Online/./src/shared-utils/agreement-product-utils.ts?ee0a","webpack://Msdyn365.Commerce.Online/./src/shared-utils/attributes/locale/locale.ts?bf3e","webpack://Msdyn365.Commerce.Online/./src/shared-utils/attributes/on-buy-access-validator.ts?4b31","webpack://Msdyn365.Commerce.Online/./src/shared-utils/badge-utils.ts?ae14","webpack://Msdyn365.Commerce.Online/./src/shared-utils/hooks/use-active-prices.ts?6577","webpack://Msdyn365.Commerce.Online/./src/themes/dlvry-adventureworks/views/product-collection.view.tsx?17ff","webpack://Msdyn365.Commerce.Online/./lib/product-collection/module-registration.js?36d3","webpack://Msdyn365.Commerce.Online/./src/modules/product-collection/product-collection.tsx?4008","webpack://Msdyn365.Commerce.Online/./src/modules/product-collection/product-collection.view.tsx?5d36","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["import { callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest, IQueryResultSettings } from \"@msdyn365-commerce/retail-proxy\";\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Types from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nfunction getProductUnitOfMeasureOptionsQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n}\r\n\r\n\r\nexport function getProductUnitOfMeasureOptionsInput(\r\n queryResultSettings: IQueryResultSettings, productIds:\r\n number[]\r\n): IDataServiceRequest {\r\n const query = getProductUnitOfMeasureOptionsQuery().resultSettings(queryResultSettings);\r\n query.top(10000);\r\n return query.createDataServiceRequestForOperation(\r\n 'GetProductUnitOfMeasureOptions',\r\n true, Entities.UnitOfMeasureConversionClass,\r\n 'true',\r\n { bypassCache: 'none', returnEntity: 'Entities.UnitOfMeasureConversion' },\r\n {\r\n productIds: productIds\r\n }\r\n );\r\n}\r\n\r\nexport async function getProductUnitOfMeasureOptionsAsync(context: IContext, productIds: number[]): Promise {\r\n const request = getProductUnitOfMeasureOptionsInput(\r\n context.queryResultSettings || {}, productIds);\r\n const conversions = await callActionOrExecute(request, context.callerContext);\r\n return conversions;\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 { IActionContext } from '@msdyn365-commerce/core';\r\nimport {\r\n InventoryAvailabilitySearchCriteria,\r\n ProductAvailableQuantity,\r\n ProductWarehouseInventoryAvailability,\r\n ProductWarehouseInventoryInformation,\r\n SearchArea\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport enum DeliveryMode {\r\n allWareHouses = 0,\r\n shipping = 1,\r\n pickup = 2\r\n}\r\n\r\n/**\r\n * This setting defines the inventory levels supported.\r\n */\r\nexport enum InventoryLevels {\r\n physicalAvailable = 'physicalAvailable',\r\n totalAvailable = 'totalAvailable',\r\n threshold = 'inventoryThreshold'\r\n}\r\n\r\n/**\r\n * Product inventory information class.\r\n */\r\nexport interface IProductInventoryInformation {\r\n ProductAvailableQuantity: ProductAvailableQuantity;\r\n StockLevelCode?: string;\r\n StockLevelLabel?: string;\r\n IsProductAvailable: boolean;\r\n InventLocationId?: string;\r\n deliveryType?: DeliveryMode;\r\n}\r\n\r\n/**\r\n * This setting defines the inventory level values return by the API.\r\n */\r\nexport enum InventoryLevelValues {\r\n outOfStock = 'OOS',\r\n available = 'AVAIL'\r\n}\r\n/**\r\n * The function defines whether the inventory label should be displayed or not.\r\n * @param context - The action context.\r\n * @param inventoryCode - The inventory code.\r\n * @returns Boolean.\r\n */\r\nexport function displayLabelEnabled(context: IActionContext, inventoryCode?: string): boolean {\r\n if (!inventoryCode) {\r\n return false;\r\n }\r\n\r\n // eslint-disable-next-line default-case\r\n switch (context.requestContext.app.config.inventoryRanges) {\r\n case 'lowAndOutofStock':\r\n if (inventoryCode !== InventoryLevelValues.available) {\r\n return true;\r\n }\r\n break;\r\n case 'outOfStock':\r\n if (inventoryCode === InventoryLevelValues.outOfStock) {\r\n return true;\r\n }\r\n break;\r\n case 'all':\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * The function that maps a ProductWareHouse object into a ProductAvailabilityQuantity.\r\n * @param context - The action context.\r\n * @param productsWarehouseInventory - The product warehouse inventory information.\r\n * @returns IProductInventoryInformation[].\r\n */\r\nexport function mapProductInventoryInformation(\r\n context: IActionContext,\r\n productsWarehouseInventory?: ProductWarehouseInventoryAvailability[]\r\n): IProductInventoryInformation[] {\r\n const productInventoryInformation: IProductInventoryInformation[] = [];\r\n\r\n if (context.requestContext.app.config.enableStockCheck === undefined || context.requestContext.app.config.enableStockCheck === false) {\r\n return productInventoryInformation;\r\n }\r\n\r\n if (productsWarehouseInventory && productsWarehouseInventory.length > 0) {\r\n for (const product of productsWarehouseInventory) {\r\n switch (context.requestContext.app.config.inventoryLevel) {\r\n case InventoryLevels.physicalAvailable:\r\n // Inventory level is enabled with Physical inventory\r\n const physicalProductMap = mapInventoryWithPhysicalBufferEnabled(context, product);\r\n if (physicalProductMap) {\r\n productInventoryInformation.push(physicalProductMap);\r\n }\r\n break;\r\n case InventoryLevels.totalAvailable:\r\n // Inventory level is enabled with Total available inventory\r\n const totalAvailableProductMap = mapInventoryWithTotalAvailableBufferEnabled(context, product);\r\n if (totalAvailableProductMap) {\r\n productInventoryInformation.push(totalAvailableProductMap);\r\n }\r\n break;\r\n default:\r\n // When inventory level is inventoryThreshold or not defined\r\n const productMap = mapInventoryWithThresholdEnabled(context, product);\r\n if (productMap) {\r\n productInventoryInformation.push(productMap);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return productInventoryInformation;\r\n}\r\n\r\n/**\r\n * The function that maps inventory for when threshold is selected.\r\n * @param context - The action context.\r\n * @param productWarehouseInventoryAvailability - The product warehouse inventory information.\r\n * @returns IProductInventoryInformation.\r\n */\r\nexport function mapInventoryWithThresholdEnabled(\r\n context: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n): IProductInventoryInformation | null {\r\n if (productWarehouseInventoryAvailability.ProductId && productWarehouseInventoryAvailability.TotalAvailable !== undefined) {\r\n const productQty = productWarehouseInventoryAvailability.TotalAvailable - context.requestContext.app.config.outOfStockThreshold;\r\n const productAvailableQuantity: ProductAvailableQuantity = {\r\n ProductId: productWarehouseInventoryAvailability.ProductId,\r\n AvailableQuantity: productQty > 0 ? productQty : 0\r\n };\r\n\r\n return {\r\n ProductAvailableQuantity: productAvailableQuantity,\r\n IsProductAvailable: !!(productAvailableQuantity.AvailableQuantity && productAvailableQuantity.AvailableQuantity > 0),\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * The function that maps inventory for when physical available is selected.\r\n * @param context - The action context.\r\n * @param productWarehouseInventoryAvailability - The product warehouse inventory information.\r\n * @returns IProductInventoryInformation.\r\n */\r\nexport function mapInventoryWithPhysicalBufferEnabled(\r\n context: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n): IProductInventoryInformation | null {\r\n const shouldRenderLabel = displayLabelEnabled(context, productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode);\r\n\r\n if (productWarehouseInventoryAvailability.ProductId && productWarehouseInventoryAvailability.TotalAvailable !== undefined) {\r\n // As per the new buffer logic from RS,\r\n // if code is out of stock then we set the available quantity to 0 regardless of the actual value from API\r\n let productQuantity: number | undefined = 0;\r\n if (productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode !== InventoryLevelValues.outOfStock) {\r\n productQuantity =\r\n productWarehouseInventoryAvailability.MaximumPurchasablePhysicalAvailableQuantity ??\r\n productWarehouseInventoryAvailability.PhysicalAvailable;\r\n }\r\n\r\n const productAvailableQuantity: ProductAvailableQuantity = {\r\n ProductId: productWarehouseInventoryAvailability.ProductId,\r\n AvailableQuantity: productQuantity\r\n };\r\n return {\r\n ProductAvailableQuantity: productAvailableQuantity,\r\n StockLevelCode: shouldRenderLabel ? productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode : undefined,\r\n StockLevelLabel: shouldRenderLabel ? productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelLabel : undefined,\r\n IsProductAvailable: productAvailableQuantity.AvailableQuantity !== undefined && productAvailableQuantity.AvailableQuantity > 0,\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * The function that maps inventory for when total available is selected.\r\n * @param context - The action context.\r\n * @param productWarehouseInventoryAvailability - The product warehouse inventory information.\r\n * @returns IProductInventoryInformation.\r\n */\r\nexport function mapInventoryWithTotalAvailableBufferEnabled(\r\n context: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n): IProductInventoryInformation | null {\r\n const shouldRenderLabel = displayLabelEnabled(context, productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode);\r\n if (productWarehouseInventoryAvailability.ProductId && productWarehouseInventoryAvailability.TotalAvailable !== undefined) {\r\n // As per the new buffer logic from RS,\r\n // if code is out of stock then we set the available quantity to 0 regardless of the actual value from API\r\n let productQuantity: number | undefined = 0;\r\n if (productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode !== InventoryLevelValues.outOfStock) {\r\n productQuantity =\r\n productWarehouseInventoryAvailability.MaximumPurchasableTotalAvailableQuantity ??\r\n productWarehouseInventoryAvailability.TotalAvailable;\r\n }\r\n\r\n const productAvailableQuantity: ProductAvailableQuantity = {\r\n ProductId: productWarehouseInventoryAvailability.ProductId,\r\n AvailableQuantity: productQuantity\r\n };\r\n return {\r\n ProductAvailableQuantity: productAvailableQuantity,\r\n StockLevelCode: shouldRenderLabel ? productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode : undefined,\r\n StockLevelLabel: shouldRenderLabel ? productWarehouseInventoryAvailability.TotalAvailableInventoryLevelLabel : undefined,\r\n // eslint-disable-next-line eqeqeq\r\n IsProductAvailable: productAvailableQuantity.AvailableQuantity != undefined && productAvailableQuantity.AvailableQuantity > 0,\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * The function created a InventoryAvailabilitySearchCriteria object for getEstimatedAvailability API.\r\n * @param context - The action context.\r\n * @returns Boolean.\r\n */\r\nexport function isAggregatedInventory(context: IActionContext): boolean {\r\n // If warehouse aggregated is true then query inventory from multiple warehouses\r\n // else query from single warehouse\r\n return (\r\n (context.requestContext.app.config.inventoryLevel === InventoryLevels.totalAvailable ||\r\n context.requestContext.app.config.inventoryLevel === InventoryLevels.physicalAvailable) &&\r\n context.requestContext.app.config.warehouseAggregation === 'multiple'\r\n );\r\n}\r\n\r\n/**\r\n * The function created a InventoryAvailabilitySearchCriteria object for getEstimatedAvailability API.\r\n * @param context - The action context.\r\n * @param productWarehouseInventoryInformation - The product ware house inventory information.\r\n * @returns ProductWarehouseInventoryInformation.\r\n */\r\nexport function mapAggregatedProductInventoryInformation(\r\n context: IActionContext,\r\n productWarehouseInventoryInformation: ProductWarehouseInventoryInformation\r\n): IProductInventoryInformation[] {\r\n if (isAggregatedInventory(context)) {\r\n const productInventoryMapping:\r\n | ProductWarehouseInventoryAvailability[]\r\n | undefined = productWarehouseInventoryInformation.AggregatedProductInventoryAvailabilities?.map(product => {\r\n return {\r\n DataAreaId: product.DataAreaId,\r\n MaximumPurchasablePhysicalAvailableQuantity:\r\n product.MaximumPurchasablePhysicalAvailableQuantity ?? product.PhysicalAvailableQuantity,\r\n MaximumPurchasableTotalAvailableQuantity:\r\n product.MaximumPurchasableTotalAvailableQuantity ?? product.TotalAvailableQuantity,\r\n ProductId: product.ProductId,\r\n PhysicalAvailable: product.PhysicalAvailableQuantity,\r\n PhysicalAvailableInventoryLevelCode: product.PhysicalAvailableInventoryLevelCode,\r\n PhysicalAvailableInventoryLevelLabel: product.PhysicalAvailableInventoryLevelLabel,\r\n TotalAvailable: product.TotalAvailableQuantity,\r\n TotalAvailableInventoryLevelCode: product.TotalAvailableInventoryLevelCode,\r\n TotalAvailableInventoryLevelLabel: product.TotalAvailableInventoryLevelLabel\r\n };\r\n });\r\n return mapProductInventoryInformation(context, productInventoryMapping);\r\n }\r\n\r\n return mapProductInventoryInformation(context, productWarehouseInventoryInformation.ProductWarehouseInventoryAvailabilities);\r\n}\r\n\r\n/**\r\n * The function created a InventoryAvailabilitySearchCriteria object for getEstimatedAvailability API.\r\n * @param context - The action context.\r\n * @param productIds - The product id collection.\r\n * @param isDefaultWareHouse - Flag to define whether inventory is from default warehouse or not.\r\n * @param isFilterByChannelFulfillmentGroup - Filter by fulfillment group.\r\n * @param searchArea - The search area.\r\n * @param defaultDeliveryMode - The delivery mode.\r\n * @returns InventoryAvailabilitySearchCriteria.\r\n */\r\nexport function createInventoryAvailabilitySearchCriteria(\r\n context: IActionContext,\r\n productIds: number[],\r\n isDefaultWareHouse?: boolean,\r\n isFilterByChannelFulfillmentGroup?: boolean,\r\n searchArea?: SearchArea,\r\n defaultDeliveryMode?: DeliveryMode\r\n): InventoryAvailabilitySearchCriteria {\r\n const salesUnitType = 2;\r\n const deliveryMode = defaultDeliveryMode ? defaultDeliveryMode : DeliveryMode.shipping;\r\n\r\n const inventoryAvailabilitySearchCriteria: InventoryAvailabilitySearchCriteria = {\r\n ProductIds: productIds,\r\n QuantityUnitTypeValue: salesUnitType,\r\n SearchArea: searchArea\r\n };\r\n\r\n if (isAggregatedInventory(context)) {\r\n inventoryAvailabilitySearchCriteria.FilterByChannelFulfillmentGroup = true;\r\n inventoryAvailabilitySearchCriteria.DeliveryModeTypeFilterValue = deliveryMode;\r\n } else {\r\n inventoryAvailabilitySearchCriteria.DefaultWarehouseOnly = isDefaultWareHouse;\r\n inventoryAvailabilitySearchCriteria.FilterByChannelFulfillmentGroup = isFilterByChannelFulfillmentGroup;\r\n }\r\n\r\n return inventoryAvailabilitySearchCriteria;\r\n}\r\n","import { ICoreContext } from \"@msdyn365-commerce/core\";\r\nimport { AttributeValue, Customer } from \"@msdyn365-commerce/retail-proxy\";\r\nimport { getLocale } from \"./attributes/locale\";\r\nimport { getAttributeBooleanOrDefault } from \"./attributes\";\r\n\r\nexport function hasAgreementProducts(context: ICoreContext, customer: Customer | undefined): boolean {\r\n const agreementProductAttributeRecordIds: Number[] | undefined = context.request.app.config?.agreementProductAttributeRecordId?.split(',').map(Number).filter(Boolean);\r\n // Check if customer has any product agreement that should be shown\r\n const shouldShowAgreementProducts = agreementProductAttributeRecordIds && agreementProductAttributeRecordIds.length > 0\r\n ? agreementProductAttributeRecordIds.some(x => customer?.Attributes?.find(y => y.RecordId === x)?.AttributeValue?.BooleanValue)\r\n : false;\r\n return shouldShowAgreementProducts;\r\n}\r\n\r\nexport function getAgreementProductRefinersToHide(context: ICoreContext, customer: Customer | undefined): number[] | undefined {\r\n const refinerIds = context.request.app.config?.agreementProductAttributeRecordId\r\n ?.split(',')\r\n .map(Number)\r\n .filter(Boolean) as number[] | undefined;\r\n\r\n // Hide all refiners if customer is not available\r\n if (!customer) {\r\n return refinerIds;\r\n }\r\n\r\n const refinersToHide = refinerIds?.filter(refinerId => {\r\n const attribute = customer.Attributes?.find(x => x.RecordId === refinerId);\r\n return !attribute?.AttributeValue?.BooleanValue;\r\n });\r\n\r\n return refinersToHide;\r\n}\r\n\r\nlet cachedAttributesMap: ReturnType | undefined;\r\n\r\nexport function isAgreementProduct(contextOrLocale: ICoreContext | string, attributes: AttributeValue[] | undefined): boolean {\r\n if (!cachedAttributesMap) {\r\n cachedAttributesMap = getLocale(contextOrLocale);\r\n }\r\n\r\n const helseNord = getAttributeBooleanOrDefault(attributes, cachedAttributesMap.helseNord, false);\r\n const municipalityNorth = getAttributeBooleanOrDefault(attributes, cachedAttributesMap.municipalityNorth, false);\r\n\r\n return helseNord || municipalityNorth;\r\n}\r\n","import { ICoreContext } from '@msdyn365-commerce/core';\r\nimport nbNO from './nb-NO.json';\r\nimport enUS from './en-US.json';\r\n\r\nexport function getLocale(langOrContext: string | ICoreContext): typeof nbNO {\r\n const lang = typeof langOrContext === 'string' ? langOrContext : langOrContext.request.locale;\r\n\r\n switch (lang) {\r\n case 'nb-NO':\r\n return nbNO;\r\n case 'en-US':\r\n return {...nbNO, ...enUS};\r\n default:\r\n return nbNO;\r\n }\r\n}\r\n","import { ICoreContext } from '@msdyn365-commerce/core';\r\nimport { ProductSearchResultExt } from \"../../modules/dlvry-search-result-container/components\";\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport { hasAccessToBuy } from '.';\r\n\r\nexport interface OnBuyHasAccessValidatorResult {\r\n isValid: boolean;\r\n message?: string;\r\n}\r\n\r\nexport async function onBuyHasAccessValidator(\r\n context: ICoreContext,\r\n customer: Customer | undefined,\r\n product: ProductSearchResultExt,\r\n validationMessage: string | undefined\r\n): Promise {\r\n if (!product || !product.AttributeValues) {\r\n return { isValid: true };\r\n }\r\n\r\n const hasAccess = hasAccessToBuy(context, customer, product.AttributeValues);\r\n\r\n return {\r\n isValid: hasAccess,\r\n message: hasAccess ? undefined : validationMessage\r\n };\r\n}\r\n","import { ProductPrice } from \"@msdyn365-commerce/retail-proxy\";\r\n\r\nexport function getDiscountBadge(productPrice: ProductPrice | undefined): string | undefined {\r\n if (!productPrice || !productPrice.DiscountLines || productPrice.DiscountLines.length === 0) {\r\n return;\r\n }\r\n\r\n const discountLineWithBadge = productPrice.DiscountLines.find(x => {\r\n const matches = x.OfferName?.toLowerCase().match(/\\{(.*?)\\}/i) || '';\r\n const parts = matches.length > 1 ? matches[1].split(';').map(x => x.trim()) : undefined;\r\n return parts?.find(x => x.startsWith('badge:'));\r\n });\r\n const offerName = discountLineWithBadge?.OfferName;\r\n\r\n if (!offerName) {\r\n return undefined;\r\n }\r\n\r\n const badge = /\\{.*Badge\\s*:\\s*(.*?)[};]/i.exec(offerName);\r\n\r\n if (badge && badge.length > 1) {\r\n return badge[1].trim();\r\n }\r\n\r\n return undefined;\r\n}","import * as React from 'react';\r\nimport { ProductPrice, SimpleProduct, ProjectionDomain } from '@msdyn365-commerce/retail-proxy';\r\nimport { ICoreContext, getCatalogId } from '@msdyn365-commerce/core';\r\nimport { getActivePricesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\nasync function getPricesAsync(context: ICoreContext, products: number[], batchSize: number = 30): Promise {\r\n const result: ProductPrice[] = [];\r\n const catalogId = context.request.apiSettings.catalogId ?? getCatalogId(context.actionContext.requestContext);\r\n const projectDomain: ProjectionDomain = { ChannelId: +context.request.apiSettings.channelId, CatalogId: catalogId };\r\n\r\n // Work with X products at a time\r\n const batchCount = Math.ceil(products.length / batchSize);\r\n\r\n for (let i = 0; i < batchCount; i++) {\r\n const batch = products.slice(i * batchSize, (i + 1) * batchSize);\r\n const prices = await getActivePricesAsync({ callerContext: context.actionContext }, projectDomain, batch, new Date(), null, undefined, true);\r\n result.push(...prices);\r\n }\r\n\r\n return result;\r\n}\r\n\r\nexport function useActivePrices(context: ICoreContext, products: SimpleProduct[] | number[] | undefined, batchSize: number = 30): [ProductPrice[], boolean, Error | undefined] {\r\n const [activePrices, setActivePrices] = React.useState([]);\r\n const [loading, setLoading] = React.useState(true);\r\n const [error, setError] = React.useState(undefined);\r\n\r\n React.useEffect(() => {\r\n if (error || !products || products.length < 1 || !context.request.user.isAuthenticated) {\r\n setLoading(false);\r\n return;\r\n }\r\n\r\n let recIds: number[];\r\n\r\n if (typeof products[0] === 'number') {\r\n recIds = products as number[];\r\n } else {\r\n recIds = (products as SimpleProduct[]).map(product => product.RecordId);\r\n }\r\n\r\n if (recIds.every(id => activePrices.some(price => price.ProductId === id))) {\r\n // We already have all the prices\r\n setLoading(false);\r\n return;\r\n }\r\n\r\n getPricesAsync(context, recIds, batchSize)\r\n .then(prices => setActivePrices(prices))\r\n .catch(error => setError(error))\r\n .finally(() => setLoading(false));\r\n }, [products]);\r\n\r\n return [activePrices, loading, error];\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 { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport * as React from 'react';\r\nimport { ICoreContext } from '@msdyn365-commerce/core';\r\nimport { IProductCollectionViewProps, IProductComponentViewProps } from '@msdyn365-commerce-modules/product-collection/src/modules/product-collection/./product-collection';\r\nimport { IProductCollectionData } from './product-collection.data';\r\nimport { IProductCollectionProps, IProductCollectionResources } from '../definition-extensions/product-collection.ext.props.autogenerated';\r\nimport { CommerceList, CommerceListsDataActions, Customer, ProductList, ProductsDataActions, SimpleProduct, UnitOfMeasureConversion } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n OrderTemplate,\r\n QueryResultSettingsProxy,\r\n GetOrderTemplatesInput,\r\n getOrderTemplates,\r\n GetCustomerInput,\r\n getCustomer,\r\n buildWishlistLine\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport ProductComponent, { IAddToOrderTemplateResources, IProductComponentProps } from './components/product.component';\r\nimport PQueue from 'p-queue';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getProductUnitOfMeasureOptionsAsync } from '../../../actions/get-product-unit-of-measure-options.action';\r\nimport { DeliveryMode, IProductInventoryInformation, createInventoryAvailabilitySearchCriteria, mapAggregatedProductInventoryInformation } from '../../../components/common/product-inventory-utils';\r\nimport { onBuyHasAccessValidator } from '../../../shared-utils/attributes/on-buy-access-validator';\r\nimport { ProductSearchResultExt } from '../../../modules/dlvry-search-result-container/components';\r\nimport { useActivePrices } from '../../../shared-utils/hooks/use-active-prices';\r\nimport { getDiscountBadge } from '../../../shared-utils/badge-utils';\r\nimport { getAttributeStringOrDefault, getAttributesLocale } from '../../../shared-utils/attributes';\r\nimport { getTemperatureZone } from '../../../shared-utils/attributes/get-temperature-zone';\r\nimport { toast, toasts } from '../../../components/toast/toast';\r\nimport { hasAgreementProducts, isAgreementProduct } from '../../../shared-utils/agreement-product-utils';\r\n\r\nfunction getInventoryLabel(productRecordId: number, productInventoryStatus: IProductInventoryInformation[] | undefined): string | undefined {\r\n if(productInventoryStatus){\r\n const shippingInventory = productInventoryStatus.find(shipping => shipping.ProductAvailableQuantity.ProductId === productRecordId);\r\n if(shippingInventory && shippingInventory.StockLevelLabel){\r\n return shippingInventory.StockLevelLabel;\r\n }\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nconst useGetInventoryStatus = (props: IProductCollectionViewProps & IProductCollectionProps) => {\r\n const { config, context } = props;\r\n const [productInventoryStatus, setProductInventoryStatus] = React.useState();\r\n\r\n React.useEffect(() => {\r\n if (!config.productCollection?.products || config.productCollection.products.length === 0) {\r\n return;\r\n }\r\n\r\n const work = async () => {\r\n const shippingSearchCriteria = createInventoryAvailabilitySearchCriteria(\r\n context.actionContext,\r\n config.productCollection.products.map(x => x.RecordId),\r\n true,\r\n undefined,\r\n undefined,\r\n DeliveryMode.shipping\r\n );\r\n\r\n const shippingAvailability = await ProductsDataActions.getEstimatedAvailabilityAsync(\r\n { callerContext: context.actionContext },\r\n shippingSearchCriteria\r\n );\r\n\r\n if (shippingAvailability.ProductWarehouseInventoryAvailabilities) {\r\n const shippingInventory = mapAggregatedProductInventoryInformation(context.actionContext, shippingAvailability);\r\n\r\n if (ArrayExtensions.hasElements(shippingInventory)) {\r\n shippingInventory[0].deliveryType = DeliveryMode.shipping;\r\n setProductInventoryStatus(shippingInventory);\r\n }\r\n }\r\n };\r\n void work();\r\n }, [config.productCollection]);\r\n\r\n return productInventoryStatus;\r\n};\r\n\r\nconst ProductCollectionView: React.FC> = props => {\r\n const {\r\n context,\r\n heading,\r\n ProductCollectionContainer,\r\n products,\r\n SingleSlideCarouselComponentProps,\r\n GridComponentProps,\r\n isCarousel,\r\n seeAllButton,\r\n resources,\r\n data: { cart, customerInformation, orgInformation, wishlists }\r\n } = props;\r\n const [orderTemplates, setOrderTemplates] = React.useState(undefined);\r\n const cartQueue = React.useMemo(() => new PQueue({ concurrency: 1 }), []);\r\n const [simpleProducts, setSimpleProducts] = React.useState(undefined);\r\n const [unitConversions, setConversions] = React.useState([]);\r\n const productInventoryStatus = useGetInventoryStatus(props);\r\n\r\n React.useEffect(() => {\r\n const { actionContext, request, app } = props.context;\r\n const ids = props.config.productCollection?.products?.map(x => x.RecordId) as number[] | undefined;\r\n\r\n if (!ids || ids.length === 0) {\r\n return;\r\n }\r\n\r\n if (ids?.some(x => !simpleProducts?.find(y => y.RecordId === x))) {\r\n const work = async () => {\r\n const simpleProducts = await getByIdsAsync(\r\n { callerContext: actionContext },\r\n request.apiSettings.channelId,\r\n ids,\r\n null,\r\n request.apiSettings.catalogId);\r\n setSimpleProducts(simpleProducts);\r\n };\r\n void work();\r\n }\r\n\r\n if (request.user.isAuthenticated && app.config.unitOfMeasureConversions) {\r\n const work = async () => {\r\n const conversions = await getProductUnitOfMeasureOptionsAsync({ callerContext: actionContext }, ids);\r\n setConversions(conversions);\r\n };\r\n void work();\r\n }\r\n }, [props.config.productCollection]);\r\n\r\n const [activePrices] = useActivePrices(context, props.config.productCollection?.products?.map(x => x.RecordId));\r\n\r\n if (Array.isArray(products)) {\r\n products?.forEach((product) => {\r\n const typedProduct = ((product.productComponent as React.ReactElement).props.data.product as ProductSearchResultExt);\r\n const price = activePrices.find(x => x.ProductId === typedProduct.RecordId);\r\n \r\n product.productComponent = React.cloneElement(product.productComponent as React.ReactElement, {\r\n showPrice: !!price\r\n });\r\n \r\n const attributeLocale = getAttributesLocale(context.request.locale);\r\n typedProduct.Brand = getAttributeStringOrDefault(typedProduct.AttributeValues, attributeLocale.brand, undefined);\r\n typedProduct.Manufacturer = getAttributeStringOrDefault(typedProduct.AttributeValues, attributeLocale.manufacturer, undefined);\r\n typedProduct.Transit = getAttributeStringOrDefault(typedProduct.AttributeValues, attributeLocale.transit, undefined) === '1';\r\n typedProduct.IsAgreementProduct = isAgreementProduct(context, typedProduct.AttributeValues);\r\n typedProduct.TemperatureZone = getTemperatureZone(context.request.locale, typedProduct.AttributeValues);\r\n typedProduct.AgentImporter = getAttributeStringOrDefault(typedProduct.AttributeValues, attributeLocale.agentImporter, undefined);\r\n typedProduct.Producer = getAttributeStringOrDefault(typedProduct.AttributeValues, attributeLocale.producer, undefined);\r\n\r\n typedProduct.Price = price?.CustomerContextualPrice ?? 0;\r\n typedProduct.BasePrice = price?.BasePrice ?? 0;\r\n typedProduct.MaxVariantPrice = price?.MaxVariantPrice ?? 0;\r\n typedProduct.MinVariantPrice = price?.MinVariantPrice ?? 0;\r\n typedProduct.ProductPrice = price;\r\n typedProduct.Badge = getDiscountBadge(price);\r\n });\r\n }\r\n\r\n const updateOrderTemplatesAsync = async (newOrderTemplate?: ProductList) => {\r\n let newOrderTemplates;\r\n\r\n if (newOrderTemplate) {\r\n newOrderTemplates = [...(orderTemplates ? orderTemplates : [])];\r\n\r\n // Add new order template if it doesn't exist\r\n if (newOrderTemplates.every(x => x.productList.Id !== newOrderTemplate.Id)) {\r\n newOrderTemplates.splice(0, 0, new OrderTemplate(newOrderTemplate, [], 0));\r\n }\r\n } else {\r\n // Refresh order templates incase new order template was created\r\n const queryResultSettings = QueryResultSettingsProxy.fromInputData({\r\n requestContext: props.context.request,\r\n config: props.config\r\n }).QueryResultSettings;\r\n const input = new GetOrderTemplatesInput('', queryResultSettings);\r\n newOrderTemplates = (await getOrderTemplates(input, props.context.actionContext)).map(x => new OrderTemplate(x, [], 0));\r\n }\r\n\r\n setOrderTemplates(newOrderTemplates);\r\n return newOrderTemplates;\r\n };\r\n\r\n const retrieveOrderTemplates = async () => {\r\n return orderTemplates ? orderTemplates : await updateOrderTemplatesAsync();\r\n };\r\n\r\n React.useEffect(() => {\r\n if (!props.config.autoplay) {\r\n return;\r\n }\r\n\r\n if (props.id !== 'product-collection__2') {\r\n return;\r\n }\r\n\r\n const nextFlipperId = `flipperNextButton_${props.id}`;\r\n const prevFlipperId = `flipperPreviousButton_${props.id}`;\r\n const nextFlipper = document.getElementById(nextFlipperId) as HTMLButtonElement;\r\n const prevFlipper = document.getElementById(prevFlipperId) as HTMLButtonElement;\r\n const carousel = prevFlipper.closest('.msc-ss-carousel');\r\n\r\n const intervalMS = props.config.interval || 5000;\r\n const onAutoPlay = () => {\r\n if (!nextFlipper.disabled) {\r\n nextFlipper.click();\r\n } else if (!prevFlipper.disabled) {\r\n prevFlipper.click();\r\n }\r\n };\r\n let interval = setInterval(onAutoPlay, intervalMS);\r\n\r\n if (props.config.pauseOnHover) {\r\n carousel?.addEventListener('mouseover', () => {\r\n clearInterval(interval);\r\n });\r\n carousel?.addEventListener('mouseleave', () => {\r\n interval = setInterval(onAutoPlay, intervalMS);\r\n });\r\n }\r\n }, []);\r\n\r\n if (products) {\r\n return (\r\n \r\n {heading}\r\n {seeAllButton}\r\n {isCarousel\r\n ? _renderCarousel(context,\r\n SingleSlideCarouselComponentProps,\r\n products,\r\n cart.result,\r\n customerInformation.result,\r\n orgInformation.result,\r\n unitConversions,\r\n wishlists.result,\r\n cartQueue,\r\n retrieveOrderTemplates,\r\n updateOrderTemplatesAsync,\r\n resources,\r\n simpleProducts,\r\n productInventoryStatus)\r\n : _renderGrid(context,\r\n GridComponentProps,\r\n products,\r\n cart.result,\r\n customerInformation.result,\r\n orgInformation.result,\r\n unitConversions,\r\n wishlists.result,\r\n cartQueue,\r\n retrieveOrderTemplates,\r\n updateOrderTemplatesAsync,\r\n resources,\r\n simpleProducts,\r\n productInventoryStatus)}\r\n \r\n );\r\n }\r\n\r\n // If no products are retrieved and the list type is promotional, still render the module to keep the entry of promotion page\r\n if (props.config.productCollection.listType === 'promotional') {\r\n return (\r\n \r\n {heading}\r\n {seeAllButton}\r\n {_renderNoProduct(resources)}\r\n \r\n );\r\n }\r\n props.context.telemetry.error('Product collection content is empty, module wont render.');\r\n return null;\r\n};\r\n\r\nconst _renderCarousel = (\r\n context: ICoreContext,\r\n carouselContainer: INodeProps,\r\n items: IProductComponentViewProps[],\r\n cart: ICartState | undefined,\r\n customerInformation: Customer | undefined,\r\n orgInformation: Customer | undefined,\r\n unitConversions: UnitOfMeasureConversion[],\r\n wishlists: CommerceList[] | undefined,\r\n cartQueue: PQueue,\r\n retrieveOrderTemplates: () => Promise,\r\n onUpdateOrderTemplates: ((orderTemplate?: ProductList | undefined) => Promise) | undefined,\r\n resources: IProductCollectionResources,\r\n simpleProducts: SimpleProduct[] | undefined,\r\n productInventoryStatus: IProductInventoryInformation[] | undefined\r\n): JSX.Element => {\r\n return (\r\n \r\n {items && items.map(x => _renderProduct(\r\n context,\r\n x,\r\n simpleProducts?.find(sp => (x.productComponent as React.ReactElement).props.data.product.RecordId === sp.RecordId),\r\n cart,\r\n customerInformation,\r\n orgInformation,\r\n unitConversions,\r\n wishlists,\r\n productInventoryStatus?.find(pi => pi.ProductAvailableQuantity.ProductId === (x.productComponent as React.ReactElement).props.data.product.RecordId),\r\n cartQueue,\r\n retrieveOrderTemplates,\r\n onUpdateOrderTemplates,\r\n resources))}\r\n \r\n );\r\n};\r\n\r\nconst _renderGrid = (\r\n context: ICoreContext,\r\n gridContainer: INodeProps,\r\n items: IProductComponentViewProps[],\r\n cart: ICartState | undefined,\r\n customerInformation: Customer | undefined,\r\n orgInformation: Customer | undefined,\r\n unitConversions: UnitOfMeasureConversion[],\r\n wishlists: CommerceList[] | undefined,\r\n cartQueue: PQueue,\r\n retrieveOrderTemplates: () => Promise,\r\n onUpdateOrderTemplates: ((orderTemplate?: ProductList | undefined) => Promise) | undefined,\r\n resources: IProductCollectionResources,\r\n simpleProducts: SimpleProduct[] | undefined,\r\n productInventoryStatus: IProductInventoryInformation[] | undefined\r\n): JSX.Element => {\r\n return (\r\n \r\n {items && items.map(x => _renderProduct(\r\n context,\r\n x,\r\n simpleProducts?.find(sp => (x.productComponent as React.ReactElement).props.data.product.RecordId === sp.RecordId),\r\n cart,\r\n customerInformation,\r\n orgInformation,\r\n unitConversions,\r\n wishlists,\r\n productInventoryStatus?.find(pi => pi.ProductAvailableQuantity.ProductId === (x.productComponent as React.ReactElement).props.data.product.RecordId),\r\n cartQueue,\r\n retrieveOrderTemplates,\r\n onUpdateOrderTemplates,\r\n resources))}\r\n \r\n );\r\n};\r\n\r\nconst _renderNoProduct = (resources: IProductCollectionResources): JSX.Element => {\r\n return (\r\n \r\n

{resources.noProductToRenderText}

\r\n
\r\n );\r\n};\r\n\r\nconst _renderProduct = (\r\n context: ICoreContext,\r\n product: IProductComponentViewProps,\r\n simpleProduct: SimpleProduct | undefined,\r\n cart: ICartState | undefined,\r\n customerInformation: Customer | undefined,\r\n orgInformation: Customer | undefined,\r\n unitConversions: UnitOfMeasureConversion[],\r\n wishlists: CommerceList[] | undefined,\r\n productInventoryStatus: IProductInventoryInformation | undefined,\r\n cartQueue: PQueue,\r\n retrieveOrderTemplates: () => Promise,\r\n onUpdateOrderTemplates: ((orderTemplate?: ProductList | undefined) => Promise) | undefined,\r\n resources: IProductCollectionResources\r\n): JSX.Element => {\r\n const { ProductContainer, productComponent } = product;\r\n\r\n const data = {\r\n ...(productComponent as React.ReactElement).props.data,\r\n cart,\r\n customerInformation,\r\n orgInformation,\r\n simpleProduct,\r\n unitConversions: unitConversions.filter(x => x.ProductRecordId === (productComponent as React.ReactElement).props.data.product?.RecordId)\r\n };\r\n\r\n const props: Partial = {\r\n data,\r\n cartQueue,\r\n buyAlwaysAdd: true,\r\n showAgreementProduct: hasAgreementProducts(context, orgInformation),\r\n inventoryLabel: getInventoryLabel((productComponent as React.ReactElement).props.data.product?.RecordId, productInventoryStatus ? [productInventoryStatus] : undefined),\r\n inventoryStatus: productInventoryStatus,\r\n wishlistButton: _renderWishlistButton(context, product, resources, wishlists),\r\n retrieveOrderTemplates: retrieveOrderTemplates,\r\n onUpdateOrderTemplates: onUpdateOrderTemplates,\r\n addToCartText: resources.addToCartText,\r\n updateCartText: resources.updateCartText,\r\n removeFromCartText: resources.removeFromCartText,\r\n priceErrorText: resources.priceErrorText,\r\n inCartTooltipText: resources.inCartTooltipText,\r\n transitTooltip: resources.transitTooltip,\r\n agreementProductTooltip: resources.agreementProductTooltip,\r\n toastStrings: {\r\n errorHeader: resources.toastErrorHeader,\r\n productsAddedToCart: resources.productsAddedToCart,\r\n productsRemovedFromCart: resources.productsRemovedFromCart,\r\n productsUpdatedInCart: resources.productsUpdatedInCart,\r\n goToCart: resources.toastGoToCart,\r\n noAccessToProduct: resources.toastNoAccessToProduct\r\n },\r\n addToOrderTemplateResources: {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText,\r\n createOrderTemplateHeader: resources.createOrderTemplateHeader,\r\n orderTemplateTitle: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n createOrderTemplateDescription: resources.createOrderTemplateDescription,\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n createOrderTemplateButtonText: resources.createOrderTemplateButtonText,\r\n cancelNewOrderTemplateCreationButtonText: resources.cancelNewOrderTemplateCreationButtonText,\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n priceFree: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\r\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\r\n updateQuantityButtonText: resources.updateQuantityButtonText,\r\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText,\r\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\r\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip\r\n } as IAddToOrderTemplateResources,\r\n onBuyValidate: (product) => onBuyHasAccessValidator(\r\n context,\r\n customerInformation,\r\n product,\r\n resources.toastNoAccessToProduct\r\n )\r\n }\r\n\r\n // TODO: Hopefully go back to this\r\n // const extendedProductComponent = React.cloneElement(productComponent as React.ReactElement, props);\r\n\r\n // Force the component to use our override since overrides are not always working automatically atm.\r\n // Directly references our ProductComponent instead of the one passed in.\r\n const forcedComponentProps = {\r\n ...(productComponent as React.ReactElement).props,\r\n ...props\r\n };\r\n const forcedComponent = ;\r\n\r\n return {forcedComponent};\r\n};\r\n\r\nconst _renderWishlistButton = (\r\n context: ICoreContext,\r\n productViewProps: IProductComponentViewProps,\r\n resources: IProductCollectionResources,\r\n wishlists: CommerceList[] | undefined\r\n): JSX.Element => {\r\n const product = (productViewProps.productComponent as React.ReactElement).props.data.product as ProductSearchResultExt;\r\n const isWishlisted = wishlists && wishlists.length > 0 && wishlists[0].CommerceListLines?.find(x => x.ProductId === product.RecordId) ? true : false;\r\n let className = 'btn-add-to-wishlist';\r\n\r\n if (isWishlisted) {\r\n className += ' is-wishlisted';\r\n }\r\n\r\n return (\r\n
\r\n {\r\n if (!isWishlisted) {\r\n await _addItemToWishlist(context, resources, product, wishlists);\r\n } else {\r\n await _removeItemFromWishlist(context, resources, product, wishlists);\r\n }\r\n }\r\n } />\r\n
\r\n )\r\n};\r\n\r\nconst _addItemToWishlist = async (\r\n context: ICoreContext,\r\n resources: IProductCollectionResources,\r\n product: ProductSearchResultExt,\r\n wishlists: CommerceList[] | undefined\r\n) => {\r\n if (!context || !product || !resources || !context.request.user.isAuthenticated) {\r\n return;\r\n }\r\n\r\n const customerInput = new GetCustomerInput(context.actionContext.requestContext.apiSettings);\r\n const customer = await getCustomer(customerInput, context.actionContext);\r\n\r\n if (!customer || !customer.AccountNumber) {\r\n return;\r\n }\r\n\r\n const listData: CommerceList = {\r\n CustomerId: customer.AccountNumber,\r\n Name: resources.defaultWishlistName,\r\n CommerceListTypeValue: 1,\r\n Id: 0\r\n };\r\n\r\n let wishlist = wishlists?.[0];\r\n\r\n if (!wishlist) {\r\n try {\r\n const commerceList = await CommerceListsDataActions.createCommerceListAsync(\r\n { callerContext: context.actionContext },\r\n listData);\r\n wishlist = commerceList;\r\n } catch (err) {\r\n const error = err as any;\r\n const footer = error?.data?.CorrelationId ? `Correlation Id: ${error?.data?.CorrelationId}` : undefined;\r\n toasts.error(resources.toastErrorHeader, error, { footer });\r\n return;\r\n }\r\n }\r\n\r\n try {\r\n const createdCommerceList = await CommerceListsDataActions.addLinesAsync({ callerContext: context.actionContext },\r\n wishlist.Id,\r\n [\r\n buildWishlistLine(product.RecordId, customer.AccountNumber, wishlist.Id)\r\n ]);\r\n context.actionContext.update(CommerceListsDataActions.createGetByCustomerInput({}, null), [createdCommerceList]);\r\n\r\n toast({\r\n text: resources.addedProductToWishlistText.replace('{productName}', product[0].Name || ''),\r\n type: 'success',\r\n autoClose: 3000,\r\n position: 'bottom-right',\r\n canClose: true,\r\n showProgress: false\r\n });\r\n } catch (error) {\r\n const footer = error?.data?.CorrelationId ? `Correlation Id: ${error?.data?.CorrelationId}` : undefined;\r\n toasts.error(resources.toastErrorHeader, error, { footer });\r\n }\r\n};\r\n\r\nconst _removeItemFromWishlist = async (\r\n context: ICoreContext,\r\n resources: IProductCollectionResources,\r\n product: ProductSearchResultExt,\r\n wishlists: CommerceList[] | undefined\r\n) => {\r\n const wishlist = wishlists?.[0];\r\n const wishlistLineId = wishlist?.CommerceListLines?.find(x => x.ProductId === product.RecordId)?.LineId;\r\n\r\n if (!wishlists || !wishlist || !wishlistLineId) {\r\n return;\r\n }\r\n\r\n try {\r\n const updatedCommerceList = await CommerceListsDataActions.removeLinesAsync(\r\n { callerContext: context.actionContext },\r\n wishlist.Id,\r\n [{ LineId: wishlistLineId }]);\r\n\r\n const newWishlists = [ ...wishlists ];\r\n newWishlists[0] = updatedCommerceList;\r\n context.actionContext.update(CommerceListsDataActions.createGetByCustomerInput({}, null), newWishlists);\r\n } catch (err) {\r\n const error = err as any;\r\n const footer = error?.data?.CorrelationId ? `Correlation Id: ${error?.data?.CorrelationId}` : undefined;\r\n toasts.error(resources.toastErrorHeader, error, { footer });\r\n }\r\n};\r\n\r\nexport default ProductCollectionView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['product-collection'] = {\n c: () => require('@msdyn365-commerce-modules/product-collection/dist/lib/modules/product-collection/product-collection'),\n $type: 'containerModule',\n da: [{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0}],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'product-collection',\n p: 'product-collection',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/product-collection/dist/lib/modules/product-collection'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|themes|dlvry-adventureworks|views|product-collection'] = {\n c: () => require('partner/themes/dlvry-adventureworks/views/product-collection.view.tsx'),\n cn: '__local__-__local__-product-collection'\n };\nviewDictionary['@msdyn365-commerce-modules|product-collection|modules|product-collection|product-collection'] = {\n c: () => require('@msdyn365-commerce-modules/product-collection/dist/lib/modules/product-collection/product-collection.view.js'),\n cn: '@msdyn365-commerce-modules-product-collection-product-collection'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\nimport { IPriceComponentResources, ProductComponent } from '@msdyn365-commerce/components';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { getCatalogId, getUrlSync, ICoreContext } from '@msdyn365-commerce/core';\nimport { ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n DimensionAvailabilitiesForProductSearchResultInput,\n DimensionTypes,\n DimensionSwatchDisplayTypes,\n getDimensionAvailabilitiesForProductSearchResultAction,\n getPriceForProductSearchResult,\n IDimensionsApp,\n ObjectExtensions,\n PriceForProductSearchResultInput,\n ProductPriceForSelectedProductsInput,\n validateCatalogId,\n getProductPriceForSelectedProducts\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getTelemetryObject,\n IComponentNodeProps,\n IModuleProps,\n INodeProps,\n ISingleSlideCarouselProps,\n ITelemetryContent,\n NodeTag,\n SingleSlideCarousel\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IProductCollectionData } from './product-collection.data';\nimport { IProductCollectionProps, layout } from './product-collection.props.autogenerated';\n\nexport interface IProductCollectionViewProps extends IProductCollectionProps {\n heading?: React.ReactNode;\n ProductCollectionContainer: IModuleProps;\n SingleSlideCarouselComponentProps: INodeProps;\n GridComponentProps: INodeProps;\n products: IProductComponentViewProps[];\n isCarousel: boolean;\n productPrices?: ProductPrice[];\n seeAllButton?: React.ReactNode;\n}\n\nexport interface IProductComponentViewProps {\n ProductContainer: INodeProps;\n productComponent: React.ReactNode;\n}\nexport interface IProductComponentState {\n products: ProductSearchResult[];\n productPrices: ProductPrice[];\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\n}\n\n/**\n * ProductCollection component.\n */\nclass ProductCollection extends React.PureComponent, IProductComponentState> {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly productPrices: ProductPrice[];\n\n constructor(props: IProductCollectionProps) {\n super(props);\n this.productPrices = [];\n this.state = {\n products: this.props.config.productCollection.products || [],\n productPrices: this.productPrices || []\n };\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n }\n\n public async componentDidMount(): Promise {\n if (this.props.config.enableAffiliationBasedPricing && this.props.context.actionContext.requestContext.user.isAuthenticated) {\n await this._getActivePrice();\n }\n }\n\n public render(): JSX.Element | null {\n const { heading, className, shouldDisplaySeeAllButton } = this.props.config;\n const { resources } = this.props;\n const recommendation = this.props.config.productCollection.recommendationListId;\n const discountIds = this.props.config.productCollection.discountIds;\n\n // Initialize state in case if the products were not found during initial module render\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Initialize data if not there.\n this.initProductState(this.props.config.productCollection);\n\n const products = this.state.products;\n const productPrices = this.state.productPrices;\n\n const isCarousel = this.props.config.layout === layout.carousel;\n const headingLabel = heading ? heading.text : '';\n const headingComponent = heading && (\n \n );\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- product check for safety.\n const updatedProducts = products?.map((item: ProductSearchResult, index: number) => {\n const getProductData = this._getProduct(\n item,\n index,\n productPrices ? productPrices.find(p => p.ProductId === item.RecordId) : undefined\n );\n return !ObjectExtensions.isNullOrUndefined(getProductData) ? getProductData : undefined;\n });\n\n const productCollectionViewProps = {\n ...this.props,\n heading: headingComponent,\n SingleSlideCarouselComponentProps: {\n tag: SingleSlideCarousel,\n className: '',\n flipperPrevLabel: `${headingLabel} ${resources.flipperPrevious}`,\n flipperNextLabel: `${headingLabel} ${resources.flipperNext}`,\n parentId: this.props.id,\n telemetryContent: this.telemetryContent\n } as IComponentNodeProps,\n ProductCollectionContainer: {\n moduleProps: this.props,\n className: classnames('ms-product-collection', className)\n },\n GridComponentProps: {\n tag: 'ul' as NodeTag,\n className: 'ms-product-collection__items'\n },\n isCarousel,\n\n products:\n ArrayExtensions.hasElements(updatedProducts) &&\n updatedProducts.filter(item => {\n return item !== undefined;\n }),\n productPrices: this.productPrices,\n seeAllButton:\n (recommendation || discountIds) &&\n shouldDisplaySeeAllButton &&\n (ArrayExtensions.hasElements(updatedProducts) || this.props.config.productCollection.listType === 'promotional')\n ? this._getSeeAllButton(headingLabel, recommendation, discountIds)\n : undefined,\n resources: resources\n };\n return this.props.renderView(productCollectionViewProps) as React.ReactElement;\n }\n\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\n\n /**\n * Get products dimension availabilities.\n * @param products - Products.\n * @returns Promise.\n */\n private readonly _getProductsDimensionsAvailabilities = async (products: ProductSearchResult[]): Promise => {\n const context = this.props.context as ICoreContext;\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\n const validProducts = ArrayExtensions.validValues(products);\n if (\n ArrayExtensions.hasElements(validProducts) &&\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\n ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none)\n ) {\n const productsDimensionAvailabilities = await getDimensionAvailabilitiesForProductSearchResultAction(\n new DimensionAvailabilitiesForProductSearchResultInput(\n validProducts,\n this.props.context as ICoreContext,\n DimensionSwatchDisplayTypes.productCard\n ),\n this.props.context.actionContext\n );\n\n if (ArrayExtensions.hasElements(productsDimensionAvailabilities)) {\n this.setState({ productsDimensionAvailabilities });\n }\n }\n };\n\n /**\n * Helper method to initialize products state.\n * @param productCollection - List of products.\n */\n private readonly initProductState = async (productCollection: Msdyn365.IProductList) => {\n let products = this.state.products;\n let productPrices = this.state.productPrices;\n const productCollectionProducts = productCollection.products;\n if (!ArrayExtensions.hasElements(products) && ArrayExtensions.hasElements(productCollectionProducts)) {\n products = productCollectionProducts;\n this.setState({ products });\n } else if (\n ArrayExtensions.hasElements(products) &&\n ArrayExtensions.hasElements(productCollectionProducts) &&\n !ArrayExtensions.equals(products, productCollectionProducts)\n ) {\n products = productCollectionProducts;\n this.setState({ products });\n } else if (productCollectionProducts === undefined && ArrayExtensions.hasElements(this.state.products)) {\n products = [];\n this.setState({ products: products });\n }\n\n if (Msdyn365.msdyn365Commerce.isBrowser && !ArrayExtensions.hasElements(this.state.productsDimensionAvailabilities)) {\n await this._getProductsDimensionsAvailabilities(products);\n }\n\n if (this.props.config.productCollection.listType === 'promotional') {\n productPrices = await getProductPriceForSelectedProducts(\n new ProductPriceForSelectedProductsInput(products.filter(p => !p.IsMasterProduct).map(p => p.RecordId)),\n this.props.context.actionContext\n );\n\n this.setState({ productPrices: productPrices });\n }\n };\n\n private readonly _getProduct = (\n product: ProductSearchResult,\n index: number,\n productPrice?: ProductPrice\n ): IProductComponentViewProps | null => {\n if (!product || !product.Name) {\n this.props.telemetry.trace('[product-collection] Product or product name is null');\n return null;\n }\n const telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n const { imageSettings, allowBackNavigation } = this.props.config;\n const resources = this.props.resources;\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\n const quickviewSlot =\n this.props.slots && this.props.slots.quickview && this.props.slots.quickview.length > 0 ? this.props.slots.quickview[0] : null;\n const productComparisonButtonSlot = ArrayExtensions.hasElements(this.props.slots.productComparisonButton)\n ? this.props.slots.productComparisonButton[0]\n : null;\n\n const reviewCount = 1;\n const reviewTotalRatings = Number(product.TotalRatings);\n const reviewCountAriaLabelValue =\n reviewTotalRatings > reviewCount ? resources.ratingCountAriaLabel : resources.ratingCountAriaLabelSingleUser;\n const isPriceMinMaxEnabled = this.props.data.featureState.result?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\n );\n const priceResources: IPriceComponentResources = {\n priceRangeSeparator: resources.priceRangeSeparator\n };\n return {\n ProductContainer: {\n tag: 'li' as NodeTag,\n className: 'ms-product-collection__item',\n role: 'listitem',\n key: index\n },\n productComponent: (\n \n ArrayExtensions.hasElements(dimensionAvailability) &&\n dimensionAvailability[0].masterProductId === (product.MasterProductId ?? product.RecordId)\n )}\n />\n )\n };\n };\n\n /**\n * Get the active price for products.\n */\n private readonly _getActivePrice = async (): Promise => {\n const productsList = this.state.products;\n const products = await getPriceForProductSearchResult(\n new PriceForProductSearchResultInput(productsList),\n this.props.context.actionContext\n );\n if (Msdyn365.msdyn365Commerce.isBrowser) {\n await this._getProductsDimensionsAvailabilities(products);\n }\n\n this.setState({ products });\n };\n\n /**\n * Get the see all button.\n * @param headingLabel - Heading label.\n * @param recommendation - Recommendation.\n * @param discountIds - Discount Ids.\n * @returns IProductComponentSeeAllViewProps - Product component see all view props.\n */\n private readonly _getSeeAllButton = (headingLabel: string, recommendation?: string, discountIds?: string[]): React.ReactNode => {\n if (!Msdyn365.msdyn365Commerce.isBrowser) {\n return null;\n }\n\n if (!recommendation && !discountIds) {\n return null;\n }\n\n const catalogId = getCatalogId(this.props.context.request);\n validateCatalogId(catalogId);\n const searchPageLink = getUrlSync('search', this.props.context.actionContext);\n if (!searchPageLink) {\n return null;\n }\n\n const url = new URL(searchPageLink, window.location.href);\n\n if (discountIds) {\n // see all button for promotion page\n url.searchParams.set('discountIds', discountIds.toString());\n url.searchParams.set('title', headingLabel);\n url.searchParams.set('catalogid', `${catalogId}`);\n } else if (recommendation) {\n // See all button for recommendation\n url.searchParams.set('recommendation', recommendation);\n url.searchParams.set('title', headingLabel);\n url.searchParams.set('catalogid', `${catalogId}`);\n }\n\n return (\n \n {this.props.resources.seeAllButtonText}\n \n );\n };\n}\n\nexport default ProductCollection;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IProductCollectionViewProps, IProductComponentViewProps } from './product-collection';\nimport { IProductCollectionResources } from './product-collection.props.autogenerated';\n\nconst ProductCollectionView: React.FC = props => {\n const {\n heading,\n ProductCollectionContainer,\n products,\n SingleSlideCarouselComponentProps,\n GridComponentProps,\n isCarousel,\n seeAllButton,\n resources\n } = props;\n\n if (products) {\n return (\n \n {heading}\n {seeAllButton}\n {isCarousel ? _renderCarousel(SingleSlideCarouselComponentProps, products) : _renderGrid(GridComponentProps, products)}\n \n );\n }\n\n // If no products are retrieved and the list type is promotional, still render the module to keep the entry of promotion page\n if (props.config.productCollection.listType === 'promotional') {\n return (\n \n {heading}\n {seeAllButton}\n {_renderNoProduct(resources)}\n \n );\n }\n props.context.telemetry.error('Product collection content is empty, module wont render.');\n return null;\n};\n\nconst _renderCarousel = (carouselContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\n return {items && items.map(_renderProduct)};\n};\n\nconst _renderGrid = (gridContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\n return {items && items.map(_renderProduct)};\n};\n\nconst _renderNoProduct = (resources: IProductCollectionResources): JSX.Element => {\n return (\n \n

{resources.noProductToRenderText}

\n
\n );\n};\n\nconst _renderProduct = (product: IProductComponentViewProps): JSX.Element => {\n const { ProductContainer, productComponent } = product;\n\n return {productComponent};\n};\n\nexport default ProductCollectionView;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["getProductUnitOfMeasureOptionsInput","queryResultSettings","productIds","query","DataServiceQuery","resultSettings","top","createDataServiceRequestForOperation","Entities","bypassCache","returnEntity","async","getProductUnitOfMeasureOptionsAsync","context","request","callActionOrExecute","callerContext","DeliveryMode","InventoryLevels","InventoryLevelValues","displayLabelEnabled","inventoryCode","requestContext","app","config","inventoryRanges","available","outOfStock","mapProductInventoryInformation","productsWarehouseInventory","productInventoryInformation","undefined","enableStockCheck","length","product","inventoryLevel","physicalAvailable","physicalProductMap","mapInventoryWithPhysicalBufferEnabled","push","totalAvailable","totalAvailableProductMap","mapInventoryWithTotalAvailableBufferEnabled","productMap","mapInventoryWithThresholdEnabled","productWarehouseInventoryAvailability","ProductId","TotalAvailable","productQty","outOfStockThreshold","productAvailableQuantity","AvailableQuantity","ProductAvailableQuantity","IsProductAvailable","InventLocationId","shouldRenderLabel","PhysicalAvailableInventoryLevelCode","productQuantity","_productWarehouseInve","MaximumPurchasablePhysicalAvailableQuantity","PhysicalAvailable","StockLevelCode","StockLevelLabel","PhysicalAvailableInventoryLevelLabel","TotalAvailableInventoryLevelCode","_productWarehouseInve2","MaximumPurchasableTotalAvailableQuantity","TotalAvailableInventoryLevelLabel","isAggregatedInventory","warehouseAggregation","mapAggregatedProductInventoryInformation","productWarehouseInventoryInformation","_productWarehouseInve3","AggregatedProductInventoryAvailabilities","map","_product$MaximumPurch","_product$MaximumPurch2","DataAreaId","PhysicalAvailableQuantity","TotalAvailableQuantity","ProductWarehouseInventoryAvailabilities","createInventoryAvailabilitySearchCriteria","isDefaultWareHouse","isFilterByChannelFulfillmentGroup","searchArea","defaultDeliveryMode","deliveryMode","shipping","inventoryAvailabilitySearchCriteria","ProductIds","QuantityUnitTypeValue","SearchArea","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","DefaultWarehouseOnly","hasAgreementProducts","customer","_context$request$app$","_context$request$app$2","agreementProductAttributeRecordIds","agreementProductAttributeRecordId","split","Number","filter","Boolean","some","x","_customer$Attributes","_customer$Attributes$","_customer$Attributes$2","Attributes","find","y","RecordId","AttributeValue","BooleanValue","getAgreementProductRefinersToHide","_context$request$app$3","_context$request$app$4","refinerIds","refinerId","_customer$Attributes2","_attribute$AttributeV","attribute","cachedAttributesMap","isAgreementProduct","contextOrLocale","attributes","getLocale","helseNord","getAttributeBooleanOrDefault","municipalityNorth","langOrContext","locale","nbNO","_objectSpread","enUS","onBuyHasAccessValidator","validationMessage","AttributeValues","isValid","hasAccess","hasAccessToBuy","message","getDiscountBadge","productPrice","DiscountLines","discountLineWithBadge","_x$OfferName","matches","OfferName","toLowerCase","match","parts","trim","startsWith","offerName","badge","exec","getPricesAsync","products","_context$request$apiS","batchSize","arguments","result","catalogId","apiSettings","getCatalogId","actionContext","projectDomain","ChannelId","channelId","CatalogId","batchCount","Math","ceil","i","batch","slice","prices","getActivePricesAsync","Date","useActivePrices","activePrices","setActivePrices","React","loading","setLoading","error","setError","user","isAuthenticated","recIds","every","id","price","then","catch","finally","getInventoryLabel","productRecordId","productInventoryStatus","shippingInventory","_renderCarousel","carouselContainer","items","cart","customerInformation","orgInformation","unitConversions","wishlists","cartQueue","retrieveOrderTemplates","onUpdateOrderTemplates","resources","simpleProducts","Node","Object","assign","_renderProduct","sp","productComponent","props","data","pi","_renderGrid","gridContainer","_renderNoProduct","className","noProductToRenderText","simpleProduct","_productComponent$pro2","ProductContainer","_productComponent$pro","ProductRecordId","buyAlwaysAdd","showAgreementProduct","inventoryLabel","inventoryStatus","wishlistButton","_renderWishlistButton","addToCartText","updateCartText","removeFromCartText","priceErrorText","inCartTooltipText","transitTooltip","agreementProductTooltip","toastStrings","errorHeader","toastErrorHeader","productsAddedToCart","productsRemovedFromCart","productsUpdatedInCart","goToCart","toastGoToCart","noAccessToProduct","toastNoAccessToProduct","addToOrderTemplateResources","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","createOrderTemplateHeader","orderTemplateTitle","orderTemplateNameAriaLabel","createOrderTemplateDescription","defaultOrderTemplateName","createOrderTemplateButtonText","cancelNewOrderTemplateCreationButtonText","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","priceFree","originalPriceText","currentPriceText","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","onBuyValidate","forcedComponentProps","forcedComponent","ProductComponent","productViewProps","_wishlists$0$Commerce","isWishlisted","CommerceListLines","title","removeFromWishlistButtonText","addToWishlistButtonText","onClick","_removeItemFromWishlist","_addItemToWishlist","customerInput","GetCustomerInput","getCustomer","AccountNumber","listData","CustomerId","Name","defaultWishlistName","CommerceListTypeValue","Id","wishlist","CommerceListsDataActions","err","_error$data","_error$data2","footer","CorrelationId","toasts","createdCommerceList","buildWishlistLine","update","toast","text","addedProductToWishlistText","replace","type","autoClose","position","canClose","showProgress","_error$data3","_error$data4","_wishlist$CommerceLis","_wishlist$CommerceLis2","wishlistLineId","LineId","updatedCommerceList","newWishlists","_error$data5","_error$data6","_props$config$product3","_props$config$product4","heading","ProductCollectionContainer","SingleSlideCarouselComponentProps","GridComponentProps","isCarousel","seeAllButton","orderTemplates","setOrderTemplates","PQueue","concurrency","setSimpleProducts","setConversions","setProductInventoryStatus","_config$productCollec","productCollection","shippingSearchCriteria","shippingAvailability","ProductsDataActions","ArrayExtensions","deliveryType","work","useGetInventoryStatus","_props$config$product","_props$config$product2","ids","getByIdsAsync","unitOfMeasureConversions","conversions","Array","isArray","forEach","_price$CustomerContex","_price$BasePrice","_price$MaxVariantPric","_price$MinVariantPric","typedProduct","showPrice","attributeLocale","getAttributesLocale","Brand","getAttributeStringOrDefault","brand","Manufacturer","manufacturer","Transit","transit","IsAgreementProduct","TemperatureZone","getTemperatureZone","AgentImporter","agentImporter","Producer","producer","Price","CustomerContextualPrice","BasePrice","MaxVariantPrice","MinVariantPrice","ProductPrice","Badge","updateOrderTemplatesAsync","newOrderTemplates","newOrderTemplate","productList","splice","OrderTemplate","QueryResultSettingsProxy","QueryResultSettings","input","GetOrderTemplatesInput","getOrderTemplates","autoplay","nextFlipperId","prevFlipperId","nextFlipper","document","getElementById","prevFlipper","carousel","closest","intervalMS","interval","onAutoPlay","disabled","click","setInterval","pauseOnHover","addEventListener","clearInterval","Module","listType","telemetry","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","window","__bindings__","viewDictionary","cn","ProductCollection","constructor","super","handleHeadingChange","event","this","target","value","_getProductsDimensionsAvailabilities","dimensionsToDisplayOnProductCard","dimensionsInProductCard","dimensionsToDisplayAsSwatch","dimensionsAsSwatchType","validProducts","includes","DimensionTypes","productsDimensionAvailabilities","getDimensionAvailabilitiesForProductSearchResultAction","DimensionAvailabilitiesForProductSearchResultInput","DimensionSwatchDisplayTypes","setState","initProductState","state","productPrices","productCollectionProducts","Msdyn365","getProductPriceForSelectedProducts","ProductPriceForSelectedProductsInput","IsMasterProduct","_getProduct","index","_this$props$data$feat","_this$state$productsD","trace","telemetryContent","getTelemetryObject","telemetryPageName","friendlyName","imageSettings","allowBackNavigation","breaCrumbType","breadcrumbType","allowBack","quickviewSlot","slots","quickview","productComparisonButtonSlot","productComparisonButton","reviewCountAriaLabelValue","TotalRatings","ratingCountAriaLabel","ratingCountAriaLabelSingleUser","isPriceMinMaxEnabled","featureState","priceResources","priceRangeSeparator","tag","role","key","freePriceText","ratingAriaLabel","typeName","quickViewButton","IsEnabled","dimensionAvailabilities","dimensionAvailability","_product$MasterProduc","masterProductId","MasterProductId","_getActivePrice","productsList","getPriceForProductSearchResult","PriceForProductSearchResultInput","_getSeeAllButton","headingLabel","recommendation","discountIds","validateCatalogId","searchPageLink","getUrlSync","url","URL","location","href","searchParams","set","toString","Button","seeAllButtonText","enableAffiliationBasedPricing","render","shouldDisplaySeeAllButton","recommendationListId","layout","headingComponent","editProps","onEdit","updatedProducts","item","getProductData","ObjectExtensions","productCollectionViewProps","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","moduleProps","classnames","renderView","module","exports","ReactDOM"],"sourceRoot":""}