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,aAEY,MAAMkB,EAAiB,GAC9BA,EAAe,qFAAuF,CAC9GpkB,EAAGA,IAAMyjB,EAAQ,MACjBY,GAAI,kDAEpB/U,OAAO6U,aAAe7U,OAAO6U,cAAgB,GAC7C7U,OAAO6U,aAAaC,eAActhB,EAAAA,EAAA,GACPwM,OAAO6U,aAAaC,gBAAkB,IACtCA,UCtH3BE,EAAOC,QAAUlpB,cCAjBipB,EAAOC,QAAUC","sources":["webpack://Dobbies.Commerce/./src/actions/get-plant-pots-product-count.ts?cf83","webpack://Dobbies.Commerce/./src/modules/dobbies-product-collection/dobbies-product-collection.props.autogenerated.ts?d60b","webpack://Dobbies.Commerce/./src/modules/dobbies-product-collection/dobbies-product-collection.tsx?ae9b","webpack://Dobbies.Commerce/./src/modules/dobbies-product-collection/dobbies-product-collection.view.tsx?797c","webpack://Dobbies.Commerce/./src/themes/dobbies/utilities/inventory/product-inventory-utils.ts?3772","webpack://Dobbies.Commerce/./lib/dobbies-product-collection/module-registration.js?9ef8","webpack://Dobbies.Commerce/external var \"React\"?0d3b","webpack://Dobbies.Commerce/external var \"ReactDOM\"?853b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * CheckoutModulesStateShare Input Action\r\n */\r\n\r\nexport class GetPlantPotsProductCountInput implements IActionInput {\r\n public getCacheKey = () => `plantPotsProductCount`;\r\n public getCacheObjectType = () => 'plantPotsProductCount';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetPlantPotsProductCountState {\r\n potsProductCount?: number; // Share the plantProductsIds accross checkout modules to not check categories again & again\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new GetPlantPotsProductCountInput();\r\n};\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nexport async function sampleStateAction(\r\n input: GetPlantPotsProductCountInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return { potsProductCount: 0 };\r\n}\r\n\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >sampleStateAction,\r\n input: createInput\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 * IDobbiesProductCollection containerModule 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\nimport * as React from 'react';\r\n\r\nexport const enum layout {\r\n carousel = 'carousel',\r\n grid = 'grid'\r\n}\r\n\r\nexport interface IDobbiesProductCollectionConfig extends Msdyn365.IModuleConfig {\r\n productCollection: Msdyn365.IProductList;\r\n heading?: IHeadingData;\r\n allowedRelationType?: string;\r\n layout?: layout;\r\n allowBackNavigation?: boolean;\r\n imageSettings?: Msdyn365.IImageSettings;\r\n clientRender?: boolean;\r\n enableAffiliationBasedPricing?: boolean;\r\n shouldDisplaySeeAllButton?: boolean;\r\n className?: string;\r\n redirectToCart?: boolean;\r\n isProductBundles?: boolean;\r\n isBundlesModal?: boolean;\r\n isNotificationModal?: boolean;\r\n discountAppliedInCartMessage?: string;\r\n maxQuantityReachedInBundlesmsg?: string;\r\n}\r\n\r\nexport interface IDobbiesProductCollectionResources {\r\n priceFree: string;\r\n priceRangeSeparator: string;\r\n ratingAriaLabel: string;\r\n flipperNext: string;\r\n flipperPrevious: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n ratingCountAriaLabel: string;\r\n ratingCountAriaLabelSingleUser: string;\r\n seeAllButtonText: string;\r\n addToCartButtonText: string;\r\n addedToCartSuccessMessage: string;\r\n addedToCartFailureMessage: string;\r\n maxQuantityLimitText: string;\r\n}\r\n\r\nexport const enum HeadingTag {\r\n h1 = 'h1',\r\n h2 = 'h2',\r\n h3 = 'h3',\r\n h4 = 'h4',\r\n h5 = 'h5',\r\n h6 = 'h6'\r\n}\r\n\r\nexport interface IHeadingData {\r\n text: string;\r\n tag?: HeadingTag;\r\n}\r\n\r\nexport interface IDobbiesProductCollectionProps extends Msdyn365.IModule {\r\n resources: IDobbiesProductCollectionResources;\r\n config: IDobbiesProductCollectionConfig;\r\n slots: {\r\n quickview: React.ReactNode[];\r\n productComparisonButton: React.ReactNode[];\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\n/* eslint-disable no-duplicate-imports */\r\n/* eslint-disable security/detect-object-injection */\r\nimport {\r\n ArrayExtensions,\r\n IProductInventoryInformation,\r\n validateCatalogId,\r\n getFallbackImageUrl\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getTelemetryObject,\r\n IComponentNodeProps,\r\n IModuleProps,\r\n INodeProps,\r\n ISingleSlideCarouselProps,\r\n ITelemetryContent,\r\n NodeTag,\r\n SingleSlideCarousel\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { ProductComponent } from '../../themes/dobbies/views/components/product.component';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport {\r\n ProductPrice,\r\n ProductSearchResult,\r\n ProjectionDomain,\r\n ProductWarehouseInventoryAvailability\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getActivePricesAsync,\r\n getByIdAsync,\r\n getDeliveryOptionsAsync,\r\n getEstimatedAvailabilityAsync,\r\n searchByCriteriaAsync,\r\n getVariantsByDimensionValuesAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n ProductSearchCriteria,\r\n ProductWarehouseInventoryInformation,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { GetPlantPotsProductCountInput } from '../../actions/get-plant-pots-product-count';\r\nimport { mapProductInventoryInformation } from '../../themes/dobbies/utilities/inventory/product-inventory-utils';\r\nimport { IDobbiesProductCollectionData } from './dobbies-product-collection.data';\r\nimport { IDobbiesProductCollectionProps, layout } from './dobbies-product-collection.props.autogenerated';\r\nimport { CartModulesStateShareInput } from '../../actions/cart-state-share';\r\nimport { reaction } from 'mobx';\r\nimport { DiscountLine } from '@msdyn365-commerce/retail-proxy';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { _getCartItemMaxQuantity } from '../dobbies-cart/components/dobbies-cart-line-items';\r\nimport { getCatalogId } from '@msdyn365-commerce/core';\r\nimport { IActivePointsData } from '../dobbies-active-image';\r\nimport { IDobbiesMiniCartSummaryProduct } from '../../themes/dobbies/views/buybox.view';\r\n\r\nexport interface IProductCollectionViewProps extends IDobbiesProductCollectionProps<{}> {\r\n heading?: React.ReactNode;\r\n ProductCollectionContainer: IModuleProps;\r\n SingleSlideCarouselComponentProps: INodeProps;\r\n GridComponentProps: INodeProps;\r\n products: IProductComponentViewProps[];\r\n isCarousel: boolean;\r\n productPrices?: ProductPrice[];\r\n shouldShowAddAllProducts?: boolean;\r\n addAllProductsOnClick?: Button;\r\n pdpProduct?: SimpleProduct;\r\n pdpProductComponent?: React.ReactNode;\r\n isBundlesModal?: boolean;\r\n state: IProductComponentState;\r\n notificationModalProducts?: IDobbiesMiniCartSummaryProduct[];\r\n data: IDobbiesProductCollectionData;\r\n}\r\n\r\nexport interface IProductBundlesMaxAvailableQuantities {\r\n productId: number;\r\n maxQuantity: number;\r\n}\r\n\r\nexport interface IProductComponentViewProps {\r\n ProductContainer: INodeProps;\r\n productComponent: React.ReactNode;\r\n addToCartButton: React.ReactNode;\r\n}\r\nexport interface IProductComponentState {\r\n products: ProductSearchResult[];\r\n /* VSI Customization - START - 13/04/21 */\r\n inventoryInformation: IProductInventoryInformation[];\r\n productCount?: number;\r\n allProducts?: ProductSearchResult[];\r\n listType?: string; // Check if listType is not plants pots, return\r\n isSharedStateSet?: boolean; // Check if shared state is set no need to reset it again and again\r\n /* VSI Customization - END */\r\n addedProductIdsToBundles: number[];\r\n currQuantities: number[][];\r\n pdpProduct?: SimpleProduct;\r\n pdpSearchResultProduct?: ProductSearchResult;\r\n discountLines?: (DiscountLine[] | undefined)[];\r\n nonClubPlusDiscount?: ProductPrice[];\r\n simpleProductObjs?: SimpleProduct[];\r\n}\r\nexport interface IAddToBagActionMessageState {\r\n productId?: number;\r\n itemKey?: string;\r\n userMessage?: string;\r\n statusCssString?: string;\r\n messageGlyph?: string;\r\n isOpen?: boolean;\r\n}\r\n\r\nexport interface IProductWithModes extends ProductSearchResult {\r\n isCnC: boolean;\r\n isHomeDelivery: boolean;\r\n}\r\nexport interface IDobbiesAddedProductToBundle {\r\n productId?: number;\r\n quantity?: number;\r\n price?: number;\r\n maxQuantity?: number;\r\n}\r\n/**\r\n * ProductCollection component\r\n */\r\nclass ProductCollection extends React.PureComponent<\r\n IDobbiesProductCollectionProps,\r\n IProductComponentState & IAddToBagActionMessageState\r\n> {\r\n private telemetryContent: ITelemetryContent;\r\n private productPrices: ProductPrice[];\r\n constructor(\r\n props: IDobbiesProductCollectionProps,\r\n state: IProductComponentState & IAddToBagActionMessageState\r\n ) {\r\n super(props);\r\n const {\r\n config: { productCollection }\r\n } = this.props;\r\n this.productPrices = [];\r\n this.state = {\r\n products: productCollection && productCollection.products,\r\n inventoryInformation: [],\r\n productCount: 0,\r\n listType: productCollection && productCollection.listType,\r\n allProducts: [],\r\n addedProductIdsToBundles: [],\r\n currQuantities: [],\r\n discountLines: [],\r\n nonClubPlusDiscount: []\r\n };\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n if (this.props.config.isNotificationModal) {\r\n this.getActiveImageproductAction();\r\n }\r\n }\r\n private getActiveImageproductAction = async () => {\r\n const {\r\n context: {\r\n actionContext: {\r\n requestContext: { cookies }\r\n }\r\n }\r\n } = this.props;\r\n const cookienotificationValue = cookies.get('notification_products');\r\n if (cookienotificationValue && Array.isArray(cookienotificationValue.value) && cookienotificationValue.value['length'] > 0) {\r\n const activePoints = cookienotificationValue.value;\r\n const itemIds: number[] = [];\r\n if (activePoints) {\r\n activePoints.map((activePointData: IActivePointsData) => itemIds.push(+activePointData.itemId!));\r\n }\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n const catalogId = getCatalogId(this.props.context.actionContext.requestContext);\r\n validateCatalogId(catalogId);\r\n\r\n searchCriteriaInput.Context = {\r\n ChannelId: this.props.context.actionContext.requestContext.apiSettings.channelId,\r\n CatalogId: catalogId\r\n };\r\n searchCriteriaInput.IncludeAttributes = true;\r\n searchCriteriaInput.Ids = itemIds;\r\n if (!activePoints || !ArrayExtensions.hasElements(activePoints)) {\r\n throw new Error('Fail to call ActiveImage API no active points configured.');\r\n }\r\n // eslint-disable-next-line no-return-await -- Disable because we want to return the promise.\r\n const products = await searchByCriteriaAsync({ callerContext: this.props.context.actionContext }, searchCriteriaInput);\r\n this.setState({ products: products });\r\n // return products\r\n }\r\n };\r\n\r\n public componentDidMount(): void {\r\n const {\r\n config: { allowedRelationType, productCollection },\r\n context: { actionContext }\r\n } = this.props;\r\n if (!this.props.config.isProductBundles) {\r\n void this.getNonClubPlusDiscountPrices();\r\n }\r\n /* VSI Customization - START - 13/04/21 */\r\n // Check if listType is not plants pots, return\r\n if (!this.state.isSharedStateSet) {\r\n if (this.state.listType?.toLowerCase() === allowedRelationType?.toLowerCase() && productCollection?.products?.length > 0) {\r\n this._getProductAvailability()\r\n .then(res => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const maxQData: IProductBundlesMaxAvailableQuantities[] = [];\r\n for (const sp of this.state.products) {\r\n const maxQ = this.getMaxAvailableQuantityForProduct(sp.RecordId);\r\n const maxQObj: IProductBundlesMaxAvailableQuantities = { productId: sp.RecordId, maxQuantity: maxQ };\r\n maxQData.push(maxQObj);\r\n }\r\n cookies.set('product_bundles_maximum_available_quantities', maxQData);\r\n })\r\n .catch(error => error);\r\n } else {\r\n actionContext.update(new GetPlantPotsProductCountInput(), { potsProductCount: 0 });\r\n this.setState({ isSharedStateSet: true });\r\n }\r\n }\r\n /* VSI Customization - END */\r\n\r\n this.setState({ addedProductIdsToBundles: [] });\r\n this.updateAddedProductsList();\r\n reaction(\r\n () => this.props.data.cartSharedState.result?.isCartUpdated,\r\n () => {\r\n if (this.props.data.cartSharedState.result?.isCartUpdated) {\r\n this.updateAddedProductsList();\r\n }\r\n }\r\n );\r\n if (this.props.config.isProductBundles && window && !this.props.config.isNotificationModal) {\r\n const splittedUrl = window.location.href.split('/');\r\n const prodIdStr = splittedUrl[splittedUrl.length - 1];\r\n const prodIdStrSplitted = prodIdStr.split('.p');\r\n let prodId = '';\r\n if (prodIdStrSplitted.length > 1) {\r\n prodId = prodIdStrSplitted[0];\r\n }\r\n if (prodId) {\r\n getByIdAsync(\r\n { callerContext: this.props.context.actionContext },\r\n Number(prodId),\r\n this.props.context.request.apiSettings.channelId\r\n )\r\n .then(resp => {\r\n const pdpProd: SimpleProduct = Array.isArray(resp) ? resp[0] : resp;\r\n this.setState({ pdpProduct: pdpProd });\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = {\r\n ChannelId: this.props.context.actionContext.requestContext.apiSettings.channelId,\r\n CatalogId: this.props.context.actionContext.requestContext.apiSettings.catalogId\r\n };\r\n const productId = pdpProd.MasterProductId ? pdpProd.MasterProductId : pdpProd.RecordId;\r\n searchCriteriaInput.Ids = [productId];\r\n searchCriteriaInput.IncludeAttributes = true;\r\n searchByCriteriaAsync(\r\n {\r\n callerContext: this.props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n searchCriteriaInput\r\n )\r\n .then(searchByCriteriaResp => {\r\n if (searchByCriteriaResp && searchByCriteriaResp.length > 0) {\r\n const searchByCriteriaItem = searchByCriteriaResp[0];\r\n searchByCriteriaItem.RecordId = pdpProd.RecordId;\r\n if (searchByCriteriaItem.IsMasterProduct) {\r\n getVariantsByDimensionValuesAsync(\r\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\r\n searchByCriteriaItem.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n []\r\n ).then(variants => {\r\n if (variants && variants.length) {\r\n const variant = variants[0];\r\n const fallbackImageUrl = getFallbackImageUrl(\r\n variant.ItemId,\r\n this.props.context.actionContext.requestContext.apiSettings\r\n );\r\n if (!variant.PrimaryImageUrl?.includes('http')) {\r\n variant.PrimaryImageUrl = fallbackImageUrl;\r\n }\r\n this.setState({ pdpSearchResultProduct: variant });\r\n void this.getNonClubPlusDiscountPrices();\r\n void this.getAllSimpleProducts();\r\n }\r\n });\r\n } else {\r\n this.setState({ pdpSearchResultProduct: searchByCriteriaItem });\r\n void this.getNonClubPlusDiscountPrices();\r\n void this.getAllSimpleProducts();\r\n }\r\n }\r\n })\r\n .catch(e => {});\r\n })\r\n .catch(ex => {});\r\n }\r\n }\r\n }\r\n public checkDifference = (array1: ProductSearchResult[], array2: ProductSearchResult[]) => {\r\n if (!array1 || !array2) {\r\n return true;\r\n }\r\n if (array1?.length !== array2?.length) {\r\n return true;\r\n }\r\n for (let i = 0; i < array1.length; i++) {\r\n if (array1[i].RecordId !== array2[i].RecordId) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n\r\n public componentDidUpdate(\r\n prevProps: Readonly>,\r\n prevState: Readonly,\r\n snapshot?: any\r\n ): void {\r\n if (this.checkDifference(prevState.products, this.state.products)) {\r\n if (this.state.products && this.props.config.isNotificationModal && this.props.config.isProductBundles) {\r\n this._getProductAvailabilityNotification()\r\n .then(res => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const maxQData: IProductBundlesMaxAvailableQuantities[] = [];\r\n for (const sp of this.state.products) {\r\n const maxQ = this.getMaxAvailableQuantityForProduct(sp.RecordId);\r\n const maxQObj: IProductBundlesMaxAvailableQuantities = { productId: sp.RecordId, maxQuantity: maxQ };\r\n maxQData.push(maxQObj);\r\n }\r\n cookies.set('product_notification_maximum_available_quantities', maxQData);\r\n void this.getNonClubPlusDiscountPrices();\r\n void this.getAllSimpleProducts();\r\n })\r\n .catch(error => error);\r\n }\r\n }\r\n }\r\n private async getProductsListWithKitProductsHandled(products: ProductSearchResult[]): Promise {\r\n const kitProductIds = products.map(prod => {\r\n if (prod.IsMasterProduct) {\r\n return prod.RecordId;\r\n }\r\n return undefined;\r\n });\r\n if (kitProductIds && kitProductIds.length) {\r\n for (const kpId of kitProductIds) {\r\n if (kpId) {\r\n const variants = await getVariantsByDimensionValuesAsync(\r\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\r\n kpId,\r\n this.props.context.request.apiSettings.channelId,\r\n []\r\n );\r\n if (variants && variants.length) {\r\n products = products.filter(p => p.RecordId !== kpId);\r\n products.push(variants[0]);\r\n }\r\n }\r\n }\r\n }\r\n return products;\r\n }\r\n private async getAllSimpleProducts(): Promise {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n let products = this.props.config.isNotificationModal\r\n ? this.state.products\r\n : this.props.config.productCollection && this.props.config.productCollection.products;\r\n products = await this.getProductsListWithKitProductsHandled(products);\r\n\r\n if (!this.props.config.isNotificationModal) {\r\n const productCollectionProducts = products.map(pros => ({ itemId: pros.RecordId }));\r\n cookies.set('productBundle_products', productCollectionProducts);\r\n }\r\n const productRecIds = ArrayExtensions.hasElements(products) ? products.map(prod => prod.RecordId) : [];\r\n const simpleProds = await getByIdsAsync(\r\n {\r\n callerContext: this.props.context.actionContext,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(this.props.context.actionContext)\r\n },\r\n this.props.context.request.apiSettings.channelId,\r\n productRecIds,\r\n null,\r\n this.props.context.request.apiSettings.catalogId ?? 0\r\n );\r\n this.setState({ simpleProductObjs: simpleProds });\r\n }\r\n\r\n private _getNotificationModalProducts(): IDobbiesMiniCartSummaryProduct[] {\r\n const addedToSummaryProducts: IDobbiesMiniCartSummaryProduct[] = [];\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection =\r\n cookies.get(this.props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n const product = this.state.simpleProductObjs?.find(prod => prod.RecordId === obj['productId']);\r\n if (product) {\r\n const miniCartProduct: IDobbiesMiniCartSummaryProduct = { ...product };\r\n miniCartProduct.quantity = obj['quantity'];\r\n addedToSummaryProducts.push(miniCartProduct);\r\n }\r\n }\r\n }\r\n return addedToSummaryProducts;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { heading, className } = this.props.config;\r\n const { resources } = this.props;\r\n const { products, inventoryInformation } = this.state;\r\n // Return if there are no products\r\n if (!products || products.length === 0 || inventoryInformation.length === 0) {\r\n return null;\r\n }\r\n const isCarousel = this.props.config.layout === layout.carousel;\r\n const headingComponent = heading && (\r\n \r\n );\r\n\r\n const productCollectionViewProps = {\r\n ...this.props,\r\n state: this.state,\r\n heading: headingComponent,\r\n SingleSlideCarouselComponentProps: {\r\n tag: SingleSlideCarousel,\r\n className: '',\r\n flipperPrevLabel: resources.flipperPrevious,\r\n flipperNextLabel: resources.flipperNext,\r\n parentId: this.props.id,\r\n telemetryContent: this.telemetryContent\r\n } as IComponentNodeProps,\r\n ProductCollectionContainer: {\r\n moduleProps: this.props,\r\n className: classnames('ms-product-collection product-bundles', className)\r\n },\r\n GridComponentProps: {\r\n tag: 'ul' as NodeTag,\r\n className: 'ms-product-collection__items'\r\n },\r\n isCarousel: isCarousel,\r\n products:\r\n products &&\r\n products.length > 0 &&\r\n products\r\n .filter(item => {\r\n // Check if product doesn't have inventory, dont dislay it\r\n const itemInventorys = inventoryInformation.filter(\r\n inventory => inventory.ProductAvailableQuantity.ProductId === item.RecordId\r\n );\r\n if (itemInventorys && itemInventorys.length) {\r\n for (const iv of itemInventorys) {\r\n if (iv && iv.IsProductAvailable) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n })\r\n .map((item: ProductSearchResult, index: number) => this._getProduct(item, index)),\r\n productPrices: this.productPrices,\r\n shouldShowAddAllProducts: this.props.config.isProductBundles,\r\n pdpProduct: this.props.config.isProductBundles && this.state.pdpProduct ? this.state.pdpProduct : undefined,\r\n pdpProductComponent:\r\n this.props.config.isProductBundles &&\r\n this.state.pdpSearchResultProduct &&\r\n this._getPDPProduct(this.state.pdpSearchResultProduct, this.state.pdpSearchResultProduct.RecordId),\r\n isBundlesModal: this.props.config.isBundlesModal,\r\n notificationModalProducts: this._getNotificationModalProducts()\r\n };\r\n return this.props.renderView(productCollectionViewProps) as React.ReactElement;\r\n }\r\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\r\n\r\n private updateAddedProductsList = () => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection =\r\n cookies.get(this.props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n const addedProductsIds: number[] = [];\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n addedProductsIds.push(obj['productId']);\r\n }\r\n this.setState({ addedProductIdsToBundles: addedProductsIds });\r\n }\r\n if (\r\n this.props.config.isNotificationModal &&\r\n this.props.config.isProductBundles &&\r\n this.props.context.request.telemetryPageName !== 'DefaultPdp'\r\n ) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: false });\r\n }\r\n };\r\n private getPDPProductMaxQ = () => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n return cookies.get('pdp_product_quantity_for_bundles').value;\r\n };\r\n private onBundleProductCheckBoxSelected = (productId: number) => {\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === productId);\r\n const maxPDPQ = this.getPDPProductMaxQ();\r\n const maxPDPQNumber = maxPDPQ ? Number(maxPDPQ) : 0;\r\n if (productId === this.state.pdpSearchResultProduct?.RecordId && !(cl && cl.Quantity && cl.Quantity >= maxPDPQNumber)) {\r\n this._updateCookiesForAddedProducts(this.state.pdpSearchResultProduct);\r\n } else {\r\n const prods = this.state.products;\r\n const prod = prods.find(p => p.RecordId === productId);\r\n if (prod) {\r\n void this._addItemToCart(prod, prod.RecordId.toString());\r\n }\r\n }\r\n };\r\n private _getPDPProduct = (product: ProductSearchResult, index: number): React.ReactNode => {\r\n if (!product || !product.Name) {\r\n this.props.telemetry.trace('[product-collection] Product or product name is null');\r\n return null;\r\n }\r\n const telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n const { imageSettings, allowBackNavigation } = this.props.config;\r\n const { addToCartButtonText } = this.props.resources;\r\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\r\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\r\n const resources = this.props.resources;\r\n // 9.33 SDK Update\r\n const quickviewSlot =\r\n this.props.slots && this.props.slots.quickview && this.props.slots.quickview.length > 0 ? this.props.slots.quickview[0] : null;\r\n const reviewCount = 1;\r\n const reviewTotalRatings = Number(product.TotalRatings);\r\n const reviewCountAriaLabelValue =\r\n reviewTotalRatings > reviewCount ? resources.ratingCountAriaLabel : resources.ratingCountAriaLabelSingleUser;\r\n const isPriceMinMaxEnabled = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n console.log(reviewCountAriaLabelValue);\r\n // VSI - CUSTOMIZATION 04/02/2022 - To hide the Mode Of Delivery icons from modal for related products / delivery cart upsells\r\n const productWithModes: IProductWithModes = { ...product, isCnC: false, isHomeDelivery: false };\r\n let shouldNotShowAddToCartButton =\r\n this.props.config.isProductBundles && this.state.addedProductIdsToBundles.includes(product.RecordId);\r\n const maxAvailableQ = this.getPDPProductMaxQ(); //this.getMaxAvailableQuantityForProduct(productWithModes.RecordId);\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl) {\r\n shouldNotShowAddToCartButton = true;\r\n } else {\r\n shouldNotShowAddToCartButton = false;\r\n }\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isNotificationModal) {\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl) {\r\n shouldNotShowAddToCartButton = true;\r\n } else {\r\n shouldNotShowAddToCartButton = false;\r\n }\r\n }\r\n // VSI - CUSTOMIZATION - END\r\n return (\r\n
\r\n 0 ? this.state.discountLines[index] : []}\r\n nonClubPlusDiscount={this.state.nonClubPlusDiscount?.filter(item => item.ProductId === productWithModes.RecordId)[0]}\r\n simpleProduct={this.state.simpleProductObjs?.find(sp => sp.RecordId === productWithModes.RecordId)}\r\n />\r\n {shouldNotShowAddToCartButton ? (\r\n <>\r\n ) : (\r\n \r\n Add\r\n \r\n )}\r\n
\r\n );\r\n };\r\n\r\n private _getProduct = (product: ProductSearchResult, index: number): IProductComponentViewProps | null => {\r\n if (!product || !product.Name) {\r\n this.props.telemetry.trace('[product-collection] Product or product name is null');\r\n return null;\r\n }\r\n const telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n const { imageSettings, allowBackNavigation } = this.props.config;\r\n const { addToCartButtonText } = this.props.resources;\r\n const breaCrumbType = this.props.context.app.config.breadcrumbType;\r\n\r\n const allowBack = allowBackNavigation && (breaCrumbType === 'back' || breaCrumbType === 'categoryAndBack');\r\n\r\n const resources = this.props.resources;\r\n // 9.33 SDK Update\r\n const quickviewSlot =\r\n this.props.slots && this.props.slots.quickview && this.props.slots.quickview.length > 0 ? this.props.slots.quickview[0] : null;\r\n const reviewCount = 1;\r\n const reviewTotalRatings = Number(product.TotalRatings);\r\n const reviewCountAriaLabelValue =\r\n reviewTotalRatings > reviewCount ? resources.ratingCountAriaLabel : resources.ratingCountAriaLabelSingleUser;\r\n const isPriceMinMaxEnabled = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n\r\n console.log(reviewCountAriaLabelValue);\r\n // VSI - CUSTOMIZATION 04/02/2022 - To hide the Mode Of Delivery icons from modal for related products / delivery cart upsells\r\n const productWithModes: IProductWithModes = { ...product, isCnC: false, isHomeDelivery: false };\r\n let shouldNotShowAddToCartButton =\r\n this.props.config.isProductBundles && this.state.addedProductIdsToBundles.includes(product.RecordId);\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl) {\r\n shouldNotShowAddToCartButton = true;\r\n } else {\r\n shouldNotShowAddToCartButton = false;\r\n }\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isNotificationModal) {\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl) {\r\n shouldNotShowAddToCartButton = true;\r\n } else {\r\n shouldNotShowAddToCartButton = false;\r\n }\r\n }\r\n // VSI - CUSTOMIZATION - END\r\n return {\r\n ProductContainer: {\r\n tag: 'li' as NodeTag,\r\n className: 'ms-product-collection__item',\r\n role: 'listitem',\r\n key: index\r\n },\r\n productComponent: (\r\n 0 ? this.state.discountLines[index] : []}\r\n nonClubPlusDiscount={this.state.nonClubPlusDiscount?.filter(item => item.ProductId === productWithModes.RecordId)[0]}\r\n simpleProduct={this.state.simpleProductObjs?.find(sp => sp.RecordId === productWithModes.RecordId)}\r\n />\r\n ),\r\n addToCartButton: shouldNotShowAddToCartButton ? (\r\n <>\r\n ) : (\r\n \r\n Add\r\n \r\n )\r\n };\r\n };\r\n\r\n private onQuantityChangeListener = (productId: number, newQuantity: number): void => {\r\n const currQuantityData = this.state.currQuantities;\r\n let productFound = false;\r\n for (const qd of currQuantityData) {\r\n if (qd[0] === productId) {\r\n qd[1] = newQuantity;\r\n productFound = true;\r\n }\r\n }\r\n if (!productFound) {\r\n currQuantityData.push([productId, newQuantity]);\r\n }\r\n this.setState({ currQuantities: currQuantityData });\r\n if (this.props.config.isNotificationModal && this.props.config.isProductBundles) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: false });\r\n }\r\n };\r\n\r\n private _getProductAvailabilityNotification = async (): Promise => {\r\n const { products } = this.state;\r\n const {\r\n context: { actionContext }\r\n } = this.props;\r\n\r\n if (!products) {\r\n return;\r\n }\r\n\r\n const validProducts: number[] = [];\r\n\r\n for (const product of products) {\r\n if (product.RecordId) {\r\n validProducts.push(product.RecordId);\r\n }\r\n }\r\n\r\n if (validProducts.length === 0) {\r\n return;\r\n }\r\n\r\n const callerContext = actionContext;\r\n const {\r\n requestContext: {\r\n apiSettings: { channelId, catalogId }\r\n }\r\n } = actionContext;\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = { ChannelId: channelId, CatalogId: catalogId };\r\n searchCriteriaInput.Ids = validProducts;\r\n searchCriteriaInput.IncludeAttributes = true;\r\n const productData = await searchByCriteriaAsync({ callerContext, queryResultSettings: {} }, searchCriteriaInput);\r\n\r\n this.setState({\r\n allProducts: productData\r\n });\r\n const attributeName = 'fulfillmenttype';\r\n const attributeTextValue = 'plants';\r\n\r\n const plantProducts: ProductSearchResult[] = [];\r\n const nonPlantProducts: ProductSearchResult[] = [];\r\n\r\n this.state.allProducts &&\r\n this.state.allProducts.map(product => {\r\n const fulfillmentTypeAttribute =\r\n product.AttributeValues &&\r\n product.AttributeValues.find(attribute => {\r\n return attribute?.Name?.toLowerCase() === attributeName;\r\n });\r\n const isPlantFulfillment =\r\n fulfillmentTypeAttribute && fulfillmentTypeAttribute.TextValue?.toLowerCase() === attributeTextValue;\r\n const isPlantCategory = isPlantFulfillment ? true : false;\r\n\r\n if (isPlantCategory) {\r\n plantProducts.push(product);\r\n } else {\r\n nonPlantProducts.push(product);\r\n }\r\n });\r\n\r\n const prodIds = this.state.allProducts && this.state.allProducts.map(prod => prod.RecordId);\r\n if (prodIds && prodIds.length <= 0) {\r\n return;\r\n }\r\n\r\n const plantProductIds = plantProducts.map(pp => pp.RecordId);\r\n const nonPlantProductIds = nonPlantProducts.map(npp => npp.RecordId);\r\n\r\n let productAvailabilitesPlants: ProductWarehouseInventoryInformation | null = null;\r\n\r\n if (plantProductIds && plantProductIds.length) {\r\n productAvailabilitesPlants = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: plantProductIds, DefaultWarehouseOnly: false, FilterByChannelFulfillmentGroup: true }\r\n );\r\n }\r\n\r\n const deliveryOptions = await getDeliveryOptionsAsync(\r\n { callerContext: actionContext, queryResultSettings: {} },\r\n prodIds ? prodIds : []\r\n );\r\n const productsWithPlantsDelivery: IProductWithModes[] = await Promise.all(\r\n plantProducts.map(async (prod, idx) => {\r\n let isCnC = false;\r\n let isHomeDelivery = false;\r\n\r\n if (productAvailabilitesPlants && productAvailabilitesPlants.ProductWarehouseInventoryAvailabilities) {\r\n productAvailabilitesPlants.ProductWarehouseInventoryAvailabilities?.map(\r\n (item: ProductWarehouseInventoryAvailability) => {\r\n if (item.InventLocationId === 'P001' || item.InventLocationId === 'S059') {\r\n if (item.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n isHomeDelivery = true;\r\n }\r\n } else {\r\n if (item.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n deliveryOptions[idx].DeliveryOptions?.map(option => {\r\n if (option.Code === 'ClickCol') {\r\n isCnC = true;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n );\r\n }\r\n\r\n // If product has vendorship === \"yes\" then show it as available\r\n const isVendorShipAttribute = prod.AttributeValues?.find(attribute => {\r\n const attributeName = attribute.Name && attribute.Name.trim().toLowerCase();\r\n return attributeName === 'isvendershipproduct';\r\n });\r\n\r\n if (isVendorShipAttribute && isVendorShipAttribute.TextValue && isVendorShipAttribute.TextValue.toLowerCase() === 'yes') {\r\n isHomeDelivery = true;\r\n isCnC = false;\r\n }\r\n\r\n return { ...prod, isHomeDelivery, isCnC };\r\n })\r\n );\r\n\r\n let productAvailabilitesNonPlantsHD: ProductWarehouseInventoryInformation | null = null;\r\n let productAvailabilitesNonPlantsCNC: ProductWarehouseInventoryInformation | null = null;\r\n // Not Plants API since the warehouse storage is different\r\n if (nonPlantProductIds && nonPlantProductIds.length) {\r\n productAvailabilitesNonPlantsHD = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: nonPlantProductIds, DefaultWarehouseOnly: true, FilterByChannelFulfillmentGroup: false }\r\n );\r\n productAvailabilitesNonPlantsCNC = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: nonPlantProductIds, DefaultWarehouseOnly: false, FilterByChannelFulfillmentGroup: true }\r\n );\r\n }\r\n\r\n const productsWithNonPlantsDelivery: IProductWithModes[] = await Promise.all(\r\n nonPlantProducts.map(async (prod, idx) => {\r\n let isCnC = false;\r\n let isHomeDelivery = false;\r\n\r\n if (productAvailabilitesNonPlantsHD && productAvailabilitesNonPlantsHD.AggregatedProductInventoryAvailabilities) {\r\n productAvailabilitesNonPlantsHD.AggregatedProductInventoryAvailabilities.map(stores => {\r\n if (stores.ProductId === prod.RecordId && stores.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n isHomeDelivery = true;\r\n }\r\n });\r\n }\r\n\r\n if (productAvailabilitesNonPlantsCNC && productAvailabilitesNonPlantsCNC.AggregatedProductInventoryAvailabilities) {\r\n productAvailabilitesNonPlantsCNC.AggregatedProductInventoryAvailabilities.map(stores => {\r\n if (stores.ProductId === prod.RecordId && stores.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n deliveryOptions[idx].DeliveryOptions?.map(option => {\r\n if (option.Code === 'ClickCol') {\r\n isCnC = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n // If product has vendorship === \"yes\" then show it as available\r\n const isVendorShipAttribute = prod.AttributeValues?.find(attribute => {\r\n const attributeName = attribute.Name && attribute.Name.trim().toLowerCase();\r\n return attributeName === 'isvendershipproduct';\r\n });\r\n\r\n if (isVendorShipAttribute && isVendorShipAttribute.TextValue && isVendorShipAttribute.TextValue.toLowerCase() === 'yes') {\r\n isHomeDelivery = true;\r\n isCnC = false;\r\n }\r\n\r\n return { ...prod, isHomeDelivery, isCnC };\r\n })\r\n );\r\n\r\n const totalProducts = [...productsWithPlantsDelivery, ...productsWithNonPlantsDelivery];\r\n\r\n const allProducts: any = [];\r\n products.map(prod => {\r\n totalProducts.find(item => {\r\n if (item.RecordId === prod.RecordId) {\r\n allProducts.push(item);\r\n }\r\n });\r\n });\r\n let inventoryInformation: IProductInventoryInformation[] = [];\r\n let productsLength = 0;\r\n if (plantProducts.length > 0) {\r\n inventoryInformation = inventoryInformation.concat(\r\n mapProductInventoryInformation(actionContext, productAvailabilitesPlants?.ProductWarehouseInventoryAvailabilities ?? [])\r\n );\r\n productsLength += plantProducts.length;\r\n //this.setState({ inventoryInformation: inventoryInformation, productCount: plantProducts.length });\r\n\r\n // Check if product shared state is not set, set it\r\n // if (!this.state.isSharedStateSet) {\r\n // this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n // potsProductCount: plantProducts.length\r\n // });\r\n // this.setState({ isSharedStateSet: true });\r\n // }\r\n }\r\n if (nonPlantProducts.length > 0) {\r\n inventoryInformation = inventoryInformation.concat(\r\n mapProductInventoryInformation(\r\n actionContext,\r\n productAvailabilitesNonPlantsHD?.ProductWarehouseInventoryAvailabilities ?? []\r\n )\r\n );\r\n productsLength += nonPlantProducts.length;\r\n // this.setState({\r\n // inventoryInformation: inventoryInformation,\r\n // productCount: nonPlantProducts.length\r\n // });\r\n // Check if product shared state is not set, set it\r\n\r\n // if (!this.state.isSharedStateSet) {\r\n // this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n // potsProductCount: nonPlantProducts.length\r\n // });\r\n // this.setState({ isSharedStateSet: true });\r\n // }\r\n }\r\n if (inventoryInformation && inventoryInformation.length) {\r\n this.setState({ inventoryInformation: inventoryInformation, productCount: productsLength });\r\n if (!this.state.isSharedStateSet) {\r\n this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n potsProductCount: productsLength\r\n });\r\n this.setState({ isSharedStateSet: true });\r\n }\r\n }\r\n };\r\n\r\n /* VSI Customization - START - 13/04/21 */\r\n private _getProductAvailability = async (): Promise => {\r\n const { products } = this.state;\r\n const {\r\n context: { actionContext }\r\n } = this.props;\r\n\r\n if (!products) {\r\n return;\r\n }\r\n\r\n const validProducts: number[] = [];\r\n\r\n for (const product of products) {\r\n if (product.RecordId) {\r\n validProducts.push(product.RecordId);\r\n }\r\n }\r\n\r\n if (validProducts.length === 0) {\r\n return;\r\n }\r\n\r\n const callerContext = actionContext;\r\n const {\r\n requestContext: {\r\n apiSettings: { channelId, catalogId }\r\n }\r\n } = actionContext;\r\n const searchCriteriaInput: ProductSearchCriteria = {};\r\n searchCriteriaInput.Context = { ChannelId: channelId, CatalogId: catalogId };\r\n searchCriteriaInput.Ids = validProducts;\r\n searchCriteriaInput.IncludeAttributes = true;\r\n const productData = await searchByCriteriaAsync({ callerContext, queryResultSettings: {} }, searchCriteriaInput);\r\n\r\n this.setState({\r\n allProducts: productData\r\n });\r\n const attributeName = 'fulfillmenttype';\r\n const attributeTextValue = 'plants';\r\n\r\n const plantProducts: ProductSearchResult[] = [];\r\n const nonPlantProducts: ProductSearchResult[] = [];\r\n\r\n this.state.allProducts &&\r\n this.state.allProducts.map(product => {\r\n const fulfillmentTypeAttribute =\r\n product.AttributeValues &&\r\n product.AttributeValues.find(attribute => {\r\n return attribute?.Name?.toLowerCase() === attributeName;\r\n });\r\n const isPlantFulfillment =\r\n fulfillmentTypeAttribute && fulfillmentTypeAttribute.TextValue?.toLowerCase() === attributeTextValue;\r\n const isPlantCategory = isPlantFulfillment ? true : false;\r\n\r\n if (isPlantCategory) {\r\n plantProducts.push(product);\r\n } else {\r\n nonPlantProducts.push(product);\r\n }\r\n });\r\n\r\n const prodIds = this.state.allProducts && this.state.allProducts.map(prod => prod.RecordId);\r\n if (prodIds && prodIds.length <= 0) {\r\n return;\r\n }\r\n\r\n const plantProductIds = plantProducts.map(pp => pp.RecordId);\r\n const nonPlantProductIds = nonPlantProducts.map(npp => npp.RecordId);\r\n\r\n let productAvailabilitesPlants: ProductWarehouseInventoryInformation | null = null;\r\n if (plantProductIds && plantProductIds.length) {\r\n productAvailabilitesPlants = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: plantProductIds, DefaultWarehouseOnly: false, FilterByChannelFulfillmentGroup: true }\r\n );\r\n }\r\n\r\n const deliveryOptions = await getDeliveryOptionsAsync(\r\n { callerContext: actionContext, queryResultSettings: {} },\r\n prodIds ? prodIds : []\r\n );\r\n const productsWithPlantsDelivery: IProductWithModes[] = await Promise.all(\r\n plantProducts.map(async (prod, idx) => {\r\n let isCnC = false;\r\n let isHomeDelivery = false;\r\n\r\n if (productAvailabilitesPlants && productAvailabilitesPlants.ProductWarehouseInventoryAvailabilities) {\r\n productAvailabilitesPlants.ProductWarehouseInventoryAvailabilities?.map(\r\n (item: ProductWarehouseInventoryAvailability) => {\r\n if (item.InventLocationId === 'P001' || item.InventLocationId === 'S059') {\r\n if (item.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n isHomeDelivery = true;\r\n }\r\n } else {\r\n if (item.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n deliveryOptions[idx].DeliveryOptions?.map(option => {\r\n if (option.Code === 'ClickCol') {\r\n isCnC = true;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n );\r\n }\r\n\r\n // If product has vendorship === \"yes\" then show it as available\r\n const isVendorShipAttribute = prod.AttributeValues?.find(attribute => {\r\n const attributeName = attribute.Name && attribute.Name.trim().toLowerCase();\r\n return attributeName === 'isvendershipproduct';\r\n });\r\n\r\n if (isVendorShipAttribute && isVendorShipAttribute.TextValue && isVendorShipAttribute.TextValue.toLowerCase() === 'yes') {\r\n isHomeDelivery = true;\r\n isCnC = false;\r\n }\r\n\r\n return { ...prod, isHomeDelivery, isCnC };\r\n })\r\n );\r\n\r\n let productAvailabilitesNonPlantsHD: ProductWarehouseInventoryInformation | null = null;\r\n let productAvailabilitesNonPlantsCNC: ProductWarehouseInventoryInformation | null = null;\r\n // Not Plants API since the warehouse storage is different\r\n if (nonPlantProductIds && nonPlantProductIds.length) {\r\n productAvailabilitesNonPlantsHD = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: nonPlantProductIds, DefaultWarehouseOnly: true, FilterByChannelFulfillmentGroup: false }\r\n );\r\n productAvailabilitesNonPlantsCNC = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: nonPlantProductIds, DefaultWarehouseOnly: false, FilterByChannelFulfillmentGroup: true }\r\n );\r\n }\r\n\r\n const productsWithNonPlantsDelivery: IProductWithModes[] = await Promise.all(\r\n nonPlantProducts.map(async (prod, idx) => {\r\n let isCnC = false;\r\n let isHomeDelivery = false;\r\n\r\n if (productAvailabilitesNonPlantsHD && productAvailabilitesNonPlantsHD.AggregatedProductInventoryAvailabilities) {\r\n productAvailabilitesNonPlantsHD.AggregatedProductInventoryAvailabilities.map(stores => {\r\n if (stores.ProductId === prod.RecordId && stores.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n isHomeDelivery = true;\r\n }\r\n });\r\n }\r\n\r\n if (productAvailabilitesNonPlantsCNC && productAvailabilitesNonPlantsCNC.AggregatedProductInventoryAvailabilities) {\r\n productAvailabilitesNonPlantsCNC.AggregatedProductInventoryAvailabilities.map(stores => {\r\n if (stores.ProductId === prod.RecordId && stores.PhysicalAvailableInventoryLevelCode !== 'OOS') {\r\n deliveryOptions[idx].DeliveryOptions?.map(option => {\r\n if (option.Code === 'ClickCol') {\r\n isCnC = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n // If product has vendorship === \"yes\" then show it as available\r\n const isVendorShipAttribute = prod.AttributeValues?.find(attribute => {\r\n const attributeName = attribute.Name && attribute.Name.trim().toLowerCase();\r\n return attributeName === 'isvendershipproduct';\r\n });\r\n\r\n if (isVendorShipAttribute && isVendorShipAttribute.TextValue && isVendorShipAttribute.TextValue.toLowerCase() === 'yes') {\r\n isHomeDelivery = true;\r\n isCnC = false;\r\n }\r\n\r\n return { ...prod, isHomeDelivery, isCnC };\r\n })\r\n );\r\n\r\n const totalProducts = [...productsWithPlantsDelivery, ...productsWithNonPlantsDelivery];\r\n\r\n const allProducts: any = [];\r\n products.map(prod => {\r\n totalProducts.find(item => {\r\n if (item.RecordId === prod.RecordId) {\r\n allProducts.push(item);\r\n }\r\n });\r\n });\r\n\r\n let inventoryInformation: IProductInventoryInformation[] = [];\r\n let productsLength = 0;\r\n if (plantProducts.length > 0) {\r\n inventoryInformation = inventoryInformation.concat(\r\n mapProductInventoryInformation(actionContext, productAvailabilitesPlants?.ProductWarehouseInventoryAvailabilities ?? [])\r\n );\r\n productsLength += plantProducts.length;\r\n // this.setState({ inventoryInformation: inventoryInformation, productCount: plantProducts.length });\r\n\r\n // Check if product shared state is not set, set it\r\n // if (!this.state.isSharedStateSet) {\r\n // this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n // potsProductCount: plantProducts.length\r\n // });\r\n // this.setState({ isSharedStateSet: true });\r\n // }\r\n }\r\n if (nonPlantProducts.length > 0) {\r\n inventoryInformation = inventoryInformation.concat(\r\n mapProductInventoryInformation(\r\n actionContext,\r\n productAvailabilitesNonPlantsHD?.ProductWarehouseInventoryAvailabilities ?? []\r\n )\r\n );\r\n productsLength += nonPlantProducts.length;\r\n // this.setState({\r\n // inventoryInformation: inventoryInformation,\r\n // productCount: nonPlantProducts.length\r\n // });\r\n // Check if product shared state is not set, set it\r\n // if (!this.state.isSharedStateSet) {\r\n // this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n // potsProductCount: nonPlantProducts.length\r\n // });\r\n // this.setState({ isSharedStateSet: true });\r\n // }\r\n }\r\n if (inventoryInformation && inventoryInformation.length) {\r\n this.setState({ inventoryInformation: inventoryInformation, productCount: productsLength });\r\n if (!this.state.isSharedStateSet) {\r\n this.props.context.actionContext.update(new GetPlantPotsProductCountInput(), {\r\n potsProductCount: productsLength\r\n });\r\n this.setState({ isSharedStateSet: true });\r\n }\r\n }\r\n };\r\n // Following function adds product to cart\r\n private _getAddToCart = (product: ProductSearchResult, itemKey: string) => () => {\r\n this._addItemToCart(product, itemKey).catch(error => `[addItemToCart] unable to add to cart`);\r\n };\r\n\r\n private getOrderQuantityLimitsFeatureFlag(): boolean {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n try {\r\n const featureStatuses = this.props.data.featureState.result;\r\n const isQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n return false;\r\n }\r\n } catch (error) {\r\n this.props.telemetry.warning(error as string);\r\n this.props.telemetry.debug('Unable to get feature states');\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n try {\r\n const customerInfo = this.props.data.customerInformation.result;\r\n return (\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n } catch (error) {\r\n this.props.telemetry.warning(error as string);\r\n this.props.telemetry.debug('Unable to get customer info');\r\n return false;\r\n }\r\n }\r\n\r\n private _updateCookiesForAddedProducts = (product: ProductSearchResult) => {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const addedProducts: IDobbiesAddedProductToBundle[] = [];\r\n const addedProductsToCollection =\r\n cookies.get(this.props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n const maxPDPQuantity = this.getPDPProductMaxQ();\r\n const maxPDPQNumber = maxPDPQuantity ? Number(maxPDPQuantity) : 0;\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n addedProducts.push({\r\n productId: obj['productId'],\r\n quantity: obj['quantity'],\r\n price: obj['price'],\r\n maxQuantity: obj['maxQuantity']\r\n });\r\n }\r\n }\r\n let productAddedAlready = false;\r\n for (const ap of addedProducts) {\r\n if (ap.productId === product.RecordId) {\r\n ap.quantity = ap.quantity ? ap.quantity + 1 : 1;\r\n productAddedAlready = true;\r\n }\r\n }\r\n if (!productAddedAlready) {\r\n const prodQD = this.state.currQuantities.find(qd => qd[0] === product.RecordId);\r\n if (prodQD) {\r\n const quantityToBeAdded = prodQD[1];\r\n addedProducts.push({\r\n productId: product.RecordId,\r\n quantity: quantityToBeAdded,\r\n price: product.Price ? product.Price : product.BasePrice,\r\n maxQuantity:\r\n product.RecordId === this.state.pdpSearchResultProduct?.RecordId\r\n ? maxPDPQNumber\r\n : this.getMaxAvailableQuantityForProduct(product.RecordId)\r\n });\r\n } else {\r\n addedProducts.push({\r\n productId: product.RecordId,\r\n quantity: 1,\r\n price: product.Price ? product.Price : product.BasePrice,\r\n maxQuantity:\r\n product.RecordId === this.state.pdpSearchResultProduct?.RecordId\r\n ? maxPDPQNumber\r\n : this.getMaxAvailableQuantityForProduct(product.RecordId)\r\n });\r\n }\r\n }\r\n\r\n const cookieName = this.props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles';\r\n cookies.set(cookieName, addedProducts);\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n if (this.props.config.isNotificationModal) {\r\n this.updateAddedProductsList();\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: false });\r\n }\r\n };\r\n private getMaxAvailableQuantityForProduct = (productId: number): number => {\r\n let quantity = 0;\r\n const inventoryInformation = this.state.inventoryInformation;\r\n const productInvInfo =\r\n inventoryInformation && inventoryInformation.find(inventory => inventory.ProductAvailableQuantity.ProductId === productId);\r\n quantity =\r\n productInvInfo && productInvInfo.ProductAvailableQuantity.AvailableQuantity\r\n ? productInvInfo.ProductAvailableQuantity.AvailableQuantity\r\n : 0;\r\n const product = this.state.simpleProductObjs?.find(prod => prod.RecordId === productId);\r\n quantity = _getCartItemMaxQuantity(\r\n this.props.context.app.config.maxQuantityForCartLineItem,\r\n this.props.context.app.config.enableStockCheck || false,\r\n quantity,\r\n this.getOrderQuantityLimitsFeatureFlag(),\r\n product?.Behavior?.MaximumQuantity || 0\r\n );\r\n return quantity;\r\n };\r\n\r\n private _addItemToCart = async (product: ProductSearchResult, itemKey: string): Promise => {\r\n const { context, data, resources, telemetry } = this.props;\r\n const { cart, featureState } = data;\r\n const { addedToCartSuccessMessage, addedToCartFailureMessage } = resources;\r\n const { inventoryInformation } = this.state;\r\n const productInventoryInformation =\r\n inventoryInformation &&\r\n inventoryInformation.find(inventory => inventory.ProductAvailableQuantity.ProductId === product.RecordId);\r\n const navigationUrl = Msdyn365.getUrlSync('cart', context.actionContext);\r\n if (this.props.config.isProductBundles && !this.props.config.isBundlesModal && !this.props.config.isNotificationModal) {\r\n this._updateCookiesForAddedProducts(product);\r\n return;\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n const productList = new Array();\r\n const p = await this._convertToSimpleProduct(product);\r\n const prodQD = this.state.currQuantities.find(qd => qd[0] === product.RecordId);\r\n let quantityToBeAdded = 1;\r\n if (prodQD) {\r\n quantityToBeAdded = prodQD[1];\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl && cl.Quantity && cl.Quantity < quantityToBeAdded) {\r\n quantityToBeAdded = quantityToBeAdded - cl.Quantity;\r\n }\r\n }\r\n productList.push({\r\n product: p,\r\n count: quantityToBeAdded,\r\n enableStockCheck: this.props.context.app.config.enableStockCheck\r\n });\r\n cart.result\r\n ?.addProductsToCart(productList)\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: addedToCartSuccessMessage,\r\n statusCssString: 'success',\r\n messageGlyph: 'fas fa-check',\r\n isOpen: true\r\n });\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n }\r\n })\r\n .catch(e => {});\r\n return;\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isNotificationModal) {\r\n const productList = new Array();\r\n const p = await this._convertToSimpleProduct(product);\r\n const prodQD = this.state.currQuantities.find(qd => qd[0] === product.RecordId);\r\n let quantityToBeAdded = 1;\r\n if (prodQD) {\r\n quantityToBeAdded = prodQD[1];\r\n const cl = this.props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (cl && cl.Quantity && cl.Quantity < quantityToBeAdded) {\r\n quantityToBeAdded = quantityToBeAdded - cl.Quantity;\r\n }\r\n }\r\n productList.push({\r\n product: p,\r\n count: quantityToBeAdded,\r\n enableStockCheck: this.props.context.app.config.enableStockCheck\r\n });\r\n cart.result\r\n ?.addProductsToCart(productList)\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: addedToCartSuccessMessage,\r\n statusCssString: 'success',\r\n messageGlyph: 'fas fa-check',\r\n isOpen: true\r\n });\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isNotificationModal) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n }\r\n })\r\n .catch(e => {});\r\n return;\r\n }\r\n if (context) {\r\n if (cart.result) {\r\n const isOrderQuantityLimitsFeatureEnabledInHq =\r\n featureState.result?.find(\r\n featuresState => featuresState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform\r\n ?.enableDefaultOrderQuantityLimits;\r\n\r\n const isOrderQuantityLimitsFeatureEnabledInSiteSettings = defaultOrderQuantityLimitsFeatureConfig === 'all';\r\n\r\n const isOrderQuantityLimitsFeatureEnabled =\r\n isOrderQuantityLimitsFeatureEnabledInHq && isOrderQuantityLimitsFeatureEnabledInSiteSettings;\r\n // check if the product delivery mode is electronic\r\n const emailDeliveryModeCode = this.props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n const deliveryOptions = await getDeliveryOptionsAsync(\r\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\r\n [product.RecordId]\r\n );\r\n\r\n const simpleProduct = await this._convertToSimpleProduct(product);\r\n\r\n const addProductToCartInput = {\r\n product: simpleProduct,\r\n quantity: 1,\r\n enableStockCheck: context.app.config.enableStockCheck,\r\n availableQuantity: productInventoryInformation\r\n ? productInventoryInformation.ProductAvailableQuantity.AvailableQuantity\r\n : 0,\r\n additionalProperties: { orderQuantityLimitsFeatureIsEnabled: isOrderQuantityLimitsFeatureEnabled },\r\n isAddEmailDeliveryItemToCart:\r\n ArrayExtensions.hasElements(deliveryOptions) &&\r\n ArrayExtensions.hasElements(deliveryOptions[0].DeliveryOptions) &&\r\n deliveryOptions[0].DeliveryOptions[0].Code === emailDeliveryModeCode\r\n };\r\n cart.result\r\n .addProductToCart(addProductToCartInput)\r\n .then(async result => {\r\n if (result.status === 'SUCCESS') {\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: addedToCartSuccessMessage,\r\n statusCssString: 'success',\r\n messageGlyph: 'fas fa-check',\r\n isOpen: true\r\n });\r\n if (this.props.config.isProductBundles && this.props.config.isBundlesModal) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n if (this.props.config.isProductBundles && this.props.config.isNotificationModal) {\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n !this.props.config.isProductBundles &&\r\n !this.props.config.isBundlesModal &&\r\n navigationUrl &&\r\n window &&\r\n window.location.assign(navigationUrl);\r\n } else if (result.substatus === 'MAXQUANTITY') {\r\n const curQuantity =\r\n (await cart).cart?.CartLines?.find(item => item.ProductId === product.RecordId)?.Quantity || 0;\r\n const maxQtyLimitReachedMessage = this._getInventoryValueMessage(productInventoryInformation, curQuantity);\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: maxQtyLimitReachedMessage,\r\n statusCssString: 'danger',\r\n messageGlyph: 'fas fa-exclamation-triangle',\r\n isOpen: true\r\n });\r\n } else if (result.substatus === 'QUANTITYLIMITS' && isOrderQuantityLimitsFeatureEnabled) {\r\n const maxQtyLimitReachedMessage = result.errorDetails?.LocalizedMessage;\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: maxQtyLimitReachedMessage || addedToCartFailureMessage,\r\n statusCssString: 'danger',\r\n messageGlyph: 'fas fa-exclamation-triangle',\r\n isOpen: true\r\n });\r\n } else {\r\n this.props.telemetry.debug('[wishlist-items] Unable to Update Cart Line from Pots Collection');\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: addedToCartFailureMessage,\r\n statusCssString: 'danger',\r\n messageGlyph: 'fas fa-exclamation-triangle',\r\n isOpen: true\r\n });\r\n }\r\n })\r\n .catch(error => {\r\n telemetry.warning(error);\r\n telemetry.debug('[wishlist-items] Error trying to Update Cart Line from Pots Collection');\r\n this.setState({\r\n productId: product.RecordId,\r\n itemKey: itemKey,\r\n userMessage: addedToCartFailureMessage,\r\n statusCssString: 'danger',\r\n messageGlyph: 'fas fa-exclamation-triangle',\r\n isOpen: true\r\n });\r\n });\r\n }\r\n }\r\n };\r\n\r\n private readonly getNonClubPlusDiscountPrices = async (): Promise => {\r\n const products = this.state.products || [];\r\n if (this.props.config.isProductBundles && this.state.pdpSearchResultProduct) {\r\n products.push(this.state.pdpSearchResultProduct);\r\n }\r\n const productRecIds = ArrayExtensions.hasElements(products) ? products.map(prod => prod.RecordId) : [];\r\n const projectDomain: ProjectionDomain = {\r\n ChannelId: this.props.context.request.apiSettings.channelId,\r\n CatalogId: this.props.context.request.apiSettings.catalogId\r\n };\r\n await getActivePricesAsync(\r\n {\r\n callerContext: this.props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n projectDomain,\r\n productRecIds,\r\n new Date(),\r\n null,\r\n null,\r\n true\r\n )\r\n .then(async (activePricesResponse: ProductPrice[]) => {\r\n if (activePricesResponse && activePricesResponse.length > 0) {\r\n this.setState({\r\n nonClubPlusDiscount: activePricesResponse\r\n });\r\n const productsListWithKitScenarioHandled = await this.getProductsListWithKitProductsHandled(\r\n this.state.products ? this.state.products : []\r\n );\r\n const updatedProducts = productsListWithKitScenarioHandled.map(prod => {\r\n const activePrice = activePricesResponse.find(price => price.ProductId === prod.RecordId);\r\n if (activePrice) {\r\n prod.Price = activePrice.CustomerContextualPrice ?? prod.Price;\r\n prod.BasePrice = Math.max(\r\n activePrice.BasePrice || 0,\r\n activePrice.TradeAgreementPrice || 0,\r\n activePrice.AdjustedPrice || 0\r\n );\r\n }\r\n return prod;\r\n });\r\n const productPricesforcookies = updatedProducts.map(prod => {\r\n return {\r\n recordId: prod.RecordId,\r\n price: prod.Price,\r\n basePrice: prod.BasePrice\r\n };\r\n });\r\n if (updatedProducts) {\r\n const cookieName = this.props.config.isNotificationModal ? 'notification_products_prices' : '';\r\n if (cookieName) {\r\n this.props.context.actionContext.requestContext.cookies.set(cookieName, productPricesforcookies);\r\n }\r\n this.setState({ products: updatedProducts });\r\n }\r\n const activePrice = activePricesResponse.find(price => price.ProductId === this.state.pdpSearchResultProduct?.RecordId);\r\n if (activePrice) {\r\n const pdpProd = this.state.pdpSearchResultProduct;\r\n if (pdpProd) {\r\n pdpProd.Price = activePrice.CustomerContextualPrice ?? pdpProd.Price;\r\n pdpProd.BasePrice = Math.max(\r\n activePrice.BasePrice || 0,\r\n activePrice.TradeAgreementPrice || 0,\r\n activePrice.AdjustedPrice || 0\r\n );\r\n this.setState({ pdpSearchResultProduct: pdpProd });\r\n if (this.props.config.isProductBundles && !this.props.config.isBundlesModal) {\r\n const cookies = this.props.context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection =\r\n cookies.get(\r\n this.props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles'\r\n )?.value || [];\r\n let pdpProductAlreadyAdded = false;\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n if (pdpProd.RecordId === obj['productId']) {\r\n pdpProductAlreadyAdded = true;\r\n }\r\n }\r\n }\r\n if (!pdpProductAlreadyAdded) {\r\n if (this.props.config.isProductBundles && !this.props.config.isBundlesModal) {\r\n this._addItemToCart(pdpProd, pdpProd.RecordId.toString()).catch(\r\n error => `[addItemToCart] unable to add to cart`\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n })\r\n .catch((error: Error) => {\r\n this.props.context.actionContext.trace(error.message);\r\n this.props.context.actionContext.telemetry.exception(error);\r\n this.props.context.actionContext.telemetry.debug(\r\n '[get Affiliation based price on search result container ]Error executing action'\r\n );\r\n throw new Error('[get Affiliation based price on search result container]Error executing action');\r\n });\r\n };\r\n\r\n // Following function converts ProductSearchResult into SimpleProduct\r\n private async _convertToSimpleProduct(product: ProductSearchResult): Promise {\r\n const {\r\n context: {\r\n actionContext: {\r\n requestContext: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n }\r\n } = this.props;\r\n\r\n const response = await getByIdAsync({ callerContext: this.props.context.actionContext }, product.RecordId, channelId);\r\n return Array.isArray(response) ? response[0] : response;\r\n }\r\n\r\n // Followig function returns inventory messages\r\n private _getInventoryValueMessage(product: IProductInventoryInformation | undefined, curQuantity: number): string {\r\n const { context, resources } = this.props;\r\n const { maxQuantityLimitText } = resources;\r\n\r\n const maxQuantityForLineItem = context.app.config.maxQuantityForCartLineItem || 10;\r\n\r\n if (!product || !product.ProductAvailableQuantity.AvailableQuantity || !context.app.config.enableStockCheck) {\r\n return maxQuantityLimitText\r\n .replace('{maxQuantity}', maxQuantityForLineItem.toString())\r\n .replace('{curQuantity}', curQuantity.toString());\r\n }\r\n\r\n const minInventory = Math.min(maxQuantityForLineItem, product.ProductAvailableQuantity.AvailableQuantity);\r\n\r\n return maxQuantityLimitText.replace('{maxQuantity}', minInventory.toString()).replace('{curQuantity}', curQuantity.toString());\r\n }\r\n /* VSI Customization - END */\r\n // private _getActivePrice = async (): Promise => {\r\n // let products = this.state.products || [];\r\n // const productRecIds = products && products.length > 0 ? products.map(prod => prod.RecordId) : [];\r\n // const projectDomain: ProjectionDomain = {\r\n // ChannelId: this.props.context.request.apiSettings.channelId,\r\n // CatalogId: this.props.context.request.apiSettings.catalogId\r\n // };\r\n // const affliations: AffiliationLoyaltyTier[] = [];\r\n // const customerInput = new GetCustomerInput(this.props.context.actionContext.requestContext.apiSettings);\r\n // const customer = await getCustomer(customerInput, this.props.context.actionContext);\r\n\r\n // if (customer && customer.CustomerAffiliations) {\r\n // customer.CustomerAffiliations.forEach((affliation: CustomerAffiliation) => {\r\n // const aff: AffiliationLoyaltyTier = { AffiliationId: affliation.RetailAffiliationId, CustomerId: customer.AccountNumber };\r\n // affliations.push(aff);\r\n // });\r\n // }\r\n\r\n // await getActivePricesAsync(\r\n // { callerContext: this.props.context.actionContext, queryResultSettings: {} },\r\n // projectDomain,\r\n // productRecIds,\r\n // new Date(),\r\n // null,\r\n // affliations,\r\n // true\r\n // )\r\n // .then((activePricesResponse: ProductPrice[]) => {\r\n // this.productPrices = activePricesResponse;\r\n // products = products.map(prod => {\r\n // const activePrice = activePricesResponse.find(price => price.ProductId === prod.RecordId);\r\n // if (activePrice) {\r\n // prod.Price = activePrice.CustomerContextualPrice ?? prod.Price;\r\n // prod.BasePrice = Math.max(\r\n // activePrice.BasePrice || 0,\r\n // activePrice.TradeAgreementPrice || 0,\r\n // activePrice.AdjustedPrice || 0\r\n // );\r\n // }\r\n // return prod;\r\n // });\r\n // this.setState({\r\n // products: products\r\n // });\r\n // })\r\n // .catch((error: Error) => {\r\n // this.props.context.actionContext.trace(error.message);\r\n // this.props.context.actionContext.telemetry.exception(error);\r\n // this.props.context.actionContext.telemetry.debug(\r\n // `[get Affiliation based price on Product Collection]Error executing action`\r\n // );\r\n // throw new Error('[get Affiliation based price on Product Collection]Error executing action');\r\n // });\r\n // };\r\n}\r\n\r\nexport default ProductCollection;\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 { INodeProps, Module, Node, Button } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IDobbiesAddedProductToBundle, IProductCollectionViewProps, IProductComponentViewProps } from './dobbies-product-collection';\r\nimport { IDobbiesMiniCartSummaryProduct } from '../../themes/dobbies/views/buybox.view';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport { ProductPrice, SimpleProduct, ProjectionDomain } from '@msdyn365-commerce/retail-proxy';\r\nimport { CartModulesStateShareInput } from '../../actions/cart-state-share';\r\nimport { Quantity } from '../../themes/dobbies/utilities/quantity';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n getByIdsAsync,\r\n getDeliveryOptionsAsync,\r\n getActivePricesAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ArrayExtensions, QueryResultSettingsProxy } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { cartLineQuantityUpdatedAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport PriceComponent from '../../themes/dobbies/views/custom-components/product-price-component';\r\nconst ProductCollectionView: React.FC = props => {\r\n const [cartProducts, setCartProducts] = React.useState([]);\r\n const [bundlesSummaryScrollPos, setBundlesSummaryScrollPos] = React.useState(0);\r\n const [bundlesModalSummaryScrollPos, setBundlesModalSummaryScrollPos] = React.useState(0);\r\n\r\n const {\r\n heading,\r\n ProductCollectionContainer,\r\n products,\r\n SingleSlideCarouselComponentProps,\r\n GridComponentProps,\r\n isCarousel,\r\n pdpProduct,\r\n pdpProductComponent\r\n } = props;\r\n\r\n const equalsCheck = (a: number[], b: number[]) => {\r\n return a.length === b.length && a.every((v, i) => v === b[i]);\r\n };\r\n const updateCartProduct = async () => {\r\n const productIds: number[] = props.data.cart.result?.cart.CartLines\r\n ? props.data.cart.result?.cart.CartLines?.map(cartline => cartline.ProductId || -1)\r\n : [];\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const addedProducts =\r\n cookies.get(props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n if (Array.isArray(addedProducts)) {\r\n for (const ap of addedProducts) {\r\n if (!productIds.includes(ap['productId'])) {\r\n productIds.push(ap['productId']);\r\n }\r\n }\r\n }\r\n const productBundleProducts = cookies.get('notification_products');\r\n const updatedProductIds: number[] = [];\r\n if (Array.isArray(productIds)) {\r\n for (const prodId of productIds) {\r\n if (productBundleProducts && Array.isArray(productBundleProducts.value) && productBundleProducts.value['length'] > 0) {\r\n for (const prodBP of productBundleProducts.value) {\r\n if (+prodBP.itemId === prodId) {\r\n updatedProductIds.push(prodId);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n const simpleProductsData = ArrayExtensions.validValues(\r\n await getByIdsAsync(\r\n {\r\n callerContext: props.context.actionContext,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(props.context.actionContext)\r\n },\r\n props.context.actionContext.requestContext.apiSettings.channelId\r\n ? props.context.actionContext.requestContext.apiSettings.channelId\r\n : -1,\r\n updatedProductIds,\r\n null,\r\n props.context.actionContext.requestContext.apiSettings.catalogId\r\n )\r\n );\r\n\r\n let simpleProductsWithQuantities = simpleProductsData.map(sp => {\r\n const prodWithQuantity: IDobbiesMiniCartSummaryProduct = { ...sp, quantity: 1 };\r\n const cl = props.data.cart.result?.cart.CartLines?.find(c => c.ProductId === prodWithQuantity.RecordId);\r\n if (Array.isArray(addedProducts)) {\r\n for (const ap of addedProducts) {\r\n if (prodWithQuantity.RecordId === ap['productId']) {\r\n prodWithQuantity.quantity = ap['quantity'];\r\n if (cl && prodWithQuantity.quantity && cl.Quantity) {\r\n prodWithQuantity.quantity += cl.Quantity;\r\n }\r\n }\r\n }\r\n }\r\n if (cl && cl.Quantity && prodWithQuantity.quantity && prodWithQuantity.quantity <= cl.Quantity) {\r\n prodWithQuantity.quantity = cl.Quantity;\r\n }\r\n return prodWithQuantity;\r\n });\r\n const simpleProdIds = simpleProductsWithQuantities.map(prod => prod.RecordId);\r\n const cartProductIds = cartProducts.map(cartProd => cartProd.RecordId);\r\n\r\n if (!equalsCheck(simpleProdIds, cartProductIds)) {\r\n const projectDomain: ProjectionDomain = {\r\n ChannelId: props.context.request.apiSettings.channelId,\r\n CatalogId: props.context.request.apiSettings.catalogId\r\n };\r\n const pIds = simpleProductsWithQuantities.map(p => p.RecordId);\r\n await getActivePricesAsync(\r\n {\r\n callerContext: props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n projectDomain,\r\n pIds,\r\n new Date(),\r\n null,\r\n null,\r\n true\r\n )\r\n .then((activePricesResponse: ProductPrice[]) => {\r\n if (activePricesResponse && activePricesResponse.length > 0) {\r\n simpleProductsWithQuantities = simpleProductsWithQuantities.map(sp => {\r\n const activePrice = activePricesResponse.find(price => price.ProductId === sp.RecordId);\r\n if (activePrice) {\r\n sp.Price = activePrice.CustomerContextualPrice ?? sp.Price;\r\n sp.BasePrice = Math.max(\r\n activePrice.BasePrice || 0,\r\n activePrice.TradeAgreementPrice || 0,\r\n activePrice.AdjustedPrice || 0\r\n );\r\n }\r\n return sp;\r\n });\r\n }\r\n })\r\n .catch((error: Error) => {});\r\n const updatedSimpleProductsWithQuantities = simpleProductsWithQuantities.filter(item => {\r\n // Check if product doesn't have inventory, dont dislay it\r\n const itemInventory = props.state.inventoryInformation.find(\r\n inventory => inventory.ProductAvailableQuantity.ProductId === item.RecordId\r\n );\r\n\r\n return itemInventory && itemInventory.IsProductAvailable === true;\r\n });\r\n setCartProducts(updatedSimpleProductsWithQuantities);\r\n } else {\r\n if (simpleProductsWithQuantities) {\r\n let needsUpdate = false;\r\n for (const cp of cartProducts) {\r\n const ap = simpleProductsWithQuantities.find(p => p.RecordId === cp.RecordId);\r\n if (ap?.quantity !== cp.quantity) {\r\n needsUpdate = true;\r\n }\r\n }\r\n if (needsUpdate) {\r\n const projectDomain: ProjectionDomain = {\r\n ChannelId: props.context.request.apiSettings.channelId,\r\n CatalogId: props.context.request.apiSettings.catalogId\r\n };\r\n const pIds = simpleProductsWithQuantities.map(p => p.RecordId);\r\n await getActivePricesAsync(\r\n {\r\n callerContext: props.context.actionContext,\r\n queryResultSettings: {}\r\n },\r\n projectDomain,\r\n pIds,\r\n new Date(),\r\n null,\r\n null,\r\n true\r\n )\r\n .then((activePricesResponse: ProductPrice[]) => {\r\n if (activePricesResponse && activePricesResponse.length > 0) {\r\n simpleProductsWithQuantities = simpleProductsWithQuantities.map(sp => {\r\n const activePrice = activePricesResponse.find(price => price.ProductId === sp.RecordId);\r\n if (activePrice) {\r\n sp.Price = activePrice.CustomerContextualPrice ?? sp.Price;\r\n sp.BasePrice = Math.max(\r\n activePrice.BasePrice || 0,\r\n activePrice.TradeAgreementPrice || 0,\r\n activePrice.AdjustedPrice || 0\r\n );\r\n }\r\n return sp;\r\n });\r\n }\r\n })\r\n .catch((error: Error) => {});\r\n const updatedSimpleProductsWithQuantities = simpleProductsWithQuantities.filter(item => {\r\n // Check if product doesn't have inventory, dont dislay it\r\n const itemInventory = props.state.inventoryInformation.find(\r\n inventory => inventory.ProductAvailableQuantity.ProductId === item.RecordId\r\n );\r\n\r\n return itemInventory && itemInventory.IsProductAvailable === true;\r\n });\r\n setCartProducts(updatedSimpleProductsWithQuantities);\r\n }\r\n }\r\n }\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: false });\r\n };\r\n React.useEffect(() => {\r\n updateCartProduct();\r\n }, [props.data.cart.result?.cart.CartLines]);\r\n React.useEffect(() => {\r\n if (props.data.cartSharedState?.result?.isCartUpdated) {\r\n updateCartProduct();\r\n }\r\n }, [props.data.cartSharedState.result?.isCartUpdated]);\r\n if (products) {\r\n if (props.config.isNotificationModal) {\r\n return (\r\n <>\r\n \r\n {heading}\r\n {isCarousel\r\n ? _renderCarousel(SingleSlideCarouselComponentProps, products)\r\n : _renderGrid(GridComponentProps, products)}\r\n\r\n {props.shouldShowAddAllProducts && props.addAllProductsOnClick}\r\n \r\n
\r\n
\r\n

Your basket

\r\n {_renderCartLines(\r\n props,\r\n cartProducts,\r\n setCartProducts,\r\n bundlesSummaryScrollPos,\r\n setBundlesSummaryScrollPos,\r\n bundlesModalSummaryScrollPos,\r\n setBundlesModalSummaryScrollPos,\r\n true\r\n )}\r\n {\r\n const notifiCheck = props.context.request.user.isAuthenticated ? 'signedin' : 'signedout';\r\n setCookie(props, 'notification_popup', notifiCheck, 1);\r\n MsDyn365.isBrowser && window && window.location.assign('/cart');\r\n }}\r\n >\r\n {!props.data.cart.result?.cart.CartLines?.length ? 'Add an item' : 'View your basket'}\r\n \r\n

