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AG5DoH,OACI7F,EAAAA,cAAC8F,EAAAA,OAAMC,OAAAC,OAAA,CACH/F,UAAU,6BACVgG,QAAS3C,EACT4C,MAAO/D,GACH0B,GAEH1B,GAGTgE,cAAepG,EAAqBa,EAAUnC,KAgGtCkD,CACIf,EACAE,EACArC,EACAoC,EACwB,QADnBG,EACLD,SAAwB,IAAAC,OAAA,EAAxBA,EAA0BS,8BAOnCf,IAvCHjC,EAAMyD,QAAQkE,UAAUC,MAAM,kDACvB,OA6CFoN,EAAuBhV,IAChC,MAAM,SAAEgC,EAAQ,UAAED,GAAc/B,EAChC,OAAO8B,EAAmBC,EAAWC,EAAUhC,WC9UnD2b,EAAOC,QAAUra,cCAjBoa,EAAOC,QAAUC","sources":["webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/britax-cart-icon/britax-cart-icon.props.autogenerated.ts?7634","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/britax-cart-icon/components/flyout-cart-line-items.tsx?db70","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/britax-cart-icon/utils/get-products-in-mini-cart.ts?d8c1","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/britax-cart-icon/britax-cart-icon.tsx?ee1c","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/britax-cart-icon/britax-cart-icon.view.tsx?51d9","webpack://@msdyn365-commerce-partners/fabrikam/./lib/britax-cart-icon/module-registration.js?b235","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/cart-icon/utils/get-products-in-mini-cart.ts?3c15","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/cart-icon/cart-icon.tsx?4ae8","webpack://@msdyn365-commerce-partners/fabrikam/./src/modules/cart-icon/components/flyout-cart-line-items.tsx?f2c4","webpack://@msdyn365-commerce-partners/fabrikam/external var \"React\"?0d3b","webpack://@msdyn365-commerce-partners/fabrikam/external var \"ReactDOM\"?853b"],"sourcesContent":["/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IBritaxCartIcon containerModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum cartLinesSortOrder {\r\n ascending = 'ascending',\r\n descending = 'descending'\r\n}\r\n\r\nexport interface IBritaxCartIconConfig extends Msdyn365.IModuleConfig {\r\n imageSettings?: Msdyn365.IImageSettings;\r\n enableHoverCart?: boolean;\r\n cartLinesSortOrder?: cartLinesSortOrder;\r\n isAnonymousCheckout?: boolean;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface IBritaxCartIconResources {\r\n price: string;\r\n cartDiscount: string;\r\n referenceNumber: string;\r\n goToCartButtonTitle: string;\r\n totalPriceFormatString: string;\r\n guestCheckoutButtonTitle: string;\r\n checkoutButtonTitle: string;\r\n dropShipCheckoutButtonTitle: string;\r\n productDimensionTypeColor: string;\r\n productDimensionTypeSize: string;\r\n productDimensionTypeStyle: string;\r\n productDimensionTypeConfiguration: string;\r\n quantityDisplayText: string;\r\n removeCartButtonText: string;\r\n cartLabel: string;\r\n cartQtyLabel: string;\r\n flyoutTitle: string;\r\n salesAgreementPricePrompt: string;\r\n shippingText: string;\r\n checkoutBlockedDueToUnavailableFundsTitle: string;\r\n checkoutBlockedDueToUnavailableFundsMessage: string;\r\n}\r\n\r\nexport interface IBritaxCartIconProps extends Msdyn365.IModule {\r\n resources: IBritaxCartIconResources;\r\n config: IBritaxCartIconConfig;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n CartLineItemComponent,\r\n ICartlineResourceString,\r\n} from \"@msdyn365-commerce/components\";\r\nimport MsDyn365, {\r\n ICoreContext,\r\n IGridSettings,\r\n IImageSettings,\r\n ITelemetry,\r\n isChannelTypeB2B,\r\n} from \"@msdyn365-commerce/core\";\r\nimport {ICartState} from \"@msdyn365-commerce/global-state\";\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n OrgUnitLocation,\r\n ProductAvailableQuantity,\r\n ProductDeliveryOptions,\r\n SimpleProduct,\r\n} from \"@msdyn365-commerce/retail-proxy\";\r\nimport {\r\n ProductCatalog,\r\n ReleasedProductType,\r\n} from \"@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g\";\r\nimport {\r\n getProductUrlSync,\r\n IProductInventoryInformation,\r\n} from \"@msdyn365-commerce-modules/retail-actions\";\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n} from \"@msdyn365-commerce-modules/utilities\";\r\nimport * as React from \"react\";\r\n\r\nimport {\r\n getProductByProductId,\r\n getProductByProductIdAndWarehouse,\r\n} from \"@msdyn365-commerce-modules/cart\";\r\n\r\nexport interface IFlyoutCartLineItemsProps {\r\n cartlines: CartLine[];\r\n cartState: ICartState | undefined;\r\n orgUnitLocations: OrgUnitLocation[] | undefined;\r\n resources: ICartlineResourceString;\r\n productAvailabilites: IProductInventoryInformation[] | undefined;\r\n products: SimpleProduct[] | undefined;\r\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\r\n pickupDeliveryModeCode?: string;\r\n catalogs?: ProductCatalog[];\r\n\r\n /**\r\n * GridSettings for the product image in cartline\r\n */\r\n gridSettings: IGridSettings;\r\n\r\n /**\r\n * ImageSettings for the product image in cartline\r\n */\r\n imageSettings: IImageSettings;\r\n id: string;\r\n typeName: string;\r\n context: ICoreContext;\r\n telemetry: ITelemetry;\r\n removeButtonText: string;\r\n outOfStockText: string;\r\n outOfRangeOneText: string;\r\n outOfRangeFormatText: string;\r\n maxCartlineQuantity: number;\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n\r\n outOfStockThreshold: number;\r\n isStockCheckEnabled: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n}\r\n\r\nexport interface IFlyoutCartLineItemViewProps {\r\n cartline: React.ReactNode;\r\n remove: React.ReactNode;\r\n storeLocation: React.ReactNode;\r\n hasError: boolean;\r\n\r\n data: {\r\n product: SimpleProduct;\r\n cartline: CartLine;\r\n };\r\n}\r\n\r\nconst _getCartItemAvailableQuantity = (\r\n isStockCheckEnabled: boolean,\r\n outOfStockThreshold: number,\r\n productAvailability?: ProductAvailableQuantity,\r\n): number => {\r\n if (isStockCheckEnabled) {\r\n if (\r\n !productAvailability ||\r\n !productAvailability.AvailableQuantity ||\r\n productAvailability.AvailableQuantity <= 0 ||\r\n productAvailability.AvailableQuantity <= outOfStockThreshold\r\n ) {\r\n return 0;\r\n }\r\n return productAvailability.AvailableQuantity - outOfStockThreshold;\r\n }\r\n\r\n return 0;\r\n};\r\n\r\nconst _getCartItemMaxQuantity = (\r\n maxQuantityByConfig: number,\r\n isStockCheckEnabled: boolean,\r\n availableQuantityInStock: number,\r\n isQuantityLimitsFeatureEnabled: boolean,\r\n maxByQuantityLimitsFeature: number,\r\n) => {\r\n if (isQuantityLimitsFeatureEnabled) {\r\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\r\n\r\n // If max by feature in not defined when feature is on then we suggest that there is no max by feature\r\n // and consider available qty if stock check enabled and max from config in site settings.\r\n if (!maxByQuantityLimitsFeature) {\r\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\r\n }\r\n\r\n return isStockCheckEnabled\r\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\r\n ? maxByQuantityLimitsFeatureResult\r\n : availableQuantityInStock\r\n : maxByQuantityLimitsFeatureResult;\r\n }\r\n if (isStockCheckEnabled) {\r\n return availableQuantityInStock < maxQuantityByConfig\r\n ? availableQuantityInStock\r\n : maxQuantityByConfig;\r\n }\r\n return maxQuantityByConfig;\r\n};\r\n\r\n/**\r\n * On Remove Click functionality.\r\n * @param removeItemClickHandler -Remove item click function.\r\n * @param cartline -CartLine.\r\n * @returns Remove change value.\r\n */\r\nconst onRemoveClickFunction = (\r\n removeItemClickHandler: (cartlineToRemove: CartLine) => void,\r\n cartline: CartLine,\r\n) => () => {\r\n removeItemClickHandler(cartline);\r\n};\r\nconst _assembleNode = (\r\n cartline: CartLine,\r\n product: SimpleProduct,\r\n props: IFlyoutCartLineItemsProps,\r\n index: number,\r\n foundProductAvailability?: ProductAvailableQuantity,\r\n foundProductDeliveryOptions?: ProductDeliveryOptions,\r\n): IFlyoutCartLineItemViewProps => {\r\n const {\r\n imageSettings,\r\n gridSettings,\r\n id,\r\n typeName,\r\n context,\r\n resources,\r\n removeButtonText,\r\n removeItemClickHandler,\r\n } = props;\r\n\r\n const availableQuantityInStock = _getCartItemAvailableQuantity(\r\n props.isStockCheckEnabled,\r\n props.outOfStockThreshold,\r\n foundProductAvailability,\r\n );\r\n const maxQuantity =\r\n product &&\r\n _getCartItemMaxQuantity(\r\n props.maxCartlineQuantity,\r\n props.isStockCheckEnabled,\r\n availableQuantityInStock,\r\n props.isQuantityLimitsFeatureEnabled,\r\n product?.Behavior?.MaximumQuantity || 0,\r\n );\r\n\r\n // Check if the product is service or not by product type\r\n const isServiceItem = product.ItemTypeValue === ReleasedProductType.Service;\r\n\r\n const onRemoveClickHandler = onRemoveClickFunction(\r\n removeItemClickHandler,\r\n cartline,\r\n );\r\n const payLoad = getPayloadObject(\r\n \"click\",\r\n props.telemetryContent!,\r\n TelemetryConstant.RemoveCartItem,\r\n );\r\n const removeCartItemAttribute = getTelemetryAttributes(\r\n props.telemetryContent!,\r\n payLoad,\r\n );\r\n\r\n let productUrl = getProductUrlSync(\r\n product,\r\n props.context.actionContext,\r\n undefined,\r\n );\r\n if (\r\n MsDyn365.isBrowser &&\r\n isChannelTypeB2B(props.context.actionContext.requestContext)\r\n ) {\r\n const fullUrl = new URL(productUrl, window.location.href);\r\n fullUrl.searchParams.set(\"catalogid\", `${cartline.CatalogId ?? 0}`);\r\n productUrl = fullUrl.href;\r\n }\r\n\r\n return {\r\n data: {\r\n product,\r\n cartline,\r\n },\r\n hasError:\r\n !isServiceItem && props.isStockCheckEnabled\r\n ? cartline.Quantity! > maxQuantity\r\n : false,\r\n cartline: (\r\n \r\n ),\r\n remove: (\r\n \r\n {removeButtonText}\r\n \r\n ),\r\n storeLocation: _renderStoreLocation(cartline, props),\r\n };\r\n};\r\n\r\nconst _renderDeliveryLocation = (\r\n cartLine: CartLine | null | undefined,\r\n props: IFlyoutCartLineItemsProps,\r\n): string | undefined => {\r\n let deliverylocation;\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n const orgUnitName = _getOrgUnitName(\r\n cartLine.FulfillmentStoreId,\r\n props.orgUnitLocations,\r\n );\r\n\r\n let foundProductDeliveryOption;\r\n if (\r\n props.productDeliveryOptions &&\r\n props.productDeliveryOptions.length > 0\r\n ) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(\r\n (deliveryOption) => {\r\n return (\r\n deliveryOption && deliveryOption.ProductId === cartLine.ProductId\r\n );\r\n },\r\n );\r\n }\r\n const delivery = foundProductDeliveryOption?.DeliveryOptions?.find(\r\n (option) => option.Code === cartLine.DeliveryMode,\r\n );\r\n const location = delivery?.Description;\r\n\r\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\r\n if (location) {\r\n deliverylocation = `${location}, ${orgUnitName}`;\r\n } else {\r\n deliverylocation = `${orgUnitName}`;\r\n }\r\n } else {\r\n deliverylocation = props.resources.shippingText;\r\n }\r\n return deliverylocation;\r\n};\r\n\r\nconst _renderStoreLocation = (\r\n cartLine: CartLine | null | undefined,\r\n props: IFlyoutCartLineItemsProps,\r\n): JSX.Element | null => {\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n const orgUnitName = _getOrgUnitName(\r\n cartLine.FulfillmentStoreId,\r\n props.orgUnitLocations,\r\n );\r\n\r\n if (orgUnitName) {\r\n return (\r\n
\r\n {orgUnitName}\r\n
\r\n );\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nconst _getOrgUnitName = (\r\n fulfillmentStoreId: string | undefined,\r\n orgUnitLocations: OrgUnitLocation[] | undefined,\r\n) => {\r\n if (\r\n !orgUnitLocations ||\r\n !fulfillmentStoreId ||\r\n orgUnitLocations.length === 0\r\n ) {\r\n return \"\";\r\n }\r\n\r\n const foundLocation = orgUnitLocations.find((orgUnitLocation) => {\r\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\r\n });\r\n\r\n if (foundLocation) {\r\n return foundLocation.OrgUnitName;\r\n }\r\n return fulfillmentStoreId;\r\n};\r\n\r\nconst _assembleCartlines = (\r\n cartlines: CartLine[],\r\n products: SimpleProduct[] | undefined,\r\n props: IFlyoutCartLineItemsProps,\r\n): IFlyoutCartLineItemViewProps[] | null => {\r\n const reactNodes: IFlyoutCartLineItemViewProps[] = [];\r\n\r\n if (!products || products.length === 0) {\r\n props.context.telemetry.error(\r\n \"Cartlines content is empty, module wont render\",\r\n );\r\n return null;\r\n }\r\n\r\n cartlines.map((cartline, index) => {\r\n let product;\r\n if (props.isQuantityLimitsFeatureEnabled) {\r\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\r\n // to check productId and WarehouseId for identification.\r\n product = getProductByProductIdAndWarehouse(\r\n cartline.ProductId,\r\n products,\r\n cartline.WarehouseId,\r\n props.cartState,\r\n );\r\n } else {\r\n product = getProductByProductId(cartline.ProductId, products);\r\n }\r\n let foundProductAvailability;\r\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\r\n foundProductAvailability = props.productAvailabilites.find(\r\n (productAvailability) => {\r\n return (\r\n productAvailability.ProductAvailableQuantity?.ProductId! ===\r\n cartline.ProductId\r\n );\r\n },\r\n );\r\n }\r\n let foundProductDeliveryOption;\r\n if (\r\n props.productDeliveryOptions &&\r\n props.productDeliveryOptions.length > 0\r\n ) {\r\n foundProductDeliveryOption = props.productDeliveryOptions.find(\r\n (deliveryOption) => {\r\n return (\r\n deliveryOption && deliveryOption.ProductId === cartline.ProductId\r\n );\r\n },\r\n );\r\n }\r\n if (product) {\r\n reactNodes.push(\r\n _assembleNode(\r\n cartline,\r\n product,\r\n props,\r\n index,\r\n foundProductAvailability?.ProductAvailableQuantity,\r\n foundProductDeliveryOption,\r\n ),\r\n );\r\n }\r\n });\r\n\r\n return reactNodes;\r\n};\r\n\r\n/**\r\n * CartLineItems component.\r\n */\r\n\r\nexport const FlyoutCartLineItems = (props: IFlyoutCartLineItemsProps) => {\r\n const {products, cartlines} = props;\r\n return _assembleCartlines(cartlines, products, props);\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport {IActionContext} from \"@msdyn365-commerce/core\";\r\nimport {ICartState} from \"@msdyn365-commerce/global-state\";\r\nimport {\r\n ProductDeliveryOptions,\r\n SimpleProduct,\r\n} from \"@msdyn365-commerce/retail-proxy\";\r\nimport {\r\n ActiveCartProductsInput,\r\n getActiveCartProductsAction,\r\n getAvailabilitiesForCartLineItems,\r\n getDeliveryOptionsForCartLineItems,\r\n IProductInventoryInformation,\r\n ProductAvailabilitiesForCartLineItems,\r\n ProductDeliveryOptionsForCartLineItems,\r\n} from \"@msdyn365-commerce-modules/retail-actions\";\r\n\r\n/**\r\n * IMiniCartData entity interface.\r\n */\r\nexport interface IMiniCartData {\r\n products?: SimpleProduct[];\r\n productAvailabilites?: IProductInventoryInformation[];\r\n deliveryOptions?: ProductDeliveryOptions[];\r\n}\r\n\r\nexport const createInput = () => {\r\n return new ActiveCartProductsInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a mini cart data.\r\n * @param ctx\r\n * @param cartState\r\n */\r\nexport async function getMiniCartData(\r\n ctx: IActionContext,\r\n cartState: ICartState,\r\n): Promise {\r\n const miniCartData: IMiniCartData = {};\r\n\r\n const cart = cartState.cart;\r\n\r\n // If there are cart lines, make call to get products\r\n // If there are invocie linese, then there is no products, so don't make call to get products\r\n if (\r\n cart &&\r\n cart.CartLines &&\r\n cart.CartLines.length > 0 &&\r\n !cartState.hasInvoiceLine\r\n ) {\r\n await getActiveCartProductsAction(new ActiveCartProductsInput(), ctx)\r\n .then((products) => {\r\n if (products) {\r\n miniCartData.products = products;\r\n }\r\n })\r\n .catch((error) => {\r\n ctx.telemetry.exception(error);\r\n throw new Error(\r\n \"[getActiveCartWithProdcuts]Unable to hydrate cart with product information\",\r\n );\r\n });\r\n\r\n await getAvailabilitiesForCartLineItems(\r\n new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings),\r\n ctx,\r\n )\r\n .then((availableQuantity) => {\r\n if (availableQuantity) {\r\n miniCartData.productAvailabilites = availableQuantity;\r\n }\r\n })\r\n .catch((error) => {\r\n ctx.telemetry.exception(error);\r\n /* throw new Error(\r\n \"[getActiveCartWithProdcuts]Unable to hydrate cart with product information\"\r\n ); */\r\n });\r\n\r\n await getDeliveryOptionsForCartLineItems(\r\n new ProductDeliveryOptionsForCartLineItems(\r\n ctx.requestContext.apiSettings,\r\n ),\r\n ctx,\r\n )\r\n .then((deliveryOptions) => {\r\n if (deliveryOptions) {\r\n miniCartData.deliveryOptions = deliveryOptions;\r\n }\r\n })\r\n .catch((error) => {\r\n ctx.telemetry.exception(error);\r\n throw new Error(\r\n \"[getActiveCartWithProdcuts]Unable to hydrate cart with product information\",\r\n );\r\n });\r\n }\r\n\r\n return miniCartData;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n AddToCartBehavior,\r\n CartIconComponent,\r\n} from \"@msdyn365-commerce/components\";\r\nimport {\r\n getUrlSync,\r\n IDictionary,\r\n IImageSettings,\r\n msdyn365Commerce,\r\n TelemetryEvent,\r\n isOboRequest,\r\n} from \"@msdyn365-commerce/core\";\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n CartLineValidationResultsByLineId,\r\n OrgUnitLocation,\r\n CommerceProperty,\r\n} from \"@msdyn365-commerce/retail-proxy\";\r\nimport { validateCartAsync } from \"@msdyn365-commerce-modules/cart-utilities\";\r\nimport {\r\n ArrayExtensions,\r\n validateCartLinesInventory,\r\n} from \"@msdyn365-commerce-modules/retail-actions\";\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n INodeProps,\r\n ITelemetryContent,\r\n TelemetryConstant,\r\n UncontrolledTooltip,\r\n updateMaxQuantityForCartLineItem,\r\n urlCheck,\r\n} from \"@msdyn365-commerce-modules/utilities\";\r\nimport classnames from \"classnames\";\r\nimport { reaction } from \"mobx\";\r\nimport { observer } from \"mobx-react\";\r\nimport React from \"react\";\r\n\r\nimport { IBritaxCartIconData } from \"./britax-cart-icon.data\";\r\nimport {\r\n cartLinesSortOrder,\r\n IBritaxCartIconProps,\r\n} from \"./britax-cart-icon.props.autogenerated\";\r\nimport {\r\n FlyoutCartLineItems,\r\n IFlyoutCartLineItemViewProps,\r\n} from \"./components/flyout-cart-line-items\";\r\nimport {\r\n getMiniCartData,\r\n IMiniCartData,\r\n} from \"./utils/get-products-in-mini-cart\";\r\n\r\nexport interface IMiniCartState {\r\n miniCartData: IMiniCartData;\r\n orgUnitLocations?: OrgUnitLocation[];\r\n isQuantityLimitsFeatureEnabled: boolean;\r\n isCartValid: boolean;\r\n IsDropShipCustomer: boolean;\r\n}\r\n\r\nexport interface ICartIconViewProps\r\n extends IBritaxCartIconProps {\r\n className: string;\r\n cartIcon: React.ReactNode;\r\n FlyoutContainer?: INodeProps;\r\n CartlinesWrapper: INodeProps;\r\n miniCartWrapper: INodeProps;\r\n miniCartItemWrapper: INodeProps;\r\n cartlines?: IFlyoutCartLineItemViewProps[];\r\n flyoutTitle: React.ReactNode;\r\n totalPrice: React.ReactNode;\r\n checkoutAsGuestButton?: React.ReactNode;\r\n checkoutAsSignInUserButton?: React.ReactNode;\r\n checkoutAsDropshipButton?: React.ReactNode;\r\n goToCartButton?: React.ReactNode;\r\n waitingComponent?: React.ReactNode;\r\n isCartLoading: boolean;\r\n checkoutBlockedDueToUnavailableFunds?: React.ReactNode;\r\n\r\n removeItemClickHandler(cartlineToRemove: CartLine): void;\r\n}\r\n\r\n/**\r\n *\r\n * Cart component.\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nclass CartIcon extends React.Component<\r\n IBritaxCartIconProps,\r\n IMiniCartState\r\n> {\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly checkoutBySignInAttributes: IDictionary | undefined;\r\n\r\n private readonly checkoutByGuestAttributes: IDictionary | undefined;\r\n\r\n private readonly viewShoppingBagAttributes: IDictionary | undefined;\r\n\r\n private retailMultiplePickUpOptionEnabled?: boolean = false;\r\n\r\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n private lastValidatedCartVersion: number | undefined;\r\n\r\n constructor(props: IBritaxCartIconProps) {\r\n super(props);\r\n this.state = {\r\n miniCartData: {},\r\n isCartValid: true,\r\n isQuantityLimitsFeatureEnabled: false,\r\n IsDropShipCustomer: false,\r\n };\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n const payload = getPayloadObject(\r\n TelemetryEvent.CheckOut,\r\n this.telemetryContent,\r\n TelemetryConstant.Checkout\r\n );\r\n this.checkoutBySignInAttributes = getTelemetryAttributes(\r\n this.telemetryContent,\r\n payload\r\n );\r\n\r\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\r\n this.checkoutByGuestAttributes = getTelemetryAttributes(\r\n this.telemetryContent,\r\n payload\r\n );\r\n\r\n payload.contentAction.etext = TelemetryConstant.ViewShoppingBag;\r\n this.viewShoppingBagAttributes = getTelemetryAttributes(\r\n this.telemetryContent,\r\n payload\r\n );\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const context = this.props.context.actionContext;\r\n // VSI Start - DropShip Customization\r\n const attributes =\r\n this.props.data.customerInformation.result?.Attributes || [];\r\n const isDropShipAttribute =\r\n attributes.find((attr) => attr.Name === \"Is Drop Ship\")?.AttributeValue\r\n ?.BooleanValue || false;\r\n this.setState({\r\n IsDropShipCustomer: isDropShipAttribute,\r\n });\r\n // VSI End - DropShip Customization\r\n\r\n reaction(\r\n () => this.props.data.cart.result?.cart.CartLines,\r\n async () => {\r\n this.setState({\r\n miniCartData: await getMiniCartData(\r\n context,\r\n this.props.data.cart.result!\r\n ),\r\n });\r\n }\r\n );\r\n\r\n this.setState({\r\n orgUnitLocations: this.props.data.orgUnitLocations?.result,\r\n });\r\n await this._setQuantityLimitsFeatureFlag();\r\n this._validateCart();\r\n }\r\n\r\n public componentDidUpdate(\r\n prevProps: IBritaxCartIconProps\r\n ): void {\r\n this._validateCart();\r\n }\r\n\r\n public shouldComponentUpdate(\r\n nextProps: IBritaxCartIconProps,\r\n nextState: IMiniCartState\r\n ): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n private readonly _handleCheckout = (value: string, url: string): void => {\r\n const cart = this.props.data.cart.result;\r\n let dropShipCheckoutRecord: CommerceProperty = {\r\n Key: \"isDropshipCheckout\",\r\n Value: {\r\n BooleanValue: false,\r\n },\r\n };\r\n\r\n if (value === \"dropship\") {\r\n dropShipCheckoutRecord = {\r\n Key: \"isDropshipCheckout\",\r\n Value: {\r\n BooleanValue: true,\r\n },\r\n };\r\n }\r\n cart?.updateExtensionProperties({\r\n newExtensionProperties: [\r\n ...(cart?.cart.ExtensionProperties || []),\r\n dropShipCheckoutRecord,\r\n ],\r\n });\r\n window.location.href = url;\r\n };\r\n // VSI End - DropShip Customizatio\r\n\r\n // eslint-disable-next-line complexity -- disabling the complexity for this method for now as its causing lot of other warnings\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n typeName,\r\n config: { enableHoverCart, isAnonymousCheckout },\r\n context: {\r\n request: {\r\n user: { isAuthenticated, signInUrl },\r\n },\r\n },\r\n context,\r\n resources,\r\n } = this.props;\r\n\r\n const cart =\r\n (this.props.data.cart && this.props.data.cart.result) || undefined;\r\n const guestCheckoutUrl =\r\n getUrlSync(\"checkout\", this.props.context.actionContext) || \"\";\r\n const cartUrl = getUrlSync(\"cart\", this.props.context.actionContext) || \"\";\r\n const checkoutURL = this._getCheckoutURL(\r\n isAuthenticated,\r\n guestCheckoutUrl,\r\n signInUrl || \"\"\r\n );\r\n const isCartEmpty =\r\n cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\r\n const shouldShowMiniCart =\r\n cart?.isProductAddedToCart &&\r\n this.props.context.app.config.addToCartBehavior ===\r\n AddToCartBehavior.showMiniCart;\r\n const hasInvoiceLine = cart?.hasInvoiceLine;\r\n // Adding here for 9.38 version upgradation\r\n const emailDeliveryModeCode = this.props.context.request.channel\r\n ?.EmailDeliveryModeCode;\r\n const cartLines = this._getCartLines();\r\n const validInventoryAcrossCartLines = validateCartLinesInventory(\r\n cart?.cart.CartLines ?? [],\r\n this.state.miniCartData.productAvailabilites ?? [],\r\n this.props.context.actionContext,\r\n this.state.miniCartData.products ?? [],\r\n emailDeliveryModeCode\r\n );\r\n const hasError =\r\n !validInventoryAcrossCartLines?.isValid ||\r\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\r\n !this.state.isCartValid ||\r\n // Adding here for 9.38 version upgradation\r\n this._isCheckoutBlockedDueToUnavailableFunds() ||\r\n (cartLines ? cartLines.some((cartline) => cartline.hasError) : false);\r\n const includeFlyout =\r\n this.props.data.cart &&\r\n this.props.data.cart.status === \"SUCCESS\" &&\r\n enableHoverCart;\r\n const totalItemsInCart = cart?.totalItemsInCart ? cart.totalItemsInCart : 0;\r\n const goToCartButtonText = resources.goToCartButtonTitle.replace(\r\n \"{count}\",\r\n totalItemsInCart.toString()\r\n );\r\n const flyoutTitle = resources.flyoutTitle;\r\n const flyoutTooltip = {\r\n tag: UncontrolledTooltip,\r\n shouldShowMiniCart,\r\n placement: \"bottom-end\",\r\n hideArrow: true,\r\n className: \"ms-cart-icon__flyout-container\",\r\n trigger: \"hover\",\r\n displayMode: \"FLYOUT\",\r\n target: id,\r\n shouldShowCloseButton: true,\r\n cartPageUrl: cartUrl,\r\n hideAriaHidden: true,\r\n };\r\n\r\n // If there are invoice lines, don't update mini cart price\r\n const price =\r\n (cart && !cart.hasInvoiceLine && cart.cart.TotalAmount) || undefined;\r\n const priceString = price\r\n ? resources.totalPriceFormatString.replace(\r\n \"{price}\",\r\n context.cultureFormatter.formatCurrency(price)\r\n )\r\n : \"\";\r\n const multiplePickupStoreSwitchName =\r\n \"Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature\";\r\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\r\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.find(\r\n (feature) => feature.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n cartIcon: (\r\n \r\n ),\r\n cartlines: cartLines,\r\n FlyoutContainer: includeFlyout ? flyoutTooltip : undefined,\r\n CartlinesWrapper: {\r\n className: \"ms-cart-icon__cart-lines\",\r\n },\r\n miniCartWrapper: {\r\n className: classnames(\"ms-cart-icon\"),\r\n id: this.props.id,\r\n },\r\n miniCartItemWrapper: {\r\n className: classnames(\"msc-cart-lines-item\"),\r\n },\r\n\r\n // If there are invoice lines, don't update mini cart checkout button\r\n // Checkout button will display by default to maintain backward compatibility. When Anonymous user checkout is enabled &&\r\n // user is authenticated then we will show the checkout button otherwise we will show the guest checkout button.\r\n checkoutAsSignInUserButton:\r\n !isCartEmpty &&\r\n !hasInvoiceLine &&\r\n (!isAnonymousCheckout || isAuthenticated) ? (\r\n {\r\n e.preventDefault();\r\n this._handleCheckout(\"checkout\", checkoutURL);\r\n }}\r\n title={resources.checkoutButtonTitle}\r\n {...this.checkoutBySignInAttributes}\r\n >\r\n {resources.checkoutButtonTitle}\r\n \r\n ) : null,\r\n // VSI Start - DropShip Customization\r\n checkoutAsDropshipButton:\r\n !isCartEmpty &&\r\n !hasInvoiceLine &&\r\n (!isAnonymousCheckout || isAuthenticated) ? (\r\n this.state.IsDropShipCustomer ? (\r\n {\r\n e.preventDefault();\r\n this._handleCheckout(\"dropship\", checkoutURL);\r\n }}\r\n title={resources.dropShipCheckoutButtonTitle}\r\n >\r\n {resources.dropShipCheckoutButtonTitle}\r\n \r\n ) : null\r\n ) : null,\r\n // VSI End - DropShip Customization\r\n\r\n checkoutAsGuestButton:\r\n isAnonymousCheckout && !isCartEmpty && !isAuthenticated ? (\r\n \r\n {resources.guestCheckoutButtonTitle}\r\n \r\n ) : null,\r\n goToCartButton: (\r\n \r\n {goToCartButtonText}\r\n \r\n ),\r\n checkoutBlockedDueToUnavailableFunds: this._isCheckoutBlockedDueToUnavailableFunds() ? (\r\n \r\n \r\n \r\n \r\n {resources.checkoutBlockedDueToUnavailableFundsTitle}\r\n \r\n {resources.checkoutBlockedDueToUnavailableFundsMessage}\r\n \r\n \r\n ) : null,\r\n flyoutTitle: (\r\n {flyoutTitle}\r\n ),\r\n totalPrice:
{priceString}
,\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _validateCart(): void {\r\n const {\r\n data: { cart },\r\n } = this.props;\r\n const cartVersion = cart.result?.cart?.Version ?? undefined;\r\n if (this.lastValidatedCartVersion === cartVersion) {\r\n return;\r\n }\r\n\r\n this.lastValidatedCartVersion = cartVersion; // This field is populated to block concurrent requests\r\n\r\n // Adding here for 9.38 version upgradation\r\n\r\n if (this.state.isQuantityLimitsFeatureEnabled) {\r\n validateCartAsync(cart, this.props.telemetry, this.props.context)\r\n .then((result: CartLineValidationResultsByLineId | undefined) => {\r\n this.setState({\r\n isCartValid: !ArrayExtensions.hasElements(\r\n result?.ValidationResultsPairs\r\n ),\r\n });\r\n })\r\n .catch(() => {\r\n this.setState({ isCartValid: false });\r\n });\r\n } else {\r\n this.setState({ isCartValid: true });\r\n }\r\n }\r\n\r\n private _getCheckoutURL(\r\n isAuthenticated: boolean,\r\n guestCheckoutUrl: string,\r\n signInUrl: string\r\n ): string {\r\n if (isAuthenticated) {\r\n return guestCheckoutUrl;\r\n }\r\n\r\n const isAbsoluteUrl = urlCheck(guestCheckoutUrl);\r\n let returnURL = guestCheckoutUrl;\r\n if (msdyn365Commerce.isBrowser && !isAbsoluteUrl) {\r\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\r\n }\r\n\r\n return `${signInUrl}${!signInUrl.includes(\"?\") ? \"?\" : \"&\"}ru=${returnURL}`;\r\n }\r\n\r\n private _isCheckoutBlockedDueToUnavailableFunds(): boolean {\r\n if (isOboRequest(this.props.context.request)) {\r\n const customerInfo =\r\n this.props.data.customerInformation &&\r\n this.props.data.customerInformation?.result;\r\n return !!customerInfo && !customerInfo.AllowOnAccountPayment; //VSI-Customization: OBO: Remove Customer Account Credit Limit zero Check.\r\n //return !!customerInfo && (!customerInfo.AllowOnAccountPayment || customerInfo.CreditLimit === 0);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Sort cartline items.\r\n * @param cartlines - Cartlines to be sorted.\r\n * @param sortOrder - Ascending or descending.\r\n * @returns - Sorted cartlines.\r\n */\r\n private readonly getSortedCartLines = (\r\n cartlines: CartLine[],\r\n sortOrder?: cartLinesSortOrder\r\n ): CartLine[] => {\r\n const lines: CartLine[] = [...cartlines];\r\n const zero: number = 0;\r\n\r\n if (sortOrder === cartLinesSortOrder.descending) {\r\n return lines.sort(\r\n (item1, item2) =>\r\n (item2.LineNumber ?? zero) - (item1.LineNumber ?? zero)\r\n );\r\n }\r\n return lines.sort(\r\n (item1, item2) => (item1.LineNumber ?? zero) - (item2.LineNumber ?? zero)\r\n );\r\n };\r\n\r\n private _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\r\n const {\r\n context: {\r\n request: {\r\n channel: { PickupDeliveryModeCode } = {\r\n PickupDeliveryModeCode: undefined,\r\n },\r\n },\r\n },\r\n config,\r\n telemetry,\r\n resources,\r\n } = this.props;\r\n\r\n const imageSettings = this._getImageSettings(config.imageSettings);\r\n const cart = this.props.data.cart && this.props.data.cart.result;\r\n\r\n // Cart-icon could be placed in each page\r\n // so we check cart content to reduce number of RS calls\r\n return this.state.miniCartData.products &&\r\n cart &&\r\n cart.cart.CartLines &&\r\n cart.cart.CartLines.length > 0\r\n ? FlyoutCartLineItems({\r\n cartlines: this.getSortedCartLines(\r\n cart.cart.CartLines,\r\n config.cartLinesSortOrder\r\n ),\r\n products: this.state.miniCartData.products,\r\n productAvailabilites: this.state.miniCartData.productAvailabilites,\r\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\r\n imageSettings,\r\n outOfStockThreshold:\r\n this.props.context.app.config.outOfStockThreshold || 0,\r\n isStockCheckEnabled:\r\n this.props.context.app.config.enableStockCheck || false,\r\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(\r\n this.props.context.app.config.maxQuantityForCartLineItem\r\n ),\r\n gridSettings: this.props.context.request.gridSettings!,\r\n context: this.props.context,\r\n typeName: this.props.typeName,\r\n id: this.props.id,\r\n resources: {\r\n sizeString: resources.productDimensionTypeSize,\r\n colorString: resources.productDimensionTypeColor,\r\n configString: resources.productDimensionTypeConfiguration,\r\n styleString: resources.productDimensionTypeStyle,\r\n quantityDisplayString: resources.quantityDisplayText,\r\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\r\n inputQuantityAriaLabel: \"\", // Not used\r\n discountStringText: \"\", // Not used\r\n originalPriceText: \"\",\r\n currentPriceText: \"\",\r\n shippingChargesText: \"\",\r\n shippingText: resources.shippingText,\r\n },\r\n telemetry,\r\n removeButtonText: resources.removeCartButtonText,\r\n outOfStockText: \"\", // Not used\r\n outOfRangeOneText: \"\", // Not used\r\n outOfRangeFormatText: \"\", // Not used\r\n cartState: cart,\r\n orgUnitLocations: this.state.orgUnitLocations,\r\n removeItemClickHandler: this._removeItemFromCartHandler,\r\n pickupDeliveryModeCode: PickupDeliveryModeCode,\r\n telemetryContent: this.telemetryContent,\r\n channelDeliveryOptionConfig: this.retailMultiplePickUpOptionEnabled\r\n ? this.channelDeliveryOptionConfig\r\n : undefined,\r\n isQuantityLimitsFeatureEnabled: this.state\r\n .isQuantityLimitsFeatureEnabled,\r\n catalogs: this.props.data.catalogs?.result,\r\n })\r\n : null;\r\n }\r\n\r\n private readonly _getImageSettings = (\r\n imageSettings: IImageSettings | undefined\r\n ): IImageSettings => {\r\n return (\r\n imageSettings || {\r\n viewports: {\r\n xs: { q: \"w=80&h=94&m=6\", w: 0, h: 0 },\r\n sm: { q: \"w=148&h=174&m=6\", w: 0, h: 0 },\r\n lg: { q: \"w=148&h=174&m=6\", w: 0, h: 0 },\r\n },\r\n lazyload: true,\r\n }\r\n );\r\n };\r\n\r\n private readonly _removeItemFromCartHandler = (\r\n cartlineToRemove: CartLine\r\n ) => {\r\n if (this.props.data.cart.result) {\r\n const input = {\r\n cartLineIds: [cartlineToRemove.LineId!.toString()],\r\n };\r\n this.props.data.cart.result.removeCartLines(input).catch((error) => {\r\n this.props.telemetry.warning(error);\r\n this.props.telemetry.debug(\"Unable to Remove Cart Line\");\r\n });\r\n }\r\n };\r\n // For 10.0.40 Version Upgradation\r\n private async _setQuantityLimitsFeatureFlag(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isChannelQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n (featureState) =>\r\n featureState.Name ===\r\n \"Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature\"\r\n )?.IsEnabled || false;\r\n\r\n if (isChannelQuantityLimitsFeatureEnabledInHq) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n\r\n return;\r\n }\r\n\r\n const useSiteBuilderSettings = featureStatuses?.find(\r\n (featureState) =>\r\n featureState.Name === \"RevertToSiteBuilderOrderQuantityLimitsSettings\"\r\n )?.IsEnabled;\r\n\r\n if (useSiteBuilderSettings) {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context\r\n ?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n\r\n if (\r\n !defaultOrderQuantityLimitsFeatureConfig ||\r\n defaultOrderQuantityLimitsFeatureConfig === \"none\"\r\n ) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n\r\n return;\r\n }\r\n\r\n try {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isQuantityLimitsFeatureEnabledInHq =\r\n featureStatuses?.find(\r\n (featureState) =>\r\n featureState.Name ===\r\n \"Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature\"\r\n )?.IsEnabled || false;\r\n\r\n if (!isQuantityLimitsFeatureEnabledInHq) {\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n\r\n return;\r\n }\r\n } catch (error) {\r\n // this.props.telemetry.warning(error);\r\n\r\n this.props.telemetry.debug(\"Unable to get feature states\");\r\n\r\n this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n\r\n return;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === \"all\") {\r\n this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n } else {\r\n this.props.data.customerInformation\r\n\r\n .then((customerInfo) => {\r\n const result =\r\n !!customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === \"b2b\" &&\r\n customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === \"b2c\" &&\r\n !customerInfo.IsB2b));\r\n\r\n this.setState({ isQuantityLimitsFeatureEnabled: result });\r\n })\r\n\r\n .catch((error) => {\r\n this.props.telemetry.warning(error);\r\n\r\n this.props.telemetry.debug(\"Unable to get customer info\");\r\n });\r\n }\r\n } else {\r\n const cartConfiguration = await this.props.data.cartConfiguration;\r\n\r\n this.setState({\r\n isQuantityLimitsFeatureEnabled: !(\r\n cartConfiguration?.IgnoreOrderSettings ?? false\r\n ),\r\n });\r\n\r\n return;\r\n }\r\n\r\n //For 10.0.40 Version Upgradation\r\n\r\n // private async _setOrderQuantityLimitsFeatureFlag(): Promise {\r\n // const featureStatuses = await this.props.data.featureState;\r\n\r\n // const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request\r\n // ?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n // if (\r\n // !defaultOrderQuantityLimitsFeatureConfig ||\r\n // defaultOrderQuantityLimitsFeatureConfig === \"none\"\r\n // ) {\r\n // this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n // return;\r\n // }\r\n\r\n // try {\r\n // // const featureStatuses = await this.props.data.featureState;\r\n // const isQuantityLimitsFeatureEnabledInHq =\r\n // featureStatuses.find(\r\n // (featureState) =>\r\n // featureState.Name ===\r\n // \"Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature\"\r\n // )?.IsEnabled || false;\r\n // if (!isQuantityLimitsFeatureEnabledInHq) {\r\n // this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n // return;\r\n // }\r\n // } catch (error) {\r\n // this.props.telemetry.warning(error as string);\r\n // this.props.telemetry.debug(\"Unable to get feature states\");\r\n // this.setState({ isQuantityLimitsFeatureEnabled: false });\r\n // return;\r\n // }\r\n // if (defaultOrderQuantityLimitsFeatureConfig === \"all\") {\r\n // this.setState({ isQuantityLimitsFeatureEnabled: true });\r\n // } else {\r\n // this.props.data.customerInformation\r\n // .then((customerInfo) => {\r\n // const result =\r\n // !!customerInfo &&\r\n // ((defaultOrderQuantityLimitsFeatureConfig === \"b2b\" &&\r\n // customerInfo.IsB2b) ||\r\n // (defaultOrderQuantityLimitsFeatureConfig === \"b2c\" &&\r\n // !customerInfo.IsB2b));\r\n // this.setState({ isQuantityLimitsFeatureEnabled: result });\r\n // })\r\n // .catch((error) => {\r\n // this.props.telemetry.warning(error);\r\n // this.props.telemetry.debug(\"Unable to get customer info\");\r\n // });\r\n // }\r\n // }\r\n }\r\n}\r\n\r\nexport default CartIcon;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Node } from \"@msdyn365-commerce-modules/utilities\";\r\nimport * as React from \"react\";\r\n\r\nimport { ICartIconViewProps } from \"./britax-cart-icon\";\r\n//import {IFlyoutCartLineItemViewProps} from \"./components/flyout-cart-line-items\";\r\nimport { getProductsReferenceNumberAsync } from \"./../../themes/britax-romers/actions/get-reference-number\";\r\nimport CartLine from \"./../../themes/britax-romers/views/components/cartlineitem.component\";\r\nconst RenderCartlines = (props: any): any => {\r\n const { cartLines, prop } = props;\r\n\r\n //const [productTypes, setProductTypes] = useState([]);\r\n const [referenceNumber, setReferenceNumber] = React.useState([]);\r\n\r\n let pids: any = [];\r\n\r\n let recordIds: any = [];\r\n\r\n React.useEffect(() => {\r\n const items =\r\n cartLines &&\r\n cartLines.map((line: any) => {\r\n return line.data.cartline;\r\n });\r\n\r\n items?.map((data: any) =>\r\n pids.indexOf(data.ProductId) == -1 ? pids.push(data.ProductId) : \"\"\r\n );\r\n\r\n items?.map((data: any) => recordIds.push(data.ProductId));\r\n\r\n if (pids.length > 0 && referenceNumber.length == 0) {\r\n getProductsReferenceNumberAsync(\r\n { callerContext: prop.context.actionContext },\r\n pids\r\n ).then((res: any) => {\r\n var refArray: any[] = [];\r\n res?.map((d: any) => {\r\n refArray[d.Id] = d.ReferenceNumber;\r\n });\r\n setReferenceNumber(refArray);\r\n });\r\n }\r\n }, []);\r\n\r\n const currencyCode: any = prop.data.customerInformation?.result?.CurrencyCode;\r\n\r\n if (!cartLines) {\r\n prop.context.telemetry.error(\r\n \"Cartlines content is empty, module wont render\"\r\n );\r\n return null;\r\n }\r\n\r\n return cartLines.map((cartLine: any, index: any) => {\r\n return (\r\n \r\n \r\n
\r\n {prop.context.cultureFormatter.formatCurrency(\r\n Number(cartLine.data?.product?.Price)\r\n )}\r\n
\r\n \r\n {prop.resources.referenceNumber}:{\" \"}\r\n {referenceNumber[cartLine.data.product?.RecordId]\r\n ? referenceNumber[cartLine.data.product?.RecordId]\r\n : null}\r\n \r\n {cartLine.storeLocation}\r\n {cartLine.remove}\r\n
\r\n );\r\n });\r\n};\r\n\r\nconst CartIconView: React.FC = (\r\n props: ICartIconViewProps\r\n) => {\r\n let price = 0;\r\n props?.cartlines?.map((d: any) => (price += d.data.cartline.TotalAmount));\r\n var counter = 0;\r\n // let [counterDis, setCounterDis] = React.useState(0);\r\n props?.cartlines?.map((element: any, index: any) => {\r\n element.cartline.props.data.cartLine.DiscountLines.map((d: any) => {\r\n if (d.CustomerDiscountTypeValue == 3) {\r\n counter += d.EffectiveAmount;\r\n }\r\n });\r\n });\r\n\r\n return (\r\n \r\n {props.cartIcon}\r\n {props.FlyoutContainer ? (\r\n \r\n {props.flyoutTitle}\r\n \r\n \r\n \r\n\r\n
\r\n {counter != 0 ? (\r\n
\r\n {props.resources.cartDiscount}\r\n \r\n : -{props.context.cultureFormatter.formatCurrency(counter)}\r\n \r\n
\r\n ) : (\r\n <>\r\n )}\r\n\r\n {//@ts-ignore\r\n props?.totalPrice?.props.children.split(\":\")[0] ? (\r\n //@ts-ignore\r\n {props.totalPrice.props.children.split(\":\")[0]}: \r\n ) : (\r\n <>\r\n )}\r\n {//@ts-ignore\r\n props?.totalPrice?.props.children.split(\":\")[0]\r\n ? props.context.cultureFormatter.formatCurrency(price)\r\n : null}\r\n
\r\n {props.checkoutAsSignInUserButton}\r\n {props.checkoutAsDropshipButton}\r\n {props.goToCartButton}\r\n
\r\n ) : (\r\n false\r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default CartIconView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['britax-cart-icon'] = {\n c: () => require('partner/modules/britax-cart-icon/britax-cart-icon.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action', runOn: 1},{name:'cartConfiguration', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration', runOn: 0},{name:'catalogs', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerBalances', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orgUnitLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'britax-cart-icon',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/britax-cart-icon'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-cart-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-catalogs');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/search-org-unit-locations');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/get-cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|britax-cart-icon|britax-cart-icon'] = {\n c: () => require('partner/modules/britax-cart-icon/britax-cart-icon.view.tsx'),\n cn: '__local__-__local__-britax-cart-icon'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { ProductDeliveryOptions, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n ActiveCartProductsInput,\n getActiveCartProductsAction,\n getAvailabilitiesForCartLineItems,\n getDeliveryOptionsForCartLineItems,\n IProductInventoryInformation,\n ProductAvailabilitiesForCartLineItems,\n ProductDeliveryOptionsForCartLineItems\n} from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * IMiniCartData entity interface.\n */\nexport interface IMiniCartData {\n products?: SimpleProduct[];\n productAvailabilites?: IProductInventoryInformation[];\n deliveryOptions?: ProductDeliveryOptions[];\n}\n\nexport const createInput = () => {\n return new ActiveCartProductsInput();\n};\n\n/**\n * Calls the Retail API and returns a mini cart data.\n * @param ctx\n * @param cartState\n */\nexport async function getMiniCartData(ctx: IActionContext, cartState: ICartState): Promise {\n const miniCartData: IMiniCartData = {};\n\n const cart = cartState.cart;\n\n // If there are cart lines, make call to get products\n // If there are invocie linese, then there is no products, so don't make call to get products\n if (cart && cart.CartLines && cart.CartLines.length > 0 && !cartState.hasInvoiceLine) {\n await getActiveCartProductsAction(new ActiveCartProductsInput(), ctx)\n .then(products => {\n if (products) {\n miniCartData.products = products;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n\n await getAvailabilitiesForCartLineItems(new ProductAvailabilitiesForCartLineItems(ctx.requestContext.apiSettings), ctx)\n .then(availableQuantity => {\n if (availableQuantity) {\n miniCartData.productAvailabilites = availableQuantity;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n\n await getDeliveryOptionsForCartLineItems(new ProductDeliveryOptionsForCartLineItems(ctx.requestContext.apiSettings), ctx)\n .then(deliveryOptions => {\n if (deliveryOptions) {\n miniCartData.deliveryOptions = deliveryOptions;\n }\n })\n .catch(error => {\n ctx.telemetry.exception(error);\n throw new Error('[getActiveCartWithProdcuts]Unable to hydrate cart with product information');\n });\n }\n\n return miniCartData;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AddToCartBehavior, CartIconComponent } from '@msdyn365-commerce/components';\nimport { getUrlSync, IDictionary, IImageSettings, msdyn365Commerce, TelemetryEvent } from '@msdyn365-commerce/core';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n CartLineValidationResultsByLineId,\n OrgUnitLocation\n} from '@msdyn365-commerce/retail-proxy';\nimport { validateCartAsync } from '@msdyn365-commerce-modules/cart-utilities';\nimport { ArrayExtensions, validateCartLinesInventory } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n INodeProps,\n ITelemetryContent,\n TelemetryConstant,\n UncontrolledTooltip,\n updateMaxQuantityForCartLineItem,\n urlCheck\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport React from 'react';\n\nimport { ICartIconData } from './cart-icon.data';\nimport { cartLinesSortOrder, ICartIconProps } from './cart-icon.props.autogenerated';\nimport { FlyoutCartLineItems, IFlyoutCartLineItemViewProps } from './components/flyout-cart-line-items';\nimport { getMiniCartData, IMiniCartData } from './utils/get-products-in-mini-cart';\n\nexport interface IMiniCartState {\n miniCartData: IMiniCartData;\n orgUnitLocations?: OrgUnitLocation[];\n isQuantityLimitsFeatureEnabled: boolean;\n isCartValid: boolean;\n}\n\nexport interface ICartIconViewProps extends ICartIconProps {\n className: string;\n cartIcon: React.ReactNode;\n FlyoutContainer?: INodeProps;\n CartlinesWrapper: INodeProps;\n miniCartWrapper: INodeProps;\n miniCartItemWrapper: INodeProps;\n cartlines?: IFlyoutCartLineItemViewProps[];\n flyoutTitle: React.ReactNode;\n totalPrice: React.ReactNode;\n checkoutAsGuestButton?: React.ReactNode;\n checkoutAsSignInUserButton?: React.ReactNode;\n goToCartButton?: React.ReactNode;\n waitingComponent?: React.ReactNode;\n isCartLoading: boolean;\n checkoutBlockedDueToUnavailableFunds?: React.ReactNode;\n\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n}\n\n/**\n *\n * Cart component.\n * @extends {React.PureComponent>}\n */\n@observer\nclass CartIcon extends React.Component, IMiniCartState> {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly checkoutBySignInAttributes: IDictionary | undefined;\n\n private readonly checkoutByGuestAttributes: IDictionary | undefined;\n\n private readonly viewShoppingBagAttributes: IDictionary | undefined;\n\n private retailMultiplePickUpOptionEnabled?: boolean = false;\n\n private channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n private lastValidatedCartVersion: number | undefined;\n\n constructor(props: ICartIconProps) {\n super(props);\n this.state = {\n miniCartData: {},\n isCartValid: true,\n isQuantityLimitsFeatureEnabled: false\n };\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n const payload = getPayloadObject(TelemetryEvent.CheckOut, this.telemetryContent, TelemetryConstant.Checkout);\n this.checkoutBySignInAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n\n payload.contentAction.etext = TelemetryConstant.GuestCheckout;\n this.checkoutByGuestAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n\n payload.contentAction.etext = TelemetryConstant.ViewShoppingBag;\n this.viewShoppingBagAttributes = getTelemetryAttributes(this.telemetryContent, payload);\n }\n\n public async componentDidMount(): Promise {\n const context = this.props.context.actionContext;\n\n reaction(\n () => this.props.data.cart.result?.cart.CartLines,\n async () => {\n this.setState({\n miniCartData: await getMiniCartData(context, this.props.data.cart.result!)\n });\n }\n );\n await this._setQuantityLimitsFeatureFlag();\n\n this.setState({\n orgUnitLocations: this.props.data.orgUnitLocations?.result\n });\n\n this._validateCart();\n }\n\n public componentDidUpdate(prevProps: ICartIconProps): void {\n this._validateCart();\n }\n\n public shouldComponentUpdate(nextProps: ICartIconProps, nextState: IMiniCartState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n // eslint-disable-next-line complexity -- disabling the complexity for this method for now as its causing lot of other warnings\n public render(): JSX.Element | null {\n const {\n id,\n typeName,\n config: { enableHoverCart, isAnonymousCheckout },\n context: {\n request: {\n user: { isAuthenticated, signInUrl }\n }\n },\n context,\n resources\n } = this.props;\n\n const cart = (this.props.data.cart && this.props.data.cart.result) || undefined;\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) || '';\n const cartUrl = getUrlSync('cart', this.props.context.actionContext) || '';\n const checkoutURL = this._getCheckoutURL(isAuthenticated, guestCheckoutUrl, signInUrl || '');\n const isCartEmpty = cart && cart.cart.CartLines && cart.cart.CartLines.length === 0;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- check config.\n const shouldShowMiniCart =\n cart?.isProductAddedToCart && this.props.context.app.config.addToCartBehavior === AddToCartBehavior.showMiniCart;\n const hasInvoiceLine = cart?.hasInvoiceLine;\n const emailDeliveryModeCode = this.props.context.request.channel?.EmailDeliveryModeCode;\n const cartLines = this._getCartLines();\n const validInventoryAcrossCartLines = validateCartLinesInventory(\n cart?.cart.CartLines ?? [],\n this.state.miniCartData.productAvailabilites ?? [],\n this.props.context.actionContext,\n this.state.miniCartData.products ?? [],\n emailDeliveryModeCode\n );\n const hasError =\n !validInventoryAcrossCartLines?.isValid ||\n (!validInventoryAcrossCartLines && !this.state.isCartValid) ||\n (cartLines ? cartLines.some(cartline => cartline.hasError) : false);\n const includeFlyout = this.props.data.cart && this.props.data.cart.status === 'SUCCESS' && enableHoverCart;\n const totalItemsInCart = cart?.totalItemsInCart ? cart.totalItemsInCart : 0;\n const goToCartButtonText = resources.goToCartButtonTitle.replace('{count}', totalItemsInCart.toString());\n const flyoutTitle = resources.flyoutTitle;\n const flyoutTooltip = {\n tag: UncontrolledTooltip,\n shouldShowMiniCart,\n placement: 'bottom-end',\n hideArrow: true,\n className: 'ms-cart-icon__flyout-container',\n trigger: 'hover',\n displayMode: 'FLYOUT',\n target: id,\n shouldShowCloseButton: true,\n cartPageUrl: cartUrl,\n hideAriaHidden: true\n };\n\n // If there are invoice lines, don't update mini cart price\n const price = (cart && !cart.hasInvoiceLine && cart.cart.TotalAmount) || undefined;\n const priceString = price\n ? resources.totalPriceFormatString.replace('{price}', context.cultureFormatter.formatCurrency(price))\n : '';\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n this.channelDeliveryOptionConfig = this.props.data.channelDeliveryOptionConfig?.result;\n this.retailMultiplePickUpOptionEnabled = this.props.data.featureState?.result?.find(\n feature => feature.Name === multiplePickupStoreSwitchName\n )?.IsEnabled;\n\n const viewProps = {\n ...this.props,\n cartIcon: (\n \n ),\n cartlines: cartLines,\n FlyoutContainer: includeFlyout ? flyoutTooltip : undefined,\n CartlinesWrapper: {\n className: 'ms-cart-icon__cart-lines'\n },\n miniCartWrapper: {\n className: classnames('ms-cart-icon'),\n id: this.props.id\n },\n miniCartItemWrapper: {\n className: classnames('msc-cart-lines-item')\n },\n\n // If there are invoice lines, don't update mini cart checkout button\n // Checkout button will display by default to maintain backward compatibility. When Anonymous user checkout is enabled &&\n // user is authenticated then we will show the checkout button otherwise we will show the guest checkout button.\n checkoutAsSignInUserButton:\n !isCartEmpty && !hasInvoiceLine && (!isAnonymousCheckout || isAuthenticated) ? (\n \n {resources.checkoutButtonTitle}\n \n ) : null,\n checkoutAsGuestButton:\n isAnonymousCheckout && !isCartEmpty && !isAuthenticated ? (\n \n {resources.guestCheckoutButtonTitle}\n \n ) : null,\n goToCartButton: (\n \n {goToCartButtonText}\n \n ),\n checkoutBlockedDueToUnavailableFunds: null,\n flyoutTitle: {flyoutTitle},\n totalPrice:
{priceString}
\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _validateCart(): void {\n const {\n data: { cart }\n } = this.props;\n const cartVersion = cart.result?.cart?.Version ?? undefined;\n if (this.lastValidatedCartVersion === cartVersion) {\n return;\n }\n\n this.lastValidatedCartVersion = cartVersion; // This field is populated to block concurrent requests\n\n if (this.state.isQuantityLimitsFeatureEnabled) {\n validateCartAsync(cart, this.props.telemetry, this.props.context)\n .then((result: CartLineValidationResultsByLineId | undefined) => {\n this.setState({ isCartValid: !ArrayExtensions.hasElements(result?.ValidationResultsPairs) });\n })\n .catch(() => {\n this.setState({ isCartValid: false });\n });\n } else {\n this.setState({ isCartValid: true });\n }\n }\n\n private _getCheckoutURL(isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string {\n if (isAuthenticated) {\n return guestCheckoutUrl;\n }\n\n const isAbsoluteUrl = urlCheck(guestCheckoutUrl);\n let returnURL = guestCheckoutUrl;\n if (msdyn365Commerce.isBrowser && !isAbsoluteUrl) {\n returnURL = `${window.location.origin}${guestCheckoutUrl}`;\n }\n\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnURL}`;\n }\n\n /**\n * Sort cartline items.\n * @param cartlines - Cartlines to be sorted.\n * @param sortOrder - Ascending or descending.\n * @returns - Sorted cartlines.\n */\n private readonly getSortedCartLines = (cartlines: CartLine[], sortOrder?: cartLinesSortOrder): CartLine[] => {\n const lines: CartLine[] = [...cartlines];\n const zero: number = 0;\n\n if (sortOrder === cartLinesSortOrder.descending) {\n return lines.sort((item1, item2) => (item2.LineNumber ?? zero) - (item1.LineNumber ?? zero));\n }\n return lines.sort((item1, item2) => (item1.LineNumber ?? zero) - (item2.LineNumber ?? zero));\n };\n\n private _getCartLines(): IFlyoutCartLineItemViewProps[] | null {\n const {\n context: {\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\n },\n config,\n telemetry,\n resources\n } = this.props;\n\n const imageSettings = this._getImageSettings(config.imageSettings);\n const cart = this.props.data.cart && this.props.data.cart.result;\n\n // Cart-icon could be placed in each page\n // so we check cart content to reduce number of RS calls\n return this.state.miniCartData.products && cart && cart.cart.CartLines && cart.cart.CartLines.length > 0\n ? FlyoutCartLineItems({\n cartlines: this.getSortedCartLines(cart.cart.CartLines, config.cartLinesSortOrder),\n products: this.state.miniCartData.products,\n productAvailabilites: this.state.miniCartData.productAvailabilites,\n productDeliveryOptions: this.state.miniCartData.deliveryOptions,\n imageSettings,\n outOfStockThreshold: this.props.context.app.config.outOfStockThreshold || 0,\n isStockCheckEnabled: this.props.context.app.config.enableStockCheck || false,\n maxCartlineQuantity: updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem),\n gridSettings: this.props.context.request.gridSettings!,\n context: this.props.context,\n typeName: this.props.typeName,\n id: this.props.id,\n resources: {\n sizeString: resources.productDimensionTypeSize,\n colorString: resources.productDimensionTypeColor,\n configString: resources.productDimensionTypeConfiguration,\n styleString: resources.productDimensionTypeStyle,\n quantityDisplayString: resources.quantityDisplayText,\n salesAgreementPricePrompt: resources.salesAgreementPricePrompt,\n inputQuantityAriaLabel: '', // Not used\n discountStringText: '', // Not used\n originalPriceText: '',\n currentPriceText: '',\n shippingChargesText: '',\n shippingText: resources.shippingText\n },\n telemetry,\n removeButtonText: resources.removeCartButtonText,\n outOfStockText: '', // Not used\n outOfRangeOneText: '', // Not used\n outOfRangeFormatText: '', // Not used\n cartState: cart,\n orgUnitLocations: this.state.orgUnitLocations,\n removeItemClickHandler: this._removeItemFromCartHandler,\n pickupDeliveryModeCode: PickupDeliveryModeCode,\n telemetryContent: this.telemetryContent,\n channelDeliveryOptionConfig: this.retailMultiplePickUpOptionEnabled ? this.channelDeliveryOptionConfig : undefined,\n isQuantityLimitsFeatureEnabled: this.state.isQuantityLimitsFeatureEnabled,\n catalogs: this.props.data.catalogs?.result\n })\n : null;\n }\n\n private readonly _getImageSettings = (imageSettings: IImageSettings | undefined): IImageSettings => {\n return (\n imageSettings || {\n viewports: {\n xs: { q: 'w=80&h=94&m=6', w: 0, h: 0 },\n sm: { q: 'w=148&h=174&m=6', w: 0, h: 0 },\n lg: { q: 'w=148&h=174&m=6', w: 0, h: 0 }\n },\n lazyload: true\n }\n );\n };\n\n private readonly _removeItemFromCartHandler = (cartlineToRemove: CartLine) => {\n if (this.props.data.cart.result) {\n const input = {\n cartLineIds: [cartlineToRemove.LineId!.toString()]\n };\n this.props.data.cart.result.removeCartLines(input).catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to Remove Cart Line');\n });\n }\n };\n\n private async _setQuantityLimitsFeatureFlag(): Promise {\n const featureStatuses = await this.props.data.featureState;\n\n const isChannelQuantityLimitsFeatureEnabledInHq =\n featureStatuses?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.EcommerceQuantityLimitConfigurationsFeature'\n )?.IsEnabled || false;\n if (isChannelQuantityLimitsFeatureEnabledInHq) {\n this.setState({ isQuantityLimitsFeatureEnabled: true });\n return;\n }\n\n const useSiteBuilderSettings = featureStatuses?.find(\n featureState => featureState.Name === 'RevertToSiteBuilderOrderQuantityLimitsSettings'\n )?.IsEnabled;\n\n if (useSiteBuilderSettings) {\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\n if (!defaultOrderQuantityLimitsFeatureConfig || defaultOrderQuantityLimitsFeatureConfig === 'none') {\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n\n try {\n const featureStatuses = await this.props.data.featureState;\n const isQuantityLimitsFeatureEnabledInHq =\n featureStatuses?.find(\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailDefaultOrderQuantityLimitsFeature'\n )?.IsEnabled || false;\n if (!isQuantityLimitsFeatureEnabledInHq) {\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n } catch (error) {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get feature states');\n this.setState({ isQuantityLimitsFeatureEnabled: false });\n return;\n }\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\n this.setState({ isQuantityLimitsFeatureEnabled: true });\n } else {\n this.props.data.customerInformation\n .then(customerInfo => {\n const result =\n !!customerInfo &&\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b));\n this.setState({ isQuantityLimitsFeatureEnabled: result });\n })\n .catch(error => {\n this.props.telemetry.warning(error);\n this.props.telemetry.debug('Unable to get customer info');\n });\n }\n } else {\n const cartConfiguration = await this.props.data.cartConfiguration;\n this.setState({ isQuantityLimitsFeatureEnabled: !(cartConfiguration?.IgnoreOrderSettings ?? false) });\n return;\n }\n }\n}\n\nexport default CartIcon;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLineItemComponent, ICartlineResourceString } from '@msdyn365-commerce/components';\nimport MsDyn365, { ICoreContext, IGridSettings, IImageSettings, ITelemetry, isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n OrgUnitLocation,\n ProductAvailableQuantity,\n ProductDeliveryOptions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ProductCatalog, ReleasedProductType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductUrlSync, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { getProductByProductId, getProductByProductIdAndWarehouse } from '../../../Common/get-product';\n\nexport interface IFlyoutCartLineItemsProps {\n cartlines: CartLine[];\n cartState: ICartState | undefined;\n orgUnitLocations: OrgUnitLocation[] | undefined;\n resources: ICartlineResourceString;\n productAvailabilites: IProductInventoryInformation[] | undefined;\n products: SimpleProduct[] | undefined;\n productDeliveryOptions: ProductDeliveryOptions[] | undefined;\n pickupDeliveryModeCode?: string;\n catalogs?: ProductCatalog[];\n\n /**\n * GridSettings for the product image in cartline\n */\n gridSettings: IGridSettings;\n\n /**\n * ImageSettings for the product image in cartline\n */\n imageSettings: IImageSettings;\n id: string;\n typeName: string;\n context: ICoreContext;\n telemetry: ITelemetry;\n removeButtonText: string;\n outOfStockText: string;\n outOfRangeOneText: string;\n outOfRangeFormatText: string;\n maxCartlineQuantity: number;\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n isQuantityLimitsFeatureEnabled: boolean;\n\n outOfStockThreshold: number;\n isStockCheckEnabled: boolean;\n telemetryContent?: ITelemetryContent;\n removeItemClickHandler(cartlineToRemove: CartLine): void;\n}\n\nexport interface IFlyoutCartLineItemViewProps {\n cartline: React.ReactNode;\n remove: React.ReactNode;\n storeLocation: React.ReactNode;\n hasError: boolean;\n\n data: {\n product: SimpleProduct;\n cartline: CartLine;\n };\n}\n\nconst _getCartItemAvailableQuantity = (\n isStockCheckEnabled: boolean,\n outOfStockThreshold: number,\n productAvailability?: ProductAvailableQuantity\n): number => {\n if (isStockCheckEnabled) {\n if (\n !productAvailability ||\n !productAvailability.AvailableQuantity ||\n productAvailability.AvailableQuantity <= 0 ||\n productAvailability.AvailableQuantity <= outOfStockThreshold\n ) {\n return 0;\n }\n return productAvailability.AvailableQuantity - outOfStockThreshold;\n }\n\n return 0;\n};\n\nconst _getCartItemMaxQuantity = (\n maxQuantityByConfig: number,\n isStockCheckEnabled: boolean,\n availableQuantityInStock: number,\n isQuantityLimitsFeatureEnabled: boolean,\n maxByQuantityLimitsFeature: number\n) => {\n if (isQuantityLimitsFeatureEnabled) {\n let maxByQuantityLimitsFeatureResult = maxByQuantityLimitsFeature;\n\n // If max by feature in not defined when feature is on then we suggest that there is no max by feature\n // and consider available qty if stock check enabled and max from config in site settings.\n if (!maxByQuantityLimitsFeature) {\n maxByQuantityLimitsFeatureResult = maxQuantityByConfig || 10;\n }\n\n return isStockCheckEnabled\n ? maxByQuantityLimitsFeatureResult < availableQuantityInStock\n ? maxByQuantityLimitsFeatureResult\n : availableQuantityInStock\n : maxByQuantityLimitsFeatureResult;\n }\n if (isStockCheckEnabled) {\n return availableQuantityInStock < maxQuantityByConfig ? availableQuantityInStock : maxQuantityByConfig;\n }\n return maxQuantityByConfig;\n};\n\n/**\n * On Remove Click functionality.\n * @param removeItemClickHandler -Remove item click function.\n * @param cartline -CartLine.\n * @returns Remove change value.\n */\nconst onRemoveClickFunction = (removeItemClickHandler: (cartlineToRemove: CartLine) => void, cartline: CartLine) => () => {\n removeItemClickHandler(cartline);\n};\nconst _assembleNode = (\n cartline: CartLine,\n product: SimpleProduct,\n props: IFlyoutCartLineItemsProps,\n index: number,\n foundProductAvailability?: ProductAvailableQuantity,\n foundProductDeliveryOptions?: ProductDeliveryOptions\n): IFlyoutCartLineItemViewProps => {\n const { imageSettings, gridSettings, id, typeName, context, resources, removeButtonText, removeItemClickHandler } = props;\n\n const availableQuantityInStock = _getCartItemAvailableQuantity(\n props.isStockCheckEnabled,\n props.outOfStockThreshold,\n foundProductAvailability\n );\n const maxQuantity =\n product &&\n _getCartItemMaxQuantity(\n props.maxCartlineQuantity,\n props.isStockCheckEnabled,\n availableQuantityInStock,\n props.isQuantityLimitsFeatureEnabled,\n product?.Behavior?.MaximumQuantity || 0\n );\n\n // Check if the product is service or not by product type\n const isServiceItem = product.ItemTypeValue === ReleasedProductType.Service;\n\n const onRemoveClickHandler = onRemoveClickFunction(removeItemClickHandler, cartline);\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.RemoveCartItem);\n const removeCartItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n let productUrl = getProductUrlSync(product, props.context.actionContext, undefined);\n if (MsDyn365.isBrowser && isChannelTypeB2B(props.context.actionContext.requestContext)) {\n const fullUrl = new URL(productUrl, window.location.href);\n fullUrl.searchParams.set('catalogid', `${cartline.CatalogId ?? 0}`);\n productUrl = fullUrl.href;\n }\n\n return {\n data: {\n product,\n cartline\n },\n hasError: !isServiceItem && props.isStockCheckEnabled ? cartline.Quantity! > maxQuantity : false,\n cartline: (\n \n ),\n remove: (\n \n {removeButtonText}\n \n ),\n storeLocation: _renderStoreLocation(cartline, props)\n };\n};\n\nconst _renderDeliveryLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): string | undefined => {\n let deliverylocation;\n if (cartLine && cartLine.FulfillmentStoreId) {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\n\n let foundProductDeliveryOption;\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\n return deliveryOption && deliveryOption.ProductId === cartLine.ProductId;\n });\n }\n const delivery = foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === cartLine.DeliveryMode);\n const location = delivery?.Description;\n\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n if (location) {\n deliverylocation = `${location}, ${orgUnitName}`;\n } else {\n deliverylocation = `${orgUnitName}`;\n }\n } else {\n deliverylocation = props.resources.shippingText;\n }\n return deliverylocation;\n};\n\nconst _renderStoreLocation = (cartLine: CartLine | null | undefined, props: IFlyoutCartLineItemsProps): JSX.Element | null => {\n if (cartLine && cartLine.FulfillmentStoreId) {\n const orgUnitName = _getOrgUnitName(cartLine.FulfillmentStoreId, props.orgUnitLocations);\n\n if (orgUnitName) {\n return (\n
\n {orgUnitName}\n
\n );\n }\n }\n\n return null;\n};\n\nconst _getOrgUnitName = (fulfillmentStoreId: string | undefined, orgUnitLocations: OrgUnitLocation[] | undefined) => {\n if (!orgUnitLocations || !fulfillmentStoreId || orgUnitLocations.length === 0) {\n return '';\n }\n\n const foundLocation = orgUnitLocations.find(orgUnitLocation => {\n return orgUnitLocation.OrgUnitNumber === fulfillmentStoreId;\n });\n\n if (foundLocation) {\n return foundLocation.OrgUnitName;\n }\n return fulfillmentStoreId;\n};\n\nconst _assembleCartlines = (\n cartlines: CartLine[],\n products: SimpleProduct[] | undefined,\n props: IFlyoutCartLineItemsProps\n): IFlyoutCartLineItemViewProps[] | null => {\n const reactNodes: IFlyoutCartLineItemViewProps[] = [];\n\n if (!products || products.length === 0) {\n props.context.telemetry.error('Cartlines content is empty, module wont render');\n return null;\n }\n\n cartlines.map((cartline, index) => {\n let product;\n if (props.isQuantityLimitsFeatureEnabled) {\n // When feature is enabled the same products could have different quantity limits in Behavior so we need\n // to check productId and WarehouseId for identification.\n product = getProductByProductIdAndWarehouse(cartline.ProductId, products, cartline.WarehouseId, props.cartState);\n } else {\n product = getProductByProductId(cartline.ProductId, products);\n }\n let foundProductAvailability;\n if (props.productAvailabilites && props.productAvailabilites.length > 0) {\n foundProductAvailability = props.productAvailabilites.find(productAvailability => {\n return productAvailability.ProductAvailableQuantity?.ProductId! === cartline.ProductId;\n });\n }\n let foundProductDeliveryOption;\n if (props.productDeliveryOptions && props.productDeliveryOptions.length > 0) {\n foundProductDeliveryOption = props.productDeliveryOptions.find(deliveryOption => {\n return deliveryOption && deliveryOption.ProductId === cartline.ProductId;\n });\n }\n if (product) {\n reactNodes.push(\n _assembleNode(\n cartline,\n product,\n props,\n index,\n foundProductAvailability?.ProductAvailableQuantity,\n foundProductDeliveryOption\n )\n );\n }\n });\n\n return reactNodes;\n};\n\n/**\n * CartLineItems component.\n */\n\nexport const FlyoutCartLineItems = (props: IFlyoutCartLineItemsProps) => {\n const { products, cartlines } = props;\n return _assembleCartlines(cartlines, products, props);\n};\n","module.exports = React;","module.exports = ReactDOM;"],"names":["cartLinesSortOrder","_renderDeliveryLocation","cartLine","props","deliverylocation","FulfillmentStoreId","_foundProductDelivery","orgUnitName","_getOrgUnitName","orgUnitLocations","foundProductDeliveryOption","productDeliveryOptions","length","find","deliveryOption","ProductId","delivery","DeliveryOptions","option","Code","DeliveryMode","location","Description","resources","shippingText","_renderStoreLocation","React","className","fulfillmentStoreId","foundLocation","orgUnitLocation","OrgUnitNumber","OrgUnitName","_assembleCartlines","cartlines","products","reactNodes","map","cartline","index","product","foundProductAvailability","_foundProductAvailabi","isQuantityLimitsFeatureEnabled","getProductByProductIdAndWarehouse","WarehouseId","cartState","getProductByProductId","productAvailabilites","productAvailability","_productAvailability$","ProductAvailableQuantity","push","_assembleNode","foundProductDeliveryOptions","_product$Behavior","imageSettings","gridSettings","id","typeName","context","removeButtonText","removeItemClickHandler","availableQuantityInStock","isStockCheckEnabled","outOfStockThreshold","AvailableQuantity","_getCartItemAvailableQuantity","maxQuantity","_getCartItemMaxQuantity","maxQuantityByConfig","maxByQuantityLimitsFeature","maxByQuantityLimitsFeatureResult","maxCartlineQuantity","Behavior","MaximumQuantity","isServiceItem","ItemTypeValue","ReleasedProductType","Service","onRemoveClickHandler","onRemoveClickFunction","payLoad","getPayloadObject","telemetryContent","TelemetryConstant","RemoveCartItem","removeCartItemAttribute","getTelemetryAttributes","productUrl","getProductUrlSync","actionContext","undefined","MsDyn365","isBrowser","isChannelTypeB2B","requestContext","_cartline$CatalogId","fullUrl","URL","window","href","searchParams","set","CatalogId","data","hasError","Quantity","CartLineItemComponent","catalogs","currentQuantity","isOutOfStock","key","isQuantityEditable","primaryImageUrl","PrimaryImageUrl","displayMode","channelDeliveryOptionConfig","deliveryLocation","remove","Button","Object","assign","onClick","title","storeLocation","telemetry","error","async","getMiniCartData","ctx","miniCartData","cart","CartLines","hasInvoiceLine","getActiveCartProductsAction","ActiveCartProductsInput","then","catch","exception","Error","getAvailabilitiesForCartLineItems","ProductAvailabilitiesForCartLineItems","apiSettings","availableQuantity","getDeliveryOptionsForCartLineItems","ProductDeliveryOptionsForCartLineItems","deliveryOptions","CartIcon","constructor","super","retailMultiplePickUpOptionEnabled","_handleCheckout","value","url","this","result","dropShipCheckoutRecord","Key","Value","BooleanValue","updateExtensionProperties","newExtensionProperties","ExtensionProperties","getSortedCartLines","sortOrder","lines","descending","sort","item1","item2","_item2$LineNumber","_item1$LineNumber","LineNumber","_item1$LineNumber2","_item2$LineNumber2","_getImageSettings","viewports","xs","q","w","h","sm","lg","lazyload","_removeItemFromCartHandler","cartlineToRemove","input","cartLineIds","LineId","toString","removeCartLines","warning","debug","state","isCartValid","IsDropShipCustomer","getTelemetryObject","request","telemetryPageName","friendlyName","payload","TelemetryEvent","CheckOut","Checkout","checkoutBySignInAttributes","contentAction","etext","GuestCheckout","checkoutByGuestAttributes","ViewShoppingBag","viewShoppingBagAttributes","_this$props$data$cust","_attributes$find","_this$props$data$orgU","isDropShipAttribute","customerInformation","Attributes","attr","Name","AttributeValue","setState","reaction","_this$props$data$cart","_setQuantityLimitsFeatureFlag","_validateCart","componentDidUpdate","prevProps","shouldComponentUpdate","nextProps","nextState","render","_this$props$context$r","_cart$cart$CartLines","_this$state$miniCartD","_this$state$miniCartD2","_this$props$data$chan","_this$props$data$feat","config","enableHoverCart","isAnonymousCheckout","user","isAuthenticated","signInUrl","guestCheckoutUrl","getUrlSync","cartUrl","checkoutURL","_getCheckoutURL","isCartEmpty","shouldShowMiniCart","isProductAddedToCart","app","addToCartBehavior","AddToCartBehavior","showMiniCart","emailDeliveryModeCode","channel","EmailDeliveryModeCode","cartLines","_getCartLines","validInventoryAcrossCartLines","validateCartLinesInventory","isValid","_isCheckoutBlockedDueToUnavailableFunds","some","includeFlyout","status","totalItemsInCart","goToCartButtonText","goToCartButtonTitle","replace","flyoutTitle","flyoutTooltip","tag","UncontrolledTooltip","placement","hideArrow","trigger","target","shouldShowCloseButton","cartPageUrl","hideAriaHidden","price","TotalAmount","priceString","totalPriceFormatString","cultureFormatter","formatCurrency","featureState","feature","IsEnabled","viewProps","_objectSpread","cartIcon","CartIconComponent","cartLabel","cartQtyLabel","FlyoutContainer","CartlinesWrapper","miniCartWrapper","classnames","miniCartItemWrapper","checkoutAsSignInUserButton","disabled","e","preventDefault","checkoutButtonTitle","checkoutAsDropshipButton","dropShipCheckoutButtonTitle","checkoutAsGuestButton","guestCheckoutButtonTitle","goToCartButton","checkoutBlockedDueToUnavailableFunds","checkoutBlockedDueToUnavailableFundsTitle","checkoutBlockedDueToUnavailableFundsMessage","totalPrice","renderView","_cart$result$cart$Ver","_cart$result","cartVersion","Version","lastValidatedCartVersion","validateCartAsync","ArrayExtensions","hasElements","ValidationResultsPairs","isAbsoluteUrl","urlCheck","returnURL","msdyn365Commerce","origin","includes","isOboRequest","_this$props$data$cust2","customerInfo","AllowOnAccountPayment","_this$props$data$cata","PickupDeliveryModeCode","FlyoutCartLineItems","enableStockCheck","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","sizeString","productDimensionTypeSize","colorString","productDimensionTypeColor","configString","productDimensionTypeConfiguration","styleString","productDimensionTypeStyle","quantityDisplayString","quantityDisplayText","salesAgreementPricePrompt","inputQuantityAriaLabel","discountStringText","originalPriceText","currentPriceText","shippingChargesText","removeCartButtonText","outOfStockText","outOfRangeOneText","outOfRangeFormatText","pickupDeliveryModeCode","_featureStatuses$find","_featureStatuses$find2","featureStatuses","_this$props$context","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","_featureStatuses$find3","IsB2b","_cartConfiguration$Ig","cartConfiguration","IgnoreOrderSettings","__decorate","observer","RenderCartlines","_prop$data$customerIn","prop","referenceNumber","setReferenceNumber","pids","recordIds","items","line","indexOf","getProductsReferenceNumberAsync","callerContext","res","refArray","d","Id","ReferenceNumber","currencyCode","CurrencyCode","_cartLine$cartline","_cartLine$data","_cartLine$data$produc","_cartLine$data$produc2","Node","CartLine","priceTranslation","isCartIcon","Number","Price","RecordId","_props$cartlines","_props$cartlines2","_props$totalPrice","_props$totalPrice2","counter","element","DiscountLines","CustomerDiscountTypeValue","EffectiveAmount","renderModuleAttributes","cartDiscount","children","split","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}