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EAAGC,YAAa,CAAC,GAwCxCF,EAAQC,QAAQ,4BAA8B,CAC3CE,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,kBACPC,GAAI,CAAC,CAACvE,KAAK,eAAiBwE,KAAK,uEAAwEC,MAAO,IAEhHC,KAAK,EACLC,GAAI,YACJC,EAAG,2BACHjV,EAAG,YAEHkV,IAAK,GAGLC,GAAI,wCAlC4BC,EAACC,EAAqBC,KAUlD,GADAhB,EAAQE,YAAYa,GAAuBC,GACtChB,EAAQE,YAAYa,GAAqBE,QAC1C,MAAM,IAAIC,MAAM,oBAAsBH,EAAsB,mCAEhEf,EAAQE,YAAYa,GAAqBE,QAAQE,UAAUC,eAAiBL,EACxEf,EAAQE,YAAYa,GAAqBE,QAAQE,UAAU9U,KAC3D2T,EAAQE,YAAYF,EAAQE,YAAYa,GAAqBE,QAAQE,UAAU9U,IAAM0U,EAE7F,EAwBID,CAF4B,uEACXV,EAAQ,KAMjCiB,OAAOC,aAAeD,OAAOC,cAAgB,CAAC,EAC9CD,OAAOC,aAAarB,QAAOnM,EAAAA,EAAA,GACpBuN,OAAOC,aAAarB,SAAW,CAAC,GAChCD,EAAQC,SAGXoB,OAAOC,aAAapB,YAAWpM,EAAAA,EAAA,GAC5BuN,OAAOC,aAAapB,aAAe,CAAC,GACpCF,EAAQE,aAEY,MAAMqB,EAAiB,CAAC,EAC/BA,EAAe,iFAAmF,CAC1GpB,EAAGA,IAAMC,EAAQ,MACjBoB,GAAI,gDAEpBH,OAAOC,aAAeD,OAAOC,cAAgB,CAAC,EAC9CD,OAAOC,aAAaC,eAAczN,EAAAA,EAAA,GACPuN,OAAOC,aAAaC,gBAAkB,CAAC,GACvCA,UCnF3BE,EAAOC,QAAUxY,cCAjBuY,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/eshop-product-collection/eshop-product-collection.props.autogenerated.ts?5002","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-product-collection/eshop-product-collection.tsx?2bd5","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-product-collection/eshop-product-collection.view.tsx?430a","webpack://Msdyn365.Commerce.Online/./src/modules/eshop-search-result-container/components/eshop-product-component.tsx?07f0","webpack://Msdyn365.Commerce.Online/./lib/eshop-product-collection/module-registration.js?55dd","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IEshopProductCollection 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 IEshopProductCollectionConfig extends Msdyn365.IModuleConfig {\r\n productCollection: Msdyn365.IProductList;\r\n heading?: IHeadingData;\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}\r\n\r\nexport interface IEshopProductCollectionResources {\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}\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 IEshopProductCollectionProps extends Msdyn365.IModule {\r\n resources: IEshopProductCollectionResources;\r\n config: IEshopProductCollectionConfig;\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\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\r\nimport { IPriceComponentResources } from '@msdyn365-commerce/components';\r\nimport { ProductComponent } from '../eshop-search-result-container/components/eshop-product-component';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getCatalogId, ICoreContext } from '@msdyn365-commerce/core';\r\nimport { ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { getByIdsAsync, getEstimatedAvailabilityAsync, getDimensionValuesWithEstimatedAvailabilitiesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n ArrayExtensions,\r\n DimensionAvailabilitiesForProductSearchResultInput,\r\n DimensionTypes,\r\n DimensionSwatchDisplayTypes,\r\n getDimensionAvailabilitiesForProductSearchResultAction,\r\n getPriceForProductSearchResult,\r\n IDimensionsApp,\r\n ObjectExtensions,\r\n PriceForProductSearchResultInput,\r\n DeliveryMode,\r\n createInventoryAvailabilitySearchCriteria,\r\n mapAggregatedProductInventoryInformation\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 classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { IEshopProductCollectionData } from './eshop-product-collection.data';\r\nimport { IEshopProductCollectionProps, layout } from './eshop-product-collection.props.autogenerated';\r\n\r\nexport interface IProductCollectionViewProps extends IEshopProductCollectionProps {\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 seeAllButton?: React.ReactNode;\r\n}\r\n\r\nexport interface IProductComponentViewProps {\r\n ProductContainer: INodeProps;\r\n productComponent: React.ReactNode;\r\n}\r\n\r\nexport interface IProductAvailabilityLabel {\r\n id: number;\r\n label: string;\r\n}\r\n\r\nexport interface IProductComponentState {\r\n products: ProductSearchResult[];\r\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\r\n productsLabel?: IProductAvailabilityLabel[];\r\n}\r\n\r\n/**\r\n * ProductCollection component.\r\n */\r\nclass ProductCollection extends React.PureComponent, IProductComponentState> {\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly productPrices: ProductPrice[];\r\n\r\n constructor(props: IEshopProductCollectionProps) {\r\n super(props);\r\n this.productPrices = [];\r\n this.state = {\r\n products: this.props.config.productCollection.products || []\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\r\n public async componentDidMount(): Promise {\r\n if (this.props.config.enableAffiliationBasedPricing && this.props.context.actionContext.requestContext.user.isAuthenticated) {\r\n await this._getActivePrice();\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { heading, className, shouldDisplaySeeAllButton } = this.props.config;\r\n const { resources } = this.props;\r\n const recommendation = this.props.config.productCollection.recommendationListId;\r\n\r\n // Initialize state in case if the products were not found during initial module render\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Initialize data if not there.\r\n this.initProductState(this.props.config.productCollection);\r\n\r\n const products = this.state.products;\r\n const isCarousel = this.props.config.layout === layout.carousel;\r\n const headingLabel = heading ? heading.text : '';\r\n const headingComponent = heading && (\r\n \r\n );\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- product check for safety.\r\n const updatedProducts = products?.map((item: ProductSearchResult, index: number) => {\r\n const getProductData = this._getProduct(item, index);\r\n return !ObjectExtensions.isNullOrUndefined(getProductData) ? getProductData : undefined;\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: `${headingLabel} ${resources.flipperPrevious}`,\r\n flipperNextLabel: `${headingLabel} ${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', className)\r\n },\r\n GridComponentProps: {\r\n tag: 'ul' as NodeTag,\r\n className: 'ms-product-collection__items'\r\n },\r\n isCarousel,\r\n\r\n products:\r\n ArrayExtensions.hasElements(updatedProducts) &&\r\n updatedProducts.filter(item => {\r\n return item !== undefined;\r\n }),\r\n productPrices: this.productPrices,\r\n seeAllButton:\r\n recommendation && shouldDisplaySeeAllButton && ArrayExtensions.hasElements(updatedProducts)\r\n ? this._getSeeAllButton(recommendation, headingLabel)\r\n : undefined\r\n };\r\n return this.props.renderView(productCollectionViewProps) as React.ReactElement;\r\n }\r\n\r\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\r\n\r\n /**\r\n * Get products dimension availabilities.\r\n * @param products - Products.\r\n * @returns Promise.\r\n */\r\n private readonly _getProductsDimensionsAvailabilities = async (products: ProductSearchResult[]): Promise => {\r\n const context = this.props.context as ICoreContext;\r\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\r\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\r\n const validProducts = ArrayExtensions.validValues(products);\r\n if (\r\n ArrayExtensions.hasElements(validProducts) &&\r\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\r\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none)\r\n ) {\r\n const productsDimensionAvailabilities = await getDimensionAvailabilitiesForProductSearchResultAction(\r\n new DimensionAvailabilitiesForProductSearchResultInput(\r\n validProducts,\r\n this.props.context as ICoreContext,\r\n DimensionSwatchDisplayTypes.productCard\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (ArrayExtensions.hasElements(productsDimensionAvailabilities)) {\r\n this.setState({ productsDimensionAvailabilities });\r\n }\r\n }\r\n };\r\n\r\n private readonly _getProductsInventory = async (products: ProductSearchResult[]): Promise => {\r\n let productsLabel: IProductAvailabilityLabel[] = [];\r\n const context = this.props.context.actionContext;\r\n const shippingSearchCriteria = createInventoryAvailabilitySearchCriteria(context, products.map(p => p.RecordId), true, undefined, undefined, DeliveryMode.shipping);\r\n\r\n const shippingAvailability = await getEstimatedAvailabilityAsync({ callerContext: context }, shippingSearchCriteria);\r\n if (shippingAvailability.ProductWarehouseInventoryAvailabilities) {\r\n const productsInventory = mapAggregatedProductInventoryInformation(context, shippingAvailability);\r\n productsLabel = productsInventory.map(i => ({id: i.ProductAvailableQuantity.ProductId, label: i.StockLevelLabel === 'Available' ? '' : 'Out of stock'} as IProductAvailabilityLabel));\r\n }\r\n\r\n const simpleProducts = await getByIdsAsync({ callerContext: context }, context.requestContext.apiSettings.channelId, products.map(p => p.RecordId));\r\n for (const simpleProduct of simpleProducts) {\r\n const dimensionCount = simpleProduct.Dimensions?.length ?? 0;\r\n if (dimensionCount > 0) {\r\n const dimensionInventory = await getDimensionValuesWithEstimatedAvailabilitiesAsync({ callerContext: context }, simpleProduct.RecordId, {\r\n RequestedDimensionTypeValues: simpleProduct.Dimensions?.map(d => d.DimensionTypeValue), \r\n DefaultWarehouseOnly: shippingSearchCriteria.DefaultWarehouseOnly,\r\n FilterByChannelFulfillmentGroup: shippingSearchCriteria.FilterByChannelFulfillmentGroup,\r\n DeliveryModeTypeFilterValue: shippingSearchCriteria.DeliveryModeTypeFilterValue,\r\n });\r\n const isAvailable = dimensionInventory.filter(i => i.PhysicalAvailableInventoryLevelLabel === 'Available').length > 0;\r\n const product = productsLabel.find(p => p.id === simpleProduct.RecordId);\r\n if (product) {\r\n product.label = isAvailable ? '' : 'Out of stock';\r\n }\r\n }\r\n }\r\n this.setState({ productsLabel });\r\n }\r\n\r\n /**\r\n * Helper method to initialize products state.\r\n * @param productCollection - List of products.\r\n */\r\n private readonly initProductState = async (productCollection: Msdyn365.IProductList) => {\r\n let products = this.state.products;\r\n const productCollectionProducts = productCollection.products;\r\n if (!ArrayExtensions.hasElements(products) && ArrayExtensions.hasElements(productCollectionProducts)) {\r\n products = productCollectionProducts;\r\n this.setState({ products });\r\n } else if (\r\n ArrayExtensions.hasElements(products) &&\r\n ArrayExtensions.hasElements(productCollectionProducts) &&\r\n !ArrayExtensions.equals(products, productCollectionProducts)\r\n ) {\r\n products = productCollectionProducts;\r\n this.setState({ products });\r\n } else if (productCollectionProducts === undefined && ArrayExtensions.hasElements(this.state.products)) {\r\n products = [];\r\n this.setState({ products: products });\r\n }\r\n\r\n if (Msdyn365.msdyn365Commerce.isBrowser && !ArrayExtensions.hasElements(this.state.productsDimensionAvailabilities)) {\r\n await this._getProductsDimensionsAvailabilities(products);\r\n }\r\n\r\n await this._getProductsInventory(products);\r\n };\r\n\r\n private readonly _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 resources = 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 quickviewSlot =\r\n this.props.slots && this.props.slots.quickview && this.props.slots.quickview.length > 0 ? this.props.slots.quickview[0] : null;\r\n\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 const priceResources: IPriceComponentResources = {\r\n priceRangeSeparator: resources.priceRangeSeparator\r\n };\r\n\r\n let inventoryLabel = '';\r\n if (this.state.productsLabel) {\r\n inventoryLabel = this.state.productsLabel.find(p => p.id === product.RecordId)?.label ?? '';\r\n }\r\n\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 \r\n ArrayExtensions.hasElements(dimensionAvailability) &&\r\n dimensionAvailability[0].masterProductId === (product.MasterProductId ?? product.RecordId)\r\n )}\r\n />\r\n )\r\n };\r\n };\r\n\r\n /**\r\n * Get the active price for products.\r\n */\r\n private readonly _getActivePrice = async (): Promise => {\r\n const productsList = this.state.products;\r\n const products = await getPriceForProductSearchResult(\r\n new PriceForProductSearchResultInput(productsList),\r\n this.props.context.actionContext\r\n );\r\n if (Msdyn365.msdyn365Commerce.isBrowser) {\r\n await this._getProductsDimensionsAvailabilities(products);\r\n }\r\n\r\n this.setState({ products });\r\n };\r\n\r\n /**\r\n * Get the see all button.\r\n * @param recommendation - Recommendation.\r\n * @param headingLabel - Heading label.\r\n * @returns IProductComponentSeeAllViewProps - Product component see all view props.\r\n */\r\n private readonly _getSeeAllButton = (recommendation: string, headingLabel: string): React.ReactNode => {\r\n const catalogId = getCatalogId(this.props.context.request);\r\n const seeAllLink = `/search?recommendation=${recommendation}&title=${headingLabel}&catalogid=${catalogId}`;\r\n return (\r\n \r\n {this.props.resources.seeAllButtonText}\r\n \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 './eshop-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 seeAllButton\r\n } = props;\r\n\r\n if (products) {\r\n return (\r\n \r\n {heading}\r\n {seeAllButton}\r\n {isCarousel ? _renderCarousel(SingleSlideCarouselComponentProps, products) : _renderGrid(GridComponentProps, products)}\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 } = product;\r\n\r\n return {productComponent};\r\n};\r\n\r\nexport default ProductCollectionView;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n IComponent, IComponentProps, ICoreContext, IGridSettings,\r\n IImageData, IImageProps, IImageSettings, Image, IRequestContext, msdyn365Commerce\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeSwatch, ProductDimension, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions, checkIfShouldDisplayAsSwatch, convertDimensionTypeToProductDimensionType,\r\n Dictionary,\r\n DimensionSwatchDisplayTypes, DimensionTypes, generateImageUrl,\r\n getProductPageUrlSync,IDimensionsApp, StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useState } from 'react';\r\n\r\nimport { IPriceComponentResources, PriceComponent, ISwatchItem, RatingComponent, ProductComponentSwatchComponent } from '@msdyn365-commerce/components';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n ratingCountAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n inventoryLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\r\n swatchItemAriaLabel?: string;\r\n eShopPdpUrl?:Msdyn365.ILinkData;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent { }\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst ProductCard: React.FC = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n ratingCountAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n inventoryLabel,\r\n isPriceMinMaxEnabled,\r\n priceResources,\r\n dimensionAvailabilities,\r\n swatchItemAriaLabel,\r\n eShopPdpUrl\r\n}) => {\r\n const product = data.product;\r\n\r\n /**\r\n * Updates the product url link to product details page.\r\n * @param productDetailsPageUrl - Product page url.\r\n * @param coreContext - Context of the module using the component.\r\n * @param queryString - Querystring to be added to the URL.\r\n * @returns The update product page url.\r\n */\r\n function updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\r\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\r\n if (sourceUrl.search) {\r\n sourceUrl.search += `&${queryString}`;\r\n } else {\r\n sourceUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(sourceUrl.href);\r\n return updatedUrl.pathname + sourceUrl.search;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param productData - Product card to be rendered.\r\n * @returns The default color swatch selected if any.\r\n */\r\n function getDefaultColorSwatchSelected(productData?: ProductSearchResult): AttributeSwatch | null {\r\n if (!productData || !productData.AttributeValues) {\r\n return null;\r\n }\r\n\r\n const colorAttribute = productData.AttributeValues.find(attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color);\r\n if (!ArrayExtensions.hasElements(colorAttribute?.Swatches)) {\r\n return null;\r\n }\r\n\r\n const defaultSwatch = colorAttribute!.Swatches.find(item => item.IsDefault === true) ?? colorAttribute!.Swatches[0];\r\n return defaultSwatch;\r\n }\r\n\r\n /**\r\n * Gets the product image from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\r\n const siteContext = coreContext as ICoreContext;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\r\n return productData?.PrimaryImageUrl;\r\n }\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.ProductImageUrls) ? generateImageUrl(\r\n defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings) : productData?.PrimaryImageUrl;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productUrl - Product page url for the product card.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductPageUrlFromDefaultSwatch(coreContext: ICoreContext, productUrl: string, productData?: ProductSearchResult): string | undefined {\r\n const siteContext = coreContext as ICoreContext;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\r\n return productUrl;\r\n }\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n if (!defaultSwatch || !defaultSwatch.SwatchValue) {\r\n return productUrl;\r\n }\r\n\r\n const queryString = `color=${defaultSwatch.SwatchValue}`;\r\n return updateProductUrl(productUrl, coreContext, queryString);\r\n }\r\n\r\n let productUrl = product ? getProductPageUrlSync(product.Name ?? '', product.RecordId, context.actionContext, undefined) : '';\r\n // let productUrl = product ? eShopPdpUrl? eShopPdpUrl.destinationUrl+`${'?productId=' + product.RecordId }`:\"/ecomm/eshop?productId=\"+ product.RecordId : '';\r\n if (allowBack && productUrl) {\r\n productUrl = updateProductUrl(productUrl, context, 'back=true');\r\n }\r\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.PrimaryImageUrl;\r\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\r\n const [productPageUrl, setProductPageUrl] = useState(productPageUrlFromSwatch);\r\n const [productImageUrl, setProductImageUrl] = useState(productImageUrlFromSwatch);\r\n const [selectedSwatchItems] = useState(new Dictionary());\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\r\n const enableStockCheck = context.app.config.enableStockCheck;\r\n\r\n /**\r\n * Updates the product page and Image url based on swatch selected.\r\n * @param coreContext - Context of the caller.\r\n * @param swatchItem - Dimension swatch selected.\r\n */\r\n const updatePageAndImageUrl = React.useCallback((coreContext: ICoreContext, swatchItem: ISwatchItem) => {\r\n const dimensionType = swatchItem.dimensionType;\r\n selectedSwatchItems.setValue(dimensionType, swatchItem);\r\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\r\n return;\r\n }\r\n const queryString = `${dimensionType}=${swatchItem.value}`;\r\n let productPageUrlWithSwatch = '';\r\n if (productPageUrl.includes(dimensionType)) {\r\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\r\n newUrl.searchParams.delete(dimensionType);\r\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\r\n } else {\r\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\r\n }\r\n setProductPageUrl(productPageUrlWithSwatch);\r\n if (dimensionType === DimensionTypes.color) {\r\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls) ? swatchItem.productImageUrls[0] : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n }, [selectedSwatchItems, context, productPageUrl]);\r\n\r\n if (!product) {\r\n return null;\r\n }\r\n \r\n const swatchItems = ArrayExtensions.validValues(product.AttributeValues?.map(item => {\r\n const dimensionTypeValue = \"size\";//item.KeyName?.toLocaleLowerCase() ?? '';\r\n const shouldDisplayAsSwatch = checkIfShouldDisplayAsSwatch(\r\n dimensionTypeValue as DimensionTypes,\r\n context as ICoreContext,\r\n DimensionSwatchDisplayTypes.productCard);\r\n \r\n if (!shouldDisplayAsSwatch) {\r\n return null;\r\n }\r\n\r\n const siteContext = context as ICoreContext;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n const dimensionType = dimensionTypeValue as DimensionTypes;\r\n const swatches = item.Swatches?.map(swatchItem => {\r\n return {\r\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\r\n value: swatchItem.SwatchValue ?? '',\r\n dimensionType,\r\n colorHexCode: swatchItem.SwatchColorHexCode,\r\n imageUrl: swatchItem.SwatchImageUrl,\r\n productImageUrls: swatchItem.ProductImageUrls,\r\n isDefault: swatchItem.IsDefault,\r\n swatchItemAriaLabel: swatchItemAriaLabel ? format(swatchItemAriaLabel, dimensionType) : '',\r\n isDisabled: enableStockCheck && dimensionAvailabilities?.find(\r\n dimensionAvailability => dimensionAvailability.value === (swatchItem.SwatchValue ?? ''))?.isDisabled\r\n };\r\n }) ?? [];\r\n if (dimensionToPreSelectInProductCard !== DimensionTypes.none && ArrayExtensions.hasElements(swatches) &&\r\n !swatches.some(swatch => swatch.isDefault) && dimensionType === DimensionTypes.color) {\r\n swatches[0].isDefault = true;\r\n }\r\n return { recordId: item.RecordId, swatches };\r\n }));\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\r\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\r\n\r\n if (!unitOfMeasure) {\r\n return null;\r\n }\r\n return (\r\n
\r\n \r\n {unitOfMeasure}\r\n \r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product availability.\r\n * @param inventoryAvailabilityLabel - The product information.\r\n * @returns The node representing markup for product availability.\r\n */\r\n function renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\r\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n \r\n {inventoryAvailabilityLabel}\r\n \r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product dimension as swatch.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductDimensions(): JSX.Element | null {\r\n if (!ArrayExtensions.hasElements(swatchItems)) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n {\r\n swatchItems.map(item => {\r\n return (\r\n \r\n );\r\n })\r\n }\r\n
\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param quickview - Quick view node.\r\n * @param item - Product id to de displayed in quickview.\r\n * @returns The product quickview component.\r\n */\r\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n const selectedDimensions: ProductDimension[] = selectedSwatchItems.getValues().map(swatches => {\r\n return {\r\n DimensionTypeValue: convertDimensionTypeToProductDimensionType(swatches.dimensionType),\r\n DimensionValue: {\r\n RecordId: 0,\r\n Value: swatches.value\r\n }\r\n };\r\n });\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item, selectedDimensions });\r\n }\r\n\r\n /**\r\n * Gets the aria label for rating.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Aria label format for rating.\r\n * @returns The product rating aria label string.\r\n */\r\n function getRatingAriaLabel(rating?: number, ratingAriaLabelText?: string): string {\r\n if (rating && ratingAriaLabelText) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabelText || '', roundedRating, '5');\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label for review count.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Aria label format for review.\r\n * @returns The product review count aria label string.\r\n */\r\n function getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\r\n if (reviewCount && ratingCountAriaLabelText) {\r\n return format(ratingCountAriaLabelText || '', reviewCount);\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label string for product that includes product name with its price and rating.\r\n * @param name - Product name.\r\n * @param price - Product price.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Rating aria label text.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Number of ratings.\r\n * @returns The aria label string for the product card.\r\n */\r\n function renderLabel(\r\n name?: string,\r\n price?: string,\r\n rating?: number,\r\n ratingAriaLabelText?: string,\r\n reviewCount?: number,\r\n ratingCountAriaLabelText?: string): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return (\r\n `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${reviewCountArialableText ? ` ${reviewCountArialableText}` : ''}`\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param productCardimageSettings - Module image settings for product card.\r\n * @param gridSettings - Grid settings defined in theme.\r\n * @param imageUrl - Image url.\r\n * @param fallbackImageUrl - Fallback url for imge.\r\n * @param altText - Image Alt text.\r\n * @param requestContext - Request context using the component.\r\n * @returns React component for product image.\r\n */\r\n function renderProductPlacementImage(\r\n productCardimageSettings?: IImageSettings, gridSettings?: IGridSettings,\r\n imageUrl?: string, fallbackImageUrl?: string, altText?: string, requestContext?: IRequestContext): JSX.Element | null {\r\n\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\r\n const emptyPlaceHolderImage = context.app.config.placeholderImageName as string;\r\n let fallbackImageSource = fallbackImageUrl;\r\n if (emptyPlaceHolderImage && fallbackImageUrl) {\r\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageSource\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n \r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param basePrice - Product base price.\r\n * @param adjustedPrice - Product adjusted price.\r\n * @param maxVariantPrice - Product variant max price.\r\n * @param minVariantPrice - Product variant min price.\r\n * @param savingsPriceResourceText - Product price saving text.\r\n * @param freePriceResourceText - Product price free text.\r\n * @param originalPriceResourceText - Product price original text.\r\n * @param currentPriceResourceText - Product price current text.\r\n * @returns React component for Product price.\r\n */\r\n function renderPrice(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, basePrice?: number, adjustedPrice?: number,\r\n maxVariantPrice?: number, minVariantPrice?: number, savingsPriceResourceText?: string, freePriceResourceText?: string,\r\n originalPriceResourceText?: string, currentPriceResourceText?: string): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice,\r\n MaxVariantPrice: maxVariantPrice ? maxVariantPrice : adjustedPrice,\r\n MinVariantPrice: minVariantPrice ? minVariantPrice : adjustedPrice\r\n };\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param description - Product description.\r\n * @returns The product description component.\r\n */\r\n function renderDescription(description?: string): JSX.Element | null {\r\n return (

\r\n {description}\r\n

);\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param avgRating - Average rating.\r\n * @param totalRatings - Total rating.\r\n * @param ariaLabel - Aria label for rating.\r\n * @returns React component for Product rating.\r\n */\r\n function renderRating(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, avgRating?: number,\r\n totalRatings?: number, ariaLabel?: string): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n }\r\n\r\n const numberRatings = totalRatings?.toString() || undefined;\r\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\r\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n return (\r\n <>\r\n \r\n
\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, productImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext)}\r\n
\r\n {renderProductAvailability(inventoryLabel)}\r\n
\r\n

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

\r\n \r\n {renderProductDimensions()}\r\n
\r\n {renderPrice(context, typeName, id, product.BasePrice, product.Price,\r\n product.MaxVariantPrice, product.MinVariantPrice, savingsText, freePriceText, originalPriceText, currentPriceText)}\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n {renderDescription(product.Description)}\r\n {!context.app.config.hideRating && renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\r\n
\r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n \r\n );\r\n};\r\n\r\nexport const ProductComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\r\n 'Product',\r\n { component: ProductCard, ...PriceComponentActions }\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['eshop-product-collection'] = {\n c: () => require('partner/modules/eshop-product-collection/eshop-product-collection.tsx'),\n $type: 'containerModule',\n da: [{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'eshop-product-collection',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/eshop-product-collection'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|eshop-product-collection|eshop-product-collection'] = {\n c: () => require('partner/modules/eshop-product-collection/eshop-product-collection.view.tsx'),\n cn: '__local__-__local__-eshop-product-collection'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["layout","HeadingTag","ProductCollection","React","constructor","props","super","handleHeadingChange","event","this","config","heading","text","target","value","_getProductsDimensionsAvailabilities","async","context","dimensionsToDisplayOnProductCard","app","dimensionsInProductCard","dimensionsToDisplayAsSwatch","dimensionsAsSwatchType","validProducts","ArrayExtensions","validValues","products","hasElements","includes","DimensionTypes","none","productsDimensionAvailabilities","getDimensionAvailabilitiesForProductSearchResultAction","DimensionAvailabilitiesForProductSearchResultInput","DimensionSwatchDisplayTypes","productCard","actionContext","setState","_getProductsInventory","productsLabel","shippingSearchCriteria","createInventoryAvailabilitySearchCriteria","map","p","RecordId","undefined","DeliveryMode","shipping","shippingAvailability","getEstimatedAvailabilityAsync","callerContext","ProductWarehouseInventoryAvailabilities","mapAggregatedProductInventoryInformation","i","id","ProductAvailableQuantity","ProductId","label","StockLevelLabel","simpleProducts","getByIdsAsync","requestContext","apiSettings","channelId","simpleProduct","_simpleProduct$Dimens","_simpleProduct$Dimens2","Dimensions","length","_simpleProduct$Dimens3","isAvailable","getDimensionValuesWithEstimatedAvailabilitiesAsync","RequestedDimensionTypeValues","d","DimensionTypeValue","DefaultWarehouseOnly","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","filter","PhysicalAvailableInventoryLevelLabel","product","find","initProductState","state","productCollectionProducts","productCollection","equals","Msdyn365","isBrowser","_getProduct","index","_this$props$data$feat","_this$state$productsD","Name","telemetry","trace","telemetryContent","getTelemetryObject","request","telemetryPageName","friendlyName","imageSettings","allowBackNavigation","resources","breaCrumbType","breadcrumbType","allowBack","quickviewSlot","slots","quickview","reviewCountAriaLabelValue","Number","TotalRatings","ratingCountAriaLabel","ratingCountAriaLabelSingleUser","isPriceMinMaxEnabled","data","featureState","result","priceResources","priceRangeSeparator","inventoryLabel","_this$state$productsL","_this$state$productsL2","ProductContainer","tag","className","role","key","productComponent","ProductComponent","freePriceText","priceFree","originalPriceText","currentPriceText","ratingAriaLabel","typeName","quickViewButton","IsEnabled","dimensionAvailabilities","dimensionAvailability","_product$MasterProduc","masterProductId","MasterProductId","_getActivePrice","productsList","getPriceForProductSearchResult","PriceForProductSearchResultInput","_getSeeAllButton","recommendation","headingLabel","seeAllLink","getCatalogId","Button","title","seeAllButtonText","href","productPrices","enableAffiliationBasedPricing","user","isAuthenticated","render","shouldDisplaySeeAllButton","recommendationListId","isCarousel","carousel","headingComponent","editProps","onEdit","updatedProducts","item","getProductData","ObjectExtensions","isNullOrUndefined","productCollectionViewProps","_objectSpread","SingleSlideCarouselComponentProps","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","ProductCollectionContainer","moduleProps","classnames","GridComponentProps","seeAllButton","renderView","_renderCarousel","carouselContainer","items","Node","Object","assign","_renderProduct","_renderGrid","gridContainer","Module","error","msdyn365Commerce","createComponent","component","_ref","_product$Name","_getProductImageUrlFr","_getProductPageUrlFro","_product$AttributeVal","savingsText","swatchItemAriaLabel","eShopPdpUrl","updateProductUrl","productDetailsPageUrl","coreContext","queryString","sourceUrl","URL","baseUrl","search","pathname","getDefaultColorSwatchSelected","productData","_colorAttribute$Swatc","AttributeValues","colorAttribute","attributeValue","_attributeValue$KeyNa","KeyName","toLocaleLowerCase","color","Swatches","IsDefault","productUrl","getProductPageUrlSync","productImageUrlFromSwatch","dimensionToPreSelectInProductCard","PrimaryImageUrl","defaultSwatch","ProductImageUrls","generateImageUrl","getProductImageUrlFromDefaultColorSwatch","productPageUrlFromSwatch","SwatchValue","getProductPageUrlFromDefaultSwatch","productPageUrl","setProductPageUrl","useState","productImageUrl","setProductImageUrl","selectedSwatchItems","Dictionary","enableStockCheck","updatePageAndImageUrl","swatchItem","dimensionType","setValue","StringExtensions","isNullOrWhitespace","productPageUrlWithSwatch","newUrl","searchParams","delete","toString","swatchProductImageUrl","productImageUrls","newImageUrl","swatchItems","_item$Swatches$map","_item$Swatches","dimensionTypeValue","checkIfShouldDisplayAsSwatch","swatches","_item$RecordId","_swatchItem$SwatchVal","_swatchItem$SwatchVal2","_dimensionAvailabilit","itemId","colorHexCode","SwatchColorHexCode","imageUrl","SwatchImageUrl","isDefault","format","isDisabled","_swatchItem$SwatchVal3","some","swatch","recordId","payLoad","getPayloadObject","attribute","getTelemetryAttributes","isUnitOfMeasureEnabled","unitOfMeasureDisplayType","getRatingAriaLabel","rating","ratingAriaLabelText","roundedRating","toFixed","getReviewAriaLabel","reviewCount","ratingCountAriaLabelText","onClick","onTelemetryClick","name","price","reviewCountArialableText","renderLabel","cultureFormatter","formatCurrency","Price","AverageRating","style","productCardimageSettings","gridSettings","fallbackImageUrl","altText","emptyPlaceHolderImage","placeholderImageName","fallbackImageSource","image","src","fallBackSrc","imageProps","cropFocalRegion","Image","loadFailureBehavior","bypassHideOnFailure","renderProductPlacementImage","inventoryAvailabilityLabel","ProductComponentSwatchComponent","onSelectDimension","moduleTypeName","moduleId","basePrice","adjustedPrice","maxVariantPrice","minVariantPrice","savingsPriceResourceText","freePriceResourceText","originalPriceResourceText","currentPriceResourceText","BasePrice","AdjustedPrice","CustomerContextualPrice","MaxVariantPrice","MinVariantPrice","PriceComponent","renderPrice","unitOfMeasure","DefaultUnitOfMeasure","description","Description","hideRating","avgRating","totalRatings","ariaLabel","numberRatings","RatingComponent","ratingCount","readOnly","renderRating","selectedDimensions","getValues","convertDimensionTypeToProductDimensionType","DimensionValue","Value","selectedProductId","renderQuickView","binding","modules","dataActions","c","require","$type","da","path","runOn","iNM","ns","n","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","window","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}