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ACvB,OA6CF42B,EAAuBx7B,IAChC,MAAM,SAAEkW,EAAQ,UAAED,GAAcjW,EAChC,OAAO+7B,EAAmB9lB,EAAWC,EAAUlW,WC5UnDw8B,EAAOC,QAAU/8B,cCAjB88B,EAAOC,QAAUC","sources":["webpack://msdyn365.commerce.online/./src/actions/FlintFoxSourceCodeEntities.g.ts?16f0","webpack://msdyn365.commerce.online/./src/actions/FlintFoxSourceCodeAction.g.ts?fd3f","webpack://msdyn365.commerce.online/./src/common/components/order-summary-lineitem.tsx?0022","webpack://msdyn365.commerce.online/./src/modules/c-cart/components/c-promocode-component.tsx?62bf","webpack://msdyn365.commerce.online/./src/modules/c-cart/components/c-cart-pick-up-in-store.tsx?3e3e","webpack://msdyn365.commerce.online/./src/modules/c-cart/components/c-cart-line-items.tsx?2ab4","webpack://msdyn365.commerce.online/./src/modules/c-cart/components/c-cart-line-groups.tsx?f37a","webpack://msdyn365.commerce.online/./src/modules/c-cart/utils/get-promotion-in-c-cart.ts?f839","webpack://msdyn365.commerce.online/./src/modules/c-cart/c-cart.tsx?8b35","webpack://msdyn365.commerce.online/./src/modules/c-cart/actions/validate-cartlines-inventory.ts?2f95","webpack://msdyn365.commerce.online/./src/modules/c-cart/components/c-cart-line-items-promotion.tsx?7ebf","webpack://msdyn365.commerce.online/./src/modules/c-cart/c-cart.view.tsx?b2c3","webpack://msdyn365.commerce.online/./src/common/utilities/dimensions-with-backorderable-flag.ts?57b5","webpack://msdyn365.commerce.online/./src/modules/c-checkout/mod/data-actions/get-cart-state-data-action.ts?f9f0","webpack://msdyn365.commerce.online/./src/themes/peruvian/views/components/cartlineitem.component.tsx?5e16","webpack://msdyn365.commerce.online/./lib/c-cart/module-registration.js?8283","webpack://msdyn365.commerce.online/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://msdyn365.commerce.online/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://msdyn365.commerce.online/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://msdyn365.commerce.online/./src/modules/cart-icon/utils/get-products-in-mini-cart.ts?3c15","webpack://msdyn365.commerce.online/./src/modules/cart-icon/cart-icon.tsx?4ae8","webpack://msdyn365.commerce.online/./src/modules/cart-icon/components/flyout-cart-line-items.tsx?f2c4","webpack://msdyn365.commerce.online/external var \"React\"?0d3b","webpack://msdyn365.commerce.online/external var \"ReactDOM\"?853b"],"sourcesContent":["/* eslint-disable security/detect-object-injection */\r\n\r\n // tslint:disable\r\n import * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\n import * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g'; \r\n \r\n export interface IFlintfoxSourceCodeStatus {\r\n Result?: string;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n }\r\n \r\n /**\r\n * FlintfoxSourceCodeStatus entity class.\r\n */\r\n export class FlintfoxSourceCodeStatusExtensionClass implements IFlintfoxSourceCodeStatus {\r\n \r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Result: string;\r\n \r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n \r\n // Navigation properties names\r\n \r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Result = odataObject.Result;\r\n \r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (var i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n var className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat(\"Class\");\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i])\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n \r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n \r\n }\r\n }\r\n\r\n ","\r\n/*!\r\n* Copyright (c) Microsoft Corporation.\r\n* All rights reserved. See LICENSE in the project root for license information.\r\n* THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n* TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n*/\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './FlintFoxSourceCodeEntities.g';\r\n\r\n\r\nfunction getSourceIdStatusQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n}\r\n\r\n\r\nexport function getSourceIdStatusInput(\r\n sourceId:\r\n string\r\n): IDataServiceRequest {\r\n const query = getSourceIdStatusQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'GetSourceIdStatus',\r\n true,\r\n DataServiceEntities.FlintfoxSourceCodeStatusExtensionClass\r\n ,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IFlintfoxSourceCodeStatus' },\r\n {\r\n SourceId: sourceId\r\n }\r\n );\r\n}\r\n\r\nexport function getSourceIdStatusAsync(\r\n context: IContext, sourceId:\r\n string\r\n): AsyncResult {\r\n const request = getSourceIdStatusInput(sourceId);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\r\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\r\nimport { Cart, ChannelConfiguration, ChannelDeliveryOptionConfiguration } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\n\r\nimport Cookies from 'universal-cookie';\r\n\r\nexport interface IOrderSummaryProps {\r\n subTotalLabel: string;\r\n shippingLabel: string;\r\n taxLabel: string;\r\n orderTotalLabel: string;\r\n loyaltyLabel?: string;\r\n giftcardLabel?: string;\r\n totalDiscountsLabel: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n cart: Cart;\r\n channelConfiguration: ChannelConfiguration;\r\n id: string;\r\n typeName: string;\r\n otherChargeLabel?: string;\r\n freeText?: string;\r\n toBeCalculatedText?: string;\r\n checkoutState?: ICheckoutState;\r\n retailMultiplePickUpOptionEnabled?: boolean;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n}\r\n\r\nexport interface IOrderSummaryLines {\r\n subtotal: React.ReactNode;\r\n shipping?: React.ReactNode;\r\n otherCharge?: React.ReactNode;\r\n tax: React.ReactNode;\r\n orderTotal: React.ReactNode;\r\n totalDiscounts?: React.ReactNode;\r\n giftCard?: React.ReactNode;\r\n loyalty?: React.ReactNode;\r\n sourceCode?: React.ReactNode;\r\n}\r\n\r\ninterface IOrderSummaryLineProps {\r\n label: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n price?: number;\r\n freeText?: string;\r\n toBeCalculatedText?: string;\r\n id: string;\r\n typeName: string;\r\n cssLabel: string;\r\n}\r\n\r\ninterface IShippingOrderLine {\r\n cart: Cart;\r\n channelConfiguration: ChannelConfiguration;\r\n canShip?: boolean;\r\n hasDeliveryMethod?: boolean;\r\n hasShippingMethod?: boolean;\r\n freightFee?: number;\r\n}\r\n\r\nconst OrderSummaryLine: React.FC = ({\r\n price,\r\n label,\r\n context,\r\n id,\r\n typeName,\r\n toBeCalculatedText,\r\n freeText,\r\n cssLabel\r\n}) => {\r\n return (\r\n

\r\n {label}\r\n {price || price === 0 ? (\r\n \r\n ) : (\r\n {toBeCalculatedText}\r\n )}\r\n