\r\n {props.config.discountAppliedInCartMessage\r\n ? props.config.discountAppliedInCartMessage\r\n : 'Any offers/discounts will be applied at checkout'}\r\n

\r\n
\r\n
\r\n \r\n );\r\n } else if (pdpProduct && pdpProductComponent && !props.isBundlesModal) {\r\n return (\r\n <>\r\n {pdpProductComponent}\r\n
\r\n \r\n {heading}\r\n {isCarousel\r\n ? _renderCarousel(SingleSlideCarouselComponentProps, products)\r\n : _renderGrid(GridComponentProps, products)}\r\n\r\n {props.shouldShowAddAllProducts && props.addAllProductsOnClick}\r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n {heading}\r\n {isCarousel ? _renderCarousel(SingleSlideCarouselComponentProps, products) : _renderGrid(GridComponentProps, products)}\r\n {props.shouldShowAddAllProducts && props.addAllProductsOnClick}\r\n \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 setCookie = (props: IProductCollectionViewProps, name: string, value: string, deltaDaysFromToday: number) => {\r\n const { cookies } = props.context.request;\r\n const expirationDate = new Date(Date.now());\r\n expirationDate.setTime(expirationDate.getTime() + deltaDaysFromToday * 24 * 60 * 60 * 1000);\r\n\r\n cookies.set(name, value, {\r\n expires: deltaDaysFromToday ? expirationDate : null,\r\n isEssential: true\r\n } as {});\r\n};\r\n\r\nconst changeQinBundlesModalSummary = async (\r\n props: IProductCollectionViewProps,\r\n productId: number,\r\n newValue: number,\r\n cartProducts: IDobbiesMiniCartSummaryProduct[],\r\n setCartProducts: React.Dispatch>,\r\n isSummaryInModal: boolean,\r\n maxQuantityForBundle: number\r\n) => {\r\n const cartState = await getCartState(props.context.actionContext);\r\n const cl = cartState.cart.CartLines?.find(c => c.ProductId === productId);\r\n const simpleProduct: SimpleProduct | undefined = cartProducts.find(c => c.RecordId === productId);\r\n if (maxQuantityForBundle <= 0) {\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const maxQuantities =\r\n cookies.get(\r\n props.config.isNotificationModal\r\n ? 'product_notification_maximum_available_quantities'\r\n : 'product_bundles_maximum_available_quantities'\r\n )?.value || [];\r\n if (Array.isArray(maxQuantities)) {\r\n for (const maxQ of maxQuantities) {\r\n if (maxQ.productId === productId) {\r\n maxQuantityForBundle = maxQ.maxQuantity;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (cl && cl.Quantity && maxQuantityForBundle && simpleProduct) {\r\n if (newValue > maxQuantityForBundle) {\r\n return;\r\n }\r\n const diffInQuantity = newValue - cl.Quantity;\r\n const deliveryOptions = await getDeliveryOptionsAsync({ callerContext: props.context.actionContext, queryResultSettings: {} }, [\r\n productId\r\n ]);\r\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n if (diffInQuantity > 0) {\r\n const addProductToCartInput = {\r\n product: simpleProduct,\r\n quantity: diffInQuantity,\r\n enableStockCheck: props.context.app.config.enableStockCheck,\r\n availableQuantity: maxQuantityForBundle,\r\n isAddEmailDeliveryItemToCart:\r\n ArrayExtensions.hasElements(deliveryOptions) &&\r\n ArrayExtensions.hasElements(deliveryOptions[0].DeliveryOptions) &&\r\n deliveryOptions[0].DeliveryOptions[0].Code === emailDeliveryModeCode\r\n };\r\n cartState\r\n .addProductToCart(addProductToCartInput)\r\n .then(async result => {\r\n if (result.status === 'SUCCESS') {\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: true });\r\n }\r\n })\r\n .catch(e => {});\r\n } else if (diffInQuantity < 0) {\r\n cartLineQuantityUpdatedAsync(true, cartState, props.context.actionContext.telemetry, [simpleProduct], cl, newValue)\r\n .then((cartActionResult: ICartActionResult | undefined): boolean => {\r\n if (cartActionResult?.status === 'SUCCESS') {\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: true });\r\n return true;\r\n }\r\n return false;\r\n })\r\n .catch(e => {});\r\n }\r\n }\r\n};\r\nconst onQuantityChange = async (\r\n props: IProductCollectionViewProps,\r\n productId: number,\r\n newValue: number,\r\n cartProducts: IDobbiesMiniCartSummaryProduct[],\r\n setCartProducts: React.Dispatch>,\r\n isSummaryInModal: boolean,\r\n maxQuantityForBundle: number\r\n) => {\r\n if (isSummaryInModal) {\r\n changeQinBundlesModalSummary(props, productId, newValue, cartProducts, setCartProducts, isSummaryInModal, maxQuantityForBundle);\r\n return;\r\n }\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: false });\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection =\r\n cookies.get(props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles')?.value || [];\r\n const cartProductsCopy = cartProducts.map(cp => cp);\r\n const updatedProducts: IDobbiesAddedProductToBundle[] = [];\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n if (obj['productId'] === productId) {\r\n const valueToBeUpdated = newValue;\r\n if (valueToBeUpdated > 0) {\r\n updatedProducts.push({\r\n productId: obj['productId'],\r\n price: obj['price'],\r\n quantity: valueToBeUpdated,\r\n maxQuantity: obj['maxQuantity']\r\n });\r\n for (const cp of cartProductsCopy) {\r\n if (cp.RecordId === obj['productId']) {\r\n cp.quantity = valueToBeUpdated;\r\n }\r\n }\r\n }\r\n } else {\r\n updatedProducts.push({\r\n productId: obj['productId'],\r\n price: obj['price'],\r\n quantity: obj['quantity'],\r\n maxQuantity: obj['maxQuantity']\r\n });\r\n }\r\n }\r\n const cookieName = props.config.isNotificationModal ? 'notification_added_products' : 'added_products_bundles';\r\n cookies.set(cookieName, updatedProducts);\r\n setCartProducts(cartProductsCopy);\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isQuantityUpdated: true });\r\n }\r\n};\r\nconst _renderCartLines = (\r\n props: IProductCollectionViewProps,\r\n cartProducts: IDobbiesMiniCartSummaryProduct[],\r\n setCartProducts: React.Dispatch>,\r\n bundlesSummaryScrollPos: number,\r\n setBundlesSummaryScrollPos: React.Dispatch>,\r\n bundlesModalSummaryScrollPos: number,\r\n setBundlesModalSummaryScrollPos: React.Dispatch>,\r\n isSummaryInModal: boolean\r\n) => {\r\n let totalPrice = 0.0;\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const productsAddedInBundles = cookies.get('notification_added_products')?.value || [];\r\n const elemId = 'notification_product_summary';\r\n const elem = MsDyn365.isBrowser && window && window.document.getElementById(elemId);\r\n const rowHeight = 116;\r\n const minProductsToScroll =\r\n isSummaryInModal ||\r\n (MsDyn365.isBrowser && window && window.innerWidth >= 768 && MsDyn365.isBrowser && window && window.innerWidth <= 2500)\r\n ? 2\r\n : 3;\r\n const upArrowId = isSummaryInModal ? 'up-arrow-btn-modal' : 'up-arrow-btn';\r\n const downArrowId = isSummaryInModal ? 'down-arrow-btn-modal' : 'down-arrow-btn';\r\n let scrollPos = isSummaryInModal ? bundlesModalSummaryScrollPos : bundlesSummaryScrollPos;\r\n const rowHeightForCalc = 90;\r\n const maxQuantityReachedMsg = props.config.maxQuantityReachedInBundlesmsg\r\n ? props.config.maxQuantityReachedInBundlesmsg\r\n : `There is only 1 product left. Please choose quantity within the available range`;\r\n if (isSummaryInModal) {\r\n cartProducts = cartProducts.filter(cp =>\r\n props.data.cart.result?.cart.CartLines?.find(cl => cl.ProductId === cp.RecordId) ? true : false\r\n );\r\n if (cartProducts && props.data.cart.result?.cart.CartLines && props.data.cart.result?.cart.CartLines.length) {\r\n for (const c of props.data.cart.result?.cart.CartLines) {\r\n for (const cp of cartProducts) {\r\n if (c.ProductId === cp.RecordId) {\r\n cp.quantity = c.Quantity;\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n cartProducts = cartProducts.filter(\r\n cp => Array.isArray(productsAddedInBundles) && productsAddedInBundles.find(p => p['productId'] === cp.RecordId)\r\n );\r\n }\r\n return (\r\n <>\r\n {cartProducts && cartProducts.length > minProductsToScroll ? (\r\n {\r\n if (elem) {\r\n if (elem.scrollTop - rowHeight > 0) {\r\n elem.scrollTop -= rowHeight;\r\n } else {\r\n elem.scrollTop = 0;\r\n }\r\n if (isSummaryInModal) {\r\n setBundlesModalSummaryScrollPos(elem.scrollTop);\r\n } else {\r\n setBundlesSummaryScrollPos(elem.scrollTop);\r\n }\r\n }\r\n }}\r\n hidden={elem && scrollPos < 50 ? true : false}\r\n >\r\n ) : (\r\n <>\r\n )}\r\n {\r\n if (elem && Math.abs(Math.ceil(elem.scrollTop) - Math.ceil(scrollPos)) > rowHeightForCalc) {\r\n if (!isSummaryInModal) {\r\n if (elem.scrollTop >= (cartProducts.length - (minProductsToScroll + 1)) * rowHeightForCalc) {\r\n setBundlesSummaryScrollPos(elem?.scrollTop);\r\n } else if (elem.scrollTop < 50) {\r\n setBundlesSummaryScrollPos(elem?.scrollTop);\r\n }\r\n } else {\r\n if (elem.scrollTop >= (cartProducts.length - minProductsToScroll + 1) * rowHeightForCalc) {\r\n setBundlesModalSummaryScrollPos(elem?.scrollTop);\r\n } else if (elem.scrollTop < 50) {\r\n setBundlesModalSummaryScrollPos(elem?.scrollTop);\r\n }\r\n const upArrow = MsDyn365.isBrowser && window && window.document.getElementById(upArrowId);\r\n const downArrow = MsDyn365.isBrowser && window && window.document.getElementById(downArrowId);\r\n\r\n if (elem.scrollTop < 50) {\r\n if (upArrow) {\r\n upArrow.hidden = true;\r\n }\r\n } else {\r\n if (upArrow) {\r\n upArrow.hidden = false;\r\n }\r\n }\r\n if (elem.scrollTop > (cartProducts.length - minProductsToScroll) * rowHeightForCalc) {\r\n if (downArrow) {\r\n downArrow.hidden = true;\r\n }\r\n } else {\r\n if (downArrow) {\r\n downArrow.hidden = false;\r\n }\r\n }\r\n }\r\n scrollPos = elem.scrollTop;\r\n }\r\n }}\r\n >\r\n {cartProducts.map((product, index) => {\r\n let prodInBundles;\r\n let cookiePrice;\r\n let maxQuantityForBundle = 0;\r\n let shouldShowQuantityReachedErrorMsg = false;\r\n const cl = props.data.cart?.result?.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if (Array.isArray(productsAddedInBundles)) {\r\n prodInBundles = productsAddedInBundles.find(p => p['productId'] === product.RecordId);\r\n if (prodInBundles) {\r\n cookiePrice = prodInBundles['price'];\r\n maxQuantityForBundle = prodInBundles['maxQuantity'];\r\n if (!isSummaryInModal) {\r\n product.quantity = prodInBundles['quantity'];\r\n if (cl && cl.Quantity && product.quantity && maxQuantityForBundle) {\r\n shouldShowQuantityReachedErrorMsg = product.quantity + cl.Quantity > maxQuantityForBundle;\r\n }\r\n }\r\n }\r\n }\r\n if (maxQuantityForBundle <= 0) {\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const maxQuantities =\r\n cookies.get(\r\n props.config.isNotificationModal\r\n ? 'product_notification_maximum_available_quantities'\r\n : 'product_bundles_maximum_available_quantities'\r\n )?.value || [];\r\n if (Array.isArray(maxQuantities)) {\r\n for (const maxQ of maxQuantities) {\r\n if (maxQ.productId === product.RecordId) {\r\n maxQuantityForBundle = maxQ.maxQuantity;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (product.quantity && product.quantity >= maxQuantityForBundle) {\r\n shouldShowQuantityReachedErrorMsg = true;\r\n }\r\n const priceObj: ProductPrice = {\r\n BasePrice: product.BasePrice,\r\n AdjustedPrice: cookiePrice ? cookiePrice : product.Price,\r\n CustomerContextualPrice: cookiePrice ? cookiePrice : product.Price\r\n };\r\n totalPrice =\r\n totalPrice + (cookiePrice ? Number(cookiePrice) : product.Price) * (product.quantity ? product.quantity : 0);\r\n const imageSettings = {\r\n viewports: {\r\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\r\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n const baseImageUrl: string = props.context.request.apiSettings.baseImageUrl;\r\n
;\r\n const currQ = product.quantity;\r\n return (\r\n <>\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n

\r\n {product && product.Name}\r\n

\r\n \r\n {/*

Quantity: {product.quantity}

*/}\r\n

Quantity:

\r\n {\r\n onQuantityChange(\r\n props,\r\n product.RecordId,\r\n newVal,\r\n cartProducts,\r\n setCartProducts,\r\n isSummaryInModal,\r\n maxQuantityForBundle\r\n );\r\n }}\r\n hideQuantityControls={false}\r\n disabledInput={false}\r\n max={maxQuantityForBundle}\r\n min={1}\r\n />\r\n {shouldShowQuantityReachedErrorMsg &&

{maxQuantityReachedMsg}

}\r\n
\r\n
\r\n {\r\n if (!isSummaryInModal) {\r\n const cookies = props.context.actionContext.requestContext.cookies;\r\n const productsAddedInBundles =\r\n cookies.get(\r\n props.config.isNotificationModal\r\n ? 'notification_added_products'\r\n : 'added_products_bundles'\r\n )?.value || [];\r\n if (Array.isArray(productsAddedInBundles)) {\r\n for (let i = 0; i < productsAddedInBundles.length; i++) {\r\n if (productsAddedInBundles[i]['productId'] === product.RecordId) {\r\n delete productsAddedInBundles[i];\r\n }\r\n }\r\n const updatedProductsAddedInBundles: IDobbiesAddedProductToBundle[] = [];\r\n productsAddedInBundles.map(prod => {\r\n if (prod && prod['productId']) {\r\n const dobbiesProductData: IDobbiesAddedProductToBundle = {};\r\n dobbiesProductData.productId = prod['productId'];\r\n dobbiesProductData.quantity = prod['quantity'];\r\n dobbiesProductData.price = prod['price'];\r\n dobbiesProductData.maxQuantity = prod['maxQuantity'];\r\n updatedProductsAddedInBundles.push(dobbiesProductData);\r\n }\r\n });\r\n const cookieName = props.config.isNotificationModal\r\n ? 'notification_added_products'\r\n : 'added_products_bundles';\r\n cookies.set(cookieName, updatedProductsAddedInBundles);\r\n props.context.actionContext.update(new CartModulesStateShareInput(), {\r\n isCartUpdated: true\r\n });\r\n }\r\n return;\r\n }\r\n const cartlineToRemove = props.data.cart.result?.cart.CartLines?.find(\r\n cl => cl.ProductId === product.RecordId\r\n );\r\n if (cartlineToRemove) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n props.data.cart.result\r\n ?.removeCartLines(input)\r\n .then(() => {\r\n props.context.actionContext.update(new CartModulesStateShareInput(), {\r\n isCartUpdated: true\r\n });\r\n })\r\n .catch(error => {\r\n props.telemetry.warning(error);\r\n props.telemetry.debug('Unable to Remove Cart Line');\r\n });\r\n } else {\r\n props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\r\n }\r\n }}\r\n >\r\n
\r\n \r\n );\r\n })}\r\n \r\n\r\n {cartProducts && cartProducts.length > minProductsToScroll ? (\r\n {\r\n if (elem) {\r\n elem.scrollTop += rowHeight;\r\n if (isSummaryInModal) {\r\n setBundlesModalSummaryScrollPos(elem.scrollTop);\r\n } else {\r\n setBundlesSummaryScrollPos(elem.scrollTop);\r\n }\r\n }\r\n }}\r\n hidden={elem && scrollPos > (cartProducts.length - minProductsToScroll) * rowHeightForCalc ? true : false}\r\n >\r\n ) : (\r\n <>\r\n )}\r\n

