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6BACgB,QAA3BoY,EAAA1Q,KAAK/H,MAAMyE,KAAK6B,KAAKqD,cAAM,IAAA8O,GAA3BA,EAA6BC,QAC1B5a,IAAAA,cAAC4H,EAAAA,OAAM,CACHrF,UAAU,mCACV2I,MAAMf,EAAAA,EAAAA,IAAW,OAAQF,KAAK/H,MAAM2C,QAAQsC,gBAE3C8C,KAAK/H,MAAM4C,UAAUuW,6BAE1B,SAtIRC,IAAC9Q,EAAuDtI,GAoNhF","sources":["webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b","webpack://Msdyn365.Commerce.Online/./lib/cart-icon/module-registration.js?4d28","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/cart-icon.props.autogenerated.ts?05ea","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/components/flyout-cart-line-items.tsx?b492","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/utils/get-products-in-mini-cart.ts?a1c2","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/cart-icon.tsx?06e4","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/cart-icon.view.tsx?8ffb","webpack://Msdyn365.Commerce.Online/./src/themes/adventureworks/views/cart-icon.view.tsx?53f0","webpack://Msdyn365.Commerce.Online/./src/modules/cart-icon/cart-icon.view.tsx?f9dd","webpack://Msdyn365.Commerce.Online/./src/modules/adventureworks/views/cart-icon.view.tsx?7ec9"],"sourcesContent":["module.exports = React;","module.exports = ReactDOM;","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['cart-icon'] = {\n c: () => require('partner/modules/cart-icon/cart-icon.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action', runOn: 1},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orgUnitLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'cart-icon',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/cart-icon'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|cart-icon|cart-icon'] = {\n c: () => require('partner/modules/cart-icon/cart-icon.view.tsx'),\n cn: '__local__-__local__-cart-icon'\n };\nviewDictionary['__local__|__local__|themes|adventureworks|views|cart-icon'] = {\n c: () => require('partner/themes/adventureworks/views/cart-icon.view.tsx'),\n cn: '__local__-__local__-cart-icon'\n };\nviewDictionary['@msdyn365-commerce-modules|cart|modules|cart-icon|cart-icon'] = {\n c: () => require('@msdyn365-commerce-modules/cart/dist/lib/modules/cart-icon/cart-icon.view.js'),\n cn: '@msdyn365-commerce-modules-cart-cart-icon'\n };\nviewDictionary['@msdyn365-commerce-theme|adventureworks-theme-kit|modules|adventureworks|views|cart-icon'] = {\n c: () => require('@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/views/cart-icon.view.js'),\n cn: '@msdyn365-commerce-theme-adventureworks-theme-kit-cart-icon'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * ICartIcon 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 ICartIconConfig extends Msdyn365.IModuleConfig {\r\n mixedDeliveryOptionAlertHeader?: string;\r\n mixedDeliveryOptionAlertBody?: string;\r\n imageSettings?: Msdyn365.IImageSettings;\r\n enableHoverCart?: boolean;\r\n cartLinesSortOrder?: cartLinesSortOrder;\r\n isAnonymousCheckout?: boolean;\r\n}\r\n\r\nexport interface ICartIconResources {\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 removeAllLabel: string;\r\n salesAgreementPricePrompt: string;\r\n}\r\n\r\nexport interface ICartIconProps extends Msdyn365.IModule {\r\n resources: ICartIconResources;\r\n config: ICartIconConfig;\r\n}\r\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/* eslint-disable no-duplicate-imports */\nimport { CartLineItemComponent, ICartlineResourceString } from '@msdyn365-commerce/components';\nimport { ICoreContext, IGridSettings, IImageSettings, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { CartLine, ChannelDeliveryOptionConfiguration, OrgUnitLocation, ProductAvailableQuantity, ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductUrlSync, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '@msdyn365-commerce-modules/cart';\n\nexport interface IFlyoutCartLineItemsProps {\n cartlines: CartLine[];\n cartState: ICartState | undefined;\n orgUnitLocations: OrgUnitLocation[] | undefined;\n resources: ICartlineResourceString;\n productAvailabilites: IProductInventoryInformation[] | undefined;\n products: SimpleProduct[] | undefined;\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\n pickupDeliveryModeCode?: string;\n\n /**\n * GridSettings for the product image in cartline\n */\n gridSettings: IGridSettings;\n\n /**\n * ImageSettings for the product image in cartline\n */\n imageSettings: IImageSettings;\n id: string;\n typeName: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n removeButtonText: string;\n outOfStockText: string;\n outOfRangeOneText: string;\n outOfRangeFormatText: string;\n maxCartlineQuantity: number;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n isQuantityLimitsFeatureEnabled: boolean;\n\n outOfStockThreshold: number;\n isStockCheckEnabled: boolean;\n telemetryContent?: ITelemetryContent;\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n}\n\n\nexport interface IFlyoutCartLineItemViewProps {\n cartline: React.ReactNode;\n remove: React.ReactNode;\n storeLocation: React.ReactNode;\n hasError: boolean;\n isOutOfStock: boolean;\n data: {\n product: SimpleProduct;\n cartline: CartLine;\n };\n}\n\nconst _getCartItemAvailableQuantity = (isStockCheckEnabled: boolean, outOfStockThreshold: number, productAvailability?: ProductAvailableQuantity): number => {\n if (isStockCheckEnabled) {\n if (!productAvailability || !productAvailability.AvailableQuantity || productAvailability.AvailableQuantity <= 0 || productAvailability.AvailableQuantity <= outOfStockThreshold) {\n return 0;\n }\n return productAvailability.AvailableQuantity - outOfStockThreshold;\n }\n\n return 0;\n};\n\nconst _getCartItemMaxQuantity = (\n maxQuantityByConfig: number,\n isStockCheckEnabled: boolean,\n availableQuantityInStock: number,\n isQuantityLimitsFeatureEnabled: boolean,\n maxByQuantityLimitsFeature: number) => {\n if (isQuantityLimitsFeatureEnabled) {\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\n\n // If max by feature in not defined when feature is on then we suggest that there is no max by feature\n // and consider available qty if stock check enabled and max from config in site settings.\n if (!maxByQuantityLimitsFeature) {\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\n }\n\n return isStockCheckEnabled ? (maxByQuantityLimitsFeatureResult < availableQuantityInStock ? maxByQuantityLimitsFeatureResult : availableQuantityInStock) : maxByQuantityLimitsFeatureResult;\n }\n if (isStockCheckEnabled) {\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\n }\n return maxQuantityByConfig;\n\n};\n\n/**\n * On Remove Click functionality.\n * @param removeItemClickHandler -Remove item click function.\n * @param cartline -CartLine.\n * @returns Remove change value.\n */\nconst onRemoveClickFunction = (removeItemClickHandler: (cartlineToRemove: CartLine) => void, cartline: CartLine) => () => {\n removeItemClickHandler(cartline);\n};\nconst _assembleNode = (\n cartline: CartLine,\n product: SimpleProduct,\n props: IFlyoutCartLineItemsProps,\n index: number,\n foundProductAvailability?: ProductAvailableQuantity,\n foundProductDeliveryOptions?: ProductDeliveryOptions\n): IFlyoutCartLineItemViewProps => {\n const {\n imageSettings,\n gridSettings,\n id,\n typeName,\n context,\n resources,\n removeButtonText,\n removeItemClickHandler } = props;\n\n const availableQuantityInStock = _getCartItemAvailableQuantity(props.isStockCheckEnabled, props.outOfStockThreshold, foundProductAvailability);\n const maxQuantity = product && _getCartItemMaxQuantity(\n props.maxCartlineQuantity,\n props.isStockCheckEnabled,\n availableQuantityInStock,\n props.isQuantityLimitsFeatureEnabled,\n product?.Behavior?.MaximumQuantity || 0);\n\n // Check if the product is service or not by product type\n const isServiceItem = product.ItemTypeValue === ReleasedProductType.Service;\n\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.RemoveCartItem);\n const removeCartItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n return {\n data: {\n product,\n cartline\n },\n hasError: (!isServiceItem && props.isStockCheckEnabled) ? cartline.Quantity! > maxQuantity : false,\n cartline: (\n ),\n remove: (\n \n {removeButtonText}\n \n ),\n storeLocation: (\n _renderStoreLocation(cartline, props)\n ),\n isOutOfStock: (!isServiceItem && props.isStockCheckEnabled) ? (availableQuantityInStock <= 0) : false\n };\n};\n\nconst _renderStoreLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): JSX.Element | null => {\n if (cartLine && cartLine.FulfillmentStoreId) {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\n\n if (orgUnitName) {\n return (\n
\n \n {orgUnitName}\n \n
\n );\n }\n }\n\n return null;\n};\n\nconst _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\n return '';\n }\n\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\n });\n\n if (foundLocation) {\n return foundLocation.OrgUnitName;\n }\n return fulfillmentStoreId;\n\n};\n\nconst _assembleCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: IFlyoutCartLineItemsProps): IFlyoutCartLineItemViewProps[] | null => {\n const reactNodes: IFlyoutCartLineItemViewProps[] = [];\n\n if (!products || products.length === 0) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n\n cartlines.map((cartline, index) => {\n let product;\n if (props.isQuantityLimitsFeatureEnabled) {\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\n // to check productId and WarehouseId for identification.\n product = getProductByProductIdAndWarehouse(cartline.ProductId, products, cartline.WarehouseId, props.cartState);\n } else {\n product = getProductByProductId(cartline.ProductId, products);\n }\n let foundProductAvailability;\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\n foundProductAvailability = props.productAvailabilites.find((productAvailability) => {\n return productAvailability.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\n });\n }\n let foundProductDeliveryOption;\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\n foundProductDeliveryOption = props.productDeliveryOptions.find((deliveryOption) => {\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\n });\n }\n if (product) {\n reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability?.ProductAvailableQuantity, foundProductDeliveryOption));\n }\n });\n\n return reactNodes;\n};\n\n/**\n * CartLineItems component.\n */\n\nexport const FlyoutCartLineItems = (props: IFlyoutCartLineItemsProps) => {\n const { products, cartlines } = props;\n return (\n _assembleCartlines(cartlines, products, props)\n );\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/* eslint-disable no-duplicate-imports */\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ActiveCartProductsInput, getActiveCartProductsAction, getAvailabilitiesForCartLineItems, getDeliveryOptionsForCartLineItems, IProductInventoryInformation, ProductAvailabilitiesForCartLineItems, ProductDeliveryOptionsForCartLineItems } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * IMiniCartData entity interface.\n */\nexport interface IMiniCartData {\n products?: SimpleProduct[];\n productAvailabilites?: IProductInventoryInformation[];\n deliveryOptions?: ProductDeliveryOptions[];\n}\n\nexport const createInput = () => {\n return new ActiveCartProductsInput();\n};\n\n/**\n * Calls the Retail API and returns a mini cart data.\n * @param ctx\n * @param cartState\n */\nexport async function getMiniCartData(ctx: IActionContext, cartState: ICartState): Promise {\n const miniCartData: IMiniCartData = {};\n\n const cart = cartState.cart;\n\n // If there are cart lines, make call to get products\n // If there are invocie linese, then there is no products, so don't make call to get products\n if (cart && cart.CartLines && cart.CartLines.length > 0 && !cartState.hasInvoiceLine) {\n await getActiveCartProductsAction(\n new ActiveCartProductsInput(),\n ctx\n )\n .then(products => {\n if (products) {\n miniCartData.products = products;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n\n await getAvailabilitiesForCartLineItems(\n new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings),\n ctx\n )\n .then(availableQuantity => {\n if (availableQuantity) {\n miniCartData.productAvailabilites = availableQuantity;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n\n await getDeliveryOptionsForCartLineItems(\n new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings),\n ctx\n )\n .then(deliveryOptions => {\n if (deliveryOptions) {\n miniCartData.deliveryOptions = deliveryOptions;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n }\n\n return miniCartData;\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/* eslint-disable no-duplicate-imports */\nimport { AddToCartBehavior, CartIconComponent } from '@msdyn365-commerce/components';\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\nimport { CartLine, CartLineValidationResultsByLineId, ChannelDeliveryOptionConfiguration, OrgUnitLocation } from '@msdyn365-commerce/retail-proxy';\nimport { validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\nimport { ArrayExtensions, validateCartLinesInventory } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, getPayloadObject, getTelemetryAttributes, getTelemetryObject, INodeProps,\n ITelemetryContent, TelemetryConstant, UncontrolledTooltip } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport React from 'react';\n\nimport { ICartIconData } from './cart-icon.data';\nimport { cartLinesSortOrder, ICartIconProps } from './cart-icon.props.autogenerated';\nimport { FlyoutCartLineItems, IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\nimport { getMiniCartData, IMiniCartData } from './utils/get-products-in-mini-cart';\nimport {CartMethodChangeDialog} from '../../themes/adventureworks/views/components/cartMethodChangePopup';\n// import { validateCartLinesInventory } from '../checkout/actions/validate-cartlines-inventory';\n\nexport interface IMiniCartState {\n miniCartData: IMiniCartData;\n orgUnitLocations?: OrgUnitLocation[];\n isQuantityLimitsFeatureEnabled: boolean;\n isDeliveryModeChange: boolean;\n isCheckoutDisabled: boolean;\n isCartValid: boolean;\n}\n\nexport interface ICartIconViewProps extends ICartIconProps {\n className: string;\n cartIcon: React.ReactNode;\n FlyoutContainer?: INodeProps;\n CartlinesWrapper: INodeProps;\n miniCartWrapper: INodeProps;\n miniCartItemWrapper: INodeProps;\n cartlines?: IFlyoutCartLineItemViewProps[];\n flyoutTitle: React.ReactNode;\n totalPrice: React.ReactNode;\n checkoutAsGuestButton?: React.ReactNode;\n checkoutAsSignInUserButton?: React.ReactNode;\n goToCartButton?: React.ReactNode;\n waitingComponent?: React.ReactNode;\n isCartLoading: boolean;\n removeAll: React.ReactNode;\n deliveryOptionDialogNode: React.ReactNode;\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n}\n\n/**\n *\n * Cart component.\n * @extends {React.PureComponent>}\n */\n@observer\nclass CartIcon extends React.Component, IMiniCartState> {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly checkoutBySignInAttributes: IDictionary | undefined;\n\n private readonly checkoutByGuestAttributes: IDictionary | undefined;\n\n private readonly viewShoppingBagAttributes: IDictionary | undefined;\n\n private retailMultiplePickUpOptionEnabled?: boolean = false;\n\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n private lastValidatedCartVersion: number | undefined;\n\n constructor(props: ICartIconProps) {\n super(props);\n this.state = {\n miniCartData: {},\n isCartValid: true,\n isQuantityLimitsFeatureEnabled: false,\n isDeliveryModeChange: false,\n isCheckoutDisabled: false\n };\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n const payload = getPayloadObject(TelemetryEvent.CheckOut, this.telemetryContent, TelemetryConstant.Checkout);\n this.checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\n this.checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n\n payload.contentAction.etext = TelemetryConstant.ViewShoppingBag;\n this.viewShoppingBagAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n }\n\n public async componentDidMount(): Promise {\n const context = this.props.context.actionContext;\n\n reaction(\n () => this.props.data.cart.result?.cart.CartLines,\n async () => {\n this.setState({\n miniCartData: await getMiniCartData(context, this.props.data.cart.result!)\n });\n }\n );\n\n this.setState({\n orgUnitLocations: this.props.data.orgUnitLocations?.result\n });\n await this._setOrderQuantityLimitsFeatureFlag();\n this._validateCart();\n }\n\n public componentDidUpdate(prevProps: ICartIconProps): void {\n this._validateCart();\n }\n\n public shouldComponentUpdate(nextProps: ICartIconProps,\n nextState: IMiniCartState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n // eslint-disable-next-line complexity -- disabling the complexity for this method for now as its causing lot of other warnings\n public render(): JSX.Element | null {\n const {\n id,\n typeName,\n config: {\n enableHoverCart,\n isAnonymousCheckout\n },\n context: {\n request: {\n user: {\n isAuthenticated//,\n //signInUrl\n }\n }\n },\n context,\n resources\n } = this.props;\n\n const cart = this.props.data.cart && this.props.data.cart.result || undefined;\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\n // const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\n const shouldShowMiniCart = cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\n const hasInvoiceLine = cart?.hasInvoiceLine;\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n const cartLines = this._getCartLines();\n // const hasError = !this.state.isCartValid || (cartLines ? cartLines.some(cartline => cartline.hasError === true && (cartline.isOutOfStock !== true && cart?.cart.ExtensionProperties?.find(ext=>ext.Key === cartline.data.cartline.LineId) === undefined)) : false);\n const validInventoryAcrossCartLines = validateCartLinesInventory(\n cart?.cart.CartLines ?? [],\n this.state.miniCartData.productAvailabilites ?? [],\n this.props.context.actionContext,\n this.state.miniCartData.products ?? [],\n emailDeliveryModeCode\n );\n const isQtyLimitExceed = this.validateQtyOrderLimit(cart?.cart.CartLines ?? []);\n const hasError =\n !validInventoryAcrossCartLines?.isValid || !isQtyLimitExceed ||\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\n (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\n const includeFlyout = this.props.data.cart && this.props.data.cart.status === 'SUCCESS' && enableHoverCart;\n const totalItemsInCart = cart?.cart && cart.cart.CartLines ? cart.cart.CartLines.length : 0;\n const goToCartButtonText = resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\n const flyoutTitle = resources.flyoutTitle;\n const flyoutTooltip = {\n tag: UncontrolledTooltip,\n shouldShowMiniCart,\n placement: 'bottom-end',\n hideArrow: true,\n className: 'ms-cart-icon__flyout-container',\n trigger: 'hover',\n displayMode: 'FLYOUT',\n target: id,\n shouldShowCloseButton: true,\n cartPageUrl: cartUrl\n };\n // this.setState({isCheckoutDisabled: hasError});\n // If there are invoice lines, don't update mini cart price\n const price = cart && !cart.hasInvoiceLine && cart.cart.TotalAmount || undefined;\n const priceString = price ? resources.totalPriceFormatString.replace('{price}', context.cultureFormatter.formatCurrency(price)) : '';\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result\n ?.find(feature => feature.Name === multiplePickupStoreSwitchName)?.IsEnabled;\n\n const viewProps = {\n ...this.props,\n cartIcon: (\n \n ),\n cartlines: cartLines,\n removeAll: (),\n FlyoutContainer: includeFlyout ? flyoutTooltip : undefined,\n CartlinesWrapper: {\n className: 'ms-cart-icon__cart-lines'\n },\n miniCartWrapper: {\n className: classnames('ms-cart-icon'),\n id: this.props.id\n },\n miniCartItemWrapper: {\n className: classnames('msc-cart-lines-item')\n },\n deliveryOptionDialogNode: (),\n // If there are invoice lines, don't update mini cart checkout button\n // Checkout button will display by default to maintain backward compatibility. When Anonymous user checkout is enabled &&\n // user is authenticated then we will show the checkout button otherwise we will show the guest checkout button.\n checkoutAsSignInUserButton: (!isCartEmpty && !hasInvoiceLine && (!isAnonymousCheckout || isAuthenticated)) ? (\n \n {resources.checkoutButtonTitle}\n \n ) : null,\n checkoutAsGuestButton: (isAnonymousCheckout && !isCartEmpty && !isAuthenticated) ? (\n \n {resources.guestCheckoutButtonTitle}\n \n ) : null,\n goToCartButton:\n (\n \n {goToCartButtonText}\n \n ),\n flyoutTitle:\n (\n \n {flyoutTitle}\n \n ),\n totalPrice:\n (\n
\n {priceString}\n
\n )\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _checkoutSignInClick = () => {\n const {\n context: {\n request: {\n user: {\n isAuthenticated,\n signInUrl\n }\n }\n }\n } = this.props;\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\n const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\n console.log(checkoutURL);\n const cartLines = this._getCartLines();\n if(cartLines?.some(x => x.data.cartline.DeliveryMode !== undefined && x.data.cartline.DeliveryMode.toLowerCase() === 'pickup') === true && cartLines?.some(x => x.data.cartline.DeliveryMode === undefined || x.data.cartline.DeliveryMode.toLowerCase() !== 'pickup') === true)\n {\n this.setState({isDeliveryModeChange: true,isCheckoutDisabled: true});\n }\n else\n {\n window.location.href=checkoutURL;\n }\n };\n\n private _deliveryModePopUpClose = () =>{\n this.setState({isDeliveryModeChange: false});\n };\n\n private _removeCartLines = (cartLines?: IFlyoutCartLineItemViewProps[])=> () =>{\n const {\n data: { cart }\n } = this.props;\n const lineIds: string[] = new Array();\n if(cartLines)\n {\n cartLines.map(item =>(\n lineIds.push(item.data.cartline.LineId!)\n ));\n if(lineIds.length > 0)\n {\n const ids ={\n cartLineIds: lineIds,\n additionalProperties: undefined\n };\n cart.result?.removeCartLines(ids);\n }\n }\n };\n\n private _validateCart(): void {\n const {\n data: { cart }\n } = this.props;\n const cartVersion = cart.result?.cart?.Version ?? undefined;\n if (this.lastValidatedCartVersion === cartVersion) {\n return;\n }\n\n this.lastValidatedCartVersion = cartVersion; // This field is populated to block concurrent requests\n validateCartAsync(cart, this.props.telemetry, this.props.context)\n .then((result: CartLineValidationResultsByLineId | undefined) => {\n this.setState({ isCartValid: !ArrayExtensions.hasElements(result?.ValidationResultsPairs) });\n })\n .catch(() => {\n this.setState({ isCartValid: false });\n });\n }\n\n private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\n if (isAuthenticated) {\n return guestCheckoutUrl;\n }\n\n const absoluteUrlRegExp = new RegExp('^(?:[a-z]+:)?//', 'i');\n const isAbsoluteUrl = absoluteUrlRegExp.test(guestCheckoutUrl);\n let returnURL = guestCheckoutUrl;\n if (msdyn365Commerce.isBrowser && !isAbsoluteUrl) {\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\n }\n\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\n }\n\n /**\n * Sort cartline items.\n * @param cartlines - Cartlines to be sorted.\n * @param sortOrder - Ascending or descending.\n * @returns - Sorted cartlines.\n */\n private readonly getSortedCartLines = (cartlines: CartLine[], sortOrder?: cartLinesSortOrder): CartLine[] => {\n const lines: CartLine[] = [...cartlines];\n const zero: number = 0;\n\n if (sortOrder === cartLinesSortOrder.descending) {\n return lines.sort((item1, item2) => (item2.LineNumber ?? zero) - (item1.LineNumber ?? zero));\n }\n return lines.sort((item1, item2) => (item1.LineNumber ?? zero) - (item2.LineNumber ?? zero));\n };\n\n private validateQtyOrderLimit(cartLines:CartLine[]): boolean {\n let isValid = true;\n const cartLineMap = new Map();\n const defaultCartLineQuantity = 1;\n for (const cartLine of cartLines) {\n // Skip validation if is an invoice inline.\n if (cartLine.ProductId && !cartLine.IsInvoiceLine && !cartLine.IsGiftCardLine) {\n if (!cartLineMap.has(cartLine.ProductId)) {\n cartLineMap.set(cartLine.ProductId, cartLine.Quantity ?? defaultCartLineQuantity);\n } else {\n const cartLineTotal = cartLineMap.get(cartLine.ProductId) ?? 0;\n cartLineMap.delete(cartLine.ProductId);\n cartLineMap.set(cartLine.ProductId, cartLineTotal + (cartLine.Quantity ?? defaultCartLineQuantity));\n }\n }\n }\n for (const productId of Array.from(cartLineMap.keys())) {\n const cartLineQty = cartLineMap.get(productId) ?? defaultCartLineQuantity;\n if (cartLineQty > this.props.context.app.config.cartMaxQuantity){\n isValid = false;\n }\n }\n return isValid;\n }\n\n private _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\n const {\n context: {\n request: {\n channel: {\n PickupDeliveryModeCode\n } = { PickupDeliveryModeCode: undefined }\n }\n },\n config,\n telemetry,\n resources\n } = this.props;\n\n const imageSettings = this._getImageSettings(config.imageSettings);\n const cart = this.props.data.cart && this.props.data.cart.result;\n\n // Cart-icon could be placed in each page\n // so we check cart content to reduce number of RS calls\n return this.state.miniCartData.products && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0 ?\n (\n FlyoutCartLineItems({\n cartlines: this.getSortedCartLines(cart.cart.CartLines, config.cartLinesSortOrder),\n products: this.state.miniCartData.products,\n productAvailabilites: this.state.miniCartData.productAvailabilites,\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\n imageSettings,\n outOfStockThreshold: this.props.context.app.config.outOfStockThreshold || 0,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n maxCartlineQuantity: this.props.context.app.config.maxQuantityForCartLineItem,\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n resources: {\n sizeString: resources.productDimensionTypeSize,\n colorString: resources.productDimensionTypeColor,\n configString: resources.productDimensionTypeConfiguration,\n styleString: resources.productDimensionTypeStyle,\n quantityDisplayString: resources.quantityDisplayText,\n inputQuantityAriaLabel: '', // Not used\n discountStringText: '', // Not used\n originalPriceText: '',\n currentPriceText: '',\n shippingChargesText: ''\n },\n telemetry,\n removeButtonText: resources.removeCartButtonText,\n outOfStockText: '', // Not used\n outOfRangeOneText: '', // Not used\n outOfRangeFormatText: '', // Not used\n cartState: cart,\n orgUnitLocations: this.state.orgUnitLocations,\n removeItemClickHandler: this._removeItemFromCartHandler,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n telemetryContent: this.telemetryContent,\n channelDeliveryOptionConfig: this.retailMultiplePickUpOptionEnabled ? this.channelDeliveryOptionConfig : undefined,\n isQuantityLimitsFeatureEnabled: this.state.isQuantityLimitsFeatureEnabled\n })\n ) : null;\n }\n\n private readonly _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\n return imageSettings || {\n viewports: {\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n };\n\n private readonly _removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\n if (this.props.data.cart.result) {\n const input = {\n cartLineIds: [cartlineToRemove.LineId!.toString()]\n };\n this.props.data.cart.result.removeCartLines(input).then(() =>{\n const cartLines = this._getCartLines();\n if(cartLines?.some(x => x.data.cartline.DeliveryMode !== undefined && x.data.cartline.DeliveryMode.toLowerCase() === 'pickup') === true && cartLines?.some(x => x.data.cartline.DeliveryMode === undefined || x.data.cartline.DeliveryMode.toLowerCase() !== 'pickup') === true)\n {\n // this.setState({isCheckoutDisabled: true});\n }\n else\n {\n this.setState({isCheckoutDisabled: false});\n }\n })\n .catch((error) => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to Remove Cart Line');\n });\n }\n };\n\n private async _setOrderQuantityLimitsFeatureFlag(): Promise {\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n if (!defaultOrderQuantityLimitsFeatureConfig || defaultOrderQuantityLimitsFeatureConfig === 'none') {\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n try {\n const featureStatuses = await this.props.data.featureState;\n const isQuantityLimitsFeatureEnabledInHq = featureStatuses\n .find(featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature')?.IsEnabled || false;\n if (!isQuantityLimitsFeatureEnabledInHq) {\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n } catch (error) {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get feature states');\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n this.setState({ isQuantityLimitsFeatureEnabled: true });\n } else {\n this.props.data.customerInformation\n .then(customerInfo => {\n const result = !!customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\n this.setState({ isQuantityLimitsFeatureEnabled: result });\n }).catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get customer info');\n });\n }\n }\n}\n\nexport default CartIcon;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/* eslint-disable no-duplicate-imports */\nimport { Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICartIconViewProps } from './cart-icon';\nimport { IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\n\nconst _renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\n if (!cartLines) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n return cartLines.map((cartLine, index) => {\n return (\n \n {cartLine.cartline}\n {cartLine.storeLocation}\n {cartLine.remove}\n \n );\n });\n};\n\nconst CartIconView: React.FC = (props: ICartIconViewProps) => (\n \n {props.cartIcon}\n {props.FlyoutContainer ? (\n \n {props.flyoutTitle}\n \n {_renderCartlines(props.cartlines, props)}\n \n {props.totalPrice}\n {props.checkoutAsSignInUserButton}\n {props.checkoutAsGuestButton}\n {props.goToCartButton}\n \n ) : false }\n \n);\n\nexport default CartIconView;\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync } from '@msdyn365-commerce/core';\r\nimport { ICartViewProps } from '@msdyn365-commerce-modules/cart';\r\nimport { ICartIconViewProps } from '../../../modules/cart-icon/cart-icon';\r\nimport { IFlyoutCartLineItemViewProps } from '@msdyn365-commerce-modules/cart/src/modules/cart-icon/./components/flyout-cart-line-items';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\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 return cartLines.map((cartLine, index) => {\r\n const cartLineIndex = index;\r\n return (\r\n \r\n \r\n {cartLine.cartline}\r\n \r\n {cartLine.remove}\r\n {cartLine.storeLocation}\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 ? props.context.cultureFormatter.formatCurrency(price) : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\r\n return (\r\n
\r\n \r\n {props.resources.totalPriceFormatString}\r\n \r\n {totalPrice}\r\n \r\n \r\n
\r\n );\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, ICartIconViewState> {\r\n\r\n private isAutoDisplayTriggered: boolean;\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 = 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 {this.props.cartIcon}\r\n \r\n \r\n \r\n {this.props.flyoutTitle}\r\n {this._renderCartItemCount(this.props)}\r\n {this._renderCartCloseIcon()}\r\n {this.props.removeAll}\r\n \r\n \r\n {this.props.data.cart.result?.isEmpty ? this.props.slots.emptyCart : null}\r\n \r\n {renderCartlines(this.props.cartlines, this.props)}\r\n \r\n \r\n \r\n {this.props.slots.promoContentItem}\r\n {renderTotalPrice(this.props)}\r\n

\r\n {this.props.resources.subTotalMessage}\r\n

\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 {\r\n this.props.data.cart.result?.isEmpty ? \r\n {this.props.resources.continueShoppingButtonTitle}\r\n : null\r\n }\r\n \r\n {this.props.deliveryOptionDialogNode}\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.setState({\r\n isModalOpen: false\r\n });\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 (\r\n \r\n );\r\n };\r\n\r\n /**\r\n * Render Cart Item count.\r\n * @param props - Cart icon view props.\r\n * @returns JSX Element.\r\n */\r\n private readonly _renderCartItemCount = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\r\n let cartItemCount;\r\n const defaultCartItemCount: number = 0;\r\n const defaultCartItemCountOne: number = 1;\r\n\r\n if (ArrayExtensions.hasElements(props.cartlines)) {\r\n if (props.cartlines.length === defaultCartItemCountOne) {\r\n cartItemCount = `${defaultCartItemCountOne} ${props.resources.item}`;\r\n } else {\r\n cartItemCount = `${props.cartlines.length} ${props.resources.items}`;\r\n }\r\n } else {\r\n cartItemCount = `${defaultCartItemCount} ${props.resources.items}`;\r\n }\r\n return (\r\n \r\n {cartItemCount}\r\n \r\n );\r\n };\r\n\r\n /**\r\n * Handle escape click to close modal.\r\n * @param event - On press of any key.\r\n */\r\n private readonly _escFunction = (event: KeyboardEvent) => {\r\n if (event.keyCode === KeyCodes.Escape && this.state.isModalOpen) {\r\n this.closeModal();\r\n }\r\n };\r\n\r\n}\r\n\r\nexport default CartIconView;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICartIconViewProps } from './cart-icon';\nimport { IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\n\nconst _renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\n if (!cartLines) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n return cartLines.map((cartLine, index) => {\n return (\n \n {cartLine.cartline}\n {cartLine.storeLocation}\n {cartLine.remove}\n \n );\n });\n};\n\nconst CartIconView: React.FC = (props: ICartIconViewProps) => (\n \n {props.cartIcon}\n {props.FlyoutContainer ? (\n \n {props.flyoutTitle}\n {props.checkoutBlockedDueToUnavailableFunds}\n {_renderCartlines(props.cartlines, props)}\n {props.totalPrice}\n {props.checkoutAsSignInUserButton}\n {props.checkoutAsGuestButton}\n {props.goToCartButton}\n \n ) : (\n false\n )}\n \n);\n\nexport default CartIconView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AddToCartBehavior } from '@msdyn365-commerce/components';\nimport MsDyn365, { getUrlSync } from '@msdyn365-commerce/core';\nimport { ICartIconViewProps, ICartViewProps, IFlyoutCartLineItemViewProps } from '@msdyn365-commerce-modules/cart';\nimport { Button, getPayloadObject, INodeProps, KeyCodes, Modal, Node, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { ICartIconProps as ICartIconExtensionProps } from '../definition-extensions/cart-icon.ext.props.autogenerated';\n\n/**\n * ICartIconViewState: Interface for Cart Icon View State.\n */\ninterface ICartIconViewState {\n isModalOpen: boolean;\n}\n\n/**\n * Render Cart lines.\n * @param cartLines - Flyout cart line view props.\n * @param props - Cart icon view props.-\n * @returns JSX Element.\n */\nconst renderCartlines = (cartLines: IFlyoutCartLineItemViewProps[] | undefined, props: ICartIconViewProps): JSX.Element[] | null => {\n if (!cartLines) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n\n return cartLines.map((cartLine, index) => {\n const cartLineIndex = index;\n return (\n \n {cartLine.cartline}\n {cartLine.storeLocation}\n {cartLine.remove}\n \n );\n });\n};\n\n/**\n * Initiate total price.\n * @param props - Cart icon view props.\n * @returns JSX Element.\n */\nconst renderTotalPrice = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\n const cart = props.data.cart.result ?? undefined;\n const price = cart && !cart.hasInvoiceLine && (cart.cart.TotalAmount || undefined);\n const totalPrice = price\n ? props.context.cultureFormatter.formatCurrency(price)\n : props.context.cultureFormatter.formatCurrency(props.resources.emptyPrice);\n return cart && !cart.hasInvoiceLine ? (\n
\n \n {props.resources.totalPriceFormatString}\n {totalPrice}\n \n
\n ) : (\n <>\n );\n};\n\n/**\n * Initiate subtotal message.\n * @param props - Cart icon view props.\n * @returns JSX Element.\n */\nconst renderSubtotalMessage = (props: ICartIconViewProps & ICartIconExtensionProps<{}>): JSX.Element | null => {\n const cart = props.data.cart.result ?? undefined;\n return cart && !cart.hasInvoiceLine ?

{props.resources.subTotalMessage}

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