\r\n );\r\n};\r\n\r\nconst _buildOrderSummarySection = (\r\n props: IOrderSummaryProps,\r\n price: number | undefined,\r\n cssLabel: string,\r\n label: string = ''\r\n): React.ReactNode => {\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\r\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\r\n};\r\n\r\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\r\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\r\n return count + (giftCard.Balance || 0);\r\n };\r\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\r\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\r\n return Math.min(giftCardTotalValue, amount);\r\n};\r\n\r\nconst getDeliveryConfiguration = (\r\n cart: Cart,\r\n channelConfiguration: ChannelConfiguration,\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration,\r\n retailMultiplePickUpOptionEnabled?: boolean\r\n): IShippingOrderLine => {\r\n const pickupDeliveryModeCode = channelConfiguration && channelConfiguration.PickupDeliveryModeCode;\r\n const emailDeliveryModeCode = channelConfiguration && channelConfiguration.EmailDeliveryModeCode;\r\n const cartLines = cart.CartLines || [];\r\n const deliveryModes = cartLines.map(cartLine => cartLine.DeliveryMode);\r\n\r\n const freightFee = cart.ShippingChargeAmount;\r\n const canShip = deliveryModes.some(\r\n deliveryMode =>\r\n !(\r\n deliveryMode !== '' &&\r\n (deliveryMode ===\r\n getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) ||\r\n deliveryMode === emailDeliveryModeCode)\r\n )\r\n );\r\n const hasDeliveryMethod = deliveryModes.some(deliveryMode => !!deliveryMode && deliveryMode !== emailDeliveryModeCode);\r\n const hasShippingMethod = deliveryModes.some(\r\n deliveryMode =>\r\n !!deliveryMode &&\r\n deliveryMode !==\r\n getDeliveryMode(deliveryMode, retailMultiplePickUpOptionEnabled, channelDeliveryOptionConfig, pickupDeliveryModeCode) &&\r\n deliveryMode !== emailDeliveryModeCode\r\n );\r\n return {\r\n canShip,\r\n hasDeliveryMethod,\r\n hasShippingMethod,\r\n freightFee\r\n } as IShippingOrderLine;\r\n};\r\n\r\nconst getDeliveryMode = (\r\n deliveryMode?: string,\r\n featureSate: boolean = false,\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration,\r\n pickupDeliveryMode?: string\r\n) => {\r\n if (!featureSate) {\r\n return pickupDeliveryMode;\r\n }\r\n return channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(dM => dM === deliveryMode);\r\n};\r\n\r\nexport const OrderSummary = (props: IOrderSummaryProps) => {\r\n const cookies = new Cookies();\r\n const { SubtotalAmount, TaxAmount, DiscountAmountWithoutTax = 0, TotalAmount, OtherChargeAmount } = props.cart;\r\n const { canShip, hasDeliveryMethod, hasShippingMethod, freightFee } = getDeliveryConfiguration(\r\n props.cart,\r\n props.channelConfiguration,\r\n props.channelDeliveryOptionConfig,\r\n props.retailMultiplePickUpOptionEnabled\r\n );\r\n const reactNodes: IOrderSummaryLines = {\r\n subtotal: _buildOrderSummarySection(props, (SubtotalAmount || 0) + DiscountAmountWithoutTax, 'sub-total', props.subTotalLabel),\r\n tax: _buildOrderSummarySection(props, hasDeliveryMethod ? TaxAmount : undefined, 'tax-amount', props.taxLabel),\r\n orderTotal: _buildOrderSummarySection(props, TotalAmount, 'total', props.orderTotalLabel),\r\n otherCharge:\r\n (OtherChargeAmount && _buildOrderSummarySection(props, OtherChargeAmount, 'other-charges', props.otherChargeLabel)) || undefined\r\n };\r\n\r\n if (canShip) {\r\n reactNodes.shipping = _buildOrderSummarySection(props, hasShippingMethod ? freightFee : undefined, 'shipping', props.shippingLabel);\r\n }\r\n if (props.checkoutState) {\r\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\r\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\r\n const subTotalAmountAfterGiftCard = (SubtotalAmount || 0) + DiscountAmountWithoutTax;\r\n // console.log('sub total', subTotalAmountAfterGiftCard);\r\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount;\r\n\r\n if (loyaltyAmount > 0) {\r\n reactNodes.loyalty = _buildOrderSummarySection(props, -loyaltyAmount, 'loyalty', props.loyaltyLabel || 'Loyalty amount');\r\n }\r\n\r\n if (cookies.get('sourceCode')) {\r\n reactNodes.sourceCode = _buildOrderSummarySection(props, 0, 'sourcecode', `Source Code: ${cookies.get('sourceCode')}`);\r\n }\r\n\r\n if (giftCardAmount > 0) {\r\n reactNodes.giftCard = _buildOrderSummarySection(props, -giftCardAmount, 'gift-card', props.giftcardLabel || 'Gift card amount');\r\n }\r\n reactNodes.subtotal = _buildOrderSummarySection(\r\n { ...props, freeText: undefined },\r\n subTotalAmountAfterGiftCard,\r\n 'sub-total',\r\n props.subTotalLabel\r\n );\r\n\r\n reactNodes.orderTotal = _buildOrderSummarySection(\r\n { ...props, freeText: undefined },\r\n totalAmountAfterGiftCard,\r\n 'total',\r\n props.orderTotalLabel\r\n );\r\n }\r\n\r\n if (DiscountAmountWithoutTax > 0) {\r\n reactNodes.totalDiscounts = _buildOrderSummarySection(\r\n props,\r\n -DiscountAmountWithoutTax,\r\n 'total-discounts',\r\n props.totalDiscountsLabel\r\n );\r\n }\r\n return reactNodes;\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { Button, format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { getSourceIdStatusAsync } from './../../../actions/FlintFoxSourceCodeAction.g'\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport Cookies from 'universal-cookie';\r\n\r\nexport interface IPromoCodeProps extends IComponentProps<{}> {\r\n cart: ICartState | undefined;\r\n promoCodeHeadingText: string;\r\n appliedPromoCodeHeadingText: string;\r\n appliedSourceCodeHeadingText: string;\r\n removePromoAriaLabelFormat: string;\r\n promoPlaceholderText: string;\r\n promoCodeApplyButtonText: string;\r\n collapseTimeOut: number;\r\n removePromoText: string;\r\n invalidPromoCodeErrorText: string;\r\n invalidSourceCodeErrorText: string;\r\n failedToAddPromoCodeErrorText: string;\r\n duplicatePromoCodeErrorText: string;\r\n failedToRemovePromoCodeErrorText: string;\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n promoCodeApplyCallback?(): void;\r\n}\r\n\r\nexport interface IPromoCodeComponent extends IComponent { }\r\n\r\nconst PromoCodeComponentActions = {};\r\n\r\ninterface IPromoCodeState {\r\n isCollapseOpen: boolean;\r\n promoCodeInputValue: string;\r\n error: string;\r\n canApply: boolean;\r\n appliedSourceCode: string;\r\n sourceCodeApplied: -1 | 0 | 1;\r\n}\r\n\r\n/**\r\n *\r\n * The PromoCode component renders the promocode section.\r\n * @extends {React.PureComponent}\r\n */\r\nclass PromoCode extends React.Component {\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n constructor(props: IPromoCodeProps, state: IPromoCodeState) {\r\n super(props);\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, TelemetryConstant.ApplyPromoCode);\r\n this.state = {\r\n isCollapseOpen: false,\r\n promoCodeInputValue: '',\r\n error: '',\r\n canApply: false,\r\n appliedSourceCode: '',\r\n sourceCodeApplied: -1\r\n };\r\n }\r\n public cookies = new Cookies();\r\n public async componentDidMount(): Promise {\r\n const sourceCodeCookie = this.cookies.get('sourceCode');\r\n if (sourceCodeCookie) {\r\n await this._applyPromotionUrl(this.props.cart, sourceCodeCookie);\r\n await this._applyPromotion(this.props.cart);\r\n }\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IPromoCodeProps): boolean {\r\n if (this.props.appliedPromoCodeHeadingText !== nextProps.appliedPromoCodeHeadingText) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n public render(): JSX.Element {\r\n return (\r\n
\r\n
\r\n {this.props.promoCodeHeadingText}\r\n
\r\n {this._renderForm(this.props.promoPlaceholderText, this.props.promoCodeApplyButtonText, this.props.cart)}\r\n

\r\n {this.state.error}\r\n

\r\n {this._renderAppliedPromoCode(this.props)}\r\n
\r\n );\r\n }\r\n\r\n private readonly _onInputChange = (e: React.ChangeEvent) => {\r\n const error = e.target.value === '' ? '' : this.state.error;\r\n this.setState({\r\n promoCodeInputValue: e.target.value, error,\r\n canApply: !!e.target.value\r\n });\r\n };\r\n\r\n\r\n private readonly _applyPromotionUrl = (cartState: ICartState | undefined, sourceCode: string) : Promise => {\r\n return new Promise((resolve, reject) => {\r\n if (!cartState || !cartState.cart) {\r\n reject();\r\n return;\r\n }\r\n this.setState({ error: '', sourceCodeApplied: 1, appliedSourceCode: sourceCode }, () => {\r\n resolve();\r\n });\r\n });\r\n }\r\n private readonly _applyPromotion = async (cartState: ICartState | undefined) => {\r\n if (!cartState || !cartState.cart) {\r\n return;\r\n }\r\n const promoInput = this.state.promoCodeInputValue;\r\n const appliedPromo = promoInput && promoInput !== '' ? promoInput : this.state.appliedSourceCode ;\r\n \r\n const myres = await getSourceIdStatusAsync({ callerContext: this.props.context.actionContext }, appliedPromo)\r\n if (myres.Result === 'Failed') {\r\n this.setState({ error: this.props.invalidSourceCodeErrorText });\r\n } else {\r\n const cookieExpireDay = this.props.context.app.config.embeddedSourceCodeExpiryDuration;\r\n const cookieExpiryDate = new Date(Date.now() + cookieExpireDay * 24 * 60 * 60 * 1000);\r\n if(this.state.appliedSourceCode === '') {\r\n this.setState({ sourceCodeApplied: 1, appliedSourceCode: promoInput, promoCodeInputValue: '' })\r\n this.cookies.set('sourceCode', `${appliedPromo}`, { path: '/', expires: cookieExpiryDate });\r\n }\r\n cartState.addPromoCode({ promoCode: appliedPromo })\r\n .then(async (result) => {\r\n if (result.status === 'SUCCESS') {\r\n // Show success text\r\n // this.setState({ promoCodeInputValue: '', error: '', canApply: false });\r\n this.setState({ promoCodeInputValue: '', error: '', canApply: false, sourceCodeApplied: 1, appliedSourceCode: appliedPromo });\r\n } else if (result.substatus === 'ALREADYADDED') {\r\n this.setState({ error: this.props.duplicatePromoCodeErrorText });\r\n }\r\n })\r\n .catch(error => {\r\n this.setState({ error: this.props.failedToAddPromoCodeErrorText });\r\n });\r\n }\r\n \r\n };\r\n\r\n private readonly _renderForm = (promoPlaceholderText: string, promoCodeApplyButtonText: string, cartState: ICartState | undefined) => {\r\n const _onSubmit = (event: React.FormEvent) => {\r\n event.preventDefault(); this._applyPromotion(cartState);\r\n };\r\n const _applyPromotion = (event: React.MouseEvent) => {\r\n this._applyPromotion(cartState);\r\n };\r\n const attributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n {promoCodeApplyButtonText}\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n private readonly _removePromotion = (cartState: ICartState | undefined, event: React.MouseEvent) => {\r\n if (!cartState) {\r\n return;\r\n }\r\n const code = event.currentTarget.getAttribute('data-value') || '';\r\n cartState.removePromoCodes({\r\n promoCodes: [code]\r\n })\r\n .then(result => {\r\n // if (result.status === 'SUCCESS' && this.cookies.get('sourceCode')) {\r\n // }\r\n this.cookies.remove('sourceCode', { path: '/' });\r\n this.setState({ error: '', sourceCodeApplied: -1, appliedSourceCode: '', promoCodeInputValue: '', canApply: true });\r\n })\r\n .catch(() => {\r\n this.setState({ error: this.props.failedToRemovePromoCodeErrorText });\r\n });\r\n\r\n };\r\n\r\n private readonly _calculateDiscount = (code: string, cartState: ICartState | undefined) => {\r\n if (!cartState || !cartState.cart || !cartState.cart.CartLines || cartState.cart.CartLines.length === 0 || !code) {\r\n return;\r\n }\r\n let discountAmount = 0;\r\n for (const line of cartState.cart.CartLines) {\r\n if (line.DiscountLines) {\r\n for (const discountLine of line.DiscountLines) {\r\n if (discountLine.DiscountCode === code) {\r\n discountAmount += discountLine.DiscountCost!;\r\n }\r\n }\r\n }\r\n }\r\n return discountAmount * -1;\r\n };\r\n\r\n private readonly _renderAppliedPromoCode = (props: IPromoCodeProps) => {\r\n if (this.state.sourceCodeApplied === 1) {\r\n const _removePromotion = (event: React.MouseEvent) => {\r\n this._removePromotion(props.cart, event);\r\n };\r\n return (\r\n <>
\r\n
\r\n
\r\n {`${this.props.appliedSourceCodeHeadingText}: ${this.state.appliedSourceCode}`}\r\n
\r\n \r\n {props.removePromoText}\r\n \r\n
\r\n
\r\n \r\n );\r\n }\r\n if (!props.cart || !props.cart.cart || !props.cart.cart.Coupons || !(props.cart.cart.Coupons.length > 0)) {\r\n return;\r\n }\r\n\r\n const _removePromotion = (event: React.MouseEvent) => {\r\n this._removePromotion(props.cart, event);\r\n };\r\n let totalCouponDiscountAmount = 0;\r\n for (const coupon of props.cart.cart.Coupons) {\r\n const discountAmount = this._calculateDiscount(coupon.Code ?? '', props.cart);\r\n if (discountAmount) {\r\n totalCouponDiscountAmount += discountAmount;\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n {this.props.appliedPromoCodeHeadingText}\r\n
\r\n \r\n
\r\n {\r\n props.cart.cart.Coupons.map((coupon: Coupon) => {\r\n const ariaLabel = props.removePromoAriaLabelFormat ? format(props.removePromoAriaLabelFormat, props.removePromoText, coupon.Code) : '';\r\n\r\n return (\r\n
\r\n
\r\n {coupon.Code}\r\n {' '}\r\n (\r\n \r\n )\r\n
\r\n \r\n {props.removePromoText}\r\n \r\n
\r\n );\r\n })\r\n }\r\n \r\n );\r\n };\r\n}\r\n\r\n// @ts-expect-error\r\nexport const PromoCodeComponent: React.FunctionComponent = msdyn365Commerce.createComponent(\r\n 'PromoCode',\r\n { component: PromoCode, ...PromoCodeComponentActions }\r\n);\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { CartLine, OrgUnitLocation, ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IPickUpInStoreViewProps {\r\n callbacks: {\r\n toggleBopis(isBopisSelected: boolean): void;\r\n };\r\n defaultComponent?: React.ReactNode;\r\n orgUnitName?: string;\r\n isBopisSelected: boolean;\r\n ContainerProps: INodeProps;\r\n deliveryOption?: string;\r\n}\r\n\r\nexport interface IPickUpInStoreProps {\r\n cartline: CartLine;\r\n product: SimpleProduct;\r\n shipitText: string;\r\n pickUpInStoreText: string;\r\n changeStoreText: string;\r\n cartState: ICartState | undefined;\r\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\r\n orgUnitLocations?: OrgUnitLocation[] | undefined;\r\n deliveryOptions?: ProductDeliveryOptions;\r\n pickupDeliveryModeCode?: string;\r\n storeSelectorModuleId?: string;\r\n locationChangedHandler(): void;\r\n}\r\n\r\nexport const PickUpInStore = (props: IPickUpInStoreProps): IPickUpInStoreViewProps | undefined => {\r\n const _onLocationChangedCallback = async (orgUnitLocation: OrgUnitLocation, cartState: ICartState | undefined, cartline: CartLine, deliveryMode?: string) => {\r\n if (!cartState) {\r\n return Promise.resolve();\r\n }\r\n return cartState.updateCartLinePickupLocation({ cartLineId: cartline.LineId!, location: orgUnitLocation, deliveryMode })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n })\r\n .catch(error => {});\r\n };\r\n\r\n const _toggleBOPIS = (isBopisSelected: boolean) => {\r\n const { storeSelectorStateManager, product, cartline, cartState, storeSelectorModuleId } = props;\r\n\r\n if (isBopisSelected) {\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n storeSelectorStateManager.openDialog({\r\n id: storeSelectorModuleId,\r\n product,\r\n alreadySelectedLocation: {\r\n OrgUnitNumber: cartline.FulfillmentStoreId\r\n },\r\n deliveryOptions: props.deliveryOptions,\r\n onLocationSelected: async (orgUnitLocation, deliveryMode: string | undefined) => {\r\n return _onLocationChangedCallback(orgUnitLocation, cartState, cartline, deliveryMode);\r\n }\r\n })\r\n .catch(error => {});\r\n } else {\r\n if (!cartState) {\r\n return;\r\n }\r\n cartline.DeliveryMode = '';\r\n cartline.FulfillmentStoreId = '';\r\n cartline.ShippingAddress = {};\r\n cartState.clearCartLinePickupLocation({ cartLineId: cartline.LineId! })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n props.locationChangedHandler();\r\n }\r\n })\r\n .catch(error => {});\r\n }\r\n };\r\n\r\n const _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\n\r\n const _renderShippingMethod = (\r\n cartLine: CartLine,\r\n shipItText: string,\r\n pickupInStoretext: string,\r\n changeStoreText: string,\r\n orgUnitLocations: OrgUnitLocation[] | undefined): JSX.Element => {\r\n\r\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, orgUnitLocations);\r\n const bopisSelected = !!cartLine.FulfillmentStoreId;\r\n\r\n const toggleBOPIS = (isBopisSelected: boolean) => {\r\n return () => {\r\n _toggleBOPIS(isBopisSelected);\r\n };\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n {\r\n cartLine.FulfillmentStoreId ? (\r\n
\r\n \r\n {orgUnitName}\r\n \r\n \r\n
\r\n ) : null\r\n }\r\n \r\n );\r\n };\r\n\r\n const _getDeliveryOption = (pickupStore: IPickUpInStoreProps, deliveryOptions: ProductDeliveryOptions) => {\r\n const delivery = deliveryOptions?.DeliveryOptions?.find(option => option.Code === pickupStore.pickupDeliveryModeCode);\r\n return delivery?.Description;\r\n };\r\n\r\n // If no delivery options present on the product, or none of the delivery options\r\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\r\n if (!props.deliveryOptions ||\r\n !props.deliveryOptions.DeliveryOptions ||\r\n !props.pickupDeliveryModeCode ||\r\n !props.deliveryOptions.DeliveryOptions.find(option => option.Code === props.pickupDeliveryModeCode)) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n callbacks: {\r\n toggleBopis: _toggleBOPIS\r\n },\r\n defaultComponent: _renderShippingMethod(props.cartline, props.shipitText, props.pickUpInStoreText, props.changeStoreText, props.orgUnitLocations),\r\n orgUnitName: _getOrgUnitName(props.cartline.FulfillmentStoreId, props.orgUnitLocations),\r\n isBopisSelected: !!props.cartline.FulfillmentStoreId,\r\n deliveryOption: _getDeliveryOption(props, props.deliveryOptions),\r\n ContainerProps: {\r\n className: 'msc-cart-line__bopis-container'\r\n }\r\n };\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { CartLineItemComponent } from '../../../themes/peruvian/views/components/cartlineitem.component';\r\nimport {\r\n AddToOrderTemplateComponent,\r\n AddToWishlistComponent,\r\n // CartLineItemComponent,\r\n IAddToOrderTemplateDialogResources,\r\n ICartlineResourceString,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n IOrderTemplateNameDialogResources,\r\n IWishlistActionSuccessResult\r\n} from '@msdyn365-commerce/components';\r\nimport { IAny, ICoreContext, IGeneric, IGridSettings, IImageSettings, ITelemetry, TelemetryEvent } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n AsyncResult,\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n CommerceList,\r\n Customer,\r\n LineDataValidationFailure,\r\n OrgUnitLocation,\r\n ProductDeliveryOptions,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n AttributeTextValue,\r\n ProductDimensionType,\r\n ReleasedProductType\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport {\r\n ArrayExtensions,\r\n getInvoiceDetailsPageUrlSync,\r\n getProductUrlSync,\r\n IProductInventoryInformation,\r\n ObjectExtensions,\r\n OrderTemplate\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '@msdyn365-commerce-modules/cart';\r\nimport { IPickUpInStoreViewProps, PickUpInStore } from './c-cart-pick-up-in-store';\r\n\r\nexport interface ICartLineItemsProps {\r\n cartlines: CartLine[];\r\n cartlinesErrors: LineDataValidationFailure[];\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\r\n /* GridSettings for the product image in cartline */\r\n gridSettings: IGridSettings;\r\n\r\n /* ImageSettings for the product image in cartline */\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 addToWishlistButtonText: string;\r\n removeFromWishlistButtonText: string;\r\n shipItText: string;\r\n pickitUpText: string;\r\n changeStoreText: string;\r\n outOfStockText: string;\r\n outOfRangeOneText: string;\r\n outOfRangeFormatText: string;\r\n storeSelectorStateManager: IStoreSelectorStateManager | undefined;\r\n isStockCheckEnabled: boolean;\r\n wishlists: CommerceList[] | undefined;\r\n defaultWishlistName: string;\r\n maxCartlineQuantity: number;\r\n includeErrors?: boolean;\r\n showShippingChargesForLineItems?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n storeSelectorModuleId?: string;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n addToOrderTemplateDialogResources: IAddToOrderTemplateDialogResources;\r\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\r\n itemAddedToOrderTemplateDialogResources: IItemAddedToOrderTemplateDialogResources;\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources: IDuplicateItemsWhenAddingToOrderTemplateDialogResources;\r\n\r\n addToOrderTemplateButtonText: string;\r\n addToOrderTemplateButtonTooltip: string;\r\n addToOrderTemplateMessage: string;\r\n addItemToOrderTemplateError: string;\r\n orderTemplates: OrderTemplate[] | undefined;\r\n customerInformation: Customer | undefined;\r\n shouldIgnoreWarehouse: boolean | undefined;\r\n productAvailability?: AsyncResult;\r\n\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\r\n updateCartLinesQuantitySuccessHandler(cartline: CartLine, quantity: number, lineIndex?: number): boolean;\r\n locationChangedHandler(): void;\r\n}\r\n\r\nexport interface ICartlinesViewProps {\r\n cartline: React.ReactNode;\r\n pickUpInStore?: IPickUpInStoreViewProps;\r\n remove: React.ReactNode;\r\n addToWishlist: React.ReactNode | undefined;\r\n addToOrderTemplate: React.ReactNode | undefined;\r\n\r\n error?: string;\r\n cartlineId?: string;\r\n hasError?: boolean;\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 productAvailability: IProductInventoryInformation | undefined,\r\n disableStockCheckInAppForBackorderableProducts: boolean,\r\n cartline: CartLine,\r\n maxCartlineQuantity: number\r\n): number => {\r\n if (disableStockCheckInAppForBackorderableProducts && isStockCheckEnabled) {\r\n const NBFlag: AttributeTextValue | undefined = cartline.AttributeValues?.find(attr => attr.Name === 'NonBackOrderableFlag');\r\n if (NBFlag && NBFlag.TextValue) {\r\n const value = JSON.parse(NBFlag.TextValue);\r\n if (value) {\r\n if (\r\n productAvailability &&\r\n productAvailability.IsProductAvailable &&\r\n productAvailability.ProductAvailableQuantity &&\r\n productAvailability.ProductAvailableQuantity.AvailableQuantity\r\n ) {\r\n return productAvailability.ProductAvailableQuantity.AvailableQuantity;\r\n } else {\r\n return 0;\r\n }\r\n } else {\r\n if (\r\n productAvailability &&\r\n productAvailability.IsProductAvailable &&\r\n productAvailability.ProductAvailableQuantity &&\r\n productAvailability.ProductAvailableQuantity.AvailableQuantity\r\n ) {\r\n return productAvailability.ProductAvailableQuantity.AvailableQuantity;\r\n } else {\r\n return maxCartlineQuantity;\r\n }\r\n }\r\n // return JSON.parse(NBFlag.TextValue) ? 0 : maxCartlineQuantity;\r\n } else {\r\n return 0;\r\n }\r\n }\r\n if (\r\n !isStockCheckEnabled ||\r\n !productAvailability ||\r\n !productAvailability.ProductAvailableQuantity ||\r\n !productAvailability.IsProductAvailable ||\r\n !productAvailability.ProductAvailableQuantity.AvailableQuantity\r\n ) {\r\n return 0;\r\n }\r\n\r\n return productAvailability.ProductAvailableQuantity.AvailableQuantity;\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 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\nconst _getErrorMessage = (\r\n availableQuantityInStock: number,\r\n currentQuantity: number,\r\n props: ICartLineItemsProps,\r\n lineIndex: number,\r\n shouldSkipStockCheck: boolean,\r\n cartLine: CartLine\r\n): string | undefined => {\r\n const finalErrorMessages: string[] = [];\r\n\r\n const isLoadingDeliveryOptions = props.productAvailability?.status === 'LOADING';\r\n if (isLoadingDeliveryOptions) {\r\n return undefined;\r\n }\r\n\r\n let foundProductAvailability;\r\n if (props.productAvailabilites && ArrayExtensions.hasElements(props.productAvailabilites)) {\r\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\r\n if (props.shouldIgnoreWarehouse) {\r\n return productAvailability.ProductAvailableQuantity.ProductId === cartLine.ProductId;\r\n }\r\n return (\r\n productAvailability.ProductAvailableQuantity.ProductId === cartLine.ProductId &&\r\n productAvailability.InventLocationId === cartLine.WarehouseId\r\n );\r\n });\r\n if (foundProductAvailability === undefined) {\r\n return undefined;\r\n }\r\n }\r\n\r\n if (props.includeErrors && props.isStockCheckEnabled && !shouldSkipStockCheck) {\r\n if (availableQuantityInStock <= 0) {\r\n finalErrorMessages.push(props.outOfStockText);\r\n } else if (availableQuantityInStock < currentQuantity) {\r\n if (availableQuantityInStock === 1) {\r\n finalErrorMessages.push(props.outOfRangeOneText);\r\n } else {\r\n finalErrorMessages.push(props.outOfRangeFormatText.replace('{numLeft}', availableQuantityInStock.toString()));\r\n }\r\n }\r\n }\r\n\r\n // Server-side validation\r\n props.cartlinesErrors\r\n .filter(i => i.LineIndex === lineIndex)\r\n .forEach(i => {\r\n if (i.DataValidationFailure?.ErrorContext) {\r\n finalErrorMessages.push(i.DataValidationFailure.ErrorContext);\r\n }\r\n });\r\n\r\n if (finalErrorMessages.length > 0) {\r\n return finalErrorMessages.join(' ');\r\n }\r\n\r\n return undefined;\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\n\r\n// eslint-disable-next-line complexity -- Auto-suppressed.\r\nconst _assembleNode = (\r\n cartline: CartLine,\r\n product: SimpleProduct | undefined,\r\n props: ICartLineItemsProps,\r\n index: number,\r\n foundProductAvailability?: IProductInventoryInformation,\r\n foundProductDeliveryOptions?: ProductDeliveryOptions\r\n): ICartlinesViewProps => {\r\n const {\r\n imageSettings,\r\n gridSettings,\r\n id,\r\n typeName,\r\n context,\r\n resources,\r\n removeButtonText,\r\n removeItemClickHandler,\r\n moveToWishlistSuccessHandler,\r\n addToOrderTemplateButtonText,\r\n addToOrderTemplateButtonTooltip,\r\n addToOrderTemplateDialogResources,\r\n createOrderTemplateDialogResources,\r\n itemAddedToOrderTemplateDialogResources,\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n addToWishlistButtonText,\r\n removeFromWishlistButtonText,\r\n orderTemplates,\r\n customerInformation,\r\n wishlists,\r\n defaultWishlistName,\r\n storeSelectorModuleId\r\n } = props;\r\n\r\n const isAuthenticated = context.request.user.isAuthenticated;\r\n const nameOfWishlist = wishlists && wishlists.length > 0 && wishlists[0].Name ? wishlists[0].Name : defaultWishlistName;\r\n const availableQuantityInStock = _getCartItemAvailableQuantity(\r\n props.isStockCheckEnabled,\r\n foundProductAvailability,\r\n props.context.app.config.disableStockCheckInAppForBackorderableProducts,\r\n cartline,\r\n props.maxCartlineQuantity\r\n );\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 // Skip stock check if the cart line is a service item or an invoice line\r\n const shouldSkipStockCheck = product?.ItemTypeValue === ReleasedProductType.Service || !!cartline.IsInvoiceLine;\r\n\r\n const errorMessage = ObjectExtensions.isNullOrUndefined(maxQuantity)\r\n ? undefined\r\n : _getErrorMessage(availableQuantityInStock, cartline.Quantity!, props, index, shouldSkipStockCheck, cartline);\r\n\r\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\r\n\r\n const payload = getPayloadObject(TelemetryEvent.RemoveFromCart, props.telemetryContent!, removeButtonText, '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\r\n\r\n const inventoryLbl = foundProductAvailability?.StockLevelLabel;\r\n const inventoryCode = foundProductAvailability\r\n ? `ms-cart-line__inventory-code-${foundProductAvailability.StockLevelCode?.toLowerCase()}`\r\n : undefined;\r\n const productDimension = 4;\r\n const customPriceDimensionType = productDimension as ProductDimensionType.Style;\r\n const isCustomPriceSelected =\r\n product?.Dimensions?.find(dimension => dimension.DimensionTypeValue === customPriceDimensionType)?.DimensionValue?.Value ===\r\n 'Custom';\r\n\r\n return {\r\n data: {\r\n product,\r\n cartline\r\n },\r\n cartlineId: cartline.LineId,\r\n error: errorMessage,\r\n hasError: !shouldSkipStockCheck && props.isStockCheckEnabled ? cartline.Quantity! > (maxQuantity ?? 0) : false,\r\n cartline: (\r\n \r\n ),\r\n pickUpInStore: product\r\n ? PickUpInStore({\r\n storeSelectorModuleId,\r\n cartState: props.cartState,\r\n cartline,\r\n product,\r\n shipitText: props.shipItText,\r\n pickUpInStoreText: props.pickitUpText,\r\n changeStoreText: props.changeStoreText,\r\n storeSelectorStateManager: props.storeSelectorStateManager,\r\n orgUnitLocations: props.orgUnitLocations,\r\n deliveryOptions: foundProductDeliveryOptions,\r\n pickupDeliveryModeCode:\r\n cartline.DeliveryMode !== (undefined || '') ? cartline.DeliveryMode : props.pickupDeliveryModeCode,\r\n locationChangedHandler: props.locationChangedHandler\r\n })\r\n : undefined,\r\n remove: (\r\n \r\n ),\r\n addToWishlist:\r\n isAuthenticated && product && !isCustomPriceSelected ? (\r\n \r\n ) : (\r\n undefined\r\n ),\r\n addToOrderTemplate:\r\n isAuthenticated && orderTemplates && product ? (\r\n \r\n ) : (\r\n undefined\r\n )\r\n };\r\n};\r\n\r\nexport const assembleCartlines = (\r\n cartlines: CartLine[],\r\n products: SimpleProduct[] | undefined,\r\n props: ICartLineItemsProps\r\n): ICartlinesViewProps[] | null => {\r\n const reactNodes: ICartlinesViewProps[] = [];\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 && ArrayExtensions.hasElements(props.productAvailabilites)) {\r\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\r\n if (props.shouldIgnoreWarehouse) {\r\n return productAvailability.ProductAvailableQuantity?.ProductId === cartline.ProductId;\r\n }\r\n return (\r\n productAvailability.ProductAvailableQuantity?.ProductId === cartline.ProductId &&\r\n productAvailability.InventLocationId === cartline.WarehouseId\r\n );\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 reactNodes.push(_assembleNode(cartline, product, props, index, foundProductAvailability, foundProductDeliveryOption));\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLineItems component.\r\n * @param props\r\n */\r\nexport const CartLineItems = (props: ICartLineItemsProps) => {\r\n const { products, cartlines } = props;\r\n return assembleCartlines(cartlines, products, props);\r\n};\r\n","/* eslint-disable security/detect-object-injection */\r\n/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport groupBy from 'lodash/groupBy';\r\n\r\nimport { assembleCartlines, ICartLineItemsProps, ICartlinesViewProps } from './c-cart-line-items';\r\n\r\nconst _assembleGroupCartlines = (cartlines: CartLine[], products: SimpleProduct[] | undefined, props: ICartLineItemsProps): ICartlinesViewProps[][] | null => {\r\n const reactNodes: ICartlinesViewProps[][] = [];\r\n if (!products || products.length === 0) {\r\n props.context.telemetry.error('Products content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const getGroupByStorePickup = (items: CartLine[]) => groupBy(items, item => item.FulfillmentStoreId);\r\n const getGroupByDelivery = (items: CartLine[]) => groupBy(items, item => (item.DeliveryMode));\r\n const groupDelivery = getGroupByDelivery(cartlines);\r\n const cartLinesGroup: CartLine[] = [];\r\n\r\n // 1) Group by store and pick up mode\r\n Object.entries(groupDelivery).forEach(([deliveryType, groupByDeliveryType]) => {\r\n // @ts-expect-error\r\n // eslint-disable-next-line security/detect-object-injection\r\n groupDelivery[deliveryType] = getGroupByStorePickup(groupByDeliveryType);\r\n cartLinesGroup.push(getGroupByStorePickup(groupByDeliveryType));\r\n });\r\n\r\n // 2) Create cartlines group\r\n Object.keys(cartLinesGroup).forEach(key => {\r\n // eslint-disable-next-line security/detect-object-injection\r\n const cartLines = cartLinesGroup[key];\r\n Object.keys(cartLines).forEach(index => {\r\n // eslint-disable-next-line security/detect-object-injection\r\n const cartLine = cartLines[index];\r\n const carLineViewProps = assembleCartlines(cartLine, products, props);\r\n if (carLineViewProps !== null) {\r\n reactNodes.push(carLineViewProps);\r\n }\r\n });\r\n\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLine Group component.\r\n * @param props\r\n */\r\nexport const CartLineGroupItems = (props: ICartLineItemsProps) => {\r\n const { products, cartlines } = props;\r\n return (\r\n _assembleGroupCartlines(cartlines, products, props)\r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\r\nimport { getPromotionOptionsForCartLineItems, PromotionOptionsForCartLineItems } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * IPromotionData entity interface.\r\n */\r\nexport interface IPromotionData {\r\n promotionOptions?: CartPromotionLine[];\r\n}\r\n\r\n/**\r\n * Calls the Retail API and returns a promotion data.\r\n * @param ctx\r\n */\r\nexport async function getPromotionData(ctx: IActionContext): Promise {\r\n const promotionData: IPromotionData = {};\r\n\r\n await getPromotionOptionsForCartLineItems(\r\n new PromotionOptionsForCartLineItems(ctx.requestContext.apiSettings),\r\n ctx\r\n ).then(promotionOptions => {\r\n if (promotionOptions) {\r\n promotionData.promotionOptions = promotionOptions;\r\n }\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n return {};\r\n });\r\n\r\n return promotionData;\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n IAddToOrderTemplateDialogResources,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n ILinesAddedToOrderTemplateDialogResources,\r\n IOrderTemplateNameDialogResources,\r\n IWishlistActionSuccessResult,\r\n SaveCartToOrderTemplateComponent\r\n} from '@msdyn365-commerce/components';\r\nimport MsDyn365, { getUrlSync, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\r\nimport { AsyncResult, CartLine, LineDataValidationFailure, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { cartLineQuantityUpdatedAsync, validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\r\nimport { IInvoiceSummaryLines, InvoiceSummary } from '@msdyn365-commerce-modules/invoice-payment-summary';\r\n// import { IOrderSummaryLines, OrderSummary } from '@msdyn365-commerce-modules/order-summary-utilities';\r\nimport { IOrderSummaryLines, OrderSummary } from '../../common/components/order-summary-lineitem';\r\nimport { PromoCodeComponent } from './components/c-promocode-component';\r\nimport {\r\n ActiveCartProductsInput,\r\n ArrayExtensions,\r\n getActiveCartProductsAction,\r\n ICartLineInventoryValidationResult,\r\n ObjectExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { validateCartLinesInventory } from './actions/validate-cartlines-inventory';\r\nimport {\r\n Alert,\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n INodeProps,\r\n IPayLoad,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n Waiting\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 { ICCartData } from './c-cart.data';\r\nimport { ICCartProps, ICCartResources } from './c-cart.props.autogenerated';\r\nimport { CartLineGroupItems } from './components/c-cart-line-groups';\r\nimport { CartLineItems, ICartlinesViewProps } from './components/c-cart-line-items';\r\nimport { cartPromotions, ICartLineItemViewProps } from './components/c-cart-line-items-promotion';\r\nimport { getPromotionData, IPromotionData } from './utils/get-promotion-in-c-cart';\r\nimport { getNBFlagForCartLine } from '../../common/utils/helper';\r\n\r\nimport Cookies from 'universal-cookie';\r\n/**\r\n * Cart view props interface.\r\n */\r\nexport interface ICartViewProps extends ICCartProps {\r\n className: string;\r\n title?: React.ReactNode;\r\n CartlinesWrapper: INodeProps;\r\n cartlines?: ICartlinesViewProps[];\r\n cartLinesGroup?: ICartlinesViewProps[][];\r\n cart: ICartState | undefined;\r\n orderSummaryHeading: React.ReactNode;\r\n orderSummaryLineitems?: IOrderSummaryLines;\r\n invoiceSummaryLineitems?: IInvoiceSummaryLines;\r\n OrderSummaryWrapper: INodeProps;\r\n OrderSummaryItems: INodeProps;\r\n OrderSummaryErrors?: IOrderSummaryErrors;\r\n checkoutAsGuestButton: React.ReactNode;\r\n checkoutAsSignInUserButton: React.ReactNode;\r\n storeSelector?: React.ReactNode;\r\n backToShoppingButton: React.ReactNode;\r\n waitingComponent: React.ReactNode;\r\n promotionOptions?: ICartLineItemViewProps;\r\n promoCode: React.ReactNode;\r\n cartLoadingStatus: string;\r\n cartDataResult: boolean;\r\n multiplePickUpEnabled?: boolean;\r\n createTemplateFromCartButton: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n moveToWishlistSuccessHandler(result: IWishlistActionSuccessResult, cartlineId: CartLine): void;\r\n}\r\n\r\n/**\r\n * Order summary errors interface.\r\n */\r\nexport interface IOrderSummaryErrors {\r\n Wrapper: INodeProps;\r\n header: React.ReactNode;\r\n errors: React.ReactNode[];\r\n}\r\n\r\n/**\r\n * Cart component state interface.\r\n */\r\ninterface ICartComponentState {\r\n showPromotionDialog: boolean;\r\n cartlinesErrors: LineDataValidationFailure[];\r\n promotionData: IPromotionData;\r\n products: SimpleProduct[];\r\n isCartValid: boolean;\r\n // ITS Customization - embedded src code\r\n embeddedSrcCode?: string;\r\n // ITS Customization - embedded src code end\r\n}\r\n\r\n/**\r\n * Cart component.\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nclass Cart extends React.Component> {\r\n public state: ICartComponentState;\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly payLoad: IPayLoad;\r\n // ITS Customization - embedded src code\r\n private readonly cookies = new Cookies();\r\n // ITS Customization - embedded src code end\r\n private isQuantityLimitsFeatureEnabled: boolean = false;\r\n\r\n private _isMounted: boolean = false;\r\n\r\n private readonly promotionPopupId: string = 'cart-promotion-popup';\r\n\r\n public constructor(props: ICCartProps) {\r\n super(props);\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 this.payLoad = getPayloadObject('click', this.telemetryContent, '');\r\n this.promotionLinkClick = this.promotionLinkClick.bind(this);\r\n this.promotionCloseButtonclick = this.promotionCloseButtonclick.bind(this);\r\n this.state = {\r\n cartlinesErrors: [],\r\n showPromotionDialog: false,\r\n promotionData: {},\r\n products: [],\r\n isCartValid: true,\r\n // ITS Customization - embedded src code\r\n embeddedSrcCode: ''\r\n // ITS Customization - embedded src code end\r\n };\r\n }\r\n\r\n /**\r\n * Component did mount function.\r\n */\r\n public async componentDidMount(): Promise {\r\n this._isMounted = true;\r\n const {\r\n config,\r\n context: { actionContext }\r\n } = this.props;\r\n this.isQuantityLimitsFeatureEnabled = await this.getOrderQuantityLimitsFeatureFlag();\r\n if (this.isQuantityLimitsFeatureEnabled) {\r\n await this.validateCart();\r\n }\r\n\r\n try {\r\n const products = await this.props.data.products;\r\n if (this._isMounted) {\r\n this.setState({ products });\r\n }\r\n } catch (error) {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get cart');\r\n }\r\n // ITS Customization - embedded src code\r\n if (this.cookies && this.cookies.get('embeddedCode')) {\r\n const embeddedSrcCode = this.cookies.get('embeddedCode');\r\n this.setState({ embeddedSrcCode: embeddedSrcCode });\r\n }\r\n // ITS Customization - embedded src code end\r\n\r\n if (config.showAvailablePromotions) {\r\n if (this._isMounted && this.props.data.cart.result?.cart.CartLines) {\r\n this.setState({ promotionData: await getPromotionData(actionContext) });\r\n }\r\n\r\n reaction(\r\n () => this.props.data.cart.result?.cart.CartLines,\r\n async () => {\r\n if (this._isMounted) {\r\n this.setState({ promotionData: await getPromotionData(actionContext) });\r\n }\r\n }\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Component will unmount function.\r\n */\r\n public componentWillUnmount(): void {\r\n this._isMounted = false;\r\n }\r\n\r\n /**\r\n * Should component update function.\r\n * @param nextProps - Next props.\r\n * @param nextState - Next state.\r\n * @returns True if component should update, false otherwise.\r\n */\r\n public shouldComponentUpdate(nextProps: ICCartProps, nextState: ICartComponentState): 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 complexity -- Disabling complexity for render method */\r\n public render(): JSX.Element | null {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n products: { result: products }\r\n },\r\n context: {\r\n request: {\r\n user: { isAuthenticated, signInUrl }\r\n }\r\n // app: {\r\n // config: {\r\n // enableStockCheck,\r\n // disableStockCheckInAppForBackorderableProducts\r\n // }\r\n // }\r\n },\r\n resources\r\n } = this.props;\r\n\r\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\r\n const backToShoppingUrl = getUrlSync('home', 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 const cartLines = this._getCartLines();\r\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\r\n const validInventoryAcrossCartLines = validateCartLinesInventory(\r\n cart?.cart.CartLines ?? [],\r\n this.props.data.productAvailabilites.result ?? [],\r\n this.props.context.actionContext,\r\n products ?? [],\r\n emailDeliveryModeCode\r\n );\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 RetailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\r\n );\r\n const multiplePickUpEnabled = !cart?.hasInvoiceLine && RetailMultiplePickupFeatureState?.IsEnabled;\r\n const cartLinesGroup = multiplePickUpEnabled ? this.getCartLinesGroup() : null;\r\n this.payLoad.contentAction.etext = TelemetryConstant.Checkout;\r\n const checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\r\n this.payLoad.contentAction.etext = TelemetryConstant.GuestCheckout;\r\n const checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\r\n this.payLoad.contentAction.etext = TelemetryConstant.BackToShopping;\r\n const backtoShoppingAttributes = getTelemetryAttributes(this.telemetryContent, this.payLoad);\r\n\r\n // If there's inventory issues across multiple cart lines then update the error and display as part of the order summary\r\n if (validInventoryAcrossCartLines && !validInventoryAcrossCartLines.isValid) {\r\n if (multiplePickUpEnabled && cartLinesGroup !== null) {\r\n for (const cartLineGroup of cartLinesGroup) {\r\n this._updateCartLineErrorForInvalidInventory(cartLineGroup, validInventoryAcrossCartLines);\r\n }\r\n }\r\n\r\n this._updateCartLineErrorForInvalidInventory(cartLines, validInventoryAcrossCartLines);\r\n }\r\n\r\n const viewProps = {\r\n ...this.props,\r\n className: classnames('ms-cart'),\r\n title:

