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EAAQ,EAAG+C,EAAIE,GAAe,IAAMtB,EAAY3B,EAAQ+C,EAAIE,IAEnEC,EAAOlD,CAEpB","sources":["webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/add-product-to-cart.ts?85ba","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/add-promo-code.ts?2e69","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/base-cart-state.ts?592c","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/add-invoices-to-cart.ts?cb4a","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/add-order-invoice-to-cart.ts?d6f8","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/update-receipt-email.ts?a0ea","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/clear-cart-line-delivery-mode.ts?86b9","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/clear-cart-lines-delivery-information.ts?527a","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/get-or-create-active-cart.ts?26ce","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/refresh-cart.ts?3943","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/remove-all-promo-codes.ts?1bb2","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/remove-cart-lines.ts?2e16","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/remove-promo-codes.ts?ffc1","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/set-invoice-line-price.ts?9cb9","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/update-cart-line-delivery-specifications.ts?6d68","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/update-cart-line-quantity.ts?a037","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/update-cart.ts?8850","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/update-loyalty-card-id.ts?c304","webpack://@msdyn365-commerce-partners/fabrikam/./src/cart-state/update-shipping-address.ts?4d06","webpack://@msdyn365-commerce-partners/fabrikam/./src/checkout-state/base-checkout-cart-state.ts?509c","webpack://@msdyn365-commerce-partners/fabrikam/./src/checkout-state/checkout-state-storage.ts?b049","webpack://@msdyn365-commerce-partners/fabrikam/./src/checkout-state/base-checkout-state.ts?a438","webpack://@msdyn365-commerce-partners/fabrikam/./src/data-actions/cart-state-data-action.ts?5695","webpack://@msdyn365-commerce-partners/fabrikam/./src/data-actions/checkout-state-data-action.ts?ad58","webpack://@msdyn365-commerce-partners/fabrikam/./src/data-actions/get-cart-state-data-action.ts?9f8e","webpack://@msdyn365-commerce-partners/fabrikam/./src/data-actions/get-cart-state.ts?4428","webpack://@msdyn365-commerce-partners/fabrikam/./src/data-actions/get-checkout-cart.ts?2235","webpack://@msdyn365-commerce-partners/fabrikam/./src/data-actions/global-state-data-action.ts?901a","webpack://@msdyn365-commerce-partners/fabrikam/./src/global-state/i-global-state.ts?6850","webpack://@msdyn365-commerce-partners/fabrikam/./src/data-actions/get-checkout-state.ts?61f7","webpack://@msdyn365-commerce-partners/fabrikam/./src/global-state/global-state.ts?008e","webpack://@msdyn365-commerce-partners/fabrikam/./src/state-interfaces/checkout-state-enums.ts?13e8","webpack://@msdyn365-commerce-partners/fabrikam/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/string-repeat.js?0dd5","webpack://@msdyn365-commerce-partners/fabrikam/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/this-number-value.js?7112","webpack://@msdyn365-commerce-partners/fabrikam/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.number.to-fixed.js?f820"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { addCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\n/**\n * Get the quantity limit.\n * @param maxQuantityForCartLineItem - Max quantity for cart line.\n * @param inputItem - The input item.\n * @param inputItem.cartLineToAdd - Cart line to add.\n * @param inputItem.availableQuantity - Available quantity.\n * @param inputItem.shouldEnableStockCheck - Is stock check enabled.\n * @param inputItem.isAddServiceItemToCart - Is add service item to cart.\n * @returns The quantity limit.\n */\nfunction getQuantityLimit(\n maxQuantityForCartLineItem: number | undefined,\n inputItem: {\n cartLineToAdd: CartLine;\n availableQuantity?: number;\n shouldEnableStockCheck?: boolean;\n isAddServiceItemToCart?: boolean;\n }\n): number {\n let quantityLimit: number;\n const defaultSiteMaxQuantity = 10;\n\n if (inputItem.shouldEnableStockCheck === false) {\n quantityLimit = maxQuantityForCartLineItem ?? defaultSiteMaxQuantity;\n } else if (maxQuantityForCartLineItem === undefined && inputItem.availableQuantity === undefined) {\n quantityLimit = defaultSiteMaxQuantity;\n } else if (inputItem.availableQuantity === undefined) {\n quantityLimit = maxQuantityForCartLineItem ?? defaultSiteMaxQuantity;\n } else if (maxQuantityForCartLineItem === undefined) {\n quantityLimit = inputItem.availableQuantity;\n } else {\n quantityLimit = Math.min(maxQuantityForCartLineItem, inputItem.availableQuantity);\n }\n\n return quantityLimit;\n}\n\n/**\n * Get the index of the item to add.\n * @param lines - The cart lines.\n * @param cartLineToAdd - The cart line to add.\n * @returns The index of the item to add.\n */\nfunction getElementIndex(lines: CartLine[], cartLineToAdd: CartLine): number {\n let elementFoundAt: number = -1;\n const productIdToFind = cartLineToAdd.ProductId;\n\n for (const [index, line] of lines.entries()) {\n if (\n line.ProductId === productIdToFind &&\n (line.DeliveryMode || '') === (cartLineToAdd.DeliveryMode || '') &&\n (line.FulfillmentStoreId || '') === (cartLineToAdd.FulfillmentStoreId || '')\n ) {\n elementFoundAt = index;\n\n break;\n }\n }\n\n return elementFoundAt;\n}\n\nasync function addProductsToCartValidateMaxAgainstDefaultOrderSettings(\n cart: Readonly,\n actionContext: IActionContext,\n input: {\n cartLineToAdd: CartLine;\n availableQuantity?: number;\n enableStockCheck?: boolean;\n isAddServiceItemToCart?: boolean;\n }[]\n): Promise {\n if (!cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n for (const inputItem of input) {\n if (inputItem.enableStockCheck && inputItem.availableQuantity) {\n let elementFoundAt: number = -1;\n const productIdToFind = inputItem.cartLineToAdd.ProductId;\n\n for (let i = 0; i < cart.CartLines.length; i++) {\n if (\n cart.CartLines[i].ProductId === productIdToFind &&\n (cart.CartLines[i].DeliveryMode || '') === (inputItem.cartLineToAdd.DeliveryMode || '') &&\n (cart.CartLines[i].FulfillmentStoreId || '') === (inputItem.cartLineToAdd.FulfillmentStoreId || '')\n ) {\n elementFoundAt = i;\n\n break;\n }\n }\n\n if (!inputItem.isAddServiceItemToCart && elementFoundAt !== -1) {\n const cartLineToUpdate = { ...cart.CartLines[elementFoundAt] };\n const curQuantity = cartLineToUpdate.Quantity || 0;\n\n if (curQuantity + (inputItem.cartLineToAdd.Quantity || 1) > inputItem.availableQuantity) {\n return {\n cart: {\n Id: cart.Id,\n CartLines: cart.CartLines\n },\n status: 'FAILED',\n substatus: 'MAXQUANTITY'\n };\n }\n }\n }\n }\n\n const newCartLines = input.map(inputItem => {\n const cartLine = { ...inputItem.cartLineToAdd };\n return cartLine;\n });\n let addCartLinesResult: ICartActionResultWithCart;\n\n if (cart.Version) {\n return addCartLinesAsync({ callerContext: actionContext }, cart.Id, newCartLines, cart.Version)\n .then(newCart => {\n addCartLinesResult = { cart: newCart, status: 'SUCCESS', substatus: 'PRODUCTADDED' };\n return addCartLinesResult;\n })\n .catch(error => {\n actionContext.telemetry.trace(error);\n actionContext.telemetry.trace('Unable to add Cart Line');\n\n if (\n error.name === 'Microsoft_Dynamics_Commerce_Runtime_AddingItem_ExceedsMaximumQuantity' ||\n error.name === 'Microsoft_Dynamics_Commerce_Runtime_UpdatingItem_ExceedsMaximumQuantity'\n ) {\n addCartLinesResult = {\n cart: undefined,\n status: 'FAILED',\n substatus: 'QUANTITYLIMITS',\n errorDetails: { LocalizedMessage: error.message }\n };\n return addCartLinesResult;\n }\n\n const hasInvoiceInCart = cart.CartLines?.find(cartline => cartline.IsInvoiceLine === true);\n if (hasInvoiceInCart) {\n addCartLinesResult = {\n cart: undefined,\n status: 'FAILED',\n substatus: 'INVOICEINCART',\n errorDetails: { LocalizedMessage: error.message }\n };\n return addCartLinesResult;\n }\n\n addCartLinesResult = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n\n return addCartLinesResult;\n });\n }\n actionContext.telemetry.warning('Unable to update Cart Line, Cart Version could not be found');\n\n addCartLinesResult = { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\n return addCartLinesResult;\n}\n\nasync function addProductsToCartValidateMaxAgainstSiteSettings(\n cart: Readonly,\n actionContext: IActionContext,\n input: {\n cartLineToAdd: CartLine;\n availableQuantity?: number;\n enableStockCheck?: boolean;\n isAddServiceItemToCart?: boolean;\n }[]\n): Promise {\n if (!cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const maxQuantityForCartLineItem: number | undefined = actionContext.requestContext.app.config.maxQuantityForCartLineItem;\n\n for (const inputItem of input) {\n const quantityLimit: number = getQuantityLimit(maxQuantityForCartLineItem, {\n cartLineToAdd: inputItem.cartLineToAdd,\n availableQuantity: inputItem.availableQuantity,\n shouldEnableStockCheck: inputItem.enableStockCheck,\n isAddServiceItemToCart: inputItem.isAddServiceItemToCart\n });\n const elementFoundAt: number = getElementIndex(cart.CartLines, inputItem.cartLineToAdd);\n\n if (!inputItem.isAddServiceItemToCart && elementFoundAt !== -1) {\n const cartLineToUpdate = { ...cart.CartLines[elementFoundAt] };\n const currentQuantity = cartLineToUpdate.Quantity || 0;\n\n if (currentQuantity + (inputItem.cartLineToAdd.Quantity || 1) > quantityLimit) {\n return {\n cart: {\n Id: cart.Id,\n CartLines: cart.CartLines\n },\n status: 'FAILED',\n substatus: 'MAXQUANTITY'\n };\n }\n }\n\n if (\n !inputItem.isAddServiceItemToCart &&\n inputItem.cartLineToAdd &&\n inputItem.cartLineToAdd.Quantity &&\n inputItem.cartLineToAdd.Quantity > quantityLimit\n ) {\n return {\n cart: {\n Id: cart.Id,\n CartLines: cart.CartLines\n },\n status: 'FAILED',\n substatus: 'MAXQUANTITY'\n };\n }\n }\n\n const newCartLines = input.map(inputItem => {\n const cartLine = { ...inputItem.cartLineToAdd };\n cartLine.Quantity = cartLine.Quantity || 1;\n return cartLine;\n });\n let cartActionResult: ICartActionResultWithCart;\n\n if (cart.Version) {\n return addCartLinesAsync({ callerContext: actionContext }, cart.Id, newCartLines, cart.Version)\n .then(newCart => {\n cartActionResult = { cart: newCart, status: 'SUCCESS', substatus: 'PRODUCTADDED' };\n return cartActionResult;\n })\n .catch(error => {\n actionContext.telemetry.trace(error);\n actionContext.telemetry.trace('Unable to add Cart Line');\n\n const hasInvoiceInCart = cart.CartLines?.find(cartline => cartline.IsInvoiceLine === true);\n if (hasInvoiceInCart) {\n cartActionResult = {\n cart: undefined,\n status: 'FAILED',\n substatus: 'INVOICEINCART',\n errorDetails: { LocalizedMessage: error.message }\n };\n return cartActionResult;\n }\n\n cartActionResult = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n return cartActionResult;\n });\n }\n actionContext.telemetry.warning('Unable to update Cart Line, Cart Version could not be found');\n\n cartActionResult = { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\n return cartActionResult;\n}\n\n/**\n * Add products to cart without site settings validation.\n * @param cart - The cart.\n * @param actionContext - The action context.\n * @param input - The cart lines to add.\n * @returns The results.\n */\nasync function addProductsToCartWithoutSiteSettings(\n cart: Readonly,\n actionContext: IActionContext,\n input: {\n cartLineToAdd: CartLine;\n }[]\n): Promise {\n if (!cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const defaultQuantity = 1;\n const newCartLines = input.map(inputItem => {\n const cartLine = { ...inputItem.cartLineToAdd };\n cartLine.Quantity = cartLine.Quantity ?? defaultQuantity;\n return cartLine;\n });\n let addCartLinesResult: ICartActionResultWithCart;\n\n if (cart.Version) {\n return addCartLinesAsync({ callerContext: actionContext }, cart.Id, newCartLines, cart.Version)\n .then(newCart => {\n addCartLinesResult = { cart: newCart, status: 'SUCCESS', substatus: 'PRODUCTADDED' };\n return addCartLinesResult;\n })\n .catch(error => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- existing error type.\n actionContext.telemetry.trace(error);\n actionContext.telemetry.trace('Unable to add cart lines');\n\n addCartLinesResult = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n return addCartLinesResult;\n });\n }\n\n actionContext.telemetry.warning('Unable to update cart lines, cart version could not be found');\n\n addCartLinesResult = { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\n return addCartLinesResult;\n}\n\nexport async function addProductsToCartInternal(\n cart: Readonly,\n actionContext: IActionContext,\n input: {\n cartLineToAdd: CartLine;\n availableQuantity?: number;\n isStockCheckEnabled?: boolean;\n isAddServiceItemToCart?: boolean;\n }[]\n): Promise {\n return addProductsToCartWithoutSiteSettings(cart, actionContext, input);\n}\n\nexport async function addProductToCartInternal(\n cart: Readonly,\n cartLineToAdd: CartLine,\n actionContext: IActionContext,\n orderQuantityLimitsFeatureIsEnabled: boolean,\n availableQuantity?: number,\n enableStockCheck?: boolean,\n isAddServiceItemToCart?: boolean,\n isMaxByQuantityValidationFeatureDefined?: boolean,\n shouldSkipSiteSettings?: boolean\n): Promise {\n if (shouldSkipSiteSettings) {\n return addProductsToCartWithoutSiteSettings(cart, actionContext, [{ cartLineToAdd }]);\n }\n\n // Using max from the default order settings if it's defined there and quantity limits feature is enabled.\n // Otherwise use max from site settings or default max 10.\n if (isMaxByQuantityValidationFeatureDefined && orderQuantityLimitsFeatureIsEnabled) {\n return addProductsToCartValidateMaxAgainstDefaultOrderSettings(cart, actionContext, [\n { cartLineToAdd, availableQuantity, enableStockCheck, isAddServiceItemToCart }\n ]);\n }\n return addProductsToCartValidateMaxAgainstSiteSettings(cart, actionContext, [\n { cartLineToAdd, availableQuantity, enableStockCheck, isAddServiceItemToCart }\n ]);\n}\n\nexport default addProductToCartInternal;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { addDiscountCodeAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function addPromoCode(\n cart: Readonly,\n promoCode: string,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n if (hasPromoCode(cart, promoCode)) {\n return { cart: undefined, status: 'FAILED', substatus: 'ALREADYADDED' };\n }\n\n return addDiscountCodeAsync({ callerContext: actionContext }, cart.Id, promoCode)\n .then(newCart => {\n // Retail server will still return success if a promo code is not valid,\n // but it won't actually add that promo code. So need to check if promo\n // code is actually in the new cart\n if (hasPromoCode(newCart, promoCode)) {\n return { cart: newCart, status: 'SUCCESS' };\n }\n return { cart: undefined, status: 'FAILED', substatus: 'INVALIDPROMOCODE' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n const resultWithCart: ICartActionResultWithCart = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message }\n };\n\n return resultWithCart;\n });\n}\n\nfunction hasPromoCode(cart: Cart, code: string): boolean {\n const codes = cart.Coupons\n ? cart.Coupons.map((coupon: Coupon) => {\n return coupon.Code!.toLowerCase();\n })\n : [];\n return codes.includes(code.toLowerCase());\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getCatalogId, IActionContext } from '@msdyn365-commerce/core';\nimport {\n Address,\n Cart,\n CartLine,\n ChannelDeliveryOptionConfiguration,\n OrgUnitLocation,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport {\n AttributeValueBase,\n CommerceProperty,\n LineDeliverySpecification,\n ReleasedProductType\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { action, computed, observable } from 'mobx';\n\nimport { GlobalState } from '../global-state/global-state';\nimport { ICartActionResult, ICartState } from '../state-interfaces/i-cart-state';\nimport addInvoicesToCartInternal from './add-invoices-to-cart';\nimport addOrderInvoiceToCartInternal from './add-order-invoice-to-cart';\nimport addProductToCartInternal, { addProductsToCartInternal } from './add-product-to-cart';\nimport addPromoCodeInternal from './add-promo-code';\nimport { ICartActionResultWithCart } from './cart-action-result';\nimport clearCartLineDeliveryModeInternal from './clear-cart-line-delivery-mode';\nimport clearCartLinesDeliveryInformation from './clear-cart-lines-delivery-information';\nimport getOrCreateActiveCart from './get-or-create-active-cart';\nimport refreshCartInternal from './refresh-cart';\nimport removeAllPromoCodesInternal from './remove-all-promo-codes';\nimport removeCartLineInternal from './remove-cart-lines';\nimport removePromoCodesInternal from './remove-promo-codes';\nimport setInvoiceLinePriceInternal from './set-invoice-line-price';\nimport updateCart from './update-cart';\nimport updateCartLineDeliverySpecificationsInternal from './update-cart-line-delivery-specifications';\nimport updateCartLineQuantityInternal from './update-cart-line-quantity';\nimport updateLoyaltyCardIdInternal from './update-loyalty-card-id';\nimport updateReceiptEmail from './update-receipt-email';\nimport updateShippingAddress from './update-shipping-address';\n\n/**\n * Cart state information.\n */\nexport class BaseCartState extends GlobalState implements ICartState {\n @observable protected _cart: Cart;\n\n @computed public get cart(): Readonly {\n return this._cart;\n }\n\n @observable protected _attributeValues: AttributeValueBase[];\n\n @computed public get attributeValues(): AttributeValueBase[] {\n return this._attributeValues;\n }\n\n @observable protected _extensionProperties: CommerceProperty[];\n\n @computed public get extensionProperties(): CommerceProperty[] {\n return this._extensionProperties;\n }\n\n @computed public get totalItemsInCart(): number {\n if (this._cart.CartLines) {\n return this._cart.CartLines.map(cartLine => cartLine.Quantity || 1).reduce((total, num) => total + num, 0);\n }\n\n return 0;\n }\n\n @observable protected _isProductAddedToCart: boolean;\n\n @computed public get isProductAddedToCart(): boolean {\n return this._isProductAddedToCart;\n }\n\n @computed public get isEmpty(): boolean {\n return !(this._cart.CartLines && this._cart.CartLines.length > 0);\n }\n\n @computed public get hasInvoiceLine(): boolean {\n return !!(this._cart.CartLines && this._cart.CartLines.some(cartline => cartline.IsInvoiceLine === true));\n }\n\n constructor(actionContext: IActionContext) {\n super(actionContext);\n this._cart = {};\n this._attributeValues = [];\n this._extensionProperties = [];\n this._isProductAddedToCart = false;\n }\n\n /**\n * Refreshes the cart by getting it from the server.\n *\n * Other actions should keep cart up to date so shouldn't need to call this\n * outside of initialization but still might be scenarios where a manual\n * refresh is needed.\n * @param input - Input.\n * @param input.additionalProperties - Additional properties.\n * @returns - The cart action result.\n */\n @action\n public async refreshCart(input: { additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n const newCart = await refreshCartInternal(this.cart.Id, this.actionContext);\n\n if (newCart) {\n this._cart = newCart;\n\n return { status: 'SUCCESS' };\n }\n\n return { status: 'FAILED' };\n });\n }\n\n /**\n * Adds the specified product to the current cart. If product is already in cart\n * will update its cart line, otherwise will add a new cart line to the cart.\n * @param input - The input.\n * @param input.product - The product to add to the cart.\n * @param input.count - How many copies of the product to add.\n * @param input.location - The org unit location, used for BuyOnlinePickupInStore scenarios\n * (If you want item to simply be shipped, leave this parameter undefined).\n * @param input.additionalProperties - Additional properties.\n * @param input.availableQuantity - Available quantity.\n * @param input.enableStockCheck - Is stock check enabled.\n * @param input.isAddEmailDeliveryItemToCart - Is add email delivery item to cart.\n * @param input.isPriceKeyedIn - Is price keyed in.\n * @param input.customPrice - Custom price.\n * @param input.deliveryMode - Delivery mode.\n * @param input.shouldSkipSiteSettings - Should skip site settings.\n * @param input.catalogId - Should skip site settings.\n * @returns Cart action result.\n */\n @action\n public async addProductToCart(input: {\n product: SimpleProduct;\n count?: number;\n location?: OrgUnitLocation;\n additionalProperties?: object;\n availableQuantity?: number;\n enableStockCheck?: boolean;\n isAddEmailDeliveryItemToCart?: boolean;\n isPriceKeyedIn?: boolean;\n customPrice?: number;\n deliveryMode?: string;\n shouldSkipSiteSettings?: boolean;\n catalogId?: number;\n }): Promise {\n return this._doAsyncAction(async () => {\n const cartLine: CartLine = {\n CatalogId: input.catalogId ?? getCatalogId(this.actionContext.requestContext),\n Description: input.product.Description,\n\n // TODO: Investigate this value and what it represents\n EntryMethodTypeValue: 3,\n ItemId: input.product.ItemId,\n ProductId: input.product.RecordId,\n Quantity: input.count || 1,\n TrackingId: '',\n UnitOfMeasureSymbol: input.product.DefaultUnitOfMeasure,\n IsPriceKeyedIn: input.isPriceKeyedIn,\n IsGiftCardLine: input.product.IsGiftCard,\n Price: input.customPrice ? input.customPrice : input.product.Price\n };\n\n if (input.location) {\n if (!this.actionContext.requestContext.channel) {\n return { status: 'FAILED' };\n }\n\n // If curbside pick is not available use the default one\n if (input.deliveryMode !== undefined) {\n cartLine.DeliveryMode = input.deliveryMode;\n } else {\n cartLine.DeliveryMode = this.actionContext.requestContext.channel.PickupDeliveryModeCode;\n }\n\n cartLine.FulfillmentStoreId = input.location.OrgUnitNumber;\n cartLine.WarehouseId = input.location.InventoryLocationId;\n cartLine.ShippingAddress = this._buildAddressFromOrgUnitLocation(input.location);\n }\n\n if (input.isAddEmailDeliveryItemToCart) {\n if (!this.actionContext.requestContext.channel) {\n return { status: 'FAILED' };\n }\n\n cartLine.DeliveryMode = this.actionContext.requestContext.channel.EmailDeliveryModeCode;\n }\n\n // Check if the product is service or not by product type\n const isAddServiceItemToCart = input.product.ItemTypeValue === ReleasedProductType.Service;\n\n // @ts-expect-error\n const orderQuantityLimitsFeatureIsEnabled: boolean = !!input.additionalProperties?.orderQuantityLimitsFeatureIsEnabled;\n const isMaxByQuantityValidationFeatureDefined: boolean = !!input.product.Behavior?.MaximumQuantity;\n return this._doCartOperationWithRetry(() =>\n addProductToCartInternal(\n this.cart,\n cartLine,\n this.actionContext,\n orderQuantityLimitsFeatureIsEnabled,\n input.availableQuantity,\n input.enableStockCheck,\n isAddServiceItemToCart,\n isMaxByQuantityValidationFeatureDefined,\n input.shouldSkipSiteSettings\n )\n );\n });\n }\n\n /**\n * Adds the specified product to the current cart. If product is already in cart\n * will update its cart line, otherwise will add a new cart line to the cart.\n * @param input - Input.\n * @param input.product - Product.\n * @param input.count - Count.\n * @param input.location - Location.\n * @param input.additionalProperties - Additional properties.\n * @param input.availableQuantity - Available quantity.\n * @param input.enableStockCheck - Enable stock check.\n * @param input.isAddEmailDeliveryItemToCart - Is add email delivery item to cart.\n * @param input.isPriceKeyedIn - Is price keyed in.\n * @param input.customPrice - Custom price.\n * @param input.deliveryMode - Delivery mode.\n * @returns Cart action result.\n */\n @action\n public async addProductsToCart(\n input: {\n product: SimpleProduct;\n count?: number;\n location?: OrgUnitLocation;\n additionalProperties?: object;\n availableQuantity?: number;\n enableStockCheck?: boolean;\n isAddEmailDeliveryItemToCart?: boolean;\n isPriceKeyedIn?: boolean;\n customPrice?: number;\n deliveryMode?: string;\n catalogId?: number;\n }[]\n ): Promise {\n return this._doAsyncAction(async () => {\n const internalInput: {\n cartLineToAdd: CartLine;\n availableQuantity?: number;\n isStockCheckEnabled?: boolean;\n isAddServiceItemToCart?: boolean;\n }[] = [];\n\n for (const inputItem of input) {\n const cartLine: CartLine = {\n CatalogId: inputItem.catalogId ?? getCatalogId(this.actionContext.requestContext),\n Description: inputItem.product.Description,\n\n // TODO: Investigate this value and what it represents\n EntryMethodTypeValue: 3,\n ItemId: inputItem.product.ItemId,\n ProductId: inputItem.product.RecordId,\n Quantity: inputItem.count || 1,\n TrackingId: '',\n UnitOfMeasureSymbol: inputItem.product.DefaultUnitOfMeasure,\n IsPriceKeyedIn: inputItem.isPriceKeyedIn,\n IsGiftCardLine: inputItem.product.IsGiftCard,\n Price: inputItem.customPrice ? inputItem.customPrice : inputItem.product.Price\n };\n\n if (inputItem.location) {\n if (!this.actionContext.requestContext.channel) {\n return { status: 'FAILED' };\n }\n\n // If curbside pick is not available use the default one\n if (inputItem.deliveryMode !== undefined) {\n cartLine.DeliveryMode = inputItem.deliveryMode;\n } else {\n cartLine.DeliveryMode = this.actionContext.requestContext.channel.PickupDeliveryModeCode;\n }\n\n cartLine.FulfillmentStoreId = inputItem.location.OrgUnitNumber;\n cartLine.WarehouseId = inputItem.location.InventoryLocationId;\n cartLine.ShippingAddress = this._buildAddressFromOrgUnitLocation(inputItem.location);\n }\n\n if (inputItem.isAddEmailDeliveryItemToCart) {\n cartLine.DeliveryMode = this.actionContext.requestContext.channel?.EmailDeliveryModeCode;\n }\n\n // Check if the product is service or not by product type\n const PRODUCTASSERVICE = 2 as ReleasedProductType.Service;\n const isAddServiceItemToCart = inputItem.product.ItemTypeValue === PRODUCTASSERVICE;\n\n internalInput.push({\n cartLineToAdd: cartLine,\n availableQuantity: inputItem.availableQuantity,\n isStockCheckEnabled: inputItem.enableStockCheck,\n isAddServiceItemToCart\n });\n }\n\n return this._doCartOperationWithRetry(() => addProductsToCartInternal(this.cart, this.actionContext, internalInput));\n });\n }\n\n /**\n * Adds the specified invoices to the current cart.\n * @param input - The input.\n * @param input.invoiceIds - Invoice Ids.\n * @param input.additionalProperties - Additional properties.\n * @returns Cart action result.\n */\n @action\n public async addInvoicesToCart(input: { invoiceIds: string[]; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => addInvoicesToCartInternal(this.cart, input.invoiceIds, this.actionContext));\n });\n }\n\n /**\n * Adds the specified order invoice to the current cart.\n * @param input - Input.\n * @param input.invoiceId - Invoice id.\n * @param input.lineDescription - Line description.\n * @param input.additionalProperties - Additional properties.\n * @returns Cart action result.\n */\n @action\n public async addOrderInvoiceToCart(input: {\n invoiceId: string;\n lineDescription: string;\n additionalProperties?: object;\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n addOrderInvoiceToCartInternal(this.cart, input.invoiceId, input.lineDescription, this.actionContext)\n );\n });\n }\n\n /**\n * Sets price for the given cart line with an invoice. Used to complete partial invoice payments.\n * @param input - Input for the operation.\n * @param input.cartLineId - The cart line with the invoice for which to update the price.\n * @param input.price - The new value of price of the invoice.\n * @returns The cart action result.\n */\n @action public async setInvoiceLinePrice(input: { cartLineId: string | null; price: number }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(async () =>\n setInvoiceLinePriceInternal(this.cart, input.cartLineId, input.price, this.actionContext)\n );\n });\n }\n\n /**\n * Removes the cart lines with the provided ids from the cart.\n * @param input - Input.\n * @param input.cartLineIds - Cart line ids.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async removeCartLines(input: { cartLineIds: string[]; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => removeCartLineInternal(this.cart, input.cartLineIds, this.actionContext));\n });\n }\n\n /**\n * Clears the pickup location information from the provided cart line,\n * resulting in it getting shipped to the customer.\n * @param input - Input.\n * @param input.cartLineId - Cart line id.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async clearCartLinePickupLocation(input: { cartLineId: string; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => clearCartLineDeliveryModeInternal(this.cart, input.cartLineId, this.actionContext));\n });\n }\n\n /**\n * Clears the delivery mode, and other information for the shipping cart lines.\n * @param input - Input.\n * @param input.additionalProperties - Additional properties.\n * @param input.channelDeliveryOptionConfiguration -- Channel delivery option configuration.\n * @returns The cart action result.\n */\n @action\n public async clearCartLinesDeliveryInformation(input: {\n additionalProperties?: object;\n channelDeliveryOptionConfiguration?: ChannelDeliveryOptionConfiguration;\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n clearCartLinesDeliveryInformation(this.cart, this.actionContext, input.channelDeliveryOptionConfiguration)\n );\n });\n }\n\n /**\n * Marks the provided cart line for pickup in store, with the provided location as\n * the pickup location.\n * @param input - Input.\n * @param input.cartLineId - Cart line id.\n * @param input.location - Location.\n * @param input.additionalProperties - Additional properties.\n * @param input.deliveryMode - Delivery mode.\n * @returns The cart action result.\n */\n @action\n public async updateCartLinePickupLocation(input: {\n cartLineId: string;\n location: OrgUnitLocation;\n additionalProperties?: object;\n deliveryMode?: string;\n }): Promise {\n return this._doAsyncAction(async () => {\n if (!this.actionContext.requestContext.channel) {\n return { status: 'FAILED' };\n }\n\n const cartLineDeliverySpecification = {\n LineId: input.cartLineId,\n DeliverySpecification: {\n DeliveryModeId:\n input.deliveryMode !== undefined\n ? input.deliveryMode\n : this.actionContext.requestContext.channel.PickupDeliveryModeCode,\n DeliveryPreferenceTypeValue: 2, // Pick up in store\n PickUpStoreId: input.location.OrgUnitNumber,\n DeliveryAddress: this._buildAddressFromOrgUnitLocation(input.location)\n }\n };\n\n return this._doCartOperationWithRetry(() =>\n updateCartLineDeliverySpecificationsInternal(this.cart, [cartLineDeliverySpecification], this.actionContext)\n );\n });\n }\n\n /**\n * Updates cart line pick up date.\n * @param input - The cart line.\n * @param input.lineDeliverySpecifications - Line delivery specifications.\n * @returns The cart action result.\n */\n @action\n public async updateCartLinePickupDateTimeslot(input: {\n lineDeliverySpecifications: LineDeliverySpecification[];\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n updateCartLineDeliverySpecificationsInternal(this.cart, input.lineDeliverySpecifications, this.actionContext)\n );\n });\n }\n\n /**\n * Updates the delivery mode for items in the cart with the desired delivery mode, preserving BOPIS status for stuff already marked as BOPIS.\n * @param input - The input.\n * @param input.deliveryModeId - Delivery mode id.\n * @param input.shippingAddress - Shipping address.\n * @param input.additionalProperties - Additional properties.\n * @param input.channelDeliveryOptionConfig - Channel delivery option configuration.\n * @returns The cart action result.\n */\n @action\n public async updateCartDeliverySpecification(input: {\n deliveryModeId: string;\n shippingAddress: Address | undefined;\n additionalProperties?: object;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n }): Promise {\n return this._doAsyncAction(async () => {\n if (input.deliveryModeId.trim() === '') {\n return { status: 'FAILED', substatus: 'EMPTYINPUT' };\n }\n\n const pickupDeliveryModeCode =\n this.actionContext.requestContext.channel && this.actionContext.requestContext.channel.PickupDeliveryModeCode;\n const emailDeliveryModeCode =\n this.actionContext.requestContext.channel && this.actionContext.requestContext.channel.EmailDeliveryModeCode;\n let cartLinesForShipping: CartLine[] = [];\n\n cartLinesForShipping =\n input.channelDeliveryOptionConfig !== undefined\n ? (this.cart.CartLines || []).filter(cartLine =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\n ? cartLine.DeliveryMode !==\n input.channelDeliveryOptionConfig?.PickupDeliveryModeCodes?.find(\n deliveryMode => deliveryMode === cartLine.DeliveryMode\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\n : cartLine\n )\n : (this.cart.CartLines || []).filter(cartLine =>\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\n ? cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\n : cartLine\n );\n\n if (cartLinesForShipping.length > 0) {\n const deliverySpecifications = cartLinesForShipping.map(cartLine => {\n return {\n LineId: cartLine.LineId,\n DeliverySpecification: {\n DeliveryModeId: input.deliveryModeId,\n DeliveryPreferenceTypeValue: 1, // Ship\n DeliveryAddress: input.shippingAddress\n }\n };\n });\n\n return this._doCartOperationWithRetry(() =>\n updateCartLineDeliverySpecificationsInternal(this.cart, deliverySpecifications, this.actionContext)\n );\n }\n\n return { status: 'FAILED', substatus: 'NOCONTENT' };\n });\n }\n\n /**\n * Updates the quantity of the cart line.\n * @param input - The input.\n * @param input.cartLineId - Cart line id.\n * @param input.newQuantity - New quantity.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async updateCartLineQuantity(input: {\n cartLineId: string;\n newQuantity: number;\n additionalProperties?: object;\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n updateCartLineQuantityInternal(\n this.cart,\n input.cartLineId,\n input.newQuantity,\n this.actionContext,\n\n // @ts-expect-error\n input.additionalProperties?.isUsingDefaultOrderSettingsMax\n )\n );\n });\n }\n\n /**\n * Updates the loyalty card ID on the card.\n * @param input - The input.\n * @param input.loyaltyCardNumber - The loyalty card id to use.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async updateLoyaltyCardId(input: {\n loyaltyCardNumber: string | undefined;\n additionalProperties?: object;\n }): Promise {\n if (!input.loyaltyCardNumber) {\n return { status: 'FAILED', substatus: 'EMPTYINPUT' };\n }\n\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() =>\n updateLoyaltyCardIdInternal(this.cart, input.loyaltyCardNumber!, this.actionContext)\n );\n });\n }\n\n /**\n * Adds promo code to the cart.\n * @param input - The input.\n * @param input.promoCode - The promo code to add.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public addPromoCode(input: { promoCode: string; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => addPromoCodeInternal(this.cart, input.promoCode, this.actionContext));\n });\n }\n\n /**\n * Removes promo codes from the cart.\n * @param input - The input.\n * @param input.promoCodes - The promo codes to remove.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public removePromoCodes(input: { promoCodes: string[]; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => removePromoCodesInternal(this.cart, input.promoCodes, this.actionContext));\n });\n }\n\n /**\n * Removes all promo code from the cart.\n * @param input - The input.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public removeAllPromoCodes(input: { additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => removeAllPromoCodesInternal(this.cart, this.actionContext));\n });\n }\n\n /**\n * Updates receipt email.\n * @param input - The input.\n * @param input.newEmail - The receipt email.\n * @param input.additionalProperties - Additional properties.\n * @returns The cart action result.\n */\n @action\n public async updateReceiptEmail(input: { newEmail: string; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => updateReceiptEmail(this.cart, input.newEmail, this.actionContext));\n });\n }\n\n /**\n * Updates shipping address.\n * @param input - The input.\n * @param input.newShippingAddress - The shipping address.\n * @param input.additionalProperties - The additional properties.\n * @returns ICartActionResult.\n */\n @action\n public async updateShippingAddress(input: {\n newShippingAddress: Address;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(async () =>\n updateShippingAddress(this.cart, input.newShippingAddress, this.actionContext)\n );\n });\n }\n\n /**\n * Updates the attribute values.\n * @param input - The input.\n * @param input.newAttributeValues - The new attribute values to update.\n * @param input.additionalProperties - The additional properties.\n * @returns ICartActionResult.\n */\n @action\n public async updateAttributeValues(input: {\n newAttributeValues: AttributeValueBase[];\n additionalProperties?: object;\n }): Promise {\n this._attributeValues = input.newAttributeValues;\n const newCartObject: Cart = {\n Id: this.cart.Id,\n AttributeValues: input.newAttributeValues\n };\n return this.updateCart({ newCartObject });\n }\n\n /**\n * Updates the extension properties.\n * @param input - The input.\n * @param input.newExtensionProperties - The new extension properties.\n * @param input.additionalProperties - The additional properties.\n * @returns ICartActionResult.\n */\n @action\n public async updateExtensionProperties(input: {\n newExtensionProperties: CommerceProperty[];\n additionalProperties?: object;\n }): Promise {\n this._extensionProperties = input.newExtensionProperties;\n const newCartObject: Cart = {\n Id: this.cart.Id,\n ExtensionProperties: input.newExtensionProperties\n };\n return this.updateCart({ newCartObject });\n }\n\n /**\n * Updates cart object.\n * @param input - The input.\n * @param input.newCartObject - The new cart object.\n * @param input.additionalProperties - Additional properties.\n * @returns Promise of cart action result.\n */\n @action\n public async updateCart(input: { newCartObject: Cart; additionalProperties?: object }): Promise {\n return this._doAsyncAction(async () => {\n return this._doCartOperationWithRetry(() => updateCart(this.cart, input.newCartObject, this.actionContext));\n });\n }\n\n /**\n * Initialize function.\n */\n public async initialize(): Promise {\n if (this.isInitialized) {\n return;\n }\n\n const newCart = await getOrCreateActiveCart(this.actionContext);\n\n if (newCart) {\n this._cart = newCart;\n this._status = 'READY';\n } else {\n this._status = 'ERROR';\n }\n\n this.isInitialized = true;\n }\n\n /**\n * Validates inventory across cart lines.\n * @param callback - Callback function.\n * @returns ICartActionResult.\n */\n private async _doCartOperationWithRetry(callback: () => Promise): Promise {\n let callbackResult = await callback();\n\n if (callbackResult.status === 'SUCCESS') {\n if (callbackResult.cart) {\n this._cart = callbackResult.cart;\n }\n } else {\n const refreshCartResult = await this.refreshCart({});\n\n if (refreshCartResult.status === 'SUCCESS') {\n callbackResult = await callback();\n\n if (callbackResult.status === 'SUCCESS') {\n if (callbackResult.cart) {\n this._cart = callbackResult.cart;\n }\n }\n }\n }\n\n if (callbackResult.status === 'SUCCESS' && callbackResult.substatus && callbackResult.substatus === 'PRODUCTADDED') {\n this._isProductAddedToCart = true;\n } else {\n this._isProductAddedToCart = false;\n }\n\n return {\n status: callbackResult.status,\n substatus: callbackResult.substatus,\n errorDetails: callbackResult.errorDetails,\n validationResults: callbackResult.validationResults\n };\n }\n\n /**\n * Build address from org unit location.\n * @param location - The location.\n * @returns Address.\n */\n private _buildAddressFromOrgUnitLocation(location: OrgUnitLocation): Address {\n return {\n RecordId: location.PostalAddressId,\n Name: location.OrgUnitName,\n FullAddress: location.Address,\n Street: location.Street,\n StreetNumber: location.StreetNumber,\n City: location.City,\n DistrictName: location.DistrictName,\n BuildingCompliment: location.BuildingCompliment,\n Postbox: location.Postbox,\n ThreeLetterISORegionName: location.Country,\n ZipCode: location.Zip,\n County: location.County,\n CountyName: location.CountyName,\n State: location.State,\n StateName: location.StateName\n };\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { Cart, CartsDataActions, CommerceException } from '@msdyn365-commerce/retail-proxy';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function addInvoicesToCartInternal(\n cart: Readonly,\n invoiceIds: string[],\n actionContext: IActionContext\n): Promise {\n if (!invoiceIds || invoiceIds.length === 0) {\n actionContext.telemetry.trace('Invoice ids are empty, unable to add invoices to cart.');\n return { cart, status: 'FAILED', substatus: 'EMPTYINPUT' };\n }\n\n if (cart.Version) {\n return CartsDataActions.addInvoicesAsync({ callerContext: actionContext }, cart.Id, invoiceIds)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.trace(error);\n actionContext.telemetry.trace('Unable to add invoices to cart');\n\n // Error object comes from API and doesn't have type definitions yet.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- No type definition for error.\n const errorDetails: CommerceException = error.data;\n const errorResult: ICartActionResultWithCart = { cart: undefined, status: 'FAILED', errorDetails };\n return errorResult;\n });\n }\n actionContext.telemetry.warning('Unable to add invoices, Cart Version could not be found');\n\n return { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { addOrderInvoiceAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function addOrderInvoiceToCartInternal(\n cart: Readonly,\n invoiceId: string,\n lineDescription: string,\n actionContext: IActionContext\n): Promise {\n if (!invoiceId || invoiceId === '') {\n actionContext.telemetry.trace('Invoice id is empty, unable to add invoice to cart.');\n return { cart, status: 'FAILED', substatus: 'EMPTYINPUT' };\n }\n\n if (cart.Version) {\n return addOrderInvoiceAsync({ callerContext: actionContext }, cart.Id, invoiceId, lineDescription)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.trace(error);\n actionContext.telemetry.trace('Unable to add order invoice to cart');\n\n const resultWithCart: ICartActionResultWithCart = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message }\n };\n\n return resultWithCart;\n });\n }\n actionContext.telemetry.warning('Unable to add order invoice, Cart Version could not be found');\n\n return { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { updateAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateReceiptEmail(\n cart: Readonly,\n email: string,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return updateAsync(\n { callerContext: actionContext },\n {\n Id: cart.Id,\n ReceiptEmail: email\n }\n )\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to add receipt email to the cart');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { updateCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function clearCartLineDeliveryMode(\n cart: Readonly,\n cartLineId: string,\n actionContext: IActionContext\n): Promise {\n if (!cart || !cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const matchingLines = cart.CartLines.filter(cartLine => cartLine.LineId === cartLineId);\n\n if (matchingLines.length === 0) {\n return { cart: undefined, status: 'FAILED', substatus: 'NOMATCHEDCARTLINE' };\n }\n\n const copyCartLine: CartLine = { ...matchingLines[0] };\n\n copyCartLine.DeliveryMode = '';\n copyCartLine.FulfillmentStoreId = '';\n copyCartLine.ShippingAddress = {};\n copyCartLine.WarehouseId = cart.WarehouseId;\n\n return updateCartLinesAsync({ callerContext: actionContext }, cart.Id, [copyCartLine], null)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Update Cart Line');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { updateCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, CartLine, ChannelDeliveryOptionConfiguration } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { cloneDeep } from 'lodash';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function clearCartLinesDeliveryInformation(\n cart: Readonly,\n actionContext: IActionContext,\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration\n): Promise {\n if (!cart || !cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n let matchingLines: CartLine[] = [];\n const pickupDeliveryModeCode =\n actionContext && actionContext.requestContext && actionContext.requestContext.channel?.PickupDeliveryModeCode;\n const emailDeliveryModeCode =\n actionContext && actionContext.requestContext && actionContext.requestContext.channel?.EmailDeliveryModeCode;\n if (channelDeliveryOptionConfig !== undefined) {\n matchingLines = cart.CartLines.filter(\n cartLine =>\n cartLine.DeliveryMode &&\n cartLine.DeliveryMode !== channelDeliveryOptionConfig.PickupDeliveryModeCodes?.find(dM => dM === cartLine.DeliveryMode) &&\n cartLine.DeliveryMode !== emailDeliveryModeCode &&\n cartLine.LineId\n );\n } else {\n matchingLines = cart.CartLines.filter(\n cartLine =>\n cartLine.DeliveryMode &&\n cartLine.DeliveryMode !== pickupDeliveryModeCode &&\n cartLine.DeliveryMode !== emailDeliveryModeCode &&\n cartLine.LineId\n );\n }\n\n // If there are no lines needing updates, just return success\n if (matchingLines.length === 0) {\n return { cart, status: 'SUCCESS' };\n }\n\n const copiedLines: CartLine[] = cloneDeep(matchingLines);\n\n copiedLines.forEach(line => {\n line.DeliveryMode = '';\n line.FulfillmentStoreId = '';\n line.ShippingAddress = {};\n });\n\n return updateCartLinesAsync({ callerContext: actionContext }, cart.Id, copiedLines, null)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch((error: string) => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Update Cart Lines');\n\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error } };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { FeatureState } from '@msdyn365-commerce/retail-proxy';\nimport {\n addCartLinesAsync,\n addCouponsAsync,\n createCartAsync,\n readAsync,\n removeCartLinesAsync,\n searchAsync,\n updateAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport {\n getChannelDeliveryOptionConfigurationAsync,\n getCustomerLoyaltyCardsAsync,\n getFeatureStatesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n Cart,\n CartLine,\n CartSearchCriteria,\n Coupon,\n QueryResultSettings\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport isEmpty from 'lodash/isEmpty';\n\nenum CartTokenPrefix {\n Auth = 't',\n Anon = 'p'\n}\n\nexport default async function getOrCreateActiveCart(ctx: IActionContext): Promise {\n let cart: Cart | undefined;\n const cartCookie: string = ctx.requestContext.cookies.getCartCookie();\n const cartCookieParts: string[] = cartCookie.split(':');\n try {\n // Check if there are already is a cart cookie and it is in the format we understand\n cart = await getCartFromCookie(cartCookieParts, ctx);\n const wasReadFromCookie = !!cart && cart.Id;\n\n // If the customer is authenticated, and the auth cookie didn't give us a cart OR doesn't have a cookie, search for the customer's cart\n if (!(cart && cart.Id)) {\n cart = await getCartFromCustomer(ctx);\n }\n\n // If the customer just went from anon to signed in state then get that anon cart\n // if the search of carts didn't result in a cart, claim the current anon cart as a new auth cart for the customer\n // if the search resulted in a cart, and the read also resulted in cart, then go ahead an merge the carts\n const anonCart = await claimAnonCart(cartCookieParts, cart, ctx);\n if (anonCart) {\n cart = anonCart;\n }\n\n // If there is no cookie or everything else fails, create an empty cart and return that for the customer\n if (!(cart && cart.Id)) {\n cart = await createNewCart(ctx);\n }\n if (!wasReadFromCookie && ctx.requestContext.user.isAuthenticated && cart && !cart.LoyaltyCardId) {\n const card = await getCustomerLoyaltyCardsAsync({ callerContext: ctx, queryResultSettings: {} }, null);\n if (card && card.length > 0) {\n cart = await updateAsync(\n { callerContext: ctx },\n {\n Id: cart.Id,\n LoyaltyCardId: card[0].CardNumber\n }\n );\n }\n }\n } catch (error) {\n ctx.telemetry.error(`Caught exception in getting cart: ${error}`);\n cart = await createNewCart(ctx);\n }\n return cart;\n}\n\nexport async function createNewCart(ctx: IActionContext): Promise {\n const newCart = await createCartAsync({ callerContext: ctx }, {});\n if (newCart && newCart.Id) {\n ctx.requestContext.cookies.setCartCookie(newCart, ctx.requestContext.user.isAuthenticated);\n\n return newCart;\n }\n\n return undefined;\n}\n\nexport async function getCartFromCookie(cartCookieParts: string[], ctx: IActionContext): Promise {\n if (cartCookieParts && cartCookieParts.length === 2) {\n // If the customer is authenticated and they have an auth cookie\n // OR if the customer is not authenticated and then have an anon cookie\n // just get the cart and return that\n\n if (\n (ctx.requestContext.user.isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Auth) ||\n (!ctx.requestContext.user.isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Anon)\n ) {\n const readCart = await readAsync({ callerContext: ctx, bypassCache: 'none' }, cartCookieParts[1]);\n\n if (readCart && readCart.Id) {\n ctx.requestContext.cookies.setCartCookie(readCart, ctx.requestContext.user.isAuthenticated);\n return readCart;\n }\n }\n }\n\n return undefined;\n}\n\nexport async function getCartFromCustomer(ctx: IActionContext): Promise {\n if (ctx.requestContext.user.isAuthenticated) {\n const authCarts = await searchCarts(ctx);\n if (authCarts && authCarts.length > 0) {\n ctx.requestContext.cookies.setCartCookie(authCarts[0], ctx.requestContext.user.isAuthenticated);\n return authCarts[0];\n }\n }\n\n return undefined;\n}\n\nexport async function claimAnonCart(\n cartCookieParts: string[],\n currentCart: Cart | undefined,\n ctx: IActionContext\n): Promise {\n if (\n ctx.requestContext.user.isAuthenticated &&\n cartCookieParts &&\n cartCookieParts.length === 2 &&\n cartCookieParts[0] === CartTokenPrefix.Anon\n ) {\n const anonCurrentCart = await readAsync({ callerContext: ctx, bypassCache: 'none' }, cartCookieParts[1]);\n\n if (anonCurrentCart && !currentCart) {\n const newCart = await claimCart(anonCurrentCart.Id, ctx);\n if (newCart && newCart.Id) {\n ctx.requestContext.cookies.setCartCookie(newCart, ctx.requestContext.user.isAuthenticated);\n return newCart;\n }\n }\n\n if (anonCurrentCart && anonCurrentCart.Id && currentCart) {\n const mergedCart = await addCartLines(anonCurrentCart, currentCart, ctx);\n\n // Once updated, take that merged cart ID and store the cart ID in the cookie\n if (!(mergedCart instanceof Error) && mergedCart.Id) {\n ctx.requestContext.cookies.setCartCookie(mergedCart, ctx.requestContext.user.isAuthenticated);\n return mergedCart;\n }\n }\n }\n\n return undefined;\n}\n\n/**\n * Function that copies a cartline for giftcard.\n * @param cartline Source CartLine you want to copy.\n */\nfunction buildGiftCardLine(cartline: CartLine): CartLine {\n return {\n DeliveryMode: cartline.DeliveryMode,\n CatalogId: cartline.CatalogId,\n Description: cartline.Description,\n EntryMethodTypeValue: cartline.EntryMethodTypeValue || 3,\n ItemId: cartline.ItemId,\n ProductId: cartline.ProductId,\n Quantity: cartline.Quantity,\n Price: cartline.Price,\n NetPrice: cartline.NetPrice,\n GiftCardBalance: cartline.GiftCardBalance,\n TrackingId: '',\n UnitOfMeasureSymbol: cartline.UnitOfMeasureSymbol,\n IsPriceKeyedIn: true,\n IsGiftCardLine: true,\n ExtensionProperties: cartline.ExtensionProperties\n };\n}\n\n/**\n * Function that adds cart lines from source cart to destination cart.\n * @param sourceCart Source cart you want to add cart lines from.\n * @param destinationCart Destination cart that you want to add cart lines to.\n * @param ctx Request context.\n */\nexport async function addCartLines(sourceCart: Cart, destinationCart: Cart, ctx: IActionContext): Promise {\n let updatedCart;\n const cartLines: CartLine[] = [];\n const cartLinesToDelete: string[] = [];\n let hasShippingMethod: boolean;\n const channelConfiguration = ctx.requestContext.channel;\n const featureNames: string[] = [\n 'Dynamics.AX.Application.RetailB2BEcommerceFeature',\n 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature',\n 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n ];\n if (destinationCart.Version) {\n if (sourceCart.CartLines && sourceCart.CartLines.length > 0) {\n for (const cartline of sourceCart.CartLines) {\n let newCartLine: CartLine;\n\n if (cartline.IsGiftCardLine) {\n newCartLine = buildGiftCardLine(cartline);\n } else {\n newCartLine = {};\n const featureStates = await getFeatureStatesAsync({ callerContext: ctx }, featureNames);\n const isfeatureStatesEnabled =\n featureStates?.find(\n (featureState: FeatureState) =>\n featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\n )?.IsEnabled || false;\n if (isfeatureStatesEnabled) {\n const channelDeliveryOptionConfig = await getChannelDeliveryOptionConfigurationAsync({ callerContext: ctx });\n hasShippingMethod =\n cartline.DeliveryMode ===\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.find(\n (deliveryMode: string) => deliveryMode === cartline.DeliveryMode\n );\n\n if (cartline.DeliveryMode !== undefined && hasShippingMethod) {\n newCartLine.DeliveryMode = cartline.DeliveryMode;\n newCartLine.FulfillmentStoreId = cartline.FulfillmentStoreId;\n newCartLine.ShippingAddress = cartline.ShippingAddress;\n newCartLine.WarehouseId = cartline.WarehouseId;\n }\n } else if (!isEmpty(cartline.DeliveryMode) && cartline.DeliveryMode === channelConfiguration?.PickupDeliveryModeCode) {\n newCartLine.DeliveryMode = channelConfiguration?.PickupDeliveryModeCode;\n newCartLine.FulfillmentStoreId = cartline.FulfillmentStoreId;\n newCartLine.ShippingAddress = cartline.ShippingAddress;\n newCartLine.WarehouseId = cartline.WarehouseId;\n }\n newCartLine.ProductId = cartline.ProductId;\n newCartLine.Quantity = cartline.Quantity;\n newCartLine.ExtensionProperties = cartline.ExtensionProperties;\n newCartLine.Description = cartline.Description;\n newCartLine.ReasonCodeLines = cartline.ReasonCodeLines;\n newCartLine.AttributeValues = cartline.AttributeValues;\n newCartLine.CatalogId = cartline.CatalogId;\n if (cartline.IsPriceKeyedIn) {\n newCartLine.Price = cartline.Price;\n newCartLine.IsPriceKeyedIn = cartline.IsPriceKeyedIn;\n }\n }\n\n cartLines.push({ ...newCartLine });\n if (cartline.LineId) {\n cartLinesToDelete.push(cartline.LineId);\n }\n }\n }\n\n if (cartLines.length > 0) {\n try {\n updatedCart = await addCartLinesAsync({ callerContext: ctx }, destinationCart.Id, cartLines, destinationCart.Version);\n\n if (cartLinesToDelete.length > 0) {\n sourceCart = await removeCartLinesAsync({ callerContext: ctx }, sourceCart.Id, cartLinesToDelete);\n }\n } catch (error) {\n ctx.telemetry.error('Error adding cart lines to desination cart');\n ctx.telemetry.exception(error);\n return destinationCart;\n }\n }\n\n // Copy over coupon codes from source cart to destination cart so that the customer doesn't lose couponCodes while migration\n if (sourceCart.Coupons && sourceCart.Coupons.length > 0) {\n const coupons = sourceCart.Coupons.map((coupon: Coupon) => {\n return coupon.Code!;\n });\n\n try {\n updatedCart = await addCouponsAsync({ callerContext: ctx }, destinationCart.Id, coupons, false);\n } catch (error) {\n ctx.telemetry.error('Error adding existing coupon codes to the cart');\n ctx.telemetry.exception(error);\n return destinationCart;\n }\n }\n }\n\n return updatedCart || destinationCart;\n}\n\n/**\n * Function to claim a cart as auth cart and set the browser cookie accordingly.\n *\n * @param cartId Cart Id to claim as auth cart.\n * @param ctx Request Context.\n */\nexport async function claimCart(cartId: string, ctx: IActionContext): Promise {\n const claimAuthCart = await updateAsync(\n { callerContext: ctx },\n {\n Id: cartId\n }\n );\n if (!(claimAuthCart instanceof Error) && claimAuthCart && claimAuthCart.Id) {\n return claimAuthCart;\n }\n return {};\n}\n\n/**\n * Function to search carts that belong to a customer.\n *\n * @param ctx Request context.\n */\nexport async function searchCarts(ctx: IActionContext): Promise {\n const cartSearchCriteria: CartSearchCriteria = {\n IncludeAnonymous: false,\n CartTypeValue: 1\n };\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: 1,\n Skip: 0\n },\n Sorting: {\n Columns: [\n {\n ColumnName: 'ModifiedDateTime',\n IsDescending: true\n }\n ]\n }\n };\n\n return searchAsync({ callerContext: ctx, queryResultSettings }, cartSearchCriteria);\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nexport default async function refreshCart(cartId: string, ctx: IActionContext): Promise {\n return readAsync({ callerContext: ctx, bypassCache: 'get' }, cartId)\n .then(cart => {\n return cart;\n })\n .catch(error => {\n return undefined;\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { removeDiscountCodesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function removeAllPromoCodes(\n cart: Readonly,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n if (cart.Coupons && cart.Coupons.length > 0) {\n const promoCodes = cart.Coupons.map(coupon => {\n return coupon.Code || '';\n });\n\n return removeDiscountCodesAsync({ callerContext: actionContext }, cart.Id, promoCodes)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n }\n\n return { cart, status: 'SUCCESS' };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { removeCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function removeCartLinesInternal(\n cart: Readonly,\n cartLineIds: string[],\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return removeCartLinesAsync({ callerContext: actionContext }, cart.Id, cartLineIds)\n .then(newCart => {\n // This is because of a TSProxy typing error\n const returnedCart = Array.isArray(newCart) ? newCart[0] : newCart;\n\n return { cart: returnedCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Remove Cart Line');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { removeDiscountCodesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function removePromoCodes(\n cart: Readonly,\n promoCodes: string[],\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return removeDiscountCodesAsync({ callerContext: actionContext }, cart.Id, promoCodes)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { Cart, CartsDataActions } from '@msdyn365-commerce/retail-proxy';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\n/**\n * Sets price for the given cart line with an invoice. Used to complete partial invoice payments.\n * @param cart - Cart where the invoice is located.\n * @param cartLineId - The cart line with the invoice for which to update the price.\n * @param price - The new value of price of the invoice.\n * @param actionContext - The action context from SDK.\n * @returns Result of the operation with the details.\n */\nexport async function setInvoiceLinePriceInternal(\n cart: Readonly,\n cartLineId: string | null,\n price: number,\n actionContext: IActionContext\n): Promise {\n if (!cart.Version) {\n actionContext.telemetry.warning('Unable to set invoice line price, Cart Version could not be found');\n return { cart: undefined, status: 'FAILED', substatus: 'NOCARTVERSION' };\n }\n\n try {\n const newCart = await CartsDataActions.setInvoiceLinePriceAsync(\n { callerContext: actionContext },\n cart.Id,\n cartLineId,\n price,\n cart.Version\n );\n return { cart: newCart, status: 'SUCCESS' };\n } catch (error) {\n const errorInstance = error as Error;\n actionContext.telemetry.trace(error as string);\n actionContext.telemetry.trace('Unable to set invoice line price');\n\n return {\n cart: undefined,\n status: 'FAILED',\n errorDetails: { LocalizedMessage: errorInstance.message }\n };\n }\n}\n\nexport default setInvoiceLinePriceInternal;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { updateLineDeliverySpecificationsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, LineDeliverySpecification } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateCartLineDeliverySpecificationsInternal(\n cart: Readonly,\n cartLineDeliverySpecifications: LineDeliverySpecification[],\n actionContext: IActionContext\n): Promise {\n if (!cart || !cart.CartLines || cartLineDeliverySpecifications.length === 0) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return updateLineDeliverySpecificationsAsync({ callerContext: actionContext }, cart.Id, cartLineDeliverySpecifications)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to updateLineDeliverySpecificationsAsync');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { updateCartLinesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateCartLineQuantityInternal(\n cart: Readonly,\n cartLineId: string,\n newQuantity: number,\n actionContext: IActionContext,\n isUsingDefaultOrderSettingsMax: boolean\n): Promise {\n if (isUsingDefaultOrderSettingsMax) {\n return updateCartLineQuantityValidateMaxAgainstDefaultOrderSettings(cart, cartLineId, newQuantity, actionContext);\n }\n return updateCartLineQuantityValidateMaxAgainstSiteSettings(cart, cartLineId, newQuantity, actionContext);\n}\nasync function updateCartLineQuantityValidateMaxAgainstDefaultOrderSettings(\n cart: Readonly,\n cartLineId: string,\n newQuantity: number,\n actionContext: IActionContext\n): Promise {\n if (!cart || !cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const matchingLines = cart.CartLines.filter(cartLine => cartLine.LineId === cartLineId);\n\n if (matchingLines.length === 0) {\n return { cart: undefined, status: 'FAILED', substatus: 'NOMATCHEDCARTLINE' };\n }\n\n const copyCartLine: CartLine = { ...matchingLines[0] };\n\n copyCartLine.Quantity = newQuantity;\n\n return updateCartLinesAsync({ callerContext: actionContext }, cart.Id, [copyCartLine], null)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n let cartActionResult: ICartActionResultWithCart;\n\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Update Cart Line');\n if (\n error.name === 'Microsoft_Dynamics_Commerce_Runtime_AddingItem_ExceedsMaximumQuantity' ||\n error.name === 'Microsoft_Dynamics_Commerce_Runtime_UpdatingItem_ExceedsMaximumQuantity'\n ) {\n cartActionResult = {\n cart: undefined,\n status: 'FAILED',\n substatus: 'QUANTITYLIMITS',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n return cartActionResult;\n }\n\n cartActionResult = {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n return cartActionResult;\n });\n}\n\nasync function updateCartLineQuantityValidateMaxAgainstSiteSettings(\n cart: Readonly,\n cartLineId: string,\n newQuantity: number,\n actionContext: IActionContext\n): Promise {\n if (!cart || !cart.CartLines) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n const matchingLines = cart.CartLines.filter(cartLine => cartLine.LineId === cartLineId);\n\n if (matchingLines.length === 0) {\n return { cart: undefined, status: 'FAILED', substatus: 'NOMATCHEDCARTLINE' };\n }\n\n const copyCartLine: CartLine = { ...matchingLines[0] };\n copyCartLine.Quantity = Math.min(newQuantity, actionContext.requestContext.app.config.maxQuantityForCartLineItem || 10);\n\n return updateCartLinesAsync({ callerContext: actionContext }, cart.Id, [copyCartLine], null)\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to Update Cart Line');\n return {\n cart: undefined,\n status: 'FAILED',\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n errorDetails: { LocalizedMessage: error.message },\n validationResults: error.data?.ValidationResults\n };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { updateAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateCart(\n cart: Readonly,\n updatedCartObject: Cart,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return updateAsync({ callerContext: actionContext }, { ...updatedCartObject, Id: cart.Id })\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to update the cart');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { updateAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { Cart } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\nexport default async function updateLoyaltyCardId(\n cart: Readonly,\n newLoyaltyCardId: string,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return updateAsync(\n { callerContext: actionContext },\n {\n Id: cart.Id,\n LoyaltyCardId: newLoyaltyCardId\n }\n )\n .then(newCart => {\n return { cart: newCart, status: 'SUCCESS' };\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to update loyalty card id');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { Address, Cart, CartsDataActions } from '@msdyn365-commerce/retail-proxy';\n\nimport { ICartActionResultWithCart } from './cart-action-result';\n\n/**\n * Update shipping address in cart.\n * @param cart - The cart object.\n * @param shippingAddress - The new shipping address.\n * @param actionContext - The action context.\n * @returns The updated cart with new shipping address.\n */\nexport async function updateShippingAddress(\n cart: Readonly,\n shippingAddress: Address,\n actionContext: IActionContext\n): Promise {\n if (!cart) {\n return { cart: undefined, status: 'FAILED', substatus: 'EMPTYCART' };\n }\n\n return CartsDataActions.updateAsync(\n { callerContext: actionContext },\n {\n Id: cart.Id,\n ShippingAddress: shippingAddress\n }\n )\n .then(newCart => {\n const result: ICartActionResultWithCart = { cart: newCart, status: 'SUCCESS' };\n return result;\n })\n .catch(error => {\n actionContext.telemetry.warning(error);\n actionContext.telemetry.debug('Unable to update shipping address to the cart');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- existing error type.\n return { cart: undefined, status: 'FAILED', errorDetails: { LocalizedMessage: error.message } };\n });\n}\n\nexport default updateShippingAddress;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { BaseCartState } from '../cart-state/base-cart-state';\nimport getCheckoutCart, { GetCheckoutCartInput } from '../data-actions/get-checkout-cart';\n\n/**\n * Version of BaseCartState that uses the checkout cart.\n */\nexport class BaseCheckoutCartState extends BaseCartState {\n public async initialize(): Promise {\n if (this.isInitialized) {\n return;\n }\n\n const newCart = await getCheckoutCart(new GetCheckoutCartInput(this.actionContext.requestContext.apiSettings), this.actionContext);\n\n if (newCart) {\n this._cart = newCart;\n this._status = 'READY';\n } else {\n this._status = 'ERROR';\n }\n\n this.isInitialized = true;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport enum CheckoutStorageKey {\n BillingAddress = 'BillingAddress',\n GiftCard = 'GiftCard',\n LoyaltyCardNumber = 'LoyaltyCardNumber',\n LoyaltyAmount = 'LoyaltyAmount',\n TermsAndCondition = 'TermsAndCondition',\n CheckoutGenericData = 'Checkout-Generic-Data',\n PaymentTenderType = 'PaymentTenderType',\n RedirectPaymentConnectorId = 'RedirectPaymentConnectorId',\n IsExpressCheckoutApplied = 'IsExpressCheckoutApplied'\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport {\n Address,\n AttributeValueBase,\n CardPaymentAcceptResult,\n CommerceProperty,\n GiftCard,\n SalesOrder,\n SimpleProduct,\n TenderLine,\n TokenizedPaymentCard\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport get from 'lodash/get';\nimport { action, computed, observable } from 'mobx';\n\nimport { GlobalState } from '../global-state/global-state';\nimport { CheckoutModule } from '../state-interfaces';\nimport { ICartState } from '../state-interfaces/i-cart-state';\nimport {\n ICheckoutActionResult,\n ICheckoutGenericData,\n ICheckoutState,\n IGiftCardExtend,\n ICheckoutError\n} from '../state-interfaces/i-checkout-state';\nimport { BaseCheckoutCartState } from './base-checkout-cart-state';\nimport { CheckoutStorageKey } from './checkout-state-storage';\n\n/**\n * State information related to what is needed to succesfully perform a checkout.\n */\nexport class BaseCheckoutState extends GlobalState implements ICheckoutState {\n @observable protected _checkoutCart: ICartState;\n\n @computed public get checkoutCart(): ICartState {\n return this._checkoutCart;\n }\n\n @observable protected _salesOrder?: SalesOrder;\n\n @computed public get salesOrder(): Readonly {\n return this._salesOrder;\n }\n\n @observable protected _attributeValues: AttributeValueBase[];\n\n @computed public get attributeValues(): Readonly {\n return this._attributeValues;\n }\n\n @observable protected _extensionProperties: CommerceProperty[];\n\n @computed public get extensionProperties(): Readonly {\n return this._extensionProperties;\n }\n\n @observable protected _orderedProducts?: SimpleProduct[];\n\n @computed public get orderedProducts(): Readonly {\n return this._orderedProducts;\n }\n\n @observable protected _tokenizedPaymentCard?: TokenizedPaymentCard;\n\n @computed public get tokenizedPaymentCard(): Readonly {\n return this._tokenizedPaymentCard;\n }\n\n @observable protected _tenderLine?: TenderLine;\n\n @computed public get tenderLine(): Readonly {\n return this._tenderLine;\n }\n\n @observable protected _billingAddress?: Address;\n\n @computed public get billingAddress(): Readonly
{\n return this._billingAddress;\n }\n\n @observable protected _isBillingAddressSameAsShippingAddress?: boolean;\n\n @computed public get isBillingAddressSameAsShippingAddress(): Readonly {\n return this._isBillingAddressSameAsShippingAddress;\n }\n\n @observable protected _shippingAddress?: Address;\n\n @computed public get shippingAddress(): Readonly
{\n return this._shippingAddress;\n }\n\n @observable protected _hasShippingAddress?: boolean;\n\n @computed public get hasShippingAddress(): Readonly {\n return this._hasShippingAddress;\n }\n\n @observable protected _hasCartDeliveryMode?: boolean;\n\n @computed public get hasCartDeliveryMode(): Readonly {\n return this._hasCartDeliveryMode;\n }\n\n @observable protected _cardPrefix?: string;\n\n @computed public get cardPrefix(): Readonly {\n return this._cardPrefix;\n }\n\n @observable protected _paymentTenderType?: string;\n\n @computed public get paymentTenderType(): Readonly {\n return this._paymentTenderType;\n }\n\n /**\n * @deprecated Use giftCardExtends method.\n */\n @computed public get giftCards(): Readonly {\n return this.giftCardExtends;\n }\n\n @observable protected _giftCardExtends: IGiftCardExtend[] = [];\n\n @computed public get giftCardExtends(): Readonly {\n return this._giftCardExtends;\n }\n\n @observable protected _loyaltyCardNumber?: string;\n\n @computed public get loyaltyCardNumber(): Readonly {\n return this._loyaltyCardNumber;\n }\n\n @observable protected _loyaltyAmount: number = 0;\n\n @computed public get loyaltyAmount(): Readonly {\n return this._loyaltyAmount;\n }\n\n @observable protected _guestCheckoutEmail: string = '';\n\n @computed public get guestCheckoutEmail(): Readonly {\n return this._guestCheckoutEmail;\n }\n\n @observable protected _hasGuestCheckoutEmail?: boolean;\n\n @computed public get hasGuestCheckoutEmail(): Readonly {\n return this._hasGuestCheckoutEmail;\n }\n\n @observable protected _isTermsAndConditionAccepted?: boolean;\n\n @computed public get isTermsAndConditionAccepted(): Readonly {\n return this._isTermsAndConditionAccepted;\n }\n\n @observable protected _isTermsAndConditionChecked?: boolean;\n\n @computed public get isTermsAndConditionChecked(): Readonly {\n return this._isTermsAndConditionChecked;\n }\n\n @observable protected _shouldEnableSinglePaymentAuthorizationCheckout?: boolean;\n\n @computed public get shouldEnableSinglePaymentAuthorizationCheckout(): Readonly {\n return this._shouldEnableSinglePaymentAuthorizationCheckout;\n }\n\n @observable protected _shouldEnableCheckoutErrorDisplayMessaging?: boolean;\n\n @computed public get shouldEnableCheckoutErrorDisplayMessaging(): Readonly {\n return this._shouldEnableCheckoutErrorDisplayMessaging;\n }\n\n @observable protected _shouldCollapsePaymentSection?: boolean;\n\n @computed public get shouldCollapsePaymentSection(): Readonly {\n return this._shouldCollapsePaymentSection;\n }\n\n @observable protected _shouldTriggerPaymentWithPlaceOrder?: boolean;\n\n @computed public get shouldTriggerPaymentWithPlaceOrder(): Readonly {\n return this._shouldTriggerPaymentWithPlaceOrder;\n }\n\n @observable protected _isPaymentSectionContainerReady?: boolean;\n\n @computed public get isPaymentSectionContainerReady(): Readonly {\n return this._isPaymentSectionContainerReady;\n }\n\n @observable protected _cardPaymentAcceptResult?: CardPaymentAcceptResult;\n\n @computed public get cardPaymentAcceptResult(): Readonly {\n return this._cardPaymentAcceptResult;\n }\n\n @observable protected _isPaymentSectionContainerHasError?: boolean;\n\n @computed public get isPaymentSectionContainerHasError(): Readonly {\n return this._isPaymentSectionContainerHasError;\n }\n\n @observable protected _redirectAdditionalContext?: string;\n\n @computed public get redirectAdditionalContext(): Readonly {\n return this._redirectAdditionalContext;\n }\n\n @observable protected _redirectPaymentConnectorId?: string;\n\n @computed public get redirectPaymentConnectorId(): Readonly {\n return this._redirectPaymentConnectorId;\n }\n\n @observable protected _checkoutErrorPaymentConnectorId?: string;\n\n @computed public get checkoutErrorPaymentConnectorId(): Readonly {\n return this._checkoutErrorPaymentConnectorId;\n }\n\n @observable protected _isPlaceOrderEnabledInRedirection?: boolean;\n\n @computed public get isPlaceOrderEnabledInRedirection(): Readonly {\n return this._isPlaceOrderEnabledInRedirection;\n }\n\n @observable protected _isPaymentVerificationRequired?: boolean;\n\n @computed public get isPaymentVerificationRequired(): Readonly {\n return this._isPaymentVerificationRequired;\n }\n\n @observable protected _isCheckoutCallFailed?: boolean;\n\n @computed public get isCheckoutCallFailed(): Readonly {\n return this._isCheckoutCallFailed;\n }\n\n @observable protected _customerAccountAmount: number = 0;\n\n @computed public get customerAccountAmount(): Readonly {\n return this._customerAccountAmount;\n }\n\n @observable protected _shouldEnableExpressCheckoutInCheckout?: boolean;\n\n @computed public get shouldEnableExpressCheckoutInCheckout(): Readonly {\n return this._shouldEnableExpressCheckoutInCheckout;\n }\n\n @observable protected _shouldEnableExpressCheckoutInCart?: boolean;\n\n @computed public get shouldEnableExpressCheckoutInCart(): Readonly {\n return this._shouldEnableExpressCheckoutInCart;\n }\n\n @observable protected _shippingAddressFromExpressCheckout?: Address;\n\n @computed public get shippingAddressFromExpressCheckout(): Readonly
{\n return this._shippingAddressFromExpressCheckout;\n }\n\n @observable protected _emailAddressFromExpressCheckout: string = '';\n\n @computed public get emailAddressFromExpressCheckout(): Readonly {\n return this._emailAddressFromExpressCheckout;\n }\n\n @observable protected _billingAddressFromExpressCheckout?: Address;\n\n @computed public get billingAddressFromExpressCheckout(): Readonly
{\n return this._billingAddressFromExpressCheckout;\n }\n\n @observable protected _isExpressCheckoutApplied?: boolean;\n\n @computed public get isExpressCheckoutApplied(): Readonly {\n return this._isExpressCheckoutApplied;\n }\n\n @observable protected _isExpressAddressApplied?: boolean;\n\n @computed public get isExpressAddressApplied(): Readonly {\n return this._isExpressAddressApplied;\n }\n\n @observable protected _isExpressCheckoutAppliedInCartPage?: boolean;\n\n @computed public get isExpressCheckoutAppliedInCartPage(): Readonly {\n return this._isExpressCheckoutAppliedInCartPage;\n }\n\n @observable protected _isExpressPaymentModulesReady?: CommerceProperty[];\n\n @computed public get isExpressPaymentModulesReady(): Readonly {\n return this._isExpressPaymentModulesReady;\n }\n\n @computed public get isPaymentVerificationRedirection(): Readonly {\n const { requestFormData, query } = this.actionContext.requestContext;\n return !!(query && query.pv === '1' && (requestFormData || query.redirectResult));\n }\n\n @observable protected _checkoutError?: ICheckoutError;\n\n @computed public get checkoutError(): Readonly {\n return this._checkoutError;\n }\n\n @observable protected _isBillingAddressHasError?: boolean;\n\n @computed public get isBillingAddressHasError(): Readonly {\n return this._isBillingAddressHasError;\n }\n\n @observable protected _checkoutErrorFocus?: CheckoutModule;\n\n @computed public get checkoutErrorFocus(): Readonly {\n return this._checkoutErrorFocus;\n }\n\n @observable protected _checkoutGenericData: object = {};\n\n constructor(actionContext: IActionContext) {\n super(actionContext);\n this._checkoutCart = new BaseCheckoutCartState(actionContext);\n this._attributeValues = [];\n this._extensionProperties = [];\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for app settings.\n this._shouldEnableSinglePaymentAuthorizationCheckout = actionContext.requestContext.app.config\n .shouldEnableSinglePaymentAuthorizationCheckout as boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for app settings.\n this._shouldEnableCheckoutErrorDisplayMessaging = actionContext.requestContext.app.config\n .shouldEnableCheckoutErrorDisplayMessaging as boolean;\n }\n\n @action\n public updateSalesOrder(input: {\n newSalesOrder: SalesOrder;\n newOrderedProducts: SimpleProduct[];\n additionalProperties?: object;\n }): Promise {\n this._salesOrder = input.newSalesOrder;\n this._orderedProducts = input.newOrderedProducts;\n this._attributeValues = input.newSalesOrder.AttributeValues || [];\n this._extensionProperties = input.newSalesOrder.ExtensionProperties || [];\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateAttributeValues(input: {\n newAttributeValues: AttributeValueBase[];\n additionalProperties?: object;\n }): Promise {\n this._attributeValues = input.newAttributeValues;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateExtensionProperties(input: {\n newExtensionProperties: CommerceProperty[];\n additionalProperties?: object;\n }): Promise {\n this._extensionProperties = input.newExtensionProperties;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateTokenizedPaymentCard(input: {\n newTokenizedPaymentCard?: TokenizedPaymentCard;\n additionalProperties?: object;\n }): Promise {\n this._tokenizedPaymentCard = input.newTokenizedPaymentCard;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateTenderLine(input: { newTenderLine?: TenderLine; additionalProperties?: object }): Promise {\n this._tenderLine = input.newTenderLine;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateShippingAddress(input: {\n newShippingAddress: Address;\n additionalProperties?: object;\n }): Promise {\n this._shippingAddress = input.newShippingAddress;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateHasShippingAddress(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newHasShippingAddress: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._hasShippingAddress = input.newHasShippingAddress;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateHasCartDeliveryMode(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newHasCartDeliveryMode: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._hasCartDeliveryMode = input.newHasCartDeliveryMode;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateTermsAndConditionsAcceptance(input: {\n newIsTermsAndConditionAccepted: boolean;\n additionalProperties?: object;\n }): Promise {\n this._isTermsAndConditionAccepted = input.newIsTermsAndConditionAccepted;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateIsTermsAndConditionsChecked(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsTermsAndConditionChecked: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isTermsAndConditionChecked = input.newIsTermsAndConditionChecked;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShouldCollapsePaymentSection(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newShouldCollapsePaymentSection: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._shouldCollapsePaymentSection = input.newShouldCollapsePaymentSection;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShouldTriggerPaymentWithPlaceOrder(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newShouldTriggerPaymentWithPlaceOrder: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._shouldTriggerPaymentWithPlaceOrder = input.newShouldTriggerPaymentWithPlaceOrder;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsPaymentSectionContainerReady(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsPaymentSectionContainerReady: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isPaymentSectionContainerReady = input.newIsPaymentSectionContainerReady;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateCardPaymentAcceptResult(input: {\n newCardPaymentAcceptResult: CardPaymentAcceptResult;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._cardPaymentAcceptResult = input.newCardPaymentAcceptResult;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsPaymentSectionContainerHasError(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsPaymentSectionContainerHasError: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isPaymentSectionContainerHasError = input.newIsPaymentSectionContainerHasError;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateRedirectAdditionalContext(input: {\n newRedirectAdditionalContext: string;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._redirectAdditionalContext = input.newRedirectAdditionalContext;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateRedirectPaymentConnectorId(input: {\n newRedirectPaymentConnectorId: string;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._redirectPaymentConnectorId = input.newRedirectPaymentConnectorId;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateCheckoutErrorPaymentConnectorId(input: {\n newCheckoutErrorPaymentConnectorId: string;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._checkoutErrorPaymentConnectorId = input.newCheckoutErrorPaymentConnectorId;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsCheckoutCallFailed(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsCheckoutCallFailed: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isCheckoutCallFailed = input.newIsCheckoutCallFailed;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsPlaceOrderEnabledInRedirection(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsPlaceOrderEnabledInRedirection: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isPlaceOrderEnabledInRedirection = input.newIsPlaceOrderEnabledInRedirection;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsPaymentVerificationRequired(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsPaymentVerificationRequired: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isPaymentVerificationRequired = input.newIsPaymentVerificationRequired;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public updateBillingAddress(input: { newBillingAddress: Address; additionalProperties?: object }): Promise {\n this._billingAddress = input.newBillingAddress;\n\n // @ts-expect-error\n this._isBillingAddressSameAsShippingAddress = input.additionalProperties?.isBillingAddressSameAsShippingAddress || false;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public removeBillingAddress(input: { additionalProperties?: object }): Promise {\n this._billingAddress = undefined;\n this._isBillingAddressSameAsShippingAddress = undefined;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updatePaymentTenderType(input: {\n newPaymentTenderType?: string;\n additionalProperties?: object;\n }): Promise {\n this._paymentTenderType = input.newPaymentTenderType;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateCardPrefix(input: { newCardPrefix: string; additionalProperties?: object }): Promise {\n this._cardPrefix = input.newCardPrefix;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public removeGiftCard(input: { giftCardNumber: string; additionalProperties?: object }): Promise {\n this._giftCardExtends = this._giftCardExtends.filter(giftCard => giftCard.Id !== input.giftCardNumber);\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public removeGiftCardExtend(input: { giftCardNumber: string; additionalProperties?: object }): Promise {\n this._giftCardExtends = this._giftCardExtends.filter(giftCard => giftCard.Id !== input.giftCardNumber);\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public addGiftCard(input: { giftCard: GiftCard; additionalProperties?: object }): Promise {\n // @ts-expect-error\n const { Pin, ExpirationDate, TenderTypeId } = input.additionalProperties || {};\n\n const gitCardExtend = { ...input.giftCard, ...{ Pin, ExpirationDate, TenderTypeId } };\n\n this._giftCardExtends = [gitCardExtend, ...this._giftCardExtends];\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public addGiftCardExtend(input: { giftCard: IGiftCardExtend; additionalProperties?: object }): Promise {\n this._giftCardExtends = [input.giftCard, ...this._giftCardExtends];\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateLoyaltyCardNumber(input: { newLoyaltyCardNumber: string; additionalProperties?: object }): Promise {\n this._loyaltyCardNumber = input.newLoyaltyCardNumber;\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateLoyaltyAmount(input: { newAmount: number; additionalProperties?: object }): Promise {\n this._loyaltyAmount = Number(input.newAmount.toFixed(2));\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateGuestCheckoutEmail(input: {\n newGuestCheckoutEmail: string;\n additionalProperties?: object;\n }): Promise {\n this._guestCheckoutEmail = input.newGuestCheckoutEmail;\n const emailOnCart = this.checkoutCart.cart.ReceiptEmail;\n\n if (emailOnCart !== input.newGuestCheckoutEmail) {\n await this.checkoutCart.updateReceiptEmail({ newEmail: input.newGuestCheckoutEmail });\n }\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateHasGuestCheckoutEmail(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newHasGuestCheckoutEmail: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._hasGuestCheckoutEmail = input.newHasGuestCheckoutEmail;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public removeCheckoutCartId(input: { additionalProperties?: object }): Promise {\n this.actionContext.requestContext.cookies.removeCheckoutCartCookie();\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public saveDataInStorage(input: { additionalProperties?: object }): Promise {\n const { sessionStorage } = this.actionContext.requestContext;\n\n // Add all local data to session storage\n if (this.billingAddress) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.BillingAddress, {\n billingAddress: this.billingAddress,\n isBillingAddressSameAsShippingAddress: this.isBillingAddressSameAsShippingAddress\n });\n }\n\n if (this.giftCardExtends && this.giftCardExtends.length > 0) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.GiftCard, this.giftCardExtends);\n }\n\n if (this.loyaltyCardNumber) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.LoyaltyCardNumber, { loyaltyCardNumber: this.loyaltyCardNumber });\n }\n\n if (this.loyaltyAmount) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.LoyaltyAmount, { loyaltyAmount: this.loyaltyAmount });\n }\n\n if (this.isTermsAndConditionAccepted) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.TermsAndCondition, {\n isTermsAndConditionAccepted: this.isTermsAndConditionAccepted\n });\n }\n\n if (this.paymentTenderType) {\n window.sessionStorage.setItem(CheckoutStorageKey.PaymentTenderType, this.paymentTenderType);\n }\n\n if (this.redirectPaymentConnectorId) {\n window.sessionStorage.setItem(CheckoutStorageKey.RedirectPaymentConnectorId, this.redirectPaymentConnectorId);\n }\n\n if (this.isExpressCheckoutApplied) {\n window.sessionStorage.setItem(CheckoutStorageKey.IsExpressCheckoutApplied, this.isExpressCheckoutApplied.toString());\n }\n\n // Save generic data with SaveDataBeforeRedirect value true\n const filtered = Object.keys(this._checkoutGenericData).reduce((filteredData: object, key: string) => {\n if (this._checkoutGenericData[key].SaveDataBeforeRedirect) {\n filteredData[key] = this._checkoutGenericData[key];\n }\n return filteredData;\n }, {});\n\n if (Object.keys(filtered).length > 0) {\n sessionStorage.setCheckoutCartData(CheckoutStorageKey.CheckoutGenericData, { checkoutGenericData: filtered });\n }\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public updateCustomerAccountAmount(input: { newAmount: number; additionalProperties?: object }): Promise {\n this._customerAccountAmount = Number(input.newAmount.toFixed(2));\n\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public async updateBillingAddressFromExpressCheckout(input: {\n newBillingAddressFromExpressCheckout: Address;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._billingAddressFromExpressCheckout = input.newBillingAddressFromExpressCheckout;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShippingAddressFromExpressCheckout(input: {\n newShippingAddressFromExpressCheckout: Address;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._shippingAddressFromExpressCheckout = input.newShippingAddressFromExpressCheckout;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateEmailAddressFromExpressCheckout(input: {\n newEmailAddressFromExpressCheckout: string;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._emailAddressFromExpressCheckout = input.newEmailAddressFromExpressCheckout;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShouldEnableExpressCheckoutInCheckout(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newShouldEnableExpressCheckoutInCheckout: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._shouldEnableExpressCheckoutInCheckout = input.newShouldEnableExpressCheckoutInCheckout;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateShouldEnableExpressCheckoutInCart(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newShouldEnableExpressCheckoutInCart: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._shouldEnableExpressCheckoutInCart = input.newShouldEnableExpressCheckoutInCart;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsExpressCheckoutApplied(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsExpressCheckoutApplied: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isExpressCheckoutApplied = input.newIsExpressCheckoutApplied;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsExpressAddressApplied(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsExpressAddressApplied: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isExpressAddressApplied = input.newIsExpressAddressApplied;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsExpressCheckoutAppliedInCartPage(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsExpressCheckoutAppliedInCartPage: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isExpressCheckoutAppliedInCartPage = input.newIsExpressCheckoutAppliedInCartPage;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsBillingAddressHasError(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newIsBillingAddressHasError: boolean; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._isBillingAddressHasError = input.newIsBillingAddressHasError;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateIsExpressPaymentModulesReady(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: {\n newIsExpressPaymentModulesReady: CommerceProperty[];\n additionalProperties?: { [key: string]: unknown };\n }\n ): Promise {\n this._isExpressPaymentModulesReady = input.newIsExpressPaymentModulesReady;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateExpressCheckoutDetails(input: {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n newIsExpressCheckoutApplied: boolean;\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n newIsExpressAddressApplied?: boolean;\n newCardPaymentAcceptResult?: CardPaymentAcceptResult;\n newEmailAddressFromExpressCheckout: string;\n newTenderLine?: TenderLine;\n newPaymentTenderType?: string;\n newTokenizedPaymentCard?: TokenizedPaymentCard;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._isExpressCheckoutApplied = input.newIsExpressCheckoutApplied;\n\n if (input.newIsExpressAddressApplied !== undefined) {\n this._isExpressAddressApplied = input.newIsExpressAddressApplied;\n }\n\n if (input.newCardPaymentAcceptResult !== undefined) {\n this._cardPaymentAcceptResult = input.newCardPaymentAcceptResult;\n }\n\n if (input.newPaymentTenderType !== undefined) {\n this._paymentTenderType = input.newPaymentTenderType;\n }\n\n if (input.newTokenizedPaymentCard !== undefined) {\n this._tokenizedPaymentCard = input.newTokenizedPaymentCard;\n }\n\n if (input.newTenderLine !== undefined) {\n this._tenderLine = input.newTenderLine;\n }\n\n if (input.newEmailAddressFromExpressCheckout) {\n this._emailAddressFromExpressCheckout = input.newEmailAddressFromExpressCheckout;\n }\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public async updateCheckoutError(input: {\n newCheckoutError: ICheckoutError;\n additionalProperties?: { [key: string]: unknown };\n }): Promise {\n this._checkoutError = input.newCheckoutError;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n @action\n public setCheckoutGenericData(input: {\n key: string;\n checkoutGenericData: ICheckoutGenericData;\n additionalProperties?: object;\n }): Promise {\n this._checkoutGenericData[input.key] = input.checkoutGenericData;\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n @action\n public getCheckoutGenericData(input: { key: string }): ICheckoutGenericData | undefined {\n return this._checkoutGenericData[input.key];\n }\n\n @action\n public async updateCheckoutErrorFocus(\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Keep the same naming pattern.\n input: { newCheckoutErrorFocus: CheckoutModule; additionalProperties?: { [key: string]: unknown } }\n ): Promise {\n this._checkoutErrorFocus = input.newCheckoutErrorFocus;\n\n const result: ICheckoutActionResult = { status: 'SUCCESS' };\n return Promise.resolve(result);\n }\n\n public async initialize(): Promise {\n if (this.isInitialized) {\n return;\n }\n\n await this._checkoutCart.initialize();\n\n this.setInitialData();\n this.isInitialized = true;\n this._status = 'READY';\n this._attributeValues = [];\n this._extensionProperties = [];\n }\n\n @action\n private cleanCheckoutData(input: { additionalProperties?: object }): Promise {\n this.actionContext.requestContext.sessionStorage.removeCheckoutCartData();\n return Promise.resolve({ status: 'SUCCESS' });\n }\n\n private setInitialData() {\n const { sessionStorage } = this.actionContext.requestContext;\n\n if (this.isPaymentVerificationRedirection) {\n const billingAddress = sessionStorage.getCheckoutCartData(CheckoutStorageKey.BillingAddress);\n const giftCard = sessionStorage.getCheckoutCartData(CheckoutStorageKey.GiftCard);\n\n this._billingAddress = get(billingAddress, 'billingAddress');\n this._isBillingAddressSameAsShippingAddress = get(billingAddress, 'isBillingAddressSameAsShippingAddress');\n this._giftCardExtends = (giftCard && Array.isArray(giftCard) ? giftCard : []) as IGiftCardExtend[];\n this._loyaltyCardNumber = get(sessionStorage.getCheckoutCartData(CheckoutStorageKey.LoyaltyCardNumber), 'loyaltyCardNumber');\n this._loyaltyAmount = get(sessionStorage.getCheckoutCartData(CheckoutStorageKey.LoyaltyAmount), 'loyaltyAmount');\n this._isTermsAndConditionAccepted = get(\n sessionStorage.getCheckoutCartData(CheckoutStorageKey.TermsAndCondition),\n 'isTermsAndConditionAccepted'\n );\n this._checkoutGenericData =\n get(sessionStorage.getCheckoutCartData(CheckoutStorageKey.CheckoutGenericData), 'checkoutGenericData') || {};\n this._paymentTenderType = window.sessionStorage.getItem(CheckoutStorageKey.PaymentTenderType) ?? undefined;\n this._redirectPaymentConnectorId = window.sessionStorage.getItem(CheckoutStorageKey.RedirectPaymentConnectorId) as string;\n this._isExpressCheckoutApplied = (window.sessionStorage.getItem(CheckoutStorageKey.IsExpressCheckoutApplied) as string)\n ? true\n : false;\n }\n\n this.cleanCheckoutData({});\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { BaseCartState } from '../cart-state/base-cart-state';\nimport { ICartState } from '../state-interfaces/i-cart-state';\nimport createGlobalStateDataAction from './global-state-data-action';\n\nexport default createGlobalStateDataAction('CARTSTATE', BaseCartState);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { BaseCheckoutState } from '../checkout-state/base-checkout-state';\nimport { ICheckoutState } from '../state-interfaces/i-checkout-state';\nimport createGlobalStateDataAction from './global-state-data-action';\n\nexport default createGlobalStateDataAction('CHECKOUTSTATE', BaseCheckoutState);\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 getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext,\n IRequestContext\n} from '@msdyn365-commerce/core';\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\n\nimport { ICartState } from '../state-interfaces';\nimport { getCartState } from './get-cart-state';\n\n/**\n * Input class for getCart data action.\n */\nexport class GetCartStateDataInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n private readonly catalogId?: number;\n\n constructor(apiSettings: ICommerceApiSettings, requestContext?: IRequestContext) {\n this.apiSettings = apiSettings;\n if (requestContext) {\n this.catalogId = getCatalogId(requestContext);\n }\n }\n\n public getCacheKey = () => `GetCart-chanId:${this.apiSettings.channelId}-catId:${this.catalogId ?? 0}`;\n\n public getCacheObjectType = () => 'Cart';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nconst createInput = (inputData: ICreateActionContext) => {\n return new GetCartStateDataInput(inputData.requestContext.apiSettings, inputData.requestContext);\n};\n\n/**\n * Data action to copy the cart for actions.\n * @param input\n * @param ctx\n */\nexport async function getCartStateData(input: GetCartStateDataInput, ctx: IActionContext): Promise {\n const cartState = await getCartState(ctx);\n if (cartState && cartState.cart.Id !== undefined) {\n return cartState;\n }\n\n return undefined;\n}\n\nexport default createObservableDataAction({\n id: '@msdyn365-commerce/global-state/get-cart-state-data',\n action: >getCartStateData,\n input: createInput\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AsyncResult, IActionContext } from '@msdyn365-commerce/core';\n\nimport { BaseCartState } from '../cart-state/base-cart-state';\nimport { ICartState } from '../state-interfaces/i-cart-state';\nimport cartStateDataAction from './cart-state-data-action';\nimport { GlobalStateInput } from './global-state-data-action';\n\nexport function getCartState(ctx: IActionContext): AsyncResult {\n return cartStateDataAction(\n new GlobalStateInput('CARTSTATE', BaseCartState, ctx.requestContext.apiSettings, ctx.requestContext),\n ctx\n );\n}\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 ICommerceApiSettings,\n ICreateActionContext\n} from '@msdyn365-commerce/core';\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\nimport { copyAsync, readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\n\nimport { getCartState } from './get-cart-state';\n\n/**\n * Input class for getCheckoutCart data action.\n */\nexport class GetCheckoutCartInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => `CheckoutCart-chanId:${this.apiSettings.channelId}-catId:${this.apiSettings.catalogId}`;\n\n public getCacheObjectType = () => 'CheckoutCart';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\nenum CartTokenPrefix {\n Auth = 't',\n Anon = 'p'\n}\n\nconst createInput = (inputData: ICreateActionContext) => {\n return new GetCheckoutCartInput(inputData.requestContext.apiSettings);\n};\n\n/**\n * Data action to copy the cart for checkout actions.\n * @param input\n * @param ctx\n */\nexport async function getCheckoutCart(input: GetCheckoutCartInput, ctx: IActionContext): Promise {\n const savedCheckoutCartId = ctx.requestContext.cookies.getCheckoutCartCookie();\n const cartCookieParts: string[] = savedCheckoutCartId.split(':');\n let checkoutCartId = null;\n const isAuthenticated = ctx.requestContext.user.isAuthenticated;\n\n if (\n (isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Auth) ||\n (!isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Anon)\n ) {\n checkoutCartId = cartCookieParts[1];\n }\n\n let checkoutCart: Cart | undefined;\n\n if (checkoutCartId) {\n try {\n checkoutCart = await readAsync({ callerContext: ctx, bypassCache: 'none' }, checkoutCartId);\n } catch (error) {\n ctx.telemetry.error('Error getting checkout cart based on saved checkout card id');\n ctx.telemetry.exception(error);\n }\n }\n\n const cartState = await getCartState(ctx);\n if (cartState && cartState.cart.Id !== undefined) {\n if (checkoutCart && checkoutCart.Version && cartState.cart.Version && checkoutCart.Version > cartState.cart.Version) {\n return Promise.resolve(checkoutCart);\n }\n\n return copyAsync({ callerContext: ctx }, cartState.cart.Id, 2)\n .then(cart => {\n ctx.requestContext.cookies.setCheckoutCartCookie(cart, isAuthenticated);\n return cart;\n })\n .catch(error => {\n ctx.telemetry.error('Error copying cart');\n ctx.telemetry.exception(error);\n return undefined;\n });\n }\n\n return undefined;\n}\n\nexport const getCheckoutCartDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/global-state/get-checkout-cart',\n action: >getCheckoutCart,\n input: createInput\n});\n\nexport default getCheckoutCartDataAction;\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 getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n ICreateActionContext,\n IObservableAction,\n IRequestContext\n} from '@msdyn365-commerce/core';\n\nimport { createGlobalState, GlobalStateConstructor, IGlobalState } from '../global-state/i-global-state';\n\nexport declare type GlobalStateType = 'CARTSTATE' | 'CHECKOUTSTATE';\n\n/**\n * Shared class that handles global state inputs.\n */\nexport class GlobalStateInput implements IActionInput {\n public readonly stateConstructor: GlobalStateConstructor;\n\n public readonly key: GlobalStateType;\n\n public readonly catalogId?: number;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n public constructor(\n key: GlobalStateType,\n stateConstructor: GlobalStateConstructor,\n apiSettings: ICommerceApiSettings,\n requestContext?: IRequestContext\n ) {\n this.apiSettings = apiSettings;\n this.stateConstructor = stateConstructor;\n this.key = key;\n\n if (requestContext) {\n this.catalogId = getCatalogId(requestContext);\n }\n }\n\n public getCacheKey = () => `${this.key}-chanId:${this.apiSettings.channelId}-catId:${this.catalogId ?? 0}`;\n\n public getCacheObjectType = () => this.key;\n\n public dataCacheType = (): CacheType => 'instance';\n}\n\nexport async function getState(input: GlobalStateInput, ctx: IActionContext): Promise {\n const globalStateObject = createGlobalState(input.stateConstructor, ctx);\n\n await globalStateObject.initialize();\n\n return globalStateObject;\n}\n\nexport default function createGlobalStateDataAction(\n key: GlobalStateType,\n stateConstructor: GlobalStateConstructor\n): IObservableAction {\n return createObservableDataAction({\n action: >getState,\n input: (args: ICreateActionContext) => {\n return new GlobalStateInput(key, stateConstructor, args.requestContext.apiSettings, args.requestContext);\n }\n });\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\n\nexport declare type GlobalStateStatus = 'READY' | 'UPDATING' | 'ERROR';\n\nexport type GlobalStateConstructor = new (actionContext: IActionContext) => T;\n\nexport function createGlobalState(ctor: GlobalStateConstructor, actionContext: IActionContext): T {\n return new ctor(actionContext);\n}\n\nexport interface IGlobalState {\n readonly status: GlobalStateStatus;\n\n initialize(): Promise;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AsyncResult, IActionContext } from '@msdyn365-commerce/core';\n\nimport { BaseCheckoutState } from '../checkout-state/base-checkout-state';\nimport { ICheckoutState } from '../state-interfaces/i-checkout-state';\nimport checkoutStateDataAction from './checkout-state-data-action';\nimport { GlobalStateInput } from './global-state-data-action';\n\nexport function getCheckoutState(ctx: IActionContext): AsyncResult {\n return checkoutStateDataAction(\n new GlobalStateInput('CHECKOUTSTATE', BaseCheckoutState, ctx.requestContext.apiSettings, ctx.requestContext),\n ctx\n );\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { computed, observable } from 'mobx';\n\nimport { GlobalStateStatus, IGlobalState } from './i-global-state';\n\n/**\n * Base global state that handles common global state behavior that other state can extend from.\n */\nexport class GlobalState implements IGlobalState {\n protected isInitialized: boolean = false;\n\n protected actionContext: IActionContext;\n\n @observable protected _status: GlobalStateStatus;\n\n @computed public get status(): Readonly {\n return this._status;\n }\n\n constructor(actionContext: IActionContext) {\n this.actionContext = actionContext;\n this._status = 'UPDATING';\n }\n\n public async initialize(): Promise {\n this.isInitialized = true;\n this._status = 'READY';\n\n return;\n }\n\n protected async _doAsyncAction(lambda: () => Promise): Promise {\n this._status = 'UPDATING';\n\n return lambda()\n .then(result => {\n this._status = 'READY';\n return result;\n })\n .catch(error => {\n console.log(error);\n this._status = 'ERROR';\n\n return Promise.reject(error);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport enum ErrorCode {\n ActionError = 'ActionError',\n Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard = 'Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount',\n Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices = 'Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices',\n Microsoft_Dynamics_Commerce_Runtime_FraudRisk = 'Microsoft_Dynamics_Commerce_Runtime_FraudRisk',\n Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed = 'Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed',\n Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch = 'Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch',\n Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion = 'Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion',\n Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber = 'Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber',\n Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest = 'Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest',\n Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines = 'Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines',\n Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed = ' Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed',\n Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender = 'Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender',\n Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry = 'Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry',\n Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard = 'Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard',\n Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints = 'Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints',\n Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided = 'Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided',\n Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance = 'Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance',\n Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties = 'Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties',\n Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount = 'Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount',\n Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed = 'Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed',\n Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment = 'Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment',\n Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired = 'Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired',\n Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported = 'Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported',\n Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment = 'Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment',\n Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo = 'Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo',\n Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult = 'Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult'\n}\n\nexport enum ErrorMessageResource {\n blockedLoyaltyCardErrorMessage = 'blockedLoyaltyCardErrorMessage',\n checkoutTimeoutErrorMessage = 'checkoutTimeoutErrorMessage',\n customerAccountLimitSignDifferentFromAmountDueErrorMessage = 'customerAccountLimitSignDifferentFromAmountDueErrorMessage',\n customerAccountPaymentExceedsCustomerAccountFloorLimitErrorMessage = 'customerAccountPaymentExceedsCustomerAccountFloorLimitErrorMessage',\n customerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItemsErrorMessage = 'customerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItemsErrorMessage',\n customerAccountPaymentForCustomerWithoutAllowOnAccountErrorMessage = 'customerAccountPaymentForCustomerWithoutAllowOnAccountErrorMessage',\n customerAccountPaymentNotAllowedForOpenInvoicesErrorMessage = 'customerAccountPaymentNotAllowedForOpenInvoicesErrorMessage',\n fraudRiskErrorMessage = 'fraudRiskErrorMessage',\n giftCardBalanceInquiryFailedErrorMessage = 'giftCardBalanceInquiryFailedErrorMessage',\n giftCardCurrencyMismatchErrorMessage = 'giftCardCurrencyMismatchErrorMessage',\n invalidCartVersionErrorMessage = 'invalidCartVersionErrorMessage',\n invalidLoyaltyCardNumberErrorMessage = 'invalidLoyaltyCardNumberErrorMessage',\n invalidPaymentRequestConsoleErrorMessage = 'invalidPaymentRequestConsoleErrorMessage',\n invalidPaymentRequestErrorMessage = 'invalidPaymentRequestErrorMessage',\n missingRequiredCartTenderLinesErrorMessage = 'missingRequiredCartTenderLinesErrorMessage',\n multipleCustomerAccountPaymentsNotAllowedErrorMessage = 'multipleCustomerAccountPaymentsNotAllowedErrorMessage',\n noMoreThanOneLoyaltyTenderErrorMessage = 'noMoreThanOneLoyaltyTenderErrorMessage',\n noResponseFromGatewayForGiftCardBalanceInquiryErrorMessage = 'noResponseFromGatewayForGiftCardBalanceInquiryErrorMessage',\n noTenderLoyaltyCardErrorMessage = 'noTenderLoyaltyCardErrorMessage',\n notEnoughRewardPointsErrorMessage = 'notEnoughRewardPointsErrorMessage',\n paymentAlreadyVoidedErrorMessage = 'paymentAlreadyVoidedErrorMessage',\n paymentAmountExceedsGiftBalanceErrorMessage = 'paymentAmountExceedsGiftBalanceErrorMessage',\n paymentRequiresMerchantPropertiesConsoleErrorMessage = 'paymentRequiresMerchantPropertiesConsoleErrorMessage',\n paymentRequiresMerchantPropertiesErrorMessage = 'paymentRequiresMerchantPropertiesErrorMessage',\n paymentUsingUnauthorizedAccountErrorMessage = 'paymentUsingUnauthorizedAccountErrorMessage',\n refundAmountMoreThanAllowedErrorMessage = 'refundAmountMoreThanAllowedErrorMessage',\n unableToAuthorizePaymentCardAdditionalContextRequiredErrorMessage = 'unableToAuthorizePaymentCardAdditionalContextRequiredErrorMessage',\n unableToAuthorizePaymentCardTypeMissingOrNotSupportedErrorMessage = 'unableToAuthorizePaymentCardTypeMissingOrNotSupportedErrorMessage',\n unableToAuthorizePaymentErrorMessage = 'unableToAuthorizePaymentErrorMessage',\n unableToCancelPaymentErrorMessage = 'unableToCancelPaymentErrorMessage',\n unableToReadCardTokenInfoErrorMessage = 'unableToReadCardTokenInfoErrorMessage',\n unableToRetrieveCardPaymentAcceptResultErrorMessage = 'unableToRetrieveCardPaymentAcceptResultErrorMessage'\n}\n\nexport enum ErrorLocation {\n Checkout,\n CheckoutCustomerAccountPayment,\n CheckoutDeliveryOptions,\n CheckoutExpress,\n CheckoutGiftCard,\n CheckoutGuestProfile,\n CheckoutLoyalty,\n CheckoutPaymentInstrument,\n CheckoutPickup,\n CheckoutTermsAndConditions,\n Console,\n GiftCardBalanceCheck\n}\n\nexport enum CheckoutModule {\n CheckoutCustomerAccountPayment = 'checkout-customer-account-payment',\n CheckoutDeliveryOptions = 'checkout-delivery-options',\n CheckoutExpress = 'checkout-express',\n CheckoutGiftCard = 'checkout-gift-card',\n CheckoutGuestProfile = 'checkout-guest-profile',\n CheckoutLoyalty = 'checkout-loyalty',\n CheckoutPaymentInstrument = 'checkout-payment-instrument',\n CheckoutPickup = 'checkout-pickup',\n CheckoutTermsAndConditions = 'checkout-terms-and-conditions',\n None = 'none'\n}\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $RangeError = RangeError;\n\n// `String.prototype.repeat` method implementation\n// https://tc39.es/ecma262/#sec-string.prototype.repeat\nmodule.exports = function repeat(count) {\n var str = toString(requireObjectCoercible(this));\n var result = '';\n var n = toIntegerOrInfinity(count);\n if (n < 0 || n == Infinity) throw $RangeError('Wrong number of repetitions');\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;\n return result;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\n// `thisNumberValue` abstract operation\n// https://tc39.es/ecma262/#sec-thisnumbervalue\nmodule.exports = uncurryThis(1.0.valueOf);\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar thisNumberValue = require('../internals/this-number-value');\nvar $repeat = require('../internals/string-repeat');\nvar fails = require('../internals/fails');\n\nvar $RangeError = RangeError;\nvar $String = String;\nvar floor = Math.floor;\nvar repeat = uncurryThis($repeat);\nvar stringSlice = uncurryThis(''.slice);\nvar nativeToFixed = uncurryThis(1.0.toFixed);\n\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\n\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\nvar multiply = function (data, n, c) {\n var index = -1;\n var c2 = c;\n while (++index < 6) {\n c2 += n * data[index];\n data[index] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n};\n\nvar divide = function (data, n) {\n var index = 6;\n var c = 0;\n while (--index >= 0) {\n c += data[index];\n data[index] = floor(c / n);\n c = (c % n) * 1e7;\n }\n};\n\nvar dataToString = function (data) {\n var index = 6;\n var s = '';\n while (--index >= 0) {\n if (s !== '' || index === 0 || data[index] !== 0) {\n var t = $String(data[index]);\n s = s === '' ? t : s + repeat('0', 7 - t.length) + t;\n }\n } return s;\n};\n\nvar FORCED = fails(function () {\n return nativeToFixed(0.00008, 3) !== '0.000' ||\n nativeToFixed(0.9, 0) !== '1' ||\n nativeToFixed(1.255, 2) !== '1.25' ||\n nativeToFixed(1000000000000000128.0, 0) !== '1000000000000000128';\n}) || !fails(function () {\n // V8 ~ Android 4.3-\n nativeToFixed({});\n});\n\n// `Number.prototype.toFixed` method\n// https://tc39.es/ecma262/#sec-number.prototype.tofixed\n$({ target: 'Number', proto: true, forced: FORCED }, {\n toFixed: function toFixed(fractionDigits) {\n var number = thisNumberValue(this);\n var fractDigits = toIntegerOrInfinity(fractionDigits);\n var data = [0, 0, 0, 0, 0, 0];\n var sign = '';\n var result = '0';\n var e, z, j, k;\n\n // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation\n if (fractDigits < 0 || fractDigits > 20) throw $RangeError('Incorrect fraction digits');\n // eslint-disable-next-line no-self-compare -- NaN check\n if (number != number) return 'NaN';\n if (number <= -1e21 || number >= 1e21) return $String(number);\n if (number < 0) {\n sign = '-';\n number = -number;\n }\n if (number > 1e-21) {\n e = log(number * pow(2, 69, 1)) - 69;\n z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(data, 0, z);\n j = fractDigits;\n while (j >= 7) {\n multiply(data, 1e7, 0);\n j -= 7;\n }\n multiply(data, pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(data, 1 << 23);\n j -= 23;\n }\n divide(data, 1 << j);\n multiply(data, 1, 1);\n divide(data, 2);\n result = dataToString(data);\n } else {\n multiply(data, 0, z);\n multiply(data, 1 << -e, 0);\n result = dataToString(data) + repeat('0', fractDigits);\n }\n }\n if (fractDigits > 0) {\n k = result.length;\n result = sign + (k <= fractDigits\n ? '0.' + repeat('0', fractDigits - k) + result\n : stringSlice(result, 0, k - fractDigits) + '.' + stringSlice(result, k - fractDigits));\n } else {\n result = sign + result;\n } return result;\n }\n});\n"],"names":["getQuantityLimit","maxQuantityForCartLineItem","inputItem","quantityLimit","shouldEnableStockCheck","undefined","availableQuantity","Math","min","getElementIndex","lines","cartLineToAdd","elementFoundAt","productIdToFind","ProductId","index","line","entries","DeliveryMode","FulfillmentStoreId","async","addProductsToCartWithoutSiteSettings","cart","actionContext","input","CartLines","status","substatus","newCartLines","map","cartLine","Quantity","addCartLinesResult","Version","addCartLinesAsync","callerContext","Id","then","newCart","catch","error","telemetry","trace","errorDetails","LocalizedMessage","message","validationResults","data","ValidationResults","warning","addProductsToCartInternal","orderQuantityLimitsFeatureIsEnabled","enableStockCheck","isAddServiceItemToCart","isMaxByQuantityValidationFeatureDefined","shouldSkipSiteSettings","i","length","name","find","cartline","IsInvoiceLine","addProductsToCartValidateMaxAgainstDefaultOrderSettings","requestContext","app","config","cartActionResult","addProductsToCartValidateMaxAgainstSiteSettings","addPromoCode","promoCode","hasPromoCode","addDiscountCodeAsync","code","Coupons","coupon","Code","toLowerCase","includes","BaseCartState","GlobalState","constructor","super","this","_cart","_attributeValues","_extensionProperties","_isProductAddedToCart","attributeValues","extensionProperties","totalItemsInCart","reduce","total","num","isProductAddedToCart","isEmpty","hasInvoiceLine","some","_doAsyncAction","refreshCartInternal","CatalogId","catalogId","getCatalogId","Description","product","EntryMethodTypeValue","ItemId","RecordId","count","TrackingId","UnitOfMeasureSymbol","DefaultUnitOfMeasure","IsPriceKeyedIn","isPriceKeyedIn","IsGiftCardLine","IsGiftCard","Price","customPrice","location","channel","deliveryMode","PickupDeliveryModeCode","OrgUnitNumber","WarehouseId","InventoryLocationId","ShippingAddress","_buildAddressFromOrgUnitLocation","isAddEmailDeliveryItemToCart","EmailDeliveryModeCode","ItemTypeValue","ReleasedProductType","additionalProperties","Behavior","MaximumQuantity","_doCartOperationWithRetry","addProductToCartInternal","internalInput","PRODUCTASSERVICE","push","isStockCheckEnabled","invoiceIds","CartsDataActions","addInvoicesToCartInternal","invoiceId","lineDescription","addOrderInvoiceAsync","addOrderInvoiceToCartInternal","setInvoiceLinePriceInternal","cartLineId","price","removeCartLineInternal","cartLineIds","clearCartLineDeliveryModeInternal","clearCartLinesDeliveryInformation","channelDeliveryOptionConfiguration","cartLineDeliverySpecification","LineId","DeliverySpecification","DeliveryModeId","DeliveryPreferenceTypeValue","PickUpStoreId","DeliveryAddress","updateCartLineDeliverySpecificationsInternal","lineDeliverySpecifications","deliveryModeId","trim","pickupDeliveryModeCode","emailDeliveryModeCode","cartLinesForShipping","channelDeliveryOptionConfig","filter","PickupDeliveryModeCodes","deliverySpecifications","shippingAddress","updateCartLineQuantityInternal","newQuantity","isUsingDefaultOrderSettingsMax","loyaltyCardNumber","updateLoyaltyCardIdInternal","addPromoCodeInternal","removePromoCodes","removePromoCodesInternal","promoCodes","removeAllPromoCodes","removeAllPromoCodesInternal","email","updateAsync","ReceiptEmail","debug","updateReceiptEmail","newEmail","updateShippingAddress","newShippingAddress","newAttributeValues","newCartObject","AttributeValues","updateCart","newExtensionProperties","ExtensionProperties","isInitialized","getOrCreateActiveCart","_status","callback","callbackResult","refreshCart","PostalAddressId","Name","OrgUnitName","FullAddress","Address","Street","StreetNumber","City","DistrictName","BuildingCompliment","Postbox","ThreeLetterISORegionName","Country","ZipCode","Zip","County","CountyName","State","StateName","__decorate","observable","computed","action","clearCartLineDeliveryMode","matchingLines","copyCartLine","updateCartLinesAsync","dM","copiedLines","forEach","CartTokenPrefix","ctx","cartCookieParts","cookies","getCartCookie","split","user","isAuthenticated","Auth","Anon","readCart","readAsync","bypassCache","setCartCookie","getCartFromCookie","wasReadFromCookie","getCartFromCustomer","anonCart","currentCart","anonCurrentCart","cartId","claimAuthCart","Error","claimCart","mergedCart","sourceCart","destinationCart","updatedCart","cartLines","cartLinesToDelete","hasShippingMethod","channelConfiguration","featureNames","newCartLine","buildGiftCardLine","featureStates","getFeatureStatesAsync","featureState","IsEnabled","getChannelDeliveryOptionConfigurationAsync","ReasonCodeLines","removeCartLinesAsync","exception","coupons","addCouponsAsync","addCartLines","claimAnonCart","createNewCart","LoyaltyCardId","card","getCustomerLoyaltyCardsAsync","queryResultSettings","CardNumber","createCartAsync","authCarts","cartSearchCriteria","IncludeAnonymous","CartTypeValue","Paging","Top","Skip","Sorting","Columns","ColumnName","IsDescending","searchAsync","searchCarts","NetPrice","GiftCardBalance","removeDiscountCodesAsync","removeCartLinesInternal","Array","isArray","errorInstance","cartLineDeliverySpecifications","updateLineDeliverySpecificationsAsync","updateCartLineQuantityValidateMaxAgainstDefaultOrderSettings","updateCartLineQuantityValidateMaxAgainstSiteSettings","updatedCartObject","updateLoyaltyCardId","newLoyaltyCardId","BaseCheckoutCartState","getCheckoutCart","GetCheckoutCartInput","apiSettings","CheckoutStorageKey","BaseCheckoutState","_giftCardExtends","_loyaltyAmount","_guestCheckoutEmail","_customerAccountAmount","_emailAddressFromExpressCheckout","_checkoutGenericData","_checkoutCart","_shouldEnableSinglePaymentAuthorizationCheckout","shouldEnableSinglePaymentAuthorizationCheckout","_shouldEnableCheckoutErrorDisplayMessaging","shouldEnableCheckoutErrorDisplayMessaging","checkoutCart","salesOrder","_salesOrder","orderedProducts","_orderedProducts","tokenizedPaymentCard","_tokenizedPaymentCard","tenderLine","_tenderLine","billingAddress","_billingAddress","isBillingAddressSameAsShippingAddress","_isBillingAddressSameAsShippingAddress","_shippingAddress","hasShippingAddress","_hasShippingAddress","hasCartDeliveryMode","_hasCartDeliveryMode","cardPrefix","_cardPrefix","paymentTenderType","_paymentTenderType","giftCards","giftCardExtends","_loyaltyCardNumber","loyaltyAmount","guestCheckoutEmail","hasGuestCheckoutEmail","_hasGuestCheckoutEmail","isTermsAndConditionAccepted","_isTermsAndConditionAccepted","isTermsAndConditionChecked","_isTermsAndConditionChecked","shouldCollapsePaymentSection","_shouldCollapsePaymentSection","shouldTriggerPaymentWithPlaceOrder","_shouldTriggerPaymentWithPlaceOrder","isPaymentSectionContainerReady","_isPaymentSectionContainerReady","cardPaymentAcceptResult","_cardPaymentAcceptResult","isPaymentSectionContainerHasError","_isPaymentSectionContainerHasError","redirectAdditionalContext","_redirectAdditionalContext","redirectPaymentConnectorId","_redirectPaymentConnectorId","checkoutErrorPaymentConnectorId","_checkoutErrorPaymentConnectorId","isPlaceOrderEnabledInRedirection","_isPlaceOrderEnabledInRedirection","isPaymentVerificationRequired","_isPaymentVerificationRequired","isCheckoutCallFailed","_isCheckoutCallFailed","customerAccountAmount","shouldEnableExpressCheckoutInCheckout","_shouldEnableExpressCheckoutInCheckout","shouldEnableExpressCheckoutInCart","_shouldEnableExpressCheckoutInCart","shippingAddressFromExpressCheckout","_shippingAddressFromExpressCheckout","emailAddressFromExpressCheckout","billingAddressFromExpressCheckout","_billingAddressFromExpressCheckout","isExpressCheckoutApplied","_isExpressCheckoutApplied","isExpressAddressApplied","_isExpressAddressApplied","isExpressCheckoutAppliedInCartPage","_isExpressCheckoutAppliedInCartPage","isExpressPaymentModulesReady","_isExpressPaymentModulesReady","isPaymentVerificationRedirection","requestFormData","query","pv","redirectResult","checkoutError","_checkoutError","isBillingAddressHasError","_isBillingAddressHasError","checkoutErrorFocus","_checkoutErrorFocus","updateSalesOrder","newSalesOrder","newOrderedProducts","Promise","resolve","updateTokenizedPaymentCard","newTokenizedPaymentCard","updateTenderLine","newTenderLine","newHasShippingAddress","newHasCartDeliveryMode","newIsTermsAndConditionAccepted","newIsTermsAndConditionChecked","newShouldCollapsePaymentSection","newShouldTriggerPaymentWithPlaceOrder","newIsPaymentSectionContainerReady","newCardPaymentAcceptResult","newIsPaymentSectionContainerHasError","newRedirectAdditionalContext","newRedirectPaymentConnectorId","newCheckoutErrorPaymentConnectorId","newIsCheckoutCallFailed","newIsPlaceOrderEnabledInRedirection","newIsPaymentVerificationRequired","updateBillingAddress","newBillingAddress","removeBillingAddress","updatePaymentTenderType","newPaymentTenderType","updateCardPrefix","newCardPrefix","removeGiftCard","giftCard","giftCardNumber","removeGiftCardExtend","addGiftCard","Pin","ExpirationDate","TenderTypeId","gitCardExtend","addGiftCardExtend","updateLoyaltyCardNumber","newLoyaltyCardNumber","updateLoyaltyAmount","Number","newAmount","toFixed","newGuestCheckoutEmail","newHasGuestCheckoutEmail","removeCheckoutCartId","removeCheckoutCartCookie","saveDataInStorage","sessionStorage","setCheckoutCartData","BillingAddress","GiftCard","LoyaltyCardNumber","LoyaltyAmount","TermsAndCondition","window","setItem","PaymentTenderType","RedirectPaymentConnectorId","IsExpressCheckoutApplied","toString","filtered","Object","keys","filteredData","key","SaveDataBeforeRedirect","CheckoutGenericData","checkoutGenericData","updateCustomerAccountAmount","newBillingAddressFromExpressCheckout","newShippingAddressFromExpressCheckout","newEmailAddressFromExpressCheckout","newShouldEnableExpressCheckoutInCheckout","newShouldEnableExpressCheckoutInCart","newIsExpressCheckoutApplied","newIsExpressAddressApplied","newIsExpressCheckoutAppliedInCartPage","newIsBillingAddressHasError","newIsExpressPaymentModulesReady","newCheckoutError","setCheckoutGenericData","getCheckoutGenericData","newCheckoutErrorFocus","initialize","setInitialData","cleanCheckoutData","removeCheckoutCartData","getCheckoutCartData","get","getItem","createGlobalStateDataAction","GetCartStateDataInput","getCacheKey","channelId","getCacheObjectType","dataCacheType","getCartStateData","cartState","getCartState","createObservableDataAction","id","inputData","cartStateDataAction","GlobalStateInput","getCheckoutCartCookie","checkoutCartId","copyAsync","setCheckoutCartCookie","stateConstructor","getState","globalStateObject","createGlobalState","args","getCheckoutState","checkoutStateDataAction","lambda","result","console","log","reject","ErrorCode","ErrorMessageResource","ErrorLocation","CheckoutModule","toIntegerOrInfinity","requireObjectCoercible","$RangeError","RangeError","module","exports","str","n","Infinity","uncurryThis","valueOf","$","thisNumberValue","$repeat","fails","$String","String","floor","repeat","stringSlice","slice","nativeToFixed","pow","x","acc","multiply","c","c2","divide","dataToString","s","t","target","proto","forced","fractionDigits","e","z","j","k","number","fractDigits","sign","x2"],"sourceRoot":""}