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.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}\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 { ArrayExtensions, IProductInventoryInformation } 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} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductSearchCriteria, SimpleProduct } 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\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}\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 }\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) {\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 this.setState({ pdpSearchResultProduct: searchByCriteriaItem });\r\n void this.getNonClubPlusDiscountPrices();\r\n void this.getAllSimpleProducts();\r\n }\r\n })\r\n .catch(e => {});\r\n })\r\n .catch(ex => {});\r\n }\r\n }\r\n }\r\n\r\n private async getAllSimpleProducts(): Promise {\r\n const products = this.props.config.productCollection && this.props.config.productCollection.products;\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 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 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 itemInventory = 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 .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 };\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 = cookies.get('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 };\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 // 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 // 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 };\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 productAvailabilitesPlants = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: prodIds, DefaultWarehouseOnly: false, FilterByChannelFulfillmentGroup: true }\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') {\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 // Not Plants API since the warehouse storage is different\r\n const productAvailabilitesNonPlantsHD = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: prodIds, DefaultWarehouseOnly: true, FilterByChannelFulfillmentGroup: false }\r\n );\r\n const productAvailabilitesNonPlantsCNC = await getEstimatedAvailabilityAsync(\r\n { callerContext: actionContext },\r\n { ProductIds: prodIds, DefaultWarehouseOnly: false, FilterByChannelFulfillmentGroup: true }\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 if (plantProducts.length > 0) {\r\n const inventoryInformation = mapProductInventoryInformation(\r\n actionContext,\r\n productAvailabilitesPlants?.ProductWarehouseInventoryAvailabilities ?? []\r\n );\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 } else if (nonPlantProducts.length > 0) {\r\n const inventoryInformation = mapProductInventoryInformation(\r\n actionContext,\r\n productAvailabilitesNonPlantsHD?.ProductWarehouseInventoryAvailabilities ?? []\r\n );\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 };\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 = cookies.get('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 cookies.set('added_products_bundles', addedProducts);\r\n this.props.context.actionContext.update(new CartModulesStateShareInput(), { isCartUpdated: true });\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) {\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 (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 !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((activePricesResponse: ProductPrice[]) => {\r\n if (activePricesResponse && activePricesResponse.length > 0) {\r\n this.setState({\r\n nonClubPlusDiscount: activePricesResponse\r\n });\r\n\r\n const updatedProducts = this.state.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 if (updatedProducts) {\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 = cookies.get('added_products_bundles')?.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 } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IProductCollectionViewProps, IProductComponentViewProps } from './dobbies-product-collection';\r\n\r\nconst ProductCollectionView: React.FC = props => {\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 if (products) {\r\n 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 _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","handleHeadingChange","event","this","config","heading","text","target","value","updateAddedProductsList","_cookies$get","addedProductsToCollection","context","actionContext","requestContext","cookies","get","addedProductsIds","Array","isArray","obj","push","setState","addedProductIdsToBundles","getPDPProductMaxQ","onBundleProductCheckBoxSelected","productId","_this$props$data$cart","_this$state$pdpSearch","cl","data","cart","result","CartLines","find","c","ProductId","maxPDPQ","maxPDPQNumber","Number","pdpSearchResultProduct","RecordId","Quantity","prod","products","p","_addItemToCart","toString","_updateCookiesForAddedProducts","_getPDPProduct","product","index","_this$props$data$feat","_this$props$data$wish","_this$props$data$cart3","_this$state$nonClubPl","_this$state$simplePro","Name","telemetry","trace","telemetryContent","getTelemetryObject","request","telemetryPageName","friendlyName","imageSettings","allowBackNavigation","addToCartButtonText","resources","breaCrumbType","app","breadcrumbType","allowBack","quickviewSlot","slots","quickview","length","reviewCountAriaLabelValue","TotalRatings","ratingCountAriaLabel","ratingCountAriaLabelSingleUser","isPriceMinMaxEnabled","featureState","console","log","productWithModes","_objectSpread","isCnC","isHomeDelivery","shouldNotShowAddToCartButton","isProductBundles","includes","maxAvailableQ","isBundlesModal","_this$props$data$cart2","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$cart5","_this$state$nonClubPl2","_this$state$simplePro2","_this$props$data$cart4","ProductContainer","tag","role","key","productComponent","getMaxAvailableQuantityForProduct","addToCartButton","newQuantity","currQuantityData","currQuantities","productFound","qd","_getProductAvailability","validProducts","callerContext","apiSettings","channelId","catalogId","searchCriteriaInput","Context","ChannelId","CatalogId","Ids","IncludeAttributes","productData","searchByCriteriaAsync","queryResultSettings","allProducts","plantProducts","nonPlantProducts","map","_fulfillmentTypeAttri","fulfillmentTypeAttribute","AttributeValues","attribute","_attribute$Name","toLowerCase","TextValue","prodIds","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","_productAvailabilites2","inventoryInformation","mapProductInventoryInformation","productCount","isSharedStateSet","update","_productAvailabilites3","itemKey","catch","error","_cookies$get2","addedProducts","maxPDPQuantity","quantity","price","maxQuantity","productAddedAlready","ap","prodQD","_this$state$pdpSearch2","quantityToBeAdded","Price","BasePrice","_this$state$pdpSearch3","set","CartModulesStateShareInput","isCartUpdated","_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$cart6","count","addProductsToCart","then","status","userMessage","statusCssString","messageGlyph","isOpen","e","_featureState$result","_this$props$context","_this$props$context$a","isOrderQuantityLimitsFeatureEnabledInHq","featuresState","isOrderQuantityLimitsFeatureEnabledInSiteSettings","platform","enableDefaultOrderQuantityLimits","isOrderQuantityLimitsFeatureEnabled","emailDeliveryModeCode","channel","EmailDeliveryModeCode","addProductToCartInput","availableQuantity","additionalProperties","orderQuantityLimitsFeatureIsEnabled","isAddEmailDeliveryItemToCart","ArrayExtensions","hasElements","addProductToCart","window","location","assign","substatus","_await$cart$cart","curQuantity","maxQtyLimitReachedMessage","_getInventoryValueMessage","_result$errorDetails","errorDetails","LocalizedMessage","debug","warning","getNonClubPlusDiscountPrices","productRecIds","projectDomain","getActivePricesAsync","Date","activePricesResponse","_this$state$products","updatedProducts","activePrice","_activePrice$Customer","CustomerContextualPrice","Math","max","TradeAgreementPrice","AdjustedPrice","_this$state$pdpSearch4","pdpProd","_activePrice$Customer2","_cookies$get3","pdpProductAlreadyAdded","message","exception","Error","productCollection","productPrices","listType","componentDidMount","allowedRelationType","_this$state$listType","_productCollection$pr","res","maxQData","maxQ","maxQObj","reaction","_this$props$data$cart7","_this$props$data$cart8","splittedUrl","href","split","prodIdStrSplitted","prodId","getByIdAsync","resp","pdpProduct","MasterProductId","searchByCriteriaResp","searchByCriteriaItem","getAllSimpleProducts","ex","_this$props$context$r","simpleProds","getByIdsAsync","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","render","isCarousel","carousel","headingComponent","editProps","onEdit","productCollectionViewProps","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","ProductCollectionContainer","moduleProps","classnames","GridComponentProps","itemInventory","IsProductAvailable","shouldShowAddAllProducts","undefined","pdpProductComponent","renderView","_this$props$context2","defaultOrderQuantityLimitsFeatureConfig","_featureStatuses$find","featureStatuses","customerInfo","customerInformation","IsB2b","response","maxQuantityLimitText","maxQuantityForLineItem","replace","minInventory","min","_renderCarousel","carouselContainer","items","Node","Object","_renderProduct","_renderGrid","gridContainer","Module","addAllProductsOnClick","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","name","path","runOn","iNM","ns","n","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}