\r\n {'Total price:'}\r\n \r\n {' '}\r\n {new Intl.NumberFormat('en-US', {\r\n style: 'currency',\r\n currencyDisplay: 'symbol',\r\n currency: 'GBP',\r\n minimumFractionDigits: 2\r\n }).format(totalPrice)}\r\n \r\n

\r\n \r\n );\r\n};\r\nconst _renderCarousel = (carouselContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\r\n return {items && items.map(_renderProduct)};\r\n};\r\n\r\nconst _renderGrid = (gridContainer: INodeProps, items: IProductComponentViewProps[]): JSX.Element => {\r\n return {items && items.map(_renderProduct)};\r\n};\r\n\r\nconst _renderProduct = (product: IProductComponentViewProps): JSX.Element => {\r\n const { ProductContainer, productComponent, addToCartButton } = product;\r\n\r\n return (\r\n \r\n {productComponent}\r\n {addToCartButton}\r\n \r\n );\r\n};\r\n\r\nexport default ProductCollectionView;\r\n","import { IActionContext } from '@msdyn365-commerce/core';\r\nimport { ProductAvailableQuantity, ProductSearchResult, ProductWarehouseInventoryAvailability } from '@msdyn365-commerce/retail-proxy';\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}\r\n/**\r\n * The function that maps a ProductWareHouse object into a ProductAvailabilityQuantity\r\n */\r\nexport const mapProductInventoryInformation = (\r\n ctx: IActionContext,\r\n productsWarehouseInventory: ProductWarehouseInventoryAvailability[],\r\n isPreSale?: string,\r\n dobbiesProductsData?: ProductSearchResult[]\r\n): IProductInventoryInformation[] => {\r\n const {\r\n requestContext: {\r\n app: {\r\n config: { enableStockCheck, inventoryLevel }\r\n }\r\n }\r\n } = ctx;\r\n\r\n const productInventoryInformation: IProductInventoryInformation[] = [];\r\n\r\n if (enableStockCheck === undefined || 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 const filteredProduct = dobbiesProductsData?.find(prod => prod.RecordId === product.ProductId);\r\n const presell = filteredProduct?.AttributeValues?.find(proAttr => proAttr.Name === \"PreSale\" && proAttr.TextValue === \"Yes\")\r\n const IsVendershipProduct = filteredProduct?.AttributeValues?.find(proAttr => proAttr.Name === \"IsVendershipProduct\" && proAttr.TextValue === \"No\")\r\n const FulfillmentType = filteredProduct?.AttributeValues?.find(proAttr => proAttr.Name === \"FulfillmentType\" && proAttr.TextValue !== \"Plants\")\r\n switch (isPreSale ? \"totalAvailable\" : (presell && IsVendershipProduct && FulfillmentType) ? \"totalAvailable\" : inventoryLevel) {\r\n case 'physicalAvailable':\r\n // Inventory level is enabled with Physical inventory\r\n const physicalProductMap = mapInventoryWithPhysicalBufferEnabled(ctx, product);\r\n if (physicalProductMap) {\r\n productInventoryInformation.push(physicalProductMap);\r\n }\r\n break;\r\n case 'totalAvailable':\r\n // Inventory level is enabled with Total available inventory\r\n const totalAvailableProductMap = mapInventoryWithTotalAvailableBufferEnabled(ctx, 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(ctx, product);\r\n if (productMap) {\r\n productInventoryInformation.push(productMap);\r\n }\r\n }\r\n }\r\n }\r\n return productInventoryInformation;\r\n};\r\n\r\nexport const mapInventoryWithThresholdEnabled = (\r\n ctx: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n) => {\r\n if (\r\n productWarehouseInventoryAvailability &&\r\n productWarehouseInventoryAvailability.ProductId &&\r\n productWarehouseInventoryAvailability.TotalAvailable !== undefined\r\n ) {\r\n const productQty = productWarehouseInventoryAvailability.TotalAvailable - ctx.requestContext.app.config.outOfStockThreshold;\r\n const productAvailableQuantity = {\r\n ProductId: productWarehouseInventoryAvailability.ProductId,\r\n AvailableQuantity: productQty > 0 ? productQty : 0\r\n };\r\n return {\r\n ProductAvailableQuantity: productAvailableQuantity,\r\n IsProductAvailable: productAvailableQuantity.AvailableQuantity && productAvailableQuantity.AvailableQuantity > 0 ? true : false,\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n return null;\r\n};\r\n\r\nexport const mapInventoryWithPhysicalBufferEnabled = (\r\n ctx: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n) => {\r\n const shouldRenderLabel = displayLabelEnabled(ctx, productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode);\r\n if (\r\n productWarehouseInventoryAvailability &&\r\n productWarehouseInventoryAvailability.ProductId &&\r\n productWarehouseInventoryAvailability.TotalAvailable !== undefined\r\n ) {\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 const productQuantity =\r\n productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode === 'OOS'\r\n ? 0\r\n : productWarehouseInventoryAvailability.PhysicalAvailable;\r\n const 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 return null;\r\n};\r\n\r\nexport const mapInventoryWithTotalAvailableBufferEnabled = (\r\n ctx: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n) => {\r\n const shouldRenderLabel = displayLabelEnabled(ctx, productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode);\r\n if (\r\n productWarehouseInventoryAvailability &&\r\n productWarehouseInventoryAvailability.ProductId &&\r\n productWarehouseInventoryAvailability.TotalAvailable !== undefined\r\n ) {\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 const productQuantity =\r\n productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode === 'OOS'\r\n ? 0\r\n : productWarehouseInventoryAvailability.TotalAvailable;\r\n const 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 IsProductAvailable: productAvailableQuantity.AvailableQuantity !== undefined && productAvailableQuantity.AvailableQuantity > 0,\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n return null;\r\n};\r\n\r\nexport const displayLabelEnabled = (ctx: IActionContext, inventoryCode: string | undefined) => {\r\n if (!inventoryCode) {\r\n return false;\r\n }\r\n switch (ctx.requestContext.app.config.inventoryRanges) {\r\n case 'lowAndOutofStock':\r\n if (inventoryCode !== 'AVAIL') {\r\n return true;\r\n }\r\n break;\r\n case 'outOfStock':\r\n if (inventoryCode === 'OOS') {\r\n return true;\r\n }\r\n break;\r\n case 'all':\r\n return true;\r\n default:\r\n return false;\r\n }\r\n return false;\r\n};\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['dobbies-product-collection'] = {\n c: () => require('partner/modules/dobbies-product-collection/dobbies-product-collection.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'cartSharedState', path:'actions/cart-state-share', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'plantPotsProductCountState', path:'actions/get-plant-pots-product-count', runOn: 0},{name:'wishlists', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'dobbies-product-collection',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/dobbies-product-collection'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\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 const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/cart-state-share';\n let dataAction = require('partner/actions/cart-state-share');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-plant-pots-product-count';\n let dataAction = require('partner/actions/get-plant-pots-product-count');\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__|modules|dobbies-product-collection|dobbies-product-collection'] = {\n c: () => require('partner/modules/dobbies-product-collection/dobbies-product-collection.view.tsx'),\n cn: '__local__-__local__-dobbies-product-collection'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["GetPlantPotsProductCountInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","async","sampleStateAction","input","ctx","potsProductCount","createObservableDataAction","action","inputData","layout","HeadingTag","ProductCollection","React","props","state","super","getActiveImageproductAction","context","actionContext","requestContext","cookies","this","cookienotificationValue","get","Array","isArray","value","activePoints","itemIds","map","activePointData","push","itemId","searchCriteriaInput","catalogId","getCatalogId","validateCatalogId","Context","ChannelId","apiSettings","channelId","CatalogId","IncludeAttributes","Ids","ArrayExtensions","hasElements","Error","products","searchByCriteriaAsync","callerContext","setState","checkDifference","array1","array2","length","i","RecordId","handleHeadingChange","event","config","heading","text","target","updateAddedProductsList","_cookies$get","addedProductsToCollection","isNotificationModal","addedProductsIds","obj","addedProductIdsToBundles","isProductBundles","request","telemetryPageName","update","CartModulesStateShareInput","isCartUpdated","getPDPProductMaxQ","onBundleProductCheckBoxSelected","productId","_this$props$data$cart","_this$state$pdpSearch","cl","data","cart","result","CartLines","find","c","ProductId","maxPDPQ","maxPDPQNumber","Number","pdpSearchResultProduct","Quantity","prod","p","_addItemToCart","toString","_updateCookiesForAddedProducts","_getPDPProduct","product","index","_this$props$data$feat","_this$props$data$wish","_this$props$data$cart4","_this$state$nonClubPl","_this$state$simplePro","Name","telemetry","trace","telemetryContent","getTelemetryObject","friendlyName","imageSettings","allowBackNavigation","addToCartButtonText","resources","breaCrumbType","app","breadcrumbType","allowBack","quickviewSlot","slots","quickview","reviewCountAriaLabelValue","TotalRatings","ratingCountAriaLabel","ratingCountAriaLabelSingleUser","isPriceMinMaxEnabled","featureState","console","log","productWithModes","_objectSpread","isCnC","isHomeDelivery","shouldNotShowAddToCartButton","includes","maxAvailableQ","isBundlesModal","_this$props$data$cart2","_this$props$data$cart3","className","ProductComponent","freePriceText","priceFree","originalPriceText","currentPriceText","ratingAriaLabel","id","typeName","quickViewButton","IsEnabled","showDeliveryIcons","wishlists","isProductAddedToBundles","maxQuantityForBundle","redirectToCartEnabled","redirectToCart","onQuantityChangeListener","isQuantityUpdated","cartSharedState","discountLine","discountLines","nonClubPlusDiscount","filter","item","simpleProduct","simpleProductObjs","sp","Button","title","onClick","_getAddToCart","_getProduct","_this$props$data$feat2","_this$props$data$wish2","_this$props$data$cart7","_this$state$nonClubPl2","_this$state$simplePro2","_this$props$data$cart5","_this$props$data$cart6","ProductContainer","tag","role","key","productComponent","getMaxAvailableQuantityForProduct","addToCartButton","newQuantity","currQuantityData","currQuantities","productFound","qd","_getProductAvailabilityNotification","validProducts","productData","queryResultSettings","allProducts","plantProducts","nonPlantProducts","_fulfillmentTypeAttri","fulfillmentTypeAttribute","AttributeValues","attribute","_attribute$Name","toLowerCase","TextValue","prodIds","plantProductIds","pp","nonPlantProductIds","npp","productAvailabilitesPlants","getEstimatedAvailabilityAsync","ProductIds","DefaultWarehouseOnly","FilterByChannelFulfillmentGroup","deliveryOptions","getDeliveryOptionsAsync","productsWithPlantsDelivery","Promise","all","idx","_prod$AttributeValues","_productAvailabilites","ProductWarehouseInventoryAvailabilities","_deliveryOptions$idx$","InventLocationId","PhysicalAvailableInventoryLevelCode","DeliveryOptions","option","Code","isVendorShipAttribute","trim","productAvailabilitesNonPlantsHD","productAvailabilitesNonPlantsCNC","totalProducts","_prod$AttributeValues2","AggregatedProductInventoryAvailabilities","stores","_deliveryOptions$idx$2","inventoryInformation","productsLength","_productAvailabilites2","_productAvailabilites3","_productAvailabilites4","_productAvailabilites5","concat","mapProductInventoryInformation","productCount","isSharedStateSet","_getProductAvailability","_fulfillmentTypeAttri2","_attribute$Name2","_prod$AttributeValues3","_productAvailabilites6","_deliveryOptions$idx$3","_prod$AttributeValues4","_deliveryOptions$idx$4","_productAvailabilites7","_productAvailabilites8","_productAvailabilites9","_productAvailabilites10","itemKey","catch","error","_cookies$get2","addedProducts","maxPDPQuantity","quantity","price","maxQuantity","productAddedAlready","ap","prodQD","_this$state$pdpSearch2","quantityToBeAdded","Price","BasePrice","_this$state$pdpSearch3","cookieName","set","_this$state$simplePro3","_product$Behavior","productInvInfo","inventory","ProductAvailableQuantity","AvailableQuantity","_getCartItemMaxQuantity","maxQuantityForCartLineItem","enableStockCheck","getOrderQuantityLimitsFeatureFlag","Behavior","MaximumQuantity","addedToCartSuccessMessage","addedToCartFailureMessage","productInventoryInformation","navigationUrl","Msdyn365","_cart$result","productList","_convertToSimpleProduct","_this$props$data$cart8","count","addProductsToCart","then","status","userMessage","statusCssString","messageGlyph","isOpen","e","_cart$result2","_this$props$data$cart9","_featureState$result","_this$props$context","_this$props$context$a","isOrderQuantityLimitsFeatureEnabledInHq","featuresState","isOrderQuantityLimitsFeatureEnabledInSiteSettings","platform","enableDefaultOrderQuantityLimits","isOrderQuantityLimitsFeatureEnabled","emailDeliveryModeCode","channel","EmailDeliveryModeCode","addProductToCartInput","availableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","isAddEmailDeliveryItemToCart","addProductToCart","window","location","assign","substatus","_await$cart$cart","curQuantity","maxQtyLimitReachedMessage","_getInventoryValueMessage","_result$errorDetails","errorDetails","LocalizedMessage","debug","warning","getNonClubPlusDiscountPrices","productRecIds","projectDomain","getActivePricesAsync","Date","activePricesResponse","updatedProducts","getProductsListWithKitProductsHandled","activePrice","_activePrice$Customer","CustomerContextualPrice","Math","max","TradeAgreementPrice","AdjustedPrice","productPricesforcookies","recordId","basePrice","_this$state$pdpSearch4","pdpProd","_activePrice$Customer2","_cookies$get3","pdpProductAlreadyAdded","message","exception","productCollection","productPrices","listType","componentDidMount","allowedRelationType","_this$state$listType","_productCollection$pr","res","maxQData","maxQ","maxQObj","reaction","_this$props$data$cart10","_this$props$data$cart11","splittedUrl","href","split","prodIdStrSplitted","prodId","getByIdAsync","resp","pdpProduct","MasterProductId","searchByCriteriaResp","searchByCriteriaItem","IsMasterProduct","getVariantsByDimensionValuesAsync","variants","_variant$PrimaryImage","variant","fallbackImageUrl","getFallbackImageUrl","ItemId","PrimaryImageUrl","getAllSimpleProducts","ex","componentDidUpdate","prevProps","prevState","snapshot","kitProductIds","kpId","_this$props$context$r","productCollectionProducts","pros","simpleProds","getByIdsAsync","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","_getNotificationModalProducts","_cookies$get4","addedToSummaryProducts","_this$state$simplePro4","miniCartProduct","render","isCarousel","carousel","headingComponent","editProps","onEdit","productCollectionViewProps","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","ProductCollectionContainer","moduleProps","classnames","GridComponentProps","itemInventorys","iv","IsProductAvailable","shouldShowAddAllProducts","undefined","pdpProductComponent","notificationModalProducts","renderView","_this$props$context2","defaultOrderQuantityLimitsFeatureConfig","_featureStatuses$find","featureStatuses","customerInfo","customerInformation","IsB2b","response","maxQuantityLimitText","maxQuantityForLineItem","replace","minInventory","min","setCookie","name","deltaDaysFromToday","expirationDate","now","setTime","getTime","expires","isEssential","onQuantityChange","newValue","cartProducts","setCartProducts","isSummaryInModal","_cartState$cart$CartL","cartState","getCartState","maxQuantities","_props$context$action","diffInQuantity","cartLineQuantityUpdatedAsync","cartActionResult","changeQinBundlesModalSummary","cartProductsCopy","cp","valueToBeUpdated","_renderCartLines","bundlesSummaryScrollPos","setBundlesSummaryScrollPos","bundlesModalSummaryScrollPos","setBundlesModalSummaryScrollPos","totalPrice","productsAddedInBundles","elemId","elem","MsDyn365","isBrowser","document","getElementById","minProductsToScroll","innerWidth","upArrowId","downArrowId","scrollPos","maxQuantityReachedMsg","maxQuantityReachedInBundlesmsg","_props$data$cart$resu9","_props$data$cart$resu10","_props$data$cart$resu8","_props$data$cart$resu11","scrollTop","hidden","onScroll","abs","ceil","upArrow","downArrow","_props$data$cart","prodInBundles","cookiePrice","shouldShowQuantityReachedErrorMsg","_cookies$get5","priceObj","baseImageUrl","currQ","src","fallBackSrc","altText","gridSettings","viewports","xs","q","w","h","sm","lg","lazyload","loadFailureBehavior","PriceComponent","savingsText","updatedPrice","getTierId","clubPlusDiscountsOfferId","currentCount","onChange","newVal","hideQuantityControls","disabledInput","_props$data$cart$resu12","_cookies$get6","updatedProductsAddedInBundles","dobbiesProductData","cartlineToRemove","_props$data$cart$resu13","cartLineIds","LineId","removeCartLines","Intl","NumberFormat","style","currencyDisplay","currency","minimumFractionDigits","format","_renderCarousel","carouselContainer","items","Node","Object","_renderProduct","_renderGrid","gridContainer","_props$data$cart$resu4","_props$data$cartShare2","updateCartProduct","_props$data$cart$resu","_props$data$cart$resu2","productIds","cartline","productBundleProducts","updatedProductIds","prodBP","simpleProductsWithQuantities","validValues","_props$data$cart$resu3","prodWithQuantity","simpleProdIds","cartProductIds","cartProd","b","a","every","v","needsUpdate","pIds","updatedSimpleProductsWithQuantities","itemInventory","equalsCheck","_props$data$cart$resu5","_props$data$cart$resu6","_props$data$cart$resu7","_props$data$cartShare","Module","addAllProductsOnClick","disabled","notifiCheck","user","isAuthenticated","discountAppliedInCartMessage","productsWarehouseInventory","isPreSale","dobbiesProductsData","inventoryLevel","_filteredProduct$Attr","_filteredProduct$Attr2","_filteredProduct$Attr3","filteredProduct","presell","proAttr","IsVendershipProduct","FulfillmentType","physicalProductMap","mapInventoryWithPhysicalBufferEnabled","totalAvailableProductMap","mapInventoryWithTotalAvailableBufferEnabled","productMap","mapInventoryWithThresholdEnabled","productWarehouseInventoryAvailability","TotalAvailable","productQty","outOfStockThreshold","productAvailableQuantity","shouldRenderLabel","displayLabelEnabled","productQuantity","PhysicalAvailable","StockLevelCode","StockLevelLabel","PhysicalAvailableInventoryLevelLabel","TotalAvailableInventoryLevelCode","TotalAvailableInventoryLevelLabel","inventoryCode","inventoryRanges","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","require","$type","da","path","runOn","iNM","ns","n","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}