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IAA2B,CAC7DrG,GAAI,sEACJL,OAAwCm0B,EAAAA,aACxCj0B,MAAO2zB,IAGX,wBC3BAnB,EAAO0B,QAAUpzB,2BCAjB0xB,EAAO0B,QAAUhgB","sources":["webpack://msdyn365.commerce.online/./src/actions/FlintFoxCheckoutEntities.g.ts?5382","webpack://msdyn365.commerce.online/./src/actions/FlintFoxCheckoutAction.g.ts?313c","webpack://msdyn365.commerce.online/./src/actions/get-payment-onbill-value.action.ts?df19","webpack://msdyn365.commerce.online/./src/actions/savesubmit-enabledisable.action.ts?d0df","webpack://msdyn365.commerce.online/./src/common/components/order-summary-lineitem.tsx?0022","webpack://msdyn365.commerce.online/./src/modules/c-checkout/actions/global-state-data-action.ts?7b66","webpack://msdyn365.commerce.online/./src/modules/c-checkout/actions/i-global-state.ts?63ef","webpack://msdyn365.commerce.online/./src/modules/c-checkout/actions/checkout-state-data-action.ts?059b","webpack://msdyn365.commerce.online/./src/modules/c-checkout/actions/get-products-in-active-checkout-cart.ts?16a1","webpack://msdyn365.commerce.online/./src/modules/c-checkout/components/alert.tsx?45a9","webpack://msdyn365.commerce.online/./src/modules/c-checkout/components/get-invoice-payment-summary.tsx?9e3b","webpack://msdyn365.commerce.online/./src/modules/c-checkout/components/get-line-items.tsx?8a40","webpack://msdyn365.commerce.online/./src/modules/c-checkout/components/get-order-summary.tsx?4d22","webpack://msdyn365.commerce.online/./src/modules/c-checkout/components/guided-card.tsx?536e","webpack://msdyn365.commerce.online/./src/modules/c-checkout/components/guided-form.tsx?0db2","webpack://msdyn365.commerce.online/./src/modules/c-checkout/components/place-order-button.tsx?c682","webpack://msdyn365.commerce.online/./src/modules/c-checkout/methods/checkout.ts?dc76","webpack://msdyn365.commerce.online/./src/modules/c-checkout/methods/empty-active-cart.ts?8132","webpack://msdyn365.commerce.online/./src/modules/c-checkout/methods/place-order.ts?1a57","webpack://msdyn365.commerce.online/./src/actions/FlintFoxOnAccountGuestCheckoutEntities.g.ts?4528","webpack://msdyn365.commerce.online/./src/actions/FlintFoxOnAccountGuestCheckoutAction.g.ts?0afc","webpack://msdyn365.commerce.online/./src/modules/c-checkout/c-checkout.tsx?c255","webpack://msdyn365.commerce.online/./src/modules/c-checkout/c-checkout.view.tsx?3a26","webpack://msdyn365.commerce.online/./lib/c-checkout/module-registration.js?5b84","webpack://msdyn365.commerce.online/../../src/checkout-state-data-action.ts?8344","webpack://msdyn365.commerce.online/../../src/checkout-state.ts?acd8","webpack://msdyn365.commerce.online/../../../src/module-state-manager/module-state.ts?7579","webpack://msdyn365.commerce.online/../../../src/module-state-manager/with-module-state.tsx?61ca","webpack://msdyn365.commerce.online/./src/invoice-summary-lineitem.tsx?5f61","webpack://msdyn365.commerce.online/../../src/search-org-unit-locations.ts?d18d","webpack://msdyn365.commerce.online/external var \"React\"?0d3b","webpack://msdyn365.commerce.online/external var \"ReactDOM\"?853b"],"sourcesContent":["// 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// import { jsonLightReadStringPropertyValue } from '@msdyn365-commerce/retail-proxy/dist/externals';\r\n\r\n/**\r\n * Checkout entity interface.\r\n */\r\nexport interface ICheckout {\r\n Response?: string;\r\n}\r\n\r\n/**\r\n * Checkout entity class.\r\n */\r\nexport class CheckoutExtensionClass implements ICheckout {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Response: string;\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.Response = odataObject.Response;\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 {\r\n AsyncResult,\r\n callActionOrExecute,\r\n DataServiceQuery,\r\n IContext,\r\n IDataServiceRequest\r\n // IQueryResultSettings,\r\n // NullResult\r\n} from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * 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\nimport * as DataServiceEntities from './FlintFoxCheckoutEntities.g';\r\n\r\nfunction saveCheckoutDetailsQuery(): DataServiceQuery {\r\n return new DataServiceQuery();\r\n}\r\n\r\nexport function saveCheckoutDetailsInput(\r\n email: string,\r\n phone: string,\r\n custAccount: string,\r\n rentFlag: number,\r\n emailFlag: number\r\n): IDataServiceRequest {\r\n const query = saveCheckoutDetailsQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'SaveCheckoutDetails',\r\n true,\r\n DataServiceEntities.CheckoutExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.ICheckout' },\r\n {\r\n Email: email,\r\n Phone: phone,\r\n CustAccount: custAccount,\r\n RentFlag: rentFlag,\r\n EmailFlag: emailFlag\r\n }\r\n );\r\n}\r\n\r\nexport function saveCheckoutDetailsAsync(\r\n context: IContext,\r\n email: string,\r\n phone: string,\r\n custAccount: string,\r\n rentFlag: number,\r\n emailFlag: number\r\n): AsyncResult {\r\n const request = saveCheckoutDetailsInput(email, phone, custAccount, rentFlag, emailFlag);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetPaymentOnbillValue Input Action\r\n */\r\nexport class GetPaymentOnbillValueInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `GetPaymentOnbillValue`;\r\n public getCacheObjectType = () => 'GetPaymentOnbillValue';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetPaymentOnbillValueData {\r\n onBill: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetPaymentOnbillValueInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetPaymentOnbillValueInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { onBill: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetPaymentOnbillValue',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * SavesubmitEnabledisable Input Action\r\n */\r\nexport class SavesubmitEnabledisableInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `SavesubmitEnabledisable`;\r\n public getCacheObjectType = () => 'SavesubmitEnabledisable';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ISavesubmitEnabledisableData {\r\n disableButton: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new SavesubmitEnabledisableInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: SavesubmitEnabledisableInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { disableButton: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'SavesubmitEnabledisable',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\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 { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, ICommerceApiSettings, ICreateActionContext, IObservableAction } from '@msdyn365-commerce/core';\r\n\r\nimport { GlobalStateConstructor, IGlobalState ,createGlobalState} from './i-global-state';\r\nexport declare type GlobalStateType = 'CARTSTATE' | 'CHECKOUTSTATE';\r\n\r\n/**\r\n * Shared class that handles global state inputs.\r\n */\r\nexport class GlobalStateInput implements IActionInput {\r\n public readonly stateConstructor: GlobalStateConstructor;\r\n\r\n public readonly key: GlobalStateType;\r\n\r\n private readonly apiSettings: ICommerceApiSettings;\r\n\r\n constructor(key: GlobalStateType, stateConstructor: GlobalStateConstructor, apiSettings: ICommerceApiSettings) {\r\n this.apiSettings = apiSettings;\r\n this.stateConstructor = stateConstructor;\r\n this.key = key;\r\n }\r\n\r\n public getCacheKey = () => `${this.key}-chanId:${this.apiSettings.channelId}-catId:${this.apiSettings.catalogId}`;\r\n\r\n public getCacheObjectType = () => this.key;\r\n\r\n public dataCacheType = (): CacheType => 'instance';\r\n}\r\n\r\nexport async function getState(input: GlobalStateInput, ctx: IActionContext): Promise {\r\n const globalStateObject = createGlobalState(input.stateConstructor, ctx);\r\n await globalStateObject.initialize();\r\n return globalStateObject;\r\n}\r\n\r\nexport default function createGlobalStateDataAction(key: GlobalStateType, stateConstructor: GlobalStateConstructor): IObservableAction {\r\n return createObservableDataAction({\r\n action: >getState,\r\n input: (args: ICreateActionContext) => {\r\n return new GlobalStateInput(key, stateConstructor, args.requestContext.apiSettings);\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\nimport { IActionContext } from '@msdyn365-commerce/core';\r\n\r\nexport declare type GlobalStateStatus = 'READY' | 'UPDATING' | 'ERROR';\r\n\r\nexport type GlobalStateConstructor = new (actionContext: IActionContext) => T;\r\n\r\nexport function createGlobalState(ctor: GlobalStateConstructor, actionContext: IActionContext): T {\r\n const res = new ctor(actionContext);\r\n return res;\r\n}\r\n\r\nexport interface IGlobalState {\r\n readonly status: GlobalStateStatus;\r\n\r\n initialize(): Promise;\r\n}\r\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { BaseCheckoutState } from '../mod/checkout-state/base-checkout-state';\nimport { ICheckoutState } from '../mod/state-interfaces/i-checkout-state';\nimport createGlobalStateDataAction from './global-state-data-action';\n\nexport default createGlobalStateDataAction('CHECKOUTSTATE', BaseCheckoutState);\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 } from '@msdyn365-commerce/core';\r\nimport { getCheckoutState } from '@msdyn365-commerce/global-state';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { getSimpleProducts, ProductInput } from '@msdyn365-commerce-modules/retail-actions';\r\n\r\n/**\r\n * Input class for ActiveCheckoutCartWithProducts data action.\r\n */\r\nexport class ActiveCheckoutCartProductsInput implements IActionInput {\r\n public getCacheKey = () => 'ActiveCheckoutCartProducts';\r\n\r\n public getCacheObjectType = () => 'ActiveCheckoutCartProducts';\r\n\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const createInput = () => {\r\n return new ActiveCheckoutCartProductsInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a cart object based on the passed GetCartInput.\r\n * @param input\r\n * @param ctx\r\n */\r\nexport async function getActiveCheckoutCartProductsAction(input: ActiveCheckoutCartProductsInput, ctx: IActionContext): Promise {\r\n // If no cart ID is provided in input, we need to create a cart object\r\n if (!input) {\r\n ctx.telemetry.exception(new Error('[getActiveCheckoutCartWithProducts]No valid Input was provided, failing'));\r\n throw new Error('[getActiveCheckoutCartWithProducts]No valid Input was provided, failing');\r\n }\r\n\r\n const checkoutState = await getCheckoutState(ctx);\r\n const cart = checkoutState.checkoutCart.cart;\r\n\r\n // If there are cart lines, make call to get products\r\n if (!checkoutState.checkoutCart.hasInvoiceLine && cart && cart.CartLines && cart.CartLines.length > 0) {\r\n return getSimpleProducts(\r\n cart.CartLines.map(cartLine => {\r\n if (cartLine.ProductId) {\r\n return new ProductInput(cartLine.ProductId, ctx.requestContext.apiSettings);\r\n }\r\n return undefined;\r\n }).filter(Boolean),\r\n ctx\r\n )\r\n .then(products => {\r\n if (products) {\r\n return products;\r\n }\r\n return [];\r\n\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n throw new Error('[getActiveCheckoutCartWithProdcuts]Unable to hydrate cart with product information');\r\n });\r\n }\r\n\r\n return [];\r\n}\r\n\r\nexport const getActiveCheckoutCartProductsActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/checkout/get-products-in-active-checkout-cart',\r\n action: >getActiveCheckoutCartProductsAction,\r\n input: createInput\r\n});\r\n\r\nexport default getActiveCheckoutCartProductsActionDataAction;\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 * as React from 'react';\r\n\r\ninterface IAlertProps {\r\n message: string;\r\n}\r\n\r\nconst CheckoutAlert: React.FC = ({ message }) => (\r\n

\r\n {message}\r\n