{resources.cartTitle}

,\r\n cart: this.props.data.cart.result,\r\n CartlinesWrapper: { className: 'msc-cartline-wraper' },\r\n OrderSummaryWrapper: { className: cart?.hasInvoiceLine ? 'msc-invoice-summary-wrapper' : 'msc-order-summary-wrapper' },\r\n OrderSummaryItems: { className: cart?.hasInvoiceLine ? 'msc-invoice-summary__items' : 'msc-order-summary__items' },\r\n cartlines: cartLines,\r\n cartLinesGroup,\r\n promoCode: this._getPromoCode(),\r\n promotionOptions: this._getPromotions(),\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n telemetry: this.props.telemetry,\r\n id: this.props.id,\r\n multiplePickUpEnabled,\r\n removePromoAriaLabelFormat: resources.removePromoAriaLabelFormat,\r\n orderSummaryHeading: ArrayExtensions.hasElements(cart?.cart.CartLines) ? (\r\n cart?.hasInvoiceLine ? (\r\n

{resources.invoiceSummaryTitle}

\r\n ) : (\r\n

{resources.orderSummaryTitle}

\r\n )\r\n ) : null,\r\n orderSummaryLineitems: this._getOrderSummaryLineItems(),\r\n invoiceSummaryLineitems: this._getInvoiceSummaryLineItems(),\r\n checkoutAsSignInUserButton: !isCartEmpty ? (\r\n \r\n {resources.checkoutButtonTitle}\r\n \r\n ) : null,\r\n checkoutAsGuestButton:\r\n !isCartEmpty && !isAuthenticated ? (\r\n \r\n {resources.guestCheckoutButtonTitle}\r\n \r\n ) : null,\r\n backToShoppingButton: (\r\n \r\n {resources.backToShoppingButtonTitle}\r\n \r\n ),\r\n createTemplateFromCartButton:\r\n this._displayAddCartToTemplate() && products ? (\r\n \r\n ) : null,\r\n storeSelector:\r\n this.props.slots.storeSelector && this.props.slots.storeSelector.length > 0 ? this.props.slots.storeSelector[0] : null,\r\n removeItemClickHandler: this.removeItemFromCartHandler,\r\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\r\n waitingComponent: ,\r\n cartLoadingStatus: this.props.data.cart.status === 'FAILED' ? this.props.resources.cartLoadingErrorMessage : null,\r\n cartDataResult: this.props.data.cart.result && this.props.data.cart.result.isEmpty,\r\n OrderSummaryErrors: this._getOrderSummaryErrors(cartLines),\r\n telemetryContent: this.telemetryContent,\r\n embeddedSrcCode: this.state.embeddedSrcCode\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n /* eslint-enable complexity -- Disabling complexity for render method */\r\n\r\n /**\r\n * Promotion click event handler.\r\n * @param event - The mouse event.\r\n */\r\n private readonly promotionLinkClick = (event: React.MouseEvent) => {\r\n this.setState({\r\n showPromotionDialog: !this.state.showPromotionDialog\r\n });\r\n };\r\n\r\n /**\r\n * Promotion close button click.\r\n */\r\n private readonly promotionCloseButtonclick = () => {\r\n this._hidePromotionDialog();\r\n };\r\n\r\n /**\r\n * Hide promotion dialog.\r\n */\r\n private _hidePromotionDialog(): void {\r\n this.setState({\r\n showPromotionDialog: false\r\n });\r\n }\r\n\r\n /**\r\n * Display add to cart template.\r\n * @returns True if should display, false otherwise.\r\n */\r\n private _displayAddCartToTemplate(): boolean {\r\n const cart = this.props.data.cart?.result;\r\n if (ObjectExtensions.isNullOrUndefined(cart) || cart.hasInvoiceLine) {\r\n return false;\r\n }\r\n\r\n const RetailB2BEcommerceFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailB2BEcommerceFeature'\r\n );\r\n if (\r\n RetailB2BEcommerceFeatureState?.IsEnabled &&\r\n this.props.data.customerInformation.result?.IsB2b &&\r\n this.props.data.orderTemplates.result &&\r\n ArrayExtensions.hasElements(cart.cart?.CartLines) &&\r\n this.props.data.customerInformation.result\r\n ) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Get promotions.\r\n * @returns React node with the promotions.\r\n */\r\n private _getPromotions(): React.ReactNode {\r\n return (\r\n this.props.config.showAvailablePromotions &&\r\n cartPromotions({\r\n id: this.promotionPopupId,\r\n showPromotionPopup: this.state.showPromotionDialog,\r\n onSeeAllClick: this.promotionLinkClick,\r\n onCloseButtonClick: this.promotionCloseButtonclick,\r\n promotions: this.state.promotionData.promotionOptions,\r\n resources: {\r\n promotionStringHeading: this.props.resources.promotionStringHeading,\r\n promotionLinkText: this.props.resources.promotionLinkText,\r\n promotionPopupHeading: this.props.resources.promotionPopupHeading,\r\n promotionCloseButtonAriaLabel: this.props.resources.promotionCloseButtonAriaLabel\r\n }\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Add error message in cart line in case the quantity exceeds the current inventory.\r\n * @param cartLines - The cart lines.\r\n * @param cartLineInventoryValidationResult - The cart line inventory result.\r\n */\r\n private _updateCartLineErrorForInvalidInventory(\r\n cartLines: ICartlinesViewProps[] | null,\r\n cartLineInventoryValidationResult: ICartLineInventoryValidationResult\r\n ) {\r\n const { resources } = this.props;\r\n\r\n if (\r\n ArrayExtensions.hasElements(cartLines) &&\r\n !cartLineInventoryValidationResult.isValid &&\r\n ArrayExtensions.hasElements(cartLineInventoryValidationResult.productIdWithErrors)\r\n ) {\r\n for (const productIdWithError of cartLineInventoryValidationResult.productIdWithErrors) {\r\n const cartLine = cartLines.find(element => element.data?.cartline.ProductId === productIdWithError);\r\n if (cartLine) {\r\n cartLine.error = resources.outOfStockErrorMessage;\r\n cartLine.hasError = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Get order summary errors.\r\n * @param cartLines - The cart lines.\r\n * @returns Order summary errors.\r\n */\r\n private _getOrderSummaryErrors(cartLines: ICartlinesViewProps[] | null): IOrderSummaryErrors | undefined {\r\n const { enableStockCheck, disableStockCheckInAppForBackorderableProducts } = this.props.context.app.config;\r\n const allErrors =\r\n (cartLines &&\r\n cartLines\r\n .map((cartline, index) => {\r\n // Check if the product is service or not by product type\r\n const isServiceItem = cartline.data?.product?.ItemTypeValue === ReleasedProductType.Service;\r\n\r\n if (disableStockCheckInAppForBackorderableProducts && enableStockCheck && cartline.data?.cartline) {\r\n const NBFlag: boolean | undefined = getNBFlagForCartLine(cartline.data?.cartline);\r\n if (!NBFlag && !isServiceItem && cartline.error) {\r\n return null;\r\n }\r\n }\r\n if (!isServiceItem && cartline.error) {\r\n const fullError =\r\n cartline.data && cartline.data.product?.Name\r\n ? `${cartline.data.product.Name}: ${cartline.error}`\r\n : cartline.error;\r\n\r\n return (\r\n
\r\n {fullError}\r\n
\r\n );\r\n }\r\n\r\n return null;\r\n })\r\n .filter((line): line is JSX.Element => !!line)) ||\r\n [];\r\n\r\n return {\r\n Wrapper: {\r\n tag: Alert,\r\n className: 'msc-alert',\r\n isOpen: allErrors.length > 0,\r\n color: 'danger',\r\n assertive: true,\r\n 'aria-label': this.props.resources.outOfStockErrorMessageHeader\r\n },\r\n header: (\r\n \r\n ),\r\n errors: allErrors\r\n };\r\n }\r\n\r\n /**\r\n * Gets invoice summary line items.\r\n * @returns Invoice summary lines.\r\n */\r\n private _getInvoiceSummaryLineItems(): IInvoiceSummaryLines | undefined {\r\n const {\r\n data: {\r\n cart: { result: cart }\r\n },\r\n telemetry,\r\n resources\r\n } = this.props;\r\n\r\n return cart?.hasInvoiceLine\r\n ? InvoiceSummary({\r\n orderTotalLabel: resources.totalAmountLabel,\r\n invoiceLabel: resources.invoiceLabel,\r\n cart: cart.cart,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n telemetry,\r\n id: this.props.id\r\n })\r\n : undefined;\r\n }\r\n\r\n /**\r\n * Gets order summary line items.\r\n * @returns Order summary lines.\r\n */\r\n private _getOrderSummaryLineItems(): IOrderSummaryLines | undefined {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n channelDeliveryOptionConfig\r\n },\r\n telemetry,\r\n resources\r\n } = this.props;\r\n\r\n const channelConfiguration = this.props.context && this.props.context.request && this.props.context.request.channel;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const featureState = this.props?.data?.featureState;\r\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(item => item.Name === multiplePickupStoreSwitchName)\r\n ?.IsEnabled;\r\n\r\n return channelConfiguration && ArrayExtensions.hasElements(cart?.cart.CartLines) && !cart?.hasInvoiceLine\r\n ? OrderSummary({\r\n cart: cart!.cart,\r\n subTotalLabel: resources.itemsWithCountLabel,\r\n shippingLabel: resources.estimatedShippingLabel,\r\n otherChargeLabel: resources.otherCharges,\r\n taxLabel: resources.estimatedTaxLabel,\r\n orderTotalLabel: resources.orderTotal,\r\n totalDiscountsLabel: resources.totalDiscountsLabel,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n toBeCalculatedText: resources.yetToBeCalculatedText,\r\n freeText: resources.priceFree,\r\n channelConfiguration,\r\n retailMultiplePickUpOptionEnabled,\r\n channelDeliveryOptionConfig: channelDeliveryOptionConfig?.result,\r\n telemetry\r\n })\r\n : undefined;\r\n }\r\n\r\n /**\r\n * Gets promo code.\r\n * @returns React node with the promo code.\r\n */\r\n private _getPromoCode(): React.ReactNode {\r\n const {\r\n data: {\r\n cart: { result: cart }\r\n },\r\n resources\r\n } = this.props;\r\n\r\n return (\r\n cart && (\r\n \r\n )\r\n );\r\n }\r\n\r\n /**\r\n * Generate add to order template dialog resources.\r\n * @param resources - The resources.\r\n * @returns IAddToOrderTemplateDialogResources.\r\n */\r\n private _generateAddToOrderTemplateDialogResources(resources: ICCartResources): IAddToOrderTemplateDialogResources {\r\n return {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText\r\n };\r\n }\r\n\r\n /**\r\n * Generate item added to order template dialog resources.\r\n * @param resources - The resources.\r\n * @returns IItemAddedToOrderTemplateDialogResources.\r\n */\r\n private _generateItemAddedToOrderTemplateDialogResources(resources: ICCartResources): IItemAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n freePriceText: resources.freePriceText,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n }\r\n\r\n /**\r\n * Generate lines added to order template dialog resources.\r\n * @param resources - The resources.\r\n * @returns ILinesAddedToOrderTemplateDialogResources.\r\n */\r\n private _generateLinesAddedToOrderTemplateDialogResources(resources: ICCartResources): ILinesAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n linesAddedToOrderTemplateHeaderItemsOneText: resources.linesAddedToOrderTemplateHeaderItemsOneText,\r\n linesAddedToOrderTemplateHeaderItemsFormatText: resources.linesAddedToOrderTemplateHeaderItemsFormatText,\r\n linesAddedToOrderTemplateHeaderLinesOneText: resources.linesAddedToOrderTemplateHeaderLinesOneText,\r\n linesAddedToOrderTemplateHeaderLinesFormatText: resources.linesAddedToOrderTemplateHeaderLinesFormatText,\r\n linesAddedToOrderTemplateHeaderMessageText: resources.linesAddedToOrderTemplateHeaderMessageText,\r\n linesAddedToOrderTemplateCustomPriceAlertMessageText: resources.linesAddedToOrderTemplateCustomPriceAlertMessageText\r\n };\r\n }\r\n\r\n /**\r\n * Generate duplicate items when adding to order template dialog resources.\r\n * @param resources - The resources.\r\n * @returns IDuplicateItemsWhenAddingToOrderTemplateDialogResources.\r\n */\r\n private _generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\r\n resources: ICCartResources\r\n ): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\r\n return {\r\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\r\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\r\n updateQuantityButtonText: resources.updateQuantityButtonText,\r\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\r\n };\r\n }\r\n\r\n /**\r\n * Generate order template name dialog resources.\r\n * @param resources - The resources.\r\n * @returns IOrderTemplateNameDialogResources.\r\n */\r\n private _generateOrderTemplateNameDialogResources(resources: ICCartResources): IOrderTemplateNameDialogResources {\r\n return {\r\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\r\n orderTemplateTitleLabel: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n orderTemplateDescription: resources.createOrderTemplateDescription,\r\n\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n\r\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\r\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\r\n };\r\n }\r\n\r\n /**\r\n * Gets the cart lines view props.\r\n * @returns ICartlinesViewProps [].\r\n */\r\n private _getCartLines(): ICartlinesViewProps[] | null {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n wishlists: { result: wishlists },\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n },\r\n config,\r\n telemetry,\r\n resources,\r\n modules\r\n } = this.props;\r\n\r\n const imageSettings = this.getImageSettings(config.imageSettings);\r\n\r\n const cartlinesErrors: LineDataValidationFailure[] = this.state.cartlinesErrors;\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n return ArrayExtensions.hasElements(cart?.cart.CartLines)\r\n ? CartLineItems({\r\n cartlines: cart!.cart.CartLines,\r\n storeSelectorModuleId: storeSelectorId,\r\n cartlinesErrors,\r\n products: this.state.products,\r\n productAvailabilites: this.props.data.productAvailabilites.result,\r\n productDeliveryOptions: this.props.data.deliveryOptions.result,\r\n imageSettings,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: this.props.context.app.config.maxQuantityForCartLineItem,\r\n shouldIgnoreWarehouse: this.props.context.app.config.warehouseAggregation === 'multiple',\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 amountString: resources.productDimensionTypeAmount,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\r\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\r\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\r\n discountStringText: resources.discountStringText,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n shippingChargesText: resources.shippingCharges,\r\n priceEditorResources: {\r\n ...resources\r\n }\r\n },\r\n telemetry,\r\n addToWishlistButtonText: resources.addToWishlistButtonText,\r\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\r\n removeButtonText: resources.removeCartButtonText,\r\n shipItText: resources.shipInsteadDisplayText,\r\n pickitUpText: resources.pickItUpDisplayText,\r\n changeStoreText: resources.changeStoreDisplayText,\r\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\r\n outOfStockText: resources.outOfStockErrorMessage,\r\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\r\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\r\n cartState: this.props.data.cart.result,\r\n orgUnitLocations: this.props.data.orgUnitLocations.result,\r\n removeItemClickHandler: this.removeItemFromCartHandler,\r\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\r\n updateCartLinesQuantitySuccessHandler: this.updateCartlineQuantity,\r\n locationChangedHandler: this.fulfillmentStoreIdUpdated,\r\n wishlists,\r\n defaultWishlistName: resources.defaultWishlistName,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n includeErrors: config.showOutOfStockErrors,\r\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\r\n telemetryContent: this.telemetryContent,\r\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\r\n\r\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\r\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\r\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\r\n resources\r\n ),\r\n\r\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\r\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\r\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\r\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\r\n orderTemplates,\r\n customerInformation,\r\n productAvailability: this.props.data.productAvailabilites\r\n })\r\n : null;\r\n }\r\n\r\n /**\r\n * Gets the checkout URL.\r\n * @param isAuthenticated - Is authenticated flag.\r\n * @param guestCheckoutUrl - Guest checkout URL.\r\n * @param signInUrl -The sign in URL.\r\n * @returns The checkout URL.\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 // eslint-disable-next-line security/detect-unsafe-regex\r\n const absoluteUrlRegExp = new RegExp('^(?:[a-z]+:)?//', 'i');\r\n const isAbsoluteUrl = absoluteUrlRegExp.test(guestCheckoutUrl);\r\n let returnURL = guestCheckoutUrl;\r\n if (MsDyn365.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 * Gets the image settings.\r\n * @param imageSettings - Image settings.\r\n * @returns IImageSettings.\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 /**\r\n * Remove item from c-cart handler.\r\n * @param cartlineToRemove - The cart line to remove.\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\r\n .removeCartLines(input)\r\n .then(() => {\r\n this.validateCart().catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n });\r\n })\r\n .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 /**\r\n * Move to wish list handler.\r\n * @param result - The wish list action success result.\r\n * @param cartline - The cart line.\r\n */\r\n private readonly moveToWishlistSuccessHandler = (result: IWishlistActionSuccessResult, cartline?: CartLine) => {\r\n if (result.status === 'ADDED' && cartline) {\r\n this.removeItemFromCartHandler(cartline);\r\n }\r\n };\r\n\r\n /**\r\n * Updates the cart line quantity.\r\n * @param cartlineToUpdate - The cart line.\r\n * @param quantity - The quantity.\r\n * @param lineIndex - The line index.\r\n * @returns True if the cart line was updated, false otherwise.\r\n */\r\n private readonly updateCartlineQuantity = (cartlineToUpdate: CartLine, quantity: number, lineIndex?: number): boolean => {\r\n cartLineQuantityUpdatedAsync(\r\n this.isQuantityLimitsFeatureEnabled,\r\n this.props.data.cart.result,\r\n this.props.telemetry,\r\n this.state.products,\r\n cartlineToUpdate,\r\n quantity\r\n )\r\n .then((cartActionResult: ICartActionResult | undefined): boolean => {\r\n if (cartActionResult?.status === 'SUCCESS') {\r\n this.validateCart().catch(error => {\r\n this.props.telemetry.warning((error as Error).message);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n });\r\n\r\n return true;\r\n }\r\n\r\n if (!ObjectExtensions.isNullOrUndefined(cartActionResult)) {\r\n // Show update line error message.\r\n const lineUpdateFailure: LineDataValidationFailure = {\r\n LineIndex: ObjectExtensions.isNullOrUndefined(lineIndex) ? 0 : lineIndex,\r\n DataValidationFailure: {\r\n ErrorContext: ArrayExtensions.hasElements(cartActionResult.validationResults)\r\n ? cartActionResult.validationResults[0].ErrorContext\r\n : '',\r\n LocalizedMessage: cartActionResult.errorDetails?.LocalizedMessage\r\n }\r\n };\r\n\r\n this.setState((previousState: Readonly) => {\r\n const currentErrors: LineDataValidationFailure[] = previousState.cartlinesErrors.filter(\r\n error => error.LineIndex !== lineIndex\r\n );\r\n currentErrors.push(lineUpdateFailure);\r\n return { cartlinesErrors: currentErrors };\r\n });\r\n }\r\n\r\n return false;\r\n })\r\n .catch(() => {\r\n return false;\r\n });\r\n\r\n return false;\r\n };\r\n\r\n /**\r\n * Fulfillment store id is updated.\r\n */\r\n private readonly fulfillmentStoreIdUpdated = () => {\r\n if (this.isQuantityLimitsFeatureEnabled) {\r\n getActiveCartProductsAction(new ActiveCartProductsInput(), this.props.context.actionContext)\r\n .then(products => {\r\n this.setState({ products });\r\n })\r\n .then(async () => this.validateCart())\r\n .catch((error: Error) => {\r\n this.props.telemetry.warning(error.message);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Validates cart.\r\n * @returns Void promise.\r\n */\r\n private async validateCart(): Promise {\r\n const {\r\n data: { cart },\r\n telemetry,\r\n context\r\n } = this.props;\r\n\r\n const validationResults: LineDataValidationFailure[] | undefined = await validateCartAsync(\r\n this.isQuantityLimitsFeatureEnabled,\r\n cart,\r\n telemetry,\r\n context,\r\n true\r\n );\r\n\r\n if (validationResults) {\r\n const isValid = !ArrayExtensions.hasElements(validationResults);\r\n this.setState({\r\n cartlinesErrors: validationResults,\r\n isCartValid: isValid\r\n });\r\n } else {\r\n this.setState({ isCartValid: true });\r\n }\r\n\r\n return AsyncResult.resolve();\r\n }\r\n\r\n /**\r\n * Get order quantity limit feature flag.\r\n * @returns True if flag is enabled, false otherwise.\r\n */\r\n private async getOrderQuantityLimitsFeatureFlag(): Promise {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n try {\r\n const featureStatuses = 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 return false;\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 return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n try {\r\n const customerInfo = await this.props.data.customerInformation;\r\n return (\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n } catch (error) {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to get customer info');\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the cart lines group.\r\n * @returns ICartlinesViewProps [][].\r\n */\r\n private getCartLinesGroup(): ICartlinesViewProps[][] | null {\r\n const {\r\n data: {\r\n cart: { result: cart },\r\n wishlists: { result: wishlists },\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n },\r\n config,\r\n telemetry,\r\n resources,\r\n modules\r\n } = this.props;\r\n\r\n const imageSettings = this.getImageSettings(config.imageSettings);\r\n const cartlinesErrors: LineDataValidationFailure[] = this.state.cartlinesErrors;\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n\r\n return this.props.data.products &&\r\n this.props.data.products.result &&\r\n cart &&\r\n cart.cart.CartLines &&\r\n cart.cart.CartLines.length > 0 &&\r\n this.props.data.channelDeliveryOptionConfig?.result\r\n ? CartLineGroupItems({\r\n cartlines: cart.cart.CartLines,\r\n storeSelectorModuleId: storeSelectorId,\r\n cartlinesErrors,\r\n products: this.props.data.products.result,\r\n productAvailabilites: this.props.data.productAvailabilites.result,\r\n productDeliveryOptions: this.props.data.deliveryOptions.result,\r\n imageSettings,\r\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: 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 amountString: resources.productDimensionTypeAmount,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n inputQuantityAriaLabel: resources.inputQuantityAriaLabel,\r\n decrementButtonAriaLabel: resources.decrementButtonAriaLabel,\r\n incrementButtonAriaLabel: resources.incrementButtonAriaLabel,\r\n discountStringText: resources.discountStringText,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n shippingChargesText: resources.shippingCharges,\r\n priceEditorResources: {\r\n ...resources\r\n }\r\n },\r\n telemetry,\r\n addToWishlistButtonText: resources.addToWishlistButtonText,\r\n removeFromWishlistButtonText: resources.removeFromWishlistButtonText,\r\n removeButtonText: resources.removeCartButtonText,\r\n shipItText: resources.shipInsteadDisplayText,\r\n pickitUpText: resources.pickItUpDisplayText,\r\n changeStoreText: resources.changeStoreDisplayText,\r\n storeSelectorStateManager: this.props.data.storeSelectorStateManager.result,\r\n outOfStockText: resources.outOfStockErrorMessage,\r\n outOfRangeOneText: resources.errorMessageOutOfRangeOneLeft,\r\n outOfRangeFormatText: resources.errorMessageOutOfRangeFormat,\r\n cartState: this.props.data.cart.result,\r\n orgUnitLocations: this.props.data.orgUnitLocations.result,\r\n removeItemClickHandler: this.removeItemFromCartHandler,\r\n moveToWishlistSuccessHandler: this.moveToWishlistSuccessHandler,\r\n updateCartLinesQuantitySuccessHandler: this.updateCartlineQuantity,\r\n locationChangedHandler: this.fulfillmentStoreIdUpdated,\r\n wishlists,\r\n defaultWishlistName: resources.defaultWishlistName,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n includeErrors: config.showOutOfStockErrors,\r\n showShippingChargesForLineItems: config.showShippingChargesForLineItems,\r\n telemetryContent: this.telemetryContent,\r\n isQuantityLimitsFeatureEnabled: this.isQuantityLimitsFeatureEnabled,\r\n\r\n addToOrderTemplateDialogResources: this._generateAddToOrderTemplateDialogResources(resources),\r\n createOrderTemplateDialogResources: this._generateOrderTemplateNameDialogResources(resources),\r\n itemAddedToOrderTemplateDialogResources: this._generateItemAddedToOrderTemplateDialogResources(resources),\r\n duplicateItemsWhenAddingToOrderTemplateDialogResources: this._generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\r\n resources\r\n ),\r\n\r\n addToOrderTemplateButtonText: resources.addToOrderTemplateButtonText,\r\n addToOrderTemplateButtonTooltip: resources.addToOrderTemplateButtonTooltip,\r\n addToOrderTemplateMessage: resources.addToOrderTemplateMessage,\r\n addItemToOrderTemplateError: resources.addItemToOrderTemplateError,\r\n orderTemplates,\r\n customerInformation,\r\n channelDeliveryOptionConfig: this.props.data.channelDeliveryOptionConfig?.result,\r\n shouldIgnoreWarehouse: this.props.context.app.config.warehouseAggregation === 'multiple',\r\n productAvailability: this.props.data.productAvailabilites\r\n })\r\n : null;\r\n }\r\n}\r\n\r\nexport default Cart;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CartLine } from '@msdyn365-commerce/retail-proxy';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { getNBFlagForCartLine } from '../../../common/utils/helper';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions/';\r\n\r\n/**\r\n * Cart line inventory validation result interface.\r\n */\r\nexport interface ICartLineInventoryValidationResult {\r\n /**\r\n * Define whether the cart lines inventory is valid across multiple cart lines.\r\n */\r\n readonly isValid: boolean;\r\n\r\n /**\r\n * Defines the list of product id with invalid inventory.\r\n */\r\n readonly productIdWithErrors: number[];\r\n}\r\n\r\n/**\r\n * Validates inventory across cart lines.\r\n * @param cartLines - The cart lines.\r\n * @param productAvailabilities - The product availability collection.\r\n * @param actionContext - The action context.\r\n * @param products - The products.\r\n * @param emailDeliveryModeCode - The emailDeliveryModeCode.\r\n * @returns True if all product quantity are available, false otherwise.\r\n */\r\nexport function validateCartLinesInventory(\r\n cartLines: CartLine[],\r\n productAvailabilities: IProductInventoryInformation[],\r\n actionContext: IActionContext,\r\n products?: SimpleProduct[],\r\n emailDeliveryModeCode?: string | undefined\r\n): ICartLineInventoryValidationResult {\r\n const { enableStockCheck, disableStockCheckInAppForBackorderableProducts } = actionContext.requestContext.app.config;\r\n const cartLineMap = new Map();\r\n const defaultCartLineQuantity = 1;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Disabling rule validation for this line.\r\n if (!actionContext.requestContext.app.config.enableStockCheck) {\r\n return {\r\n isValid: true,\r\n productIdWithErrors: []\r\n };\r\n }\r\n const productIdWithErrors = [];\r\n let isValid = true;\r\n\r\n if (ArrayExtensions.hasElements(cartLines) && ArrayExtensions.hasElements(productAvailabilities)) {\r\n // Consolidate products in different cart lines into single entry with the total cart quantity\r\n for (const cartLine of cartLines) {\r\n // Skip validation if is an invoice inline.\r\n if (cartLine.ProductId && !cartLine.IsInvoiceLine) {\r\n if (!cartLineMap.has(cartLine.ProductId)) {\r\n cartLineMap.set(cartLine.ProductId, cartLine.Quantity ?? defaultCartLineQuantity);\r\n } else {\r\n const cartLineTotal = cartLineMap.get(cartLine.ProductId) ?? 0;\r\n cartLineMap.delete(cartLine.ProductId);\r\n cartLineMap.set(cartLine.ProductId, cartLineTotal + (cartLine.Quantity ?? defaultCartLineQuantity));\r\n }\r\n }\r\n }\r\n\r\n // Hashing product availability object by product ID.\r\n const productAvailabilityMap = new Map();\r\n for (const productAvailability of productAvailabilities) {\r\n if (\r\n productAvailability.ProductAvailableQuantity.ProductId &&\r\n !productAvailabilityMap.has(productAvailability.ProductAvailableQuantity.ProductId)\r\n ) {\r\n productAvailabilityMap.set(productAvailability.ProductAvailableQuantity.ProductId, productAvailability);\r\n }\r\n }\r\n\r\n // Compare total quantity with the available quantity from the inventory API, also validate that the product is available.\r\n for (const productId of Array.from(cartLineMap.keys())) {\r\n const cartLineQty = cartLineMap.get(productId) ?? defaultCartLineQuantity;\r\n const productAvailability = productAvailabilityMap.get(productId);\r\n const availableQuantity = productAvailability?.ProductAvailableQuantity.AvailableQuantity ?? undefined;\r\n\r\n // If product is non-stocked or cartLine is electronic delivery, then no inventory check\r\n const cartLine = cartLines.find(line => line.ProductId === productId);\r\n const cartLineProduct = products?.find(product => product.RecordId === productId);\r\n let byPassNBProducts = false;\r\n if(cartLine && enableStockCheck && disableStockCheckInAppForBackorderableProducts) {\r\n const NBFlag = getNBFlagForCartLine(cartLine);\r\n if(!NBFlag && !availableQuantity) {\r\n byPassNBProducts = true;\r\n }\r\n }\r\n let isStockedItem = true;\r\n if (cartLineProduct) {\r\n isStockedItem = !!cartLineProduct.Behavior?.IsStockedProduct;\r\n }\r\n const isEmailDelivery =\r\n cartLine?.DeliveryMode && cartLine.DeliveryMode !== '' ? cartLine.DeliveryMode === emailDeliveryModeCode : false;\r\n const shouldSkipInventoryCheck = !isStockedItem || isEmailDelivery || byPassNBProducts;\r\n\r\n // If product is non-stocked or cartLine is electronic delivery, then no inventory check\r\n if (shouldSkipInventoryCheck) {\r\n continue;\r\n }\r\n // if(byPassNBProducts) {\r\n // isValid = true;\r\n // }\r\n if (!productAvailability?.IsProductAvailable || (availableQuantity && cartLineQty > availableQuantity)) {\r\n productIdWithErrors.push(productId);\r\n isValid = false;\r\n }\r\n }\r\n }\r\n return {\r\n isValid,\r\n productIdWithErrors\r\n };\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { CartPromotionLine } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { INodeProps, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nexport interface ICartLineItemPromotion {\r\n id: string;\r\n showPromotionPopup: boolean;\r\n promotions: CartPromotionLine[] | undefined;\r\n resources: ICartLineItemPromotionResourceString;\r\n onSeeAllClick(event: React.MouseEvent): void;\r\n onCloseButtonClick(): void;\r\n}\r\n\r\nexport interface ICartLineItemViewProps {\r\n promotionMessageWrapper: INodeProps;\r\n promotionMessage: React.ReactNode;\r\n promotionSeeAllLink: React.ReactElement;\r\n promotionDialog: React.ReactNode;\r\n}\r\n\r\nexport interface ICartLineItemPromotionResourceString {\r\n promotionLinkText: string;\r\n promotionStringHeading: string;\r\n promotionPopupHeading: string;\r\n promotionCloseButtonAriaLabel: string;\r\n}\r\n\r\nexport const cartPromotions = (props: ICartLineItemPromotion): ICartLineItemViewProps | undefined => {\r\n\r\n const {\r\n id,\r\n showPromotionPopup,\r\n promotions,\r\n resources: {\r\n promotionLinkText,\r\n promotionPopupHeading\r\n },\r\n onCloseButtonClick,\r\n onSeeAllClick\r\n } = props;\r\n\r\n if (!ArrayExtensions.hasElements(promotions)) {\r\n return;\r\n }\r\n\r\n const titleId = `${id}_title`;\r\n const className = 'msc-cart__promotion';\r\n return {\r\n promotionMessageWrapper: {\r\n className: 'msc-cart__promotion'\r\n },\r\n promotionMessage: (\r\n <>\r\n \r\n \r\n {' '}\r\n {props.resources.promotionStringHeading}\r\n \r\n \r\n ),\r\n promotionSeeAllLink: (\r\n \r\n {' '}\r\n {promotionLinkText}\r\n {' '}\r\n ),\r\n promotionDialog: (\r\n \r\n \r\n
\r\n {promotionPopupHeading}\r\n
\r\n
\r\n \r\n
    \r\n {promotions.map(_promotion => {\r\n return (\r\n
  • \r\n {_promotion.Promotion?.OfferName}\r\n {' '}\r\n
  • \r\n );\r\n }\r\n )}\r\n
\r\n
\r\n \r\n
\r\n )\r\n };\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IInvoiceSummaryLines } from '@msdyn365-commerce-modules/invoice-payment-summary';\r\nimport { IOrderSummaryLines } from '@msdyn365-commerce-modules/order-summary-utilities';\r\nimport { ArrayExtensions, getProductUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\r\n// import { getUrlSync } from '@msdyn365-commerce/core-internal';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\n\r\nimport { ICartViewProps, IOrderSummaryErrors } from './c-cart';\r\nimport { ICartlinesViewProps } from './components/c-cart-line-items';\r\nimport { ICartLineItemViewProps } from './components/c-cart-line-items-promotion';\r\n\r\nconst _renderCartlines = (\r\n cartLines: ICartlinesViewProps[] | undefined,\r\n cartEmptyText: string,\r\n CartlinesWrapper: INodeProps,\r\n storeSelector: React.ReactNode | undefined,\r\n backToShoppingButton: React.ReactNode,\r\n waitingComponent: React.ReactNode,\r\n cartLoadingStatus: string,\r\n cartDataResult: boolean\r\n): JSX.Element[] | JSX.Element => {\r\n if (cartLoadingStatus) {\r\n return <>{cartLoadingStatus};\r\n }\r\n if (cartLines) {\r\n return cartLines.map(cartLine => {\r\n return (\r\n
\r\n {cartLine.cartline}\r\n {storeSelector && cartLine.pickUpInStore ? (\r\n {cartLine.pickUpInStore.defaultComponent}\r\n ) : null}\r\n {cartLine.addToOrderTemplate ? (\r\n \r\n {cartLine.remove}\r\n {cartLine.addToWishlist}\r\n {cartLine.addToOrderTemplate}\r\n \r\n ) : (\r\n <>\r\n {cartLine.remove}\r\n {cartLine.addToWishlist}\r\n \r\n )}\r\n
\r\n );\r\n });\r\n }\r\n return cartDataResult ? (\r\n
\r\n

{cartEmptyText}

\r\n {backToShoppingButton}\r\n
\r\n ) : (\r\n <>{waitingComponent}\r\n );\r\n};\r\n\r\n// ITS Customization\r\nconst _renderSaveBagButton = (props: ICartViewProps): any => {\r\n //const loginUrl = getUrlSync('/_msdyn365/sign-in', props.context.actionContext) || '';\r\n const products: SimpleProduct[] = props.data.products.result || [];\r\n getProductUrlSync(products[0], props.context.actionContext) || '';\r\n return (\r\n \r\n {props.resources.saveBagText}\r\n \r\n ); //custom-work\r\n};\r\n\r\n// ITS Customization\r\nconst _renderBackToShoppingButton = (props: ICartViewProps): any => {\r\n var products: SimpleProduct[] = props.data.products.result || [];\r\n if (products.length > 0) {\r\n products = products.reverse();\r\n return (\r\n \r\n {props.resources.backToShoppingButtonTitle}\r\n \r\n );\r\n } else {\r\n return props.backToShoppingButton;\r\n }\r\n};\r\n\r\n/**\r\n * Method will render error block.\r\n * @param errorData -The order summary errors interface.\r\n * @returns Jsx element.\r\n */\r\nconst _renderErrorBlock = (errorData: IOrderSummaryErrors | undefined): JSX.Element | null => {\r\n if (!errorData || !ArrayExtensions.hasElements(errorData.errors)) {\r\n return null;\r\n }\r\n return (\r\n \r\n {errorData.header}\r\n {errorData.errors}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Method will render invoice summary lines.\r\n * @param invoiceSummaryLines -The invoicesummary lines interface.\r\n * @param OrderSummaryItems -The order summary items props.\r\n * @param props -The cartview props.\r\n * @returns Jsx element.\r\n */\r\nconst _renderInvoiceSummarylines = (\r\n invoiceSummaryLines: IInvoiceSummaryLines | undefined,\r\n OrderSummaryItems: INodeProps,\r\n props: ICartViewProps\r\n): JSX.Element | null => {\r\n if (!invoiceSummaryLines) {\r\n props.context.telemetry.error('InvoiceSummary content is empty, module wont render');\r\n return null;\r\n }\r\n return (\r\n \r\n {invoiceSummaryLines.invoices}\r\n {invoiceSummaryLines.giftCard}\r\n {invoiceSummaryLines.loyalty}\r\n {invoiceSummaryLines.orderTotal}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Method will render order summary lines.\r\n * @param orderSummaryLines -The ordersummary lines interface.\r\n * @param OrderSummaryItems -The order summary items props.\r\n * @param props -The cartview props.\r\n * @returns Jsx element.\r\n */\r\nconst _renderOrderSummarylines = (\r\n orderSummaryLines: IOrderSummaryLines | undefined,\r\n OrderSummaryItems: INodeProps,\r\n props: ICartViewProps\r\n): JSX.Element | null => {\r\n if (!orderSummaryLines) {\r\n props.context.telemetry.error('OrderSummary content is empty, module wont render');\r\n return null;\r\n }\r\n return (\r\n \r\n {props.promoCode}\r\n {orderSummaryLines.subtotal}\r\n {orderSummaryLines.shipping}\r\n {orderSummaryLines.otherCharge}\r\n {orderSummaryLines.tax}\r\n {orderSummaryLines.totalDiscounts ? orderSummaryLines.totalDiscounts : null}\r\n {orderSummaryLines.orderTotal}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Method will render cart promotions.\r\n * @param promotions -The cartline item view props.\r\n * @returns Jsx element.\r\n */\r\nconst _renderPromotions = (promotions: ICartLineItemViewProps): JSX.Element | undefined => {\r\n return (\r\n <>\r\n \r\n {promotions.promotionMessage}\r\n {promotions.promotionSeeAllLink}\r\n {promotions.promotionDialog}\r\n \r\n \r\n );\r\n};\r\n\r\n/**\r\n * Method will render cartlines group title.\r\n * @param cartLine -The cartline view props.\r\n * @param titleSeparate -The title separate.\r\n * @returns Jsx element.\r\n */\r\nconst renderCartLinesGroupTitle = (cartLine: ICartlinesViewProps, titleSeparate: string) => {\r\n const isBopisSelected: boolean | undefined = cartLine.pickUpInStore?.isBopisSelected;\r\n return (\r\n <>\r\n \r\n {isBopisSelected ? (\r\n

