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qc,EAAmBrc,KAZjF","sources":["webpack://Dobbies.Commerce/./src/actions/cart-state-share.ts?609c","webpack://Dobbies.Commerce/./src/themes/dobbies/utilities/badges/vsi-product-badges.tsx?c9c2","webpack://Dobbies.Commerce/./src/dotdigital-extension/PopularityDataService.g.ts?e708","webpack://Dobbies.Commerce/./src/dotdigital-extension/PopularityBannerDataAction.g.ts?334d","webpack://Dobbies.Commerce/./src/themes/dobbies/utilities/quantity/Quantity.tsx?0e68","webpack://Dobbies.Commerce/./src/themes/dobbies/views/components/product.component.tsx?de6d","webpack://Dobbies.Commerce/./src/themes/dobbies/views/custom-components/product-price-component.tsx?086b"],"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 * CheckoutModulesStateShare Input Action\r\n */\r\nexport class CartModulesStateShareInput implements IActionInput {\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `cartSharedState`;\r\n public getCacheObjectType = () => 'cartSharedState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ICartSharedState {\r\n isCartUpdated?: boolean; // Used to display msg in delivery section\r\n isQuantityUpdated?: boolean;\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 CartModulesStateShareInput();\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 updateCartStateAction(input: CartModulesStateShareInput, ctx: IActionContext): Promise {\r\n return {\r\n isCartUpdated: undefined,\r\n isQuantityUpdated: undefined\r\n };\r\n}\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >updateCartStateAction,\r\n input: createInput\r\n});\r\n","/**\r\n * Copyright (c) 2020 Visionet Systems, Inc\r\n */\r\nimport {\r\n getPriceForSelectedVariant,\r\n getRatingsSummary,\r\n GetRatingsSummaryInput,\r\n getRnrEndpointId,\r\n getRnrPartnerId,\r\n PriceForSelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IActionContext, IImageData, Image } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, ProductPrice, IContext } from '@msdyn365-commerce/retail-proxy';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport * as React from 'react';\r\nimport { IModuleConfig, IVsiProductBadgesProps } from './vsi-product-badges.props';\r\nimport { vSIInitiateRestCallAsync } from '../../../../dotdigital-extension/PopularityBannerDataAction.g';\r\n\r\nexport enum badgePageType {\r\n plp = 'plp',\r\n pdp = 'pdp'\r\n}\r\n\r\nexport interface IVsiProductBadgeState {\r\n rating: number | undefined;\r\n productPrice: ProductPrice;\r\n productAttributes: AttributeValue[];\r\n badgeDisplay: boolean;\r\n imageBadge: boolean;\r\n showPromotionalBanner: boolean;\r\n showBannerStatus: boolean;\r\n totalProdTransaction: string;\r\n}\r\n\r\n/**\r\n *\r\n * VsiProductBadges Component is used to add badges on products\r\n * @extends {React.PureComponent}\r\n */\r\nclass VsiProductBadges extends React.PureComponent {\r\n constructor(props: IVsiProductBadgesProps) {\r\n super(props);\r\n this.state = {\r\n rating: 0,\r\n productPrice: {},\r\n productAttributes: [],\r\n badgeDisplay: false,\r\n imageBadge: false,\r\n showPromotionalBanner: true,\r\n showBannerStatus: false,\r\n totalProdTransaction: '0'\r\n };\r\n }\r\n\r\n public findBannerData = async () => {\r\n if (!this.props.mediaGalleryProduct?.ItemId) return;\r\n try {\r\n const context: IContext = { callerContext: this.props.context.actionContext };\r\n const res = await vSIInitiateRestCallAsync(\r\n context,\r\n this.props.mediaGalleryProduct?.ItemId,\r\n this.props.context.app.config.popularityBannerHours,\r\n this.props.context.app.config.popularityBannerCompany\r\n );\r\n if (res.result) {\r\n this.setState({\r\n showBannerStatus: res.result?.Status,\r\n totalProdTransaction: res.result?.NoOfTransactions\r\n });\r\n } else {\r\n this.setState({\r\n showBannerStatus: false,\r\n totalProdTransaction: '0'\r\n });\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n };\r\n\r\n public componentDidUpdate = async (prevProps: IVsiProductBadgesProps) => {\r\n if (this.props !== prevProps) {\r\n await this.getDataOnUpdate();\r\n }\r\n };\r\n\r\n public componentDidMount = async () => {\r\n if (this.props.mediaGalleryProduct !== undefined || this.props.productComponentProduct !== undefined) {\r\n await this.getDataOnUpdate();\r\n }\r\n this.findBannerData();\r\n };\r\n\r\n public render(): JSX.Element | null {\r\n // badges config from app settings\r\n const appConfig = this.props.context.app.config;\r\n const moduleConfig: IModuleConfig = {\r\n badgeFontColor: appConfig.badgeFontColor,\r\n badgeBackgroundColor: appConfig.badgeBackgroundColor,\r\n badgeFontBold: appConfig.badgeFontBold,\r\n badgeShow: appConfig.badgeShow,\r\n badgeBorderShow: appConfig.badgeBorderShow,\r\n badgeRating: appConfig.badgeRating,\r\n imageBadgeLeftAlign: appConfig.imageBadgeLeftAlign\r\n };\r\n\r\n // return null to if badges are not enabled from config\r\n if (!moduleConfig.badgeShow || (this.props.mediaGalleryProduct === undefined && this.props.productComponentProduct === undefined)) {\r\n return null;\r\n }\r\n\r\n const color = moduleConfig.badgeFontColor || 'black';\r\n const backgroundColor = moduleConfig.badgeBackgroundColor || 'lightgray';\r\n const fontWeight = moduleConfig.badgeFontBold ? 'bold' : 'normal';\r\n const border = moduleConfig.badgeBorderShow ? '1px solid #ababac' : 'none';\r\n const rightfloat = moduleConfig.imageBadgeLeftAlign ? 'right' : 'none';\r\n\r\n const badgeStyle: React.CSSProperties = {\r\n color: color,\r\n backgroundColor: backgroundColor,\r\n border: border,\r\n fontWeight: fontWeight\r\n };\r\n\r\n //Exit Popularity Banner Badge\r\n const exitBadgeStyle: React.CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'flex-end',\r\n justifyContent: 'flex-end',\r\n alignContent: 'flex-end',\r\n marginRight: '10px'\r\n };\r\n\r\n const badgeHeadingStyle: React.CSSProperties = {\r\n display: 'flex',\r\n marginTop: '-10px',\r\n marginLeft: '5px',\r\n fontSize: '12px'\r\n };\r\n\r\n const badgeDescriptionStyle: React.CSSProperties = {\r\n display: 'flex',\r\n marginLeft: '5px',\r\n alignItems: 'flex-start',\r\n justifyContent: 'flex-start',\r\n alignContent: 'flex-start',\r\n marginTop: '5px',\r\n fontSize: '12px',\r\n textAlign: 'left'\r\n };\r\n\r\n const badgeStyleRight: React.CSSProperties = {\r\n color: color,\r\n /* backgroundColor: backgroundColor, */\r\n float: rightfloat\r\n };\r\n\r\n let parentClassName;\r\n const showOutofStock = this._shouldShowOutOfStock();\r\n if (this.state.badgeDisplay && this.state.imageBadge) {\r\n parentClassName = 'both';\r\n } else if (this.state.badgeDisplay && !this.state.imageBadge) {\r\n parentClassName = 'left-badge';\r\n } else if (!this.state.badgeDisplay && this.state.imageBadge) {\r\n parentClassName = 'right-badge';\r\n }\r\n\r\n return (\r\n
\r\n {this._renderProductBadge(badgeStyle, showOutofStock)}\r\n {this.state.showBannerStatus &&\r\n Number(this.state.totalProdTransaction) >= this.props.context.app.config.popularityBannerThreshold &&\r\n this._renderPromotionalBanner(\r\n badgeStyle,\r\n exitBadgeStyle,\r\n badgeHeadingStyle,\r\n badgeDescriptionStyle,\r\n this.state.showPromotionalBanner,\r\n this.state.totalProdTransaction\r\n )}\r\n {this._renderImageBadge(badgeStyleRight, 'BadgeImage')}\r\n
\r\n );\r\n }\r\n private _shouldShowOutOfStock = () => {\r\n const { productAvailableData, moduleType, mediaGalleryProduct, productComponentProduct } = this.props;\r\n //For PDP\r\n if (mediaGalleryProduct || productComponentProduct) {\r\n let recordId: number;\r\n let masterProductId: number | undefined;\r\n let productId: number;\r\n // if request is from Buybox/PDP\r\n if (this.props.moduleType === badgePageType.pdp) {\r\n const product = mediaGalleryProduct;\r\n recordId = product!.RecordId;\r\n masterProductId = product!.MasterProductId;\r\n productId = masterProductId || recordId;\r\n\r\n let attributes;\r\n if (moduleType === badgePageType.plp && this.props.productComponentProduct) {\r\n attributes = this.props.productComponentProduct.AttributeValues;\r\n } else {\r\n attributes = this.state.productAttributes;\r\n }\r\n this.getProductAttrbute(this.props.context.actionContext, productId);\r\n const attName = attributes?.find(onlystore => onlystore.Name === 'OnlyInStore');\r\n console.log('name', attName);\r\n\r\n const AttValue = attName?.TextValue?.toLocaleLowerCase();\r\n console.log('attt', AttValue);\r\n if (AttValue === 'no') {\r\n if (productAvailableData) {\r\n const { result } = productAvailableData;\r\n if (result !== undefined && result.length > 0 && !result[0].IsProductAvailable) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n };\r\n private _renderImageBadge(badgeStyle: React.CSSProperties, attributeName: string): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n let attributes;\r\n if (moduleType === badgePageType.plp && this.props.productComponentProduct) {\r\n attributes = this.props.productComponentProduct.AttributeValues;\r\n } else {\r\n attributes = this.state.productAttributes;\r\n }\r\n if (attributes && attributes.length > 0) {\r\n const attribute = attributes[attributes.findIndex((x: AttributeValue) => x.Name === attributeName)];\r\n if (attribute !== undefined) {\r\n const attributeValue = attribute.TextValue ? attribute.TextValue : undefined;\r\n const baseImageURL = `${this.props.context.request.apiSettings.baseImageUrl}Products/`;\r\n const badgeImage = attributeValue && attributeValue.trim().toLowerCase();\r\n\r\n if (!badgeImage || (attributeValue && attributeValue.trim().toLowerCase() === 'none')) {\r\n return null;\r\n }\r\n const imageUrl = `${baseImageURL}${badgeImage}`;\r\n const img: IImageData = {\r\n src: imageUrl,\r\n altText: ''\r\n };\r\n\r\n const imageProps = {\r\n gridSettings: this.props.context.request.gridSettings || {},\r\n imageSettings: this.props.imageSettings\r\n };\r\n this.setState({ imageBadge: true });\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private _renderDiscountBadgePercentage(badgeStyle: React.CSSProperties): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n const price = this.state.productPrice;\r\n if (price) {\r\n const { BasePrice, CustomerContextualPrice } = price;\r\n let discount = 0;\r\n if (BasePrice && CustomerContextualPrice && BasePrice > CustomerContextualPrice) {\r\n const actualPercentage = Math.round((CustomerContextualPrice / BasePrice) * 100);\r\n discount = 100 - actualPercentage;\r\n }\r\n\r\n if (discount > 0) {\r\n this.setState({ badgeDisplay: true });\r\n return (\r\n
\r\n {`-${discount}%`}\r\n
\r\n );\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private _renderRatingBadge(badgeStyle: React.CSSProperties): JSX.Element | null {\r\n const { moduleType, context } = this.props;\r\n const rating = this.state.rating;\r\n const topRating = context.app.config.badgeRating;\r\n if (rating && rating >= topRating) {\r\n this.setState({ badgeDisplay: true });\r\n return (\r\n
\r\n {`${context.app.config.badgeRatingText}`}\r\n
\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n private _renderOutofStockBadge(badgeStyle: React.CSSProperties): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n this.setState({ badgeDisplay: true });\r\n return (\r\n
\r\n {`Out of stock`}\r\n
\r\n );\r\n }\r\n\r\n //Render Promotional Badge\r\n private _renderPromotionalBanner(\r\n badgeStyle: React.CSSProperties,\r\n exitBadgeStyle: React.CSSProperties,\r\n badgeHeadingStyle: React.CSSProperties,\r\n badgeDescriptionStyle: React.CSSProperties,\r\n showPromotionalBanner: boolean,\r\n totalProdTransaction: string\r\n ): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n const _displayPromotionalBanner = () => {\r\n this.setState({\r\n showPromotionalBanner: false\r\n });\r\n };\r\n\r\n if (moduleType === badgePageType.pdp && showPromotionalBanner) {\r\n return (\r\n
\r\n

\r\n x\r\n

\r\n

Trending

\r\n

\r\n {totalProdTransaction} people bought this within the past {this.props.context.app.config.popularityBannerHours}{' '}\r\n hours\r\n

\r\n
\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n // Render discountAmount badge\r\n private _renderDiscountBadgeAmount(badgeStyle: React.CSSProperties): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n const price = this.state.productPrice;\r\n if (price) {\r\n const { BasePrice, CustomerContextualPrice } = price;\r\n let discount = 0;\r\n if (BasePrice && CustomerContextualPrice && BasePrice > CustomerContextualPrice) {\r\n discount = Number((BasePrice - CustomerContextualPrice).toFixed(2));\r\n }\r\n if (discount > 0) {\r\n // format price\r\n const discountWithCurrenceySign = discount && this.props.context.cultureFormatter.formatCurrency(discount.toString(), this.props.context.request.channel?.Currency);\r\n this.setState({ badgeDisplay: true });\r\n return (\r\n
\r\n {`${discountWithCurrenceySign} OFF`}\r\n
\r\n );\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n // Render custom badge\r\n private _renderCustomAttributeBadge(badgeStyle: React.CSSProperties, attributeName: string): JSX.Element | null {\r\n const { moduleType } = this.props;\r\n let attributes;\r\n if (moduleType === badgePageType.plp && this.props.productComponentProduct) {\r\n attributes = this.props.productComponentProduct.AttributeValues;\r\n } else {\r\n attributes = this.state.productAttributes;\r\n }\r\n if (attributes && attributes.length > 0) {\r\n const attribute = attributes[attributes.findIndex((x: AttributeValue) => x.Name === attributeName)];\r\n if (attribute !== undefined) {\r\n // const brandValue = attrbute && attrbute.TextValue ? attrbute.TextValue : 'SizeNotDefined';\r\n const attributeValue = attribute.TextValue ? attribute.TextValue : '';\r\n if (attributeValue.length > 0) {\r\n this.setState({ badgeDisplay: true });\r\n return (\r\n
\r\n {attributeValue}\r\n
\r\n );\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private renderDefaultBadge = (badgeStyle: React.CSSProperties) => {\r\n const { moduleType, productComponentProduct } = this.props;\r\n return (\r\n
\r\n {productComponentProduct?.discount}\r\n
\r\n );\r\n };\r\n\r\n private _renderProductBadge(badgeStyle: React.CSSProperties, showOutofStock: boolean): JSX.Element | null {\r\n const { moduleType, context } = this.props;\r\n const badgeShow = context.app.config.badgeShow;\r\n let attributes;\r\n if (moduleType === badgePageType.plp && this.props.productComponentProduct) {\r\n attributes = this.props.productComponentProduct.AttributeValues;\r\n } else {\r\n attributes = this.state.productAttributes;\r\n }\r\n if (showOutofStock && badgeShow) {\r\n return this._renderOutofStockBadge(badgeStyle);\r\n }\r\n if (this.props.productComponentProduct?.discount) {\r\n return this.renderDefaultBadge(badgeStyle);\r\n }\r\n let attributeValue;\r\n if (attributes && attributes.length > 0) {\r\n const attribute =\r\n attributes[\r\n attributes.findIndex((x: AttributeValue) => {\r\n const name = x.Name && x.Name.toLowerCase();\r\n return name === 'badgetype';\r\n })\r\n ];\r\n if (attribute !== undefined) {\r\n attributeValue = attribute.TextValue ? attribute.TextValue : undefined;\r\n const BadgeType = attributeValue;\r\n\r\n if (badgeShow === true && BadgeType !== undefined) {\r\n if (BadgeType === 'DiscountAmount') {\r\n return this._renderDiscountBadgeAmount(badgeStyle);\r\n } else if (BadgeType === 'DiscountPercentage') {\r\n return this._renderDiscountBadgePercentage(badgeStyle);\r\n } else if (BadgeType === 'Rating') {\r\n return this._renderRatingBadge(badgeStyle);\r\n } else if (BadgeType === 'BadgeText' && BadgeType !== undefined) {\r\n return this._renderCustomAttributeBadge(badgeStyle, BadgeType);\r\n } else {\r\n return null;\r\n }\r\n } else {\r\n return null;\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private getDataOnUpdate = async () => {\r\n const { mediaGalleryProduct, productComponentProduct, context } = this.props;\r\n\r\n if (mediaGalleryProduct || productComponentProduct) {\r\n let recordId: number;\r\n let masterProductId: number | undefined;\r\n let productId: number;\r\n // if request is from Buybox/PDP\r\n if (this.props.moduleType === badgePageType.pdp) {\r\n const product = mediaGalleryProduct;\r\n recordId = product!.RecordId;\r\n masterProductId = product!.MasterProductId;\r\n productId = masterProductId || recordId;\r\n // Get product rating\r\n const ratingInput = new GetRatingsSummaryInput(\r\n productId.toString(),\r\n getRnrPartnerId(context.actionContext),\r\n getRnrEndpointId(context.actionContext)\r\n );\r\n const ratings = await getRatingsSummary(ratingInput, context.actionContext);\r\n const ratingValue = ratings ? ratings.averageRating : 0;\r\n this.setState({ rating: ratingValue });\r\n // Get product pricing\r\n const priceInput = new PriceForSelectedVariantInput(\r\n productId,\r\n context.request.apiSettings.channelId,\r\n product,\r\n context.actionContext.requestContext.user.customerAccountNumber\r\n );\r\n // Run and await the result of the data action\r\n const productPriceResult = await getPriceForSelectedVariant(priceInput, context.actionContext);\r\n const price: ProductPrice = {\r\n // BasePrice value has been set based on higher price value among these ↓.\r\n BasePrice: Math.max(\r\n productPriceResult?.BasePrice || 0,\r\n productPriceResult?.TradeAgreementPrice || 0,\r\n productPriceResult?.AdjustedPrice || 0\r\n ),\r\n AdjustedPrice: product!.Price || 0,\r\n CustomerContextualPrice: productPriceResult!.CustomerContextualPrice || 0\r\n };\r\n this.setState({ productPrice: price });\r\n // tslint:disable-next-line: no-floating-promises\r\n this.getProductAttrbute(context.actionContext, productId);\r\n } else if (this.props.moduleType === badgePageType.plp) {\r\n const product = productComponentProduct;\r\n const price: ProductPrice = {\r\n BasePrice: (product && product.BasePrice) || 0,\r\n AdjustedPrice: (product && product.Price) || 0,\r\n CustomerContextualPrice: (product && product.Price) || 0\r\n };\r\n this.setState({ rating: productComponentProduct ? productComponentProduct.AverageRating : 0 });\r\n this.setState({ productPrice: price });\r\n // tslint:disable-next-line: no-floating-promises\r\n // this.getProductAttrbute(context.actionContext, product!.RecordId);\r\n }\r\n }\r\n };\r\n\r\n private getProductAttrbute = async (callerContext: IActionContext, productId: number) => {\r\n const productAttributeResult = await getAttributeValuesAsync(\r\n { callerContext, queryResultSettings: {} },\r\n productId,\r\n callerContext.requestContext.apiSettings.channelId,\r\n callerContext.requestContext.apiSettings.catalogId\r\n );\r\n this.setState({ productAttributes: productAttributeResult });\r\n };\r\n}\r\n\r\nexport default VsiProductBadges;\r\n","// tslint:disable\r\n/* eslint-disable security/detect-object-injection */\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * VSIRestAPIHandler entity interface.\r\n */\r\nexport interface IVSIRestAPIHandler {\r\n Id: number;\r\n result?: {\r\n Status: boolean;\r\n NoOfTransactions: string;\r\n };\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * VSIRestAPIHandler entity class.\r\n */\r\nexport class VSIRestAPIHandlerExtensionClass implements IVSIRestAPIHandler {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Id: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public result: Object;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Id = odataObject.Id;\r\n\r\n var newObj = {\r\n Status: odataObject.Status,\r\n NoOfTransactions: odataObject.NoOfTransactions\r\n };\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n // this.result = odataObject.result;\r\n this.result = newObj;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (var i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n var className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './PopularityDataService.g';\r\n\r\n// @ts-ignore\r\nfunction vSIGetAPIResponseQuery(id?: number): DataServiceQuery {\r\n const key = id ? { Id: id } : null;\r\n return new DataServiceQuery('VSIGetRestAPIResponse', 'VSIRestAPIHandler', DataServiceEntities.VSIRestAPIHandlerExtensionClass, key);\r\n}\r\n\r\nexport function createVSIInitiateRestCallInput(ItemID: string, NoOfHours: string, Company: string): IDataServiceRequest {\r\n const query = vSIGetAPIResponseQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'VSI_GetNoOfTransactions',\r\n true,\r\n DataServiceEntities.VSIRestAPIHandlerExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IVSIRestAPIHandler' },\r\n { ItemID: ItemID, NoOfHours: NoOfHours, Company: Company }\r\n );\r\n}\r\n\r\nexport function vSIInitiateRestCallAsync(\r\n context: IContext,\r\n ItemID: string,\r\n NoOfHours: string,\r\n Company: string\r\n): AsyncResult {\r\n const request = createVSIInitiateRestCallInput(ItemID, NoOfHours, Company);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","import debounce from 'lodash/debounce';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IQuantityProps } from './Quantity.props';\r\n\r\ninterface IQuantityState {\r\n currentInput: number;\r\n}\r\n/**\r\n * Quantity Component - This component is used to add or remove quantity\r\n */\r\n@observer\r\nexport default class Quantity extends React.PureComponent {\r\n public static defaultProps: Partial = {\r\n min: 1,\r\n decrementGlyphClass: 'fas fa-minus',\r\n incrementGlyphClass: 'fas fa-plus'\r\n };\r\n\r\n private inputRef: React.RefObject = React.createRef();\r\n\r\n constructor(props: IQuantityProps) {\r\n super(props);\r\n this.state = { currentInput: props.currentCount || 1 };\r\n this._onIncrement = this._onIncrement.bind(this);\r\n this._onDecrement = this._onDecrement.bind(this);\r\n this._handleChange = this._handleChange.bind(this);\r\n }\r\n\r\n public componentDidUpdate(): void {\r\n reaction(\r\n () => this.props.currentCount,\r\n () => {\r\n this.setState({ currentInput: this.props.currentCount || 1 });\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element {\r\n const glyphMinusClassName: string = `${this.props.decrementGlyphClass!} quantity__controls-glyph`;\r\n const glyphPlusClassName: string = `${this.props.incrementGlyphClass!} quantity__controls-glyph`;\r\n const disabled = this.state.currentInput === this.props.min;\r\n const incDisabled = this.state.currentInput === this.props.max;\r\n const currentValue = this.state.currentInput;\r\n let extraClass = '';\r\n if (disabled) {\r\n // The quantity has reached its boundaries (max or min)\r\n extraClass = 'disabled';\r\n } else if (this.props.disabled) {\r\n // this.props.disabled shows if the state is not succeded yet\r\n extraClass = 'transition';\r\n }\r\n let extraClassInc = '';\r\n if (incDisabled) {\r\n // The quantity has reached its boundaries (max or min)\r\n extraClassInc = 'disabled';\r\n } else if (this.props.disabled) {\r\n // this.props.disabled shows if the state is not succeded yet\r\n extraClassInc = 'transition';\r\n }\r\n return (\r\n <>\r\n
\r\n {this.props.hideQuantityControls !== true && (\r\n \r\n \r\n \r\n )}\r\n \r\n {this.props.hideQuantityControls !== true && (\r\n \r\n \r\n \r\n )}\r\n
\r\n \r\n );\r\n }\r\n\r\n private _onIncrement(): void {\r\n let invokeCallback = false;\r\n const currQuantity = this.state.currentInput;\r\n let updatedQuantity: number;\r\n\r\n if (currQuantity < this.props.max) {\r\n invokeCallback = true;\r\n updatedQuantity = currQuantity + 1;\r\n } else {\r\n invokeCallback = false;\r\n updatedQuantity = this.props.max;\r\n }\r\n\r\n invokeCallback && this.props.onChange && this.props.onChange(updatedQuantity);\r\n }\r\n\r\n private _onDecrement(): void {\r\n let invokeCallback = false;\r\n const currQuantity = this.state.currentInput;\r\n let updatedQuantity: number;\r\n\r\n if (currQuantity > 1) {\r\n invokeCallback = true;\r\n updatedQuantity = currQuantity - 1;\r\n } else {\r\n invokeCallback = false;\r\n updatedQuantity = 1;\r\n }\r\n\r\n invokeCallback && this.props.onChange && this.props.onChange(updatedQuantity);\r\n }\r\n\r\n private _handleChange(e: React.ChangeEvent): void {\r\n const currentValue = parseInt(e.target.value, 10);\r\n const minValue = this.props.min === undefined ? 1 : this.props.min;\r\n const inputElement =\r\n this.inputRef && this.inputRef.current && this.inputRef.current instanceof HTMLInputElement && this.inputRef.current;\r\n\r\n if (currentValue > this.props.max) {\r\n this.setState({ currentInput: this.props.max }, () => {\r\n debounce(() => {\r\n this.props.onChange && this.props.onChange(this.state.currentInput);\r\n }, 200)();\r\n });\r\n } else {\r\n this.setState({ currentInput: currentValue }, () => {\r\n debounce(() => {\r\n if (!isNaN(this.state.currentInput) && !(this.state.currentInput < minValue)) {\r\n this.props.onChange && this.props.onChange(this.state.currentInput);\r\n\r\n if (inputElement) {\r\n inputElement.setAttribute('aria-valuenow', currentValue.toString());\r\n inputElement.setAttribute('value', currentValue.toString());\r\n }\r\n }\r\n }, 200)();\r\n });\r\n }\r\n }\r\n\r\n private _validateMin = (): void => {\r\n const minValue = this.props.min === undefined ? 1 : this.props.min;\r\n if (isNaN(this.state.currentInput) || this.state.currentInput < minValue) {\r\n this.props.onChange && this.props.onChange(minValue);\r\n } else {\r\n this.props.onChange && this.props.onChange(this.state.currentInput);\r\n }\r\n };\r\n}\r\n","import { getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n onTelemetryClick\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { RatingComponent, AddToWishlistComponent } from '@msdyn365-commerce/components';\r\nimport { PriceComponent } from '../custom-components/product-price-component';\r\nimport { generateImageUrl, ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Quantity } from '../../utilities/quantity';\r\nimport { IDobbiesAddedProductToBundle } from '../../../../modules/dobbies-product-collection/dobbies-product-collection';\r\nimport { CartModulesStateShareInput } from '../../../../actions/cart-state-share';\r\nimport { getCartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n getDeliveryOptionsAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { cartLineQuantityUpdatedAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\n\r\nimport { getCartFromCustomer } from '@msdyn365-commerce/global-state';\r\nimport {\r\n IComponent,\r\n IComponentProps,\r\n ICoreContext,\r\n IGridSettings,\r\n IImageData,\r\n IImageSettings,\r\n Image,\r\n msdyn365Commerce,\r\n ICommerceApiSettings\r\n} from '@msdyn365-commerce/core';\r\nimport { ProductPrice, AttributeValue, DiscountLine, Cart, CommerceList, LoyaltyCard, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport React, { useRef, useState } from 'react';\r\nimport { IProductWithModes } from '../../../../modules/dobbies-search-result-container/components';\r\nimport VsiProductBadges, { badgePageType } from '../../utilities/badges/vsi-product-badges';\r\n\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: IProductWithModes; discountLine?: DiscountLine }> {\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 allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n inventoryLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n discountLine?: DiscountLine[] | undefined;\r\n badgeLink?: string;\r\n showProdPrice?: boolean;\r\n showDeliveryIcons?: boolean;\r\n wishlists?: CommerceList[];\r\n isMobile?: boolean;\r\n showBanner?: (prodId: number) => void;\r\n hideBanner?: (prodId: number) => void;\r\n loyalty?: LoyaltyCard;\r\n nonClubPlusDiscount?: ProductPrice;\r\n isProductAddedToBundles?: boolean; \r\n maxQuantityForBundle?: number;\r\n redirectToCartEnabled?: boolean; \r\n isProductBundles?: boolean,\r\n isQuantityUpdated?: boolean,\r\n isBundlesModal?: boolean,\r\n simpleProduct?: SimpleProduct;\r\n onQuantityChangeListener?(productId: number, newQuantity: number): void;\r\n onBundleProductCheckBoxSelected?(productId: number): void;\r\n}\r\n\r\ninterface ILocalImgData {\r\n primaryUrl: string;\r\n isPrimaryUrl: boolean;\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 allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n wishlists,\r\n discountLine,\r\n badgeLink,\r\n showBanner,\r\n hideBanner,\r\n showDeliveryIcons = !data.product?.IsMasterProduct,\r\n isMobile,\r\n loyalty,\r\n nonClubPlusDiscount,\r\n isProductAddedToBundles,\r\n maxQuantityForBundle,\r\n redirectToCartEnabled,\r\n isProductBundles,\r\n isBundlesModal,\r\n isQuantityUpdated,\r\n simpleProduct,\r\n onQuantityChangeListener,\r\n onBundleProductCheckBoxSelected\r\n}) => {\r\n // const [displayClubPlusInfo, setDisplayClubPlusInfo] = React.useState(false);\r\n const [cartData, setCartData] = React.useState(undefined);\r\n const [updatedProductPrice, setUpdatedProductPrice] = React.useState();\r\n const [isHover, setIsHover] = useState(false); // for hover effect\r\n const productImageRef = useRef(null);\r\n const [currBundleQuantity, setCurrBundleQuantity] = React.useState(1);\r\n // const displayClubPlus = () => {\r\n // setDisplayClubPlusInfo(!displayClubPlusInfo);\r\n // }\r\n const product = data.product;\r\n if (!product) {\r\n return null;\r\n }\r\n //VSI CUSTOMIZATION -START - Task 11167: PLP hover image flip\r\n const [images, setImages] = useState({ isPrimaryUrl: false, primaryUrl: '' });\r\n React.useEffect(() => {\r\n if(isQuantityUpdated) {\r\n if(isProductBundles && isBundlesModal) {\r\n getCartState(context.actionContext).then(cartState => {\r\n const cartlines = cartState.cart?.CartLines;\r\n if(cartlines && cartlines.length) {\r\n const cl = cartlines.find(cl => cl.ProductId === product.RecordId);\r\n if (cl && cl.Quantity) {\r\n setCurrBundleQuantity(cl.Quantity);\r\n if (onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, cl.Quantity);\r\n }\r\n }\r\n }\r\n }).catch(e => {});\r\n context.actionContext.update(new CartModulesStateShareInput(), {isQuantityUpdated: false});\r\n return;\r\n }\r\n const cookies = context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection = cookies.get('added_products_bundles')?.value || [];\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n if(obj['productId'] === product.RecordId) {\r\n setCurrBundleQuantity(obj['quantity']);\r\n if (onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, obj['quantity']);\r\n }\r\n }\r\n }\r\n }\r\n context.actionContext.update(new CartModulesStateShareInput(), {isQuantityUpdated: false});\r\n }\r\n }, [isQuantityUpdated]);\r\n\r\n React.useEffect(() => {\r\n if(isProductAddedToBundles) {\r\n resetQuantity();\r\n }\r\n }, [isProductAddedToBundles]);\r\n\r\n const resetQuantity = async () => {\r\n if(isProductBundles){\r\n const cartState = await getCartState(context.actionContext);\r\n const cl = cartState.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if(cl && cl.Quantity) {\r\n if (isProductBundles && isBundlesModal) {\r\n setCurrBundleQuantity(cl.Quantity);\r\n }\r\n }\r\n }\r\n };\r\n const resetQuantityOnLoad = async () => {\r\n if(isProductBundles){\r\n const cartState = await getCartState(context.actionContext);\r\n const cl = cartState.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if(cl && cl.Quantity) {\r\n if (isProductBundles && isBundlesModal) {\r\n setCurrBundleQuantity(cl.Quantity);\r\n } else if (!isBundlesModal){\r\n setCurrBundleQuantity(1);\r\n }\r\n } else {\r\n setCurrBundleQuantity(1);\r\n }\r\n }\r\n };\r\n\r\n\r\n React.useEffect(() => {\r\n if (product && product.RecordId) {\r\n const baseImgUrl = context.request.apiSettings.baseImageUrl;\r\n const imgName = `Products%2F${product.ItemId}_000_002.png`;\r\n const fullImgUrl = `${baseImgUrl}${imgName}`;\r\n if (!fullImgUrl) {\r\n return;\r\n } else {\r\n setImages({ isPrimaryUrl: false, primaryUrl: '' });\r\n }\r\n validateMediaLocaionAsync(fullImgUrl)\r\n .then(result => {\r\n if (result[1] === true) {\r\n setImages({ isPrimaryUrl: true, primaryUrl: result[0].src! });\r\n } else {\r\n setImages({ isPrimaryUrl: false, primaryUrl: '' });\r\n }\r\n })\r\n .catch(error => {\r\n context.actionContext.telemetry.exception(error);\r\n context.actionContext.telemetry.debug('Unable to validate prodcut images');\r\n });\r\n }\r\n }, [product]);\r\n //VSI CUSTOMIZATION -END - Task 11167: PLP hover image flip\r\n\r\n let productUrl = getProductPageUrlSync(product.Name || '', product.RecordId, context && context.actionContext, undefined);\r\n if (allowBack) {\r\n productUrl = updateProductUrl(productUrl, context);\r\n }\r\n\r\n const getCartData = async () => {\r\n const cart = await getCartFromCustomer(context.actionContext);\r\n setCartData(cart);\r\n await resetQuantityOnLoad();\r\n };\r\n\r\n const deSelectProduct = async () => {\r\n const cartState = await getCartState(context.actionContext);\r\n const cartlineToRemove = cartState.cart.CartLines?.find(cl => cl.ProductId === product.RecordId);\r\n if(isProductBundles && isBundlesModal) {\r\n if(cartlineToRemove) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n cartState.removeCartLines(input).then(() => {\r\n context.actionContext.update(new CartModulesStateShareInput(), {isCartUpdated: true});\r\n })\r\n .catch(error => {\r\n });\r\n }\r\n return;\r\n }\r\n const cookies = context.actionContext.requestContext.cookies;\r\n let productsAddedInBundles = cookies.get(\"added_products_bundles\")?.value || [];\r\n if (Array.isArray(productsAddedInBundles)) {\r\n for(let i = 0; i < productsAddedInBundles.length; i++) {\r\n if (productsAddedInBundles[i]['productId'] === product.RecordId) {\r\n delete productsAddedInBundles[i];\r\n }\r\n }\r\n const updatedProductsAddedInBundles: IDobbiesAddedProductToBundle[] = [];\r\n productsAddedInBundles.map(prod => {\r\n if(prod && prod['productId']) {\r\n const dobbiesProductData: IDobbiesAddedProductToBundle = {};\r\n dobbiesProductData.productId = prod['productId'];\r\n dobbiesProductData.quantity = prod['quantity'];\r\n dobbiesProductData.price = prod['price'];\r\n dobbiesProductData.maxQuantity = prod['maxQuantity'];\r\n updatedProductsAddedInBundles.push(dobbiesProductData);\r\n }\r\n });\r\n cookies.set('added_products_bundles', updatedProductsAddedInBundles);\r\n context.actionContext.update(new CartModulesStateShareInput(), {isCartUpdated: true});\r\n }\r\n };\r\n\r\n const onQuantityChange = async (newValue: number) => {\r\n const cartState = await getCartState(context.actionContext);\r\n const cl = cartState.cart.CartLines?.find(c => c.ProductId === product.RecordId);\r\n if(isProductBundles && isBundlesModal) {\r\n if(!cl) {\r\n if(onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, newValue);\r\n }\r\n setCurrBundleQuantity(newValue);\r\n return;\r\n }\r\n if (cl && cl.Quantity && maxQuantityForBundle && simpleProduct) {\r\n if(newValue > maxQuantityForBundle) {\r\n return;\r\n }\r\n const diffInQuantity = newValue - cl.Quantity;\r\n const deliveryOptions = await getDeliveryOptionsAsync(\r\n { callerContext: context.actionContext, queryResultSettings: {} },\r\n [product.RecordId]\r\n );\r\n const emailDeliveryModeCode = context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\r\n if(diffInQuantity > 0) {\r\n const addProductToCartInput = {\r\n product: simpleProduct,\r\n quantity: diffInQuantity,\r\n enableStockCheck: context.app.config.enableStockCheck,\r\n availableQuantity: maxQuantityForBundle,\r\n isAddEmailDeliveryItemToCart:\r\n ArrayExtensions.hasElements(deliveryOptions) &&\r\n ArrayExtensions.hasElements(deliveryOptions[0].DeliveryOptions) &&\r\n deliveryOptions[0].DeliveryOptions[0].Code === emailDeliveryModeCode\r\n };\r\n cartState.addProductToCart(addProductToCartInput)\r\n .then(async result => {\r\n if (result.status === 'SUCCESS') {\r\n context.actionContext.update(new CartModulesStateShareInput(), {isCartUpdated: true});\r\n }\r\n }).catch(e => {});\r\n } else if (diffInQuantity < 0) {\r\n cartLineQuantityUpdatedAsync(\r\n true,\r\n cartState,\r\n context.actionContext.telemetry,\r\n [simpleProduct],\r\n cl,\r\n newValue\r\n )\r\n .then((cartActionResult: ICartActionResult | undefined): boolean => {\r\n if (cartActionResult?.status === 'SUCCESS') {\r\n context.actionContext.update(new CartModulesStateShareInput(), {isCartUpdated: true});\r\n return true;\r\n }\r\n return false;\r\n }).catch(e => {});\r\n }\r\n if(onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, newValue);\r\n }\r\n setCurrBundleQuantity(newValue);\r\n }\r\n return;\r\n }\r\n const cookies = context.actionContext.requestContext.cookies;\r\n const addedProductsToCollection = cookies.get(\"added_products_bundles\")?.value || [];\r\n const updatedProducts: IDobbiesAddedProductToBundle[] = [];\r\n if (Array.isArray(addedProductsToCollection)) {\r\n for (const obj of addedProductsToCollection) {\r\n if (obj['productId'] === product.RecordId) {\r\n const valueToBeUpdated = newValue;\r\n if(valueToBeUpdated > 0) {\r\n updatedProducts.push({ productId: obj['productId'], price: obj['price'], quantity: valueToBeUpdated, maxQuantity: maxQuantityForBundle });\r\n }\r\n } else {\r\n updatedProducts.push({ productId: obj['productId'], price: obj['price'], quantity: obj['quantity'], maxQuantity: obj['maxQuantity'] });\r\n }\r\n }\r\n cookies.set('added_products_bundles', updatedProducts);\r\n }\r\n setCurrBundleQuantity(newValue);\r\n context.actionContext.update(new CartModulesStateShareInput(), {isCartUpdated: true});\r\n if(onQuantityChangeListener) {\r\n onQuantityChangeListener(product.RecordId, newValue);\r\n }\r\n };\r\n\r\n const checkboxClicked = () => {\r\n if(isProductAddedToBundles) {\r\n deSelectProduct();\r\n } else if(onBundleProductCheckBoxSelected){\r\n onBundleProductCheckBoxSelected(product.RecordId);\r\n }\r\n }\r\n\r\n React.useEffect(() => {\r\n getCartData();\r\n setUpdatedProductPrice(product.Price);\r\n\r\n productImageRef.current?.addEventListener('contextmenu', e => {\r\n e.preventDefault();\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 function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item });\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 //VSI CUSTOMIZATION -START - Check current loyalty tier id.\r\n const getTierId = () => {\r\n if (loyalty!?.LoyaltyGroups!?.length > 0) {\r\n const highestActiveLoyaltyCardTier = loyalty!.LoyaltyGroups![0]?.HighestActiveLoyaltyCardTier;\r\n const loyaltyCardTiers = loyalty!.LoyaltyGroups![0]?.LoyaltyCardTiers;\r\n const loyaltyCardTier = loyaltyCardTiers?.find(tier => tier.RecordId === highestActiveLoyaltyCardTier);\r\n return loyaltyCardTier?.LoyaltyTierRecordId;\r\n }\r\n return undefined;\r\n };\r\n //VSI CUSTOMIZATION -END\r\n const checkClubPlusDiscounts =\r\n discountLine && discountLine.length > 0 && discountLine?.find(x => x.OfferId === context.app.config.discountId);\r\n const checkUserLoyalty = getTierId() === context.app.config.LoyaltyTierId ? true : undefined;\r\n // cartData && cartData.AffiliationLines && cartData.AffiliationLines.find(x => x.LoyaltyTierId === context.app.config.LoyaltyTierId);\r\n // const checkNonClubPlusDiscounts = discountLine && discountLine.find(x => x.OfferId !== context.app.config.discountId);\r\n const membershipDiscount = discountLine && discountLine.find(x => x.OfferId === context.app.config.membershipDiscountId);\r\n //VSI CUSTOMIZATION -START - Task 11167: PLP hover image flip\r\n const getImgContainer = () => {\r\n if (!(typeName === 'dobbies-search-result-container' || images.isPrimaryUrl === false)) {\r\n return (\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context.request.apiSettings\r\n )}\r\n
\r\n );\r\n }\r\n return (\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context.request.apiSettings\r\n )}\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n images.primaryUrl,\r\n product.Name,\r\n context.request.apiSettings\r\n )}\r\n
\r\n );\r\n };\r\n //VSI CUSTOMIZATION -END - Task 11167: PLP hover image flip\r\n return (\r\n product.ItemId ? \r\n
setIsHover(true)} onMouseLeave={() => setIsHover(false)}>\r\n \r\n
\r\n
\r\n {isProductBundles &&\r\n
\r\n {checkboxClicked()}} />\r\n \r\n
\r\n }\r\n \r\n {/* //VSI CUSTOMIZATION -START - Task 11167: PLP hover image flip */}\r\n {getImgContainer()}\r\n {/* //VSI CUSTOMIZATION -END - Task 11167: PLP hover image flip */}\r\n \r\n\r\n \r\n
\r\n\r\n {isHover && quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n\r\n {(isHover || isMobile) && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n\r\n
\r\n \r\n \r\n {/*

{product.Name}

*/}\r\n

{getProductName(product, product.Name!)}

\r\n\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n checkUserLoyalty && membershipDiscount ? product.BasePrice : nonClubPlusDiscount?.AdjustedPrice!,\r\n checkUserLoyalty && membershipDiscount ? product.Price : nonClubPlusDiscount?.CustomerContextualPrice!,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n checkUserLoyalty && membershipDiscount ? discountLine : nonClubPlusDiscount?.DiscountLines,\r\n cartData,\r\n updatedProductPrice,\r\n getTierId,\r\n checkClubPlusDiscounts\r\n )}\r\n {/* {renderDescription(product.Description)} */}\r\n {!context.app.config.hideRating &&\r\n renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\r\n\r\n {/*do not show delivery and C&C icons on plp*/}\r\n {showDeliveryIcons && (\r\n
\r\n {product!.isHomeDelivery ? (\r\n
\r\n ) : (\r\n
\r\n )}\r\n {product!.isCnC ?
:
}\r\n
\r\n )}\r\n
\r\n
\r\n {isProductBundles &&\r\n
\r\n \r\n \r\n
\r\n }\r\n
\r\n {checkClubPlusDiscounts && checkUserLoyalty && (\r\n
\r\n

Club Plus Price

\r\n

£{product.Price.toFixed(2)}

\r\n
\r\n )}\r\n {checkClubPlusDiscounts && checkUserLoyalty === undefined && (\r\n
\r\n {product.clubPlusBanner && (\r\n
\r\n
hideBanner && hideBanner(product.RecordId)} className='product-card-club-plus-cross'>
\r\n

\r\n {/* Join Dobbies Club Plus for just £12 a year and enjoy 10% off on plants, bulbs and Seeds.{' '} */}\r\n Join Club Plus and save 10% on plants, bulbs and seeds all year round\r\n \r\n {' '}\r\n Find out more\r\n \r\n

\r\n
\r\n )}\r\n
\r\n

Club Plus Price

\r\n

£{product.Price.toFixed(2)}

\r\n
showBanner && showBanner(product.RecordId)} className='product-card-club-plus-icon'>\r\n

?

\r\n
\r\n
\r\n
\r\n )}\r\n
\r\n
: <>\r\n );\r\n};\r\n\r\nfunction getProductName(product: IProductWithModes | undefined, productName: string): string | undefined {\r\n let prodName = '';\r\n if (product && product.AttributeValues?.length == 0) {\r\n prodName = productName;\r\n } else {\r\n product &&\r\n product.AttributeValues?.map((val: AttributeValue) => {\r\n if (val.Name === 'EComName' && val.TextValue !== '') {\r\n prodName = val.TextValue!;\r\n } else {\r\n prodName = productName;\r\n }\r\n });\r\n }\r\n return prodName;\r\n}\r\n\r\nfunction renderLabel(name?: string, price?: string, rating?: number, ratingAriaLabel?: string): string {\r\n name = name || '';\r\n price = price || '';\r\n return `${name} ${price} ${getRatingAriaLabel(rating, ratingAriaLabel)}`;\r\n}\r\n\r\n// function renderDescription(description?: string): JSX.Element | null {\r\n// return