\r\n);\r\n\r\nexport default CheckoutAlert;\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 { IInvoiceSummaryLines, InvoiceSummary } from '@msdyn365-commerce-modules/invoice-payment-summary';\r\nimport get from 'lodash/get';\r\nimport * as React from 'react';\r\n\r\nimport { ICCheckoutData } from '../c-checkout.data';\r\nimport { ICCheckoutProps } from '../c-checkout.props.autogenerated';\r\n\r\nexport interface IInvoicePaymentSummary {\r\n heading?: React.ReactNode;\r\n lines?: IInvoiceSummaryLines;\r\n}\r\nexport const getInvoicePaymentSummary = (input: ICCheckoutProps): IInvoicePaymentSummary => {\r\n const {\r\n data: { checkout },\r\n resources: {\r\n totalAmountLabel,\r\n invoiceLabel,\r\n invoiceSummaryTitle\r\n },\r\n context,\r\n typeName,\r\n id,\r\n telemetry\r\n } = input;\r\n\r\n const checkoutCart = get(checkout, 'result.checkoutCart');\r\n const cart = get(checkout, 'result.checkoutCart.cart');\r\n\r\n return {\r\n heading:

\r\n { invoiceSummaryTitle }\r\n

,\r\n lines: checkoutCart?.hasInvoiceLine ? InvoiceSummary({\r\n orderTotalLabel: totalAmountLabel,\r\n invoiceLabel,\r\n cart,\r\n context,\r\n typeName,\r\n telemetry,\r\n id,\r\n checkoutState: checkout.result\r\n }) : undefined\r\n };\r\n\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\nimport { CartLineItemComponent } from '@msdyn365-commerce/components';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { CartLine, OrgUnitLocation, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { getProductUrlSync, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Button, getPayloadObject, getTelemetryAttributes, INodeProps, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport get from 'lodash/get';\r\nimport groupBy from 'lodash/groupBy';\r\nimport * as React from 'react';\r\n\r\nimport { ICCheckoutData } from '../c-checkout.data';\r\nimport { ICCheckoutProps } from '../c-checkout.props.autogenerated';\r\n\r\ntype deliveryType = 'pickup' | 'ship' | 'email';\r\n\r\nexport interface IPickUpAtStore {\r\n PickUpAtStore: INodeProps;\r\n label: React.ReactNode;\r\n location: React.ReactNode;\r\n}\r\n\r\nexport interface IEmailDelivery {\r\n EmailDelivery: INodeProps;\r\n label: React.ReactNode;\r\n}\r\n\r\nexport interface ILineItem {\r\n LineId: string;\r\n LineItem: INodeProps;\r\n item?: React.ReactNode;\r\n pickUpAtStore?: IPickUpAtStore;\r\n emailDelivery?: IEmailDelivery;\r\n}\r\n\r\nexport interface ILineItemDeliveryGroup {\r\n LineItemDeliveryGroup: INodeProps;\r\n LineItemList: INodeProps;\r\n heading: React.ReactNode;\r\n lineItemWraper?: React.ReactNode;\r\n lineItemWraperIcon?: React.ReactNode;\r\n lineItems: ILineItem[];\r\n}\r\n\r\nexport interface ILineItems {\r\n LineItems: INodeProps;\r\n Header: INodeProps;\r\n heading: React.ReactNode;\r\n editLink: React.ReactNode;\r\n itemsForPickup?: ILineItemDeliveryGroup;\r\n itemsForShip?: ILineItemDeliveryGroup;\r\n itemsForEmail?: ILineItemDeliveryGroup;\r\n itemsGroupWithMulitplePickupMode?: ILineItemDeliveryGroup[];\r\n}\r\n\r\nexport const getLineItems = (input: ICCheckoutProps, telemetryContent?: ITelemetryContent): ILineItems | undefined => {\r\n const pickupDeliveryModeCode = get(input, 'context.request.channel.PickupDeliveryModeCode');\r\n const emailDeliveryModeCode = get(input, 'context.request.channel.EmailDeliveryModeCode');\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const { channelDeliveryOptionConfig, featureState } = input.data;\r\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)?.IsEnabled;\r\n\r\n const _getDeliveryLocation = (cartLine: CartLine): string => {\r\n const orgUnitLocations = get(input, 'data.orgUnitLocations.result');\r\n if (!cartLine.FulfillmentStoreId || !orgUnitLocations) {\r\n return '';\r\n }\r\n\r\n const locationMatch = (orgUnitLocations || []).find((location: OrgUnitLocation): boolean => {\r\n return location.OrgUnitNumber === cartLine.FulfillmentStoreId;\r\n });\r\n\r\n return locationMatch && locationMatch.OrgUnitName;\r\n };\r\n\r\n const _getProduct = (productId: number): SimpleProduct | undefined => {\r\n const products = get(input, 'data.products.result') || [];\r\n return products.find((_product: SimpleProduct) => {\r\n return productId === _product.RecordId;\r\n });\r\n };\r\n\r\n const _getLineItemComponent = (cartLine: CartLine): JSX.Element | undefined => {\r\n const product = cartLine.ProductId && _getProduct(cartLine.ProductId);\r\n const {\r\n id,\r\n typeName,\r\n context,\r\n config: { imageSettings, showShippingChargesForLineItems },\r\n resources: {\r\n quantityDisplayString,\r\n productDimensionTypeColor,\r\n productDimensionTypeSize,\r\n productDimensionTypeStyle,\r\n productDimensionTypeAmount,\r\n configString,\r\n inputQuantityAriaLabel,\r\n discountStringText,\r\n shippingCharges\r\n },\r\n context: {\r\n request: { gridSettings }\r\n }\r\n } = input;\r\n\r\n if (!product) {\r\n return;\r\n }\r\n\r\n return (\r\n \r\n );\r\n };\r\n\r\n const _getPickUpAtStoreComponents = (pickupDeliveryLocation: string): IPickUpAtStore => {\r\n const {\r\n resources: { pickUpAtStoreWithLocationText }\r\n } = input;\r\n\r\n return {\r\n PickUpAtStore: { className: 'ms-checkout__pick-up-at-store' },\r\n label: \r\n {pickUpAtStoreWithLocationText}\r\n ,\r\n location:
\r\n {pickupDeliveryLocation}\r\n
\r\n };\r\n };\r\n\r\n const _getEmailDeliveryComponents = (): IEmailDelivery => {\r\n const {\r\n resources: { emailDeliveryText }\r\n } = input;\r\n\r\n return {\r\n EmailDelivery: { className: 'ms-checkout__email-delivery' },\r\n label: \r\n {emailDeliveryText}\r\n \r\n };\r\n };\r\n\r\n const _getLineItemsComponents = (items: CartLine[]): ILineItem[] => {\r\n return items.map(cartLine => {\r\n const pickupDeliveryLocation = _getDeliveryLocation(cartLine);\r\n const isPickUp = _getCartPickDeliveryMode(cartLine);\r\n const isEmailDelivery = (cartLine.DeliveryMode && cartLine.DeliveryMode !== '') ? cartLine.DeliveryMode === emailDeliveryModeCode : false;\r\n return {\r\n LineId: cartLine.LineId || '',\r\n LineItem: { className: 'ms-checkout__line-item' },\r\n item: _getLineItemComponent(cartLine),\r\n pickUpAtStore: isPickUp ? _getPickUpAtStoreComponents(pickupDeliveryLocation) : undefined,\r\n emailDelivery: isEmailDelivery ? _getEmailDeliveryComponents() : undefined\r\n };\r\n });\r\n };\r\n\r\n const _getCartPickDeliveryMode = (cartLineItem: CartLine): boolean => {\r\n return (!StringExtensions.isNullOrWhitespace(cartLineItem.DeliveryMode)) ? (retailMultiplePickUpOptionEnabled ? cartLineItem.DeliveryMode === channelDeliveryOptionConfig?.result?.PickupDeliveryModeCodes?.find(deliveryMode => deliveryMode === cartLineItem.DeliveryMode) : (cartLineItem.DeliveryMode === pickupDeliveryModeCode)) : false;\r\n };\r\n\r\n const _getCartShipDeliveryMode = (cartLineItem: CartLine): boolean => {\r\n return (!StringExtensions.isNullOrWhitespace(cartLineItem.DeliveryMode)) ? (retailMultiplePickUpOptionEnabled ? cartLineItem.DeliveryMode !== channelDeliveryOptionConfig?.result?.PickupDeliveryModeCodes?.find(deliveryMode => deliveryMode === cartLineItem.DeliveryMode) : (cartLineItem.DeliveryMode !== pickupDeliveryModeCode)) : false;\r\n };\r\n\r\n const _getGroupTitleComponent = (count: number, type: deliveryType): string => {\r\n const {\r\n resources: {\r\n itemLabel,\r\n itemsLabel,\r\n inStorePickUpLabel,\r\n shippingCountCheckoutLineItem\r\n }\r\n } = input;\r\n\r\n let emailDeliveryModeDesc: string = '';\r\n\r\n input.data.deliveryOptions.result?.find(productDeliveryOptions => {\r\n emailDeliveryModeDesc = emailDeliveryModeDesc ? emailDeliveryModeDesc : productDeliveryOptions.DeliveryOptions?.find(deliveryOption => deliveryOption.Code === emailDeliveryModeCode)?.Description!;\r\n });\r\n\r\n const suffix = count > 1 ? itemsLabel : itemLabel;\r\n const title = type === 'ship' ? shippingCountCheckoutLineItem : (type === 'pickup' ? inStorePickUpLabel : `${emailDeliveryModeDesc} (${count} ${suffix})`);\r\n return title.replace('{count}', count.toString()).replace('{suffix}', suffix);\r\n };\r\n\r\n const _countItems = (items: CartLine[]): number => {\r\n return items.reduce((count, item) => {\r\n return count + (item.Quantity || 0);\r\n\r\n }, 0);\r\n };\r\n\r\n const _filterItemsByDiliveryType = (type: deliveryType): CartLine[] => {\r\n const cart = get(input, 'data.checkout.result.checkoutCart.cart');\r\n if (type === 'ship') {\r\n return cart.CartLines.filter((\r\n cartLine: CartLine) => ((cartLine.DeliveryMode && cartLine.DeliveryMode !== '') ? (_getCartShipDeliveryMode(cartLine) && cartLine.DeliveryMode !== emailDeliveryModeCode) : cartLine)\r\n );\r\n } else if (type === 'pickup') {\r\n return cart.CartLines.filter((cartLine: CartLine) => ((cartLine.DeliveryMode && cartLine.DeliveryMode !== '') ? (_getCartPickDeliveryMode(cartLine)) : null)\r\n );\r\n }\r\n return cart.CartLines.filter((cartLine: CartLine) => cartLine.DeliveryMode === emailDeliveryModeCode);\r\n\r\n };\r\n\r\n const _getLineItemsByDeliveryType = (type: deliveryType): ILineItemDeliveryGroup | undefined => {\r\n if ((pickupDeliveryModeCode === '' || pickupDeliveryModeCode === undefined) && (type === 'pickup' || type === 'email')) {\r\n return;\r\n }\r\n\r\n const items = _filterItemsByDiliveryType(type);\r\n\r\n if (items.length === 0) {\r\n return undefined;\r\n }\r\n\r\n const count = _countItems(items);\r\n const title = _getGroupTitleComponent(count, type);\r\n\r\n return {\r\n LineItemDeliveryGroup: { className: classnames('ms-checkout__line-items-delivery-group', type) },\r\n LineItemList: { className: 'ms-checkout__line-items-list' },\r\n heading:
\r\n {title}\r\n
,\r\n lineItems: _getLineItemsComponents(items)\r\n };\r\n };\r\n\r\n const _getLineItems = (): ILineItems | undefined => {\r\n const {\r\n context,\r\n config: { lineItemsHeading },\r\n data: { products },\r\n resources: { editCartText }\r\n } = input;\r\n\r\n const payLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.EditCart);\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n const cart = get(input, 'data.checkout.result.checkoutCart.cart');\r\n const groupClass = retailMultiplePickUpOptionEnabled ? ' multiple-pickup-enabled' : '';\r\n if (!cart || !cart.CartLines || cart.CartLines.length === 0 || !products) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n LineItems: { className: `ms-checkout__line-items${groupClass}` },\r\n Header: { className: 'ms-checkout__line-items-header' },\r\n heading: lineItemsHeading && lineItemsHeading.text && (\r\n \r\n ),\r\n editLink: (\r\n \r\n {editCartText}\r\n \r\n ),\r\n itemsForPickup: _getLineItemsByDeliveryType('pickup'),\r\n itemsForShip: _getLineItemsByDeliveryType('ship'),\r\n itemsForEmail: _getLineItemsByDeliveryType('email'),\r\n itemsGroupWithMulitplePickupMode: retailMultiplePickUpOptionEnabled ? _getLineItemsByDeliveryTypeWithMulitplePickupMode() : undefined\r\n };\r\n };\r\n\r\n const handleLineItemHeadingChange = (event: Msdyn365.ContentEditableEvent) => {\r\n const {\r\n config: { lineItemsHeading }\r\n } = input;\r\n lineItemsHeading!.text = event.target.value;\r\n };\r\n\r\n const _getGroupTitleComponentWithMultiplePickUp = (count: number, type: deliveryType, deliveryMode?: string, fulFillmentStoreId?: string): string => {\r\n const {\r\n resources: {\r\n itemLabel,\r\n itemsLabel\r\n }\r\n } = input;\r\n\r\n let emailDeliveryModeDesc: string = '';\r\n let pickupDeliveryModeDesc: string = '';\r\n\r\n input.data.deliveryOptions.result?.find(productDeliveryOptions => {\r\n emailDeliveryModeDesc = emailDeliveryModeDesc ? emailDeliveryModeDesc : productDeliveryOptions.DeliveryOptions?.find(deliveryOption => deliveryOption.Code === emailDeliveryModeCode)?.Description!;\r\n });\r\n\r\n input.data.deliveryOptions.result?.find(productDeliveryOptions => {\r\n pickupDeliveryModeDesc = pickupDeliveryModeDesc ? pickupDeliveryModeDesc : productDeliveryOptions.DeliveryOptions?.find(deliveryOption => deliveryOption.Code === deliveryMode)?.Description!;\r\n });\r\n\r\n const pickupTitle: string = `${pickupDeliveryModeDesc}, ${fulFillmentStoreId}`;\r\n const suffix = count > 1 ? itemsLabel : itemLabel;\r\n const title = type === 'ship' ? `(${count} ${suffix})` : (type === 'pickup' ? `${pickupTitle} (${count} ${suffix})` : `${emailDeliveryModeDesc} (${count} ${suffix})`);\r\n return title.replace('{count}', count.toString()).replace('{suffix}', suffix);\r\n };\r\n\r\n const _filterItemsByMultiplePickupMode = (): CartLine[][] => {\r\n const cart = get(input, 'data.checkout.result.checkoutCart.cart');\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(cart.CartLines);\r\n const cartLinesGroup: CartLine[] = [];\r\n const cartLinesGrp: CartLine[][] = [];\r\n\r\n // 1) Group by store and pick up mode\r\n Object.entries(groupDelivery).forEach(([deliveryMode, groupByDeliveryType]) => {\r\n // @ts-expect-error\r\n groupDelivery[deliveryMode] = getGroupByStorePickup(groupByDeliveryType);\r\n cartLinesGroup.push(getGroupByStorePickup(groupByDeliveryType));\r\n });\r\n\r\n Object.keys(cartLinesGroup).forEach(key => {\r\n const cartLines = cartLinesGroup[key];\r\n Object.keys(cartLines).forEach(index => {\r\n const cartLine = cartLines[index];\r\n cartLinesGrp.push(cartLine);\r\n });\r\n });\r\n\r\n return cartLinesGrp;\r\n };\r\n\r\n const _getLineItemsByDeliveryTypeWithMulitplePickupMode = (): ILineItemDeliveryGroup[] | undefined => {\r\n if (pickupDeliveryModeCode === '' || pickupDeliveryModeCode === undefined) {\r\n return;\r\n }\r\n\r\n const {\r\n resources: {\r\n multiplePickUpLabel,\r\n shippingLable\r\n }\r\n } = input;\r\n\r\n const items = _filterItemsByMultiplePickupMode();\r\n\r\n if (items.length === 0) {\r\n return undefined;\r\n }\r\n\r\n const lineItemDeliveryGroup: ILineItemDeliveryGroup[] = [];\r\n items.map(item => {\r\n const count = _countItems(item);\r\n const cartLine = item[0];\r\n const pickupDeliveryLocation = _getDeliveryLocation(cartLine);\r\n const type: deliveryType = cartLine.FulfillmentStoreId && cartLine.DeliveryMode ? 'pickup' : (cartLine.FulfillmentStoreId === '' && cartLine.DeliveryMode === emailDeliveryModeCode ? 'email' : 'ship');\r\n const title = _getGroupTitleComponentWithMultiplePickUp(count, type, cartLine.DeliveryMode, pickupDeliveryLocation);\r\n const groupTitle = type === 'pickup' ? multiplePickUpLabel : (type === 'ship' ? shippingLable : 'email');\r\n const iconClass = `ms-checkout__line-items-group-title-multiple-pickup-${type}icon`;\r\n lineItemDeliveryGroup.push({\r\n LineItemDeliveryGroup: { className: classnames('ms-checkout__line-items-delivery-group multiple-pickup', type) },\r\n LineItemList: { className: 'ms-checkout__line-items-list' },\r\n lineItemWraperIcon:
,\r\n lineItemWraper:
\r\n {groupTitle}\r\n
,\r\n heading:
\r\n {title}\r\n
,\r\n lineItems: _getLineItemsComponents(item)\r\n });\r\n });\r\n\r\n return lineItemDeliveryGroup;\r\n };\r\n\r\n return _getLineItems();\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 * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { IOrderSummaryLines, OrderSummary } from '../../../common/components/order-summary-lineitem';\r\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport get from 'lodash/get';\r\nimport * as React from 'react';\r\n\r\nimport { ICCheckoutData } from '../c-checkout.data';\r\nimport { ICCheckoutProps } from '../c-checkout.props.autogenerated';\r\n\r\nexport interface IOrderSummary {\r\n orderSummaryProps: INodeProps;\r\n heading?: React.ReactNode;\r\n lines?: IOrderSummaryLines;\r\n}\r\nexport const getOrderSummary = (input: ICCheckoutProps): IOrderSummary => {\r\n const {\r\n config: { orderSummaryHeading },\r\n data: { checkout },\r\n resources: {\r\n subTotalLabel,\r\n shippingLabel,\r\n taxLabel,\r\n orderTotalLabel,\r\n loyaltyLabel,\r\n giftcardLabel,\r\n totalDiscountsLabel,\r\n freeText,\r\n toBeCalculatedText,\r\n otherCharges\r\n },\r\n context,\r\n typeName,\r\n id,\r\n telemetry\r\n } = input;\r\n\r\n const checkoutState = get(checkout, 'result');\r\n const cart = get(checkout, 'result.checkoutCart.cart');\r\n const showLineItems = cart?.CartLines && cart.CartLines.length > 0;\r\n const channelConfiguration = context.request.channel!;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const { channelDeliveryOptionConfig, featureState } = input.data;\r\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\r\n ?.IsEnabled;\r\n\r\n const handleOrderSummaryHeadingChange = (event: Msdyn365.ContentEditableEvent) => {\r\n const {\r\n config: { orderSummaryHeading }\r\n } = input;\r\n orderSummaryHeading!.text = event.target.value;\r\n };\r\n\r\n return {\r\n orderSummaryProps: { className: 'ms-checkout-guest-profile__selected-item' },\r\n heading: orderSummaryHeading && orderSummaryHeading.text && (\r\n \r\n ),\r\n lines: showLineItems\r\n ? OrderSummary({\r\n checkoutState,\r\n cart,\r\n subTotalLabel,\r\n shippingLabel,\r\n taxLabel,\r\n orderTotalLabel,\r\n loyaltyLabel,\r\n giftcardLabel,\r\n totalDiscountsLabel,\r\n freeText,\r\n toBeCalculatedText,\r\n context,\r\n typeName,\r\n id,\r\n channelConfiguration,\r\n telemetry,\r\n otherChargeLabel: otherCharges,\r\n retailMultiplePickUpOptionEnabled,\r\n channelDeliveryOptionConfig: channelDeliveryOptionConfig?.result\r\n })\r\n : undefined\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 { Heading as HeadingType } from '@msdyn365-commerce-modules/data-types';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n IPayLoad,\r\n ITelemetryContent,\r\n TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classname from 'classnames';\r\n\r\nimport * as React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { ISavesubmitEnabledisableData } from '../../../actions/savesubmit-enabledisable.action';\r\nimport { IGetPaymentOnbillValueData } from '../../../actions/get-payment-onbill-value.action';\r\n\r\nexport interface ICheckoutGuidedCardProps {\r\n step: number;\r\n title?: HeadingType;\r\n disabled?: boolean; // Module is not available\r\n isActive?: boolean; // Step === currentStep\r\n isVisted?: boolean; // Step < currentStep\r\n isExpanded?: boolean;\r\n isReady?: boolean;\r\n isPending?: boolean;\r\n isUpdating?: boolean;\r\n isSubmitting?: boolean;\r\n isCancelAllowed?: boolean;\r\n isMobile?: boolean;\r\n hasInitialized?: boolean;\r\n hasControlGroup?: boolean;\r\n children: React.ReactNode;\r\n resource: {\r\n checkoutStepTitleFormat: string;\r\n saveBtnLabel: string;\r\n changeBtnLabel: string;\r\n cancelBtnLabel: string;\r\n saveAndContinueBtnLabel: string;\r\n };\r\n telemetryContent?: ITelemetryContent;\r\n onEdit?(): void;\r\n onCancel?(): void;\r\n onSubmit?(): void;\r\n onNext(): void;\r\n saveAndContinue?: ISavesubmitEnabledisableData | undefined;\r\n checkIsPaymentStep: boolean;\r\n checkCustomerAccount?: number | undefined;\r\n onBillValue?: IGetPaymentOnbillValueData | undefined;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutGuidedCard component.\r\n * @extends {React.Component}\r\n */\r\nclass CheckoutGuidedCard extends React.PureComponent {\r\n private readonly editButtonRef: React.RefObject = React.createRef();\r\n\r\n private readonly formCardRef: React.RefObject = React.createRef();\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n constructor(props: ICheckoutGuidedCardProps) {\r\n super(props);\r\n this.payLoad = getPayloadObject('click', props.telemetryContent!, '');\r\n }\r\n\r\n public componentDidUpdate(prevProps: ICheckoutGuidedCardProps): void {\r\n /**\r\n * Move to next step when current step is ready.\r\n */\r\n\r\n const { isActive, isReady, onNext, isVisted, onEdit } = this.props;\r\n\r\n // Move to next step after completing the current step\r\n if (isActive && isReady) {\r\n onNext();\r\n }\r\n\r\n // Set the focus to Edit button once edit button appear\r\n // (It happens when current step switch to isReady status)\r\n const prevCanEdit = prevProps.isReady && prevProps.isVisted && !!prevProps.onEdit;\r\n const canEdit = isReady && isVisted && !!onEdit;\r\n if (!prevCanEdit && canEdit) {\r\n this.focusOnEditButton();\r\n this.scrollToTitle();\r\n }\r\n\r\n // Set the focus to the first focusable element\r\n // (It happens when current step switch to isUpdating status)\r\n if (prevProps.isReady && !isReady) {\r\n this.focusOnFirstFocusableElement();\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n title,\r\n disabled,\r\n isExpanded,\r\n isActive,\r\n isVisted,\r\n children,\r\n isReady,\r\n isPending,\r\n isUpdating,\r\n hasInitialized,\r\n hasControlGroup,\r\n onEdit,\r\n resource\r\n } = this.props;\r\n const { changeBtnLabel } = resource;\r\n this.payLoad.contentAction.etext = TelemetryConstant.CheckoutChange;\r\n\r\n const changeBtnAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n const canEdit = hasControlGroup && isReady && isVisted && onEdit;\r\n return (\r\n \r\n
\r\n {this.getTitle()}\r\n\r\n {canEdit && (\r\n \r\n {changeBtnLabel}\r\n \r\n )}\r\n
\r\n\r\n \r\n
{children}
\r\n\r\n {this.renderFooder()}\r\n
\r\n \r\n );\r\n }\r\n\r\n private readonly renderFooder = (): JSX.Element | null => {\r\n const { isVisted, isReady, isSubmitting, isCancelAllowed, hasControlGroup, onCancel, onSubmit, resource } = this.props;\r\n const { saveBtnLabel, cancelBtnLabel, saveAndContinueBtnLabel } = resource;\r\n\r\n const canSubmit = !isReady && onSubmit;\r\n const canCancel = !isReady && isVisted && isCancelAllowed && onCancel;\r\n\r\n if (!hasControlGroup || (!canSubmit && !canCancel)) {\r\n return null;\r\n }\r\n\r\n this.payLoad.contentAction.etext = isVisted ? TelemetryConstant.Save : TelemetryConstant.SaveContinue;\r\n\r\n const saveBtnAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n this.payLoad.contentAction.etext = TelemetryConstant.Cancel;\r\n\r\n const cancelBtnAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n const checkIsCustomerAcOnBill = this.props.checkCustomerAccount! === 0 && this.props.onBillValue?.onBill && this.props.checkIsPaymentStep;\r\n const checkIsPaymentBtnEnableDisable = (this.props.checkIsPaymentStep && this.props.saveAndContinue?.disableButton) || checkIsCustomerAcOnBill ? true:false;\r\n return (\r\n
\r\n {canSubmit && (\r\n \r\n {isVisted && isCancelAllowed ? saveBtnLabel : saveAndContinueBtnLabel}\r\n \r\n )}\r\n {canCancel && (\r\n \r\n {cancelBtnLabel}\r\n \r\n )}\r\n
\r\n );\r\n };\r\n\r\n private readonly focusOnFirstFocusableElement = (): void => {\r\n const node = ReactDOM.findDOMNode(this) as HTMLElement;\r\n const focussableElements = `\r\n a:not([disabled]),\r\n button:not([disabled]),\r\n input[type=submit]:not([disabled]),\r\n input[type=checkbox]:not([disabled]),\r\n input[type=text]:not([disabled]),\r\n input[type=radio]:not([disabled]),\r\n input[type=password]:not([disabled]),\r\n select:not([disabled]),\r\n textarea:not([disabled]),\r\n [tabindex]:not([disabled]):not([tabindex=\"-1\"])\r\n `;\r\n\r\n const child = node && node.querySelector && (node.querySelector(focussableElements) as HTMLElement);\r\n child && child.focus && child.focus();\r\n };\r\n\r\n private readonly focusOnEditButton = (): void => {\r\n // Focus on edit button\r\n const editButton =\r\n this.editButtonRef &&\r\n this.editButtonRef.current &&\r\n // @ts-ignore\r\n this.editButtonRef.current.focus &&\r\n (this.editButtonRef.current as HTMLElement);\r\n editButton && editButton.focus();\r\n };\r\n\r\n private readonly scrollToTitle = (): void => {\r\n // Scroll window to the title of the step that was just completed only in mobile viewport\r\n\r\n const formCard = this.props.isMobile && this.formCardRef && this.formCardRef.current && (this.formCardRef.current as HTMLElement);\r\n formCard && formCard.scrollIntoView();\r\n };\r\n\r\n private readonly getTitle = (): JSX.Element => {\r\n const { step, title } = this.props;\r\n const { headingTag: Tag = 'h2', text = '' } = title || {};\r\n return (\r\n \r\n {step + 1}. \r\n {text && {text}}\r\n \r\n );\r\n };\r\n}\r\n\r\nexport default CheckoutGuidedCard;\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 { IModuleStateManager } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { Heading } from '@msdyn365-commerce-modules/data-types';\r\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport get from 'lodash/get';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IGetPaymentOnbillValueData } from '../../../actions/get-payment-onbill-value.action';\r\nimport { ISavesubmitEnabledisableData } from '../../../actions/savesubmit-enabledisable.action';\r\n\r\nimport GuidedCard from './guided-card';\r\n\r\nexport interface ICheckoutGuidedFormProps {\r\n items: React.ReactNode[];\r\n moduleState: IModuleStateManager;\r\n disableGuidedCheckoutFlow?: boolean;\r\n isMobile?: boolean;\r\n isEditor?: boolean;\r\n resource: {\r\n checkoutStepTitleFormat: string;\r\n saveBtnLabel: string;\r\n changeBtnLabel: string;\r\n cancelBtnLabel: string;\r\n saveAndContinueBtnLabel: string;\r\n };\r\n telemetryContent?: ITelemetryContent;\r\n saveAndContinue?: ISavesubmitEnabledisableData | undefined;\r\n onBillValue?: IGetPaymentOnbillValueData | undefined;\r\n checkCustomerAccount?: number | undefined;\r\n}\r\n\r\ninterface ICheckoutGuidedFormState {\r\n currentStep: number;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutGuidedForm component.\r\n * @extends {React.Component}\r\n */\r\n// @ts-ignore\r\n@observer\r\nclass CheckoutGuidedForm extends React.PureComponent {\r\n public state: ICheckoutGuidedFormState = {\r\n currentStep: 0\r\n };\r\n\r\n public componentDidMount(): void {\r\n /**\r\n * Append child modules.\r\n */\r\n const childIds = this.props.items.map((item: React.ReactNode) => get(item, 'props.id'));\r\n // @ts-ignore\r\n this.props.moduleState.init({ childIds });\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { moduleState, items, resource } = this.props;\r\n if (!items || !moduleState) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n {items.map((item: React.ReactNode) => {\r\n const childId = this.getId(item);\r\n const step = this.getStep(childId);\r\n const title = this.getHeading(item);\r\n const state = this.props.moduleState.getModule(childId);\r\n const {\r\n isReady,\r\n isPending,\r\n isUpdating,\r\n isDisabled,\r\n isCancelAllowed,\r\n onEdit,\r\n onCancel,\r\n onSubmit,\r\n hasModuleState,\r\n hasInitialized\r\n } = state || ({} as IModuleStateManager);\r\n const checkIsPaymentStep = childId.includes('checkout-section-container');\r\n return (\r\n // @ts-ignore\r\n \r\n {React.cloneElement(item as React.ReactElement, { enableControl: true })}\r\n \r\n );\r\n })}\r\n
\r\n );\r\n }\r\n\r\n private readonly getEnabledModules = (): string[] => {\r\n const {\r\n moduleState: { childIds, getModule }\r\n } = this.props;\r\n return childIds.filter((childId: string) => {\r\n const state = getModule(childId);\r\n return !!state && !state.isDisabled;\r\n });\r\n };\r\n\r\n private readonly getStep = (id: string): number => {\r\n return this.getEnabledModules().indexOf(id);\r\n };\r\n\r\n private readonly getId = (item: React.ReactNode): string => {\r\n return get(item, 'props.id') || '';\r\n };\r\n\r\n private readonly getHeading = (item: React.ReactNode): Heading => {\r\n // @ts-ignore\r\n return get(item, 'props.config.heading') || '';\r\n };\r\n\r\n private readonly isExpanded = (step: number): boolean => {\r\n if (this.props.isEditor) {\r\n // Editorial mode: Expand all the drawers\r\n return true;\r\n }\r\n return step > -1 && step <= this.state.currentStep;\r\n };\r\n\r\n private readonly isActive = (step: number): boolean => {\r\n return step === this.state.currentStep;\r\n };\r\n\r\n private readonly isVisted = (step: number): boolean => {\r\n return step > -1 && step < this.state.currentStep;\r\n };\r\n\r\n private readonly onNext = (): void => {\r\n this.setState({\r\n currentStep: this.state.currentStep + 1\r\n });\r\n };\r\n}\r\n\r\nexport default CheckoutGuidedForm;\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 { TelemetryEvent } from '@msdyn365-commerce/core';\r\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport React, { useState } from 'react';\r\n\r\ninterface ICheckoutPlaceOrderButtonProps {\r\n canPlaceOrder: boolean;\r\n checkoutBtnText: string;\r\n telemetryContent?: ITelemetryContent;\r\n shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\r\n isPlaceOrderLoading?: boolean;\r\n placeOrder(): Promise;\r\n}\r\n\r\nconst buttonsStates: React.Dispatch>[] = [];\r\n\r\n/**\r\n * On place order function.\r\n * @param isBusy -Check is busy.\r\n * @param canPlaceOrder -Check can place order.\r\n * @param placeOrder -Place order function.\r\n * @returns Set state of button.\r\n */\r\nconst onPlaceOrderHandler = (isBusy: boolean, canPlaceOrder: boolean, placeOrder: () => Promise) => async () => {\r\n if (isBusy || !canPlaceOrder) {\r\n return;\r\n }\r\n buttonsStates.map(buttonSetState => {\r\n buttonSetState(true);\r\n return true;\r\n });\r\n await placeOrder();\r\n buttonsStates.map(buttonSetState => {\r\n buttonSetState(false);\r\n return true;\r\n });\r\n};\r\n\r\nconst CheckoutPlaceOrderButton: React.FC = ({\r\n checkoutBtnText, canPlaceOrder, placeOrder, telemetryContent, shouldEnableSinglePaymentAuthorizationCheckout, isPlaceOrderLoading }) => {\r\n const [isBusy, setIsBusy] = useState(false);\r\n buttonsStates.push(setIsBusy);\r\n const payload = getPayloadObject(TelemetryEvent.Purchase, telemetryContent!, checkoutBtnText, '');\r\n const attributes = getTelemetryAttributes(telemetryContent!, payload);\r\n\r\n if (shouldEnableSinglePaymentAuthorizationCheckout) {\r\n return (\r\n \r\n {checkoutBtnText}\r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n {checkoutBtnText}\r\n \r\n );\r\n};\r\n\r\nexport default CheckoutPlaceOrderButton;\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 { getCheckoutState } from '@msdyn365-commerce/global-state';\r\nimport { checkoutAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport {\r\n getTenderTypesAsync, resolveCardTypesAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport {\r\n Address, CardPaymentAcceptResult, CardType, CartTenderLine, RetailOperation, SalesOrder, TenderType, TokenizedPaymentCard\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nexport const OPERATIONS = {\r\n PayCard: 201,\r\n PayGiftCertificate: 214,\r\n PayLoyalty: 207,\r\n PayCustomerAccount: 202\r\n};\r\n\r\nconst getCardTypeId = async (ctx: IActionContext, cardPrefix: string = ''): Promise => {\r\n try {\r\n const response = await resolveCardTypesAsync({ callerContext: ctx }, cardPrefix, CardType.Unknown);\r\n if (response && response.length > 0) {\r\n return response[0].TypeId;\r\n }\r\n } catch (error) {\r\n ctx.telemetry.error('Call to resolveCardTypesAsync failed.', error);\r\n }\r\n return undefined;\r\n};\r\n\r\nconst findTenderIdTypeByOperationId = (tenderTypes: TenderType[], operationId: RetailOperation): string | undefined => {\r\n const matchedTenderType = tenderTypes.find(tenderType => tenderType.OperationId === operationId);\r\n if (matchedTenderType) {\r\n return matchedTenderType.TenderTypeId;\r\n }\r\n return;\r\n};\r\n\r\nconst roundNumber = (value: number) => Number(value.toFixed(2));\r\n\r\nasync function getLoyaltyTenderLine(\r\n ctx: IActionContext,\r\n LoyaltyCardId: string,\r\n Amount: number = 0,\r\n Currency: string = 'USD'\r\n): Promise {\r\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\r\n throw error;\r\n });\r\n\r\n if (!tenderTypes) {\r\n throw new Error('Fail to get gift card tender line');\r\n }\r\n\r\n const TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayLoyalty);\r\n return {\r\n // @ts-expect-error\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\r\n\r\n 'Amount@odata.type': '#Decimal',\r\n Currency,\r\n TenderTypeId,\r\n Amount,\r\n LoyaltyCardId\r\n };\r\n}\r\n\r\nasync function getGiftCardTenderLine(\r\n ctx: IActionContext,\r\n GiftCardId: string = '',\r\n Amount: number = 0,\r\n Currency: string = 'USD',\r\n tenderTypeId?: string,\r\n giftCardPin?: string,\r\n giftCardExpirationYear?: number,\r\n giftCardExpirationMonth?: number\r\n): Promise {\r\n let TenderTypeId = tenderTypeId;\r\n\r\n if (!TenderTypeId) {\r\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\r\n throw error;\r\n });\r\n if (!tenderTypes) {\r\n throw new Error('Fail to get gift card tender line');\r\n }\r\n TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayGiftCertificate);\r\n }\r\n\r\n const GiftCardPin = giftCardPin;\r\n const GiftCardExpirationYear = giftCardExpirationYear;\r\n const GiftCardExpirationMonth = giftCardExpirationMonth;\r\n return {\r\n // @ts-expect-error\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\r\n 'Amount@odata.type': '#Decimal',\r\n Currency,\r\n TenderTypeId,\r\n Amount,\r\n GiftCardId,\r\n GiftCardPin,\r\n GiftCardExpirationYear,\r\n GiftCardExpirationMonth\r\n };\r\n}\r\n\r\nasync function getCreditCardTenderLine(\r\n ctx: IActionContext,\r\n tokenizedPaymentCard: TokenizedPaymentCard,\r\n cardPrefix: string = '',\r\n Amount: number = 0,\r\n Currency: string = 'USD',\r\n billingAddress?: Address\r\n): Promise {\r\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\r\n throw error;\r\n });\r\n\r\n let cartTypeId = tokenizedPaymentCard.CardTypeId;\r\n\r\n if (!cartTypeId) {\r\n cartTypeId = await getCardTypeId(ctx, cardPrefix);\r\n }\r\n\r\n if (!tenderTypes) {\r\n throw new Error('Fail to get card tender type');\r\n }\r\n\r\n if (!cartTypeId) {\r\n throw new Error('Fail to get card type id');\r\n }\r\n\r\n const TenderTypeId = tokenizedPaymentCard.TenderType ?? findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCard);\r\n const cardTenderLine: CartTenderLine = {\r\n // @ts-expect-error\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\r\n 'Amount@odata.type': '#Decimal',\r\n Currency,\r\n Amount,\r\n TenderTypeId,\r\n CardTypeId: cartTypeId\r\n };\r\n cardTenderLine.TokenizedPaymentCard = {\r\n ...tokenizedPaymentCard,\r\n CardTypeId: cartTypeId,\r\n\r\n // @ts-expect-error\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.TokenizedPaymentCard',\r\n House: tokenizedPaymentCard.House || 'N/A',\r\n ...(tokenizedPaymentCard.CardTokenInfo && {\r\n CardTokenInfo: {\r\n ...tokenizedPaymentCard.CardTokenInfo,\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CardTokenInfo'\r\n }\r\n }),\r\n ...(billingAddress && {\r\n Phone: billingAddress.Phone,\r\n Country: billingAddress.ThreeLetterISORegionName,\r\n Address1: billingAddress.Street,\r\n City: billingAddress.City,\r\n State: billingAddress.State,\r\n Zip: billingAddress.ZipCode\r\n })\r\n };\r\n\r\n return cardTenderLine;\r\n}\r\n\r\n/**\r\n * Get credit card tender line.\r\n * @param context - Action context.\r\n * @param amount - Due amount for credit card.\r\n * @param currency - Currency.\r\n * @param cardPaymentAcceptResult - CardPaymentAcceptResult.\r\n * @returns - The credit card tender line.\r\n */\r\nasync function getCreditCardTenderLineForSinglePaymentAuth(\r\n context: IActionContext,\r\n amount: number = 0,\r\n currency: string = 'USD',\r\n cardPaymentAcceptResult?: CardPaymentAcceptResult\r\n): Promise {\r\n const tenderTypes = await getTenderTypesAsync({ callerContext: context, queryResultSettings: {} }).catch(error => {\r\n throw error;\r\n });\r\n\r\n const tenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCard);\r\n\r\n const cardTenderLine: CartTenderLine = {\r\n // @ts-expect-error -- existing data.\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\r\n 'Amount@odata.type': '#Decimal',\r\n Currency: currency,\r\n Amount: amount,\r\n TenderTypeId: tenderTypeId,\r\n CardPaymentAcceptResult: cardPaymentAcceptResult\r\n };\r\n\r\n return cardTenderLine;\r\n}\r\n\r\nasync function createCustomerAccountTenderLine(\r\n ctx: IActionContext,\r\n Amount: number,\r\n Currency: string = 'USD'\r\n): Promise {\r\n const CustomerId = null;\r\n if (!ctx.requestContext.user.isAuthenticated) {\r\n ctx.telemetry.error('A customer id is required to pay with customer account');\r\n }\r\n\r\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\r\n throw error;\r\n });\r\n\r\n if (!tenderTypes) {\r\n ctx.telemetry.error('No tender types found for this channel');\r\n }\r\n\r\n const TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCustomerAccount);\r\n if (!TenderTypeId) {\r\n ctx.telemetry.error('No customer account tender type');\r\n }\r\n return {\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\r\n 'Amount@odata.type': '#Decimal',\r\n Currency,\r\n TenderTypeId,\r\n Amount,\r\n\r\n // @ts-expect-error\r\n CustomerId\r\n };\r\n}\r\n\r\nexport default async (ctx: IActionContext, updatedCartVersion?: number, isPaymentVerificationRedirection?: boolean): Promise => {\r\n const checkoutState = await getCheckoutState(ctx).catch(error => {\r\n throw error;\r\n });\r\n\r\n const cartState = checkoutState.checkoutCart;\r\n\r\n const channelConfiguration = ctx.requestContext.channel;\r\n\r\n if (!cartState || Object.keys(cartState).length === 0 || !channelConfiguration) {\r\n throw new Error('Fail to placeOrder');\r\n }\r\n\r\n const {\r\n giftCardExtends,\r\n tokenizedPaymentCard,\r\n cardPrefix,\r\n guestCheckoutEmail,\r\n billingAddress,\r\n loyaltyAmount,\r\n cardPaymentAcceptResult,\r\n shouldEnableSinglePaymentAuthorizationCheckout\r\n } = checkoutState;\r\n const { Currency } = channelConfiguration;\r\n\r\n let amountDue = cartState.cart.AmountDue || 0;\r\n let cartTenderLines;\r\n const getTenderLinePromises = [];\r\n const loyaltyCardNumber = cartState.cart.LoyaltyCardId;\r\n\r\n // Pay by loyalty first\r\n if (loyaltyAmount && loyaltyCardNumber) {\r\n const chargedAmount = roundNumber(Math.min(loyaltyAmount, amountDue));\r\n const loyaltyTenderLinePromise = getLoyaltyTenderLine(ctx, loyaltyCardNumber, chargedAmount, Currency);\r\n getTenderLinePromises.push(loyaltyTenderLinePromise);\r\n amountDue = roundNumber(amountDue - chargedAmount);\r\n }\r\n\r\n // Then by gift card\r\n if (giftCardExtends && giftCardExtends.length > 0) {\r\n giftCardExtends.some(giftCardExtend => {\r\n if (giftCardExtend.Balance && amountDue > 0) {\r\n const chargedAmount = roundNumber(Math.min(giftCardExtend.Balance, amountDue));\r\n const tenderTypeId = giftCardExtend.TenderTypeId;\r\n const giftCardPin = giftCardExtend.Pin;\r\n const giftCardExpirationYear = giftCardExtend.ExpirationDate ? Number.parseInt(giftCardExtend.ExpirationDate?.split('/')[1], 10) : undefined;\r\n const giftCardExpirationMonth = giftCardExtend.ExpirationDate ? Number.parseInt(giftCardExtend.ExpirationDate?.split('/')[0], 10) : undefined;\r\n const creditCardTenderLinePromise = getGiftCardTenderLine(ctx, giftCardExtend.Id, chargedAmount, Currency, tenderTypeId, giftCardPin, giftCardExpirationYear, giftCardExpirationMonth);\r\n getTenderLinePromises.push(creditCardTenderLinePromise);\r\n amountDue = roundNumber(amountDue - chargedAmount);\r\n }\r\n return amountDue === 0;\r\n });\r\n }\r\n\r\n // Then by customer account\r\n if (checkoutState.customerAccountAmount > 0) {\r\n const chargedAmount = roundNumber(Math.min(checkoutState.customerAccountAmount, amountDue));\r\n const customerAccountTenderLinePromise = createCustomerAccountTenderLine(ctx, chargedAmount, Currency);\r\n getTenderLinePromises.push(customerAccountTenderLinePromise);\r\n amountDue = roundNumber(amountDue - chargedAmount);\r\n }\r\n\r\n // Pay the rest by credit card\r\n if (amountDue > 0) {\r\n let creditCardTenderLinePromise: Promise;\r\n\r\n if (shouldEnableSinglePaymentAuthorizationCheckout) {\r\n creditCardTenderLinePromise = getCreditCardTenderLineForSinglePaymentAuth(\r\n ctx,\r\n amountDue,\r\n Currency,\r\n cardPaymentAcceptResult\r\n );\r\n } else {\r\n if (!tokenizedPaymentCard) {\r\n throw new Error('Fail to placeOrder: no token found');\r\n }\r\n creditCardTenderLinePromise = getCreditCardTenderLine(\r\n ctx,\r\n tokenizedPaymentCard,\r\n cardPrefix,\r\n amountDue,\r\n Currency,\r\n billingAddress\r\n );\r\n }\r\n\r\n getTenderLinePromises.push(creditCardTenderLinePromise);\r\n }\r\n\r\n if (getTenderLinePromises.length > 0) {\r\n // When payment methods is required\r\n cartTenderLines = await Promise.all(getTenderLinePromises).catch(error => {\r\n throw error;\r\n });\r\n\r\n if (!cartTenderLines || cartTenderLines.length === 0) {\r\n throw new Error('Fail to placeOrder: fail to get cart tender lines');\r\n }\r\n }\r\n\r\n const cartVersion = updatedCartVersion || cartState.cart.Version;\r\n\r\n // Proceed checkout\r\n const salesOrder = await checkoutAsync(\r\n { callerContext: ctx, bypassCache: 'get' },\r\n cartState.cart.Id,\r\n guestCheckoutEmail,\r\n undefined,\r\n undefined,\r\n cartTenderLines || null,\r\n cartVersion\r\n ).catch(async error => {\r\n if (checkoutState.shouldEnableSinglePaymentAuthorizationCheckout) {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown type.\r\n if (error.data?.AdditionalContext) {\r\n await checkoutState.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown type.\r\n await checkoutState.updateRedirectAdditionalContext({ newRedirectAdditionalContext: error?.data?.AdditionalContext as string });\r\n } else {\r\n await checkoutState.updateIsCheckoutCallFailed({ newIsCheckoutCallFailed: true });\r\n\r\n if (isPaymentVerificationRedirection) {\r\n await checkoutState.checkoutCart.refreshCart({});\r\n }\r\n }\r\n }\r\n\r\n throw error;\r\n });\r\n\r\n if (!salesOrder) {\r\n throw new Error('Fail to placeOrder: fail to checkout');\r\n }\r\n\r\n return salesOrder;\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 { IActionContext } from '@msdyn365-commerce/core';\r\nimport { getCartState, getCheckoutState } from '@msdyn365-commerce/global-state';\r\n\r\nasync function emptyActiveCart(ctx: IActionContext): Promise {\r\n let cartState;\r\n let checkoutState;\r\n const lineItemIdsToRemove = [];\r\n\r\n try {\r\n cartState = await getCartState(ctx);\r\n checkoutState = await getCheckoutState(ctx);\r\n } catch (error) {\r\n throw error;\r\n }\r\n\r\n if (!cartState || !cartState.cart) {\r\n throw new Error('Fail to fetch active cart');\r\n }\r\n\r\n if (!checkoutState || !checkoutState.checkoutCart) {\r\n throw new Error('Fail to fetch checkoutCart cart');\r\n }\r\n\r\n const activeCart = cartState.cart;\r\n const checkoutCart = checkoutState.checkoutCart.cart;\r\n\r\n for (const activeCartLine of activeCart.CartLines || []) {\r\n for (const checkoutCartLine of checkoutCart.CartLines || []) {\r\n if (activeCartLine.LineId && activeCartLine.LineId === checkoutCartLine.LineId) {\r\n lineItemIdsToRemove.push(activeCartLine.LineId);\r\n }\r\n }\r\n }\r\n\r\n try {\r\n await cartState.removeCartLines({ cartLineIds: lineItemIdsToRemove });\r\n await cartState.removeAllPromoCodes({});\r\n await checkoutState.removeCheckoutCartId({});\r\n } catch (error) {\r\n throw error;\r\n }\r\n}\r\n\r\nexport default emptyActiveCart;\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 { getUrlSync, IActionContext } from '@msdyn365-commerce/core';\r\nimport { ICheckoutState } from '@msdyn365-commerce/global-state';\r\nimport { SalesOrder, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport checkout from './checkout';\r\nimport emptyActiveCart from './empty-active-cart';\r\n\r\nexport default async (\r\n ctx: IActionContext,\r\n checkoutState: ICheckoutState | undefined,\r\n orderedProducts: SimpleProduct[] | undefined,\r\n redirect: boolean,\r\n updatedCartVersion?: number,\r\n isPaymentVerificationRedirection?: boolean\r\n) => {\r\n return new Promise(async (resolve: () => void, reject: (reason?: Error) => void) => {\r\n let salesOrder: SalesOrder;\r\n\r\n // Proceed checkout\r\n try {\r\n salesOrder = await checkout(ctx, updatedCartVersion, isPaymentVerificationRedirection);\r\n } catch (error) {\r\n console.log('order error', error?.name!);\r\n reject(error);\r\n return;\r\n }\r\n\r\n // Remove purchased items from the active cart\r\n try {\r\n await emptyActiveCart(ctx);\r\n } catch (error) {\r\n reject(error);\r\n return;\r\n }\r\n\r\n if (redirect) {\r\n // Redirect to the order confirmation page\r\n const orderConfirmationUrl = getUrlSync('orderConfirmation', ctx) || '';\r\n if (!orderConfirmationUrl) {\r\n reject(new Error('Error: No orderConfirmationUrl'));\r\n return;\r\n }\r\n\r\n const separator = orderConfirmationUrl.includes('?') ? '&' : '?';\r\n const url = `${orderConfirmationUrl}${separator}transactionId=${salesOrder.Id}`;\r\n window.location.assign(url);\r\n } else {\r\n if (checkoutState) {\r\n const result = await checkoutState.updateSalesOrder({\r\n newSalesOrder: salesOrder,\r\n newOrderedProducts: orderedProducts || []\r\n });\r\n\r\n if (result.status === 'FAILED') {\r\n reject(new Error('Error: Updating error state failed'));\r\n return;\r\n }\r\n } else {\r\n reject(new Error('Error: No checkout state'));\r\n return;\r\n }\r\n resolve();\r\n }\r\n });\r\n};\r\n","/**\r\n * FlintFoxOnAccountGuestCheckoutResponse entity interface.\r\n */\r\nexport interface IFlintFoxOnAccountGuestCheckoutResponse {\r\n Status?: boolean;\r\n Message?: string;\r\n TransactionNumber?: string;\r\n}\r\n/**\r\n * FlintFoxOnAccountGuestCheckoutResponse entity class.\r\n */\r\nexport class FlintFoxOnAccountGuestCheckoutResponseExtensionClass implements IFlintFoxOnAccountGuestCheckoutResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Status: boolean;\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 Message: string;\r\n\r\n public TransactionNumber: string;\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.Status = odataObject.Status;\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.Message = odataObject.Message;\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.TransactionNumber = odataObject.TransactionNumber;\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 {\r\n AsyncResult,\r\n callActionOrExecute,\r\n DataServiceQuery,\r\n IContext,\r\n IDataServiceRequest\r\n // IQueryResultSettings,\r\n // NullResult\r\n} from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * 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\nimport * as DataServiceEntities from './FlintFoxOnAccountGuestCheckoutEntities.g';\r\n\r\n// @ts-ignore\r\nfunction fFOnAccountQuery(cartId?: string): DataServiceQuery {\r\n const key = cartId ? { CartId: cartId } : null;\r\n return new DataServiceQuery(\r\n 'FFOnAccount',\r\n 'FlintFoxOnAccountGuestCheckout',\r\n DataServiceEntities.FlintFoxOnAccountGuestCheckoutResponseExtensionClass,\r\n key\r\n );\r\n}\r\n\r\nexport function createFFGuestCheckoutInput(cartId: string, receiptEmail: string): IDataServiceRequest {\r\n const query = fFOnAccountQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'FFGuestCheckout',\r\n true,\r\n DataServiceEntities.FlintFoxOnAccountGuestCheckoutResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IFlintFoxOnAccountGuestCheckoutResponse' },\r\n { CartId: cartId, ReceiptEmail: receiptEmail }\r\n );\r\n}\r\n\r\nexport function fFGuestCheckoutAsync(\r\n context: IContext,\r\n cartId: string,\r\n receiptEmail: string\r\n): AsyncResult {\r\n const request = createFFGuestCheckoutInput(cartId, receiptEmail);\r\n return callActionOrExecute(request, context.callerContext);\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\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { Cart, CartLineValidationResults } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n updateLineDeliverySpecificationsAsync,\r\n validateForCheckoutAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\n// import { updateCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport {\r\n DeliveryPreferenceType,\r\n LineDeliverySpecification,\r\n ReleasedProductType,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { IModuleStateManager, IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport {\r\n ArrayExtensions,\r\n getAvailabilitiesForCartLineItems,\r\n ProductAvailabilitiesForCartLineItems\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n IModuleProps,\r\n INodeProps,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n Waiting\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { getCheckoutState } from './mod/data-actions/get-checkout-state';\r\nimport classnames from 'classnames';\r\nimport isEmpty from 'lodash/isEmpty';\r\nimport { computed, reaction, when } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport Cookies from 'universal-cookie';\r\n\r\nimport { ICCheckoutData } from './c-checkout.data';\r\nimport { ICheckoutHeadingData, ICCheckoutProps } from './c-checkout.props.autogenerated';\r\nimport AlertComponent from './components/alert';\r\nimport { getInvoicePaymentSummary, IInvoicePaymentSummary } from './components/get-invoice-payment-summary';\r\nimport { getLineItems, ILineItems } from './components/get-line-items';\r\nimport { getOrderSummary, IOrderSummary } from './components/get-order-summary';\r\nimport GuidedFormComponent from './components/guided-form';\r\nimport PlaceOrderButtonComponent from './components/place-order-button';\r\nimport placeOrder from './methods/place-order';\r\n\r\nexport * from './components/get-line-items';\r\nexport * from './components/get-order-summary';\r\nimport { fFGuestCheckoutAsync } from '../../actions/FlintFoxOnAccountGuestCheckoutAction.g';\r\nimport { ICartAttributes, updateCartProperties } from '../../common/utils/helper';\r\nimport { ICartState } from './mod/state-interfaces';\r\nimport emptyActiveCart from './methods/empty-active-cart';\r\nimport { IFlintFoxOnAccountGuestCheckoutResponse } from '../../actions/FlintFoxOnAccountGuestCheckoutEntities.g';\r\n\r\ntype DeviceType = 'Mobile';\r\n\r\ninterface ICheckoutState {\r\n errorMessage: string;\r\n isValidationPassed: boolean;\r\n isPlaceOrderLoading?: boolean;\r\n}\r\ninterface AttributeValueBase {\r\n Name: string;\r\n TextValue: string;\r\n ExtensionProperties: [];\r\n TextValueTranslations: [];\r\n}\r\nexport interface ICCheckoutViewProps extends ICCheckoutProps {\r\n className: string;\r\n canShow?: boolean;\r\n isEmptyCart?: boolean;\r\n isConsentGiven?: boolean;\r\n hasError?: boolean;\r\n cartStatus?: string;\r\n isMobile?: boolean;\r\n isEditorialMode?: boolean;\r\n backToShoppingUrl?: string;\r\n editCartLink?: string;\r\n hasSalesOrder: boolean;\r\n hasInvoiceLine?: boolean;\r\n\r\n checkoutProps: IModuleProps;\r\n headerProps: INodeProps;\r\n bodyProps: INodeProps;\r\n mainProps: INodeProps;\r\n mainControlProps: INodeProps;\r\n sideProps: INodeProps;\r\n sideControlFirstProps: INodeProps;\r\n sideControlSecondProps: INodeProps;\r\n termsAndConditionsProps: INodeProps;\r\n\r\n guidedForm?: React.ReactNode;\r\n title?: React.ReactNode;\r\n loading?: React.ReactNode;\r\n alert?: React.ReactNode;\r\n orderSummary?: IOrderSummary;\r\n invoicePaymentSummary?: IInvoicePaymentSummary;\r\n lineItems?: ILineItems;\r\n placeOrderButton?: React.ReactNode;\r\n termsAndConditions?: React.ReactNode;\r\n keepShoppingButton?: React.ReactNode;\r\n orderConfirmation?: React.ReactNode;\r\n}\r\n\r\nexport interface ICheckoutModuleProps extends ICCheckoutProps, IModuleStateProps {}\r\n\r\n/**\r\n *\r\n * CheckoutContainer component.\r\n * @extends {React.Component}\r\n */\r\n// @ts-expect-error\r\n@withModuleState\r\n@observer\r\nclass Checkout extends React.PureComponent {\r\n @computed get cartStatus(): Msdyn365.AsyncResultStatus {\r\n return this.props.data.checkout?.status;\r\n }\r\n\r\n @computed get isEmptyCart(): boolean {\r\n if (this.isEditorialMode) {\r\n // Editorial mode: Ignore empty cart\r\n return false;\r\n }\r\n const cart = this.props.data.checkout?.result?.checkoutCart?.cart;\r\n return this.cartStatus === 'SUCCESS' && !!cart && !isEmpty(cart) && (!cart.CartLines || cart.CartLines.length === 0);\r\n }\r\n\r\n @computed get hasError(): boolean {\r\n const cart = this.props.data.checkout?.result?.checkoutCart?.cart;\r\n return this.cartStatus === 'FAILED' || (this.cartStatus === 'SUCCESS' && (!cart || isEmpty(cart)));\r\n }\r\n\r\n @computed get isEditorialMode(): boolean {\r\n return this.props.context.request.params.isEditor;\r\n }\r\n\r\n @computed public get isPaymentVerificationRedirection(): boolean {\r\n const { requestFormData, query } = this.props.context.request;\r\n return !!(requestFormData || (query && query.pv === '1'));\r\n }\r\n\r\n @computed get canPlaceOrder(): boolean {\r\n const isTermsAndConditionAccepted = this.props.data.checkout.result && this.props.data.checkout.result?.isTermsAndConditionAccepted;\r\n\r\n const shouldEnableSinglePaymentAuthorizationCheckout =\r\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout ?? false;\r\n\r\n // If isTermsAndConditionAccepted is undefined means TermsAndCondition module is not added to page and we should able to place order.\r\n return (\r\n this.props.moduleState.isReady &&\r\n (isTermsAndConditionAccepted === undefined || isTermsAndConditionAccepted || shouldEnableSinglePaymentAuthorizationCheckout) &&\r\n (this.state.errorMessage === '' || shouldEnableSinglePaymentAuthorizationCheckout || this.isPaymentVerificationRedirection)\r\n );\r\n }\r\n\r\n @computed get isCartReady(): boolean {\r\n return (\r\n !!this.props.data.checkout.result?.checkoutCart?.cart &&\r\n this.props.data.customerInformation.status !== 'LOADING' &&\r\n this.props.data.featureState.status !== 'LOADING'\r\n );\r\n }\r\n\r\n public state: ICheckoutState = {\r\n errorMessage: '',\r\n isValidationPassed: false,\r\n isPlaceOrderLoading: false\r\n };\r\n public pcCookies = new Cookies();\r\n private readonly telemetryContent: ITelemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n\r\n public componentDidMount(): void {\r\n const {\r\n resources: { genericErrorMessage }\r\n } = this.props;\r\n\r\n when(\r\n () => this.hasError,\r\n () => {\r\n this.setState({\r\n errorMessage: genericErrorMessage\r\n });\r\n this.props.context.telemetry.error('Failed to get cart');\r\n }\r\n );\r\n\r\n when(\r\n () => {\r\n return this.isEmptyCart;\r\n },\r\n () => {\r\n this.redirectToCartPage('Cart is empty, but no editCartLink found');\r\n }\r\n );\r\n\r\n when(\r\n () => this.isCartReady,\r\n () => {\r\n this.validateForCheckout();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.moduleState.isReady,\r\n () => {\r\n this.onContainerReady();\r\n }\r\n );\r\n\r\n // Reaction to call place order when isPaymentSectionContainerReady is true for new checkout flow.\r\n reaction(\r\n () => this.props.data.checkout.result?.isPaymentSectionContainerReady,\r\n async isReady => {\r\n if (\r\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout &&\r\n isReady &&\r\n !this.props.data.checkout.result.redirectAdditionalContext\r\n ) {\r\n if (!this.state.isPlaceOrderLoading) {\r\n this.setState({ isPlaceOrderLoading: true });\r\n }\r\n\r\n await this.onPlaceOrder();\r\n this.setState({ isPlaceOrderLoading: false });\r\n }\r\n }\r\n );\r\n\r\n // Reaction to enable place order button when isPaymentSectionContainerHasError is true for new checkout flow.\r\n reaction(\r\n () => this.props.data.checkout.result?.isPaymentSectionContainerHasError,\r\n hasError => {\r\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout && hasError) {\r\n this.setState({ isPlaceOrderLoading: false });\r\n }\r\n }\r\n );\r\n\r\n // Reaction to enable place order button when redirection is true for new checkout flow.\r\n reaction(\r\n () => this.canPlaceOrder,\r\n async () => {\r\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout && this.canPlaceOrder) {\r\n const { requestFormData, query } = this.props.context.request;\r\n const isRedirection = !!(requestFormData && query && query.pv === '1');\r\n if (isRedirection) {\r\n await this.props.data.checkout.result.updateIsPlaceOrderEnabledInRedirection({\r\n newIsPlaceOrderEnabledInRedirection: true\r\n });\r\n }\r\n }\r\n }\r\n );\r\n }\r\n\r\n // eslint-disable-next-line complexity -- ignore the complexity.\r\n public render(): JSX.Element {\r\n const {\r\n moduleState,\r\n config: { className, checkoutHeading, disableGuidedCheckoutFlow },\r\n resources\r\n } = this.props;\r\n const { errorMessage } = this.state;\r\n const { backToShopping, placeOrderText, confirmPaymentText, cookieConsentRequiredMessage, genericErrorMessage } = resources;\r\n const checkoutClass = classnames('ms-checkout', className);\r\n const checkoutInformation = this.getSlotItems('checkoutInformation');\r\n const isConsentGiven =\r\n this.props.context.request &&\r\n this.props.context.request.cookies &&\r\n this.props.context.request.cookies.isConsentGiven &&\r\n this.props.context.request.cookies.isConsentGiven();\r\n\r\n const isMobile =\r\n this.props.context.request &&\r\n this.props.context.request.device &&\r\n (this.props.context.request.device.Type as DeviceType) === 'Mobile';\r\n\r\n const backToShoppingUrl = Msdyn365.getUrlSync('home', this.props.context.actionContext) || '';\r\n const editCartLink = Msdyn365.getUrlSync('cart', this.props.context.actionContext) || '';\r\n\r\n const termsAndConditions =\r\n this.props.slots.termsAndConditions && this.props.slots.termsAndConditions.length > 0 && this.props.slots.termsAndConditions[0];\r\n\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.BackToShopping);\r\n const backToShoppingAttributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n\r\n const hasInvoiceLine = this.props.data.checkout && this.props.data.checkout.result?.checkoutCart.hasInvoiceLine;\r\n const checkoutBtnText = hasInvoiceLine ? confirmPaymentText : placeOrderText;\r\n const checkCustomerAccount = this.props.data.checkout?.result?.customerAccountAmount;\r\n let viewProps: ICCheckoutViewProps = {\r\n ...this.props,\r\n className: checkoutClass,\r\n isEmptyCart: this.isEmptyCart,\r\n isConsentGiven,\r\n hasError: this.hasError,\r\n hasSalesOrder:\r\n this.props.data.checkout &&\r\n this.props.data.checkout.result !== undefined &&\r\n this.props.data.checkout.result.salesOrder !== undefined,\r\n hasInvoiceLine,\r\n cartStatus: this.cartStatus,\r\n isMobile,\r\n backToShoppingUrl,\r\n editCartLink,\r\n isEditorialMode: this.isEditorialMode,\r\n orderConfirmation:\r\n this.props.slots.orderConfirmation && this.props.slots.orderConfirmation.length > 0\r\n ? this.props.slots.orderConfirmation[0]\r\n : undefined,\r\n checkoutProps: { moduleProps: this.props, className: checkoutClass },\r\n headerProps: { className: 'ms-checkout__head' },\r\n bodyProps: { className: 'ms-checkout__body' },\r\n mainProps: { className: 'ms-checkout__main' },\r\n mainControlProps: { className: 'ms-checkout__main-control' },\r\n sideProps: { className: 'ms-checkout__side' },\r\n sideControlFirstProps: { className: 'ms-checkout__side-control-first' },\r\n sideControlSecondProps: { className: 'ms-checkout__side-control-second' },\r\n termsAndConditionsProps: { className: 'ms-checkout__terms-and-conditions' },\r\n title: checkoutHeading && this.renderMsdyn365Text(checkoutHeading)\r\n };\r\n\r\n if (!isConsentGiven) {\r\n viewProps = {\r\n ...viewProps,\r\n alert: \r\n };\r\n } else if (this.isLoading()) {\r\n viewProps = {\r\n ...viewProps,\r\n loading: \r\n };\r\n } else if (this.hasError) {\r\n viewProps = {\r\n ...viewProps,\r\n alert: \r\n };\r\n } else {\r\n const shouldEnableSinglePaymentAuthorizationCheckout: boolean =\r\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout ?? false;\r\n\r\n viewProps = {\r\n ...viewProps,\r\n alert: errorMessage && ,\r\n canShow: true,\r\n guidedForm: checkoutInformation ? (\r\n \r\n ) : (\r\n undefined\r\n ),\r\n orderSummary: getOrderSummary(this.props),\r\n invoicePaymentSummary: getInvoicePaymentSummary(this.props),\r\n lineItems: hasInvoiceLine ? undefined : getLineItems(this.props, this.telemetryContent),\r\n placeOrderButton: (\r\n \r\n ),\r\n termsAndConditions,\r\n keepShoppingButton: backToShoppingUrl && (\r\n \r\n {backToShopping}\r\n \r\n )\r\n };\r\n }\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n public renderMsdyn365Text(checkoutHeading: ICheckoutHeadingData): React.ReactNode {\r\n return (\r\n \r\n );\r\n }\r\n\r\n public handleCheckoutHeadingChange = (event: Msdyn365.ContentEditableEvent) =>\r\n (this.props.config.checkoutHeading!.text = event.target.value);\r\n\r\n private readonly isLoading = (): boolean => {\r\n return !this.cartStatus || this.cartStatus === 'LOADING' || this.isEmptyCart || !this.state.isValidationPassed;\r\n };\r\n\r\n private readonly getSlotItems = (key: string): React.ReactNode[] | undefined => {\r\n const { slots } = this.props;\r\n return slots && slots[key] && slots[key].length > 0 ? slots[key] : undefined;\r\n };\r\n\r\n /**\r\n * Trigger the payment section container submit when placing order.\r\n */\r\n private readonly triggerPaymentWithPlaceOrder = async (): Promise => {\r\n this.setState({ isPlaceOrderLoading: true });\r\n\r\n await this.props.data.checkout.result?.updateShouldTriggerPaymentWithPlaceOrder({\r\n newShouldTriggerPaymentWithPlaceOrder: !this.props.data.checkout.result.shouldTriggerPaymentWithPlaceOrder\r\n });\r\n };\r\n\r\n // private readonly updateCartLineSourceCode = async (sourceCode: string,updatedCartVersion: number | undefined): Promise => {\r\n // const attributeArrPDS:any[]=[];\r\n // const promoCodeCustomAttr = {\r\n // // @ts-ignore\r\n // '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue',\r\n // Name: 'SourceCode',\r\n // ExtensionProperties: [],\r\n // TextValue: sourceCode,\r\n // TextValueTranslations: []\r\n // };\r\n // attributeArrPDS.push(promoCodeCustomAttr);\r\n // const cartData = this.props.data.checkout.result?.checkoutCart.cart\r\n // let cartLinesState = this.props.data.checkout.result?.checkoutCart.cart.CartLines\r\n // cartLinesState = cartLinesState?.map(cartLineState=>{\r\n // const newcartLineState = {\r\n // ...cartLineState,\r\n // AttributeValues: attributeArrPDS\r\n // }\r\n // return newcartLineState\r\n // })\r\n // try {\r\n // const myres = await updateCartLinesAsync({callerContext: this.props.context.actionContext}, cartData?.Id! , cartLinesState ? cartLinesState : [], updatedCartVersion)\r\n // return myres.Version\r\n // } catch (error) {\r\n // this.props.telemetry.debug('Unable to update cart lines when next from email address');\r\n // return undefined\r\n // }\r\n // }\r\n private readonly getSourceCodeAttribute = (sourceCode: string): AttributeValueBase[] => {\r\n const attributeArr: AttributeValueBase[] = [];\r\n const billingAddressAttribute: AttributeValueBase = {\r\n //@ts-ignore\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue',\r\n Name: 'SourceCode',\r\n TextValue: JSON.stringify(sourceCode),\r\n ExtensionProperties: [],\r\n TextValueTranslations: []\r\n };\r\n attributeArr.push(billingAddressAttribute);\r\n return attributeArr;\r\n };\r\n\r\n private readonly onPlaceOrder = async (): Promise => {\r\n const {\r\n resources: { checkoutOutOfStockErrorMessage, genericErrorMessage, invalidCartVersionErrorMessage },\r\n context: {\r\n actionContext,\r\n app: {\r\n config: { enableStockCheck = false, disableStockCheckInAppForBackorderableProducts }\r\n }\r\n },\r\n slots: { orderConfirmation },\r\n data: { checkout, products, customerInformation, onAccountGuestCheckoutState }\r\n } = this.props;\r\n\r\n // If hasInvoiceLine is true, no inventory check\r\n if (\r\n !this.props.data.checkout.result?.checkoutCart.hasInvoiceLine &&\r\n enableStockCheck &&\r\n !disableStockCheckInAppForBackorderableProducts &&\r\n (await this.isOverMaxQuantity((await checkout).checkoutCart.cart, await products))\r\n ) {\r\n this.setState({\r\n errorMessage: checkoutOutOfStockErrorMessage\r\n });\r\n this.props.context.telemetry.error(checkoutOutOfStockErrorMessage);\r\n } else {\r\n const hasOrderConfirmation = orderConfirmation && orderConfirmation.length > 0;\r\n\r\n const updatedCartVersion = await this.updateCartLineEmailAddress(this.props.data.checkout.result?.guestCheckoutEmail || '');\r\n const sourceCode: string = this.pcCookies.get('sourceCode');\r\n const checkoutState = await getCheckoutState(this.props.context.actionContext);\r\n // let updatedCartVersionafterSC: number | undefined;\r\n // sourceCode = '21F11002';\r\n if (sourceCode && checkoutState) {\r\n const { checkoutCart } = checkoutState;\r\n await checkoutCart.updateAttributeValues({ newAttributeValues: this.getSourceCodeAttribute(sourceCode) });\r\n // another way on cartline level\r\n // updatedCartVersionafterSC = await this.updateCartLineSourceCode(sourceCode,updatedCartVersion)\r\n }\r\n\r\n if (\r\n onAccountGuestCheckoutState.result?.appliedOnAccount &&\r\n customerInformation.result === undefined &&\r\n checkoutState.customerAccountAmount > 0\r\n ) {\r\n const receiptEmail = checkout?.result?.guestCheckoutEmail ? checkout?.result?.guestCheckoutEmail : '';\r\n const checkoutCart: ICartState | undefined = checkout?.result?.checkoutCart;\r\n if (checkoutCart) {\r\n const attributesArr: ICartAttributes[] = [\r\n // {\r\n // attributeName: 'ReceiptEmail',\r\n // attributeValue: receiptEmail\r\n // },\r\n {\r\n attributeName: 'RentOptIn',\r\n attributeValue: onAccountGuestCheckoutState.result.rentOptIn\r\n },\r\n {\r\n attributeName: 'EmailOptIn',\r\n attributeValue: onAccountGuestCheckoutState.result.emailOptIn\r\n }\r\n ];\r\n await updateCartProperties(checkoutCart, attributesArr);\r\n }\r\n fFGuestCheckoutAsync({ callerContext: actionContext }, (await checkout).checkoutCart.cart.Id, receiptEmail)\r\n .then(async (response: IFlintFoxOnAccountGuestCheckoutResponse) => {\r\n if (response.Status) {\r\n let orderConfirmationUrl =\r\n Msdyn365.getUrlSync('onaccountorderconfirmation', this.props.context.actionContext) || '';\r\n // Remove purchased items from the active cart\r\n try {\r\n await emptyActiveCart(actionContext);\r\n } catch (error) {\r\n if (typeof error === 'string') {\r\n this.props.telemetry.information(error);\r\n }\r\n this.props.telemetry.debug('Unable to clear cart');\r\n }\r\n if (response.TransactionNumber) {\r\n orderConfirmationUrl = `${orderConfirmationUrl}?orderId=${response.TransactionNumber}`;\r\n }\r\n // else {\r\n // orderConfirmationUrl = `${orderConfirmationUrl}?orderId=DE07-000000047`;\r\n // }\r\n window.location.href = orderConfirmationUrl;\r\n }\r\n })\r\n .catch(err => {\r\n console.log(err);\r\n });\r\n } else {\r\n // else if (customerInformation.result || !onAccountGuestCheckoutState.result?.appliedOnAccount || (await checkout).customerAccountAmount === 0) {\r\n await placeOrder(\r\n actionContext,\r\n this.props.data.checkout.result,\r\n this.props.data.products.result,\r\n !hasOrderConfirmation,\r\n updatedCartVersion,\r\n this.isPaymentVerificationRedirection\r\n )\r\n .catch(error => {\r\n let errorMessage = genericErrorMessage;\r\n\r\n if (error && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\r\n errorMessage = invalidCartVersionErrorMessage;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown error type.\r\n if (\r\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout &&\r\n error.data?.AdditionalContext &&\r\n !this.isPaymentVerificationRedirection\r\n ) {\r\n return;\r\n }\r\n if (\r\n error &&\r\n error.name === 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount'\r\n ) {\r\n errorMessage = error?.message;\r\n }\r\n this.setState({\r\n errorMessage\r\n });\r\n this.props.telemetry.exception(error);\r\n })\r\n .then(res => {\r\n this.pcCookies.remove('sourceCode');\r\n });\r\n\r\n await checkout.result?.updateIsPaymentSectionContainerReady({ newIsPaymentSectionContainerReady: false });\r\n }\r\n }\r\n };\r\n\r\n // Update receipt email address for electronic cart line\r\n // return the updated cart version\r\n private readonly updateCartLineEmailAddress = async (newGuestCheckoutEmail: string): Promise => {\r\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\r\n\r\n const emailDeliveryCartLines = this.props.data.checkout.result?.checkoutCart.cart.CartLines?.filter(\r\n cartLine => cartLine.DeliveryMode && cartLine.DeliveryMode !== '' && cartLine.DeliveryMode === emailDeliveryModeCode\r\n );\r\n\r\n let updatedCartVersion: number | undefined;\r\n if (emailDeliveryCartLines && emailDeliveryCartLines.length > 0) {\r\n const lineDeliverySpecifications: LineDeliverySpecification[] = emailDeliveryCartLines.map(line => {\r\n return {\r\n LineId: line.LineId,\r\n DeliverySpecification: {\r\n DeliveryModeId: emailDeliveryModeCode,\r\n DeliveryPreferenceTypeValue: DeliveryPreferenceType.ElectronicDelivery,\r\n ElectronicDeliveryEmailAddress: newGuestCheckoutEmail\r\n }\r\n };\r\n });\r\n\r\n await updateLineDeliverySpecificationsAsync(\r\n { callerContext: this.props.context.actionContext },\r\n (await this.props.data.checkout).checkoutCart.cart.Id,\r\n lineDeliverySpecifications\r\n )\r\n .then(updatedCart => {\r\n updatedCartVersion = updatedCart.Version;\r\n })\r\n .catch(error => {\r\n this.props.context.actionContext.telemetry.exception(error);\r\n throw new Error('[updateLineDeliverySpecificationsAsync] Unable to update electronic delivery email address in cart');\r\n });\r\n }\r\n\r\n return updatedCartVersion;\r\n };\r\n\r\n /**\r\n * Return true if any product in the cart is over its max quantity.\r\n * @param cart -- The checkout cart.\r\n * @param products -- The checkout products.\r\n * @returns -- Is any product in the cart is over max quantity.\r\n */\r\n private readonly isOverMaxQuantity = async (cart: Cart, products: SimpleProduct[]): Promise => {\r\n let isOverMaxQuantity = false;\r\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\r\n\r\n await getAvailabilitiesForCartLineItems(\r\n new ProductAvailabilitiesForCartLineItems(this.props.context.actionContext.requestContext.apiSettings),\r\n this.props.context.actionContext\r\n )\r\n .then(productInventoryInformation => {\r\n cart.CartLines?.map(cartline => {\r\n const cartlineProduct = products.find(product => product.RecordId === cartline.ProductId);\r\n const isServiceItem = cartlineProduct?.ItemTypeValue === ReleasedProductType.Service;\r\n\r\n // If product is service item or cartline is electronic delivery, then no inventory check\r\n if (\r\n !isServiceItem &&\r\n cartline.DeliveryMode !== emailDeliveryModeCode &&\r\n ArrayExtensions.hasElements(productInventoryInformation)\r\n ) {\r\n const foundProductAvailability = productInventoryInformation.find(productInventory => {\r\n return productInventory.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\r\n });\r\n\r\n if (\r\n !(\r\n foundProductAvailability?.IsProductAvailable &&\r\n foundProductAvailability.ProductAvailableQuantity.AvailableQuantity !== undefined &&\r\n cartline.Quantity &&\r\n cartline.Quantity <= foundProductAvailability.ProductAvailableQuantity.AvailableQuantity\r\n )\r\n ) {\r\n isOverMaxQuantity = true;\r\n }\r\n }\r\n });\r\n\r\n return isOverMaxQuantity;\r\n })\r\n .catch(error => {\r\n this.props.context.actionContext.telemetry.exception(error);\r\n throw new Error('[getAvailabilitiesForCartLineItems] Unable to get availabilities for products in checkout cart');\r\n });\r\n\r\n return isOverMaxQuantity;\r\n };\r\n\r\n private readonly getActiveChildModuleStates = (): IModuleStateManager[] => {\r\n const { childIds, getModule } = this.props.moduleState;\r\n return childIds\r\n .map(getModule)\r\n .filter((state): state is IModuleStateManager => !!state && !state.isDisabled && state.hasModuleState);\r\n };\r\n\r\n private readonly onContainerReady = (): void => {\r\n this.getActiveChildModuleStates().forEach(state => {\r\n state.isReady && state.onContainerReady && state.onContainerReady();\r\n });\r\n };\r\n\r\n private readonly redirectToCartPage = (notFoundEditCartLinkMessage: string): void => {\r\n const editCartLink = Msdyn365.getUrlSync('cart', this.props.context.actionContext) || '';\r\n if (window && editCartLink) {\r\n window.location.assign(editCartLink);\r\n } else {\r\n this.setState({\r\n errorMessage: this.props.resources.genericErrorMessage\r\n });\r\n this.props.context.telemetry.error(notFoundEditCartLinkMessage);\r\n }\r\n };\r\n\r\n private readonly validateForCheckout = (retry: boolean = true): void => {\r\n const notFoundEditCartLinkMessage = \"Cart doesn't pass validation, but no editCartLink found\";\r\n const cart = this.props.data.checkout.result!.checkoutCart.cart;\r\n const { Id, Version } = cart;\r\n const isOrderQuantityLimitsFeatureEnabledInHq =\r\n this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\r\n )?.IsEnabled || false;\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n const customerInfo = this.props.data.customerInformation.result;\r\n\r\n const isOrderQuantityLimitsFeatureEnabledInSiteSettings =\r\n defaultOrderQuantityLimitsFeatureConfig === 'all' ||\r\n (customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b)));\r\n if (isOrderQuantityLimitsFeatureEnabledInHq && isOrderQuantityLimitsFeatureEnabledInSiteSettings) {\r\n if (Version && Id) {\r\n validateForCheckoutAsync({ callerContext: this.props.context.actionContext, bypassCache: 'none' }, Id, Version)\r\n .then((result: CartLineValidationResults) => {\r\n if (result.ValidationFailuresByCartLines?.length !== 0) {\r\n this.redirectToCartPage(notFoundEditCartLinkMessage);\r\n } else {\r\n this.setState({ isValidationPassed: true });\r\n }\r\n })\r\n .catch(error => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug('Unable to validate Cart');\r\n if (retry && error.name === 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion') {\r\n const cartState = this.props.data.checkout.result?.checkoutCart;\r\n cartState\r\n ?.refreshCart({})\r\n .then(() => {\r\n this.validateForCheckout(false);\r\n })\r\n .catch((refreshError: Error) => {\r\n this.props.telemetry.warning(refreshError.message);\r\n this.props.telemetry.debug('Unable to refresh Cart');\r\n });\r\n } else {\r\n this.redirectToCartPage(notFoundEditCartLinkMessage);\r\n }\r\n });\r\n } else {\r\n this.redirectToCartPage(notFoundEditCartLinkMessage);\r\n }\r\n } else {\r\n this.setState({ isValidationPassed: true });\r\n }\r\n };\r\n}\r\n\r\nexport default Checkout;\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 { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ICCheckoutViewProps, ILineItem, ILineItemDeliveryGroup, ILineItems, IOrderSummary, IPickUpAtStore } from './c-checkout';\r\nimport { IEmailDelivery } from './components';\r\nimport { IInvoicePaymentSummary } from './components/get-invoice-payment-summary';\r\nimport ReactHtmlParser from 'react-html-parser';\r\nimport { saveCheckoutDetailsAsync } from '../../actions/FlintFoxCheckoutAction.g';\r\nimport { updateContext } from '../../common/utils/helper';\r\n\r\nexport const PickUpAtStoreComponent: React.FC = ({ PickUpAtStore, label, location }) => (\r\n \r\n {label}\r\n {location}\r\n \r\n);\r\n\r\nexport const EmailDeliveryComponent: React.FC = ({ EmailDelivery, label }) => {label};\r\n\r\nexport const LineItemComponent: React.FC = ({ LineItem, item, pickUpAtStore, emailDelivery }) => (\r\n \r\n {item}\r\n {pickUpAtStore && }\r\n {emailDelivery && }\r\n \r\n);\r\n\r\nexport const LineItemGroupComponent: React.FC = ({ LineItemDeliveryGroup, LineItemList, heading, lineItems }) => (\r\n \r\n {heading}\r\n \r\n {lineItems.map(lineItem => (\r\n \r\n ))}\r\n \r\n \r\n);\r\n\r\nexport const LineItemGroupComponentWithMultiplePickUp: React.FC = ({\r\n LineItemDeliveryGroup,\r\n LineItemList,\r\n heading,\r\n lineItems,\r\n lineItemWraper,\r\n lineItemWraperIcon\r\n}) => (\r\n \r\n {lineItemWraperIcon}\r\n {lineItemWraper}\r\n {heading}\r\n \r\n {lineItems.map(lineItem => (\r\n \r\n ))}\r\n \r\n \r\n);\r\n\r\nexport const LineItemComponentWithMultiplePickUp: React.FC = ({ LineItem, item, pickUpAtStore, emailDelivery }) => (\r\n \r\n {item}\r\n {emailDelivery && }\r\n \r\n);\r\n\r\nexport const PickUpAtStoreComponentWithMultiplePickUp: React.FC = ({ PickUpAtStore, label, location }) => (\r\n \r\n {label}\r\n {location}\r\n \r\n);\r\n\r\nexport const LineItemsComponent: React.FC = ({\r\n LineItems,\r\n Header,\r\n heading,\r\n editLink,\r\n itemsForPickup,\r\n itemsForShip,\r\n itemsForEmail,\r\n itemsGroupWithMulitplePickupMode\r\n}) => (\r\n \r\n \r\n {heading}\r\n {editLink}\r\n \r\n {itemsGroupWithMulitplePickupMode === undefined && itemsForPickup && }\r\n {itemsGroupWithMulitplePickupMode === undefined && itemsForEmail && }\r\n {itemsGroupWithMulitplePickupMode === undefined && itemsForShip && }\r\n {itemsGroupWithMulitplePickupMode !== undefined\r\n ? itemsGroupWithMulitplePickupMode.map((item, index) => {\r\n return ;\r\n })\r\n : null}\r\n \r\n);\r\n\r\nconst OrderSummaryComponent: React.FC = ({ heading, lines }) => (\r\n
\r\n {heading}\r\n
\r\n {lines && (\r\n <>\r\n {lines.subtotal}\r\n {lines.shipping}\r\n {lines.otherCharge}\r\n {lines.tax}\r\n {lines.sourceCode}\r\n {lines.totalDiscounts}\r\n {lines.loyalty}\r\n {lines.giftCard}\r\n {lines.orderTotal}\r\n \r\n )}\r\n
\r\n
\r\n);\r\n\r\nconst PaymentSummaryComponent: React.FC = ({ heading, lines }) => (\r\n
\r\n {heading}\r\n
\r\n {lines && (\r\n <>\r\n {lines.invoices}\r\n {lines.giftCard}\r\n {lines.loyalty}\r\n {lines.orderTotal}\r\n \r\n )}\r\n
\r\n
\r\n);\r\n\r\nconst CheckoutView: React.FC = props => {\r\n const {\r\n canShow,\r\n checkoutProps,\r\n headerProps,\r\n hasSalesOrder,\r\n hasInvoiceLine,\r\n bodyProps,\r\n mainProps,\r\n mainControlProps,\r\n sideProps,\r\n sideControlFirstProps,\r\n sideControlSecondProps,\r\n termsAndConditionsProps,\r\n orderConfirmation,\r\n loading,\r\n alert,\r\n title,\r\n guidedForm,\r\n orderSummary,\r\n invoicePaymentSummary,\r\n lineItems,\r\n placeOrderButton,\r\n termsAndConditions,\r\n keepShoppingButton,\r\n data,\r\n context\r\n } = props;\r\n\r\n const initialRef = React.useRef();\r\n const [rentFlag, setRentFlag] = React.useState(!!props.config.checkBoxOneDefault);\r\n const [emailFlag, setEmailFlag] = React.useState(!!props.config.checkBoxTwoDefault);\r\n const onAccountGuestCheckoutState = data.onAccountGuestCheckoutState.result;\r\n\r\n React.useEffect(() => {\r\n if (initialRef.current && !onAccountGuestCheckoutState?.appliedOnAccount) {\r\n saveCheckoutDetailsAsync(\r\n { callerContext: context.actionContext },\r\n `${signInAccEmail || email}`,\r\n `${phoneNumber}`,\r\n '',\r\n rentFlag ? 1 : 0,\r\n emailFlag ? 1 : 0\r\n ).catch(err => {\r\n console.log(err);\r\n });\r\n } else {\r\n initialRef.current = true;\r\n }\r\n }, [rentFlag, emailFlag]);\r\n\r\n const onChangeHandler = (e: React.ChangeEvent, id: number) => {\r\n e.persist();\r\n const { name, checked } = e.target;\r\n if (name === 'rentFlag') {\r\n if (onAccountGuestCheckoutState && onAccountGuestCheckoutState.appliedOnAccount) {\r\n updateContext(context, 'rentOptIn', checked);\r\n }\r\n setRentFlag(checked);\r\n } else {\r\n if (onAccountGuestCheckoutState && onAccountGuestCheckoutState.appliedOnAccount) {\r\n updateContext(context, 'emailOptIn', checked);\r\n }\r\n setEmailFlag(checked);\r\n }\r\n };\r\n\r\n const email = data.checkout?.result?.guestCheckoutEmail;\r\n const phoneNumber = data.checkout?.result?.shippingAddress?.Phone;\r\n const placeOrderBtn = placeOrderButton as JSX.Element;\r\n const signInAccEmail = data.checkout?.result?.checkoutCart.cart.ReceiptEmail;\r\n\r\n const onClickHandler = async (isCheckBoxTick: boolean) => {\r\n if (!isCheckBoxTick) {\r\n placeOrderBtn.props.placeOrder();\r\n }\r\n console.log(`${signInAccEmail} ${email}`);\r\n };\r\n\r\n const canPlaceOrderValue = placeOrderButton as React.ReactNode & { props: { canPlaceOrder: boolean } };\r\n\r\n return (\r\n \r\n {!hasSalesOrder && {title}}\r\n {!hasSalesOrder && (\r\n \r\n {loading}\r\n\r\n {canShow && (\r\n <>\r\n \r\n {guidedForm}\r\n
\r\n
\r\n onClickHandler(true)}\r\n onChange={e => onChangeHandler(e, 1)}\r\n checked={rentFlag}\r\n />\r\n

{ReactHtmlParser(`${props.config.checkBoxOne}`)}

\r\n

{props.config.checkBoxTwoHeading}

\r\n onClickHandler(true)}\r\n onChange={e => onChangeHandler(e, 2)}\r\n checked={emailFlag}\r\n />\r\n

{ReactHtmlParser(`${props.config.checkBoxTwo}`)}

\r\n
\r\n
\r\n {termsAndConditions}\r\n \r\n {canPlaceOrderValue.props.canPlaceOrder ? (\r\n onClickHandler(false)}\r\n >\r\n Place order\r\n \r\n ) : (\r\n placeOrderButton\r\n )}\r\n {keepShoppingButton}\r\n \r\n
\r\n \r\n {!hasInvoiceLine\r\n ? orderSummary && \r\n : invoicePaymentSummary && }\r\n \r\n {termsAndConditions}\r\n {placeOrderButton}\r\n {keepShoppingButton}\r\n \r\n {lineItems && }\r\n \r\n {termsAndConditions}\r\n {placeOrderButton}\r\n {keepShoppingButton}\r\n \r\n \r\n {alert}\r\n \r\n )}\r\n {/* {canShow && (\r\n <>\r\n \r\n {guidedForm}\r\n \r\n {termsAndConditions}\r\n \r\n \r\n {placeOrderButton}\r\n {keepShoppingButton}\r\n \r\n \r\n \r\n {/* {!hasInvoiceLine ? orderSummary && : invoicePaymentSummary && } */}\r\n {/*
\r\n {!hasInvoiceLine ? orderSummary && \r\n : invoicePaymentSummary && }\r\n {placeOrderButton}\r\n {keepShoppingButton}\r\n
\r\n \r\n \r\n {termsAndConditions}\r\n */}\r\n {/* {placeOrderButton}\r\n {keepShoppingButton} */}\r\n {/* \r\n {lineItems && }\r\n \r\n \r\n {termsAndConditions}\r\n \r\n {placeOrderButton}\r\n {keepShoppingButton}\r\n \r\n
\r\n \r\n )} */}\r\n
\r\n )}\r\n {hasSalesOrder && orderConfirmation}\r\n
\r\n );\r\n};\r\n\r\nexport default CheckoutView;\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-checkout'] = {\n c: () => require('partner/modules/c-checkout/c-checkout.tsx'),\n $type: 'containerModule',\n da: [{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'checkout', path:'modules/c-checkout/actions/checkout-state-data-action', runOn: 1},{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: 1},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'onAccountGuestCheckoutState', path:'actions/get-on-account-guest-checkout-state', runOn: 0},{name:'onBillValue', path:'actions/get-payment-onbill-value.action', runOn: 0},{name:'orgUnitLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations', runOn: 1},{name:'products', path:'modules/c-checkout/actions/get-products-in-active-checkout-cart', runOn: 1},{name:'saveAndContinue', path:'actions/savesubmit-enabledisable.action', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'c-checkout',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/c-checkout'\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/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 = 'actions/get-on-account-guest-checkout-state';\n let dataAction = require('partner/actions/get-on-account-guest-checkout-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-payment-onbill-value.action';\n let dataAction = require('partner/actions/get-payment-onbill-value.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/savesubmit-enabledisable.action';\n let dataAction = require('partner/actions/savesubmit-enabledisable.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/c-checkout/actions/checkout-state-data-action';\n let dataAction = require('partner/modules/c-checkout/actions/checkout-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/c-checkout/actions/get-products-in-active-checkout-cart';\n let dataAction = require('partner/modules/c-checkout/actions/get-products-in-active-checkout-cart');\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-checkout|c-checkout'] = {\n c: () => require('partner/modules/c-checkout/c-checkout.view.tsx'),\n cn: '__local__-__local__-c-checkout'\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 {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { CheckoutState } from './checkout-state';\n\n/**\n * CheckoutState - action input.\n */\nexport class CheckoutStateInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey('CheckoutState', this.apiSettings);\n\n public getCacheObjectType = () => 'CheckoutState';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * CheckoutState - action.\n * @param input\n * @param ctx\n */\nexport async function checkoutStateAction(input: CheckoutStateInput, ctx: IActionContext): Promise {\n return new CheckoutState();\n}\n\n/**\n * CheckoutState - create new input for create action.\n * @param inputData\n */\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\n return new CheckoutStateInput(inputData.requestContext.apiSettings);\n};\n\n/**\n * CheckoutState - create action.\n */\nexport const checkoutStateActionDataAction = createObservableDataAction({\n action: >checkoutStateAction,\n input: createInput\n});\n\nexport default checkoutStateActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Address, GiftCard, TenderLine, TokenizedPaymentCard } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { action, computed, observable } from 'mobx';\n\n/**\n * State information related to what is needed to succesfully perform a checkout.\n */\nexport class CheckoutState {\n @observable private _tokenizedPaymentCard: TokenizedPaymentCard | undefined;\n\n @computed public get tokenizedPaymentCard(): Readonly | undefined {\n return this._tokenizedPaymentCard;\n }\n\n @observable private _tenderLine: TenderLine | undefined;\n\n @computed public get tenderLine(): Readonly | undefined {\n return this._tenderLine;\n }\n\n @observable private _billingAddress: Address | undefined;\n\n @computed public get billingAddress(): Readonly
| undefined {\n return this._billingAddress;\n }\n\n @observable private _shippingAddress: Address | undefined;\n\n @computed public get shippingAddress(): Readonly
| undefined {\n return this._shippingAddress;\n }\n\n @observable private _cardPrefix: string | undefined;\n\n @computed public get cardPrefix(): Readonly | undefined {\n return this._cardPrefix;\n }\n\n @observable private _giftCards: GiftCard[] = [];\n\n @computed public get giftCards(): readonly GiftCard[] {\n return this._giftCards;\n }\n\n @observable private _giftCardExtends: IGiftCardExtend[] = [];\n\n @computed public get giftCardExtends(): readonly IGiftCardExtend[] {\n return this._giftCardExtends;\n }\n\n @observable private _loyaltyCardNumber?: string;\n\n @computed public get loyaltyCardNumber(): Readonly | undefined {\n return this._loyaltyCardNumber;\n }\n\n @observable private _loyaltyAmount: number = 0;\n\n @computed public get loyaltyAmount(): Readonly | number {\n return this._loyaltyAmount;\n }\n\n @observable private _guestCheckoutEmail: string = '';\n\n @computed public get guestCheckoutEmail(): Readonly | string {\n return this._guestCheckoutEmail;\n }\n\n @observable private _isTermsAndConditionAccepted: boolean = false;\n\n @computed public get isTermsAndConditionAccepted(): Readonly | boolean {\n return this._isTermsAndConditionAccepted;\n }\n\n @observable private _customerAccountAmount: number = 0;\n\n @computed public get customerAccountAmount(): Readonly | number {\n return this._customerAccountAmount;\n }\n\n @action\n public updateTokenizedPaymentCard(newTokenizedPaymentCard: TokenizedPaymentCard): void {\n this._tokenizedPaymentCard = newTokenizedPaymentCard;\n }\n\n @action\n public updateTenderLine(newTenderLine: TenderLine | undefined): void {\n this._tenderLine = newTenderLine;\n }\n\n @action\n public updateShippingAddress(newShippingAddress: Address): void {\n this._shippingAddress = newShippingAddress;\n }\n\n @action\n public updateBillingAddress(newBillingAddress: Address): void {\n this._billingAddress = newBillingAddress;\n }\n\n @action\n public updateCardPrefix(newCardPrefix: string): void {\n this._cardPrefix = newCardPrefix;\n }\n\n @action\n public removeGiftCard(giftCardNumber: string): void {\n this._giftCards = this._giftCards.filter(giftCard => giftCard.Id !== giftCardNumber);\n }\n\n @action\n public removeGiftCardExtend(giftCardNumber: string): void {\n this._giftCardExtends = this._giftCardExtends.filter(giftCard => giftCard.Id !== giftCardNumber);\n }\n\n @action\n public addGiftCard(giftCard: GiftCard): void {\n this._giftCards = [giftCard, ...this._giftCards];\n }\n\n @action\n public addGiftCardExtend(giftCard: IGiftCardExtend): void {\n this._giftCardExtends = [giftCard, ...this._giftCards];\n }\n\n @action\n public updateLoyaltyCardNumber(newLoyaltyCardNumber: string): void {\n this._loyaltyCardNumber = newLoyaltyCardNumber;\n }\n\n @action\n public updateLoyaltyAmount(newAmount: number): void {\n this._loyaltyAmount = newAmount;\n }\n\n @action\n public updateGuestCheckoutEmail(newGuestCheckoutEmail: string): void {\n this._guestCheckoutEmail = newGuestCheckoutEmail;\n }\n\n @action\n public updateTermsAndConditionsAcceptance(newIsTermsAndConditionAccepted: boolean): void {\n this._isTermsAndConditionAccepted = newIsTermsAndConditionAccepted;\n }\n\n @action\n public updateCustomerAccountAmount(newAmount: number): void {\n this._customerAccountAmount = newAmount;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CacheType, IActionContext, IActionInput } from '@msdyn365-commerce/core';\n\nimport { IModuleStates } from './module-state.data';\n\n/**\n * GetModulesInput.\n */\nexport class ModuleStatesCacheKey implements IActionInput {\n public getCacheKey = () => 'ModuleState';\n\n public getCacheObjectType = () => 'ModuleState';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport function getModuleStates(ctx: IActionContext): IModuleStates {\n const cacheKey = new ModuleStatesCacheKey();\n\n let moduleStates = ctx.get(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n if (moduleStates) {\n return moduleStates;\n }\n ctx.update(cacheKey, {});\n moduleStates = ctx.get(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n return moduleStates;\n}\n\nexport function updateModuleStates(value: IModuleStates, ctx: IActionContext): void {\n const cacheKey = new ModuleStatesCacheKey();\n ctx.update(cacheKey, value);\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModule } from '@msdyn365-commerce/core';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport isMatch from 'lodash/isMatch';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { getModuleStates, updateModuleStates } from './module-state';\nimport { IModuleState, IModuleStateManager, IModuleStateProps, IModuleStates } from './module-state.data';\n\nexport interface IProps extends IModule, IModuleStateProps {\n enableControl?: boolean;\n}\n\nconst sectionContainerModuleId = 'section-container';\nconst paymentInstrumentModuleId = 'payment-instrument';\n\nconst withModuleState =

(WrappedComponent: React.ComponentType

): React.ComponentType

=> {\n /**\n *\n * ModuleState component.\n * @extends {React.Component

}\n */\n @observer\n class ModuleState extends React.Component

{\n constructor(props: P) {\n super(props);\n this.initializeState();\n }\n\n public shouldComponentUpdate(nextProps: IModuleStateProps): boolean {\n if (this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const { id } = this.props;\n return ;\n }\n\n private readonly initializeState = (): void => {\n const { id, typeName, context } = this.props;\n const states = getModuleStates(context.actionContext);\n if (!states) {\n this.props.telemetry.error('withModuleState initializeState() - states not found');\n return;\n }\n\n if (states[id]) {\n // State has been initialized\n return;\n }\n\n updateModuleStates(\n {\n ...states,\n [id]: {\n id,\n typeName,\n hasInitialized: false,\n hasError: false,\n isRequired: true,\n isCancellable: true,\n isSubmitContainer: false,\n status: undefined,\n childIds: []\n }\n },\n context.actionContext\n );\n };\n\n /**\n * GetModuleStateManager\n * Get module state manager by id.\n * @param id\n */\n private readonly getModuleStateManager = (id: string): IModuleStateManager => {\n const moduleState = this.get()[id];\n return {\n ...moduleState!,\n hasInitialized: this.validate(id, { hasInitialized: true }, true), // All has initialized is initialized\n hasError: this.validate(id, { hasError: true }), // Partial has error is error\n isReady: this.validate(id, { status: 'ready' }, true, true), // All ready is ready (exclued disabled and skipped)\n isUpdating: this.validate(id, { status: 'updating' }), // Partial updating is updating\n isPending: this.validate(id, { status: 'pending' }), // Partial pending is pending\n isSkipped: this.validate(id, { status: 'skipped' }, true, true), // All skipped is skipped (exclued disabled)\n isDisabled: this.validate(id, { status: 'disabled' }, true), // All disabled is disabled\n isCancelAllowed: this.validate(id, { isCancellable: true }, true, true), // Partial not allowed is not allowed\n shouldSubmitContainer: this.validate(id, { isSubmitContainer: true }), // Partial submit is submit.\n hasExternalSubmitGroup: this.hasExternalSubmitGroup(),\n hasModuleState: this.hasModuleState(id),\n setIsRequired: (value: boolean): void => {\n this.update(id, { isRequired: value });\n },\n setIsCancellable: (value: boolean): void => {\n this.update(id, { isCancellable: value });\n },\n setIsSubmitContainer: (value: boolean): void => {\n this.update(id, { isSubmitContainer: value });\n },\n setHasError: (value: boolean): void => {\n this.update(id, { hasError: value });\n },\n onReady: (): void => {\n this.update(id, { status: 'ready' });\n },\n onUpdating: (): void => {\n this.update(id, { status: 'updating' });\n },\n onPending: (): void => {\n this.update(id, { status: 'pending' });\n },\n onSkip: (): void => {\n this.update(id, { status: 'skipped' });\n },\n onDisable: (): void => {\n this.update(id, { status: 'disabled' });\n },\n getModule: (moduleId: string): IModuleStateManager => this.getModuleStateManager(moduleId),\n getModuleByTypeName: (typeName: string): IModuleStateManager => this.getModuleStateManagerByTypeName(typeName),\n init: (options?: Partial): void => {\n if (moduleState?.hasInitialized) {\n // State has been initialized\n return;\n }\n this.update(id, {\n hasInitialized: true,\n ...options\n });\n }\n };\n };\n\n /**\n * GetModuleStateManagerByTypeName\n * Get module state manager by type name.\n * @param typeName\n */\n private readonly getModuleStateManagerByTypeName = (typeName: string): IModuleStateManager => {\n const moduleStates = getModuleStates(this.props.context.actionContext);\n const moduleState = Object.values(moduleStates).find(_moduleState => _moduleState?.typeName === typeName);\n return this.getModuleStateManager((moduleState && moduleState.id) || '');\n };\n\n /**\n * Get\n * Get all module states.\n */\n private readonly get = (): IModuleStates => {\n return getModuleStates(this.props.context.actionContext);\n };\n\n /**\n * Update\n * Update module state.\n * @param id\n * @param value\n */\n private readonly update = (id: string, value: Partial): void => {\n // Console.log('withModuleState - update', id, value);\n const modules = this.get();\n if (!modules[id]) {\n this.props.telemetry.error(`withModuleState update() - Module state with id ${id} is not found.`);\n return;\n }\n modules[id] = {\n ...modules[id]!,\n ...value\n };\n };\n\n private readonly _validateLeaf = (id: string, source: Partial): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n return isMatch(module, source);\n };\n\n private readonly _validateContainer = (\n id: string,\n source: Partial,\n allMatched?: boolean,\n skipSkippableItem?: boolean\n ): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n // Module doesn't has module state\n return !!allMatched;\n }\n\n if (skipSkippableItem && (module.status === 'disabled' || module.status === 'skipped')) {\n // Skip disabled or skipped modules\n return !!allMatched;\n }\n\n // It is leaf module\n if (!module.childIds || module.childIds.length === 0) {\n return this._validateLeaf(id, source);\n }\n\n let childIds = module.childIds;\n\n if (this.props.context.app.config.shouldEnableSinglePaymentAuthorizationCheckout) {\n // For new checkout flow, we bypass the isReady check for payment section container to enable the place order button.\n childIds = childIds.filter(childId => !this._isPaymentSectionContainer(childId));\n }\n\n // It is container module\n const method = allMatched ? 'every' : 'some';\n return childIds[method](childId => this._validateContainer(childId, source, allMatched, skipSkippableItem));\n };\n\n /**\n * Check if it is a section container with payment module.\n * @param moduleId -- The id of the module.\n * @returns If it is a section container with payment module.\n */\n private readonly _isPaymentSectionContainer = (moduleId: string): boolean => {\n if (!moduleId.includes(sectionContainerModuleId)) {\n return false;\n }\n\n const modules = this.get();\n const module = modules[moduleId];\n\n if (module && ArrayExtensions.hasElements(module.childIds.filter(childId => childId.includes(paymentInstrumentModuleId)))) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Validate\n * Validate current module and all its child module match the provided condition.\n * @param id\n * @param source\n * @param allMatched\n * @param skipSkippableItem\n */\n private readonly validate = (\n id: string,\n source: Partial,\n allMatched?: boolean,\n skipSkippableItem?: boolean\n ): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n\n // It is leaf module\n if (!module.childIds || module.childIds.length === 0) {\n return this._validateLeaf(id, source);\n }\n\n // It is container module\n return this._validateContainer(id, source, allMatched, skipSkippableItem);\n };\n\n /**\n * HasExternalSubmitGroup\n * Module will use external submit group.\n */\n private readonly hasExternalSubmitGroup = (): boolean => {\n return !!this.props.enableControl;\n };\n\n /**\n * HasModuleState\n * Module is using module state manager.\n * @param id\n */\n private readonly hasModuleState = (id: string): boolean => {\n const modules = this.get();\n const module = modules[id];\n return !!module;\n };\n }\n\n return ModuleState;\n};\n\nexport default withModuleState;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { ICheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy';\nimport { format } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IInvoiceSummaryProps {\n orderTotalLabel: string;\n invoiceLabel: string;\n loyaltyLabel?: string;\n giftcardLabel?: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n cart: Cart;\n id: string;\n typeName: string;\n freeText?: string;\n toBeCalculatedText?: string;\n checkoutState?: ICheckoutState;\n}\n\nexport interface IInvoiceSummaryLines {\n orderTotal: React.ReactNode;\n invoices: React.ReactNode;\n giftCard?: React.ReactNode;\n loyalty?: React.ReactNode;\n}\n\ninterface IInvoiceSummaryLineProps {\n label: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n price?: number;\n freeText?: string;\n toBeCalculatedText?: string;\n id: string;\n typeName: string;\n cssLabel: string;\n}\n\nconst InvoiceSummaryLine: React.FC = ({\n price,\n label,\n context,\n id,\n typeName,\n toBeCalculatedText,\n freeText,\n cssLabel\n}) => {\n return (\n

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

\n );\n};\n\nconst _buildPaymentSummarySection = (\n props: IInvoiceSummaryProps,\n price: number | undefined,\n label: string,\n cssLabel: string\n): React.ReactNode => {\n return (\n \n );\n};\n\nconst _computedLoyaltyAmount = (checkoutState: ICheckoutState): number => {\n return (checkoutState && checkoutState.loyaltyAmount) || 0;\n};\n\nconst _computeGiftCardAmount = (checkoutState: ICheckoutState, cart: Cart): number => {\n const giftCardCounter = (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n };\n const giftCardTotalValue = (checkoutState.giftCardExtends || []).reduce(giftCardCounter, 0);\n const amount = (cart.TotalAmount || 0) - _computedLoyaltyAmount(checkoutState);\n return Math.min(giftCardTotalValue, amount);\n};\n\nexport const InvoiceSummary = (props: IInvoiceSummaryProps) => {\n const { TotalAmount, CartLines } = props.cart;\n const invoiceLines = CartLines?.filter(cartLine => cartLine.IsInvoiceLine);\n const reactNodes: IInvoiceSummaryLines = {\n invoices: invoiceLines?.map((invoiceLine: CartLine) => {\n return _buildPaymentSummarySection(\n props,\n invoiceLine.InvoiceAmount,\n format(props.invoiceLabel, invoiceLine.InvoiceId),\n 'invoice'\n );\n }),\n orderTotal: _buildPaymentSummarySection(props, TotalAmount, props.orderTotalLabel, 'total')\n };\n\n if (props.checkoutState) {\n const giftCardAmount = _computeGiftCardAmount(props.checkoutState, props.cart);\n const loyaltyAmount = _computedLoyaltyAmount(props.checkoutState);\n const totalAmountAfterGiftCard = (TotalAmount || 0) - giftCardAmount - loyaltyAmount;\n\n if (loyaltyAmount > 0) {\n reactNodes.loyalty = _buildPaymentSummarySection(props, -loyaltyAmount, props.loyaltyLabel || 'Loyalty amount', 'loyalty');\n }\n\n if (giftCardAmount > 0) {\n reactNodes.giftCard = _buildPaymentSummarySection(\n props,\n -giftCardAmount,\n props.giftcardLabel || 'Gift card amount',\n 'gift-card'\n );\n }\n\n reactNodes.orderTotal = _buildPaymentSummarySection(\n { ...props, freeText: undefined },\n totalAmountAfterGiftCard,\n props.orderTotalLabel,\n 'total'\n );\n }\n\n return reactNodes;\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, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { IDataServiceRequest, retailAction, OrgUnitsDataActions, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport { QueryResultSettingsProxy } from './utilities/QueryResultSettingsProxy';\n\n/**\n * Search Org Unit Locations action createInput method.\n * @param inputData - Current action context.\n * @returns Input needed to call the Search-org-unit-location API.\n */\nexport function createSearchOrgUnitLocationsInputFunc(\n inputData: ICreateActionContext, IGeneric>\n): IDataServiceRequest {\n const querySettingsProxy = QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(inputData);\n return OrgUnitsDataActions.createSearchOrgUnitLocationsInput(querySettingsProxy, {});\n}\n\nexport const retailActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/retail-actions/search-org-unit-locations',\n action: >retailAction,\n input: createSearchOrgUnitLocationsInputFunc\n});\n\nexport default retailActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["CheckoutExtensionClass","constructor","odataObject","this","Response","saveCheckoutDetailsInput","email","phone","custAccount","rentFlag","emailFlag","DataServiceQuery","createDataServiceRequestForOperation","DataServiceEntities","bypassCache","returnEntity","Email","Phone","CustAccount","RentFlag","EmailFlag","saveCheckoutDetailsAsync","context","request","callActionOrExecute","callerContext","GetPaymentOnbillValueInput","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","onBill","id","args","SavesubmitEnabledisableInput","disableButton","OrderSummaryLine","price","label","typeName","toBeCalculatedText","freeText","cssLabel","React","className","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","undefined","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","GlobalStateInput","key","stateConstructor","apiSettings","channelId","catalogId","getState","globalStateObject","createGlobalState","initialize","BaseCheckoutState","createObservableDataAction","requestContext","ActiveCheckoutCartProductsInput","createInput","getActiveCheckoutCartProductsAction","exception","Error","getCheckoutState","checkoutCart","hasInvoiceLine","length","getSimpleProducts","ProductId","ProductInput","filter","Boolean","then","products","catch","error","getActiveCheckoutCartProductsActionDataAction","message","role","getInvoicePaymentSummary","checkout","resources","totalAmountLabel","invoiceLabel","invoiceSummaryTitle","heading","lines","InvoiceSummary","result","getLineItems","telemetryContent","featureState","feature","Name","IsEnabled","_getDeliveryLocation","orgUnitLocations","FulfillmentStoreId","locationMatch","location","OrgUnitNumber","OrgUnitName","_getLineItemComponent","product","productId","_product","RecordId","config","imageSettings","showShippingChargesForLineItems","quantityDisplayString","productDimensionTypeColor","productDimensionTypeSize","productDimensionTypeStyle","productDimensionTypeAmount","configString","inputQuantityAriaLabel","discountStringText","shippingCharges","gridSettings","CartLineItemComponent","sizeString","colorString","styleString","amountString","originalPriceText","currentPriceText","shippingChargesText","isQuantityEditable","productUrl","getProductUrlSync","actionContext","primaryImageUrl","PrimaryImageUrl","_getPickUpAtStoreComponents","pickupDeliveryLocation","pickUpAtStoreWithLocationText","PickUpAtStore","_getEmailDeliveryComponents","emailDeliveryText","EmailDelivery","_getLineItemsComponents","items","isPickUp","_getCartPickDeliveryMode","isEmailDelivery","LineId","LineItem","item","pickUpAtStore","emailDelivery","cartLineItem","StringExtensions","isNullOrWhitespace","_countItems","Quantity","_filterItemsByDiliveryType","type","_getLineItemsByDeliveryType","title","itemLabel","itemsLabel","inStorePickUpLabel","shippingCountCheckoutLineItem","emailDeliveryModeDesc","deliveryOptions","productDeliveryOptions","DeliveryOptions","deliveryOption","Code","Description","suffix","replace","toString","_getGroupTitleComponent","LineItemDeliveryGroup","classnames","LineItemList","lineItems","handleLineItemHeadingChange","event","lineItemsHeading","text","target","value","_getLineItemsByDeliveryTypeWithMulitplePickupMode","multiplePickUpLabel","shippingLable","getGroupByStorePickup","groupBy","groupDelivery","cartLinesGroup","cartLinesGrp","Object","entries","forEach","groupByDeliveryType","push","keys","cartLines","index","_filterItemsByMultiplePickupMode","lineItemDeliveryGroup","fulFillmentStoreId","pickupDeliveryModeDesc","_getGroupTitleComponentWithMultiplePickUp","groupTitle","iconClass","lineItemWraperIcon","lineItemWraper","editCartText","payLoad","getPayloadObject","TelemetryConstant","EditCart","attribute","getTelemetryAttributes","groupClass","LineItems","Header","tag","editProps","onEdit","editLink","Button","color","href","itemsForPickup","itemsForShip","itemsForEmail","itemsGroupWithMulitplePickupMode","_getLineItems","getOrderSummary","orderSummaryHeading","otherCharges","showLineItems","channel","orderSummaryProps","CheckoutGuidedCard","super","editButtonRef","formCardRef","renderFooder","isVisted","isReady","isSubmitting","isCancelAllowed","hasControlGroup","onCancel","onSubmit","resource","saveBtnLabel","cancelBtnLabel","saveAndContinueBtnLabel","canSubmit","canCancel","contentAction","etext","Save","SaveContinue","saveBtnAttributes","Cancel","cancelBtnAttributes","checkIsCustomerAcOnBill","checkCustomerAccount","onBillValue","checkIsPaymentStep","checkIsPaymentBtnEnableDisable","saveAndContinue","classname","disabled","onClick","focusOnFirstFocusableElement","node","ReactDOM","child","querySelector","focus","focusOnEditButton","editButton","current","scrollToTitle","formCard","isMobile","scrollIntoView","getTitle","step","headingTag","Tag","componentDidUpdate","prevProps","isActive","onNext","render","isExpanded","children","isPending","isUpdating","hasInitialized","changeBtnLabel","CheckoutChange","changeBtnAttributes","canEdit","active","expanded","closed","visted","hidden","initialized","ready","pending","updating","ref","innerRef","CheckoutGuidedForm","state","currentStep","getEnabledModules","moduleState","childIds","getModule","childId","isDisabled","getStep","indexOf","getId","getHeading","isEditor","setState","componentDidMount","init","hasModuleState","includes","GuidedCard","disableGuidedCheckoutFlow","enableControl","observer","buttonsStates","onPlaceOrderHandler","isBusy","canPlaceOrder","placeOrder","buttonSetState","checkoutBtnText","shouldEnableSinglePaymentAuthorizationCheckout","isPlaceOrderLoading","setIsBusy","useState","payload","TelemetryEvent","Purchase","attributes","OPERATIONS","getCardTypeId","cardPrefix","response","resolveCardTypesAsync","CardType","Unknown","TypeId","findTenderIdTypeByOperationId","tenderTypes","operationId","matchedTenderType","tenderType","OperationId","TenderTypeId","roundNumber","Number","toFixed","updatedCartVersion","isPaymentVerificationRedirection","cartState","tokenizedPaymentCard","guestCheckoutEmail","billingAddress","cardPaymentAcceptResult","Currency","cartTenderLines","amountDue","AmountDue","getTenderLinePromises","loyaltyCardNumber","LoyaltyCardId","chargedAmount","loyaltyTenderLinePromise","Amount","getTenderTypesAsync","queryResultSettings","getLoyaltyTenderLine","giftCardExtend","tenderTypeId","giftCardPin","Pin","giftCardExpirationYear","ExpirationDate","parseInt","split","giftCardExpirationMonth","creditCardTenderLinePromise","GiftCardId","GiftCardPin","GiftCardExpirationYear","GiftCardExpirationMonth","getGiftCardTenderLine","Id","customerAccountAmount","customerAccountTenderLinePromise","CustomerId","user","isAuthenticated","createCustomerAccountTenderLine","currency","CardPaymentAcceptResult","getCreditCardTenderLineForSinglePaymentAuth","cartTypeId","CardTypeId","TenderType","cardTenderLine","TokenizedPaymentCard","House","CardTokenInfo","Country","ThreeLetterISORegionName","Address1","Street","City","State","Zip","ZipCode","getCreditCardTenderLine","Promise","all","cartVersion","Version","salesOrder","checkoutAsync","AdditionalContext","updateShouldCollapsePaymentSection","newShouldCollapsePaymentSection","updateRedirectAdditionalContext","newRedirectAdditionalContext","updateIsCheckoutCallFailed","newIsCheckoutCallFailed","refreshCart","lineItemIdsToRemove","getCartState","activeCart","activeCartLine","checkoutCartLine","removeCartLines","cartLineIds","removeAllPromoCodes","removeCheckoutCartId","orderedProducts","redirect","resolve","reject","console","log","name","emptyActiveCart","orderConfirmationUrl","getUrlSync","separator","url","window","assign","updateSalesOrder","newSalesOrder","newOrderedProducts","status","FlintFoxOnAccountGuestCheckoutResponseExtensionClass","Status","Message","TransactionNumber","createFFGuestCheckoutInput","cartId","receiptEmail","CartId","fFOnAccountQuery","ReceiptEmail","Checkout","errorMessage","isValidationPassed","pcCookies","getTelemetryObject","telemetryPageName","friendlyName","handleCheckoutHeadingChange","checkoutHeading","isLoading","cartStatus","isEmptyCart","getSlotItems","slots","triggerPaymentWithPlaceOrder","updateShouldTriggerPaymentWithPlaceOrder","newShouldTriggerPaymentWithPlaceOrder","shouldTriggerPaymentWithPlaceOrder","getSourceCodeAttribute","attributeArr","billingAddressAttribute","TextValue","JSON","stringify","ExtensionProperties","TextValueTranslations","onPlaceOrder","checkoutOutOfStockErrorMessage","genericErrorMessage","invalidCartVersionErrorMessage","app","enableStockCheck","disableStockCheckInAppForBackorderableProducts","orderConfirmation","customerInformation","onAccountGuestCheckoutState","isOverMaxQuantity","hasOrderConfirmation","updateCartLineEmailAddress","updateAttributeValues","newAttributeValues","appliedOnAccount","attributesArr","attributeName","attributeValue","rentOptIn","emailOptIn","updateCartProperties","fFGuestCheckoutAsync","information","debug","err","res","remove","updateIsPaymentSectionContainerReady","newIsPaymentSectionContainerReady","emailDeliveryCartLines","lineDeliverySpecifications","line","DeliverySpecification","DeliveryModeId","DeliveryPreferenceTypeValue","DeliveryPreferenceType","ElectronicDelivery","ElectronicDeliveryEmailAddress","newGuestCheckoutEmail","updateLineDeliverySpecificationsAsync","updatedCart","getAvailabilitiesForCartLineItems","ProductAvailabilitiesForCartLineItems","productInventoryInformation","cartline","cartlineProduct","ItemTypeValue","ReleasedProductType","Service","ArrayExtensions","hasElements","foundProductAvailability","productInventory","ProductAvailableQuantity","IsProductAvailable","AvailableQuantity","getActiveChildModuleStates","onContainerReady","redirectToCartPage","notFoundEditCartLinkMessage","editCartLink","validateForCheckout","retry","isOrderQuantityLimitsFeatureEnabledInHq","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","customerInfo","isOrderQuantityLimitsFeatureEnabledInSiteSettings","IsB2b","validateForCheckoutAsync","ValidationFailuresByCartLines","warning","refreshError","isEditorialMode","isEmpty","params","requestFormData","query","pv","isTermsAndConditionAccepted","when","hasError","isCartReady","reaction","isPaymentSectionContainerReady","redirectAdditionalContext","isPaymentSectionContainerHasError","updateIsPlaceOrderEnabledInRedirection","newIsPlaceOrderEnabledInRedirection","backToShopping","placeOrderText","confirmPaymentText","cookieConsentRequiredMessage","checkoutClass","checkoutInformation","isConsentGiven","device","Type","backToShoppingUrl","termsAndConditions","BackToShopping","backToShoppingAttributes","viewProps","hasSalesOrder","checkoutProps","moduleProps","headerProps","bodyProps","mainProps","mainControlProps","sideProps","sideControlFirstProps","sideControlSecondProps","termsAndConditionsProps","renderMsdyn365Text","loading","Waiting","alert","AlertComponent","canShow","guidedForm","GuidedFormComponent","orderSummary","invoicePaymentSummary","placeOrderButton","PlaceOrderButtonComponent","keepShoppingButton","renderView","__decorate","computed","withModuleState","PickUpAtStoreComponent","Node","EmailDeliveryComponent","LineItemComponent","LineItemGroupComponent","lineItem","LineItemGroupComponentWithMultiplePickUp","LineItemComponentWithMultiplePickUp","PickUpAtStoreComponentWithMultiplePickUp","LineItemsComponent","OrderSummaryComponent","PaymentSummaryComponent","invoices","initialRef","setRentFlag","checkBoxOneDefault","setEmailFlag","checkBoxTwoDefault","signInAccEmail","phoneNumber","onChangeHandler","e","persist","checked","updateContext","shippingAddress","placeOrderBtn","onClickHandler","isCheckBoxTick","canPlaceOrderValue","Module","onChange","ReactHtmlParser","checkBoxOne","checkBoxTwoHeading","checkBoxTwo","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","buildCacheKey","_this","CheckoutState","inputData","CheckoutStateInput","_giftCards","_giftCardExtends","_loyaltyAmount","_guestCheckoutEmail","_isTermsAndConditionAccepted","_customerAccountAmount","_tokenizedPaymentCard","_tenderLine","_billingAddress","_shippingAddress","_cardPrefix","_loyaltyCardNumber","newTokenizedPaymentCard","newTenderLine","newShippingAddress","newBillingAddress","newCardPrefix","giftCardNumber","newLoyaltyCardNumber","newAmount","newIsTermsAndConditionAccepted","observable","getModuleStates","cacheKey","ModuleStatesCacheKey","moduleStates","update","WrappedComponent","_super","states","isRequired","isCancellable","isSubmitContainer","validate","isSkipped","shouldSubmitContainer","hasExternalSubmitGroup","setIsRequired","setIsCancellable","setIsSubmitContainer","setHasError","onReady","onUpdating","onPending","onSkip","onDisable","moduleId","getModuleStateManager","getModuleByTypeName","getModuleStateManagerByTypeName","options","values","_moduleState","source","module","isMatch","allMatched","skipSkippableItem","_validateLeaf","_isPaymentSectionContainer","_validateContainer","initializeState","__extends","ModuleState","nextProps","InvoiceSummaryLine","_buildPaymentSummarySection","invoiceLines","IsInvoiceLine","invoiceLine","InvoiceAmount","format","InvoiceId","createSearchOrgUnitLocationsInputFunc","querySettingsProxy","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","OrgUnitsDataActions","retailActionDataAction","retailAction","exports"],"sourceRoot":""}