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EAF4B,kEACXO,EAAQ,KAQzBP,EAF4B,+FACXO,EAAQ,KAQzBP,EAF4B,kEACXO,EAAQ,KAQzBP,EAF4B,0EACXO,EAAQ,MAQzBP,EAF4B,uEACXO,EAAQ,KAQzBP,EAF4B,+EACXO,EAAQ,MAQzBP,EAF4B,mFACXO,EAAQ,MAMjCzT,OAAOqU,aAAerU,OAAOqU,cAAgB,GAC7CrU,OAAOqU,aAAarB,QAAOlI,EAAAA,EAAA,GACpB9K,OAAOqU,aAAarB,SAAW,IAC/BD,EAAQC,SAGXhT,OAAOqU,aAAapB,YAAWnI,EAAAA,EAAA,GAC5B9K,OAAOqU,aAAapB,aAAe,IACnCF,EAAQE,aAEY,MAAMqB,EAAiB,GAC9BA,EAAe,2DAA6D,CACpFd,EAAGA,IAAMC,EAAQ,MACjBc,GAAI,qCAEpBD,EAAe,uDAAyD,CACxDd,EAAGA,IAAMC,EAAQ,MACjBc,GAAI,qCAEpBvU,OAAOqU,aAAerU,OAAOqU,cAAgB,GAC7CrU,OAAOqU,aAAaC,eAAcxJ,EAAAA,EAAA,GACP9K,OAAOqU,aAAaC,gBAAkB,IACtCA,UCxI3BE,EAAOC,QAAUnZ,cCAjBkZ,EAAOC,QAAUC","sources":["webpack://bestseller.commerce.online/./src/modules/ext-cart-icon/ext-cart-icon.props.autogenerated.ts?8e74","webpack://bestseller.commerce.online/./src/modules/ext-cart-icon/components/flyout-cart-line-items.tsx?712c","webpack://bestseller.commerce.online/./src/modules/ext-cart-icon/utils/get-products-in-mini-cart.ts?0db3","webpack://bestseller.commerce.online/./src/modules/ext-cart-icon/ext-cart-icon.tsx?435e","webpack://bestseller.commerce.online/./src/modules/ext-cart-icon/ext-cart-icon.view.tsx?650f","webpack://bestseller.commerce.online/./src/themes/only/views/ext-cart-icon.view.tsx?7b23","webpack://bestseller.commerce.online/./lib/ext-cart-icon/module-registration.js?487e","webpack://bestseller.commerce.online/external var \"React\"?0d3b","webpack://bestseller.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 * IExtCartIcon 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\n\r\nexport const enum cartLinesSortOrder {\r\n ascending = 'ascending',\r\n descending = 'descending'\r\n}\r\n\r\nexport interface IExtCartIconConfig extends Msdyn365.IModuleConfig {\r\n imageSettings?: Msdyn365.IImageSettings;\r\n enableHoverCart?: boolean;\r\n cartLinesSortOrder?: cartLinesSortOrder;\r\n isAnonymousCheckout?: boolean;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface IExtCartIconResources {\r\n goToCartButtonTitle: string;\r\n totalPriceFormatString: string;\r\n guestCheckoutButtonTitle: string;\r\n checkoutButtonTitle: string;\r\n productDimensionTypeColor: string;\r\n productDimensionTypeSize: string;\r\n productDimensionTypeStyle: string;\r\n productDimensionTypeConfiguration: string;\r\n quantityDisplayText: string;\r\n removeCartButtonText: string;\r\n cartLabel: string;\r\n cartQtyLabel: string;\r\n flyoutTitle: string;\r\n salesAgreementPricePrompt: string;\r\n shippingText: string;\r\n checkoutBlockedDueToUnavailableFundsTitle: string;\r\n checkoutBlockedDueToUnavailableFundsMessage: string;\r\n memberPriceMessage: string;\r\n saleMessage: string;\r\n}\r\n\r\nexport interface IExtCartIconProps extends Msdyn365.IModule {\r\n resources: IExtCartIconResources;\r\n config: IExtCartIconConfig;\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 MsDyn365, { ICoreContext, IGridSettings, IImageSettings, ITelemetry, isChannelTypeB2B } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n OrgUnitLocation,\r\n ProductAvailableQuantity,\r\n ProductDeliveryOptions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { ProductCatalog, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { getProductUrlSync, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '@msdyn365-commerce-modules/cart';\r\nimport CartLineItemComponent, { ICartlineResourceString } from '../../../shared/components/cartlineitem.component';\r\n\r\nexport interface IFlyoutCartLineItemsProps {\r\n cartlines: CartLine[];\r\n cartState: ICartState | undefined;\r\n orgUnitLocations: OrgUnitLocation[] | undefined;\r\n resources: ICartlineResourceString;\r\n productAvailabilites: IProductInventoryInformation[] | undefined;\r\n products: SimpleProduct[] | undefined;\r\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\r\n pickupDeliveryModeCode?: string;\r\n catalogs?: ProductCatalog[];\r\n\r\n /**\r\n * GridSettings for the product image in cartline\r\n */\r\n gridSettings: IGridSettings;\r\n\r\n /**\r\n * ImageSettings for the product image in cartline\r\n */\r\n imageSettings: IImageSettings;\r\n id: string;\r\n typeName: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n removeButtonText: string;\r\n outOfStockText: string;\r\n outOfRangeOneText: string;\r\n outOfRangeFormatText: string;\r\n maxCartlineQuantity: number;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n\r\n outOfStockThreshold: number;\r\n isStockCheckEnabled: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n}\r\n\r\nexport interface IFlyoutCartLineItemViewProps {\r\n cartline: React.ReactNode;\r\n remove: React.ReactNode;\r\n storeLocation: React.ReactNode;\r\n hasError: boolean;\r\n\r\n data: {\r\n product: SimpleProduct;\r\n cartline: CartLine;\r\n };\r\n}\r\n\r\nconst _getCartItemAvailableQuantity = (\r\n isStockCheckEnabled: boolean,\r\n outOfStockThreshold: number,\r\n productAvailability?: ProductAvailableQuantity\r\n): number => {\r\n if (isStockCheckEnabled) {\r\n if (\r\n !productAvailability ||\r\n !productAvailability.AvailableQuantity ||\r\n productAvailability.AvailableQuantity <= 0 ||\r\n productAvailability.AvailableQuantity <= outOfStockThreshold\r\n ) {\r\n return 0;\r\n }\r\n return productAvailability.AvailableQuantity - outOfStockThreshold;\r\n }\r\n\r\n return 0;\r\n};\r\n\r\nconst _getCartItemMaxQuantity = (\r\n maxQuantityByConfig: number,\r\n isStockCheckEnabled: boolean,\r\n availableQuantityInStock: number,\r\n isQuantityLimitsFeatureEnabled: boolean,\r\n maxByQuantityLimitsFeature: number\r\n) => {\r\n if (isQuantityLimitsFeatureEnabled) {\r\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\r\n\r\n // If max by feature in not defined when feature is on then we suggest that there is no max by feature\r\n // and consider available qty if stock check enabled and max from config in site settings.\r\n if (!maxByQuantityLimitsFeature) {\r\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\r\n }\r\n\r\n return isStockCheckEnabled\r\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\r\n ? maxByQuantityLimitsFeatureResult\r\n : availableQuantityInStock\r\n : maxByQuantityLimitsFeatureResult;\r\n }\r\n if (isStockCheckEnabled) {\r\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\r\n }\r\n return maxQuantityByConfig;\r\n};\r\n\r\n/**\r\n * On Remove Click functionality.\r\n * @param removeItemClickHandler -Remove item click function.\r\n * @param cartline -CartLine.\r\n * @returns Remove change value.\r\n */\r\nconst onRemoveClickFunction = (removeItemClickHandler: (cartlineToRemove: CartLine) => void, cartline: CartLine) => () => {\r\n removeItemClickHandler(cartline);\r\n};\r\nconst _assembleNode = (\r\n cartline: CartLine,\r\n product: SimpleProduct,\r\n props: IFlyoutCartLineItemsProps,\r\n index: number,\r\n foundProductAvailability?: ProductAvailableQuantity,\r\n foundProductDeliveryOptions?: ProductDeliveryOptions\r\n): IFlyoutCartLineItemViewProps => {\r\n const { imageSettings, gridSettings, id, typeName, context, resources, removeButtonText, removeItemClickHandler } = props;\r\n\r\n const availableQuantityInStock = _getCartItemAvailableQuantity(\r\n props.isStockCheckEnabled,\r\n props.outOfStockThreshold,\r\n foundProductAvailability\r\n );\r\n const maxQuantity =\r\n product &&\r\n _getCartItemMaxQuantity(\r\n props.maxCartlineQuantity,\r\n props.isStockCheckEnabled,\r\n availableQuantityInStock,\r\n props.isQuantityLimitsFeatureEnabled,\r\n product?.Behavior?.MaximumQuantity || 0\r\n );\r\n\r\n // Check if the product is service or not by product type\r\n const isServiceItem = product.ItemTypeValue === ReleasedProductType.Service;\r\n\r\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.RemoveCartItem);\r\n const removeCartItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n\r\n let productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\r\n if (MsDyn365.isBrowser && isChannelTypeB2B(props.context.actionContext.requestContext)) {\r\n const fullUrl = new URL(productUrl, window.location.href);\r\n fullUrl.searchParams.set('catalogid', `${cartline.CatalogId ?? 0}`);\r\n productUrl = fullUrl.href;\r\n }\r\n\r\n return {\r\n data: {\r\n product,\r\n cartline\r\n },\r\n hasError: !isServiceItem && props.isStockCheckEnabled ? cartline.Quantity! > maxQuantity : false,\r\n cartline: (\r\n \r\n ),\r\n remove: (\r\n \r\n {removeButtonText}\r\n \r\n ),\r\n storeLocation: _renderStoreLocation(cartline, props)\r\n };\r\n};\r\n\r\nconst _renderDeliveryLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): string | undefined => {\r\n let deliverylocation;\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\r\n\r\n let foundProductDeliveryOption;\r\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\r\n return deliveryOption && deliveryOption.ProductId === cartLine.ProductId;\r\n });\r\n }\r\n const delivery = foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === cartLine.DeliveryMode);\r\n const location = delivery?.Description;\r\n\r\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\r\n if (location) {\r\n deliverylocation = `${location}, ${orgUnitName}`;\r\n } else {\r\n deliverylocation = `${orgUnitName}`;\r\n }\r\n } else {\r\n deliverylocation = props.resources.shippingText;\r\n }\r\n return deliverylocation;\r\n};\r\n\r\nconst _renderStoreLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): JSX.Element | null => {\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\r\n\r\n if (orgUnitName) {\r\n return (\r\n
\r\n {orgUnitName}\r\n
\r\n );\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nconst _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\r\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\r\n return '';\r\n }\r\n\r\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\r\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\r\n });\r\n\r\n if (foundLocation) {\r\n return foundLocation.OrgUnitName;\r\n }\r\n return fulfillmentStoreId;\r\n};\r\n\r\nconst _assembleCartlines = (\r\n cartlines: CartLine[],\r\n products: SimpleProduct[] | undefined,\r\n props: IFlyoutCartLineItemsProps\r\n): IFlyoutCartLineItemViewProps[] | null => {\r\n const reactNodes: IFlyoutCartLineItemViewProps[] = [];\r\n\r\n if (!products || products.length === 0) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n cartlines.map((cartline, index) => {\r\n let product;\r\n if (props.isQuantityLimitsFeatureEnabled) {\r\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\r\n // to check productId and WarehouseId for identification.\r\n product = getProductByProductIdAndWarehouse(cartline.ProductId, products, cartline.WarehouseId, props.cartState);\r\n } else {\r\n product = getProductByProductId(cartline.ProductId, products);\r\n }\r\n let foundProductAvailability;\r\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\r\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\r\n return productAvailability.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\r\n });\r\n }\r\n let foundProductDeliveryOption;\r\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\r\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\r\n });\r\n }\r\n if (product) {\r\n reactNodes.push(\r\n _assembleNode(\r\n cartline,\r\n product,\r\n props,\r\n index,\r\n foundProductAvailability?.ProductAvailableQuantity,\r\n foundProductDeliveryOption\r\n )\r\n );\r\n }\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLineItems component.\r\n */\r\n\r\nexport const FlyoutCartLineItems = (props: IFlyoutCartLineItemsProps) => {\r\n const { products, cartlines } = props;\r\n return _assembleCartlines(cartlines, products, props);\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 { IActionContext } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ActiveCartProductsInput,\r\n getAvailabilitiesForCartLineItems,\r\n getDeliveryOptionsForCartLineItems,\r\n IProductInventoryInformation,\r\n ProductAvailabilitiesForCartLineItems,\r\n ProductDeliveryOptionsForCartLineItems\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getActiveCartProductsAction } from '../../../actions/get-products-in-active-cart';\r\n\r\n/**\r\n * IMiniCartData entity interface.\r\n */\r\nexport interface IMiniCartData {\r\n products?: SimpleProduct[];\r\n productAvailabilites?: IProductInventoryInformation[];\r\n deliveryOptions?: ProductDeliveryOptions[];\r\n}\r\n\r\nexport const createInput = () => {\r\n return new ActiveCartProductsInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a mini cart data.\r\n * @param ctx\r\n * @param cartState\r\n */\r\nexport async function getMiniCartData(ctx: IActionContext, cartState: ICartState): Promise {\r\n const miniCartData: IMiniCartData = {};\r\n\r\n const cart = cartState.cart;\r\n\r\n // If there are cart lines, make call to get products\r\n // If there are invocie linese, then there is no products, so don't make call to get products\r\n if (cart && cart.CartLines && cart.CartLines.length > 0 && !cartState.hasInvoiceLine) {\r\n await getActiveCartProductsAction(new ActiveCartProductsInput(), ctx)\r\n .then(products => {\r\n if (products) {\r\n miniCartData.products = products;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\r\n });\r\n\r\n await getAvailabilitiesForCartLineItems(new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings), ctx)\r\n .then(availableQuantity => {\r\n if (availableQuantity) {\r\n miniCartData.productAvailabilites = availableQuantity;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\r\n });\r\n\r\n await getDeliveryOptionsForCartLineItems(new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx)\r\n .then(deliveryOptions => {\r\n if (deliveryOptions) {\r\n miniCartData.deliveryOptions = deliveryOptions;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\r\n });\r\n }\r\n\r\n return miniCartData;\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 { AddToCartBehavior, CartIconComponent } from '@msdyn365-commerce/components';\r\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n CartLineValidationResultsByLineId,\r\n OrgUnitLocation\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\nimport { ArrayExtensions, validateCartLinesInventory } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n INodeProps,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n UncontrolledTooltip,\r\n updateMaxQuantityForCartLineItem,\r\n urlCheck\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport React from 'react';\r\n\r\nimport { IExtCartIconData } from './ext-cart-icon.data';\r\nimport { cartLinesSortOrder, IExtCartIconProps } from './ext-cart-icon.props.autogenerated';\r\nimport { FlyoutCartLineItems, IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\r\nimport { getMiniCartData, IMiniCartData } from './utils/get-products-in-mini-cart';\r\n\r\nexport interface IMiniCartState {\r\n miniCartData: IMiniCartData;\r\n orgUnitLocations?: OrgUnitLocation[];\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n isCartValid: boolean;\r\n}\r\n\r\nexport interface ICartIconViewProps extends IExtCartIconProps {\r\n className: string;\r\n cartIcon: React.ReactNode;\r\n FlyoutContainer?: INodeProps;\r\n CartlinesWrapper: INodeProps;\r\n miniCartWrapper: INodeProps;\r\n miniCartItemWrapper: INodeProps;\r\n cartlines?: IFlyoutCartLineItemViewProps[];\r\n flyoutTitle: React.ReactNode;\r\n totalPrice: React.ReactNode;\r\n checkoutAsGuestButton?: React.ReactNode;\r\n checkoutAsSignInUserButton?: React.ReactNode;\r\n goToCartButton?: React.ReactNode;\r\n waitingComponent?: React.ReactNode;\r\n isCartLoading: boolean;\r\n checkoutBlockedDueToUnavailableFunds?: React.ReactNode;\r\n\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n}\r\n\r\n/**\r\n *\r\n * Cart component.\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nclass CartIcon extends React.Component, IMiniCartState> {\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly checkoutBySignInAttributes: IDictionary | undefined;\r\n\r\n private readonly checkoutByGuestAttributes: IDictionary | undefined;\r\n\r\n private readonly viewShoppingBagAttributes: IDictionary | undefined;\r\n\r\n private retailMultiplePickUpOptionEnabled?: boolean = false;\r\n\r\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n private lastValidatedCartVersion: number | undefined;\r\n\r\n constructor(props: IExtCartIconProps) {\r\n super(props);\r\n this.state = {\r\n miniCartData: {},\r\n isCartValid: true,\r\n isQuantityLimitsFeatureEnabled: false\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 const payload = getPayloadObject(TelemetryEvent.CheckOut, this.telemetryContent, TelemetryConstant.Checkout);\r\n this.checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n\r\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\r\n this.checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n\r\n payload.contentAction.etext = TelemetryConstant.ViewShoppingBag;\r\n this.viewShoppingBagAttributes = getTelemetryAttributes(this.telemetryContent, payload);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const context = this.props.context.actionContext;\r\n\r\n reaction(\r\n () => this.props.data.cart.result?.cart.CartLines,\r\n async () => {\r\n this.setState({\r\n miniCartData: await getMiniCartData(context, this.props.data.cart.result!)\r\n });\r\n }\r\n );\r\n await this._setQuantityLimitsFeatureFlag();\r\n\r\n this.setState({\r\n orgUnitLocations: this.props.data.orgUnitLocations?.result\r\n });\r\n\r\n this._validateCart();\r\n }\r\n\r\n public componentDidUpdate(prevProps: IExtCartIconProps): void {\r\n this._validateCart();\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IExtCartIconProps, nextState: IMiniCartState): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n // eslint-disable-next-line complexity -- disabling the complexity for this method for now as its causing lot of other warnings\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n typeName,\r\n config: { enableHoverCart, isAnonymousCheckout },\r\n context: {\r\n request: {\r\n user: { isAuthenticated, signInUrl }\r\n }\r\n },\r\n context,\r\n resources\r\n } = this.props;\r\n\r\n const cart = (this.props.data.cart && this.props.data.cart.result) || undefined;\r\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\r\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\r\n const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\r\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\r\n const shouldShowMiniCart =\r\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n const hasInvoiceLine = cart?.hasInvoiceLine;\r\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\r\n const cartLines = this._getCartLines();\r\n const validInventoryAcrossCartLines = validateCartLinesInventory(\r\n cart?.cart.CartLines ?? [],\r\n this.state.miniCartData.productAvailabilites ?? [],\r\n this.props.context.actionContext,\r\n this.state.miniCartData.products ?? [],\r\n emailDeliveryModeCode\r\n );\r\n const hasError =\r\n !validInventoryAcrossCartLines?.isValid ||\r\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\r\n (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\r\n const includeFlyout = this.props.data.cart && this.props.data.cart.status === 'SUCCESS' && enableHoverCart;\r\n const totalItemsInCart = cart?.totalItemsInCart ? cart.totalItemsInCart : 0;\r\n const goToCartButtonText = resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\r\n const flyoutTitle = resources.flyoutTitle;\r\n const flyoutTooltip = {\r\n tag: UncontrolledTooltip,\r\n shouldShowMiniCart,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__flyout-container',\r\n trigger: 'hover',\r\n displayMode: 'FLYOUT',\r\n target: id,\r\n shouldShowCloseButton: true,\r\n cartPageUrl: cartUrl,\r\n hideAriaHidden: true\r\n };\r\n\r\n // If there are invoice lines, don't update mini cart price\r\n const price = (cart && !cart.hasInvoiceLine && cart.cart.TotalAmount) || undefined;\r\n const priceString = price\r\n ? resources.totalPriceFormatString.replace('{price}', context.cultureFormatter.formatCurrency(price))\r\n : '';\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\r\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.find(\r\n feature => feature.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n cartIcon: (\r\n \r\n ),\r\n cartlines: cartLines,\r\n FlyoutContainer: includeFlyout ? flyoutTooltip : undefined,\r\n CartlinesWrapper: {\r\n className: 'ms-cart-icon__cart-lines'\r\n },\r\n miniCartWrapper: {\r\n className: classnames('ms-cart-icon'),\r\n id: this.props.id\r\n },\r\n miniCartItemWrapper: {\r\n className: classnames('msc-cart-lines-item')\r\n },\r\n\r\n // If there are invoice lines, don't update mini cart checkout button\r\n // Checkout button will display by default to maintain backward compatibility. When Anonymous user checkout is enabled &&\r\n // user is authenticated then we will show the checkout button otherwise we will show the guest checkout button.\r\n checkoutAsSignInUserButton:\r\n !isCartEmpty && !hasInvoiceLine && (!isAnonymousCheckout || isAuthenticated) ? (\r\n \r\n {resources.checkoutButtonTitle}\r\n \r\n ) : null,\r\n checkoutAsGuestButton:\r\n isAnonymousCheckout && !isCartEmpty && !isAuthenticated ? (\r\n \r\n {resources.guestCheckoutButtonTitle}\r\n \r\n ) : null,\r\n goToCartButton: (\r\n \r\n {goToCartButtonText}\r\n \r\n ),\r\n checkoutBlockedDueToUnavailableFunds: null,\r\n flyoutTitle: {flyoutTitle},\r\n totalPrice:
{priceString}
\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _validateCart(): void {\r\n const {\r\n data: { cart }\r\n } = this.props;\r\n const cartVersion = cart.result?.cart?.Version ?? undefined;\r\n if (this.lastValidatedCartVersion === cartVersion) {\r\n return;\r\n }\r\n\r\n this.lastValidatedCartVersion = cartVersion; // This field is populated to block concurrent requests\r\n\r\n if (this.state.isQuantityLimitsFeatureEnabled) {\r\n validateCartAsync(cart, this.props.telemetry, this.props.context)\r\n .then((result: CartLineValidationResultsByLineId | undefined) => {\r\n this.setState({ isCartValid: !ArrayExtensions.hasElements(result?.ValidationResultsPairs) });\r\n })\r\n .catch(() => {\r\n this.setState({ isCartValid: false });\r\n });\r\n } else {\r\n this.setState({ isCartValid: true });\r\n }\r\n }\r\n\r\n private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\r\n if (isAuthenticated) {\r\n return guestCheckoutUrl;\r\n }\r\n\r\n const isAbsoluteUrl = urlCheck(guestCheckoutUrl);\r\n let returnURL = guestCheckoutUrl;\r\n if (msdyn365Commerce.isBrowser && !isAbsoluteUrl) {\r\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\r\n }\r\n\r\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\r\n }\r\n\r\n /**\r\n * Sort cartline items.\r\n * @param cartlines - Cartlines to be sorted.\r\n * @param sortOrder - Ascending or descending.\r\n * @returns - Sorted cartlines.\r\n */\r\n private readonly getSortedCartLines = (cartlines: CartLine[], sortOrder?: cartLinesSortOrder): CartLine[] => {\r\n const lines: CartLine[] = [...cartlines];\r\n const zero: number = 0;\r\n\r\n if (sortOrder === cartLinesSortOrder.descending) {\r\n return lines.sort((item1, item2) => (item2.LineNumber ?? zero) - (item1.LineNumber ?? zero));\r\n }\r\n return lines.sort((item1, item2) => (item1.LineNumber ?? zero) - (item2.LineNumber ?? zero));\r\n };\r\n\r\n private _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\r\n const {\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n },\r\n config,\r\n telemetry,\r\n resources\r\n } = this.props;\r\n\r\n const imageSettings = this._getImageSettings(config.imageSettings);\r\n const cart = this.props.data.cart && this.props.data.cart.result;\r\n\r\n // Cart-icon could be placed in each page\r\n // so we check cart content to reduce number of RS calls\r\n return this.state.miniCartData.products && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0\r\n ? FlyoutCartLineItems({\r\n cartlines: this.getSortedCartLines(cart.cart.CartLines, config.cartLinesSortOrder),\r\n products: this.state.miniCartData.products,\r\n productAvailabilites: this.state.miniCartData.productAvailabilites,\r\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\r\n imageSettings,\r\n outOfStockThreshold: this.props.context.app.config.outOfStockThreshold || 0,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\r\n gridSettings: this.props.context.request.gridSettings!,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n resources: {\r\n sizeString: resources.productDimensionTypeSize,\r\n colorString: resources.productDimensionTypeColor,\r\n configString: resources.productDimensionTypeConfiguration,\r\n styleString: resources.productDimensionTypeStyle,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\r\n inputQuantityAriaLabel: '', // Not used\r\n discountStringText: '', // Not used\r\n originalPriceText: '',\r\n currentPriceText: '',\r\n shippingChargesText: '',\r\n shippingText: resources.shippingText,\r\n memberPriceMessage: resources.memberPriceMessage,\r\n saleMessage: resources.saleMessage,\r\n decrementButtonAriaLabel: '',\r\n incrementButtonAriaLabel: ''\r\n },\r\n telemetry,\r\n removeButtonText: resources.removeCartButtonText,\r\n outOfStockText: '', // Not used\r\n outOfRangeOneText: '', // Not used\r\n outOfRangeFormatText: '', // Not used\r\n cartState: cart,\r\n orgUnitLocations: this.state.orgUnitLocations,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n telemetryContent: this.telemetryContent,\r\n channelDeliveryOptionConfig: this.retailMultiplePickUpOptionEnabled ? this.channelDeliveryOptionConfig : undefined,\r\n isQuantityLimitsFeatureEnabled: this.state.isQuantityLimitsFeatureEnabled,\r\n catalogs: this.props.data.catalogs?.result\r\n })\r\n : null;\r\n }\r\n\r\n private readonly _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\r\n return (\r\n imageSettings || {\r\n viewports: {\r\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\r\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n }\r\n );\r\n };\r\n\r\n private readonly _removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\r\n if (this.props.data.cart.result) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()]\r\n };\r\n this.props.data.cart.result.removeCartLines(input).catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to Remove Cart Line');\r\n });\r\n }\r\n };\r\n\r\n private async _setQuantityLimitsFeatureFlag(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isChannelQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature'\r\n )?.IsEnabled || false;\r\n if (isChannelQuantityLimitsFeatureEnabledInHq) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n return;\r\n }\r\n\r\n const useSiteBuilderSettings = featureStatuses?.find(\r\n featureState => featureState.Name === 'RevertToSiteBuilderOrderQuantityLimitsSettings'\r\n )?.IsEnabled;\r\n\r\n if (useSiteBuilderSettings) {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (!defaultOrderQuantityLimitsFeatureConfig || defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n\r\n try {\r\n const featureStatuses = await this.props.data.featureState;\r\n const isQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n } catch (error) {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get feature states');\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n return;\r\n }\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n } else {\r\n this.props.data.customerInformation\r\n .then(customerInfo => {\r\n const result =\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\r\n this.setState({ isQuantityLimitsFeatureEnabled: result });\r\n })\r\n .catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get customer info');\r\n });\r\n }\r\n } else {\r\n const cartConfiguration = await this.props.data.cartConfiguration;\r\n this.setState({ isQuantityLimitsFeatureEnabled: !(cartConfiguration?.IgnoreOrderSettings ?? false) });\r\n return;\r\n }\r\n }\r\n}\r\n\r\nexport default CartIcon;\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 { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ICartIconViewProps } from './ext-cart-icon';\r\nimport { IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\r\n\r\nconst _renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\r\n if (!cartLines) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n return cartLines.map((cartLine, index) => {\r\n return (\r\n \r\n {cartLine.cartline}\r\n {cartLine.storeLocation}\r\n {cartLine.remove}\r\n \r\n );\r\n });\r\n};\r\n\r\nconst CartIconView: React.FC = (props: ICartIconViewProps) => (\r\n \r\n {props.cartIcon}\r\n {props.FlyoutContainer ? (\r\n \r\n {props.flyoutTitle}\r\n {props.checkoutBlockedDueToUnavailableFunds}\r\n {_renderCartlines(props.cartlines, props)}\r\n {props.totalPrice}\r\n {props.checkoutAsSignInUserButton}\r\n {props.checkoutAsGuestButton}\r\n {props.goToCartButton}\r\n \r\n ) : (\r\n false\r\n )}\r\n \r\n);\r\n\r\nexport default CartIconView;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync } from '@msdyn365-commerce/core';\r\nimport { ICartIconViewProps, ICartViewProps, IFlyoutCartLineItemViewProps } from '@msdyn365-commerce-modules/cart';\r\nimport { Button, getPayloadObject, INodeProps, KeyCodes, Modal, Node, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React from 'react';\r\n\r\nimport { ICartIconProps as ICartIconExtensionProps } from '../definition-extensions/cart-icon.ext.props.autogenerated';\r\n\r\n/**\r\n * ICartIconViewState: Interface for Cart Icon View State.\r\n */\r\ninterface ICartIconViewState {\r\n isModalOpen: boolean;\r\n}\r\n\r\n/**\r\n * Render Cart lines.\r\n * @param cartLines - Flyout cart line view props.\r\n * @param props - Cart icon view props.-\r\n * @returns JSX Element.\r\n */\r\nconst renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\r\n if (!cartLines) {\r\n props.context.telemetry.error('Cartlines content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n return cartLines.map((cartLine, index) => {\r\n const cartLineIndex = index;\r\n return (\r\n \r\n {cartLine.cartline}\r\n {cartLine.storeLocation}\r\n {cartLine.remove}\r\n \r\n );\r\n });\r\n};\r\n\r\n/**\r\n * Initiate total price.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\nconst renderTotalPrice = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\r\n const cart = props.data.cart.result ?? undefined;\r\n const price = cart && !cart.hasInvoiceLine && (cart.cart.TotalAmount || undefined);\r\n const totalPrice = price\r\n ? props.context.cultureFormatter.formatCurrency(price)\r\n : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\r\n return cart && !cart.hasInvoiceLine ? (\r\n
\r\n \r\n {props.resources.totalPriceFormatString}\r\n {totalPrice}\r\n \r\n
\r\n ) : (\r\n <>\r\n );\r\n};\r\n\r\n/**\r\n * Initiate subtotal message.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\nconst renderSubtotalMessage = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\r\n const cart = props.data.cart.result ?? undefined;\r\n return cart && !cart.hasInvoiceLine ?

{props.resources.subTotalMessage}

: null;\r\n};\r\n\r\n/**\r\n *\r\n * CartIconView component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class CartIconView extends React.PureComponent<\r\n ICartViewProps & ICartIconViewProps & ICartIconExtensionProps<{}>,\r\n ICartIconViewState\r\n> {\r\n private isAutoDisplayTriggered: boolean;\r\n\r\n private readonly cartIconRef: React.RefObject = React.createRef();\r\n\r\n public constructor(props: ICartViewProps & ICartIconViewState & ICartIconViewProps & ICartIconExtensionProps<{}>) {\r\n super(props);\r\n this.isAutoDisplayTriggered = false;\r\n this.state = {\r\n isModalOpen: false\r\n };\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.addEventListener('keydown', this._escFunction, false);\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.removeEventListener('keydown', this._escFunction, false);\r\n }\r\n }\r\n\r\n /**\r\n * Render Cart Item count.\r\n * @returns JSX Element.\r\n */\r\n public render(): JSX.Element | null {\r\n const cart = this.props.data.cart.result ?? undefined;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\r\n const shouldShowMiniCart =\r\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\r\n if (shouldShowMiniCart) {\r\n if (!this.isAutoDisplayTriggered) {\r\n // First time trigger auto mini cart.\r\n this.setState({ isModalOpen: true });\r\n this.isAutoDisplayTriggered = true;\r\n } else if (!this.state.isModalOpen) {\r\n // If modal is closed, reset the flag.\r\n this.isAutoDisplayTriggered = false;\r\n }\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n {this.props.flyoutTitle}\r\n {this._renderCartItemCount(this.props)}\r\n {this._renderCartCloseIcon()}\r\n \r\n \r\n {this.props.data.cart.result?.isEmpty ? this.props.slots.emptyCart : null}\r\n {this.props.checkoutBlockedDueToUnavailableFunds}\r\n {renderCartlines(this.props.cartlines, this.props)}\r\n \r\n \r\n {this.props.slots.promoContentItem}\r\n {renderTotalPrice(this.props)}\r\n {renderSubtotalMessage(this.props)}\r\n {this.props.checkoutAsSignInUserButton}\r\n {this.props.checkoutAsGuestButton}\r\n {this.props.data.cart.result?.isEmpty ? null : this.props.goToCartButton}\r\n \r\n {this.props.data.cart.result?.isEmpty ? (\r\n \r\n {this.props.resources.continueShoppingButtonTitle}\r\n \r\n ) : null}\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n /**\r\n * Initiate modal container.\r\n * @returns Inode props.\r\n */\r\n private readonly _modalContainer = (): INodeProps => {\r\n return {\r\n tag: Modal,\r\n placement: 'bottom-end',\r\n hideArrow: true,\r\n className: 'ms-cart-icon__minicartmodal-container',\r\n wrapClassName: 'ms-cart-icon__minicartmodal',\r\n isOpen: this.state.isModalOpen,\r\n toggle: this.closeModal\r\n };\r\n };\r\n\r\n /**\r\n * Initiate open modal.\r\n */\r\n private readonly _openModal = (): void => {\r\n const payLoad = getPayloadObject('click', this.props.telemetryContent!, 'cart-icon', '');\r\n onTelemetryClick(this.props.telemetryContent!, payLoad, 'cart-icon');\r\n this.setState({\r\n isModalOpen: true\r\n });\r\n };\r\n\r\n /**\r\n * Initiate close modal.\r\n */\r\n private readonly closeModal = (): void => {\r\n this.cartIconRef.current?.focus();\r\n this.setState({\r\n isModalOpen: false\r\n });\r\n };\r\n\r\n /**\r\n * Initiate cart close Icon.\r\n * @returns JSX Element.\r\n */\r\n private readonly _renderCartCloseIcon = (): JSX.Element | null => {\r\n return