{description}

;\r\n// }\r\n\r\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\r\n if (rating && ratingAriaLabel) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabel || '', roundedRating, '5');\r\n }\r\n return '';\r\n}\r\n\r\nfunction updateProductUrl(productUrl: string, context: ICoreContext): string {\r\n const srcUrl = new URL(productUrl, context.request.apiSettings.baseUrl);\r\n const queryString = `back=true`;\r\n if (srcUrl.search) {\r\n srcUrl.search += `&${queryString}`;\r\n } else {\r\n srcUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(srcUrl.href);\r\n return updatedUrl.pathname + srcUrl.search;\r\n}\r\n\r\nfunction renderRating(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\r\n avgRating?: number,\r\n totalRatings?: number,\r\n ariaLabel?: string\r\n): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n // display empty box to match the design of when rating isnt there on product component\r\n }\r\n\r\n const numRatings = (totalRatings && totalRatings.toString()) || undefined;\r\n const ratingAriaLabel = getRatingAriaLabel(avgRating, ariaLabel);\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nfunction renderPrice(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\r\n basePrice?: number,\r\n adjustedPrice?: number,\r\n savingsText?: string,\r\n freePriceText?: string,\r\n originalPriceText?: string,\r\n currentPriceText?: string,\r\n discountLine?: DiscountLine[] | undefined,\r\n cartData?: Cart | undefined,\r\n updatedPrice?: number,\r\n getTierId?: () => number | undefined,\r\n clubPlusDiscountsOfferId?: DiscountLine | undefined | false\r\n): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice\r\n };\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\n//VSI CUSTOMIZATION -START - Task 11167: PLP hover image flip\r\nasync function validateMediaLocaionAsync(uri: string): Promise<[IImageData, boolean]> {\r\n const imageData = {\r\n src: uri || '',\r\n altText: ''\r\n };\r\n if (imageData.src === '') {\r\n return [imageData, false];\r\n }\r\n return new Promise<[IImageData, boolean]>(resolve => {\r\n try {\r\n const http = new XMLHttpRequest();\r\n http.open('HEAD', imageData.src, true);\r\n http.addEventListener('load', () => {\r\n resolve([imageData, http.status === 200 || http.status === 201]);\r\n });\r\n http.addEventListener('error', () => {\r\n resolve([imageData, false]);\r\n });\r\n http.send();\r\n } catch {\r\n resolve([imageData, false]);\r\n }\r\n });\r\n}\r\n//VSI CUSTOMIZATION -END - Task 11167: PLP hover image flip\r\nfunction renderProductPlacementImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n altText?: string,\r\n apiSettings?: ICommerceApiSettings\r\n): JSX.Element | null {\r\n if (!imageUrl || !gridSettings || !imageSettings || !apiSettings) {\r\n return null;\r\n }\r\n\r\n const newImageUrl = generateImageUrl(imageUrl, apiSettings);\r\n\r\n const img: IImageData = {\r\n src: newImageUrl ? newImageUrl : '',\r\n altText: altText ? altText : ''\r\n };\r\n const imageProps = {\r\n gridSettings: gridSettings,\r\n imageSettings: imageSettings\r\n };\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n\r\n // debugger;\r\n return ;\r\n}\r\n\r\n// @ts-ignore\r\nexport const ProductComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n IProductComponent\r\n>('Product', { component: ProductCard, ...PriceComponentActions });\r\n\r\nexport default ProductComponent;\r\n","import classnames from 'classnames';\r\nimport * as React from 'react';\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\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ProductPrice, DiscountLine, Cart } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\r\n className?: string;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n discountLine?: DiscountLine[] | undefined;\r\n cartData?: Cart;\r\n updatedPrice?: number;\r\n currencyCode?: string;\r\n getTierId?: () => number | undefined;\r\n clubPlusDiscountsOfferId?: DiscountLine | undefined | false;\r\n}\r\nexport interface IPriceComponent extends IComponent {}\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst Price: React.FC = (props: IPriceComponentProps) => {\r\n // CustomerContextualPrice could be 0\r\n if (props.data.price.CustomerContextualPrice === undefined) {\r\n return null;\r\n }\r\n\r\n //loyalty &&\r\n\r\n return (\r\n \r\n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\r\n \r\n );\r\n};\r\n\r\nconst showStrikethroughPricing = (props: IPriceComponentProps) => {\r\n const originalPrice = getOriginalPrice(props);\r\n\r\n if (originalPrice && props.data.price.CustomerContextualPrice) {\r\n return originalPrice > props.data.price.CustomerContextualPrice;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nconst getOriginalPrice = (props: IPriceComponentProps) => {\r\n return Math.max(props.data.price.BasePrice || 0, props.data.price.TradeAgreementPrice || 0, props.data.price.AdjustedPrice || 0);\r\n};\r\n\r\nconst renderCurrentPrice = (props: IPriceComponentProps, clubPlusDiscountsOfferId?: DiscountLine, checkUserLoyalty?: boolean): JSX.Element | undefined => {\r\n const initialPrice = formatCurrency(props, props.data.price.CustomerContextualPrice);\r\n return (\r\n \r\n {initialPrice}\r\n \r\n );\r\n};\r\n\r\nconst formatCurrency = (props: IPriceComponentProps, price: number | undefined): string | undefined => {\r\n if (price === undefined) {\r\n return undefined;\r\n }\r\n\r\n if (price === 0 && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(price, props.currencyCode);\r\n};\r\n\r\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element | null => {\r\n const originalPrice = getOriginalPrice(props);\r\n const initialPrice = formatCurrency(props, originalPrice);\r\n\r\n const checkClubPlusDiscounts = props.discountLine && props.discountLine.find(x => x.OfferId === props.context.app.config.discountId);\r\n const checkUserLoyalty = props.getTierId && props.getTierId() === props.context.app.config.LoyaltyTierId ? true : undefined;\r\n // props.cartData &&\r\n // props.cartData.AffiliationLines &&\r\n // props.cartData.AffiliationLines.find(x => x.LoyaltyTierId === props.context.app.config.LoyaltyTierId);\r\n const checkNonClubPlusDiscounts = props.discountLine && props.discountLine.find(x => x.OfferId !== props.context.app.config.discountId);\r\n\r\n const clubPlusFormatCurrency = (\r\n props: IPriceComponentProps,\r\n price: number | undefined,\r\n nonClubPlusPrice: number | undefined\r\n ): string | undefined => {\r\n if (price === undefined) {\r\n return undefined;\r\n }\r\n if (price === 0 && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n if (nonClubPlusPrice === undefined) {\r\n return undefined;\r\n }\r\n if (nonClubPlusPrice === 0 && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(nonClubPlusPrice, props.context.request.channel?.Currency);\r\n };\r\n\r\n const renderClubPlusCurrentPrice = (props: IPriceComponentProps): JSX.Element | undefined => {\r\n const initialPrice = clubPlusFormatCurrency(props, props.data.price.CustomerContextualPrice, props.updatedPrice);\r\n return (\r\n \r\n {initialPrice}\r\n \r\n );\r\n };\r\n\r\n return (\r\n <>\r\n {checkClubPlusDiscounts && checkUserLoyalty ? (\r\n <>\r\n \r\n {' '}\r\n {props.originalPriceText} {initialPrice} {props.currentPriceText} {renderCurrentPrice(props)}\r\n \r\n {/* VSI Customization - Start - 23/10/2020 */}\r\n {/* Displayed discounted price on the left, Actual price on the right */}\r\n\r\n \r\n \r\n ) : checkClubPlusDiscounts && checkNonClubPlusDiscounts && checkUserLoyalty === undefined ? (\r\n <>\r\n \r\n {' '}\r\n {props.originalPriceText} {initialPrice} {props.currentPriceText} {renderCurrentPrice(props)}\r\n \r\n {/* VSI Customization - Start - 23/10/2020 */}\r\n {/* Displayed discounted price on the left, Actual price on the right */}\r\n \r\n \r\n {/* VSI - Customization - End */}\r\n {props.savingsText && {props.savingsText}}\r\n \r\n ) : checkClubPlusDiscounts && checkUserLoyalty === undefined ? (\r\n <>\r\n \r\n {' '}\r\n {props.originalPriceText} {initialPrice} {props.currentPriceText} {renderCurrentPrice(props)}\r\n \r\n {/* VSI Customization - Start - 23/10/2020 */}\r\n {/* Displayed discounted price on the left, Actual price on the right */}\r\n\r\n \r\n \r\n ) : (\r\n <>\r\n \r\n {' '}\r\n {props.originalPriceText} {initialPrice} {props.currentPriceText} {renderCurrentPrice(props)}\r\n \r\n {/* VSI Customization - Start - 23/10/2020 */}\r\n {/* Displayed discounted price on the left, Actual price on the right */}\r\n \r\n {props.clubPlusDiscountsOfferId && checkUserLoyalty ? (\r\n \r\n ) : (\r\n \r\n )}\r\n {/* VSI - Customization - End */}\r\n {props.savingsText && {props.savingsText}}\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\n// @ts-ignore\r\nexport const PriceComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'Price',\r\n { component: Price, ...PriceComponentActions }\r\n);\r\n\r\nexport default PriceComponent;\r\n"],"names":["CartModulesStateShareInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","async","updateCartStateAction","input","ctx","isCartUpdated","undefined","isQuantityUpdated","createObservableDataAction","action","inputData","badgePageType","VSIRestAPIHandlerExtensionClass","odataObject","this","Id","newObj","Status","NoOfTransactions","result","ExtensionProperties","i","length","className","substr","lastIndexOf","concat","EntityClasses","createVSIInitiateRestCallInput","ItemID","NoOfHours","Company","id","key","DataServiceQuery","DataServiceEntities","vSIGetAPIResponseQuery","createDataServiceRequestForOperation","bypassCache","returnEntity","VsiProductBadges","React","props","super","findBannerData","_this$props$mediaGall","mediaGalleryProduct","ItemId","_this$props$mediaGall2","context","callerContext","actionContext","res","request","callActionOrExecute","vSIInitiateRestCallAsync","app","config","popularityBannerHours","popularityBannerCompany","_res$result","_res$result2","setState","showBannerStatus","totalProdTransaction","err","console","log","componentDidUpdate","prevProps","getDataOnUpdate","componentDidMount","productComponentProduct","_shouldShowOutOfStock","productAvailableData","moduleType","recordId","masterProductId","productId","pdp","_attributes","_attName$TextValue","product","attributes","RecordId","MasterProductId","plp","AttributeValues","state","productAttributes","getProductAttrbute","attName","find","onlystore","Name","AttValue","TextValue","toLocaleLowerCase","IsProductAvailable","renderDefaultBadge","badgeStyle","style","discount","ratingInput","GetRatingsSummaryInput","toString","getRnrPartnerId","getRnrEndpointId","ratings","getRatingsSummary","ratingValue","averageRating","rating","priceInput","PriceForSelectedVariantInput","apiSettings","channelId","requestContext","user","customerAccountNumber","productPriceResult","getPriceForSelectedVariant","price","BasePrice","Math","max","TradeAgreementPrice","AdjustedPrice","Price","CustomerContextualPrice","productPrice","AverageRating","productAttributeResult","getAttributeValuesAsync","queryResultSettings","catalogId","badgeDisplay","imageBadge","showPromotionalBanner","render","appConfig","moduleConfig","badgeFontColor","badgeBackgroundColor","badgeFontBold","badgeShow","badgeBorderShow","badgeRating","imageBadgeLeftAlign","color","backgroundColor","border","fontWeight","badgeStyleRight","float","parentClassName","showOutofStock","_renderProductBadge","Number","popularityBannerThreshold","_renderPromotionalBanner","display","alignItems","justifyContent","alignContent","marginRight","marginTop","marginLeft","fontSize","textAlign","_renderImageBadge","attributeName","attribute","findIndex","x","attributeValue","baseImageURL","baseImageUrl","badgeImage","trim","toLowerCase","img","src","altText","imageProps","gridSettings","imageSettings","Image","Object","assign","loadFailureBehavior","_renderDiscountBadgePercentage","round","_renderRatingBadge","topRating","badgeRatingText","_renderOutofStockBadge","exitBadgeStyle","badgeHeadingStyle","badgeDescriptionStyle","_displayPromotionalBanner","onClick","_renderDiscountBadgeAmount","toFixed","_this$props$context$r","discountWithCurrenceySign","cultureFormatter","formatCurrency","channel","Currency","_renderCustomAttributeBadge","_this$props$productCo","BadgeType","Quantity","inputRef","_validateMin","minValue","min","isNaN","currentInput","onChange","currentCount","_onIncrement","bind","_onDecrement","_handleChange","reaction","glyphMinusClassName","decrementGlyphClass","glyphPlusClassName","incrementGlyphClass","disabled","incDisabled","currentValue","extraClass","extraClassInc","hideQuantityControls","title","decrementButtonAriaLabel","tabIndex","type","pattern","value","onBlur","inputQuantityAriaLabel","role","ref","disabledInput","incrementButtonAriaLabel","invokeCallback","currQuantity","updatedQuantity","e","parseInt","target","inputElement","current","HTMLInputElement","debounce","setAttribute","defaultProps","__decorate","observer","getProductName","productName","_product$AttributeVal","prodName","_product$AttributeVal2","map","val","renderLabel","name","ratingAriaLabel","getRatingAriaLabel","roundedRating","format","renderProductPlacementImage","imageUrl","newImageUrl","generateImageUrl","cropFocalRegion","ProductComponent","msdyn365Commerce","createComponentOverride","_objectSpread","component","_ref","_data$product","_context$request$chan","data","savingsText","freePriceText","originalPriceText","currentPriceText","allowBack","typeName","telemetryContent","quickViewButton","wishlists","discountLine","badgeLink","showBanner","hideBanner","showDeliveryIcons","IsMasterProduct","isMobile","loyalty","nonClubPlusDiscount","isProductAddedToBundles","maxQuantityForBundle","redirectToCartEnabled","isProductBundles","isBundlesModal","simpleProduct","onQuantityChangeListener","onBundleProductCheckBoxSelected","cartData","setCartData","updatedProductPrice","setUpdatedProductPrice","isHover","setIsHover","useState","productImageRef","useRef","currBundleQuantity","setCurrBundleQuantity","images","setImages","isPrimaryUrl","primaryUrl","_cookies$get","getCartState","then","cartState","_cartState$cart","cartlines","cart","CartLines","cl","ProductId","catch","update","addedProductsToCollection","cookies","get","Array","isArray","obj","resetQuantity","_cartState$cart$CartL","c","fullImgUrl","uri","imageData","Promise","resolve","http","XMLHttpRequest","open","addEventListener","status","send","_unused","validateMediaLocaionAsync","error","telemetry","exception","debug","productUrl","getProductPageUrlSync","srcUrl","URL","baseUrl","queryString","search","href","pathname","updateProductUrl","getCartData","getCartFromCustomer","_cartState$cart$CartL2","resetQuantityOnLoad","checkboxClicked","_cartState$cart$CartL3","_cookies$get2","cartlineToRemove","cartLineIds","LineId","removeCartLines","productsAddedInBundles","updatedProductsAddedInBundles","prod","dobbiesProductData","quantity","maxQuantity","push","set","deSelectProduct","_productImageRef$curr","preventDefault","payLoad","getPayloadObject","getTelemetryAttributes","getTierId","_loyalty$LoyaltyGroup","LoyaltyGroups","_loyalty$LoyaltyGroup2","_loyalty$LoyaltyGroup3","highestActiveLoyaltyCardTier","HighestActiveLoyaltyCardTier","loyaltyCardTiers","LoyaltyCardTiers","loyaltyCardTier","tier","LoyaltyTierRecordId","checkClubPlusDiscounts","OfferId","discountId","checkUserLoyalty","LoyaltyTierId","membershipDiscount","membershipDiscountId","onMouseOver","onMouseLeave","onTelemetryClick","position","checked","xmlns","width","height","viewBox","d","stroke","fill","outline","PrimaryImageUrl","quickview","item","selectedProductId","renderQuickView","AddToWishlistComponent","addToWishlistButtonText","removeFromWishlistButtonText","addToWishlistMessage","removedFromWishlistMessage","addItemToWishlistError","removeItemFromWishlistError","nameOfWishlist","ariaRole","basePrice","adjustedPrice","updatedPrice","clubPlusDiscountsOfferId","PriceComponent","renderPrice","DiscountLines","hideRating","avgRating","totalRatings","ariaLabel","numRatings","RatingComponent","ratingCount","readOnly","renderRating","TotalRatings","isHomeDelivery","isCnC","_cartState$cart$CartL4","_cookies$get3","newValue","_context$actionContex","diffInQuantity","deliveryOptions","getDeliveryOptionsAsync","emailDeliveryModeCode","EmailDeliveryModeCode","addProductToCartInput","enableStockCheck","availableQuantity","isAddEmailDeliveryItemToCart","ArrayExtensions","hasElements","DeliveryOptions","Code","addProductToCart","cartLineQuantityUpdatedAsync","cartActionResult","updatedProducts","valueToBeUpdated","clubPlusBanner","showStrikethroughPricing","originalPrice","getOriginalPrice","renderCurrentPrice","initialPrice","itemProp","currencyCode","renderCurrentPriceWithOriginalPrice","checkNonClubPlusDiscounts","clubPlusFormatCurrency","nonClubPlusPrice","_props$context$reques","renderClubPlusCurrentPrice","classnames"],"sourceRoot":""}