\r\n {cartLine.pickUpInStore?.deliveryOption}\r\n {titleSeparate}\r\n {cartLine.pickUpInStore?.orgUnitName}\r\n

\r\n ) : null}\r\n
\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Method will render cartlines groups header title.\r\n * @param pickUpText -The pickup text for group.\r\n * @param shippingText -The shipping text for group.\r\n * @param emailShippingText -The email shipping text for group.\r\n * @param titleSeparate -The title separator.\r\n * @param cartLine -The cartline view props.\r\n * @param emailDeliveryModeCode -The email delivery code from channel.\r\n * @returns Jsx element.\r\n */\r\nconst renderCartLinesGroupHeader = (\r\n pickUpText: string,\r\n shippingText: string,\r\n emailShippingText: string,\r\n titleSeparate: string,\r\n cartLine: ICartlinesViewProps,\r\n emailDeliveryModeCode?: string\r\n) => {\r\n const isBopisSelected: boolean | undefined = cartLine.pickUpInStore?.isBopisSelected;\r\n let groupTitle: string;\r\n\r\n groupTitle = isBopisSelected ? pickUpText : shippingText;\r\n groupTitle = cartLine.data && cartLine.data.cartline.DeliveryMode === emailDeliveryModeCode ? emailShippingText : groupTitle;\r\n\r\n return (\r\n <>\r\n
\r\n

\r\n

{groupTitle}

\r\n {renderCartLinesGroupTitle(cartLine, titleSeparate)}\r\n
\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Method will render cartlines in groups.\r\n * @param props -The cartline.\r\n * @returns Jsx element.\r\n */\r\nconst renderCartLinesGroup = (props: ICartViewProps): JSX.Element | undefined => {\r\n if (props.cartLinesGroup && ArrayExtensions.hasElements(props.cartLinesGroup)) {\r\n return (\r\n
\r\n {props.cartLinesGroup.map(cartlines => {\r\n return (\r\n
\r\n {renderCartLinesGroupHeader(\r\n props.resources.pickUpText,\r\n props.resources.shippingText,\r\n props.resources.emailshippingText,\r\n props.resources.titleSeparate,\r\n cartlines[0],\r\n props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode\r\n )}\r\n {_renderCartlines(\r\n cartlines,\r\n props.resources.emptyCartText,\r\n props.CartlinesWrapper,\r\n props.storeSelector,\r\n props.backToShoppingButton,\r\n props.waitingComponent,\r\n props.cartLoadingStatus,\r\n props.cartDataResult\r\n )}\r\n
\r\n );\r\n })}\r\n
\r\n );\r\n }\r\n return props.cartDataResult ? (\r\n
\r\n
\r\n

{props.resources.emptyCartText}

\r\n {props.backToShoppingButton}\r\n
\r\n
\r\n ) : (\r\n <>{props.waitingComponent}\r\n );\r\n};\r\n\r\nconst CartView: React.FC = (props: ICartViewProps) => {\r\n return (\r\n
\r\n {props.title}\r\n {!props.cart?.hasInvoiceLine && props.promotionOptions && _renderPromotions(props.promotionOptions)}\r\n {props.multiplePickUpEnabled ? (\r\n renderCartLinesGroup(props)\r\n ) : (\r\n \r\n {_renderCartlines(\r\n props.cartlines,\r\n props.resources.emptyCartText,\r\n props.CartlinesWrapper,\r\n props.storeSelector,\r\n props.backToShoppingButton,\r\n props.waitingComponent,\r\n props.cartLoadingStatus,\r\n props.cartDataResult\r\n )}\r\n \r\n )}\r\n {props.orderSummaryHeading && (\r\n \r\n {props.orderSummaryHeading}\r\n {props.cart?.hasInvoiceLine\r\n ? _renderInvoiceSummarylines(props.invoiceSummaryLineitems, props.OrderSummaryItems, props)\r\n : _renderOrderSummarylines(props.orderSummaryLineitems, props.OrderSummaryItems, props)}\r\n {_renderErrorBlock(props.OrderSummaryErrors)}\r\n {props.checkoutAsSignInUserButton}\r\n {_renderSaveBagButton(props)}\r\n {props.checkoutAsGuestButton}\r\n {/* {props.backToShoppingButton} */}\r\n {_renderBackToShoppingButton(props)}\r\n {props.createTemplateFromCartButton}\r\n \r\n )}\r\n {props.storeSelector}\r\n
\r\n );\r\n};\r\n\r\nexport default CartView;\r\n","import { IProductDimensionsWithAvailabilitiesFull, ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\n\r\nimport { ProductsDataActions, ProductDimension, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\nimport { createInventoryAvailabilitySearchCriteria } from '@msdyn365-commerce-modules/retail-actions/';\r\n\r\nimport { ProductDimensionAvailabilitySearchCriteria } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { ICCartProps } from '../../modules/c-cart/c-cart.props.autogenerated';\r\nimport { ICCartData } from '../../modules/c-cart/c-cart.data';\r\nimport { ICartLineProps } from '../../themes/peruvian/views/components/cartlineitem.component';\r\n\r\nexport interface IDimensionForSelectedVariant extends ProductDimensionFull, IProductDimensionsWithAvailabilitiesFull {}\r\n\r\nexport interface IExtendedSimpleProduct extends SimpleProduct {\r\n productDimension?: IDimensionForSelectedVariant[];\r\n NB?: boolean;\r\n}\r\n\r\nexport async function getProductsWithNBFlag(props: ICCartProps, products: SimpleProduct[]) {\r\n const asyncResult = Promise.all(\r\n products.map(async product => {\r\n const result = await __getBackorderableFlagOnSelectedDimension(props, product);\r\n if (result) {\r\n return {\r\n ...product,\r\n productDimension: result\r\n };\r\n } else {\r\n return {\r\n ...product,\r\n productDimension: []\r\n };\r\n }\r\n })\r\n );\r\n return asyncResult;\r\n}\r\n\r\nexport async function __getBackorderableFlagOnSelectedDimension(\r\n props: ICCartProps | ICartLineProps,\r\n product: SimpleProduct\r\n): Promise {\r\n if (!ArrayExtensions.hasElements(product.Dimensions)) {\r\n return [];\r\n }\r\n\r\n const MatchingDimensionValues: ProductDimension[] = [];\r\n product.Dimensions.forEach(dimension => {\r\n MatchingDimensionValues.push({\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue: dimension.DimensionValue\r\n });\r\n });\r\n const promises = product.Dimensions.map(dimension => {\r\n const shippingInventoryConfiguration = createInventoryAvailabilitySearchCriteria(\r\n props.context.actionContext,\r\n [],\r\n true,\r\n undefined,\r\n undefined\r\n );\r\n const searchCriteria: ProductDimensionAvailabilitySearchCriteria = {\r\n RequestedDimensionTypeValue: dimension.DimensionTypeValue,\r\n MatchingDimensionValues: MatchingDimensionValues.filter(item => item.DimensionTypeValue !== dimension.DimensionTypeValue),\r\n DefaultWarehouseOnly: shippingInventoryConfiguration.DefaultWarehouseOnly,\r\n FilterByChannelFulfillmentGroup: shippingInventoryConfiguration.FilterByChannelFulfillmentGroup,\r\n DeliveryModeTypeFilterValue: shippingInventoryConfiguration.DeliveryModeTypeFilterValue\r\n };\r\n\r\n const dimensionValuesPromise = ProductsDataActions.getDimensionValuesWithEstimatedAvailabilitiesAsync(\r\n { callerContext: props.context.actionContext, queryResultSettings: {} },\r\n product.MasterProductId ? product.MasterProductId : product.RecordId,\r\n searchCriteria\r\n );\r\n const fullDimensionPromise = dimensionValuesPromise.then(dimensionValues => {\r\n const fullDimension: IProductDimensionsWithAvailabilitiesFull = {\r\n ...dimension,\r\n dimensionValuesWithInventory: dimensionValues\r\n };\r\n return fullDimension;\r\n });\r\n\r\n return fullDimensionPromise;\r\n });\r\n\r\n const dimensionValuesResults = await Promise.all(promises);\r\n\r\n return prepareDimensionsDataResult(dimensionValuesResults);\r\n}\r\n\r\nconst prepareDimensionsDataResult = (dimensions: IProductDimensionsWithAvailabilitiesFull[]): IDimensionForSelectedVariant[] => {\r\n return dimensions.map(newDimension => {\r\n const oldDimension: IDimensionForSelectedVariant = { ...newDimension };\r\n oldDimension.DimensionValues = ArrayExtensions.validValues(\r\n newDimension.dimensionValuesWithInventory?.map(value => value.DimensionValue)\r\n );\r\n return oldDimension;\r\n });\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, ICommerceApiSettings, ICreateActionContext } from '@msdyn365-commerce/core';\r\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { ICartState } from '../state-interfaces';\r\nimport { getCartState } from './get-cart-state';\r\n\r\n/**\r\n * Input class for getCart data action.\r\n */\r\nexport class GetCartStateDataInput implements IActionInput {\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n constructor(apiSettings: ICommerceApiSettings) {\r\n this.apiSettings = apiSettings;\r\n }\r\n\r\n public getCacheKey = () => `GetCart-chanId:${this.apiSettings.channelId}-catId:${this.apiSettings.catalogId}`;\r\n\r\n public getCacheObjectType = () => 'Cart';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext) => {\r\n return new GetCartStateDataInput(inputData.requestContext.apiSettings);\r\n};\r\n\r\n/**\r\n * Data action to copy the cart for actions.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getCartStateData(input: GetCartStateDataInput, ctx: IActionContext): Promise {\r\n\r\n const cartState = await getCartState(ctx);\r\n if (cartState && cartState.cart.Id !== undefined) {\r\n return cartState;\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce/global-state/get-cart-state-data',\r\n action: >getCartStateData,\r\n input: createInput\r\n});\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IComponentProps, IGridSettings, IImageSettings, Image, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ChannelDeliveryOptionConfiguration, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { AttributeValueBase, CartLine, SalesLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { ArrayExtensions, getFallbackImageUrl, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classNames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport { CartLinePriceEditor, ICartLinePriceEditorResources } from '@msdyn365-commerce/components';\r\nimport { __getBackorderableFlagOnSelectedDimension } from '../../../../common/utilities/dimensions-with-backorderable-flag';\r\nimport { findAttribute, getNBFlagForCartLine, getNBFlagFromProductDimensions, setNameAttribute } from '../../../../common/utils/helper';\r\nimport { updateCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport { getCartState } from '../../../../modules/c-checkout/mod/data-actions';\r\n\r\n/**\r\n * ICartlineResourceString: Interface for specifying the\r\n * resource strings that the component needs.\r\n */\r\nexport interface ICartlineResourceString {\r\n /**\r\n * Display string for discount label.\r\n */\r\n discountStringText: string;\r\n\r\n /**\r\n * String for size key.\r\n */\r\n sizeString: string;\r\n\r\n /**\r\n * String for color key.\r\n */\r\n colorString: string;\r\n\r\n /**\r\n * String associated with the configuration product dimension.\r\n */\r\n configString: string;\r\n\r\n /**\r\n * String for style key.\r\n */\r\n styleString: string;\r\n\r\n /**\r\n * String for amount key.\r\n */\r\n amountString?: string;\r\n\r\n /**\r\n * Display string for quantity label.\r\n */\r\n quantityDisplayString: string;\r\n\r\n /**\r\n * Display string for quantity label.\r\n */\r\n inputQuantityAriaLabel: string;\r\n\r\n /**\r\n * Aria label for the decrement button in quantity component.\r\n */\r\n decrementButtonAriaLabel?: string;\r\n\r\n /**\r\n * Aria label for the increment button in quantity component.\r\n */\r\n incrementButtonAriaLabel?: string;\r\n\r\n /**\r\n * Original text screen reader.\r\n */\r\n originalPriceText: string;\r\n\r\n /**\r\n * Current text screen reader.\r\n */\r\n currentPriceText: string;\r\n\r\n /**\r\n * Shipping Charges Text.\r\n */\r\n shippingChargesText: string;\r\n\r\n priceEditorResources?: ICartLinePriceEditorResources;\r\n}\r\n\r\n/**\r\n * The data about the cart line and products.\r\n */\r\nexport interface ICartLineData {\r\n cartLine: CartLine | SalesLine;\r\n cartState?: ICartState;\r\n product?: SimpleProduct;\r\n}\r\n\r\nexport type CartLineDisplayMode = 'DEFAULT' | 'COMPACT';\r\n\r\n/**\r\n * ICartLineProps: The props required to render cartLineitem.\r\n */\r\nexport interface ICartLineProps extends IComponentProps {\r\n /**\r\n * The flag to change the quantity component from interactivity to static.\r\n */\r\n disableQuantityInteractivity?: boolean;\r\n\r\n /**\r\n * The primary image url.\r\n */\r\n primaryImageUrl?: string;\r\n\r\n /**\r\n * The product url.\r\n */\r\n productUrl?: string;\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\r\n /**\r\n * Boolean flag to indicate if the item is out of stock.\r\n */\r\n isOutOfStock?: boolean;\r\n\r\n /**\r\n * Flag to make quantity section editable.\r\n */\r\n isQuantityEditable?: boolean;\r\n\r\n /**\r\n * Max quantity for line item.\r\n */\r\n maxQuantity?: number;\r\n\r\n /**\r\n * Current quantity for line item.\r\n */\r\n currentQuantity?: number;\r\n\r\n /**\r\n * Resource string for the component.\r\n */\r\n resources: ICartlineResourceString;\r\n\r\n /**\r\n * SalesLine flag.\r\n */\r\n isSalesLine?: boolean;\r\n\r\n /**\r\n * Error message to show in place of quantity.\r\n */\r\n errorMessage?: string;\r\n\r\n /**\r\n * Display mode to use.\r\n */\r\n displayMode?: CartLineDisplayMode;\r\n\r\n /**\r\n * Inventory information label.\r\n */\r\n inventoryInformationLabel?: string;\r\n\r\n /**\r\n * Inventory information class name.\r\n */\r\n inventoryLabelClassName?: string;\r\n\r\n /**\r\n * Flag to show/hide shipping charges for line items.\r\n */\r\n showShippingChargesForLineItems?: boolean;\r\n\r\n /**\r\n * Boolean flag to indicate if cart state status is ready.\r\n */\r\n isCartStateReady?: boolean;\r\n\r\n /**\r\n * Chanel Delivery Option configuration is from api.\r\n */\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n /**\r\n * The telemetry content.\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n\r\n /**\r\n * The cart line index.\r\n */\r\n lineIndex?: number;\r\n\r\n /**\r\n * Quantity onChange callback.\r\n */\r\n quantityOnChange?(cartLine: CartLine, newQuantity: number, lineIndex?: number): void;\r\n\r\n isStockCheckEnabled: boolean;\r\n disableStockCheckInAppForBackorderableProducts: boolean;\r\n}\r\n\r\ninterface IDimensionStrings {\r\n /**\r\n * String for size key.\r\n */\r\n sizeString: string;\r\n\r\n /**\r\n * String for color key.\r\n */\r\n colorString: string;\r\n\r\n /**\r\n * String associated with the configuration product dimension.\r\n */\r\n configString: string;\r\n\r\n /**\r\n * String for style key.\r\n */\r\n styleString: string;\r\n\r\n /**\r\n * String for amount key.\r\n */\r\n amountString?: string;\r\n}\r\n\r\nconst CartLineItemFunctions = {\r\n renderProductDimensions: (Product: SimpleProduct, DimensionStrings: IDimensionStrings) => {\r\n if (!Product || !Product.Dimensions) {\r\n return [];\r\n }\r\n\r\n return Product.Dimensions.map(productDimension => {\r\n if (productDimension.DimensionTypeValue === 3) {\r\n // if (productDimension.DimensionTypeValue === 1) {\r\n return (\r\n
\r\n {/* \r\n {DimensionStrings.colorString}\r\n \r\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\r\n \r\n */}\r\n \r\n {DimensionStrings.sizeString}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === 1) {\r\n // if (productDimension.DimensionTypeValue === 2) {\r\n return (\r\n
\r\n {/* \r\n {DimensionStrings.configString}\r\n \r\n {productDimension.DimensionValue?.Value}\r\n \r\n */}\r\n \r\n {DimensionStrings.colorString}\r\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === 2) {\r\n // if (productDimension.DimensionTypeValue === 3) {\r\n return (\r\n
\r\n {/* \r\n {DimensionStrings.sizeString}\r\n \r\n {productDimension.DimensionValue?.Value}\r\n \r\n */}\r\n \r\n {DimensionStrings.configString}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === 4) {\r\n return (\r\n
\r\n \r\n {Product.IsGiftCard ? DimensionStrings.amountString : DimensionStrings.styleString}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n return null;\r\n });\r\n },\r\n renderDiscountLines: (props: ICartLineProps) => {\r\n if (!props.data.cartLine.DiscountLines || props.data.cartLine.DiscountLines.length === 0) {\r\n return null;\r\n }\r\n\r\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\r\n return (\r\n
\r\n \r\n {discountLine.OfferName ? discountLine.OfferName : ''}:{` ${props.resources.discountStringText || 'Discount'} `}\r\n \r\n \r\n {discountLine.DiscountCost && (\r\n <>\r\n \r\n \r\n )}\r\n \r\n {` (${discountLine.EffectivePercentage !== undefined ? discountLine.EffectivePercentage : ''}%)`}\r\n
\r\n );\r\n });\r\n },\r\n renderInventoryLabel: (props: ICartLineProps) => {\r\n if (!props.inventoryInformationLabel) {\r\n return null;\r\n }\r\n const inventoryCssName = props.inventoryLabelClassName\r\n ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}`\r\n : 'msc-cart-line__product-inventory-label';\r\n return {props.inventoryInformationLabel};\r\n },\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @param props - ICartLineProps props.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n renderUnitOfMeasure: (props: ICartLineProps) => {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\r\n if (\r\n props.context.app.config &&\r\n (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none')\r\n ) {\r\n return undefined;\r\n }\r\n\r\n const product = props.data.product;\r\n if (!product || !product.DefaultUnitOfMeasure) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n
\r\n {product.DefaultUnitOfMeasure}\r\n
\r\n );\r\n },\r\n renderShippingLabel: (props: ICartLineProps) => {\r\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\r\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\r\n const cartline = props.data.cartLine;\r\n let hasShippingMethod = false;\r\n if (channelDeliveryOptionConfig !== undefined) {\r\n hasShippingMethod = !!(\r\n cartline.DeliveryMode &&\r\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.some(deliveryMode => deliveryMode !== cartline.DeliveryMode)\r\n );\r\n } else {\r\n hasShippingMethod = !!(cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode);\r\n }\r\n if (!hasShippingMethod) {\r\n return undefined;\r\n }\r\n\r\n const shippingChargeLines = (cartline.ChargeLines || []).filter(chargeLine => chargeLine.IsShipping);\r\n\r\n if (shippingChargeLines.length === 0) {\r\n return undefined;\r\n }\r\n\r\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\r\n return chargeTotal + (chargeLine.CalculatedAmount || 0);\r\n }, 0);\r\n\r\n const priceComponent = (\r\n \r\n );\r\n return (\r\n <>\r\n \r\n {priceComponent}\r\n \r\n );\r\n },\r\n renderOtherCharges: (props: ICartLineProps) => {\r\n const cartline = props.data.cartLine;\r\n const otherCharges = cartline.ChargeLines?.filter(chargeline => !chargeline.IsShipping);\r\n\r\n return (\r\n (otherCharges &&\r\n otherCharges.map((otherCharge, key) => {\r\n return otherCharge && otherCharge.CalculatedAmount ? (\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n ) : (\r\n ''\r\n );\r\n })) ||\r\n undefined\r\n );\r\n }\r\n};\r\n\r\nconst CartLine: React.FC = (props: ICartLineProps) => {\r\n const { isSalesLine, productUrl, resources, isStockCheckEnabled, disableStockCheckInAppForBackorderableProducts } = props;\r\n const { product, cartLine } = props.data;\r\n\r\n const fetchData = React.useCallback(async product => {\r\n const productDimensions = await __getBackorderableFlagOnSelectedDimension(props, product);\r\n if (productDimensions && product) {\r\n const productNBFlag = getNBFlagFromProductDimensions(productDimensions, product);\r\n const cartLineNBFlag = getNBFlagForCartLine(cartLine);\r\n if (productNBFlag !== undefined && cartLineNBFlag !== undefined && productNBFlag !== cartLineNBFlag) {\r\n const newCartLine = cartLine;\r\n const lineIdBackOrderableFlagAttribute = setNameAttribute(\r\n 'NonBackOrderableFlag',\r\n typeof productNBFlag === 'boolean' ? JSON.stringify(productNBFlag) : ''\r\n );\r\n let currentAttributes: AttributeValueBase[] = newCartLine.AttributeValues || [];\r\n currentAttributes = await findAttribute(currentAttributes, lineIdBackOrderableFlagAttribute);\r\n newCartLine.AttributeValues = currentAttributes; // Updates cart with Attribute Values\r\n const cartState = await getCartState(props.context.actionContext);\r\n updateCartLinesAsync({ callerContext: props.context.actionContext }, cartState.cart.Id, [newCartLine])\r\n .then(() => {\r\n cartState.refreshCart({});\r\n })\r\n .catch(error => props.context.actionContext.telemetry.exception(error));\r\n }\r\n }\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n if (isStockCheckEnabled && disableStockCheckInAppForBackorderableProducts && product) {\r\n fetchData(product);\r\n }\r\n }, []);\r\n\r\n const destructDimensionStrings = {\r\n sizeString: resources.sizeString,\r\n colorString: resources.colorString,\r\n styleString: resources.styleString,\r\n configString: resources.configString,\r\n amountString: resources.amountString\r\n };\r\n const fallbackImageUrl = product && getFallbackImageUrl(product.ItemId, props.context.actionContext.requestContext.apiSettings);\r\n const imageSettings = props.imageSettings;\r\n imageSettings.cropFocalRegion = !ObjectExtensions.isNullOrUndefined(imageSettings);\r\n const { inputQuantityAriaLabel } = props.resources;\r\n const productDimensions = product && CartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\r\n const renderDisountLines = CartLineItemFunctions.renderDiscountLines(props);\r\n const renderInventoryLabel = CartLineItemFunctions.renderInventoryLabel(props);\r\n // const renderUnitOfMeasure = CartLineItemFunctions.renderUnitOfMeasure(props);\r\n const renderShippingLabel = CartLineItemFunctions.renderShippingLabel(props);\r\n const renderOtherCharges = CartLineItemFunctions.renderOtherCharges(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\r\n const prodAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n const productName = product?.Name || cartLine.Description;\r\n const imgeClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-image' : 'msc-cart-line__product-image';\r\n\r\n const _generateErrorMessage = (): JSX.Element | null => {\r\n if (props.errorMessage) {\r\n return (\r\n
\r\n \r\n {props.errorMessage}\r\n
\r\n );\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const _updateQuantity = (event: React.ChangeEvent) => {\r\n if (props.quantityOnChange) {\r\n props.quantityOnChange(props.data.cartLine, Number.parseInt(event.target.value, 10), props.lineIndex);\r\n }\r\n };\r\n\r\n // const _updateInputQuantity = (event: React.ChangeEvent) => {\r\n\r\n // if (props.quantityOnChange) {\r\n // props.quantityOnChange(props.data.cartLine, Number.parseInt(event.target.value, 10), props.lineIndex);\r\n // }\r\n // };\r\n\r\n const _generateMenu = (quantity: number) => {\r\n const nodes = [];\r\n\r\n for (let i = 1; i <= quantity; i++) {\r\n nodes.push(\r\n \r\n );\r\n }\r\n\r\n return nodes;\r\n };\r\n\r\n // const _generateMenu = (quantity: number) => {\r\n // const nodes = [];\r\n\r\n // for (let i = 1; i <= quantity; i++) {\r\n\r\n // nodes.push();\r\n // }\r\n\r\n // return nodes;\r\n // };\r\n\r\n const _generateSelectMenu = (quantity: number, currentQuantity: number | undefined): JSX.Element => {\r\n return (\r\n \r\n {_generateMenu(quantity)}\r\n \r\n );\r\n };\r\n\r\n // const _generateInputMenu = (quantity: number, currentQuantity: number | undefined): JSX.Element => {\r\n\r\n // return (\r\n //
\r\n // \r\n // {/* {\r\n // _generateMenu(quantity)\r\n // } */}\r\n //
\r\n // );\r\n // };\r\n\r\n const _generateQuantityAndPrice = (): JSX.Element[] | null => {\r\n const nodes = [];\r\n\r\n if (props.isOutOfStock) {\r\n return null;\r\n }\r\n\r\n // No quantity selector for invoice line\r\n if (!props.data.cartLine.IsInvoiceLine) {\r\n if (props.isQuantityEditable && !props.data.product?.IsGiftCard) {\r\n nodes.push(_generateSelectMenu(props.maxQuantity || 10, props.currentQuantity));\r\n } else {\r\n nodes.push(\r\n
\r\n \r\n {props.data.cartLine.Quantity}\r\n
\r\n );\r\n }\r\n }\r\n\r\n nodes.push(\r\n
\r\n \r\n
\r\n );\r\n\r\n return nodes;\r\n };\r\n\r\n if (props.displayMode === 'COMPACT') {\r\n // const reducedDimensions: string = product?.Dimensions ? product.Dimensions.reduce(\r\n // (str, productDimension) => {\r\n // if (productDimension.DimensionValue?.Value) {\r\n // if (str) {\r\n // return `${str}, ${productDimension.DimensionValue.Value}`;\r\n // }\r\n\r\n // return `${productDimension.DimensionValue.Value}`;\r\n // }\r\n\r\n // return str;\r\n // },\r\n // '') : '';\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n {productName}\r\n \r\n {/* {reducedDimensions !== '' ?
\r\n {reducedDimensions}\r\n
: ''} */}\r\n {ArrayExtensions.hasElements(productDimensions) ? (\r\n
{productDimensions}
\r\n ) : (\r\n ''\r\n )}\r\n {/* {renderUnitOfMeasure} */}\r\n {_generateQuantityAndPrice()}\r\n {props.data.cartLine.IsInvoiceLine && props.data.cartState && props.resources.priceEditorResources && (\r\n \r\n )}\r\n
\r\n {_generateErrorMessage()}\r\n
\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n {productName}\r\n \r\n {ArrayExtensions.hasElements(productDimensions) ? (\r\n
{productDimensions}
\r\n ) : (\r\n ''\r\n )}\r\n {/* {renderUnitOfMeasure} */}\r\n {renderDisountLines}\r\n {renderInventoryLabel}\r\n {props.showShippingChargesForLineItems &&
{renderShippingLabel}
}\r\n {renderOtherCharges}\r\n
\r\n {_generateQuantityAndPrice()}\r\n {props.data.cartLine.IsInvoiceLine && props.data.cartState && props.resources.priceEditorResources && (\r\n \r\n )}\r\n
\r\n
\r\n {_generateErrorMessage()}\r\n \r\n );\r\n};\r\n\r\n// @ts-expect-error\r\nexport const CartLineItemComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'CartLineItem',\r\n { component: CartLine, ...CartLineItemFunctions }\r\n);\r\n\r\nexport default CartLineItemComponent;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['c-cart'] = {\n c: () => require('partner/modules/c-cart/c-cart.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{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:'deliveryOptions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-cartlines', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orderTemplates', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview', runOn: 1},{name:'orgUnitLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations', runOn: 0},{name:'productAvailabilites', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-availabilities-cartlines', runOn: 0},{name:'products', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-products-in-active-cart', runOn: 0},{name:'storeSelectorStateManager', path:'@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action', runOn: 1},{name:'wishlistItems', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-items-in-wishlist', runOn: 1},{name:'wishlists', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id', runOn: 1}],\n \n iNM: false,\n ns: '__local__',\n n: 'c-cart',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/c-cart'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action';\n let dataAction = require('@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-availabilities-cartlines';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-availabilities-cartlines');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\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-delivery-options-for-cartlines';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-cartlines');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-items-in-wishlist';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-items-in-wishlist');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-products-in-active-cart';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-products-in-active-cart');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview');\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/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n 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|c-cart|c-cart'] = {\n c: () => require('partner/modules/c-cart/c-cart.view.tsx'),\n cn: '__local__-__local__-c-cart'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport {\n IListMapViewState,\n ILoadMapApiInput,\n IStoreInfo,\n IStoreSelectionStateContext,\n IStoreSelectorLocation,\n IStoreSelectorStateManager\n} from './i-store-selection-state-manager';\n\n/**\n * Abstract instance of IStoreSelectorStateManager with base implementation\n * of everything except the geoLocate function.\n */\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\n @computed public get isDialogOpen(): Readonly {\n return this._context !== undefined;\n }\n\n @computed public get context(): Readonly {\n return this._context;\n }\n\n @observable public isMapApiLoaded?: boolean;\n\n @observable public selectedStoreLocationId?: string;\n\n @observable public preferredStore?: IStoreInfo;\n\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n\n @observable public isMapModuleLoaded?: boolean;\n\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\n\n @observable protected _context?: IStoreSelectionStateContext;\n\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\n try {\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\n if (storeInfo) {\n this.preferredStore = storeInfo;\n }\n } catch {\n this.preferredStore = undefined;\n }\n }\n\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\n\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\n this._context = input;\n }\n\n @action\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\n this.selectedStoreLocationId = storeId;\n }\n\n @action\n public async setPreferredStoreLocation(\n storeId?: string,\n storeName?: string | undefined,\n writeToCookie: boolean = false,\n latitude?: number,\n longitude?: number\n ): Promise {\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\n this.preferredStore = storeInfo;\n if (writeToCookie) {\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\n }\n }\n\n @action\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\n this.lastInlineShownStoreInfo = storeInfo;\n }\n\n @action\n public async clearPreferredStore(writeToCookie: boolean): Promise {\n this.preferredStore = undefined;\n if (writeToCookie) {\n this._removeCookie(this.preferredStoreLocalStorageKey);\n }\n }\n\n @action\n public async openDialog(input: IStoreSelectionStateContext): Promise {\n if (this._context && this._context.id === input.id) {\n throw new Error('Dialog is already opened');\n }\n\n this._context = input;\n }\n\n @action\n public async closeDialog(): Promise {\n this._context = undefined;\n }\n\n private _removeCookie(key: string): void {\n if (!key) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.removeItem(key);\n }\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { action } from 'mobx';\n\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IStoreSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (\n !searchTerm ||\n !actionContext.requestContext.channel ||\n !actionContext.requestContext.channel.BingMapsApiKey ||\n !actionContext.requestContext.channel.BingMapsEnabled\n ) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl =\n actionContext.requestContext.app &&\n actionContext.requestContext.app.config &&\n actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise(resolve => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\n input.market ? `&setMkt=${input.market}` : ''\n }`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IStoreSelectorStateManager } from './i-store-selection-state-manager';\nimport { MapStoreSelectorStateManager } from './map-store-selector-state-manager';\n\nexport function createStoreSelectorStateInput(result: IStoreSelectorStateManager): GenericInput {\n return new GenericInput('mapSSSM', result, 'IStoreSelectorStateManager');\n}\n\nconst createStoreSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createStoreSelectorStateInput(new MapStoreSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createStoreSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n ActiveCartProductsInput,\n getActiveCartProductsAction,\n getAvailabilitiesForCartLineItems,\n getDeliveryOptionsForCartLineItems,\n IProductInventoryInformation,\n ProductAvailabilitiesForCartLineItems,\n ProductDeliveryOptionsForCartLineItems\n} 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(new ActiveCartProductsInput(), ctx)\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(new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings), ctx)\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(new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx)\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.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AddToCartBehavior, CartIconComponent } from '@msdyn365-commerce/components';\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\nimport { CartLine, ChannelDeliveryOptionConfiguration, LineDataValidationFailure, OrgUnitLocation } from '@msdyn365-commerce/retail-proxy';\nimport { validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n INodeProps,\n ITelemetryContent,\n TelemetryConstant,\n UncontrolledTooltip\n} 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';\n\nexport interface IMiniCartState {\n miniCartData: IMiniCartData;\n orgUnitLocations?: OrgUnitLocation[];\n isQuantityLimitsFeatureEnabled: 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\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 };\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\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, 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: { enableHoverCart, isAnonymousCheckout },\n context: {\n request: {\n user: { isAuthenticated, signInUrl }\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 =\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\n const hasInvoiceLine = cart?.hasInvoiceLine;\n const cartLines = this._getCartLines();\n const hasError = !this.state.isCartValid || (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?.totalItemsInCart ? cart.totalItemsInCart : 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 hideAriaHidden: true\n };\n\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\n ? resources.totalPriceFormatString.replace('{price}', context.cultureFormatter.formatCurrency(price))\n : '';\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.find(\n feature => feature.Name === multiplePickupStoreSwitchName\n )?.IsEnabled;\n\n const viewProps = {\n ...this.props,\n cartIcon: (\n \n ),\n cartlines: cartLines,\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\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:\n !isCartEmpty && !hasInvoiceLine && (!isAnonymousCheckout || isAuthenticated) ? (\n \n {resources.checkoutButtonTitle}\n \n ) : null,\n checkoutAsGuestButton:\n isAnonymousCheckout && !isCartEmpty && !isAuthenticated ? (\n \n {resources.guestCheckoutButtonTitle}\n \n ) : null,\n goToCartButton: (\n \n {goToCartButtonText}\n \n ),\n flyoutTitle: {flyoutTitle},\n totalPrice:
{priceString}
\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\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(this.state.isQuantityLimitsFeatureEnabled, cart, this.props.telemetry, this.props.context)\n .then((result: LineDataValidationFailure[] | undefined) => {\n this.setState({ isCartValid: !ArrayExtensions.hasElements(result) });\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 _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\n const {\n context: {\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\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 ? 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 salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\n inputQuantityAriaLabel: '', // Not used\n discountStringText: '', // Not used\n originalPriceText: '',\n currentPriceText: '',\n shippingChargesText: '',\n shippingText: resources.shippingText\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 (\n 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\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).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 =\n featureStatuses.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\n )?.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 =\n !!customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\n this.setState({ isQuantityLimitsFeatureEnabled: result });\n })\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.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLineItemComponent, ICartlineResourceString } from '@msdyn365-commerce/components';\nimport MsDyn365, { ICoreContext, IGridSettings, IImageSettings, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n OrgUnitLocation,\n ProductAvailableQuantity,\n ProductDeliveryOptions,\n SimpleProduct\n} 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 {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '../../../Common/get-product';\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\nexport interface IFlyoutCartLineItemViewProps {\n cartline: React.ReactNode;\n remove: React.ReactNode;\n storeLocation: React.ReactNode;\n hasError: boolean;\n\n data: {\n product: SimpleProduct;\n cartline: CartLine;\n };\n}\n\nconst _getCartItemAvailableQuantity = (\n isStockCheckEnabled: boolean,\n outOfStockThreshold: number,\n productAvailability?: ProductAvailableQuantity\n): number => {\n if (isStockCheckEnabled) {\n if (\n !productAvailability ||\n !productAvailability.AvailableQuantity ||\n productAvailability.AvailableQuantity <= 0 ||\n productAvailability.AvailableQuantity <= outOfStockThreshold\n ) {\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) => {\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\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\n ? maxByQuantityLimitsFeatureResult\n : availableQuantityInStock\n : maxByQuantityLimitsFeatureResult;\n }\n if (isStockCheckEnabled) {\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\n }\n return maxQuantityByConfig;\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 { imageSettings, gridSettings, id, typeName, context, resources, removeButtonText, removeItemClickHandler } = props;\n\n const availableQuantityInStock = _getCartItemAvailableQuantity(\n props.isStockCheckEnabled,\n props.outOfStockThreshold,\n foundProductAvailability\n );\n const maxQuantity =\n product &&\n _getCartItemMaxQuantity(\n props.maxCartlineQuantity,\n props.isStockCheckEnabled,\n availableQuantityInStock,\n props.isQuantityLimitsFeatureEnabled,\n product?.Behavior?.MaximumQuantity || 0\n );\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 let productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\n if (MsDyn365.isBrowser) {\n const fullUrl = new URL(productUrl, window.location.href);\n fullUrl.searchParams.set('catalogid', `${cartline.CatalogId ?? 0}`);\n productUrl = fullUrl.href;\n }\n\n return {\n data: {\n product,\n cartline\n },\n hasError: !isServiceItem && props.isStockCheckEnabled ? cartline.Quantity! > maxQuantity : false,\n cartline: (\n \n ),\n remove: (\n \n {removeButtonText}\n \n ),\n storeLocation: _renderStoreLocation(cartline, props)\n };\n};\n\nconst _renderDeliveryLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): string | undefined => {\n let deliverylocation;\n if (cartLine && cartLine.FulfillmentStoreId) {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\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 const delivery = foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === cartLine.DeliveryMode);\n const location = delivery?.Description;\n\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n if (location) {\n deliverylocation = `${location}, ${orgUnitName}`;\n } else {\n deliverylocation = `${orgUnitName}`;\n }\n } else {\n deliverylocation = props.resources.shippingText;\n }\n return deliverylocation;\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 {orgUnitName}\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\nconst _assembleCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: IFlyoutCartLineItemsProps\n): 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(\n _assembleNode(\n cartline,\n product,\n props,\n index,\n foundProductAvailability?.ProductAvailableQuantity,\n foundProductDeliveryOption\n )\n );\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 _assembleCartlines(cartlines, products, props);\n};\n","module.exports = React;","module.exports = ReactDOM;"],"names":["FlintfoxSourceCodeStatusExtensionClass","constructor","odataObject","this","Result","ExtensionProperties","undefined","i","length","className","substr","lastIndexOf","concat","EntityClasses","getSourceIdStatusInput","sourceId","DataServiceQuery","createDataServiceRequestForOperation","DataServiceEntities","bypassCache","returnEntity","SourceId","getSourceIdStatusAsync","context","request","callActionOrExecute","callerContext","OrderSummaryLine","price","label","id","typeName","toBeCalculatedText","freeText","cssLabel","React","PriceComponent","data","CustomerContextualPrice","freePriceText","_buildOrderSummarySection","props","telemetry","_computedLoyaltyAmount","checkoutState","loyaltyAmount","getDeliveryMode","deliveryMode","featureSate","channelDeliveryOptionConfig","pickupDeliveryMode","PickupDeliveryModeCodes","find","dM","OrderSummary","cookies","Cookies","SubtotalAmount","TaxAmount","DiscountAmountWithoutTax","TotalAmount","OtherChargeAmount","cart","canShip","hasDeliveryMethod","hasShippingMethod","freightFee","channelConfiguration","retailMultiplePickUpOptionEnabled","pickupDeliveryModeCode","PickupDeliveryModeCode","emailDeliveryModeCode","EmailDeliveryModeCode","deliveryModes","CartLines","map","cartLine","DeliveryMode","ShippingChargeAmount","some","getDeliveryConfiguration","reactNodes","subtotal","subTotalLabel","tax","taxLabel","orderTotal","orderTotalLabel","otherCharge","otherChargeLabel","shipping","shippingLabel","giftCardAmount","giftCardTotalValue","giftCardExtends","reduce","count","giftCard","Balance","amount","Math","min","_computeGiftCardAmount","subTotalAmountAfterGiftCard","totalAmountAfterGiftCard","loyalty","loyaltyLabel","get","sourceCode","giftcardLabel","totalDiscounts","totalDiscountsLabel","PromoCode","state","super","_onInputChange","e","error","target","value","setState","promoCodeInputValue","canApply","_applyPromotionUrl","cartState","Promise","resolve","reject","sourceCodeApplied","appliedSourceCode","_applyPromotion","async","promoInput","appliedPromo","actionContext","invalidSourceCodeErrorText","cookieExpireDay","app","config","embeddedSourceCodeExpiryDuration","cookieExpiryDate","Date","now","set","path","expires","addPromoCode","promoCode","then","result","status","substatus","duplicatePromoCodeErrorText","catch","failedToAddPromoCodeErrorText","_renderForm","promoPlaceholderText","promoCodeApplyButtonText","attributes","getTelemetryAttributes","telemetryContent","payLoad","onSubmit","event","preventDefault","onChange","placeholder","Button","title","onClick","disabled","_removePromotion","code","currentTarget","getAttribute","removePromoCodes","promoCodes","remove","failedToRemovePromoCodeErrorText","_calculateDiscount","discountAmount","line","DiscountLines","discountLine","DiscountCode","DiscountCost","_renderAppliedPromoCode","appliedSourceCodeHeadingText","removePromoText","Coupons","totalCouponDiscountAmount","coupon","Code","appliedPromoCodeHeadingText","ariaLabel","removePromoAriaLabelFormat","format","key","getPayloadObject","TelemetryConstant","ApplyPromoCode","isCollapseOpen","sourceCodeCookie","shouldComponentUpdate","nextProps","render","promoCodeHeadingText","PromoCodeComponent","msdyn365Commerce","createComponent","component","PickUpInStore","_toggleBOPIS","isBopisSelected","storeSelectorStateManager","product","cartline","storeSelectorModuleId","openDialog","alreadySelectedLocation","OrgUnitNumber","FulfillmentStoreId","deliveryOptions","onLocationSelected","orgUnitLocation","updateCartLinePickupLocation","cartLineId","LineId","location","locationChangedHandler","_onLocationChangedCallback","ShippingAddress","clearCartLinePickupLocation","_getOrgUnitName","fulfillmentStoreId","orgUnitLocations","foundLocation","OrgUnitName","DeliveryOptions","option","callbacks","toggleBopis","defaultComponent","shipItText","pickupInStoretext","changeStoreText","orgUnitName","bopisSelected","toggleBOPIS","type","name","checked","_renderShippingMethod","shipitText","pickUpInStoreText","deliveryOption","pickupStore","delivery","Description","_getDeliveryOption","ContainerProps","_assembleNode","index","foundProductAvailability","foundProductDeliveryOptions","imageSettings","gridSettings","resources","removeButtonText","removeItemClickHandler","moveToWishlistSuccessHandler","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","addToWishlistButtonText","removeFromWishlistButtonText","orderTemplates","customerInformation","wishlists","defaultWishlistName","isAuthenticated","user","nameOfWishlist","Name","availableQuantityInStock","isStockCheckEnabled","productAvailability","disableStockCheckInAppForBackorderableProducts","maxCartlineQuantity","NBFlag","AttributeValues","attr","TextValue","JSON","parse","IsProductAvailable","ProductAvailableQuantity","AvailableQuantity","_getCartItemAvailableQuantity","maxQuantity","maxQuantityByConfig","isQuantityLimitsFeatureEnabled","maxByQuantityLimitsFeature","maxByQuantityLimitsFeatureResult","_getCartItemMaxQuantity","Behavior","MaximumQuantity","shouldSkipStockCheck","ItemTypeValue","ReleasedProductType","Service","IsInvoiceLine","errorMessage","ObjectExtensions","isNullOrUndefined","currentQuantity","lineIndex","finalErrorMessages","productAvailabilites","ArrayExtensions","hasElements","shouldIgnoreWarehouse","ProductId","InventLocationId","WarehouseId","includeErrors","push","outOfStockText","outOfRangeOneText","outOfRangeFormatText","replace","toString","cartlinesErrors","filter","LineIndex","forEach","DataValidationFailure","ErrorContext","join","_getErrorMessage","Quantity","onRemoveClickHandler","onRemoveClickFunction","payload","TelemetryEvent","RemoveFromCart","inventoryLbl","StockLevelLabel","inventoryCode","StockLevelCode","toLowerCase","isCustomPriceSelected","Dimensions","dimension","DimensionTypeValue","DimensionValue","Value","cartlineId","hasError","CartLineItemComponent","isOutOfStock","productUrl","getProductUrlSync","getInvoiceDetailsPageUrlSync","isQuantityEditable","quantityOnChange","updateCartLinesQuantitySuccessHandler","primaryImageUrl","PrimaryImageUrl","inventoryInformationLabel","inventoryLabelClassName","isCartStateReady","showShippingChargesForLineItems","pickUpInStore","pickitUpText","addToWishlist","AddToWishlistComponent","showButtonText","showStatusMessage","showRemoveButton","showButtonTooltip","ariaRole","onSuccess","addToOrderTemplate","AddToOrderTemplateComponent","classnames","quantity","shouldShowButtonFailedTooltip","disableButton","disableTooltip","assembleCartlines","cartlines","products","foundProductDeliveryOption","getProductByProductIdAndWarehouse","getProductByProductId","productDeliveryOptions","CartLineGroupItems","getGroupByStorePickup","items","groupBy","item","groupDelivery","cartLinesGroup","Object","entries","deliveryType","groupByDeliveryType","keys","cartLines","carLineViewProps","_assembleGroupCartlines","getPromotionData","ctx","promotionData","getPromotionOptionsForCartLineItems","PromotionOptionsForCartLineItems","requestContext","apiSettings","promotionOptions","exception","Cart","_isMounted","promotionPopupId","promotionLinkClick","showPromotionDialog","promotionCloseButtonclick","_hidePromotionDialog","getImageSettings","viewports","xs","q","w","h","sm","lg","lazyload","removeItemFromCartHandler","cartlineToRemove","input","cartLineIds","removeCartLines","validateCart","warning","debug","updateCartlineQuantity","cartlineToUpdate","cartLineQuantityUpdatedAsync","cartActionResult","message","lineUpdateFailure","validationResults","LocalizedMessage","errorDetails","previousState","currentErrors","fulfillmentStoreIdUpdated","getActiveCartProductsAction","ActiveCartProductsInput","getTelemetryObject","telemetryPageName","friendlyName","bind","isCartValid","embeddedSrcCode","getOrderQuantityLimitsFeatureFlag","showAvailablePromotions","reaction","componentWillUnmount","nextState","signInUrl","guestCheckoutUrl","getUrlSync","backToShoppingUrl","checkoutURL","getCheckoutURL","isCartEmpty","_getCartLines","channel","validInventoryAcrossCartLines","productAvailabilities","enableStockCheck","cartLineMap","Map","isValid","productIdWithErrors","has","cartLineTotal","delete","productAvailabilityMap","productId","Array","from","cartLineQty","availableQuantity","cartLineProduct","RecordId","byPassNBProducts","getNBFlagForCartLine","isStockedItem","IsStockedProduct","isEmailDelivery","validateCartLinesInventory","RetailMultiplePickupFeatureState","featureState","multiplePickUpEnabled","hasInvoiceLine","IsEnabled","getCartLinesGroup","contentAction","etext","Checkout","checkoutBySignInAttributes","GuestCheckout","checkoutByGuestAttributes","BackToShopping","backtoShoppingAttributes","cartLineGroup","_updateCartLineErrorForInvalidInventory","viewProps","cartTitle","CartlinesWrapper","OrderSummaryWrapper","OrderSummaryItems","_getPromoCode","_getPromotions","orderSummaryHeading","invoiceSummaryTitle","orderSummaryTitle","orderSummaryLineitems","_getOrderSummaryLineItems","invoiceSummaryLineitems","_getInvoiceSummaryLineItems","checkoutAsSignInUserButton","href","checkoutButtonTitle","checkoutAsGuestButton","guestCheckoutButtonTitle","backToShoppingButton","backToShoppingButtonTitle","createTemplateFromCartButton","_displayAddCartToTemplate","SaveCartToOrderTemplateComponent","_generateAddToOrderTemplateDialogResources","_generateOrderTemplateNameDialogResources","linesAddedToOrderTemplateDialogResources","_generateLinesAddedToOrderTemplateDialogResources","createOrderTemplateFromCartButton","createOrderTemplateFromCartButtonTooltip","storeSelector","slots","waitingComponent","Waiting","cartLoadingStatus","cartLoadingErrorMessage","cartDataResult","isEmpty","OrderSummaryErrors","_getOrderSummaryErrors","renderView","RetailB2BEcommerceFeatureState","IsB2b","showPromotionPopup","promotions","promotionLinkText","promotionPopupHeading","onCloseButtonClick","onSeeAllClick","titleId","promotionMessageWrapper","promotionMessage","promotionStringHeading","promotionSeeAllLink","tabIndex","role","promotionDialog","Modal","isOpen","toggle","ModalHeader","ModalBody","_promotion","Promotion","OfferName","ModalFooter","cartPromotions","promotionCloseButtonAriaLabel","cartLineInventoryValidationResult","productIdWithError","element","outOfStockErrorMessage","allErrors","isServiceItem","fullError","Wrapper","tag","Alert","color","assertive","outOfStockErrorMessageHeader","header","errors","InvoiceSummary","totalAmountLabel","invoiceLabel","itemsWithCountLabel","estimatedShippingLabel","otherCharges","estimatedTaxLabel","yetToBeCalculatedText","priceFree","collapseTimeOut","invalidPromoCodeErrorText","duplicatePromotionErrorText","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","_generateItemAddedToOrderTemplateDialogResources","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","originalPriceText","currentPriceText","linesAddedToOrderTemplateHeaderItemsOneText","linesAddedToOrderTemplateHeaderItemsFormatText","linesAddedToOrderTemplateHeaderLinesOneText","linesAddedToOrderTemplateHeaderLinesFormatText","linesAddedToOrderTemplateHeaderMessageText","linesAddedToOrderTemplateCustomPriceAlertMessageText","_generateDuplicateItemsWhenAddingToOrderTemplateDialogResources","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","modules","storeSelectorId","CartLineItems","maxQuantityForCartLineItem","warehouseAggregation","sizeString","productDimensionTypeSize","colorString","productDimensionTypeColor","configString","productDimensionTypeConfiguration","styleString","productDimensionTypeStyle","amountString","productDimensionTypeAmount","quantityDisplayString","quantityDisplayText","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","discountStringText","shippingChargesText","shippingCharges","priceEditorResources","removeCartButtonText","shipInsteadDisplayText","pickItUpDisplayText","changeStoreDisplayText","errorMessageOutOfRangeOneLeft","errorMessageOutOfRangeFormat","showOutOfStockErrors","addToOrderTemplateMessage","addItemToOrderTemplateError","isAbsoluteUrl","RegExp","test","returnURL","MsDyn365","isBrowser","window","origin","includes","validateCartAsync","AsyncResult","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","featureStatuses","customerInfo","observer","_renderCartlines","cartEmptyText","Node","renderCartLinesGroupHeader","pickUpText","shippingText","emailShippingText","titleSeparate","groupTitle","renderCartLinesGroupTitle","errorData","renderModuleAttributes","emailshippingText","emptyCartText","renderCartLinesGroup","invoiceSummaryLines","invoices","_renderInvoiceSummarylines","orderSummaryLines","_renderOrderSummarylines","saveBtnURL","saveBagText","_renderSaveBagButton","reverse","_renderBackToShoppingButton","__getBackorderableFlagOnSelectedDimension","MatchingDimensionValues","promises","shippingInventoryConfiguration","createInventoryAvailabilitySearchCriteria","searchCriteria","RequestedDimensionTypeValue","DefaultWarehouseOnly","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","ProductsDataActions","queryResultSettings","MasterProductId","dimensionValues","dimensionValuesWithInventory","dimensionValuesResults","all","prepareDimensionsDataResult","dimensions","newDimension","oldDimension","DimensionValues","validValues","GetCartStateDataInput","getCacheKey","channelId","catalogId","getCacheObjectType","dataCacheType","createObservableDataAction","action","getCartState","Id","inputData","CartLineItemFunctions","renderProductDimensions","Product","DimensionStrings","productDimension","IsGiftCard","renderDiscountLines","OfferId","isSalesLine","PeriodicDiscount","BasePrice","DiscountAmount","EffectivePercentage","renderInventoryLabel","inventoryCssName","renderUnitOfMeasure","unitOfMeasureDisplayType","DefaultUnitOfMeasure","renderShippingLabel","shippingChargeLines","ChargeLines","chargeLine","IsShipping","chargeTotal","CalculatedAmount","priceComponent","renderOtherCharges","chargeline","createComponentOverride","fetchData","productDimensions","productNBFlag","getNBFlagFromProductDimensions","cartLineNBFlag","newCartLine","lineIdBackOrderableFlagAttribute","setNameAttribute","stringify","currentAttributes","findAttribute","updateCartLinesAsync","refreshCart","destructDimensionStrings","fallbackImageUrl","getFallbackImageUrl","ItemId","cropFocalRegion","renderDisountLines","prodAttribute","productName","imgeClassName","_generateErrorMessage","_updateQuantity","Number","parseInt","_generateSelectMenu","nodes","_generateMenu","_generateQuantityAndPrice","classNames","NetAmount","Price","NetAmountWithoutTax","NetPrice","displayMode","Image","src","fallBackSrc","altText","loadFailureBehavior","CartLinePriceEditor","binding","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","BaseStoreSelectorStateManager","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","isMapModuleLoaded","_readFromToCookie","storeInfo","preferredStore","_context","storeId","selectedStoreLocationId","storeName","writeToCookie","StoreId","StoreName","Latitude","Longitude","_writeToCookie","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","localStorage","removeItem","setItem","cookieValue","getItem","__decorate","computed","observable","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","trim","query","encodeURI","geolocationApiUrl","requestUrl","script","document","createElement","setAttribute","resourceSets","point","coordinates","body","appendChild","StringExtensions","isNullOrEmpty","getElementById","url","lang","market","defer","mapAPIReady","isMapApiLoaded","addEventListener","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","getGenericAction","getMiniCartData","miniCartData","getAvailabilitiesForCartLineItems","ProductAvailabilitiesForCartLineItems","getDeliveryOptionsForCartLineItems","ProductDeliveryOptionsForCartLineItems","CartIcon","getSortedCartLines","sortOrder","lines","sort","item1","item2","LineNumber","_getImageSettings","_removeItemFromCartHandler","CheckOut","ViewShoppingBag","viewShoppingBagAttributes","_setOrderQuantityLimitsFeatureFlag","_validateCart","componentDidUpdate","prevProps","enableHoverCart","isAnonymousCheckout","cartUrl","_getCheckoutURL","shouldShowMiniCart","isProductAddedToCart","addToCartBehavior","AddToCartBehavior","showMiniCart","includeFlyout","totalItemsInCart","goToCartButtonText","goToCartButtonTitle","flyoutTitle","flyoutTooltip","UncontrolledTooltip","placement","hideArrow","trigger","shouldShowCloseButton","cartPageUrl","hideAriaHidden","priceString","totalPriceFormatString","cultureFormatter","formatCurrency","feature","cartIcon","CartIconComponent","cartLabel","cartQtyLabel","FlyoutContainer","miniCartWrapper","miniCartItemWrapper","goToCartButton","totalPrice","cartVersion","Version","lastValidatedCartVersion","FlyoutCartLineItems","cartLinesSortOrder","outOfStockThreshold","salesAgreementPricePrompt","_renderDeliveryLocation","deliverylocation","_renderStoreLocation","_assembleCartlines","RemoveCartItem","removeCartItemAttribute","fullUrl","URL","searchParams","CatalogId","deliveryLocation","storeLocation","module","exports","ReactDOM"],"sourceRoot":""}