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,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,YAId,KAAAG,YAA2B,CAC/B,CACIJ,UAAW,OACXC,aAAc,UAElB,CACID,UAAW,OACXC,aAAc,UAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,WAElB,CACID,UAAW,OACXC,aAAc,YAIftB,6BACH,OAAO0B,QAAQ9Z,QAAQ,IAEpBqY,qBAAqB/Q,GAExB,OADAxN,QAAQod,IAAI,yEAAyE5P,MAC9E,EAGJgR,iBACH,OAAOwB,QAAQ9Z,QAAQ,CACnBiP,KAAM,sBACN8K,YAAa,CACT,CACIjT,GAAI,SACJkT,aAAc,eACdpH,YAAa,yCACbqH,KAAM,WACNna,OAAQoa,EAAAA,GAAMC,QACdC,KAAM,yCACNC,WAAY,CACR,CACIvT,GAAI,OACJkT,aAAc,YACdla,OAAQoa,EAAAA,GAAMI,OACdC,OAAQ,OAEZ,CACIzT,GAAI,OACJkT,aAAc,YACdla,OAAQoa,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IjCH,EAAE,CAAExxD,OAAQ,QAAS4xD,OAAO,GAAQ,CAClCzC,KAAM,WACJ,IAAI0C,EAAWz3B,UAAU9kC,OAAS8kC,UAAU,QAAKnjC,EAC7CixB,EAAIupC,EAAS1iD,MACbgiD,EAAYL,EAAkBxoC,GAC9BlB,EAAI2qC,EAAmBzpC,EAAG,GAE9B,OADAlB,EAAE1xB,OAASs7D,EAAiB5pC,EAAGkB,EAAGA,EAAG6oC,EAAW,OAAgB95D,IAAb46D,EAAyB,EAAIH,EAAoBG,IAC7F7qC,kCCdY,EAAQ,IAG/B8qC,CAAiB,qCCLjB,IAAIN,EAAI,EAAQ,IACZO,EAAU,EAAQ,KAClBC,EAAiB,EAAQ,KAI7BR,EAAE,CAAExxD,OAAQ,SAAUiyD,MAAM,GAAQ,CAClCxuB,YAAa,SAAqByuB,GAChC,IAAIpiC,EAAM,GAIV,OAHAiiC,EAAQG,GAAU,SAAU7qC,EAAGpB,GAC7B+rC,EAAeliC,EAAKzI,EAAGpB,KACtB,CAAEksC,YAAY,IACVriC","sources":["webpack://henrys-ecommerce/./src/common/utilities/localisation/translationUtilities.ts?ec4c","webpack://henrys-ecommerce/./src/themes/henrys/views/components/addtowishlist.component.tsx?a9d8","webpack://henrys-ecommerce/./src/themes/henrys/views/components/cartlineitem.component.tsx?20ed","webpack://henrys-ecommerce/./src/themes/henrys/views/components/price.component.tsx?eaa7","webpack://henrys-ecommerce/./src/themes/henrys/views/components/ProductStockStatus.tsx?39d5","webpack://henrys-ecommerce/./src/themes/henrys/views/components/product.component.tsx?f9eb","webpack://henrys-ecommerce/./src/themes/henrys/views/components/promocode.component.tsx?441b","webpack://henrys-ecommerce/./lib/component-registration.js?266e","webpack://henrys-ecommerce/./lib/connector-registration.js?87e5","webpack://henrys-ecommerce/./src/modules/fabrikam/views/components/cartlineitem.component.tsx?eb8c","webpack://henrys-ecommerce/./src/modules/fabrikam/views/components/promocode.component.tsx?d9d6","webpack://henrys-ecommerce/./src/connectors/msdyn365-exp-test/msdyn365-exp-test.listener.ts?1431","webpack://henrys-ecommerce/./src/connectors/msdyn365-exp-test/msdyn365-exp-test.provider.ts?04ad","webpack://henrys-ecommerce/./src/modules/adventureworks/views/components/carticon.component.tsx?3c7c","webpack://henrys-ecommerce/./src/modules/adventureworks/views/components/cartlineitem.component.tsx?ccc2","webpack://henrys-ecommerce/./src/modules/adventureworks/views/components/product-v2.component.tsx?d155","webpack://henrys-ecommerce/./src/modules/adventureworks/views/components/product.component.tsx?fd23","webpack://henrys-ecommerce/./src/modules/adventureworks/views/components/promocode.component.tsx?c06b","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/common/index.js?2b98","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/web-vitals/dist/web-vitals.js?1850","webpack://henrys-ecommerce/../../../../src/_server/inteceptors/ttl-cache.ts?e0fd","webpack://henrys-ecommerce/../../../../src/_server/inteceptors/request-vectorizer.ts?c150","webpack://henrys-ecommerce/../../../../src/_server/inteceptors/rs-logging-interceptor.ts?662d","webpack://henrys-ecommerce/../../../../src/hydrators/link-actions/page-type-context-by-id.ts?6c79","webpack://henrys-ecommerce/../../../src/hydrators/process-page-response.ts?c773","webpack://henrys-ecommerce/../../../src/hydrators/link-hydrator.ts?6237","webpack://henrys-ecommerce/../../../src/store/page-context.ts?7400","webpack://henrys-ecommerce/../../../src/utils/session-storage-utils.ts?6e42","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/universal-cookie/es6/utils.js?c36d","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/universal-cookie/es6/Cookies.js?2bbb","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/universal-cookie/es6/index.js?87b9","webpack://henrys-ecommerce/../../../src/utils/cookie-utils.ts?31b7","webpack://henrys-ecommerce/../../../src/utils/resolve-segments-utils.ts?6007","webpack://henrys-ecommerce/../../../src/_client/client-render.tsx?dd81","webpack://henrys-ecommerce/../../../src/app-initialization/initialization.ts?f0ba","webpack://henrys-ecommerce/../../../src/app-initialization/render-component.tsx?9b51","webpack://henrys-ecommerce/../../../src/app-initialization/client-initialization.ts?84a7","webpack://henrys-ecommerce/../../../src/app-initialization/utils.ts?39fc","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/entry/module-entrypoints-client.js?cde1","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/entry/webpack-public-path.js?7553","webpack://henrys-ecommerce/../../../src/components/add-module-control.tsx?59cd","webpack://henrys-ecommerce/../../../src/components/module-client-render-component.tsx?9466","webpack://henrys-ecommerce/../../../src/components/add-module-wrapper.tsx?05b8","webpack://henrys-ecommerce/../../../src/components/render-view.tsx?751d","webpack://henrys-ecommerce/../../../src/components/error-module.tsx?67fa","webpack://henrys-ecommerce/../../../src/components/safe-render-module.tsx?04c3","webpack://henrys-ecommerce/../../src/consts.ts?a6b5","webpack://henrys-ecommerce/../../../src/app-initialization/models.ts?a775","webpack://henrys-ecommerce/../../../src/data/load-data.ts?fc90","webpack://henrys-ecommerce/../../../src/utils/data-action-extension-helper.ts?35ec","webpack://henrys-ecommerce/../../../src/utils/link-utils.ts?3f81","webpack://henrys-ecommerce/../../../src/hydrators/hydrator-action-inputs.ts?51eb","webpack://henrys-ecommerce/../../../src/utils/product-list-utils.ts?20d3","webpack://henrys-ecommerce/../../../../src/hydrators/utils/inventory-util.ts?0972","webpack://henrys-ecommerce/../../../../src/hydrators/product-list-actions/products-by-category.action.ts?6ed5","webpack://henrys-ecommerce/../../../../src/hydrators/product-list-actions/products-by-recentlyviewed.action.ts?f746","webpack://henrys-ecommerce/../../../src/hydrators/get-simple-products.ts?1a66","webpack://henrys-ecommerce/../../../../src/hydrators/product-list-actions/products-by-recommendation.action.ts?6f98","webpack://henrys-ecommerce/../../../../src/hydrators/product-list-actions/products-by-relationship-id.action.ts?6e59","webpack://henrys-ecommerce/../../../../src/hydrators/product-list-actions/products-by-promotions.action.ts?412e","webpack://henrys-ecommerce/../../../../src/hydrators/product-list-actions/products-by-search.action.ts?f730","webpack://henrys-ecommerce/../../../src/hydrators/product-list-hydrator.ts?e2b4","webpack://henrys-ecommerce/../../../src/store/authoring-edit-helper.ts?e511","webpack://henrys-ecommerce/../../../../src/_server/error/HttpException.ts?621a","webpack://henrys-ecommerce/../../../../src/_server/error/HttpRedirectException.ts?19b2","webpack://henrys-ecommerce/../../../src/utils/helpers.ts?7637","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/cookie/index.js?7cab","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/does-not-exceed-safe-integer.js?0ce0","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/flatten-into-array.js?2945","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.flat.js?2b89","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.unscopables.flat.js?840a","webpack://henrys-ecommerce/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.object.from-entries.js?a284"],"sourcesContent":["import translations from './translation.json';\r\n\r\nexport const translate = (locale: string, translationPath: string, fallback: string): string => {\r\n try {\r\n let translation = translations[(locale || '').toLowerCase()];\r\n if (!translation) {\r\n translation = translations['en-us'];\r\n }\r\n const splitString = translationPath.split('.');\r\n for (let i = 0; i < splitString.length; i++) {\r\n translation = translation[splitString[i]];\r\n if (!translation) {\r\n break;\r\n }\r\n }\r\n if (translation) {\r\n return translation;\r\n } else {\r\n console.warn(`Translation path [${translationPath}] for [${locale}] missing`);\r\n return translation || fallback;\r\n }\r\n } catch (e) {\r\n console.warn('Translation key missing');\r\n return fallback;\r\n }\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { AsyncResult, CartLine, CommerceList, Customer, ProductDimension, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n addLinesAsync,\r\n createCommerceListAsync,\r\n createGetByCustomerInput,\r\n removeLinesAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CommerceListsDataActions.g';\r\nimport {\r\n buildWishlistLine,\r\n getCustomer,\r\n GetCustomerInput,\r\n getPriceForSelectedVariant,\r\n PriceForSelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { Alert, UncontrolledTooltip } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as Popper from 'popper.js';\r\nimport React, { useState } from 'react';\r\nimport { pushGoogleAnalyticsEvent } from '../../../../common/pushGoogleAnalyticsEvent';\r\n\r\nexport interface IAddToWishlistComponentProps extends IComponentProps {\r\n className?: string;\r\n addToWishlistButtonText: string;\r\n removeFromWishlistButtonText: string;\r\n nameOfWishlist: string;\r\n\r\n addToWishlistMessage?: string;\r\n removedFromWishlistMessage?: string;\r\n addItemToWishlistError?: string;\r\n removeItemFromWishlistError?: string;\r\n\r\n showButtonText?: boolean;\r\n showButtonTooltip?: boolean;\r\n tooltipPosition?: Popper.Placement;\r\n showStatusMessage?: boolean;\r\n showRemoveButton?: boolean;\r\n disabled?: boolean;\r\n cartline?: CartLine;\r\n canAddMasterProduct?: boolean;\r\n ariaRole?: string;\r\n\r\n getSelectedProduct?: Promise;\r\n\r\n onSuccess?(result: IWishlistActionSuccessResult, cartline?: CartLine): void;\r\n onError?(result: IWishlistActionErrorResult): void;\r\n}\r\n\r\nexport interface IWishlistActionSuccessResult {\r\n status: 'ADDED' | 'REMOVED';\r\n}\r\n\r\nexport interface IWishlistActionErrorResult {\r\n status: 'FAILED' | 'MISSINGDIMENSION';\r\n\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\ninterface IAddToWishlistStateManager {\r\n waiting: boolean;\r\n canRemove: boolean;\r\n content: IAddtoWishlistContentState;\r\n\r\n setWaiting(newWaiting: boolean): void;\r\n setContent(newContent: IAddtoWishlistContentState): void;\r\n setCanRemove(newCanRemove: boolean): void;\r\n}\r\n\r\ninterface IAddtoWishlistContentState {\r\n showAlert?: boolean;\r\n wishlistTextMessage?: string;\r\n color?: string;\r\n}\r\n\r\ninterface IAddtoWishlistData {\r\n wishlists?: CommerceList[];\r\n product: SimpleProduct;\r\n}\r\n\r\nexport interface IAddtoWishlistComponent extends IComponent {\r\n onClick(): (event: React.MouseEvent, props: IAddToWishlistComponentProps, state: IAddToWishlistStateManager) => void;\r\n}\r\n\r\nconst onClick = async (\r\n _event: React.MouseEvent,\r\n props: IAddToWishlistComponentProps,\r\n state: IAddToWishlistStateManager\r\n): Promise => {\r\n const { user } = props.context.request;\r\n let { product } = props.data;\r\n\r\n if (state.waiting) {\r\n return;\r\n }\r\n\r\n if (!user.isAuthenticated && user.signInUrl && window) {\r\n window.location.assign(user.signInUrl);\r\n\r\n return;\r\n }\r\n\r\n state.setWaiting(true);\r\n if (!(props.getSelectedProduct === undefined)) {\r\n product = (await props.getSelectedProduct) || props.data.product;\r\n }\r\n\r\n await (doesProductExistInWishlist(product, props) ? removeFromWishlist(product, props, state) : addToWishlist(product, props, state));\r\n\r\n const variant = product.Dimensions?.map(d => d.DimensionValue?.Value).join(',');\r\n const brandFromExt = product?.ExtensionProperties?.find(p => p.Key === 'Brand')?.Value?.StringValue;\r\n\r\n const productPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(product.RecordId, props.context.actionContext.requestContext.channel?.RecordId!),\r\n props.context.actionContext\r\n );\r\n\r\n const discount = (productPrice?.DiscountLines ?? []).reduce((a, b) => a + (b.Amount ?? 0), 0);\r\n\r\n await pushGoogleAnalyticsEvent(\r\n {\r\n event: 'add_to_wishlist',\r\n ecommerce: {\r\n currency: 'CAD',\r\n value: product.Price - discount,\r\n items: [\r\n {\r\n recId: product.RecordId,\r\n item_id: product.ProductNumber || product.ItemId || '',\r\n item_name: product.Name ?? '',\r\n index: 0,\r\n item_variant: variant,\r\n price: product.Price - discount,\r\n discount: discount,\r\n pid: product.ItemId || '',\r\n item_brand: brandFromExt ?? undefined,\r\n quantity: 1\r\n }\r\n ]\r\n }\r\n },\r\n props.context.actionContext\r\n );\r\n\r\n state.setWaiting(false);\r\n};\r\n\r\nconst onDismiss = (state: IAddToWishlistStateManager): void => {\r\n state.setContent({ color: 'success', showAlert: false });\r\n};\r\n\r\nconst AddToWishlistComponentActions = {\r\n onClick,\r\n onDismiss\r\n};\r\n\r\nconst AddToWishlist: React.FC = (props: IAddToWishlistComponentProps) => {\r\n const [waiting, setWaiting] = useState(false);\r\n const [canRemove, setCanRemove] = useState(doesProductExistInWishlist(props.data.product, props));\r\n const [content, setContent] = useState({});\r\n const state: IAddToWishlistStateManager = {\r\n waiting,\r\n canRemove,\r\n content,\r\n\r\n setWaiting,\r\n setCanRemove,\r\n setContent\r\n };\r\n\r\n React.useEffect(() => {\r\n setCanRemove(doesProductExistInWishlist(props.data.product, props));\r\n }, [props]);\r\n\r\n const {\r\n removeFromWishlistButtonText,\r\n addToWishlistButtonText,\r\n ariaRole,\r\n showStatusMessage,\r\n showRemoveButton,\r\n showButtonText,\r\n className,\r\n disabled,\r\n showButtonTooltip,\r\n tooltipPosition\r\n } = props;\r\n\r\n const onClickHandler = (event: React.MouseEvent) => {\r\n return AddToWishlistComponentActions.onClick(event, props, state);\r\n };\r\n const onDismissHandler = () => {\r\n AddToWishlistComponentActions.onDismiss(state);\r\n };\r\n const ariaLabel = state.canRemove ? removeFromWishlistButtonText : addToWishlistButtonText;\r\n const addToWishlistRef: React.RefObject = React.createRef();\r\n const removeFromWishlistRef: React.RefObject = React.createRef();\r\n const showMessage = showStatusMessage !== undefined ? showStatusMessage : true;\r\n const showButton = showRemoveButton !== undefined ? showRemoveButton : true;\r\n const showTooltip = showButtonTooltip !== undefined ? showButtonTooltip : true;\r\n const tooltipPos = showButtonTooltip !== undefined ? tooltipPosition : 'right';\r\n const linkAriaRole = ariaRole !== undefined ? ariaRole : 'link';\r\n\r\n if (state.canRemove && !showButton) {\r\n return null;\r\n }\r\n\r\n return (\r\n <>\r\n {showButtonText ? (\r\n <>\r\n \r\n {ariaLabel}\r\n \r\n {showTooltip && (\r\n \r\n {ariaLabel}\r\n \r\n )}\r\n \r\n ) : (\r\n <>\r\n \r\n {showTooltip && (\r\n \r\n {ariaLabel}\r\n \r\n )}\r\n \r\n )}\r\n {state.content.showAlert && showMessage ? (\r\n
\r\n \r\n {state.content.wishlistTextMessage}\r\n \r\n
\r\n ) : (\r\n ''\r\n )}\r\n \r\n );\r\n};\r\n\r\nconst doesProductExistInWishlist = (product: SimpleProduct, props: IAddToWishlistComponentProps): boolean => {\r\n const { wishlists } = props.data;\r\n\r\n if (!wishlists || !wishlists[0]) {\r\n return false;\r\n }\r\n\r\n const { CommerceListLines } = wishlists[0];\r\n\r\n if (!CommerceListLines || CommerceListLines.length === 0) {\r\n return false;\r\n }\r\n\r\n for (const wishlistItem of CommerceListLines) {\r\n if (wishlistItem.ProductId === product.RecordId) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n};\r\n\r\nconst propagateSuccess = (props: IAddToWishlistComponentProps, result: IWishlistActionSuccessResult): void => {\r\n const { onSuccess, cartline } = props;\r\n\r\n if (onSuccess) {\r\n cartline ? onSuccess(result, props.cartline) : onSuccess(result);\r\n }\r\n};\r\n\r\nconst propagateError = (props: IAddToWishlistComponentProps, result: IWishlistActionErrorResult): void => {\r\n const { onError } = props;\r\n\r\n if (onError) {\r\n onError(result);\r\n }\r\n};\r\n\r\nconst addToWishlist = async (\r\n product: SimpleProduct,\r\n props: IAddToWishlistComponentProps,\r\n state: IAddToWishlistStateManager\r\n): Promise => {\r\n const { canAddMasterProduct, context } = props;\r\n\r\n if (product.Dimensions && !canAddMasterProduct) {\r\n const missingDimensions = product.Dimensions.filter(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value));\r\n\r\n if (missingDimensions.length > 0) {\r\n // At least one dimension with no value exists on the product, won't be able to add to cart\r\n propagateError(props, { status: 'MISSINGDIMENSION', missingDimensions });\r\n\r\n return AsyncResult.resolve();\r\n }\r\n }\r\n\r\n if (context.request.user.isAuthenticated) {\r\n if (!props.data.wishlists || props.data.wishlists.length === 0) {\r\n const wishlistName = props.nameOfWishlist;\r\n const customer = await getCustomerAccount(props);\r\n if (customer && customer.AccountNumber) {\r\n const listData: CommerceList = {\r\n CustomerId: customer.AccountNumber,\r\n Name: wishlistName,\r\n\r\n // This is the type value specifically for a wishlist\r\n CommerceListTypeValue: 1,\r\n Id: 0\r\n };\r\n\r\n try {\r\n const commerceList = await createCommerceListAsync({ callerContext: context.actionContext }, listData);\r\n return callAddWishlistLine(props, state, commerceList.Id, product.RecordId);\r\n } catch (error) {\r\n if (context.telemetry) {\r\n context.telemetry.warning(error as any);\r\n context.telemetry.debug('Unable to create a wishlist');\r\n }\r\n propagateError(props, { status: 'FAILED' });\r\n }\r\n } else {\r\n context.telemetry.debug('Customer account number missing');\r\n }\r\n } else {\r\n return callAddWishlistLine(props, state, props.data.wishlists[0].Id, product.RecordId);\r\n }\r\n }\r\n\r\n return AsyncResult.resolve();\r\n};\r\n\r\nconst callAddWishlistLine = async (\r\n props: IAddToWishlistComponentProps,\r\n state: IAddToWishlistStateManager,\r\n wishlistId: number,\r\n productId: number\r\n): Promise => {\r\n const { context } = props;\r\n\r\n try {\r\n const customer = await getCustomerAccount(props);\r\n if (customer && customer.AccountNumber) {\r\n const createdCommerceList = await addLinesAsync({ callerContext: context.actionContext }, wishlistId, [\r\n buildWishlistLine(productId, customer.AccountNumber, wishlistId)\r\n ]);\r\n context.actionContext.update(createGetByCustomerInput({}, null), [createdCommerceList]);\r\n if (context.telemetry) {\r\n context.telemetry.debug(`Added item to the wishlist ${createdCommerceList}`);\r\n }\r\n state.setCanRemove(true);\r\n state.setContent({\r\n color: 'success',\r\n showAlert: true,\r\n wishlistTextMessage: props.addToWishlistMessage ? props.addToWishlistMessage : 'Added to your wishlist'\r\n });\r\n propagateSuccess(props, { status: 'ADDED' });\r\n } else {\r\n context.telemetry.debug('Customer Account number missing');\r\n }\r\n } catch (error) {\r\n if (context.telemetry) {\r\n context.telemetry.warning(error as any);\r\n context.telemetry.debug(`Unable to add item to wishlist ${error}`);\r\n }\r\n\r\n state.setContent({\r\n color: 'danger',\r\n showAlert: true,\r\n wishlistTextMessage: props.addItemToWishlistError\r\n });\r\n propagateError(props, { status: 'FAILED' });\r\n }\r\n};\r\n\r\nconst removeFromWishlist = async (\r\n product: SimpleProduct,\r\n props: IAddToWishlistComponentProps,\r\n state: IAddToWishlistStateManager\r\n): Promise => {\r\n const { context, data, removedFromWishlistMessage, removeItemFromWishlistError } = props;\r\n const { wishlists } = data;\r\n const { actionContext, telemetry } = context;\r\n\r\n // TODO Please fix customeraccount number null once Bug https://msdyneng.visualstudio.com/FinOps/_workitems/edit/481375 gets fixed.\r\n if (context.request.user.isAuthenticated) {\r\n if (wishlists && wishlists[0]) {\r\n const wishlistLine = wishlists[0].CommerceListLines!.find(line => line.ProductId === product.RecordId);\r\n\r\n if (wishlistLine) {\r\n try {\r\n const customer = await getCustomerAccount(props);\r\n const commerceList = await removeLinesAsync({ callerContext: actionContext }, wishlists[0].Id, [wishlistLine]);\r\n if (customer) {\r\n context.actionContext.update(createGetByCustomerInput({}, null), [commerceList]);\r\n } else {\r\n telemetry.debug('Customer Account Number missing');\r\n }\r\n\r\n if (telemetry) {\r\n telemetry.debug(`[WishlistButton] ${product.RecordId} removed from Wishlist ${commerceList.Id}`);\r\n }\r\n state.setCanRemove(false);\r\n state.setContent({\r\n color: 'success',\r\n showAlert: true,\r\n wishlistTextMessage: removedFromWishlistMessage ? removedFromWishlistMessage : 'Removed item from the wishlist'\r\n });\r\n propagateSuccess(props, { status: 'REMOVED' });\r\n } catch (error) {\r\n if (telemetry) {\r\n telemetry.warning(error as any);\r\n telemetry.debug('[WishlistButton] Error removing item from the wishlist');\r\n }\r\n\r\n state.setContent({\r\n color: 'danger',\r\n wishlistTextMessage: removeItemFromWishlistError\r\n });\r\n propagateError(props, { status: 'FAILED' });\r\n }\r\n }\r\n } else if (telemetry) {\r\n telemetry.debug(\"[WishlistButton] Can't remove from wishlist since no wishlist exisits OR there is no product data\");\r\n }\r\n }\r\n\r\n return AsyncResult.resolve();\r\n};\r\n\r\nconst getCustomerAccount = (props: IAddToWishlistComponentProps): AsyncResult => {\r\n const { context } = props;\r\n const customerInput = new GetCustomerInput(context.actionContext.requestContext.apiSettings);\r\n return getCustomer(customerInput, context.actionContext);\r\n};\r\n\r\nexport const AddToWishlistComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n // @ts-expect-error\r\n IAddtoWishlistComponent\r\n>('AddToWishlist', { component: AddToWishlist, ...AddToWishlistComponentActions });\r\n\r\nexport default AddToWishlistComponent;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { CartLinePriceEditor, ICartLinePriceEditorResources, PriceComponent } from '@msdyn365-commerce/components';\r\nimport MsDyn365, { IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { ChannelDeliveryOptionConfiguration, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { CartLine, ProductCatalog, SalesLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { ArrayExtensions, getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, IncrementalQuantity, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classNames from 'classnames';\r\nimport * as React from 'react';\r\n\r\n/**\r\n * ICartlineResourceString: Interface for specifying the\r\n * resource strings that the component needs.\r\n */\r\nexport interface ICartlineResourceString {\r\n /**\r\n * Display string for discount label\r\n */\r\n discountStringText: string;\r\n\r\n /**\r\n * String for size key\r\n */\r\n sizeString: string;\r\n\r\n /**\r\n * String for color key\r\n */\r\n colorString: string;\r\n\r\n /**\r\n * String associated with the configuration product dimension\r\n */\r\n configString: string;\r\n\r\n /**\r\n * String for style key\r\n */\r\n styleString: string;\r\n\r\n /**\r\n * String for amount key\r\n */\r\n amountString?: string;\r\n\r\n /**\r\n * Display string for quantity label\r\n */\r\n quantityDisplayString: string;\r\n\r\n /**\r\n * Display string for quantity label\r\n */\r\n inputQuantityAriaLabel: string;\r\n\r\n /**\r\n * Aria label for the decrement button in quantity component\r\n */\r\n decrementButtonAriaLabel: string;\r\n\r\n /**\r\n * Aria label for the increment button in quantity component\r\n */\r\n incrementButtonAriaLabel: string;\r\n\r\n /**\r\n * Original text screenreader\r\n */\r\n originalPriceText: string;\r\n\r\n /**\r\n * Current text screenreader\r\n */\r\n currentPriceText: string;\r\n\r\n /**\r\n * Shipping Charges Text\r\n */\r\n shippingChargesText: string;\r\n\r\n priceEditorResources?: ICartLinePriceEditorResources;\r\n salesAgreementPricePrompt?: string;\r\n}\r\n\r\ninterface ICartLineData {\r\n cartLine: CartLine | SalesLine;\r\n cartState?: ICartState;\r\n product?: SimpleProduct;\r\n catalogs?: ProductCatalog[];\r\n}\r\n\r\n/**\r\n * ICartLineProps: The props required to render cartLineitem.\r\n */\r\nexport interface ICartLineProps extends IComponentProps {\r\n /**\r\n * The flag to change the quantity component from intractable to static.\r\n */\r\n disableQuantityInteractivity?: boolean;\r\n\r\n /**\r\n * The primary image url.\r\n */\r\n primaryImageUrl?: string;\r\n\r\n /**\r\n * The product url.\r\n */\r\n productUrl?: string;\r\n\r\n /**\r\n * GridSettings for the product image in cartLine.\r\n */\r\n gridSettings: IGridSettings;\r\n\r\n /**\r\n * ImageSettings for the product image in cartLine.\r\n */\r\n imageSettings: IImageSettings;\r\n\r\n /**\r\n * Boolean flag to indicate if the item is out of stock.\r\n */\r\n isOutOfStock?: boolean;\r\n\r\n /**\r\n * Flag to make quantity section editable.\r\n */\r\n isQuantityEditable?: boolean;\r\n\r\n /**\r\n * Max quantity for line item.\r\n */\r\n maxQuantity?: number;\r\n\r\n /**\r\n * Current quantity for line item.\r\n */\r\n currentQuantity?: number;\r\n\r\n /**\r\n * Resource string for the component.\r\n */\r\n resources: ICartlineResourceString;\r\n\r\n /**\r\n * SalesLine flag.\r\n */\r\n isSalesLine?: boolean;\r\n\r\n /**\r\n * Error message to show in place of quantity.\r\n */\r\n errorMessage?: string;\r\n\r\n /**\r\n * Inventory information label.\r\n */\r\n inventoryInformationLabel?: string;\r\n\r\n /**\r\n * Inventory information class name.\r\n */\r\n inventoryLabelClassName?: string;\r\n\r\n /**\r\n * Flag to show/hide shipping charges for line items.\r\n */\r\n showShippingChargesForLineItems?: boolean;\r\n\r\n /**\r\n * Boolean flag to indicate if cart state status is ready.\r\n */\r\n isCartStateReady?: boolean;\r\n\r\n /**\r\n * Chanel Delivery Option configuration is from api.\r\n */\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n /**\r\n * The telemetry content.\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n\r\n /**\r\n * The cart line index.\r\n */\r\n lineIndex?: number;\r\n\r\n /**\r\n * Quantity onChange callback.\r\n */\r\n quantityOnChange?(cartLine: CartLine, newQuantity: number, lineIndex?: number): boolean;\r\n}\r\n\r\ninterface IDimensionStrings {\r\n /**\r\n * String for size key.\r\n */\r\n sizeString: string;\r\n\r\n /**\r\n * String for color key.\r\n */\r\n colorString: string;\r\n\r\n /**\r\n * String associated with the configuration product dimension.\r\n */\r\n configString: string;\r\n\r\n /**\r\n * String for style key.\r\n */\r\n styleString: string;\r\n\r\n /**\r\n * String for amount key.\r\n */\r\n amountString?: string;\r\n}\r\n\r\n/**\r\n * Renders catalog label for the cart line.\r\n * @param props - Cart line props.\r\n * @returns Catalog label.\r\n */\r\nconst CatalogLabelComponent: React.FC = (props: ICartLineProps) => {\r\n const catalogId = props.data.cartLine.CatalogId;\r\n\r\n if (!props.context.request.user.isB2b || !catalogId || !ArrayExtensions.hasElements(props.data.catalogs)) {\r\n return null;\r\n }\r\n\r\n const catalog = props.data.catalogs.find(item => item.RecordId === catalogId);\r\n\r\n if (!catalog || !catalog.Name) {\r\n return null;\r\n }\r\n\r\n return
{catalog.Name}
;\r\n};\r\n\r\nconst CartLineItemFunctions = {\r\n renderProductDimensions: (Product: SimpleProduct, DimensionStrings: IDimensionStrings) => {\r\n if (!Product || !Product.Dimensions) {\r\n return [];\r\n }\r\n\r\n return Product.Dimensions.map(productDimension => {\r\n if (productDimension.DimensionTypeValue === 1) {\r\n return (\r\n
\r\n \r\n {DimensionStrings.colorString}:\r\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === 2) {\r\n return (\r\n
\r\n \r\n {DimensionStrings.configString}:\r\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === 3) {\r\n return (\r\n
\r\n \r\n {DimensionStrings.sizeString}:\r\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === 4) {\r\n return (\r\n
\r\n \r\n {Product.IsGiftCard ? DimensionStrings.amountString : DimensionStrings.styleString}:\r\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\r\n \r\n
\r\n );\r\n }\r\n return null;\r\n });\r\n },\r\n\r\n renderDiscountLines: (props: ICartLineProps) => {\r\n if (!props.data.cartLine.DiscountLines || props.data.cartLine.DiscountLines.length === 0) {\r\n return null;\r\n }\r\n\r\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\r\n return (\r\n
\r\n \r\n {discountLine.OfferName ? discountLine.OfferName : ''}:{` ${props.resources.discountStringText || 'Discount'} `}\r\n \r\n \r\n \r\n \r\n {` (${discountLine.EffectivePercentage !== undefined ? discountLine.EffectivePercentage : ''}%)`}\r\n
\r\n );\r\n });\r\n },\r\n renderInventoryLabel: (props: ICartLineProps) => {\r\n if (!props.inventoryInformationLabel) {\r\n return null;\r\n }\r\n const inventoryCssName = props.inventoryLabelClassName\r\n ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}`\r\n : 'msc-cart-line__product-inventory-label';\r\n return {props.inventoryInformationLabel};\r\n },\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @param props - Icartline props.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n renderUnitOfMeasure: (props: ICartLineProps) => {\r\n if (props.data.cartLine.IsInvoiceLine) {\r\n return null;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\r\n if (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none') {\r\n return undefined;\r\n }\r\n\r\n const product = props.data.product;\r\n if (!product || !product.DefaultUnitOfMeasure) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n
\r\n {product.DefaultUnitOfMeasure}\r\n
\r\n );\r\n },\r\n renderShippingLabel: (props: ICartLineProps) => {\r\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\r\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\r\n const cartline = props.data.cartLine;\r\n let hasShippingMethod = false;\r\n if (channelDeliveryOptionConfig !== undefined) {\r\n hasShippingMethod = !!(\r\n cartline.DeliveryMode &&\r\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.some(deliveryMode => deliveryMode !== cartline.DeliveryMode)\r\n );\r\n } else {\r\n hasShippingMethod = !!(cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode);\r\n }\r\n if (!hasShippingMethod) {\r\n return undefined;\r\n }\r\n\r\n const shippingChargeLines = (cartline.ChargeLines || []).filter(chargeLine => chargeLine.IsShipping);\r\n\r\n if (shippingChargeLines.length === 0) {\r\n return undefined;\r\n }\r\n\r\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\r\n return chargeTotal + (chargeLine.CalculatedAmount || 0);\r\n }, 0);\r\n\r\n const priceComponent = (\r\n \r\n );\r\n return (\r\n <>\r\n \r\n {priceComponent}\r\n \r\n );\r\n },\r\n renderOtherCharges: (props: ICartLineProps) => {\r\n const cartline = props.data.cartLine;\r\n const otherCharges = cartline.ChargeLines?.filter(chargeline => !chargeline.IsShipping);\r\n\r\n return (\r\n (otherCharges &&\r\n otherCharges.map((otherCharge, key) => {\r\n return otherCharge && otherCharge.CalculatedAmount ? (\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n ) : (\r\n ''\r\n );\r\n })) ||\r\n undefined\r\n );\r\n },\r\n\r\n /**\r\n * Render the sales agreement prompt.\r\n * @param props - The ICartLineProps.\r\n * @returns The JSX.Element.\r\n */\r\n renderSalesAgreementPrompt: (props: ICartLineProps): JSX.Element | null => {\r\n if (props.data.cartLine.SalesAgreementLineRecordId === 0) {\r\n return null;\r\n }\r\n return
{props.resources.salesAgreementPricePrompt}
;\r\n }\r\n};\r\n\r\n// eslint-disable-next-line no-redeclare\r\nconst CartLine: React.FC = (props: ICartLineProps) => {\r\n const { isSalesLine, productUrl, resources } = props;\r\n const { product, cartLine } = props.data;\r\n\r\n const destructDimensionStrings = {\r\n sizeString: resources.sizeString,\r\n colorString: resources.colorString,\r\n styleString: resources.styleString,\r\n configString: resources.configString,\r\n amountString: resources.amountString\r\n };\r\n\r\n const fallbackImageUrl = product && getFallbackImageUrl(product.ItemId, props.context.actionContext.requestContext.apiSettings);\r\n const productDimensions = product && CartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\r\n const imageSettings = props.imageSettings;\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n const renderDisountLines = CartLineItemFunctions.renderDiscountLines(props);\r\n const renderInventoryLabel = CartLineItemFunctions.renderInventoryLabel(props);\r\n const renderUnitOfMeasure = CartLineItemFunctions.renderUnitOfMeasure(props);\r\n const renderShippingLabel = CartLineItemFunctions.renderShippingLabel(props);\r\n const renderOtherCharges = CartLineItemFunctions.renderOtherCharges(props);\r\n const renderSalesAgreementPrompt = CartLineItemFunctions.renderSalesAgreementPrompt(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\r\n const productAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n const productName = product?.Name || cartLine.Description;\r\n const imgeClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-image' : 'msc-cart-line__product-image';\r\n\r\n const onChange = (newValue: number): boolean => {\r\n if (props.quantityOnChange) {\r\n return props.quantityOnChange(props.data.cartLine, newValue, props.lineIndex);\r\n }\r\n return true;\r\n };\r\n\r\n const _generateErrorMessage = (): JSX.Element | null => {\r\n if (props.errorMessage) {\r\n return (\r\n
\r\n \r\n {props.errorMessage}\r\n
\r\n );\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const _generateQuantityandPrice = (): JSX.Element[] | null => {\r\n const nodes = [];\r\n if (props.isOutOfStock) {\r\n return null;\r\n }\r\n\r\n // No quantity selector for invoice line\r\n if (!props.data.cartLine.IsInvoiceLine) {\r\n if (props.data.product && props.isQuantityEditable) {\r\n nodes.push(\r\n
\r\n
{resources.quantityDisplayString}
\r\n \r\n
\r\n );\r\n } else {\r\n nodes.push(\r\n
\r\n \r\n {props.data.cartLine.Quantity}\r\n
\r\n );\r\n }\r\n }\r\n\r\n process.env.NODE_ENV === 'development' && console.log('CartLine', isSalesLine, props.data.cartLine);\r\n\r\n if (props.data.cartLine.NetAmountWithoutTax === 0) {\r\n const originalPriceText = props.context.cultureFormatter.formatCurrency(props.data.cartLine.NetPrice ?? 0);\r\n nodes.push(\r\n
\r\n
\r\n Bonus!\r\n {originalPriceText}\r\n $0.00\r\n
\r\n
\r\n );\r\n } else {\r\n nodes.push(\r\n
\r\n \r\n {(props.data.cartLine.DiscountAmount && props.data.cartLine.DiscountAmount > 0 && (\r\n <>\r\n \r\n {` ${props.resources.discountStringText || 'Discount'} `}\r\n \r\n \r\n \r\n )) ||\r\n null}\r\n
\r\n );\r\n }\r\n\r\n return nodes;\r\n };\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n {MsDyn365.isBrowser ? (\r\n \r\n {productName}\r\n \r\n ) : null}\r\n {ArrayExtensions.hasElements(productDimensions) ? (\r\n
{productDimensions}
\r\n ) : (\r\n ''\r\n )}\r\n {renderUnitOfMeasure}\r\n
\r\n \r\n
\r\n {renderDisountLines}\r\n {renderInventoryLabel}\r\n {props.showShippingChargesForLineItems &&
{renderShippingLabel}
}\r\n {renderOtherCharges}\r\n {renderSalesAgreementPrompt}\r\n
\r\n {_generateQuantityandPrice()}\r\n {props.data.cartLine.IsInvoiceLine && props.data.cartState && props.resources.priceEditorResources && (\r\n \r\n )}\r\n
\r\n
\r\n {_generateErrorMessage()}\r\n \r\n );\r\n};\r\n\r\nexport default CartLine;\r\n","import classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { translate } from '../../../../common/utilities/localisation/translationUtilities';\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\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ProductPrice } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\r\n className?: string;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n}\r\nexport interface IPriceComponent extends IComponent {\r\n}\r\n\r\nconst PriceComponentActions = {\r\n};\r\n\r\nconst Price: React.FC = (props: IPriceComponentProps) => {\r\n // CustomerContextualPrice could be 0\r\n if (props.data.price.CustomerContextualPrice === undefined) {\r\n return null;\r\n }\r\n return (\r\n \r\n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\r\n \r\n );\r\n};\r\n\r\nconst showStrikethroughPricing = (props: IPriceComponentProps) => {\r\n const originalPrice = getOriginalPrice(props);\r\n if (originalPrice && props.data.price.CustomerContextualPrice) {\r\n return originalPrice > props.data.price.CustomerContextualPrice;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nconst getOriginalPrice = (props: IPriceComponentProps) => {\r\n return props.data.price.TradeAgreementPrice || props.data.price.BasePrice || 0;\r\n};\r\n\r\nconst renderCurrentPrice = (props: IPriceComponentProps): JSX.Element | undefined => {\r\n const initialPrice = formatCurrency(props, props.data.price.CustomerContextualPrice);\r\n return {initialPrice};\r\n};\r\n\r\nconst formatCurrency = (props: IPriceComponentProps, price: number | undefined): string | undefined => {\r\n if (price === undefined) {\r\n return undefined;\r\n }\r\n\r\n if (price === 0 && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(price);\r\n};\r\n\r\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element | null => {\r\n const locale = props.context.request.locale;\r\n const originalPrice = getOriginalPrice(props);\r\n const initialPrice = formatCurrency(props, originalPrice);\r\n let discountAmount = formatCurrency(props, props.data.price.DiscountAmount);\r\n let discountPrice = 0;\r\n if (props.data.price.CustomerContextualPrice && initialPrice !== undefined) {\r\n discountPrice = originalPrice - props.data.price.CustomerContextualPrice\r\n discountAmount = formatCurrency(props, originalPrice - props.data.price.CustomerContextualPrice);\r\n }\r\n\r\n const saveAmtFmt = translate(locale, 'price-component.save-amt', 'Save {0}');\r\n\r\n\r\n return (\r\n <>\r\n {props.originalPriceText} {initialPrice} {props.currentPriceText} {renderCurrentPrice(props)}\r\n {discountPrice > 0 ? {saveAmtFmt.replace('{0}', discountAmount || '')} : null}\r\n {initialPrice}\r\n {renderCurrentPrice(props)}\r\n \r\n );\r\n};\r\n\r\n// @ts-ignore\r\nexport const PriceComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'Price',\r\n { component: Price, ...PriceComponentActions }\r\n);\r\n\r\nexport default PriceComponent;\r\n","import React from 'react';\r\nimport { ProductStockStatusEnum } from '../../../../common/utilities/productListExtensionHelpers';\r\nimport { translate } from '../../../../common/utilities/localisation/translationUtilities';\r\n\r\ninterface IProductStockStatusProps {\r\n availabilityStatus: ProductStockStatusEnum;\r\n locale: string;\r\n hideStatus: boolean;\r\n}\r\n\r\nexport const ProductStockStatus: React.FC = ({ availabilityStatus, locale, hideStatus }) => {\r\n switch (availabilityStatus) {\r\n case ProductStockStatusEnum.ONLINE:\r\n return hideStatus ? null : (\r\n

\r\n \r\n {' '}\r\n {translate(locale, 'product-list.in-stock', 'In Stock Online')}\r\n

\r\n );\r\n case ProductStockStatusEnum.IN_STORE:\r\n return (\r\n <>\r\n {!hideStatus &&

\r\n \r\n {' '}\r\n {translate(locale, 'product-list.out-of-stock', 'Out of Stock online')}\r\n

}\r\n

\r\n {translate(locale, 'product-list.available-in-store', 'Available in select Stores')}\r\n

\r\n \r\n );\r\n case ProductStockStatusEnum.OUT_OF_STOCK:\r\n default:\r\n return hideStatus ? null : (\r\n <>\r\n

\r\n \r\n {' '}\r\n {translate(locale, 'product-list.out-of-stock', 'Out of Stock online')}\r\n

\r\n \r\n );\r\n }\r\n};\r\n","import { getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n onTelemetryClick\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IComponent,\r\n IComponentProps,\r\n ICoreContext,\r\n IGridSettings,\r\n IImageData,\r\n IImageSettings,\r\n Image,\r\n IRequestContext,\r\n msdyn365Commerce,\r\n IImageProps\r\n} from '@msdyn365-commerce/core';\r\nimport { ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport Bazzarvoice from '../../../../modules/bazzarvoice-widget/components/Bazzarvoice';\r\nimport { widgetType } from '../../../../modules/bazzarvoice-widget/bazzarvoice-widget.props.autogenerated';\r\nimport { ProductStockStatus } from './ProductStockStatus';\r\nimport {\r\n findAllAttributes,\r\n findAttribute,\r\n findAttributeValue,\r\n getProductBadgeUrl,\r\n getProductStockStatus\r\n} from '../../../../common/utilities/productListExtensionHelpers';\r\nimport { translate } from '../../../../common/utilities/localisation/translationUtilities';\r\n\r\nconst DefaultFallbackImage = 'https://henrys.com/?fileName=placeholder.png';\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent {}\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst ProductCard: React.FC = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton\r\n}) => {\r\n const product = data.product;\r\n if (!product) {\r\n return null;\r\n }\r\n\r\n const [shouldHidePrice, setShouldHidePrice] = React.useState(null);\r\n let productUrl = getProductPageUrlSync(product.Name || '', product.RecordId, context && context.actionContext, undefined);\r\n if (allowBack) {\r\n productUrl = updateProductUrl(productUrl, context);\r\n }\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n const baseUrl = context.request.apiSettings.baseImageUrl;\r\n const locale = context.request.locale;\r\n const productBadgeStatus = getProductBadgeUrl(product, locale, baseUrl, '_PLP');\r\n React.useEffect(() => {\r\n const showPriceInCartAttributeArray = findAllAttributes(product.AttributeValues, 'See Price In Cart');\r\n if (showPriceInCartAttributeArray && showPriceInCartAttributeArray.length) {\r\n for (let i = 0; i < showPriceInCartAttributeArray.length; i++) {\r\n // have to find all attributes for this and loop through\r\n const attributeValue = findAttributeValue(showPriceInCartAttributeArray[i]);\r\n if (typeof attributeValue === 'boolean' && attributeValue) {\r\n setShouldHidePrice(true);\r\n break;\r\n }\r\n if (shouldHidePrice === null) {\r\n setShouldHidePrice(false);\r\n }\r\n }\r\n } else {\r\n setShouldHidePrice(false);\r\n }\r\n }, []);\r\n\r\n return (\r\n <>\r\n \r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n context.actionContext.requestContext\r\n )}\r\n {productBadgeStatus && (\r\n \r\n )}\r\n
\r\n {_renderProductSkuMFR(product)}\r\n
\r\n
{product.Name}
\r\n {renderRating(product)}\r\n {shouldHidePrice === null\r\n ? null\r\n : renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n shouldHidePrice ? translate(locale, 'product-list.see-price-in-cart', 'See Price In Cart') : null,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText\r\n )}\r\n {renderDescription(product.Description)}\r\n {product.ExtensionProperties?.length ? (\r\n \r\n ) : null}\r\n
\r\n \r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n \r\n );\r\n};\r\n\r\nfunction _renderProductSkuMFR(product: ProductSearchResult): JSX.Element {\r\n const mfrAttr = findAttribute(product.AttributeValues, 'MFR');\r\n let mfrValue;\r\n if (mfrAttr) {\r\n mfrValue = findAttributeValue(mfrAttr);\r\n }\r\n return (\r\n

\r\n SKU: {product.ItemId} {mfrValue ? ` MFR Code: ${mfrValue}` : null}\r\n

\r\n );\r\n}\r\n\r\nfunction renderLabel(name?: string, price?: string, rating?: number, ratingAriaLabel?: string): string {\r\n name = name || '';\r\n price = price || '';\r\n return `${name} ${price} ${getRatingAriaLabel(rating, ratingAriaLabel)}`;\r\n}\r\n\r\nfunction renderDescription(description?: string): JSX.Element | null {\r\n return

{description}

;\r\n}\r\n\r\nfunction renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item });\r\n}\r\n\r\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\r\n if (rating && ratingAriaLabel) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabel || '', roundedRating, '5');\r\n }\r\n return '';\r\n}\r\n\r\nfunction updateProductUrl(productUrl: string, context: ICoreContext): string {\r\n const srcUrl = new URL(productUrl, context.request.apiSettings.baseUrl);\r\n const queryString = 'back=true';\r\n if (srcUrl.search) {\r\n srcUrl.search += `&${queryString}`;\r\n } else {\r\n srcUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(srcUrl.href);\r\n return updatedUrl.pathname + srcUrl.search;\r\n}\r\n\r\nfunction renderRating(product?: ProductSearchResult): JSX.Element | null {\r\n if (!product) {\r\n return null;\r\n }\r\n\r\n return ;\r\n}\r\n\r\nfunction renderPrice(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\r\n seePriceInCart?: string | null,\r\n basePrice?: number,\r\n adjustedPrice?: number,\r\n savingsText?: string,\r\n freePriceText?: string,\r\n originalPriceText?: string,\r\n currentPriceText?: string\r\n): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice\r\n };\r\n\r\n if (seePriceInCart) {\r\n return

{seePriceInCart}

;\r\n }\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\n/**\r\n * Gets the react component for product rating.\r\n * @param productCardimageSettings - Module image settings for product card.\r\n * @param gridSettings - Grid settings defined in theme.\r\n * @param imageUrl - Image url.\r\n * @param fallbackImageUrl - Fallback url for imge.\r\n * @param altText - Image Alt text.\r\n * @param requestContext - Request context using the component.\r\n * @returns React component for product image.\r\n */\r\nfunction renderProductPlacementImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n altText?: string,\r\n requestContext?: IRequestContext\r\n): JSX.Element | null {\r\n if (!imageUrl || !gridSettings || !imageSettings) {\r\n return null;\r\n }\r\n\r\n const emptyPlaceHolderImage: string | undefined = requestContext?.app.config.placeholderImageName;\r\n let fallbackImageSource = emptyPlaceHolderImage ?? DefaultFallbackImage;\r\n\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageSource\r\n };\r\n const imageProps: IImageProps = {\r\n gridSettings,\r\n imageSettings: {\r\n ...imageSettings,\r\n cropFocalRegion: true\r\n }\r\n };\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport const ProductComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n IProductComponent\r\n>('Product', { component: ProductCard, ...PriceComponentActions });\r\n\r\nexport default ProductComponent;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { PriceComponent } from '@msdyn365-commerce/components';\r\nimport { IComponentProps } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport {\r\n Button,\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n IPayLoad,\r\n ITelemetryContent,\r\n TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IPromoCodeProps extends IComponentProps<{}> {\r\n cart: ICartState | undefined;\r\n promoCodeHeadingText: string;\r\n appliedPromoCodeHeadingText: string;\r\n removePromoAriaLabelFormat: string;\r\n promoPlaceholderText: string;\r\n promoCodeApplyButtonText: string;\r\n collapseTimeOut: number;\r\n removePromoText: string;\r\n invalidPromoCodeErrorText: string;\r\n failedToAddPromoCodeErrorText: string;\r\n duplicatePromoCodeErrorText: string;\r\n failedToRemovePromoCodeErrorText: string;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n promoCodeApplyCallback?(): void;\r\n}\r\n\r\ninterface IPromoCodeState {\r\n isCollapseOpen: boolean;\r\n promoCodeInputValue: string;\r\n error: string;\r\n canApply: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * The PromoCode component renders the promocode section.\r\n * @extends {React.PureComponent}\r\n */\r\nclass PromoCode extends React.Component {\r\n private readonly payLoad: IPayLoad;\r\n\r\n constructor(props: IPromoCodeProps, state: IPromoCodeState) {\r\n super(props);\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, TelemetryConstant.ApplyPromoCode);\r\n this.state = {\r\n isCollapseOpen: false,\r\n promoCodeInputValue: '',\r\n error: '',\r\n canApply: false\r\n };\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IPromoCodeProps, nextState: IPromoCodeState): 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 public render(): JSX.Element {\r\n return (\r\n
\r\n
{this.props.promoCodeHeadingText}
\r\n {this._renderForm(this.props.promoPlaceholderText, this.props.promoCodeApplyButtonText, this.props.cart)}\r\n

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

\r\n {this._renderAppliedPromoCode(this.props)}\r\n
\r\n );\r\n }\r\n\r\n private readonly _onInputChangeHandler = (e: React.ChangeEvent) => {\r\n const error = e.target.value === '' ? '' : this.state.error;\r\n this.setState({\r\n promoCodeInputValue: e.target.value.trim(),\r\n error,\r\n canApply: !!e.target.value\r\n });\r\n };\r\n\r\n private readonly _applyPromotion = (cartState: ICartState | undefined) => {\r\n if (!cartState || !cartState.cart) {\r\n return;\r\n }\r\n const appliedPromo = this.state.promoCodeInputValue;\r\n\r\n cartState\r\n .addPromoCode({ promoCode: appliedPromo })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n // Show success text\r\n this.setState({ promoCodeInputValue: '', error: '', canApply: false });\r\n } else if (result.substatus === 'ALREADYADDED') {\r\n this.setState({ error: this.props.duplicatePromoCodeErrorText });\r\n } else {\r\n this.setState({ error: this.props.invalidPromoCodeErrorText });\r\n }\r\n })\r\n .catch(error => {\r\n this.setState({ error: this.props.failedToAddPromoCodeErrorText });\r\n });\r\n };\r\n\r\n /**\r\n * On Submit function.\r\n * @param cartState -Cartstate.\r\n * @returns Apply promotion.\r\n */\r\n private readonly _onSubmitHandler = (cartState: ICartState | undefined) => (event: React.FormEvent) => {\r\n event.preventDefault();\r\n this._applyPromotionHandler(cartState);\r\n };\r\n\r\n /**\r\n * On apply promotion function.\r\n * @param cartState -Cartstate.\r\n * @returns Apply promotion.\r\n */\r\n private readonly _applyPromotionHandler = (cartState: ICartState | undefined) => () => {\r\n this._applyPromotion(cartState);\r\n };\r\n\r\n private readonly _renderForm = (promoPlaceholderText: string, promoCodeApplyButtonText: string, cartState: ICartState | undefined) => {\r\n const attributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n {promoCodeApplyButtonText}\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n private readonly _removePromotion = (cartState: ICartState | undefined, event: React.MouseEvent) => {\r\n if (!cartState) {\r\n return;\r\n }\r\n const code = event.currentTarget.getAttribute('data-value') || '';\r\n cartState\r\n .removePromoCodes({\r\n promoCodes: [code]\r\n })\r\n .then(result => {\r\n if (result.status === 'SUCCESS') {\r\n this.setState({ error: '' });\r\n }\r\n })\r\n .catch(() => {\r\n this.setState({ error: this.props.failedToRemovePromoCodeErrorText });\r\n });\r\n };\r\n\r\n private readonly _calculateDiscount = (code: string, cartState: ICartState | undefined) => {\r\n if (!cartState || !cartState.cart || !cartState.cart.CartLines || cartState.cart.CartLines.length === 0 || !code) {\r\n return;\r\n }\r\n let discountAmount = 0;\r\n for (const line of cartState.cart.CartLines) {\r\n if (line.DiscountLines) {\r\n for (const discountLine of line.DiscountLines) {\r\n if (discountLine.DiscountCode === code) {\r\n discountAmount += discountLine.DiscountCost!;\r\n }\r\n }\r\n }\r\n }\r\n return discountAmount * -1;\r\n };\r\n\r\n private readonly _renderAppliedPromoCode = (props: IPromoCodeProps) => {\r\n if (!props.cart || !props.cart.cart || !props.cart.cart.Coupons || props.cart.cart.Coupons.length === 0) {\r\n return;\r\n }\r\n\r\n const removePromotionHandler = (event: React.MouseEvent) => {\r\n this._removePromotion(props.cart, event);\r\n };\r\n\r\n const promoCodTotalDiscount = props.cart.cart.Coupons.reduce((count: number, coupon: Coupon) => {\r\n return count + (this._calculateDiscount(coupon.Code || '', props.cart) || 0);\r\n }, 0);\r\n\r\n return (\r\n <>\r\n
\r\n
{this.props.appliedPromoCodeHeadingText}
\r\n \r\n
\r\n {props.cart.cart.Coupons.map((coupon: Coupon) => {\r\n const ariaLabel = props.removePromoAriaLabelFormat\r\n ? format(props.removePromoAriaLabelFormat, props.removePromoText, coupon.Code)\r\n : '';\r\n\r\n return (\r\n
\r\n
\r\n {coupon.Code}{' '}\r\n \r\n
\r\n \r\n {props.removePromoText}\r\n \r\n
\r\n );\r\n })}\r\n \r\n );\r\n };\r\n}\r\n\r\nexport default PromoCode;\r\n","/**\n* Copyright (c) 2018 Microsoft Corporation\n* Modules Registration\n* THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\n*/\n\nexport const componentDictionary = {};\n\ncomponentDictionary['__local__|__local__|modules|hei-buybox|components|add-to-cart'] = {\n c: () => require('partner/modules/hei-buybox/components/add-to-cart.component.tsx'),\n cn: '__local__-__local__-add-to-cart'\n };\ncomponentDictionary['__local__|__local__|themes|henrys|views|components|addtowishlist'] = {\n c: () => require('partner/themes/henrys/views/components/addtowishlist.component.tsx'),\n cn: '__local__-__local__-addtowishlist'\n };\ncomponentDictionary['__local__|__local__|themes|henrys|views|components|cartlineitem'] = {\n c: () => require('partner/themes/henrys/views/components/cartlineitem.component.tsx'),\n cn: '__local__-__local__-cartlineitem'\n };\ncomponentDictionary['__local__|__local__|themes|henrys|views|components|price'] = {\n c: () => require('partner/themes/henrys/views/components/price.component.tsx'),\n cn: '__local__-__local__-price'\n };\ncomponentDictionary['__local__|__local__|themes|henrys|views|components|product'] = {\n c: () => require('partner/themes/henrys/views/components/product.component.tsx'),\n cn: '__local__-__local__-product'\n };\ncomponentDictionary['__local__|__local__|themes|henrys|views|components|promocode'] = {\n c: () => require('partner/themes/henrys/views/components/promocode.component.tsx'),\n cn: '__local__-__local__-promocode'\n };\ncomponentDictionary['@msdyn365-commerce-modules|fabrikam-design-kit|modules|fabrikam|views|components|cartlineitem'] = {\n c: () => require('@msdyn365-commerce-modules/fabrikam-design-kit/dist/lib/modules/fabrikam/views/components/cartlineitem.component.js'),\n cn: '@msdyn365-commerce-modules-fabrikam-design-kit-cartlineitem'\n };\ncomponentDictionary['@msdyn365-commerce-modules|fabrikam-design-kit|modules|fabrikam|views|components|promocode'] = {\n c: () => require('@msdyn365-commerce-modules/fabrikam-design-kit/dist/lib/modules/fabrikam/views/components/promocode.component.js'),\n cn: '@msdyn365-commerce-modules-fabrikam-design-kit-promocode'\n };\ncomponentDictionary['@msdyn365-commerce-modules|order-management|modules|order-history-with-search-and-filters|components|order-history-with-search-and-filters-header'] = {\n c: () => require('@msdyn365-commerce-modules/order-management/dist/lib/modules/order-history-with-search-and-filters/components/order-history-with-search-and-filters-header.component.js'),\n cn: '@msdyn365-commerce-modules-order-management-order-history-with-search-and-filters-header'\n };\ncomponentDictionary['@msdyn365-commerce-modules|order-management|modules|order-history-with-search-and-filters|components|order-history-with-search-and-filters-order-list'] = {\n c: () => require('@msdyn365-commerce-modules/order-management/dist/lib/modules/order-history-with-search-and-filters/components/order-history-with-search-and-filters-order-list.component.js'),\n cn: '@msdyn365-commerce-modules-order-management-order-history-with-search-and-filters-order-list'\n };\ncomponentDictionary['@msdyn365-commerce-modules|order-management|modules|order-history-with-search-and-filters|components|order-history-with-search-and-filters-order-table'] = {\n c: () => require('@msdyn365-commerce-modules/order-management/dist/lib/modules/order-history-with-search-and-filters/components/order-history-with-search-and-filters-order-table.component.js'),\n cn: '@msdyn365-commerce-modules-order-management-order-history-with-search-and-filters-order-table'\n };\ncomponentDictionary['@msdyn365-commerce-modules|order-management|modules|order-history-with-search-and-filters|components|order-history-with-search-and-filters-organization-wide-selector'] = {\n c: () => require('@msdyn365-commerce-modules/order-management/dist/lib/modules/order-history-with-search-and-filters/components/order-history-with-search-and-filters-organization-wide-selector.component.js'),\n cn: '@msdyn365-commerce-modules-order-management-order-history-with-search-and-filters-organization-wide-selector'\n };\ncomponentDictionary['@msdyn365-commerce-modules|order-management|modules|order-history-with-search-and-filters|components|order-history-with-search-and-filters-view-mode-selector'] = {\n c: () => require('@msdyn365-commerce-modules/order-management/dist/lib/modules/order-history-with-search-and-filters/components/order-history-with-search-and-filters-view-mode-selector.component.js'),\n cn: '@msdyn365-commerce-modules-order-management-order-history-with-search-and-filters-view-mode-selector'\n };\ncomponentDictionary['@msdyn365-commerce-theme|adventureworks-theme-kit|modules|adventureworks|views|components|carticon'] = {\n c: () => require('@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/views/components/carticon.component.js'),\n cn: '@msdyn365-commerce-theme-adventureworks-theme-kit-carticon'\n };\ncomponentDictionary['@msdyn365-commerce-theme|adventureworks-theme-kit|modules|adventureworks|views|components|cartlineitem'] = {\n c: () => require('@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/views/components/cartlineitem.component.js'),\n cn: '@msdyn365-commerce-theme-adventureworks-theme-kit-cartlineitem'\n };\ncomponentDictionary['@msdyn365-commerce-theme|adventureworks-theme-kit|modules|adventureworks|views|components|product-v2'] = {\n c: () => require('@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/views/components/product-v2.component.js'),\n cn: '@msdyn365-commerce-theme-adventureworks-theme-kit-product-v2'\n };\ncomponentDictionary['@msdyn365-commerce-theme|adventureworks-theme-kit|modules|adventureworks|views|components|product'] = {\n c: () => require('@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/views/components/product.component.js'),\n cn: '@msdyn365-commerce-theme-adventureworks-theme-kit-product'\n };\ncomponentDictionary['@msdyn365-commerce-theme|adventureworks-theme-kit|modules|adventureworks|views|components|promocode'] = {\n c: () => require('@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/views/components/promocode.component.js'),\n cn: '@msdyn365-commerce-theme-adventureworks-theme-kit-promocode'\n };","/**\n* Copyright (c) 2018 Microsoft Corporation\n* Modules Registration\n* THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\n*/\nconst { log, error } = console;\nconst detailedWebpackError = (msg, errorObject) => { error(msg); error(errorObject); process.env.NODE_ENV !== 'development' && error('Run in dev mode to see full list of errors'); process.exit(50); }\nconst handleError = (modPath, errObject) => {\n detailedWebpackError('Error with path: ' + modPath, errObject);\n}\n\nconst handleMissingImplementationDetails = (functionName, connectorName, connectorType) => {\n error('----ERROR: CONNECTOR MISSING IMPLEMENTATION DETAILS-----');\n error('Missing function ' + functionName + ' from ' + connectorType + ' implementation for experimentation connector ' + connectorName);\n throw new Error('Connector missing implementation details');\n}\n\nconst verifySegmentationRegistration = (connectorName) => {\n const segmentationProvider = connectorDictionary[connectorName].provider;\n try {\n if (!segmentationProvider.__proto__.initialize) {\n handleMissingImplementationDetails('initialize', connectorName, 'provider');\n }\n if (!segmentationProvider.__proto__.getSegmentations) {\n handleMissingImplementationDetails('getSegmentations', connectorName, 'provider');\n }\n } catch (e) {\n // Connector has not implemented all the required methods, setting registration as undefined\n connectorDictionary[connectorName] = undefined;\n throw e;\n }\n}\n\nconst isServer = ()=>{\n return ! (typeof window != 'undefined' && window.document);\n}\n\nconst verifyGeoLookupRegistration = (connectorName) => {\n const geoLookupProvider = connectorDictionary[connectorName].provider;\n try {\n if (!geoLookupProvider.__proto__.initialize) {\n handleMissingImplementationDetails('initialize', connectorName, 'provider');\n }\n if (!geoLookupProvider.__proto__.getGeoInformation) {\n handleMissingImplementationDetails('getGeoInformation', connectorName, 'provider');\n }\n } catch (e) {\n // Connector has not implemented all the required methods, setting registration as undefined\n connectorDictionary[connectorName] = undefined;\n throw e;\n }\n}\n\nconst verifyExperimentationReigstration = (connectorName) => {\n const connectorImpl = connectorDictionary[connectorName].provider;\n const connectorListenerImpl = connectorDictionary[connectorName].listener;\n try {\n if (!connectorImpl.__proto__.initialize) {\n handleMissingImplementationDetails('initialize', connectorName, 'provider');\n }\n if (!connectorImpl.__proto__.getConfigForClientSideInit) {\n handleMissingImplementationDetails('getConfigForClientSideInit', connectorName, 'provider');\n }\n if (!connectorImpl.__proto__.initializeClientSide) {\n handleMissingImplementationDetails('initializeClientSide', connectorName, 'provider');\n }\n if (!connectorImpl.__proto__.getExperiments) {\n handleMissingImplementationDetails('getExperiments', connectorName, 'provider');\n }\n if (!connectorImpl.__proto__.getVariantsForUser) {\n handleMissingImplementationDetails('getVariantsForUser', connectorName, 'provider');\n }\n if (!connectorImpl.__proto__.activateExperiment) {\n handleMissingImplementationDetails('activateExperiment', connectorName, 'provider');\n }\n if (!connectorListenerImpl.__proto__.initializeClientSide) {\n handleMissingImplementationDetails('initializeClientSide', connectorName, 'listener');\n }\n if (!connectorListenerImpl.__proto__.logEvent) {\n handleMissingImplementationDetails('logEvent', connectorName, 'listener');\n }\n } catch (e) {\n // Connector has not implemented all the required methods, setting registration as undefined\n connectorDictionary[connectorName] = undefined;\n throw e;\n }\n}\n\nexport const connectorDictionary = {};\n\n\n {\n const connectorName = 'msdyn365-exp-test';\n \n let connectorProviderImpl = require('@msdyn365-commerce-modules/msdyn365-exp-test-connector/dist/lib/connectors/msdyn365-exp-test/msdyn365-exp-test.provider');\n let connectorListenerImpl = require('@msdyn365-commerce-modules/msdyn365-exp-test-connector/dist/lib/connectors/msdyn365-exp-test/msdyn365-exp-test.listener');\n let connectorDomainsList = 'https://msdyn365-exp-test.com ';\n if (!connectorProviderImpl.default) {\n throw new Error('Exp Connector provider msdyn365-exp-test does not have a default export. Check the provider file of the connector for a default export.');\n }\n if (!connectorListenerImpl.default) {\n throw new Error('Exp Connector listener msdyn365-exp-test does not have a default export. Check the listener file of the connector for a default export.');\n }\n connectorDictionary[connectorName] = {provider: connectorProviderImpl.default, listener: connectorListenerImpl.default, connectorDomains: connectorDomainsList};\n }\n\nexport const validateConnectorRegistration = () => {\n \n verifyExperimentationReigstration('msdyn365-exp-test');\n};","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLinePriceEditor, ICartLinePriceEditorResources, PriceComponent } from '@msdyn365-commerce/components';\nimport MsDyn365, { IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { ChannelDeliveryOptionConfiguration, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { CartLine, ProductCatalog, SalesLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { ArrayExtensions, getFallbackImageUrl, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, IncrementalQuantity, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classNames from 'classnames';\nimport * as React from 'react';\n\n/**\n * ICartlineResourceString: Interface for specifying the\n * resource strings that the component needs.\n */\nexport interface ICartlineResourceString {\n /**\n * Display string for discount label\n */\n discountStringText: string;\n\n /**\n * String for size key\n */\n sizeString: string;\n\n /**\n * String for color key\n */\n colorString: string;\n\n /**\n * String associated with the configuration product dimension\n */\n configString: string;\n\n /**\n * String for style key\n */\n styleString: string;\n\n /**\n * String for amount key\n */\n amountString?: string;\n\n /**\n * Display string for quantity label\n */\n quantityDisplayString: string;\n\n /**\n * Display string for quantity label\n */\n inputQuantityAriaLabel: string;\n\n /**\n * Aria label for the decrement button in quantity component\n */\n decrementButtonAriaLabel: string;\n\n /**\n * Aria label for the increment button in quantity component\n */\n incrementButtonAriaLabel: string;\n\n /**\n * Original text screenreader\n */\n originalPriceText: string;\n\n /**\n * Current text screenreader\n */\n currentPriceText: string;\n\n /**\n * Shipping Charges Text\n */\n shippingChargesText: string;\n\n priceEditorResources?: ICartLinePriceEditorResources;\n salesAgreementPricePrompt?: string;\n}\n\ninterface ICartLineData {\n cartLine: CartLine | SalesLine;\n cartState?: ICartState;\n product?: SimpleProduct;\n catalogs?: ProductCatalog[];\n}\n\n/**\n * ICartLineProps: The props required to render cartLineitem.\n */\nexport interface ICartLineProps extends IComponentProps {\n /**\n * The flag to change the quantity component from intractable to static.\n */\n disableQuantityInteractivity?: boolean;\n\n /**\n * The primary image url.\n */\n primaryImageUrl?: string;\n\n /**\n * The product url.\n */\n productUrl?: string;\n\n /**\n * GridSettings for the product image in cartLine.\n */\n gridSettings: IGridSettings;\n\n /**\n * ImageSettings for the product image in cartLine.\n */\n imageSettings: IImageSettings;\n\n /**\n * Boolean flag to indicate if the item is out of stock.\n */\n isOutOfStock?: boolean;\n\n /**\n * Flag to make quantity section editable.\n */\n isQuantityEditable?: boolean;\n\n /**\n * Max quantity for line item.\n */\n maxQuantity?: number;\n\n /**\n * Current quantity for line item.\n */\n currentQuantity?: number;\n\n /**\n * Resource string for the component.\n */\n resources: ICartlineResourceString;\n\n /**\n * SalesLine flag.\n */\n isSalesLine?: boolean;\n\n /**\n * Error message to show in place of quantity.\n */\n errorMessage?: string;\n\n /**\n * Inventory information label.\n */\n inventoryInformationLabel?: string;\n\n /**\n * Inventory information class name.\n */\n inventoryLabelClassName?: string;\n\n /**\n * Flag to show/hide shipping charges for line items.\n */\n showShippingChargesForLineItems?: boolean;\n\n /**\n * Boolean flag to indicate if cart state status is ready.\n */\n isCartStateReady?: boolean;\n\n /**\n * Chanel Delivery Option configuration is from api.\n */\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n /**\n * The telemetry content.\n */\n telemetryContent?: ITelemetryContent;\n\n /**\n * The cart line index.\n */\n lineIndex?: number;\n\n /**\n * Quantity onChange callback.\n */\n quantityOnChange?(cartLine: CartLine, newQuantity: number, lineIndex?: number): boolean;\n priceCurrency?: string;\n}\n\ninterface IDimensionStrings {\n /**\n * String for size key.\n */\n sizeString: string;\n\n /**\n * String for color key.\n */\n colorString: string;\n\n /**\n * String associated with the configuration product dimension.\n */\n configString: string;\n\n /**\n * String for style key.\n */\n styleString: string;\n\n /**\n * String for amount key.\n */\n amountString?: string;\n}\n\n/**\n * Renders catalog label for the cart line.\n * @param props - Cart line props.\n * @returns Catalog label.\n */\nconst CatalogLabelComponent: React.FC = (props: ICartLineProps) => {\n const catalogId = props.data.cartLine.CatalogId;\n validateCatalogId(catalogId);\n\n if (!props.context.request.user.isB2b || !catalogId || !ArrayExtensions.hasElements(props.data.catalogs)) {\n return null;\n }\n\n const catalog = props.data.catalogs.find(item => item.RecordId === catalogId);\n\n if (!catalog || !catalog.Name) {\n return null;\n }\n\n return
{catalog.Name}
;\n};\n\nconst CartLineItemFunctions = {\n renderProductDimensions: (Product: SimpleProduct, DimensionStrings: IDimensionStrings) => {\n if (!Product || !Product.Dimensions) {\n return [];\n }\n\n return Product.Dimensions.map(productDimension => {\n if (productDimension.DimensionTypeValue === 1) {\n return (\n
\n \n {DimensionStrings.colorString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n \n
\n );\n }\n\n if (productDimension.DimensionTypeValue === 2) {\n return (\n
\n \n {DimensionStrings.configString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n \n
\n );\n }\n\n if (productDimension.DimensionTypeValue === 3) {\n return (\n
\n \n {DimensionStrings.sizeString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n \n
\n );\n }\n\n if (productDimension.DimensionTypeValue === 4) {\n return (\n
\n \n {Product.IsGiftCard ? DimensionStrings.amountString : DimensionStrings.styleString}:\n {productDimension.DimensionValue && productDimension.DimensionValue.Value}\n \n
\n );\n }\n return null;\n });\n },\n\n renderDiscountLines: (props: ICartLineProps) => {\n if (!props.data.cartLine.DiscountLines || props.data.cartLine.DiscountLines.length === 0) {\n return null;\n }\n\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\n return (\n
\n \n {discountLine.OfferName ? discountLine.OfferName : ''}:{` ${props.resources.discountStringText || 'Discount'} `}\n \n \n \n \n {` (${discountLine.EffectivePercentage !== undefined ? discountLine.EffectivePercentage : ''}%)`}\n
\n );\n });\n },\n renderInventoryLabel: (props: ICartLineProps) => {\n if (!props.inventoryInformationLabel) {\n return null;\n }\n const inventoryCssName = props.inventoryLabelClassName\n ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}`\n : 'msc-cart-line__product-inventory-label';\n return {props.inventoryInformationLabel};\n },\n\n /**\n * Gets the react node for product unit of measure display.\n * @param props - Icartline props.\n * @returns The node representing markup for unit of measure component.\n */\n renderUnitOfMeasure: (props: ICartLineProps) => {\n if (props.data.cartLine.IsInvoiceLine) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\n if (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none') {\n return undefined;\n }\n\n const product = props.data.product;\n if (!product || !product.DefaultUnitOfMeasure) {\n return undefined;\n }\n\n return (\n
\n {product.DefaultUnitOfMeasure}\n
\n );\n },\n renderShippingLabel: (props: ICartLineProps) => {\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\n const cartline = props.data.cartLine;\n let hasShippingMethod = false;\n if (channelDeliveryOptionConfig !== undefined) {\n hasShippingMethod = !!(\n cartline.DeliveryMode &&\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.some(deliveryMode => deliveryMode !== cartline.DeliveryMode)\n );\n } else {\n hasShippingMethod = !!(cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode);\n }\n if (!hasShippingMethod) {\n return undefined;\n }\n\n const shippingChargeLines = (cartline.ChargeLines || []).filter(chargeLine => chargeLine.IsShipping);\n\n if (shippingChargeLines.length === 0) {\n return undefined;\n }\n\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\n return chargeTotal + (chargeLine.CalculatedAmount || 0);\n }, 0);\n\n const priceComponent = (\n \n );\n return (\n <>\n \n {priceComponent}\n \n );\n },\n renderOtherCharges: (props: ICartLineProps) => {\n const cartline = props.data.cartLine;\n const otherCharges = cartline.ChargeLines?.filter(chargeline => !chargeline.IsShipping);\n\n return (\n (otherCharges &&\n otherCharges.map((otherCharge, key) => {\n return otherCharge && otherCharge.CalculatedAmount ? (\n
\n \n \n \n \n
\n ) : (\n ''\n );\n })) ||\n undefined\n );\n },\n\n /**\n * Render the sales agreement prompt.\n * @param props - The ICartLineProps.\n * @returns The JSX.Element.\n */\n renderSalesAgreementPrompt: (props: ICartLineProps): JSX.Element | null => {\n if (props.data.cartLine.SalesAgreementLineRecordId === 0) {\n return null;\n }\n return
{props.resources.salesAgreementPricePrompt}
;\n }\n};\n\n// eslint-disable-next-line no-redeclare\nconst CartLine: React.FC = (props: ICartLineProps) => {\n const { isSalesLine, productUrl, resources } = props;\n const { product, cartLine } = props.data;\n\n const destructDimensionStrings = {\n sizeString: resources.sizeString,\n colorString: resources.colorString,\n styleString: resources.styleString,\n configString: resources.configString,\n amountString: resources.amountString\n };\n\n const fallbackImageUrl =\n product &&\n getFallbackImageUrl(\n product.ItemId,\n props.context.actionContext.requestContext.apiSettings,\n props.context.request.app?.config?.OmniChannelMedia\n );\n const productDimensions = product && CartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\n const imageSettings = props.imageSettings;\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n const renderDisountLines = CartLineItemFunctions.renderDiscountLines(props);\n const renderInventoryLabel = CartLineItemFunctions.renderInventoryLabel(props);\n const renderUnitOfMeasure = CartLineItemFunctions.renderUnitOfMeasure(props);\n const renderShippingLabel = CartLineItemFunctions.renderShippingLabel(props);\n const renderOtherCharges = CartLineItemFunctions.renderOtherCharges(props);\n const renderSalesAgreementPrompt = CartLineItemFunctions.renderSalesAgreementPrompt(props);\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\n const productAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n const productName = product?.Name || cartLine.Description;\n const imgeClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-image' : 'msc-cart-line__product-image';\n\n const onChange = (newValue: number): boolean => {\n if (props.quantityOnChange) {\n return props.quantityOnChange(props.data.cartLine, newValue, props.lineIndex);\n }\n return true;\n };\n\n const _generateErrorMessage = (): JSX.Element | null => {\n if (props.errorMessage) {\n return (\n
\n \n {props.errorMessage}\n
\n );\n }\n\n return null;\n };\n\n const _generateQuantityandPrice = (): JSX.Element[] | null => {\n const nodes = [];\n if (props.isOutOfStock) {\n return null;\n }\n\n // No quantity selector for invoice line\n if (!props.data.cartLine.IsInvoiceLine) {\n if (props.data.product && props.isQuantityEditable) {\n nodes.push(\n
\n
{resources.quantityDisplayString}
\n \n
\n );\n } else {\n nodes.push(\n
\n \n {props.data.cartLine.Quantity}\n
\n );\n }\n }\n\n nodes.push(\n
\n \n {(props.data.cartLine.DiscountAmount && props.data.cartLine.DiscountAmount > 0 && (\n <>\n \n {` ${props.resources.discountStringText || 'Discount'} `}\n \n \n \n )) ||\n null}\n
\n );\n\n return nodes;\n };\n\n return (\n <>\n
\n
\n \n
\n
\n
\n \n {MsDyn365.isBrowser ? (\n \n {productName}\n \n ) : null}\n {ArrayExtensions.hasElements(productDimensions) ? (\n
{productDimensions}
\n ) : (\n ''\n )}\n {renderUnitOfMeasure}\n
\n \n
\n {renderDisountLines}\n {renderInventoryLabel}\n {props.showShippingChargesForLineItems &&
{renderShippingLabel}
}\n {renderOtherCharges}\n {renderSalesAgreementPrompt}\n
\n {_generateQuantityandPrice()}\n {props.data.cartLine.IsInvoiceLine && props.data.cartState && props.resources.priceEditorResources && (\n \n )}\n
\n
\n {_generateErrorMessage()}\n \n );\n};\n\nexport default CartLine;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { IComponentProps } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport {\n Button,\n format,\n getPayloadObject,\n getTelemetryAttributes,\n IPayLoad,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IPromoCodeProps extends IComponentProps<{}> {\n cart: ICartState | undefined;\n promoCodeHeadingText: string;\n appliedPromoCodeHeadingText: string;\n removePromoAriaLabelFormat: string;\n promoPlaceholderText: string;\n promoCodeApplyButtonText: string;\n collapseTimeOut: number;\n removePromoText: string;\n invalidPromoCodeErrorText: string;\n failedToAddPromoCodeErrorText: string;\n duplicatePromoCodeErrorText: string;\n failedToRemovePromoCodeErrorText: string;\n\n /**\n * The telemetry content\n */\n telemetryContent?: ITelemetryContent;\n promoCodeApplyCallback?(): void;\n}\n\ninterface IPromoCodeState {\n isCollapseOpen: boolean;\n promoCodeInputValue: string;\n error: string;\n canApply: boolean;\n}\n\n/**\n *\n * The PromoCode component renders the promocode section.\n * @extends {React.PureComponent}\n */\nclass PromoCode extends React.Component {\n private readonly payLoad: IPayLoad;\n\n constructor(props: IPromoCodeProps, state: IPromoCodeState) {\n super(props);\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, TelemetryConstant.ApplyPromoCode);\n this.state = {\n isCollapseOpen: false,\n promoCodeInputValue: '',\n error: '',\n canApply: false\n };\n }\n\n public shouldComponentUpdate(nextProps: IPromoCodeProps, nextState: IPromoCodeState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n return (\n
\n
{this.props.promoCodeHeadingText}
\n {this._renderForm(this.props.promoPlaceholderText, this.props.promoCodeApplyButtonText, this.props.cart)}\n

\n {this.state.error}\n

\n {this._renderAppliedPromoCode(this.props)}\n
\n );\n }\n\n private readonly _onInputChangeHandler = (e: React.ChangeEvent) => {\n const error = e.target.value === '' ? '' : this.state.error;\n this.setState({\n promoCodeInputValue: e.target.value.trim(),\n error,\n canApply: !!e.target.value\n });\n };\n\n private readonly _applyPromotion = (cartState: ICartState | undefined) => {\n if (!cartState || !cartState.cart) {\n return;\n }\n const appliedPromo = this.state.promoCodeInputValue;\n\n cartState\n .addPromoCode({ promoCode: appliedPromo })\n .then(result => {\n if (result.status === 'SUCCESS') {\n // Show success text\n this.setState({ promoCodeInputValue: '', error: '', canApply: false });\n } else if (result.substatus === 'ALREADYADDED') {\n this.setState({ error: this.props.duplicatePromoCodeErrorText });\n } else {\n this.setState({ error: this.props.invalidPromoCodeErrorText });\n }\n })\n .catch(error => {\n this.setState({ error: this.props.failedToAddPromoCodeErrorText });\n });\n };\n\n /**\n * On Submit function.\n * @param cartState -Cartstate.\n * @returns Apply promotion.\n */\n private readonly _onSubmitHandler = (cartState: ICartState | undefined) => (event: React.FormEvent) => {\n event.preventDefault();\n this._applyPromotionHandler(cartState);\n };\n\n /**\n * On apply promotion function.\n * @param cartState -Cartstate.\n * @returns Apply promotion.\n */\n private readonly _applyPromotionHandler = (cartState: ICartState | undefined) => () => {\n this._applyPromotion(cartState);\n };\n\n private readonly _renderForm = (promoPlaceholderText: string, promoCodeApplyButtonText: string, cartState: ICartState | undefined) => {\n const attributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n
\n
\n \n \n {promoCodeApplyButtonText}\n \n
\n
\n );\n };\n\n private readonly _removePromotion = (cartState: ICartState | undefined, event: React.MouseEvent) => {\n if (!cartState) {\n return;\n }\n const code = event.currentTarget.getAttribute('data-value') || '';\n cartState\n .removePromoCodes({\n promoCodes: [code]\n })\n .then(result => {\n if (result.status === 'SUCCESS') {\n this.setState({ error: '' });\n }\n })\n .catch(() => {\n this.setState({ error: this.props.failedToRemovePromoCodeErrorText });\n });\n };\n\n private readonly _calculateDiscount = (code: string, cartState: ICartState | undefined) => {\n if (!cartState || !cartState.cart || !cartState.cart.CartLines || cartState.cart.CartLines.length === 0 || !code) {\n return;\n }\n let discountAmount = 0;\n for (const line of cartState.cart.CartLines) {\n if (line.DiscountLines) {\n for (const discountLine of line.DiscountLines) {\n if (discountLine.DiscountCode === code) {\n discountAmount += discountLine.DiscountCost!;\n }\n }\n }\n }\n return discountAmount * -1;\n };\n\n private readonly _renderAppliedPromoCode = (props: IPromoCodeProps) => {\n if (!props.cart || !props.cart.cart || !props.cart.cart.Coupons || props.cart.cart.Coupons.length === 0) {\n return;\n }\n\n const removePromotionHandler = (event: React.MouseEvent) => {\n this._removePromotion(props.cart, event);\n };\n\n const promoCodTotalDiscount = props.cart.cart.Coupons.reduce((count: number, coupon: Coupon) => {\n return count + (this._calculateDiscount(coupon.Code || '', props.cart) || 0);\n }, 0);\n\n return (\n <>\n
\n
{this.props.appliedPromoCodeHeadingText}
\n \n
\n {props.cart.cart.Coupons.map((coupon: Coupon) => {\n const ariaLabel = props.removePromoAriaLabelFormat\n ? format(props.removePromoAriaLabelFormat, props.removePromoText, coupon.Code)\n : '';\n\n return (\n
\n
\n {coupon.Code}{' '}\n \n
\n \n {props.removePromoText}\n \n
\n );\n })}\n \n );\n };\n}\n\nexport default PromoCode;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { IExpLogger } from '@msdyn365-commerce/telemetry-internal';\n\n/**\n * A basic implementation of the ExperimentationProvider interface used for testing\n */\nclass MsDyn365ExpTestConnectorListener implements IExpLogger {\n private userId: string = '';\n public initializeClientSide(config: any, userId: string): boolean {\n this.userId = userId;\n console.log(`Listener initialize called with config ${JSON.stringify(config)} and userId ${userId}`);\n return true;\n }\n public logEvent(eventName: string, payload: any, attributes?: any): void {\n console.log(`tracking events with event type - ${eventName}, payload - ${payload}, user id - ${this.userId}`);\n }\n}\n\nconst connectorListener = new MsDyn365ExpTestConnectorListener();\nexport default connectorListener;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any, max-lines */\nimport { IExperimentationProvider, IExperimentsResult, ISecretManager, IVariants, State } from '@msdyn365-commerce/core';\n/**\n * A basic implementation of the ExperimentationProvider interface used for testing\n */\nclass MsDyn365ExpTestConnector implements IExperimentationProvider {\n private variantSet1: IVariants[] = [\n {\n variantId: 'var1',\n experimentId: 'expid1'\n },\n {\n variantId: 'var1',\n experimentId: 'expid4'\n },\n {\n variantId: 'var1',\n experimentId: 'expid6'\n },\n {\n variantId: 'var1',\n experimentId: 'expid7'\n },\n {\n variantId: 'var1',\n experimentId: 'expid8'\n },\n {\n variantId: 'var1',\n experimentId: 'expid9'\n },\n {\n variantId: 'var1',\n experimentId: 'expid10'\n },\n {\n variantId: 'var1',\n experimentId: 'expid11'\n },\n {\n variantId: 'var1',\n experimentId: 'expid12'\n }\n ];\n\n private variantSet2: IVariants[] = [\n {\n variantId: 'var2',\n experimentId: 'expid1'\n },\n {\n variantId: 'var2',\n experimentId: 'expid5'\n },\n {\n variantId: 'var2',\n experimentId: 'expid7'\n },\n {\n variantId: 'var2',\n experimentId: 'expid8'\n },\n {\n variantId: 'var2',\n experimentId: 'expid9'\n },\n {\n variantId: 'var2',\n experimentId: 'expid10'\n },\n {\n variantId: 'var2',\n experimentId: 'expid11'\n },\n {\n variantId: 'var2',\n experimentId: 'expid12'\n }\n ];\n\n private variantSet3: IVariants[] = [\n {\n variantId: 'var1',\n experimentId: 'expid5'\n },\n {\n variantId: 'var2',\n experimentId: 'expid13'\n },\n {\n variantId: 'var2',\n experimentId: 'expid14'\n },\n {\n variantId: 'var2',\n experimentId: 'expid15'\n },\n {\n variantId: 'var2',\n experimentId: 'expid16'\n },\n {\n variantId: 'var2',\n experimentId: 'expid17'\n },\n {\n variantId: 'var2',\n experimentId: 'expid18'\n },\n {\n variantId: 'var2',\n experimentId: 'expid19'\n },\n {\n variantId: 'var2',\n experimentId: 'expid20'\n },\n {\n variantId: 'var2',\n experimentId: 'expid21'\n },\n {\n variantId: 'var2',\n experimentId: 'expid22'\n },\n {\n variantId: 'var2',\n experimentId: 'expid23'\n },\n {\n variantId: 'var2',\n experimentId: 'expid24'\n },\n {\n variantId: 'var2',\n experimentId: 'expid25'\n }\n ];\n\n private variantSet4: IVariants[] = [\n {\n variantId: 'var1',\n experimentId: 'expid5'\n },\n {\n variantId: 'var1',\n experimentId: 'expid1'\n },\n {\n variantId: 'var1',\n experimentId: 'expid13'\n },\n {\n variantId: 'var1',\n experimentId: 'expid14'\n },\n {\n variantId: 'var1',\n experimentId: 'expid15'\n },\n {\n variantId: 'var1',\n experimentId: 'expid16'\n },\n {\n variantId: 'var1',\n experimentId: 'expid17'\n },\n {\n variantId: 'var1',\n experimentId: 'expid18'\n },\n {\n variantId: 'var1',\n experimentId: 'expid19'\n },\n {\n variantId: 'var1',\n experimentId: 'expid20'\n },\n {\n variantId: 'var1',\n experimentId: 'expid21'\n },\n {\n variantId: 'var1',\n experimentId: 'expid22'\n },\n {\n variantId: 'var1',\n experimentId: 'expid23'\n },\n {\n variantId: 'var1',\n experimentId: 'expid24'\n },\n {\n variantId: 'var1',\n experimentId: 'expid25'\n }\n ];\n\n public getConfigForClientSideInit(): Promise {\n return Promise.resolve({});\n }\n public initializeClientSide(config: any): boolean {\n console.log(`Initialize client side called on MsDyn365ExpTestConnector with config ${config}`);\n return true;\n }\n\n public getExperiments(): Promise {\n return Promise.resolve({\n name: 'msdyn365-exp-test-2',\n experiments: [\n {\n id: 'expid1',\n friendlyName: 'experiment-1',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n link: 'www.msdyn365-exp-test-connector/expid1',\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var3',\n friendlyName: 'variant-3',\n status: State.Draft,\n weight: '0.2'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid2',\n friendlyName: 'experiment-2',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Paused,\n link: 'www.msdyn365-exp-test-connector/expid2',\n variations: [\n {\n id: 'var3',\n friendlyName: 'variant-3',\n status: State.Paused,\n weight: '1.0'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid3',\n friendlyName: 'experiment-3',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Archived,\n variations: [\n {\n id: 'var4',\n friendlyName: 'variant-4',\n status: State.Archived,\n weight: '1.0'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid4',\n friendlyName: 'experiment-4',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid5',\n friendlyName: 'experiment-5',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid6',\n friendlyName: 'experiment-6',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid7',\n friendlyName: 'experiment-7',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid8',\n friendlyName: 'experiment-8',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid9',\n friendlyName: 'experiment-9',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid10',\n friendlyName: 'experiment-10',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid11',\n friendlyName: 'experiment-11',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid12',\n friendlyName: 'experiment-12',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid13',\n friendlyName: 'experiment-13',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid14',\n friendlyName: 'experiment-14',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid15',\n friendlyName: 'experiment-15',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid16',\n friendlyName: 'experiment-16',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid17',\n friendlyName: 'experiment-17',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid18',\n friendlyName: 'experiment-18',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid19',\n friendlyName: 'experiment-19',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid20',\n friendlyName: 'experiment-20',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid21',\n friendlyName: 'experiment-21',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid22',\n friendlyName: 'experiment-22',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid23',\n friendlyName: 'experiment-23',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid24',\n friendlyName: 'experiment-24',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n },\n {\n id: 'expid25',\n friendlyName: 'experiment-25',\n description: 'This is a msdyn365-exp test experiment',\n type: 'A/B Test',\n status: State.Running,\n variations: [\n {\n id: 'var1',\n friendlyName: 'variant-1',\n status: State.Active,\n weight: '0.4'\n },\n {\n id: 'var2',\n friendlyName: 'variant-2',\n status: State.Active,\n weight: '0.6'\n }\n ],\n createdDate: '05/01/2020',\n lastModifiedDate: '05/01/2020',\n lastModifiedBy: 'User 1'\n }\n ]\n });\n }\n public getVariantsForUser(userId: string, attributes?: { [index: string]: string } | undefined): IVariants[] {\n if (userId.match(/^[0-3].*$/)) {\n return this.variantSet1;\n } else if (userId.match(/^[4-7].*$/)) {\n return this.variantSet2;\n } else if (userId.match(/^[8-9|a-b].*$/)) {\n return this.variantSet3;\n } else {\n return this.variantSet4;\n }\n }\n public activateExperiment(userId: string, experiments: IVariants[], attributes?: { [index: string]: string } | undefined): boolean {\n console.log(\n `Active experiment called on MsDyn365ExpTestConnector with userId: ${userId}, experiments: ${JSON.stringify(\n experiments\n )}, attributes: ${JSON.stringify(attributes)}`\n );\n return true;\n }\n public initialize(config: any, secretManager?: ISecretManager): Promise {\n console.log(`MsDyn365 Exp Test Connector called with config: ${JSON.stringify(config)}`);\n return Promise.resolve(true);\n }\n}\n\nconst connector = new MsDyn365ExpTestConnector();\nexport default connector;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\n/**\n * ICartIconData: Interface for Cart Icon Data.\n */\nexport interface ICartIconData {\n cart?: ICartState;\n}\n\n/**\n * ICartIconComponentProps: Interface for Cart Icon component props.\n */\nexport interface ICartIconComponentProps extends IComponentProps {\n className?: string;\n cartLabel: string;\n cartQtyLabel: string;\n telemetryContent?: ITelemetryContent;\n salesAgreementPricePrompt?: string;\n}\n\n/**\n * ICartIconComponent: Interface for Cart Icon component.\n */\nexport interface ICartIconComponent extends IComponent {}\n\nconst CartIconComponentActions = {};\n\n/**\n *\n * CartIcon component.\n * @extends {React.FC}\n */\nconst CartIcon: React.FC = observer((props: ICartIconComponentProps) => {\n const {\n cartLabel,\n cartQtyLabel,\n data: { cart }\n } = props;\n const defaultCartItemCount: number = 0;\n\n const cartItem = cart ? cart.totalItemsInCart : defaultCartItemCount;\n let qtyLabel: string = '';\n const cartMaxQuantity: number = 99;\n const maxQuantityLabel: string = '99+';\n if (cartItem > cartMaxQuantity) {\n qtyLabel = maxQuantityLabel;\n } else {\n qtyLabel = format(cartQtyLabel, cartItem);\n }\n const label = format(cartLabel, cartItem);\n\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', props.telemetryContent!, 'cart-icon', '');\n const attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\n const style: React.CSSProperties = {\n visibility: cart ? 'visible' : 'hidden'\n };\n return (\n
\n
\n {qtyLabel}\n
\n
\n );\n});\n\nexport const CartIconComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\n // @ts-expect-error -- Compatible issue with the component override.\n ICartIconComponent\n>('CartIcon', { component: CartIcon, ...CartIconComponentActions });\n\nexport default CartIconComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLinePriceEditor, ICartLinePriceEditorResources, PriceComponent } from '@msdyn365-commerce/components';\nimport MsDyn365, {\n IComponentProps,\n IGridSettings,\n IImageSettings,\n Image,\n isChannelTypeB2B,\n msdyn365Commerce\n} from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n CartLine,\n ChannelDeliveryOptionConfiguration,\n DiscountLine,\n DiscountLineType,\n ProductCatalog,\n ProductDimensionType,\n SalesLine,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, StringExtensions, getFallbackImageUrl, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, IncrementalQuantity, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classNames from 'classnames';\nimport * as React from 'react';\n\n/**\n * ICartlineResourceString: Interface for specifying the\n * resource strings that the component needs.\n */\nexport interface ICartlineResourceString {\n /**\n * Display string for discount label.\n */\n discountStringText: string;\n\n /**\n * String for size key.\n */\n sizeString: string;\n\n /**\n * String for color key.\n */\n colorString: string;\n\n /**\n * String associated with the configuration product dimension.\n */\n configString: string;\n\n /**\n * String for style key.\n */\n styleString: string;\n\n /**\n * String for amount key.\n */\n amountString?: string;\n\n /**\n * Display string for quantity label.\n */\n quantityDisplayString: string;\n\n /**\n * Display string for quantity label.\n */\n inputQuantityAriaLabel: string;\n\n /**\n * Aria label for the decrement button in quantity component.\n */\n decrementButtonAriaLabel: string;\n\n /**\n * Aria label for the increment button in quantity component.\n */\n incrementButtonAriaLabel: string;\n\n /**\n * Original text screenreader.\n */\n originalPriceText: string;\n\n /**\n * Current text screenreader.\n */\n currentPriceText: string;\n\n /**\n * Shipping Charges Text.\n */\n shippingChargesText: string;\n\n /**\n * Price Editor Charges Text.\n */\n priceEditorResources?: ICartLinePriceEditorResources;\n\n /**\n * Sales agreement price prompt text.\n */\n salesAgreementPricePrompt?: string;\n\n /**\n * Shipping text.\n */\n shippingText?: string;\n\n /**\n * Confirmed Ship Date Label.\n */\n confirmedShipDateLabel?: string;\n}\n\n/**\n * Represents cart line data interface.\n */\ninterface ICartLineData {\n cartLine: CartLine | SalesLine;\n cartState?: ICartState;\n product?: SimpleProduct;\n catalogs?: ProductCatalog[];\n}\n\n/**\n * ICartLineProps: The props required to render cartLineitem.\n */\nexport interface ICartLineProps extends IComponentProps {\n /**\n * The flag to change the quantity component from interactible to static.\n */\n disableQuantityInteractivity?: boolean;\n\n /**\n * The primary image url.\n */\n primaryImageUrl?: string;\n\n /**\n * The product url.\n */\n productUrl?: string;\n\n /**\n * GridSettings for the product image in cartLine.\n */\n gridSettings: IGridSettings;\n\n /**\n * ImageSettings for the product image in cartLine.\n */\n imageSettings: IImageSettings;\n\n /**\n * Boolean flag to indicate if the item is out of stock.\n */\n isOutOfStock?: boolean;\n\n /**\n * Flag to make quantity section editable.\n */\n isQuantityEditable?: boolean;\n\n /**\n * Max quantity for line item.\n */\n maxQuantity?: number;\n\n /**\n * Current quantity for line item.\n */\n currentQuantity?: number;\n\n /**\n * Resource string for the component.\n */\n resources: ICartlineResourceString;\n\n /**\n * SalesLine flag.\n */\n isSalesLine?: boolean;\n\n /**\n * Error message to show in place of quantity.\n */\n errorMessage?: string;\n\n /**\n * Inventory information label.\n */\n inventoryInformationLabel?: string;\n\n /**\n * Inventory information class name.\n */\n inventoryLabelClassName?: string;\n\n /**\n * Flag to show/hide shipping charges for line items.\n */\n showShippingChargesForLineItems?: boolean;\n\n /**\n * Boolean flag to indicate if cart state status is ready.\n */\n isCartStateReady?: boolean;\n\n /**\n * Chanel Delivery Option configuration is from api.\n */\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n /**\n * The telemetry content.\n */\n telemetryContent?: ITelemetryContent;\n\n /**\n * The cart line delivery location.\n */\n deliveryLocation?: string;\n\n /**\n * Quantity onChange callback.\n */\n quantityOnChange?(cartLine: CartLine, newQuantity: number): boolean;\n priceCurrency?: string;\n\n /**\n * Sales line confirmed ship date.\n */\n confirmedShipDate?: string;\n}\n\n/**\n * Represents dimensions strings.\n */\ninterface IDimensionStrings {\n /**\n * String for size key.\n */\n sizeString: string;\n\n /**\n * String for color key.\n */\n colorString: string;\n\n /**\n * String associated with the configuration product dimension.\n */\n configString: string;\n\n /**\n * String for style key.\n */\n styleString: string;\n\n /**\n * String for amount key.\n */\n amountString?: string;\n}\n\n/**\n * Renders catalog label for the cart line.\n * @param props - Cart line props.\n * @returns Catalog label.\n */\nconst CatalogLabelComponent: React.FC = (props: ICartLineProps) => {\n const catalogId = props.data.cartLine.CatalogId;\n validateCatalogId(catalogId);\n\n if (!isChannelTypeB2B(props.context.actionContext.requestContext) || !catalogId || !ArrayExtensions.hasElements(props.data.catalogs)) {\n return null;\n }\n\n const catalog = props.data.catalogs.find(item => item.RecordId === catalogId);\n\n if (!catalog || !catalog.Name) {\n return null;\n }\n\n return
{catalog.Name}
;\n};\n\nconst cartLineItemFunctions = {\n /**\n * Render product dimensions.\n * @param product - Product data.\n * @param dimensionStrings - Dimension strings interface.\n * @returns JSX Element.\n */\n renderProductDimensions: (product: SimpleProduct, dimensionStrings: IDimensionStrings) => {\n if (!product.Dimensions) {\n return [];\n }\n\n return product.Dimensions.map(productDimension => {\n if (productDimension.DimensionTypeValue === ProductDimensionType.Color) {\n return (\n
\n \n {dimensionStrings.colorString}\n {': '}\n {productDimension.DimensionValue?.Value}\n \n
\n );\n }\n\n if (productDimension.DimensionTypeValue === ProductDimensionType.Configuration) {\n return (\n
\n \n {dimensionStrings.configString}\n {': '}\n {productDimension.DimensionValue?.Value}\n \n
\n );\n }\n\n if (productDimension.DimensionTypeValue === ProductDimensionType.Size) {\n return (\n
\n \n {dimensionStrings.sizeString}\n {': '}\n {productDimension.DimensionValue?.Value}\n \n
\n );\n }\n\n if (productDimension.DimensionTypeValue === ProductDimensionType.Style) {\n return (\n
\n \n {product.IsGiftCard ? dimensionStrings.amountString : dimensionStrings.styleString}\n {': '}\n {productDimension.DimensionValue?.Value}\n \n
\n );\n }\n return null;\n });\n },\n\n /**\n * Gets the react node for product unit of price display.\n * @param props - The cart line props.\n * @returns The node representing markup for unit of measure component.\n */\n renderProductUnitPrice: (props: ICartLineProps) => {\n if (!props.data.cartLine.Price) {\n return null;\n }\n const zeroQuantity: number = 0;\n return (\n
\n \n zeroQuantity\n ? {\n price: {\n CustomerContextualPrice: props.data.cartLine.Price\n }\n }\n : {\n price: {\n CustomerContextualPrice: props.data.cartLine.Price\n }\n }\n }\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n currencyCode={props.priceCurrency}\n />\n \n
\n );\n },\n\n /**\n * Render discount lines.\n * @param props - The cart line props.\n * @returns JSX element.\n */\n renderDiscountLines: (props: ICartLineProps) => {\n if (!props.data.cartLine.DiscountLines || !ArrayExtensions.hasElements(props.data.cartLine.DiscountLines)) {\n return null;\n }\n\n /**\n * Get the updated discount percentage.\n * @param discountLine - The discount line.\n * @param cartLine - The cart line.\n * @returns The updated discount percentage.\n */\n const discountPercent = (discountLine: DiscountLine, cartLine: CartLine): number => {\n const numberZero = 0;\n const decimalPrecision = 2;\n const fullPercentage = 100;\n let updatedPercent: number = discountLine.Percentage ?? numberZero;\n\n if (\n (discountLine.Percentage === numberZero ||\n (discountLine.DiscountLineTypeValue && discountLine.DiscountLineTypeValue === DiscountLineType.TenderTypeDiscount)) &&\n cartLine.Price &&\n cartLine.Price > numberZero &&\n cartLine.Quantity &&\n cartLine.Quantity !== numberZero\n ) {\n const effectiveAmount = discountLine.EffectiveAmount ?? numberZero;\n updatedPercent = Number(\n ((effectiveAmount / (cartLine.Price * cartLine.Quantity)) * fullPercentage).toFixed(decimalPrecision)\n );\n }\n\n return updatedPercent;\n };\n\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\n return (\n
\n {discountLine.OfferName ? discountLine.OfferName : ''}\n \n \n \n \n {` (${discountLine.Percentage !== undefined ? discountPercent(discountLine, props.data.cartLine) : ''}%)`}\n \n
\n );\n });\n },\n\n /**\n * Render inventory label.\n * @param props - The cart line props.\n * @returns JSX element.\n */\n renderInventoryLabel: (props: ICartLineProps) => {\n const inventoryCssName = props.inventoryLabelClassName\n ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}`\n : 'msc-cart-line__product-inventory-label';\n\n return

{props.inventoryInformationLabel}

;\n },\n\n /**\n * Render shipping label.\n * @param props - The cart line props.\n * @returns JSX element.\n */\n renderShippingLabel: (props: ICartLineProps) => {\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\n const cartline = props.data.cartLine;\n let hasShippingMethod = false;\n if (channelDeliveryOptionConfig !== undefined) {\n hasShippingMethod = !!(\n cartline.DeliveryMode &&\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.some(deliveryMode => deliveryMode !== cartline.DeliveryMode)\n );\n } else {\n hasShippingMethod = !!(cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode);\n }\n if (!hasShippingMethod) {\n return undefined;\n }\n\n const shippingChargeLines = (cartline.ChargeLines ?? []).filter(chargeLine => chargeLine.IsShipping);\n\n if (!ArrayExtensions.hasElements(shippingChargeLines)) {\n return undefined;\n }\n\n const defaultCharge: number = 0;\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\n return chargeTotal + (chargeLine.CalculatedAmount ?? defaultCharge);\n }, defaultCharge);\n\n const priceComponent = (\n \n );\n return (\n <>\n \n {priceComponent}\n \n );\n },\n\n /**\n * Render other charges.\n * @param props - The cart line props.\n * @returns JSX element.\n */\n renderOtherCharges: (props: ICartLineProps) => {\n const cartline = props.data.cartLine;\n const otherCharges = cartline.ChargeLines?.filter(chargeline => !chargeline.IsShipping);\n\n return (\n otherCharges?.map((otherCharge, index) => {\n const itemIndex = index;\n return otherCharge.CalculatedAmount ? (\n
\n \n \n \n \n
\n ) : (\n ''\n );\n }) ?? undefined\n );\n },\n\n /**\n * Render the sales agreement prompt.\n * @param props - The ICartLineProps.\n * @returns The JSX.Element.\n */\n renderSalesAgreementPrompt: (props: ICartLineProps): JSX.Element | null => {\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers -- We use 0 to indicate no sales agreement applied on the cart line.\n if (props.data.cartLine.SalesAgreementLineRecordId === 0) {\n return null;\n }\n return
{props.resources.salesAgreementPricePrompt}
;\n },\n\n renderConfirmedShipDate: (props: ICartLineProps) => {\n if (!props.isSalesLine || props.confirmedShipDate === undefined || StringExtensions.isNullOrEmpty(props.confirmedShipDate)) {\n return null;\n }\n return (\n
\n {props.resources.confirmedShipDateLabel}\n {props.confirmedShipDate}\n
\n );\n }\n};\n\n/**\n * Render cartline component.\n * @param props - The cart line props.\n * @returns JSX element.\n */\n// eslint-disable-next-line no-redeclare\nconst CartLine: React.FC = (props: ICartLineProps) => {\n const { isSalesLine, productUrl, resources } = props;\n const { product, cartLine } = props.data;\n\n const destructDimensionStrings = {\n sizeString: resources.sizeString,\n colorString: resources.colorString,\n styleString: resources.styleString,\n configString: resources.configString,\n amountString: resources.amountString\n };\n\n const fallbackImageUrl =\n product &&\n getFallbackImageUrl(\n product.ItemId,\n props.context.actionContext.requestContext.apiSettings,\n props.context.request.app?.config?.OmniChannelMedia\n );\n const productDimensions = product && cartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\n const renderProductUnitPrice = cartLineItemFunctions.renderProductUnitPrice(props);\n const imageSettings = props.imageSettings;\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n const renderDiscountLines = cartLineItemFunctions.renderDiscountLines(props);\n const renderInventoryLabel = cartLineItemFunctions.renderInventoryLabel(props);\n const renderShippingLabel = cartLineItemFunctions.renderShippingLabel(props);\n const renderOtherCharges = cartLineItemFunctions.renderOtherCharges(props);\n const renderConfirmedShipDate = cartLineItemFunctions.renderConfirmedShipDate(props);\n const renderSalesAgreementPrompt = cartLineItemFunctions.renderSalesAgreementPrompt(props);\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\n const productAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n const productName = product?.Name ?? cartLine.Description;\n const imgeClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-image' : 'msc-cart-line__product-image';\n const cartLineContentClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-content' : 'msc-cart-line__content';\n\n /**\n * Render other charges.\n * @param newValue - The cart line props.\n * @returns Boolean.\n */\n const onChange = (newValue: number): boolean => {\n if (props.quantityOnChange) {\n return props.quantityOnChange(props.data.cartLine, newValue);\n }\n return true;\n };\n\n /**\n * Generate error message.\n * @returns JSX element.\n */\n const generateErrorMessage = (): JSX.Element | null => {\n if (props.errorMessage) {\n return (\n
\n \n {props.errorMessage}\n
\n );\n }\n\n return null;\n };\n\n /**\n * Render Saving component.\n * @returns JSX element.\n */\n const renderSaving = (): JSX.Element | null => {\n if (!props.data.cartLine.DiscountAmount) {\n return null;\n }\n const discountAmountZero: number = 0;\n\n if (props.data.cartLine.DiscountAmount > discountAmountZero) {\n return (\n <>\n {`${props.resources.discountStringText || 'Discount'}`}\n \n \n );\n }\n return null;\n };\n\n /**\n * Gets the react node for product unit of measure display.\n * @returns The node representing markup for unit of measure component.\n */\n const renderUnitOfMeasure = () => {\n if (props.data.cartLine.IsInvoiceLine) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\n if (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none') {\n return undefined;\n }\n\n if (!product || !product.DefaultUnitOfMeasure) {\n return undefined;\n }\n\n return (\n
\n {product.DefaultUnitOfMeasure}\n
\n );\n };\n\n /**\n * Generate quantity and price component.\n * @returns JSX element.\n */\n const generateQuantityAndPrice = (): JSX.Element[] | null => {\n const nodes = [];\n const defaultMaxQuantity: number = 10;\n const singleQuantity: number = 1;\n const unitOfMeasure = renderUnitOfMeasure();\n\n // No quantity selector for invoice line\n if (!props.data.cartLine.IsInvoiceLine) {\n if (props.data.product && props.isQuantityEditable) {\n nodes.push(\n
\n
{resources.quantityDisplayString}
\n\n {generateErrorMessage()}\n\n \n {unitOfMeasure}\n
\n );\n } else {\n nodes.push(\n \n {unitOfMeasure}\n \n\n {generateErrorMessage()}\n\n {props.data.cartLine.Quantity}\n \n );\n }\n }\n\n nodes.push(\n
\n \n {renderSaving()}\n {props.isOutOfStock ? renderInventoryLabel : null}\n
\n );\n\n return nodes;\n };\n\n const _renderStoreLocation = (): JSX.Element | null => {\n if (cartLine && cartLine.FulfillmentStoreId) {\n return (\n
\n {props.deliveryLocation}\n
\n );\n } else {\n return (\n
\n {props.deliveryLocation}\n
\n );\n }\n };\n\n return (\n
\n {MsDyn365.isBrowser ? (\n \n \n ) : null}\n
\n
\n \n {MsDyn365.isBrowser ? (\n \n {productName}\n \n ) : null}\n {ArrayExtensions.hasElements(productDimensions) ? (\n
{productDimensions}
\n ) : (\n ''\n )}\n
\n \n {renderConfirmedShipDate}\n {renderUnitOfMeasure()}\n
\n {renderProductUnitPrice}\n {renderInventoryLabel}\n {renderDiscountLines}\n {props.showShippingChargesForLineItems &&
{renderShippingLabel}
}\n {renderOtherCharges}\n {renderSalesAgreementPrompt}\n
\n {generateQuantityAndPrice()}\n {renderSalesAgreementPrompt}\n {props.data.cartLine.IsInvoiceLine && props.data.cartState && props.resources.priceEditorResources && (\n \n )}\n {_renderStoreLocation()}\n
\n
\n );\n};\n\n// @ts-expect-error\nexport const CartLineItemComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\n 'CartLineItem',\n {\n component: CartLine,\n ...cartLineItemFunctions\n }\n);\n\nexport default CartLineItemComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\nimport {\n IPriceComponentResources,\n ISwatchItem,\n PriceComponent,\n ProductComponentV2SwatchComponent,\n RatingComponent\n} from '@msdyn365-commerce/components';\nimport {\n getCatalogId,\n IAny,\n IComponent,\n IComponentProps,\n ICoreContext,\n IGeneric,\n IGridSettings,\n IImageData,\n IImageSettings,\n Image,\n msdyn365Commerce\n} from '@msdyn365-commerce/core';\n\nimport {\n ArrayExtensions,\n convertDimensionTypeToProductDimensionType,\n Dictionary,\n DimensionTypes,\n generateImageUrl,\n getProductPageUrlSync,\n IDimensionsApp,\n StringExtensions,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n format,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n onTelemetryClick\n} from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\n/**\n * AttributeSwatch entity interface.\n */\ninterface IAttributeSwatch {\n swatchValue?: string;\n swatchImageUrl?: string;\n swatchColorHexCode?: string;\n isDefault?: boolean;\n productImageUrls?: string[];\n extensionProperties?: ICommerceProperty[];\n}\n\n/**\n * CommerceProperty entity interface.\n */\ninterface ICommerceProperty {\n propertyKey?: string;\n value?: IExtensionPropertyValue;\n}\n\n/**\n * Extension property value entity interface.\n */\ninterface IExtensionPropertyValue {\n isBooleanValue?: boolean;\n byteValue?: number;\n dateTimeOffsetValue?: Date;\n decimalValue?: number;\n integerValue?: number;\n longValue?: number;\n stringValue?: string;\n}\n\n/**\n * ProductDimension entity interface.\n */\ninterface IProductDimension {\n dimensionTypeValue: number;\n dimensionValue?: IProductDimensionValue;\n extensionProperties?: ICommerceProperty[];\n}\n\n/**\n * ProductDimensionValue entity interface.\n */\ninterface IProductDimensionValue {\n recordId: number;\n value?: string;\n dimensionId?: string;\n colorHexCode?: string;\n imageUrl?: string;\n refinerGroup?: string;\n extensionProperties?: ICommerceProperty[];\n}\n\n/**\n * ProductSearchResult entity interface.\n */\nexport interface IProductSearchResult {\n itemId?: string;\n name?: string;\n price: number;\n primaryImageUrl?: string;\n recordId: number;\n trackingId?: string;\n averageRating?: number;\n totalRatings?: number;\n description?: string;\n basePrice?: number;\n minVariantPrice?: number;\n maxVariantPrice?: number;\n displayOrder?: number;\n attributeValues?: IAttributeValue[];\n defaultUnitOfMeasure?: string;\n masterProductId?: number;\n extensionProperties?: ICommerceProperty[];\n}\n\n/**\n * AttributeValue entity interface.\n */\ninterface IAttributeValue {\n name?: string;\n keyName?: string;\n unitOfMeasureSymbol?: string;\n dataTypeValue?: number;\n isBooleanValue?: boolean;\n dateTimeOffsetValue?: Date;\n floatValue?: number;\n integerValue?: number;\n textValue?: string;\n currencyValue?: number;\n currencyCode?: string;\n attributeValueId?: number;\n recordId?: number;\n swatches?: IAttributeSwatch[];\n extensionProperties?: ICommerceProperty[];\n}\n\nexport interface IProductComponentV2Props extends IComponentProps<{ product?: IProductSearchResult }> {\n className?: string;\n imageSettings?: IImageSettings;\n savingsText?: string;\n freePriceText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n ratingAriaLabel?: string;\n ratingCountAriaLabel?: string;\n allowBack?: boolean;\n telemetryContent?: ITelemetryContent;\n quickViewButton?: React.ReactNode;\n productComparisonButton?: React.ReactNode;\n isEnabledProductDescription?: boolean;\n isPriceMinMaxEnabled?: boolean;\n priceResources?: IPriceComponentResources;\n inventoryLabel?: string;\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\n swatchItemAriaLabel?: string;\n}\n\nexport interface IProductComponentV2 extends IComponent {}\n\nconst PriceComponentActions = {};\n\n/**\n * Gets the product page url from the default swatch selected.\n * @param productData - Product card to be rendered.\n * @returns The default color swatch selected if any.\n */\nfunction getDefaultColorSwatchSelected(productData?: IProductSearchResult): IAttributeSwatch | null {\n if (!productData || !productData.attributeValues) {\n return null;\n }\n\n const colorAttribute = productData.attributeValues.find(\n attributeValue => attributeValue.keyName?.toLocaleLowerCase() === DimensionTypes.color\n );\n if (!colorAttribute) {\n return null;\n }\n\n const defaultSwatch = colorAttribute.swatches?.find(item => item.isDefault === true) ?? colorAttribute.swatches?.[0];\n return defaultSwatch ?? null;\n}\n\n/**\n * Gets the product image from the default swatch selected.\n * @param coreContext - Context of the module using the component.\n * @param productData - Product card to be rendered.\n * @returns The product card image url.\n */\nfunction getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: IProductSearchResult): string | undefined {\n const siteContext = coreContext as ICoreContext;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\n return productData?.primaryImageUrl;\n }\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.productImageUrls)\n ? generateImageUrl(defaultSwatch.productImageUrls[0], coreContext.request.apiSettings)\n : productData?.primaryImageUrl;\n}\n\n/**\n * Updates the product url link to product details page.\n * @param productDetailsPageUrl - Product page url.\n * @param coreContext - Context of the module using the component.\n * @param queryString - Querystring to be added to the URL.\n * @returns The update product page url.\n */\nfunction updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\n if (sourceUrl.search) {\n sourceUrl.search += `&${queryString}`;\n } else {\n sourceUrl.search += queryString;\n }\n\n const updatedUrl = new URL(sourceUrl.href);\n return updatedUrl.pathname + sourceUrl.search;\n}\n\n/**\n * Gets the react node for product unit of measure display.\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\n * @returns The node representing markup for unit of measure component.\n */\nfunction renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\n if (!unitOfMeasure) {\n return null;\n }\n return (\n
\n {unitOfMeasure}\n
\n );\n}\n\n/**\n * Gets the react node for product availability.\n * @param inventoryAvailabilityLabel - The product information.\n * @returns The node representing markup for product availability.\n */\nfunction renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\n return null;\n }\n\n return (\n
\n {inventoryAvailabilityLabel}\n
\n );\n}\n\n/**\n * Renders product comparison button similar to the quick view button.\n * @param productComparisonButton - React element of the button.\n * @param product - Current product info.\n * @param catalogId - Current catalog.\n * @returns React element for the specific product.\n */\nfunction renderProductComparisonButton(\n productComparisonButton: React.ReactNode,\n product: IProductSearchResult,\n catalogId: number\n): JSX.Element | undefined {\n validateCatalogId(catalogId);\n return React.cloneElement(productComparisonButton as React.ReactElement, { product, catalogId });\n}\n\n/**\n * Gets the product page url from the default swatch selected.\n * @param coreContext - Context of the module using the component.\n * @param productUrl - Product page url for the product card.\n * @param productData - Product card to be rendered.\n * @returns The product card image url.\n */\nfunction getProductPageUrlFromDefaultSwatch(\n coreContext: ICoreContext,\n productUrl: string,\n productData?: IProductSearchResult\n): string | undefined {\n const siteContext = coreContext as ICoreContext;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\n return productUrl;\n }\n\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\n if (!defaultSwatch || !defaultSwatch.swatchValue) {\n return productUrl;\n }\n\n const queryString = `color=${defaultSwatch.swatchValue}`;\n return updateProductUrl(productUrl, coreContext, queryString);\n}\n\nconst ProductCardV2: React.FC = ({\n data,\n context,\n imageSettings,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText,\n ratingAriaLabel,\n ratingCountAriaLabel,\n allowBack,\n typeName,\n id,\n telemetryContent,\n quickViewButton,\n productComparisonButton,\n isEnabledProductDescription,\n isPriceMinMaxEnabled,\n priceResources,\n inventoryLabel,\n dimensionAvailabilities,\n swatchItemAriaLabel\n}) => {\n const product = data.product;\n\n let productUrl = getProductPageUrlSync(product?.name ?? '', product?.recordId ?? Number.MIN_VALUE, context.actionContext, undefined);\n if (allowBack) {\n productUrl = updateProductUrl(productUrl, context, 'back=true');\n }\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.primaryImageUrl;\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\n const [productPageUrl, setProductPageUrl] = useState(productPageUrlFromSwatch);\n const [productImageUrl, setProductImageUrl] = useState(productImageUrlFromSwatch);\n React.useEffect(() => {\n setProductPageUrl(productPageUrlFromSwatch);\n setProductImageUrl(productImageUrlFromSwatch);\n }, [productUrl, productPageUrlFromSwatch, productImageUrlFromSwatch]);\n const [selectedSwatchItems] = useState(new Dictionary());\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\n const enableStockCheck = context.app.config.enableStockCheck;\n\n /**\n * Updates the product page and Image url based on swatch selected.\n * @param coreContext - Context of the caller.\n * @param swatchItem - Dimension swatch selected.\n */\n const updatePageAndImageUrl = React.useCallback(\n (coreContext: ICoreContext, swatchItem: ISwatchItem) => {\n const dimensionType = swatchItem.dimensionType;\n selectedSwatchItems.setValue(dimensionType, swatchItem);\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\n return;\n }\n const queryString = `${dimensionType}=${swatchItem.value}`;\n let productPageUrlWithSwatch = '';\n if (productPageUrl.includes(dimensionType)) {\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\n newUrl.searchParams.delete(dimensionType);\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\n } else {\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\n }\n setProductPageUrl(productPageUrlWithSwatch);\n if (dimensionType === DimensionTypes.color) {\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls)\n ? swatchItem.productImageUrls[0]\n : undefined;\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\n setProductImageUrl(newImageUrl);\n }\n },\n [selectedSwatchItems, context, productPageUrl]\n );\n\n if (!product) {\n return null;\n }\n\n /**\n * Checks if rendering the particular dimensions is allowed for product card.\n * @param dimensionType - Dimension to be displayed.\n * @returns Updates the state with new product page url.\n */\n function shouldDisplayDimension(dimensionType: string): boolean {\n const dimensionsContext = context as ICoreContext;\n const dimensionsToDisplayOnProductCard = dimensionsContext.app.config.dimensionsInProductCard;\n return (\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\n dimensionsToDisplayOnProductCard.includes(dimensionType.toLocaleLowerCase() as DimensionTypes)\n );\n }\n\n /**\n * Gets the react node for product dimension as swatch.\n * @param attributeValues - Attribute value property from product.\n * @returns The node representing markup for unit of measure component.\n */\n function renderProductDimensions(attributeValues?: IAttributeValue[]): JSX.Element | null {\n if (!attributeValues) {\n return null;\n }\n\n return (\n
\n {attributeValues.map((item: IAttributeValue) => {\n const dimensionTypeValue = item.keyName?.toLocaleLowerCase() ?? '';\n if (!shouldDisplayDimension(dimensionTypeValue)) {\n return null;\n }\n\n const siteContext = context as ICoreContext;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n const dimensionType = dimensionTypeValue as DimensionTypes;\n const swatches =\n item.swatches?.map(swatchItem => {\n return {\n itemId: `${item.recordId ?? ''}-${dimensionTypeValue}-${swatchItem.swatchValue ?? ''}`,\n value: swatchItem.swatchValue ?? '',\n dimensionType,\n colorHexCode: swatchItem.swatchColorHexCode,\n imageUrl: swatchItem.swatchImageUrl,\n productImageUrls: swatchItem.productImageUrls,\n isDefault: swatchItem.isDefault,\n swatchItemAriaLabel: swatchItemAriaLabel ? format(swatchItemAriaLabel, dimensionType) : '',\n isDisabled:\n enableStockCheck &&\n dimensionAvailabilities?.find(\n dimensionAvailability => dimensionAvailability.value === (swatchItem.swatchValue ?? '')\n )?.isDisabled\n };\n }) ?? [];\n if (\n dimensionToPreSelectInProductCard !== DimensionTypes.none &&\n ArrayExtensions.hasElements(swatches) &&\n !swatches.some(swatch => swatch.isDefault) &&\n dimensionType === DimensionTypes.color\n ) {\n swatches[0].isDefault = true;\n }\n return (\n \n );\n })}\n
\n );\n }\n\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\n if (quickview === null) {\n return undefined;\n }\n const selectedDimensions: IProductDimension[] = selectedSwatchItems.getValues().map(swatches => {\n return {\n dimensionTypeValue: convertDimensionTypeToProductDimensionType(swatches.dimensionType),\n dimensionValue: {\n recordId: 0,\n Value: swatches.value\n }\n };\n });\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item, selectedDimensions });\n }\n\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.recordId.toString());\n\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\n\n return (\n <>\n {isEnabledProductDescription ? (\n \n
\n
\n {renderProductPlacementImage(\n imageSettings,\n context.request.gridSettings,\n productImageUrl,\n product.primaryImageUrl,\n product.name,\n context\n )}\n
\n
\n
{product.name}
\n {renderPrice(\n context,\n typeName,\n id,\n product.basePrice,\n product.price,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText,\n isPriceMinMaxEnabled,\n priceResources\n )}\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.defaultUnitOfMeasure)}\n {renderDescription(product.description)}\n
\n
\n \n ) : (\n \n
\n {renderProductPlacementImage(\n imageSettings,\n context.request.gridSettings,\n productImageUrl,\n product.primaryImageUrl,\n product.name,\n context\n )}\n
\n
\n
{product.name}
\n {renderPrice(\n context,\n typeName,\n id,\n product.basePrice,\n product.price,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText\n )}\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.defaultUnitOfMeasure)}\n
\n \n )}\n {renderProductDimensions(product.attributeValues)}\n {!context.app.config.hideRating &&\n renderRating(context, typeName, id, product.averageRating, product.totalRatings, ratingAriaLabel, ratingCountAriaLabel)}\n {renderProductAvailability(inventoryLabel)}\n {quickViewButton && renderQuickView(quickViewButton, product.recordId)}\n {productComparisonButton && renderProductComparisonButton(productComparisonButton, product, getCatalogId(context.request))}\n \n );\n};\n\nfunction renderLabel(\n name?: string,\n price?: string,\n rating?: number,\n ratingAriaLabelText?: string,\n reviewCount?: number,\n ratingCountAriaLabelText?: string\n): string {\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\n return `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${\n reviewCountArialableText ? ` ${reviewCountArialableText}` : ''\n }`;\n}\n\nfunction renderDescription(description?: string): JSX.Element | null {\n return

{description}

;\n}\n\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\n if (rating && ratingAriaLabel) {\n const roundedRating = rating.toFixed(2);\n return format(ratingAriaLabel || '', roundedRating, '5');\n }\n return '';\n}\n\nfunction getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\n if (reviewCount && ratingCountAriaLabelText) {\n return format(ratingCountAriaLabelText || '', reviewCount);\n }\n return '';\n}\n\nfunction renderRating(\n coreContext: ICoreContext,\n moduleTypeName: string,\n moduleId: string,\n avgRating?: number,\n totalRatings?: number,\n ariaLabel?: string,\n ratingCountAriaLabel?: string\n): JSX.Element | null {\n if (!avgRating) {\n return null;\n }\n\n const numberRatings = totalRatings?.toString() || undefined;\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\n\n return (\n \n );\n}\n\nfunction renderPrice(\n context: ICoreContext,\n typeName: string,\n id: string,\n basePrice?: number,\n adjustedPrice?: number,\n savingsText?: string,\n freePriceText?: string,\n originalPriceText?: string,\n currentPriceText?: string,\n isPriceMinMaxEnabled?: boolean,\n priceResources?: IPriceComponentResources\n): JSX.Element | null {\n const price = {\n BasePrice: basePrice,\n AdjustedPrice: adjustedPrice,\n CustomerContextualPrice: adjustedPrice\n };\n\n return (\n \n );\n}\n\nfunction renderProductPlacementImage(\n imageSettings?: IImageSettings,\n gridSettings?: IGridSettings,\n imageUrl?: string,\n fallbackImageUrl?: string,\n altText?: string,\n context?: ICoreContext>\n): JSX.Element | null {\n if (!imageUrl || !gridSettings || !imageSettings) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment -- Site level config can be of any type.\n const contextConfig = context?.app.config?.placeholderImageName;\n const emptyPlaceHolderImage = contextConfig as string;\n let fallbackImageSource = fallbackImageUrl;\n if (emptyPlaceHolderImage && fallbackImageUrl) {\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\n }\n const img: IImageData = {\n src: imageUrl,\n altText: altText ? altText : '',\n fallBackSrc: fallbackImageSource\n };\n const imageProps = {\n gridSettings,\n imageSettings\n };\n imageProps.imageSettings.cropFocalRegion = true;\n return (\n \n );\n}\n\nexport const ProductComponentV2: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\n IProductComponentV2\n>('ProductV2', { component: ProductCardV2, ...PriceComponentActions });\n\nexport default ProductComponentV2;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\nimport {\n IPriceComponentResources,\n ISwatchItem,\n PriceComponent,\n ProductComponentSwatchComponent,\n RatingComponent\n} from '@msdyn365-commerce/components';\nimport {\n getCatalogId,\n IAny,\n IComponent,\n IComponentProps,\n ICoreContext,\n IGeneric,\n IGridSettings,\n IImageData,\n IImageSettings,\n Image,\n msdyn365Commerce\n} from '@msdyn365-commerce/core';\nimport { AttributeSwatch, AttributeValue, ProductDimension, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n convertDimensionTypeToProductDimensionType,\n Dictionary,\n DimensionTypes,\n generateImageUrl,\n getProductPageUrlSync,\n IDimensionsApp,\n StringExtensions,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n format,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n onTelemetryClick\n} from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\n className?: string;\n imageSettings?: IImageSettings;\n savingsText?: string;\n freePriceText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n ratingAriaLabel?: string;\n ratingCountAriaLabel?: string;\n allowBack?: boolean;\n telemetryContent?: ITelemetryContent;\n quickViewButton?: React.ReactNode;\n productComparisonButton?: React.ReactNode;\n isEnabledProductDescription?: boolean;\n isPriceMinMaxEnabled?: boolean;\n priceResources?: IPriceComponentResources;\n inventoryLabel?: string;\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\n swatchItemAriaLabel?: string;\n}\n\nexport interface IProductComponent extends IComponent {}\n\nconst PriceComponentActions = {};\n\n/**\n * Gets the product page url from the default swatch selected.\n * @param productData - Product card to be rendered.\n * @returns The default color swatch selected if any.\n */\nfunction getDefaultSwatchSelected(coreContext: ICoreContext, productData?: ProductSearchResult): AttributeSwatch | null {\n if (!productData || !productData.AttributeValues) {\n return null;\n }\n\n const siteContext = coreContext as ICoreContext;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n\n const attributeSwatches = productData.AttributeValues.find(\n attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === dimensionToPreSelectInProductCard\n )?.Swatches;\n\n if (!ArrayExtensions.hasElements(attributeSwatches)) {\n return null;\n }\n\n const defaultSwatch = attributeSwatches.find(item => item.IsDefault === true) ?? attributeSwatches[0];\n return defaultSwatch;\n}\n\n/**\n * Gets the product image from the default swatch selected.\n * @param coreContext - Context of the module using the component.\n * @param productData - Product card to be rendered.\n * @returns The product card image url.\n */\nfunction getProductImageUrlFromDefaultSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\n const defaultSwatch = getDefaultSwatchSelected(coreContext, productData);\n const swatchProductImageUrls = defaultSwatch?.ProductImageUrls;\n if (!ArrayExtensions.hasElements(swatchProductImageUrls)) {\n return productData?.PrimaryImageUrl;\n }\n\n return generateImageUrl(swatchProductImageUrls[0], coreContext.request.apiSettings);\n}\n\n/**\n * Updates the product url link to product details page.\n * @param productDetailsPageUrl - Product page url.\n * @param coreContext - Context of the module using the component.\n * @param queryString - Querystring to be added to the URL.\n * @returns The update product page url.\n */\nfunction updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\n if (sourceUrl.search) {\n sourceUrl.search += `&${queryString}`;\n } else {\n sourceUrl.search += queryString;\n }\n\n const updatedUrl = new URL(sourceUrl.href);\n return updatedUrl.pathname + sourceUrl.search;\n}\n\n/**\n * Gets the react node for product unit of measure display.\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\n * @returns The node representing markup for unit of measure component.\n */\nfunction renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\n if (!unitOfMeasure) {\n return null;\n }\n return (\n
\n {unitOfMeasure}\n
\n );\n}\n\n/**\n * Gets the react node for product availability.\n * @param inventoryAvailabilityLabel - The product information.\n * @returns The node representing markup for product availability.\n */\nfunction renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\n return null;\n }\n\n return (\n
\n {inventoryAvailabilityLabel}\n
\n );\n}\n\n/**\n * Renders product comparison button similar to the quick view button.\n * @param productComparisonButton - React element of the button.\n * @param product - Current product info.\n * @param catalogId - Current catalog.\n * @returns React element for the specific product.\n */\nfunction renderProductComparisonButton(\n productComparisonButton: React.ReactNode,\n product: ProductSearchResult,\n catalogId: number\n): JSX.Element | undefined {\n validateCatalogId(catalogId);\n return React.cloneElement(productComparisonButton as React.ReactElement, { product, catalogId });\n}\n\n/**\n * Gets the product page url from the default swatch selected.\n * @param coreContext - Context of the module using the component.\n * @param productUrl - Product page url for the product card.\n * @param productData - Product card to be rendered.\n * @returns The product card image url.\n */\nfunction getProductPageUrlFromDefaultSwatch(\n coreContext: ICoreContext,\n productUrl: string,\n productData?: ProductSearchResult\n): string | undefined {\n const defaultSwatch = getDefaultSwatchSelected(coreContext, productData);\n if (!defaultSwatch?.SwatchValue) {\n return productUrl;\n }\n\n const siteContext = coreContext as ICoreContext;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n\n const queryStringEncoded = encodeURIComponent(defaultSwatch.SwatchValue);\n const queryString = `${dimensionToPreSelectInProductCard}=${queryStringEncoded}`;\n return updateProductUrl(productUrl, coreContext, queryString);\n}\n\nconst ProductCard: React.FC = ({\n data,\n context,\n imageSettings,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText,\n ratingAriaLabel,\n ratingCountAriaLabel,\n allowBack,\n typeName,\n id,\n telemetryContent,\n quickViewButton,\n productComparisonButton,\n isEnabledProductDescription,\n isPriceMinMaxEnabled,\n priceResources,\n inventoryLabel,\n dimensionAvailabilities,\n swatchItemAriaLabel\n}) => {\n const product = data.product;\n\n let productUrl = getProductPageUrlSync(product?.Name ?? '', product?.RecordId ?? Number.MIN_VALUE, context.actionContext, undefined);\n if (allowBack) {\n productUrl = updateProductUrl(productUrl, context, 'back=true');\n }\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultSwatch(context, product) ?? product?.PrimaryImageUrl;\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\n const [productPageUrl, setProductPageUrl] = useState(productPageUrlFromSwatch);\n const [productImageUrl, setProductImageUrl] = useState(productImageUrlFromSwatch);\n React.useEffect(() => {\n setProductPageUrl(productPageUrlFromSwatch);\n setProductImageUrl(productImageUrlFromSwatch);\n }, [productUrl, productPageUrlFromSwatch, productImageUrlFromSwatch]);\n const [selectedSwatchItems] = useState(new Dictionary());\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\n const enableStockCheck = context.app.config.enableStockCheck;\n\n const siteContext = context as ICoreContext;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n\n /**\n * Updates the product page and Image url based on swatch selected.\n * @param coreContext - Context of the caller.\n * @param swatchItem - Dimension swatch selected.\n */\n const updatePageAndImageUrl = React.useCallback(\n (coreContext: ICoreContext, swatchItem: ISwatchItem) => {\n const dimensionType = swatchItem.dimensionType;\n selectedSwatchItems.setValue(dimensionType, swatchItem);\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\n return;\n }\n const queryString = `${dimensionType}=${swatchItem.value}`;\n let productPageUrlWithSwatch = '';\n if (productPageUrl.includes(dimensionType)) {\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\n newUrl.searchParams.delete(dimensionType);\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\n } else {\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\n }\n setProductPageUrl(productPageUrlWithSwatch);\n if (dimensionType === dimensionToPreSelectInProductCard) {\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls)\n ? swatchItem.productImageUrls[0]\n : undefined;\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\n setProductImageUrl(newImageUrl);\n }\n },\n [selectedSwatchItems, context, productPageUrl]\n );\n\n if (!product) {\n return null;\n }\n\n /**\n * Checks if rendering the particular dimensions is allowed for product card.\n * @param dimensionType - Dimension to be displayed.\n * @returns Updates the state with new product page url.\n */\n function shouldDisplayDimension(dimensionType: string): boolean {\n const dimensionsContext = context as ICoreContext;\n const dimensionsToDisplayOnProductCard = dimensionsContext.app.config.dimensionsInProductCard;\n return (\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\n dimensionsToDisplayOnProductCard.includes(dimensionType.toLocaleLowerCase() as DimensionTypes)\n );\n }\n\n /**\n * Gets the react node for product dimension as swatch.\n * @param attributeValues - Attribute value property from product.\n * @returns The node representing markup for unit of measure component.\n */\n function renderProductDimensions(attributeValues?: AttributeValue[]): JSX.Element | null {\n if (!attributeValues) {\n return null;\n }\n\n return (\n
\n {attributeValues.map((item: AttributeValue) => {\n const dimensionTypeValue = item.KeyName?.toLocaleLowerCase() ?? '';\n if (!shouldDisplayDimension(dimensionTypeValue)) {\n return null;\n }\n\n const siteContext = context as ICoreContext;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n const dimensionType = dimensionTypeValue as DimensionTypes;\n const swatches =\n item.Swatches?.map(swatchItem => {\n return {\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\n value: swatchItem.SwatchValue ?? '',\n dimensionType,\n colorHexCode: swatchItem.SwatchColorHexCode,\n imageUrl: swatchItem.SwatchImageUrl,\n productImageUrls: swatchItem.ProductImageUrls,\n isDefault: swatchItem.IsDefault,\n swatchItemAriaLabel: swatchItemAriaLabel ? format(swatchItemAriaLabel, dimensionType) : '',\n isDisabled:\n enableStockCheck &&\n dimensionAvailabilities?.find(\n dimensionAvailability => dimensionAvailability.value === (swatchItem.SwatchValue ?? '')\n )?.isDisabled\n };\n }) ?? [];\n if (\n dimensionType === dimensionToPreSelectInProductCard &&\n ArrayExtensions.hasElements(swatches) &&\n !swatches.some(swatch => swatch.isDefault)\n ) {\n swatches[0].isDefault = true;\n }\n return (\n \n );\n })}\n
\n );\n }\n\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\n if (quickview === null) {\n return undefined;\n }\n const selectedDimensions: ProductDimension[] = selectedSwatchItems.getValues().map(swatches => {\n return {\n DimensionTypeValue: convertDimensionTypeToProductDimensionType(swatches.dimensionType),\n DimensionValue: {\n RecordId: 0,\n Value: swatches.value\n }\n };\n });\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item, selectedDimensions });\n }\n\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\n\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\n\n return (\n <>\n {isEnabledProductDescription ? (\n \n
\n
\n {renderProductPlacementImage(\n imageSettings,\n context.request.gridSettings,\n productImageUrl,\n product.PrimaryImageUrl,\n product.Name,\n context\n )}\n
\n
\n
{product.Name}
\n {renderPrice(\n context,\n typeName,\n id,\n product.BasePrice,\n product.Price,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText,\n isPriceMinMaxEnabled,\n priceResources\n )}\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\n {renderDescription(product.Description)}\n
\n
\n \n ) : (\n \n
\n {renderProductPlacementImage(\n imageSettings,\n context.request.gridSettings,\n productImageUrl,\n product.PrimaryImageUrl,\n product.Name,\n context\n )}\n
\n
\n
{product.Name}
\n {renderPrice(\n context,\n typeName,\n id,\n product.BasePrice,\n product.Price,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText\n )}\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\n
\n \n )}\n {renderProductDimensions(product.AttributeValues)}\n {!context.app.config.hideRating &&\n renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel, ratingCountAriaLabel)}\n {renderProductAvailability(inventoryLabel)}\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\n {productComparisonButton && renderProductComparisonButton(productComparisonButton, product, getCatalogId(context.request))}\n \n );\n};\n\nfunction renderLabel(\n name?: string,\n price?: string,\n rating?: number,\n ratingAriaLabelText?: string,\n reviewCount?: number,\n ratingCountAriaLabelText?: string\n): string {\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\n return `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${\n reviewCountArialableText ? ` ${reviewCountArialableText}` : ''\n }`;\n}\n\nfunction renderDescription(description?: string): JSX.Element | null {\n return

{description}

;\n}\n\nfunction getRatingAriaLabel(rating?: number, ratingAriaLabel?: string): string {\n if (rating && ratingAriaLabel) {\n const roundedRating = rating.toFixed(2);\n return format(ratingAriaLabel || '', roundedRating, '5');\n }\n return '';\n}\n\nfunction getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\n if (reviewCount && ratingCountAriaLabelText) {\n return format(ratingCountAriaLabelText || '', reviewCount);\n }\n return '';\n}\n\nfunction renderRating(\n coreContext: ICoreContext,\n moduleTypeName: string,\n moduleId: string,\n avgRating?: number,\n totalRatings?: number,\n ariaLabel?: string,\n ratingCountAriaLabel?: string\n): JSX.Element | null {\n if (!avgRating) {\n return null;\n }\n\n const numberRatings = totalRatings?.toString() || undefined;\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\n\n return (\n \n );\n}\n\nfunction renderPrice(\n context: ICoreContext,\n typeName: string,\n id: string,\n basePrice?: number,\n adjustedPrice?: number,\n savingsText?: string,\n freePriceText?: string,\n originalPriceText?: string,\n currentPriceText?: string,\n isPriceMinMaxEnabled?: boolean,\n priceResources?: IPriceComponentResources\n): JSX.Element | null {\n const price: ProductPrice = {\n BasePrice: basePrice,\n AdjustedPrice: adjustedPrice,\n CustomerContextualPrice: adjustedPrice\n };\n\n return (\n \n );\n}\n\nfunction renderProductPlacementImage(\n imageSettings?: IImageSettings,\n gridSettings?: IGridSettings,\n imageUrl?: string,\n fallbackImageUrl?: string,\n altText?: string,\n context?: ICoreContext>\n): JSX.Element | null {\n if (!imageUrl || !gridSettings || !imageSettings) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment -- Site level config can be of any type.\n const contextConfig = context?.app.config?.placeholderImageName;\n const emptyPlaceHolderImage = contextConfig as string;\n let fallbackImageSource = fallbackImageUrl;\n if (emptyPlaceHolderImage && fallbackImageUrl) {\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\n }\n const img: IImageData = {\n src: imageUrl,\n altText: altText ? altText : '',\n fallBackSrc: fallbackImageSource\n };\n const imageProps = {\n gridSettings,\n imageSettings\n };\n imageProps.imageSettings.cropFocalRegion = true;\n return (\n \n );\n}\n\nexport const ProductComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\n IProductComponent\n>('Product', { component: ProductCard, ...PriceComponentActions });\n\nexport default ProductComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n format,\n getPayloadObject,\n getTelemetryAttributes,\n IPayLoad,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\n/**\n * IPromoCodeProps: Interface for promo code component.\n */\nexport interface IPromoCodeProps extends IComponentProps<{}> {\n cart: ICartState | undefined;\n promoCodeHeadingText: string;\n appliedPromoCodeHeadingText: string;\n removePromoAriaLabelFormat: string;\n promoPlaceholderText: string;\n promoCodeApplyButtonText: string;\n collapseTimeOut: number;\n removePromoText: string;\n invalidPromoCodeErrorText: string;\n failedToAddPromoCodeErrorText: string;\n duplicatePromoCodeErrorText: string;\n failedToRemovePromoCodeErrorText: string;\n\n /**\n * The telemetry content.\n */\n telemetryContent?: ITelemetryContent;\n promoCodeApplyCallback?(): void;\n}\n\n/**\n * IPromoCodeProps: Interface for promo code component.\n */\nexport interface IPromoCodeComponent extends IComponent {}\n\n/**\n * IPromoCodeProps: Interface for promo code state.\n */\ninterface IPromoCodeState {\n promoCodeInputValue: string;\n error: string;\n canApply: boolean;\n}\n\n/**\n *\n * The PromoCode component renders the promocode section.\n * @extends {React.PureComponent}\n */\nclass PromoCode extends React.PureComponent {\n private readonly payLoad: IPayLoad;\n\n public constructor(props: IPromoCodeProps) {\n super(props);\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, TelemetryConstant.ApplyPromoCode);\n this.state = {\n promoCodeInputValue: '',\n error: '',\n canApply: false\n };\n }\n\n public render(): JSX.Element {\n return (\n
\n
{this.props.promoCodeHeadingText}
\n {this._renderForm(this.props.promoPlaceholderText, this.props.promoCodeApplyButtonText, this.props.cart)}\n

\n {this.state.error}\n

\n {this._renderAppliedPromoCode(this.props)}\n
\n );\n }\n\n /**\n * On input change method.\n * @param event - Change event.\n */\n private readonly _onInputChangeHandler = (event: React.ChangeEvent) => {\n const error = event.target.value === '' ? '' : this.state.error;\n this.setState({\n promoCodeInputValue: event.target.value.trim(),\n error,\n canApply: !!event.target.value\n });\n };\n\n /**\n * Apply promo code method.\n * @param cartState - Cart state interface.\n */\n private readonly _applyPromotion = (cartState: ICartState | undefined) => {\n if (!cartState) {\n return;\n }\n const appliedPromo = this.state.promoCodeInputValue;\n\n cartState\n .addPromoCode({ promoCode: appliedPromo })\n .then(result => {\n if (result.status === 'SUCCESS') {\n // Show success text\n this.setState({ promoCodeInputValue: '', error: '', canApply: false });\n } else if (result.substatus === 'ALREADYADDED') {\n this.setState({ error: this.props.duplicatePromoCodeErrorText });\n } else {\n this.setState({ error: this.props.invalidPromoCodeErrorText });\n }\n })\n .catch(() => {\n this.setState({ error: this.props.failedToAddPromoCodeErrorText });\n });\n };\n\n /**\n * On submit action.\n * @param cartState - Cart state.\n * @returns Apply promotion.\n */\n private readonly _onSubmitHandler = (cartState: ICartState | undefined) => (event: React.FormEvent) => {\n event.preventDefault();\n this._applyPromotion(cartState);\n };\n\n /**\n * On apply promotion.\n * @param cartState - Cart state.\n * @returns Apply promotion.\n */\n private readonly applyPromotionHandler = (cartState: ICartState | undefined) => () => {\n this._applyPromotion(cartState);\n };\n\n /**\n * Renders promo code form.\n * @param promoPlaceholderText - Promo code input box placeholder string.\n * @param promoCodeApplyButtonText - Promo code button text string.\n * @param cartState - Cart state interface.\n * @returns Promo code form.\n */\n private readonly _renderForm = (promoPlaceholderText: string, promoCodeApplyButtonText: string, cartState: ICartState | undefined) => {\n const attributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n
\n
\n \n \n
\n
\n );\n };\n\n /**\n * Remove promo code method.\n * @param cartState - Cart state interface.\n * @param event - Mouse event.\n */\n private readonly _removePromotion = (cartState: ICartState | undefined, event: React.MouseEvent) => {\n if (!cartState) {\n return;\n }\n const code = event.currentTarget.getAttribute('data-value') ?? '';\n cartState\n .removePromoCodes({\n promoCodes: [code]\n })\n .then(result => {\n if (result.status === 'SUCCESS') {\n this.setState({ error: '' });\n }\n })\n .catch(() => {\n this.setState({ error: this.props.failedToRemovePromoCodeErrorText });\n });\n };\n\n /**\n * Renders applied promo code form.\n * @param props - Promo code component props.\n * @returns Applied promo code.\n */\n private readonly _renderAppliedPromoCode = (props: IPromoCodeProps) => {\n if (!props.cart || !props.cart.cart.Coupons || !ArrayExtensions.hasElements(props.cart.cart.Coupons)) {\n return;\n }\n\n /**\n * On remove promotion action.\n * @param event - Mouse event.\n */\n const removePromotionHandler = (event: React.MouseEvent) => {\n this._removePromotion(props.cart, event);\n };\n\n return (\n <>\n {props.cart.cart.Coupons.map((coupon: Coupon) => {\n const ariaLabel = props.removePromoAriaLabelFormat\n ? format(props.removePromoAriaLabelFormat, props.removePromoText, coupon.Code)\n : '';\n\n return (\n
\n
\n {'Code '}\n {coupon.Code}\n {'Applied '}\n
\n \n
\n );\n })}\n \n );\n };\n}\n\nexport default PromoCode;\n","/*******************************************************************************\n* Copyright (c) Microsoft Corporation.\n* All rights reserved. See LICENSE in the project root for license information.\n*******************************************************************************/\n\n\nimport { uniq } from 'lodash';\n/**\n * Gets list of used module types.\n */\nexport const getRequestedModules = windowInitialData => {\n let result = {\n modules: []\n };\n\n if (!windowInitialData._moduleList || windowInitialData._moduleList.length === 0) {\n return result;\n }\n windowInitialData._moduleList.forEach(moduleType => {\n result.modules.push(moduleType.typeName);\n });\n\n // Include requested theme modules\n if (windowInitialData._themeModulesList && windowInitialData._themeModulesList.length > 0) {\n result.modules = result.modules.concat(result.modules, windowInitialData._themeModulesList);\n }\n\n return result;\n};\n\n/**\n * Gets list of modules on the page\n */\nexport const getRequestedModuleNames = () => {\n const requestedPackageNames = new Set();\n window.___initialData___ &&\n window.___initialData___._moduleList &&\n window.___initialData___._moduleList.map(m => requestedPackageNames.add(m.typeName));\n window.___initialData___ &&\n window.___initialData___._themeModulesList &&\n window.___initialData___._themeModulesList.map(m => m && requestedPackageNames.add(m));\n return Array.from(requestedPackageNames);\n};\n\n/**\n * Gets keys for used assets (modules) that were utilized on the server-side render pass. Object is\n * initialized from the page viewmodel used to initialize the clientRenderer\n */\nexport const getUniqueRequestedAssets = windowInitialData => {\n let result = {\n modules: []\n };\n if (!windowInitialData) {\n return result;\n }\n\n try {\n result = getRequestedModules(windowInitialData);\n } catch (e) {\n console.error(e);\n }\n\n return {\n modules: uniq(result.modules)\n };\n};\n\n/**\n * Checks if we have that key in the requested asset keys. If so, we'll allow the value and register the\n * databinder, module, or reducer (reducers reference 'key', databinders & modules use 'name'). If we don't receive\n * a set of keys at all, then register everything\n * @param {string[]} requestedAssetKeys The valid & incldued modules\n * @returns {Function} Returns function with signature of \"(string) => boolean\"\n */\n\nexport const filterToUsedAssets = requestedAssetKeys => {\n // curry!\n return partnerModule => (!requestedAssetKeys ? true : requestedAssetKeys.indexOf(partnerModule.name || partnerModule.key) !== -1);\n};\n","var e,n,t,i,r,a=-1,o=function(e){addEventListener(\"pageshow\",(function(n){n.persisted&&(a=n.timeStamp,e(n))}),!0)},c=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0]},u=function(){var e=c();return e&&e.activationStart||0},f=function(e,n){var t=c(),i=\"navigate\";a>=0?i=\"back-forward-cache\":t&&(document.prerendering||u()>0?i=\"prerender\":document.wasDiscarded?i=\"restore\":t.type&&(i=t.type.replace(/_/g,\"-\")));return{name:e,value:void 0===n?-1:n,rating:\"good\",delta:0,entries:[],id:\"v3-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},s=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},t||{})),i}}catch(e){}},d=function(e,n,t,i){var r,a;return function(o){n.value>=0&&(o||i)&&((a=n.value-(r||0))||void 0===r)&&(r=n.value,n.delta=a,n.rating=function(e,n){return e>n[1]?\"poor\":e>n[0]?\"needs-improvement\":\"good\"}(n.value,t),e(n))}},l=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},p=function(e){var n=function(n){\"pagehide\"!==n.type&&\"hidden\"!==document.visibilityState||e(n)};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},v=function(e){var n=!1;return function(t){n||(e(t),n=!0)}},m=-1,h=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},g=function(e){\"hidden\"===document.visibilityState&&m>-1&&(m=\"visibilitychange\"===e.type?e.timeStamp:0,T())},y=function(){addEventListener(\"visibilitychange\",g,!0),addEventListener(\"prerenderingchange\",g,!0)},T=function(){removeEventListener(\"visibilitychange\",g,!0),removeEventListener(\"prerenderingchange\",g,!0)},E=function(){return m<0&&(m=h(),y(),o((function(){setTimeout((function(){m=h(),y()}),0)}))),{get firstHiddenTime(){return m}}},C=function(e){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return e()}),!0):e()},L=[1800,3e3],w=function(e,n){n=n||{},C((function(){var t,i=E(),r=f(\"FCP\"),a=s(\"paint\",(function(e){e.forEach((function(e){\"first-contentful-paint\"===e.name&&(a.disconnect(),e.startTimei.value&&(i.value=r,i.entries=a,t())},u=s(\"layout-shift\",c);u&&(t=d(e,i,b,n.reportAllChanges),p((function(){c(u.takeRecords()),t(!0)})),o((function(){r=0,i=f(\"CLS\",0),t=d(e,i,b,n.reportAllChanges),l((function(){return t()}))})),setTimeout(t,0))})))},A={passive:!0,capture:!0},I=new Date,P=function(i,r){e||(e=r,n=i,t=new Date,k(removeEventListener),F())},F=function(){if(n>=0&&n1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,n){var t=function(){P(e,n),r()},i=function(){r()},r=function(){removeEventListener(\"pointerup\",t,A),removeEventListener(\"pointercancel\",i,A)};addEventListener(\"pointerup\",t,A),addEventListener(\"pointercancel\",i,A)}(n,e):P(n,e)}},k=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(n){return e(n,M,A)}))},D=[100,300],x=function(t,r){r=r||{},C((function(){var a,c=E(),u=f(\"FID\"),l=function(e){e.startTimen.latency){if(t)t.entries.push(e),t.latency=Math.max(t.latency,e.duration);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};J[i.id]=i,G.push(i)}G.sort((function(e,n){return n.latency-e.latency})),G.splice(10).forEach((function(e){delete J[e.id]}))}},Q=function(e,n){n=n||{},C((function(){var t;q();var i,r=f(\"INP\"),a=function(e){e.forEach((function(e){(e.interactionId&&K(e),\"first-input\"===e.entryType)&&(!G.some((function(n){return n.entries.some((function(n){return e.duration===n.duration&&e.startTime===n.startTime}))}))&&K(e))}));var n,t=(n=Math.min(G.length-1,Math.floor(z()/50)),G[n]);t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())},c=s(\"event\",a,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});i=d(e,r,j,n.reportAllChanges),c&&(\"PerformanceEventTiming\"in window&&\"interactionId\"in PerformanceEventTiming.prototype&&c.observe({type:\"first-input\",buffered:!0}),p((function(){a(c.takeRecords()),r.value<0&&z()>0&&(r.value=0,r.entries=[]),i(!0)})),o((function(){G=[],_=O(),r=f(\"INP\"),i=d(e,r,j,n.reportAllChanges)})))}))},U=[2500,4e3],V={},W=function(e,n){n=n||{},C((function(){var t,i=E(),r=f(\"LCP\"),a=function(e){var n=e[e.length-1];n&&n.startTimeperformance.now())return;t.value=Math.max(a-u(),0),t.entries=[r],i(!0),o((function(){t=f(\"TTFB\",0),(i=d(e,t,X,n.reportAllChanges))(!0)}))}}))};export{b as CLSThresholds,L as FCPThresholds,D as FIDThresholds,j as INPThresholds,U as LCPThresholds,X as TTFBThresholds,S as getCLS,w as getFCP,x as getFID,Q as getINP,W as getLCP,Z as getTTFB,S as onCLS,w as onFCP,x as onFID,Q as onINP,W as onLCP,Z as onTTFB};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport interface ITTLCacheOptions {\n removalThresholdInMs?: number;\n intervalForRemovalInMs?: number;\n}\n\nexport type TOnRemoveCallback = (removedKey: string) => void;\n/**\n * Cache with TTL and polling to remove items from it, default implementaiton is to only poll on server\n */\nexport class TTLCache {\n // threshold for removal, 5mins\n public readonly removalThresholdInMs: number;\n\n // frequency of cleaning, 2mins -- this is the period it'll look for keys older than removalThresholdInMs\n public readonly intervalForRemovalInMs: number;\n\n // internal cache\n private _cache: Map;\n\n constructor(options?: ITTLCacheOptions) {\n this.removalThresholdInMs = (options && options.removalThresholdInMs) || 300000;\n this.intervalForRemovalInMs = (options && options.intervalForRemovalInMs) || 120000;\n this._cache = new Map();\n\n if (process.env.CURRENT_ENVIRONMENT === 'node') {\n // interval trigger to clear the map -- only on server\n setInterval(() => this._cleanCache(), this.intervalForRemovalInMs);\n }\n }\n\n /**\n * Gets a value from cache\n *\n * @param {string} key the key\n * @returns {(TValue | undefined)} the value, if it exists\n */\n public get(key: string): TValue | undefined {\n const value = this._cache.get(key);\n if (value) {\n return value[0];\n }\n }\n\n /**\n * Set a value\n *\n * @param {string} key the key\n * @param {TValue} value the value\n */\n public set(key: string, value: TValue, onRemoveCallback?: TOnRemoveCallback): void {\n const now = Date.now();\n this._cache.set(key, [value, now, onRemoveCallback]);\n }\n\n public clear(): void {\n this._cache.clear();\n }\n\n // cleans up the map implementation\n private _cleanCache(): void {\n const now = Date.now();\n const keys = this._cache.keys();\n for (const key of keys) {\n const value = this._cache.get(key);\n if (value && value.length > 1 && now - value[1] > this.removalThresholdInMs) {\n this._cache.delete(key);\n if (typeof value[2] === 'function') {\n value[2](key);\n }\n }\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 { TTLCache } from './ttl-cache';\n\nexport interface IRequestVectorizerOptions {\n removalThresholdInMs?: number;\n intervalForRemovalInMs?: number;\n}\n\n/**\n * Class which handles vectorizing requests\n */\nclass RequestVectorizer {\n // differentiate vectors generated client/server side\n public static SEP: string = process.env.CURRENT_ENVIRONMENT === 'node' ? '.' : '/';\n private _cache: TTLCache;\n\n constructor(options?: IRequestVectorizerOptions) {\n this._cache = new TTLCache(options);\n // binds\n this.next = this.next.bind(this);\n }\n\n /**\n * The next request in the sequence\n *\n * @param {string} requestId\n * @returns {string} the next vectorized request\n */\n public next(requestId: string): string {\n const value = this._cache.get(requestId);\n const nextValue = value === undefined ? 0 : value + 1;\n this._cache.set(requestId, nextValue);\n return `${requestId}${RequestVectorizer.SEP}${nextValue}`;\n }\n}\nconst RequestVectorizerInstance = new RequestVectorizer();\nexport { RequestVectorizerInstance, RequestVectorizer };\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IEventRetailServerRequestProperties, StaticTelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';\nimport { isEmpty as _isEmpty } from 'lodash';\nimport url from 'url';\nimport { TelemetryClient } from 'applicationinsights';\nimport { RequestVectorizerInstance } from './request-vectorizer';\nimport { TTLCache } from './ttl-cache';\n\n/**\n * Regular expression to match content inside round braces\n */\nconst regexGetRoundBraces = /\\(.+?\\)/gm;\n\n/**\n * Default client error\n */\nconst DEFAULT_ERROR_STATUS_CODE = 418;\n\n/**\n * Formats commerce URL parts used in retail server calls with odata formatting\n *\n * @param inputString The input string to replace\n * @param replaceString The replacement value, default of `(~)`.\n */\nexport const replaceIdentifiers = (inputString: string | undefined, replaceString?: string) => {\n return (inputString || '').replace(regexGetRoundBraces, replaceString || `(~)`);\n};\n\n/**\n * Helper mapping lowercase keys to real keys in an object. Note this returns the keys only, mapping\n * lower case key to the actual cased key name in the dictionary\n *\n * e.g.\n *\n * HelloWorld will be returned as 'helloworld' allowing you to look up 'helloworld' to get HelloWorld to index into the real dictionary\n * @param objectDictionary the object dictionary\n */\nexport const toLowerCaseDict = (objectDictionary): { [lowerCaseKeyName: string]: string } => {\n return Object.keys(objectDictionary || {}).reduce(\n (prevValue, current) => ({ ...prevValue, [current.toLocaleLowerCase()]: current }),\n {}\n );\n};\n\nconst ttlRequestCache = new TTLCache();\n\n/**\n * Error retail se interceptor for axios\n *\n * @param config The request cofiguration\n * @param status The response status code\n * @param requestCache The optional request cache to use (mostly for testing)\n */\n\nexport const RSErrorResponseHandler = (\n config: AxiosRequestConfig,\n status: number,\n requestCache?: TTLCache\n) => {\n if (!requestCache) {\n requestCache = ttlRequestCache;\n }\n const headers = config && config.headers;\n let requestId;\n let activityId;\n if (headers) {\n const lowercaseHeaders = toLowerCaseDict(headers);\n requestId = lowercaseHeaders.requestid && headers[lowercaseHeaders.requestid];\n activityId = lowercaseHeaders.activityid && headers[lowercaseHeaders.activityid];\n }\n const statusCode = status ? status : DEFAULT_ERROR_STATUS_CODE;\n const properties = requestCache.get(requestId);\n if (properties) {\n const elapsedTime = StaticTelemetry.stopTimer(requestId);\n const parsedUrl = url.parse((config && (config.url || config.baseURL)) || '');\n StaticTelemetry.trackDependency({\n duration: elapsedTime,\n method: (properties.m || 'unknown').toUpperCase(),\n name: properties.e,\n resultCode: statusCode,\n success: status < 400,\n url: parsedUrl,\n target: parsedUrl.hostname,\n properties: {\n requestId,\n activityId,\n empty: false\n },\n dependencyName: 'RetailServer'\n });\n }\n};\n\n/**\n * Response interceptor for axios\n *\n * @param response The resposne\n * @param requestCache The optional request cache to use (mostly for testing)\n */\nexport const RSResponseInterceptor = (response: AxiosResponse, requestCache?: TTLCache) => {\n if (!requestCache) {\n requestCache = ttlRequestCache;\n }\n // try get properties from request based on requestid header\n let requestId;\n let activityId;\n if (process.env.CURRENT_ENVIRONMENT !== 'node') {\n // on web we need to check config\n const headers = response && response.config && response.config.headers;\n if (headers) {\n const lowercaseHeaders = toLowerCaseDict(headers);\n requestId = lowercaseHeaders.requestid && headers[lowercaseHeaders.requestid];\n activityId = lowercaseHeaders.activityid && headers[lowercaseHeaders.activityid];\n }\n } else {\n requestId = response && response.headers && response.headers.requestid;\n activityId = response && response.headers && response.headers.activityid;\n }\n const properties = requestCache.get(requestId);\n if (properties) {\n const elapsedTime = StaticTelemetry.stopTimer(requestId);\n const { config, status, request } = response;\n const parsedUrl = url.parse((config && (config.url || config.baseURL)) || '');\n StaticTelemetry.trackDependency({\n duration: elapsedTime,\n method: (properties.m || (request && request.method) || 'unknown').toUpperCase(),\n name: properties.e,\n resultCode: status,\n success: status < 400,\n url: parsedUrl,\n target: parsedUrl.hostname,\n properties: {\n requestId,\n activityId,\n empty: _isEmpty(response.data),\n ...(properties.ahs && { authTokenSize: properties.ahs })\n },\n dependencyName: 'RetailServer'\n });\n }\n\n return response;\n};\n\n/**\n * Captures outgoing calls to retail server\n */\nexport const RSRequestInterceptor = (request: AxiosRequestConfig) => {\n if (!request || !request.headers) {\n return request;\n }\n const requestHeaders = request.headers;\n const caseInsensitiveHeaderMap = toLowerCaseDict(requestHeaders);\n\n // check if it's an outgoing request to retail server\n\n if (caseInsensitiveHeaderMap.oun && request.url) {\n // get the API endpoint\n const parsedUrl = url.parse(request.url, false);\n const apiEndPoint = replaceIdentifiers(parsedUrl.pathname);\n\n // associate with the request-id vector\n const requestIdVector = requestHeaders[caseInsensitiveHeaderMap['request-id']] || '';\n\n const authorizationHeader: string = (requestHeaders[caseInsensitiveHeaderMap['authorization']] || '').toString();\n let authorizationHeaderLength = 0;\n\n if (authorizationHeader && authorizationHeader.toLowerCase().indexOf('bearer') > -1) {\n const authArray = authorizationHeader.split(' ');\n if (authArray.length > 1) {\n authorizationHeaderLength = authArray[1].length;\n }\n }\n\n // associate with the requestid (non-vectored)\n const caseInsensitiveRequestIdHeaderName = caseInsensitiveHeaderMap.requestid || 'requestid';\n const currentRequestId = requestHeaders[caseInsensitiveRequestIdHeaderName] || 'undefined';\n const requestId = RequestVectorizerInstance.next(currentRequestId.toString());\n\n StaticTelemetry.startTimer(requestId);\n\n const properties: IEventRetailServerRequestProperties = {\n // method\n m: request.method!,\n // endpoint\n e: apiEndPoint,\n // request vector\n rv: requestIdVector.toString(),\n // request id\n r: requestId\n };\n\n if (authorizationHeader) {\n // Authorization header size\n properties.ahs = authorizationHeaderLength.toString();\n }\n\n // add to cache\n ttlRequestCache.set(requestId, properties, () => {\n StaticTelemetry.stopTimer(requestId);\n });\n\n request.headers[caseInsensitiveRequestIdHeaderName] = requestId;\n }\n\n return request;\n};\n\nexport const RSRequestInterceptorErrorHandler = (error: AxiosError) => {\n if (error.request) {\n RSRequestInterceptor(error.request);\n }\n\n throw error;\n};\n\nexport const RSResponseInterceptorErrorHandler = (error: AxiosError) => {\n if (error.response) {\n RSResponseInterceptor(error.response);\n } else if (error.config) {\n RSErrorResponseHandler(error.config, DEFAULT_ERROR_STATUS_CODE);\n }\n\n throw error;\n};\nexport const DataBaseType = {\n RequestData: 'RequestData',\n RemoteDependencyData: 'RemoteDependencyData',\n ExceptionData: 'ExceptionData'\n};\n\nexport const copyEventsToSecondaryInstance = (secondaryTelemetryInstance: TelemetryClient) => (envelope, context) => {\n const { data } = envelope;\n if (data.baseType === DataBaseType.RequestData) {\n secondaryTelemetryInstance.trackRequest({\n name: data.baseData.name,\n url: data.baseData.url,\n source: data.baseData.source,\n duration: data.baseData.duration,\n resultCode: data.baseData.duration,\n success: data.baseData.success\n });\n }\n if (data.baseType === DataBaseType.RemoteDependencyData) {\n secondaryTelemetryInstance.trackDependency({\n dependencyTypeName: data.baseData.dependencyTypeName,\n target: data.baseData.target,\n name: data.baseData.name,\n data: data.baseData.data,\n duration: data.baseData.duration,\n resultCode: data.baseData.resultCode,\n success: data.baseData.success\n });\n }\n if (data.baseType === DataBaseType.ExceptionData) {\n secondaryTelemetryInstance.trackException({\n exception: JSON.parse(JSON.stringify(data.baseData)).exceptions[0]\n });\n }\n return true;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport msdyn365Commerce, {\n getFriendlyName,\n getParameterizeFeatureFlagsWithRequestContext,\n IAction,\n IActionContext,\n IParameterizeFeatureFlags,\n parameterize,\n checkVersionForFeature,\n getCatalogIdForSdk\n} from '@msdyn365-commerce/core-internal';\nimport { getCategoriesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CategoriesDataActions.g';\nimport { getByIdAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { Category, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { CategoryLinkInput, IPageTypeContext, ProductLinkInput } from '../hydrator-action-inputs';\n\ntype CategoryWithNeutralizedName = Category & { NeutralizedName?: string };\n/**\n * Computes a root category's SLUG\n *\n * @param rootCategory The category for which you want to determine the slug\n * @param ctx Action context\n */\nexport const getCategorySlug = (\n rootCategory: CategoryWithNeutralizedName,\n categories: CategoryWithNeutralizedName[],\n parameterizeFeatureFlags?: IParameterizeFeatureFlags,\n context?: IActionContext\n): string => {\n let slug: string = parameterize(rootCategory.Name, undefined, parameterizeFeatureFlags, rootCategory.NeutralizedName);\n let currentCategory: Category = rootCategory;\n while (currentCategory.ParentCategory) {\n const parentId = currentCategory.ParentCategory;\n const parentCategory: CategoryWithNeutralizedName | undefined = categories.find((category: Category) => {\n if (category.RecordId) {\n return category.RecordId === parentId;\n }\n return false;\n });\n if (!parentCategory) {\n break;\n }\n\n let parentCategoryWithLocalizedName = parentCategory;\n if (context && isUrlLocalizationEnabled(parameterizeFeatureFlags)) {\n const localName = getFriendlyName(context.requestContext.locale, parentCategory.NameTranslations);\n parentCategoryWithLocalizedName = { ...parentCategory };\n parentCategoryWithLocalizedName.NeutralizedName = parentCategory.Name;\n parentCategoryWithLocalizedName.Name = localName || parentCategoryWithLocalizedName.NeutralizedName;\n }\n\n slug = `${parameterize(\n parentCategoryWithLocalizedName.Name,\n undefined,\n parameterizeFeatureFlags,\n parentCategoryWithLocalizedName.NeutralizedName\n )}/${slug}`;\n currentCategory = parentCategoryWithLocalizedName;\n }\n return slug.length > 0 ? `/${slug}` : '';\n};\n\nconst isUrlLocalizationEnabled = (parameterizeFeatureFlags?: IParameterizeFeatureFlags) => {\n return (\n (msdyn365Commerce.platformSettings && msdyn365Commerce.platformSettings.enableUrlLocalization) ||\n (parameterizeFeatureFlags && parameterizeFeatureFlags.enableUrlLocalization)\n );\n};\n\n/**\n * Returns an object containing information used to by the URL builder to build\n * the formatted product or category URL\n * =\n * @param input Action input\n * @param context Action context\n */\nconst getPageTypeContextById = async (input: ProductLinkInput | CategoryLinkInput, context: IActionContext): Promise => {\n // If product ID exits get the product details for that product\n const pageTypeContext: IPageTypeContext = {};\n if (input instanceof ProductLinkInput && input.productId) {\n try {\n const product: SimpleProduct = await getByIdAsync({ callerContext: context }, input.productId, input.channelId);\n if (!(product && product.Name)) {\n throw new Error(`Unable to retrieve product details for product id: ${input.productId}`);\n }\n pageTypeContext.product = { Name: product.Name || '', RecordId: product.RecordId };\n } catch (err) {\n context.telemetry.error(err);\n throw new Error(`Unable run getById action. Error: ${err}`);\n }\n }\n const catalogFeature = checkVersionForFeature('catalogFeature');\n const catalogid = (catalogFeature && getCatalogIdForSdk(context.requestContext, 0)) || undefined;\n\n // Get the category details for the passed category id\n // @ts-ignore old retail proxy contract does not have catalogid.\n return getCategoriesAsync({ callerContext: context }, input.channelId, catalogid)\n .then((categories: Category[]) => {\n // Find the category by id from the list of returned categories\n const rootCategory: Category | undefined = categories.find((category: Category) => {\n if (category.RecordId) {\n return category.RecordId === input.categoryId;\n }\n return false;\n });\n if (!rootCategory) {\n throw new Error(`Unable to retrieve category details for category id: ${input.categoryId}`);\n }\n const localName = getFriendlyName(context.requestContext.locale, rootCategory.NameTranslations);\n const rootCategoryWithNeutralizedName = { ...rootCategory };\n rootCategoryWithNeutralizedName.NeutralizedName = rootCategory.Name;\n rootCategoryWithNeutralizedName.Name = localName || rootCategoryWithNeutralizedName.NeutralizedName;\n // Compute the found category's slug\n const parameterizeFeatureFlags: IParameterizeFeatureFlags = getParameterizeFeatureFlagsWithRequestContext(\n context.requestContext\n );\n const slug = getCategorySlug(rootCategoryWithNeutralizedName, categories, parameterizeFeatureFlags, context);\n pageTypeContext.category = { Slug: slug, RecordId: rootCategoryWithNeutralizedName.RecordId };\n return Promise.resolve(pageTypeContext);\n })\n .catch(err => {\n // In the event of an error return just the category id\n context.telemetry.error(err);\n throw new Error(`Unable to run getCategories action. Error: ${err}`);\n });\n};\n\nexport const getPageTypeContextByIdAction = createObservableDataAction({\n action: >getPageTypeContextById\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext, IModuleContract } from '@msdyn365-commerce/core-internal';\nimport { PROCESS_TYPE } from '../consts';\nimport { IProductListMetaData, IServerLink } from './hydrator-action-inputs';\nimport { hydrateLink } from './link-hydrator';\nimport { hydrateProductList } from './product-list-hydrator';\n\nconst TYPE_KEY = 'type';\nconst LIST_TYPE_KEY = 'listType';\n\n/**\n * Recusrively traverses a module's config properties to find link/list types to transform\n *\n * @param obj The current object\n * @param context The current action context\n */\nconst searchForComplexType = (\n obj: unknown,\n context: IActionContext,\n moduleId?: string,\n propertyToMapInConfig?: string\n): Promise[] => {\n const promisesArray: Promise[] = [];\n if (!obj) {\n return promisesArray;\n }\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n promisesArray.push(...searchForComplexType(obj[i], context, moduleId, propertyToMapInConfig));\n }\n } else if (typeof obj === 'object' && obj) {\n const children = Object.keys(obj);\n\n // Link scenario ('type' is defined)\n if (obj[TYPE_KEY]) {\n promisesArray.push(hydrateLink(obj, context));\n // ProductList scenario ('list_type') is defined\n } else if (obj[LIST_TYPE_KEY]) {\n promisesArray.push(hydrateProductList(obj, context, moduleId, propertyToMapInConfig));\n } else if (children.length > 0) {\n for (let i = 0; i < children.length; i++) {\n promisesArray.push(...searchForComplexType(obj[children[i]], context, moduleId, children[i]));\n }\n }\n }\n\n return promisesArray;\n};\n\n/**\n * Entry point, processes a page response and looks for link and list types\n * to transform\n *\n * @param pageResponse The inital page response\n * @param context The current action context\n */\nexport const processComplexDataTypes = async (\n lazyloadAllDataActions: boolean,\n processType: string,\n pageSlots: IModuleContract[],\n context: IActionContext\n) => {\n const promisesArray = processComplexDataTypesAsync(lazyloadAllDataActions, processType, pageSlots, context);\n if (promisesArray) {\n await Promise.all(promisesArray);\n }\n};\n\nexport const processComplexDataTypesAsync = (\n lazyLoadAllDataActions: boolean,\n processType: string,\n pageSlots: IModuleContract[],\n context: IActionContext\n) => {\n if (pageSlots && pageSlots.length) {\n const promisesArray: Promise[] = [];\n let lazyLoadAllModuleQueryString; // Query string switch to lazyLoad all modules\n const requestContext = context.requestContext;\n const requestContextFeatures = requestContext.features;\n const clientRenderModules = 'clientRender_modules';\n const clientRenderAllModuleQueryString = 'client_render_all_modules';\n\n // Feature switch for lazyLoading render and data action currently for product collection module\n let lazyLoadModuleFeature = requestContextFeatures[clientRenderModules];\n\n // Query param to lazyLoad all modules\n if (requestContext.query && requestContext.query.clientRenderAllModuleQueryString) {\n lazyLoadAllModuleQueryString = requestContext.query[clientRenderAllModuleQueryString];\n }\n\n // If request is coming from the editor then, turn off all lazyloading feature\n if (requestContext.params && requestContext.params.isEditor && requestContext.params.isEditor === true) {\n lazyLoadModuleFeature = false;\n lazyLoadAllModuleQueryString = 'false';\n lazyLoadAllDataActions = false;\n }\n\n for (let i = 0; i < pageSlots.length; i++) {\n const currModule = pageSlots[i];\n const currModuleConfig = currModule.config;\n let clientRenderConfigSwitch; // Module config switch for lazyLoading render and data action for product collection module\n\n if (typeof currModuleConfig === 'object' && currModuleConfig) {\n lazyLoadAllModuleQueryString === 'true' ? (currModuleConfig[`clientRender`] = true) : clientRenderConfigSwitch;\n if (currModuleConfig.hasOwnProperty('clientRender')) {\n // When the lazyLoading feature switch is false, turn the lazyloading config switch to false\n if (lazyLoadModuleFeature === false) {\n currModuleConfig[`clientRender`] = false;\n }\n clientRenderConfigSwitch = currModuleConfig[`clientRender`];\n }\n }\n\n if ((lazyLoadAllDataActions || clientRenderConfigSwitch) && processType === PROCESS_TYPE.client) {\n // When lazyLoad_all feature switch is true or lazyload Module config switch is true and processComplexDataType call is from client, do hydration\n promisesArray.push(...searchForComplexType(currModuleConfig, context, currModule.id));\n } else if (!lazyLoadAllDataActions && !clientRenderConfigSwitch && processType === PROCESS_TYPE.server) {\n // When lazyLoad_all feature switch is OFF, lazyload Module config switch is OFF and processComplexDataType call is from server, do hydration\n promisesArray.push(...searchForComplexType(currModuleConfig, context, currModule.id));\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n context.runAllActionsInQueue();\n return promisesArray;\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { appendQueryParams, getCatalogIdForSdk, getUrlSync, IActionContext } from '@msdyn365-commerce/core-internal';\nimport { EXCEPTION_LINK_ACTION } from '@msdyn365-commerce/telemetry-internal';\nimport { CategoryLinkInput, IPageTypeContext, IServerLink, ProductLinkInput } from './hydrator-action-inputs';\nimport { getPageTypeContextByIdAction } from './link-actions/page-type-context-by-id';\n\n/**\n * Takes a Link object from the Page Response and uses URL Builder to construct a destination url and transform the\n * existing link structure to expose two porperties type and destinationUrl\n *\n * @param linkObject The current link object being modified\n * @param context The current action context\n */\nexport const hydrateLink = async (linkObject: IServerLink, context: IActionContext) => {\n let destinationUrl: string | undefined;\n let hostname: string | undefined = context?.requestContext?.url?.requestUrl?.hostname;\n const locale = !context.requestContext.features.disable_hydrator_link_locale ? context.requestContext.locale : '';\n // In each switch case if the required information is not present to construct the URL\n // The object will be return unmodified\n switch (linkObject.type) {\n // In the case of internal and external links, no transform is needed\n // If destination url is present set the destination url and break\n case 'internalLink':\n case 'externalLink':\n if (linkObject.destinationUrl) {\n // Append the pass through query parameters\n const queryParams = (context.requestContext && context.requestContext.query) || {};\n const featureContext = context?.requestContext?.features;\n // If add_external_link_domain switch is set to true, we pass hostname as empty string which will add domain qsp to all external and internal link\n hostname = featureContext?.add_external_link_domain ? '' : hostname;\n if (featureContext?.skip_external_link_catalogid) {\n destinationUrl = appendQueryParams(linkObject.destinationUrl, queryParams, hostname, true);\n } else {\n destinationUrl = appendQueryParams(linkObject.destinationUrl, queryParams, hostname);\n }\n\n break;\n }\n return;\n case 'productLink':\n // To build the url for a productLink we need the product and category ids\n if (linkObject.productId && linkObject.categoryId) {\n // Grab the route context using the action\n let routeContext: IPageTypeContext;\n try {\n const catalogId = getCatalogIdForSdk(context.requestContext, 0);\n routeContext = await getPageTypeContextByIdAction(\n new ProductLinkInput(\n context.requestContext.apiSettings,\n linkObject.categoryId,\n linkObject.productId,\n catalogId,\n locale\n ),\n context\n );\n // Create the URL and break\n destinationUrl = getUrlSync('product', context, routeContext);\n } catch (err) {\n context.telemetry.error(EXCEPTION_LINK_ACTION);\n context.telemetry.exception(err);\n linkObject.destinationUrl = '';\n linkObject.error = EXCEPTION_LINK_ACTION;\n return;\n }\n break;\n }\n return;\n case 'categoryLink':\n // To build the url for the categoryLink we need the category id\n if (linkObject.categoryId) {\n // Grab the route context using the action\n let routeContext: IPageTypeContext;\n try {\n routeContext = await getPageTypeContextByIdAction(\n new CategoryLinkInput(context.requestContext.apiSettings, linkObject.categoryId, null, locale),\n context\n );\n // Create the URL and break\n destinationUrl = getUrlSync('category', context, routeContext);\n } catch (err) {\n context.telemetry.error(EXCEPTION_LINK_ACTION);\n context.telemetry.exception(err);\n linkObject.destinationUrl = '';\n linkObject.error = EXCEPTION_LINK_ACTION;\n return;\n }\n break;\n }\n return;\n default:\n // If it is not one of these types or does not contain the information required for the link\n // building do not modify the data\n return;\n }\n\n // Set the computed destinationUrl and delete the other properties\n linkObject.destinationUrl = destinationUrl;\n delete linkObject.categoryId;\n delete linkObject.productId;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICache } from '@msdyn365-commerce/cache-internal';\nimport msdyn365Commerce, {\n IDictionary,\n IFeatureVersions,\n IModule,\n IModuleContract,\n IPageResponse,\n IPlatformSettings,\n IRequestContext,\n IResourceManager,\n isAuthoringEditEnabled,\n isEmptyOrNullObject\n} from '@msdyn365-commerce/core-internal';\nimport { AsyncResult, isAsyncResult } from '@msdyn365-commerce/retail-proxy';\nimport { EXCEPTION_BADPAGECONTEXT, EXCEPTION_INITIALDATAFAIL, ITelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { isObservableArray, toJS, transaction } from 'mobx';\nimport { IModuleBinder } from '../app-initialization/models';\nimport {\n CACHE_SETTING,\n MODULE_ACTION_KEY,\n MODULE_CACHE_KEY,\n MODULE_CONFIG_ERRORS_KEY,\n MODULE_CONFIG_KEY,\n MODULE_DATA_KEY,\n MODULE_DEFERRED_KEY,\n MODULE_RESOURCES_KEY,\n MSDYN365_WYSIWYG_CANADDMODULE,\n MSDYN365_WYSIWYG_DISABLED_PROPS\n} from '../consts';\nimport { getParentModuleName, isModuleEntryPointsEnabled } from '../utils/helpers';\nimport { getWrappedProxyObject } from './authoring-edit-helper';\n\n/**\n * Interface containing module metadata that pageContext holds\n *\n * Any change to this interface should result an accompanying change to the moduleList\n * Fast JSON stringify constructor in base-page-utils.ts\n */\ninterface IModuleMetaData {\n id: string;\n typeName: string;\n dataActions: unknown;\n}\n\ninterface IActionMetaData {\n name: string;\n entity: string;\n inputs: string[];\n}\n\n/**\n * Class to hold the page view model, areas and regions\n */\nexport class PageContext {\n public requestContext: IRequestContext;\n public pageRoot: IModuleContract & { theme: string };\n public requestCache: ICache;\n private _moduleList: IModuleMetaData[] = [];\n private _themeModulesList: string[] = [];\n private _clientPlatformSetting: IPlatformSettings = {};\n private _environmentVariable: IDictionary = {};\n private _versionDependentFeatureInfo: IFeatureVersions = {};\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(pageData: IPageResponse | any, requestContext: IRequestContext, requestCache: ICache, resourceManager?: IResourceManager) {\n if (isEmptyOrNullObject(pageData)) {\n throw new Error(EXCEPTION_BADPAGECONTEXT);\n }\n this.requestContext = requestContext;\n // set c1AccessToken to null so that its not sent down to client\n this.requestContext.user.c1AccessToken = undefined;\n this.requestCache = requestCache;\n this.pageRoot = pageData.pageRoot;\n this._versionDependentFeatureInfo = msdyn365Commerce.getVersionDependentFeatureInfo;\n\n if (typeof window === 'undefined') {\n this._putRequestedModulesInCacheOnServer(pageData, resourceManager);\n }\n\n this._initThemeModulesList();\n this.setEnvironmentVariableForCLient();\n }\n\n public moduleList(): IModule[][] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = this._moduleList.reduce((resultArray: any[], item, index) => {\n const chunkIndex = Math.floor(index / Number(5));\n if (!resultArray[chunkIndex]) {\n resultArray[chunkIndex] = []; // start a new chunk\n }\n resultArray[chunkIndex].push(item);\n\n return resultArray;\n }, []);\n return result;\n }\n\n /**\n * Returns callback function that returns module rendering metadata for a given module asynchronously\n */\n get modules(): (name: string) => IModule {\n return (name: string) => {\n return this._constructModuleMetaData(name);\n };\n }\n\n /**\n * Get all the modules listed in the PageContext from the cache\n */\n\n public async allModules(requestContext: IRequestContext, moduleList: IModule[]): Promise {\n if (requestContext?.features?.loadData_optimization) {\n return moduleList.map(moduleMetaData => {\n return this.modules(moduleMetaData.id);\n });\n } else {\n return this._moduleList.map(moduleMetaData => {\n return this.modules(moduleMetaData.id);\n });\n }\n }\n\n public setAppCacheEntries(appCacheEntries: string[]): void {\n this.requestCache.put({ typeName: CACHE_SETTING, key: 'APP_CACHE_ENTRIES' }, { item: appCacheEntries });\n }\n\n public setPlatformSettingsForClient(platformSettings: IPlatformSettings): void {\n this._clientPlatformSetting.clientSideDataActionTimeoutInMs = platformSettings?.clientSideDataActionTimeoutInMs || undefined;\n this._clientPlatformSetting.shouldUseInstanceCache = !!platformSettings?.clientSideDataActionTimeoutInMs;\n this._clientPlatformSetting.disableActionRegOptimization = true;\n this._clientPlatformSetting.imageFallbackOptimize = platformSettings?.imageFallbackOptimize || false;\n this._clientPlatformSetting.enableModuleEntryPoints = isModuleEntryPointsEnabled(platformSettings);\n this._clientPlatformSetting.enableImageOptimizeEvents = !!platformSettings?.enableImageOptimizeEvents;\n this._clientPlatformSetting.enableModuleCssOptimization = platformSettings?.enableModuleCssOptimization || false;\n this._clientPlatformSetting.clientTimeoutMapInMs = platformSettings?.clientTimeoutMapInMs || {};\n this._clientPlatformSetting.secondaryInstrumentationKey = platformSettings?.secondaryInstrumentationKey;\n /* if (platformSettings?.disableActionRegOptimization === true) {\n this._clientPlatformSetting.disableActionRegOptimization = true;\n }*/\n }\n\n public setEnvironmentVariableForCLient = () => {\n const environment = msdyn365Commerce.getAllEnvironmentVariable();\n this._environmentVariable = environment;\n };\n\n public getPlatformSettingsForClient(): IPlatformSettings {\n return this._clientPlatformSetting;\n }\n\n public getVersionDependentFeatureInfo(): IFeatureVersions {\n return this._versionDependentFeatureInfo;\n }\n\n /**\n * Checkis if the given module is deferred module\n * @param name name of the module\n */\n public deferred(name: string): Boolean {\n return !!this.requestCache.getValue({ typeName: MODULE_DEFERRED_KEY, key: name });\n }\n\n public getResourceTextForPlaceholderPreview(): string {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const resourceItem = this.requestCache.get({ typeName: MODULE_RESOURCES_KEY, key: 'PLACE-HOLDER-FOR-CONTAINER-PREVIEW' });\n if (resourceItem && resourceItem.item && resourceItem.item.clickToConfigure) {\n return resourceItem.item.clickToConfigure;\n } else {\n return 'Click here to configure';\n }\n }\n\n /**\n * Marks module as deferred\n * @param name name of the module\n */\n public markModuleAsDeferred(name: string): void {\n this.requestCache.put(\n { typeName: MODULE_DEFERRED_KEY, key: name },\n {\n item: true\n }\n );\n }\n\n /**\n * Inserts requested modules into cache on client side\n * @param pageData page data object\n * @param telemetry telemetry object\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public async putRequestedModulesInCacheOnClient(pageData: any, telemetry: ITelemetry): Promise {\n if (isEmptyOrNullObject(pageData.requestCache) || isEmptyOrNullObject(pageData.requestCache.internalCache)) {\n throw new Error(EXCEPTION_INITIALDATAFAIL);\n }\n\n for (const cacheType of Object.keys(pageData.requestCache.internalCache)) {\n const cacheBasedOnType = pageData.requestCache.internalCache[cacheType];\n if (!isEmptyOrNullObject(cacheBasedOnType)) {\n for (const cachekey of Object.keys(cacheBasedOnType)) {\n const cacheItem = cacheBasedOnType[cachekey];\n\n if (pageData?.requestContext?.features?.loadData_optimization) {\n setTimeout(() => {\n this._rehydrateAsyncResults(cacheItem, cacheType, cachekey);\n }, 0);\n } else {\n this._rehydrateAsyncResults(cacheItem, cacheType, cachekey);\n }\n\n // Awaiting a rejected promise will throw, so we need to catch those errors.\n try {\n await cacheItem.item;\n } catch (e) {\n telemetry.debug(`Error while hyrdating cache item, Type: ${cacheBasedOnType}, Key: ${cachekey}`);\n }\n\n if (cacheType === MODULE_CACHE_KEY) {\n const moduleItem = cacheItem.item;\n this._moduleList.push({\n id: moduleItem.id,\n typeName: moduleItem.typeName,\n dataActions: moduleItem.dataActions || []\n });\n }\n }\n }\n }\n }\n\n /**\n * Populates data actions results from cache\n * @param cacheObjectType entity type\n * @param cacheKey cache key\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _populateDataActionResultFromCache(cacheObjectType: string, cacheKey: string): any {\n const cachedValueBasedOnInput = this.requestCache.getValue({ typeName: cacheObjectType, key: cacheKey });\n if (!cachedValueBasedOnInput) {\n return;\n }\n\n // Ref resolution for promises needs to be delayed until the value is available\n if (isAsyncResult(cachedValueBasedOnInput)) {\n return transaction(() => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n cachedValueBasedOnInput.then(promiseResult => {\n // Directly set the result because we want a synchronous change\n cachedValueBasedOnInput.result = this._resolveCacheRef(cacheObjectType, promiseResult);\n });\n return cachedValueBasedOnInput;\n });\n }\n\n return this._resolveCacheRef(cacheObjectType, cachedValueBasedOnInput);\n }\n\n /**\n * Resolves cache reference for the given entity type\n * @param cacheObjectType entity type that is cached\n * @param cacheRefInfo cache ref key\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _resolveCacheRef(cacheObjectType: string, cacheRefInfo: object): any {\n if (typeof cacheRefInfo !== 'object' || cacheRefInfo['$ref'] !== true) {\n return cacheRefInfo;\n }\n const result = cacheRefInfo['key']\n .map(key => {\n const value = this.requestCache.getValue({ typeName: cacheObjectType, key });\n if (value) {\n return value;\n }\n })\n .filter(Boolean);\n return result && result.length > 0 ? (cacheRefInfo['isCollection'] ? result : result[0]) : null;\n }\n\n /**\n * Inserts requested modules in cache to prepare the initialData that will be sent to client\n * @param pageData pageData object with list of modules\n * @param resourceManager resourceManager that contains the localized strings\n */\n private _putRequestedModulesInCacheOnServer(pageData: IPageResponse, resourceManager?: IResourceManager): void {\n const isEditor = (this.requestContext.params && this.requestContext.params.isEditor) || false;\n const themeName = this.requestContext.params?.theme;\n for (let i = 0; i < pageData.slots.length; ++i) {\n const moduleInstance = pageData.slots[i];\n const moduleId = moduleInstance.id;\n this._moduleList.push({\n id: moduleInstance.id,\n typeName: moduleInstance.typeName,\n dataActions: moduleInstance.dataActions\n });\n\n this.requestCache.put(\n { typeName: MODULE_CACHE_KEY, key: moduleId },\n {\n item: { id: moduleInstance.id, typeName: moduleInstance.typeName }\n }\n );\n this.requestCache.put({ typeName: MODULE_CONFIG_KEY, key: moduleId }, { item: moduleInstance.config });\n this.requestCache.put({ typeName: MODULE_CONFIG_ERRORS_KEY, key: moduleId }, { item: moduleInstance.configErrors });\n this.requestCache.put({ typeName: MODULE_DATA_KEY, key: moduleId }, { item: moduleInstance.data });\n this.requestCache.put({ typeName: MODULE_ACTION_KEY, key: moduleId }, { item: moduleInstance.dataActions });\n this.requestCache.put({ typeName: MSDYN365_WYSIWYG_DISABLED_PROPS, key: moduleId }, { item: [] });\n this.requestCache.put({ typeName: MSDYN365_WYSIWYG_CANADDMODULE, key: moduleId }, { item: [] });\n\n if (resourceManager && !isEditor) {\n this.requestCache.put(\n { typeName: MODULE_RESOURCES_KEY, key: moduleInstance.typeName },\n { item: resourceManager.getModuleResources(moduleInstance.typeName, themeName, this.requestContext.locale) }\n );\n }\n }\n // In editor mode, put the resources for all modules for the current locale into the cache\n if (isEditor && resourceManager && this.requestContext.features.enableAuthoringRemoveAndAddModule) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const bindings = (msdyn365Commerce).getAllModuleBinder();\n bindings.forEach((moduleBinder: IModuleBinder) => {\n this.requestCache.put(\n { typeName: MODULE_RESOURCES_KEY, key: moduleBinder.name },\n { item: resourceManager.getModuleResources(moduleBinder.name, themeName, this.requestContext.locale) }\n );\n });\n }\n }\n\n /**\n * Initializes theme modules list that need to be loaded on the client\n */\n private _initThemeModulesList(): void {\n this._themeModulesList = [];\n\n if (this.requestContext.params.theme) {\n this._themeModulesList.push(this.requestContext.params.theme);\n this._themeModulesList.push(getParentModuleName(this.requestContext.params.theme));\n }\n }\n\n /**\n * Function which rehydrate Async Results.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _rehydrateAsyncResults(cacheItem: any, cacheType: string, cachekey: string): void {\n // AsyncResults sent from server to client get serialized into basic JS objects,\n // They need to be \"rehydrated\" into actual AsyncResults to enable full functionality\n if (cacheItem.item && cacheItem.item._type && cacheItem.item._type === 'AsyncResult') {\n const metadata = cacheItem.item.metadata || {};\n if (cacheItem.item.status && cacheItem.item.status === 'SUCCESS') {\n cacheItem.item = AsyncResult.resolve(cacheItem.item.result);\n } else {\n cacheItem.item = AsyncResult.reject(cacheItem.item.error || 'Unable to parse data action');\n }\n cacheItem.item.metadata = metadata;\n }\n\n this.requestCache.put({ typeName: cacheType, key: cachekey }, { item: cacheItem.item });\n }\n\n /**\n * Construct module MetaData\n * @param name moduleName\n * @returns\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _constructModuleMetaData(name: string): any {\n const cacheItem = this.requestCache.getValue({ typeName: MODULE_CACHE_KEY, key: name });\n if (!cacheItem) {\n throw new Error(`requested module id [${name}] is not found in module dictionary of pageconfig`);\n }\n\n const data = { ...(this.requestCache.getValue({ typeName: MODULE_DATA_KEY, key: name }) || {}) };\n const actions = this.requestCache.getValue({ typeName: MODULE_ACTION_KEY, key: name });\n const resources = this.requestCache.getValue>({ typeName: MODULE_RESOURCES_KEY, key: cacheItem.typeName });\n\n // toJS method\n if (actions) {\n // ToJS converts observable object to JS object.\n const actionMetaDataList = toJS(actions);\n if (actionMetaDataList) {\n for (const action of actionMetaDataList) {\n if (action.entity && action.inputs) {\n data[action.name] =\n Array.isArray(action.inputs) || isObservableArray(action.inputs)\n ? action.inputs.map((cacheKey: string) => this._populateDataActionResultFromCache(action.entity, cacheKey))\n : this._populateDataActionResultFromCache(action.entity, action.inputs);\n } else {\n data[action.name] = AsyncResult.reject('Action Input Creation Failure');\n }\n }\n }\n }\n\n const config = this.requestCache.getValue>({ typeName: MODULE_CONFIG_KEY, key: name }) || {};\n return {\n ...cacheItem,\n data: data,\n config:\n !(typeof window === 'undefined') && isAuthoringEditEnabled(this.requestContext)\n ? getWrappedProxyObject(config, name, cacheItem.typeName)\n : config,\n configErrors: this.requestCache.getValue({ typeName: MODULE_CONFIG_ERRORS_KEY, key: name }),\n resources: resources || {},\n disabledProperties: this.requestCache.getValue({ typeName: MSDYN365_WYSIWYG_DISABLED_PROPS, key: name }) || [],\n slotsForAddModule: this.requestCache.getValue({ typeName: MSDYN365_WYSIWYG_CANADDMODULE, key: name }) || []\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 msdyn365Commerce, { ISessionStorageContext, ISessionStorageValue } from '@msdyn365-commerce/core-internal';\nimport { CookieContext } from './cookie-utils';\n\n/**\n * Context for session storage handling\n *\n * @export\n * @class CookieContext\n */\nexport class SessionStorageContext implements ISessionStorageContext {\n private _cookieContext: CookieContext;\n\n constructor(_cookieContext: CookieContext) {\n this._cookieContext = _cookieContext;\n }\n\n /**\n * Gets the value stored in the session storage.\n * Returns an empty object if no such value exists.\n *\n * @param {string} key - The key string.\n */\n public getDataFromStorage = (key: string): object => {\n if (key) {\n return this.get(key).value || {};\n }\n return {};\n };\n\n /**\n * Sets a new key pair value in the session storage.\n *\n * @param {string} key - The key string.\n * @param {object} value - The data object.\n */\n public setDataInStorage = (key: string, value: object): void => {\n if (key && value) {\n this.set(key, value);\n }\n };\n\n /**\n * Gets the checkout cart stored in the session storage.\n * Returns an empty object if no such value exists.\n *\n * @param {string} key - The key string.\n */\n public getCheckoutCartData = (key: string): object => {\n if (key) {\n return key ? this.getDataFromStorage(this.getCheckoutCartKey(key)) : {};\n }\n return {};\n };\n\n /**\n * Sets checkout cart value in the session storage.\n *\n * @param {string} key - The key string.\n * @param {object} value - The cart data object.\n */\n public setCheckoutCartData = (key: string, value: object): void => {\n if (key && value) {\n this.setDataInStorage(this.getCheckoutCartKey(key), value);\n }\n };\n\n /**\n * Remove session storage by giving key\n *\n * @param {string} key - The key string.\n */\n public removeDataFromStorage = (key: string): void => {\n if (key) {\n this.remove(key);\n }\n };\n\n /**\n * Remove checkout cart data from the session storage by giving key\n *\n * @param {string} key - The key string. If key is not provided clear all data from session storage that contais the checkout cart key prefix.\n */\n public removeCheckoutCartData = (key?: string): void => {\n if (key) {\n this.removeDataFromStorage(this.getCheckoutCartKey(key));\n } else {\n const keyList = Object.keys(sessionStorage);\n keyList.map(k => {\n if (k.startsWith(`${msdyn365Commerce.checkoutCartKeyPrefix}-`)) {\n this.removeDataFromStorage(k);\n }\n });\n }\n };\n\n /**\n * Get session storage value.\n * If server side, no-op.\n *\n * @param {string} key - The key string\n * @return {ISessionStorageValue} value with status\n */\n private get = (key: string): ISessionStorageValue => {\n if (key && msdyn365Commerce.isBrowser) {\n const objString = sessionStorage.getItem(key);\n if (objString) {\n const obj = JSON.parse(objString);\n return { name: key, value: obj, status: obj ? 'FOUND' : 'NOT_FOUND' };\n }\n }\n return { name: key, value: undefined, status: 'NOT_FOUND' };\n };\n\n /**\n * Set session storage data.\n * If server side, no-op.\n *\n * @param {string} key - The key string\n * @param {T} value - The session storage value\n */\n private set = (key: string, value: T): void => {\n if (key && msdyn365Commerce.isBrowser) {\n sessionStorage.setItem(key, JSON.stringify(value));\n }\n };\n\n /**\n * Remove session storage data by giving key\n * If server side, no-op.\n *\n * @param {string} key - The key string\n */\n private remove = (key: string): void => {\n if (key && msdyn365Commerce.isBrowser) {\n sessionStorage.removeItem(key);\n }\n };\n\n /**\n * Build the checkout cart key for the session storage\n */\n private getCheckoutCartKey = (key: string): string => {\n const checkoutCartCookie = this._cookieContext.getCheckoutCartCookie();\n if (checkoutCartCookie) {\n return `${msdyn365Commerce.checkoutCartKeyPrefix}-${checkoutCartCookie}-${key}`;\n }\n return '';\n };\n}\n","import * as cookie from 'cookie';\r\nexport function hasDocumentCookie() {\r\n // Can we get/set cookies on document.cookie?\r\n return typeof document === 'object' && typeof document.cookie === 'string';\r\n}\r\nexport function cleanCookies() {\r\n document.cookie.split(';').forEach(function (c) {\r\n document.cookie = c\r\n .replace(/^ +/, '')\r\n .replace(/=.*/, '=;expires=' + new Date().toUTCString() + ';path=/');\r\n });\r\n}\r\nexport function parseCookies(cookies, options) {\r\n if (typeof cookies === 'string') {\r\n return cookie.parse(cookies, options);\r\n }\r\n else if (typeof cookies === 'object' && cookies !== null) {\r\n return cookies;\r\n }\r\n else {\r\n return {};\r\n }\r\n}\r\nexport function isParsingCookie(value, doNotParse) {\r\n if (typeof doNotParse === 'undefined') {\r\n // We guess if the cookie start with { or [, it has been serialized\r\n doNotParse =\r\n !value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '\"');\r\n }\r\n return !doNotParse;\r\n}\r\nexport function readCookie(value, options) {\r\n if (options === void 0) { options = {}; }\r\n var cleanValue = cleanupCookieValue(value);\r\n if (isParsingCookie(cleanValue, options.doNotParse)) {\r\n try {\r\n return JSON.parse(cleanValue);\r\n }\r\n catch (e) {\r\n // At least we tried\r\n }\r\n }\r\n // Ignore clean value if we failed the deserialization\r\n // It is not relevant anymore to trim those values\r\n return value;\r\n}\r\nfunction cleanupCookieValue(value) {\r\n // express prepend j: before serializing a cookie\r\n if (value && value[0] === 'j' && value[1] === ':') {\r\n return value.substr(2);\r\n }\r\n return value;\r\n}\r\n","var __assign = (this && this.__assign) || function () {\r\n __assign = Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\nimport * as cookie from 'cookie';\r\nimport { hasDocumentCookie, parseCookies, readCookie } from './utils';\r\nvar Cookies = /** @class */ (function () {\r\n function Cookies(cookies, options) {\r\n var _this = this;\r\n this.changeListeners = [];\r\n this.HAS_DOCUMENT_COOKIE = false;\r\n this.cookies = parseCookies(cookies, options);\r\n new Promise(function () {\r\n _this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();\r\n }).catch(function () { });\r\n }\r\n Cookies.prototype._updateBrowserValues = function (parseOptions) {\r\n if (!this.HAS_DOCUMENT_COOKIE) {\r\n return;\r\n }\r\n this.cookies = cookie.parse(document.cookie, parseOptions);\r\n };\r\n Cookies.prototype._emitChange = function (params) {\r\n for (var i = 0; i < this.changeListeners.length; ++i) {\r\n this.changeListeners[i](params);\r\n }\r\n };\r\n Cookies.prototype.get = function (name, options, parseOptions) {\r\n if (options === void 0) { options = {}; }\r\n this._updateBrowserValues(parseOptions);\r\n return readCookie(this.cookies[name], options);\r\n };\r\n Cookies.prototype.getAll = function (options, parseOptions) {\r\n if (options === void 0) { options = {}; }\r\n this._updateBrowserValues(parseOptions);\r\n var result = {};\r\n for (var name_1 in this.cookies) {\r\n result[name_1] = readCookie(this.cookies[name_1], options);\r\n }\r\n return result;\r\n };\r\n Cookies.prototype.set = function (name, value, options) {\r\n var _a;\r\n if (typeof value === 'object') {\r\n value = JSON.stringify(value);\r\n }\r\n this.cookies = __assign(__assign({}, this.cookies), (_a = {}, _a[name] = value, _a));\r\n if (this.HAS_DOCUMENT_COOKIE) {\r\n document.cookie = cookie.serialize(name, value, options);\r\n }\r\n this._emitChange({ name: name, value: value, options: options });\r\n };\r\n Cookies.prototype.remove = function (name, options) {\r\n var finalOptions = (options = __assign(__assign({}, options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));\r\n this.cookies = __assign({}, this.cookies);\r\n delete this.cookies[name];\r\n if (this.HAS_DOCUMENT_COOKIE) {\r\n document.cookie = cookie.serialize(name, '', finalOptions);\r\n }\r\n this._emitChange({ name: name, value: undefined, options: options });\r\n };\r\n Cookies.prototype.addChangeListener = function (callback) {\r\n this.changeListeners.push(callback);\r\n };\r\n Cookies.prototype.removeChangeListener = function (callback) {\r\n var idx = this.changeListeners.indexOf(callback);\r\n if (idx >= 0) {\r\n this.changeListeners.splice(idx, 1);\r\n }\r\n };\r\n return Cookies;\r\n}());\r\nexport default Cookies;\r\n","import Cookies from './Cookies';\r\nexport default Cookies;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, { ICookieContext, ICookieContextOptions, ICookieValue } from '@msdyn365-commerce/core-internal';\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\nimport Cookies, { CookieSetOptions } from 'universal-cookie';\nimport { USER_CONSENT_GIVEN_EVENT } from '../consts';\n\nexport interface ICookieSetOptions extends CookieSetOptions {\n isEssential?: boolean;\n}\n\nexport const enum CartTokenPrefix {\n Auth = 't',\n Anon = 'p'\n}\n\nexport const enum AccountSelectionTokenPrefix {\n Auth = 't',\n Anon = 'p'\n}\n\nconst UserConsentCookieName: string = '_msdyn365___ucc_';\n\n/**\n * Context for cookie handling\n *\n * @export\n * @class CookieContext\n */\nexport class CookieContext implements ICookieContext {\n private _cookies: Cookies;\n private _setCookieList: (() => void)[] = [];\n private _serverCookieList: string[] = [];\n private _clientCookieList: string[] = [];\n private _options: ICookieContextOptions;\n\n /**\n * Returns a cookies class from the selected cookie store. If the express server\n * is passed the cookie header will be used otherwise the global cookie store will be used.\n * @param options Optional ICookieContextOptions.\n */\n constructor(options?: ICookieContextOptions, cookieString?: string) {\n this._options = { isConsentRequired: true, ...options };\n if (cookieString) {\n this._cookies = new Cookies(cookieString);\n } else if (msdyn365Commerce.isBrowser) {\n this._cookies = new Cookies(document && document.cookie);\n } else {\n this._cookies = new Cookies(\n this._options.req &&\n this._options.req.headers &&\n (this._options.req.headers['x-msdyn365-cookie'] || this._options.req.headers.cookie)\n );\n }\n }\n\n /**\n * Get Cookie Value\n *\n * @param {string} cookieName - A string cookie name\n * @return {ICookieValue} cookie value with status\n */\n public get = (cookieName: string, isEssential?: boolean): ICookieValue => {\n if (isEssential || this.isConsentGiven()) {\n const cookieValue = this._cookies.get(cookieName);\n return { name: cookieName, value: cookieValue, status: cookieValue ? 'FOUND' : 'NOT_FOUND' };\n }\n\n return { name: cookieName, value: undefined, status: 'NO_CONSENT' };\n };\n\n /**\n * Set Cookie\n *\n * @param {string} cookieName - A string cookie name\n * @param {T} cookieValue - A cookie value\n * @param {ICookieSetOptions} options cookie options same as document.cookie\n */\n public set = (cookieName: string, cookieValue: T, options?: ICookieSetOptions): void => {\n const sameSiteRequiredFlag = this._options.sameSiteRequired;\n let cookieOptionsWithDefaults: ICookieSetOptions;\n\n cookieOptionsWithDefaults = { path: '/', secure: true, isEssential: false };\n\n if (sameSiteRequiredFlag === true) {\n cookieOptionsWithDefaults = { path: '/', secure: true, isEssential: false, sameSite: 'none', ...options };\n } else {\n if (options) {\n const filteredOptions: ICookieSetOptions = {};\n for (const [key, value] of Object.entries(options)) {\n if (key.toLowerCase() !== 'samesite') {\n filteredOptions[key] = value;\n }\n }\n cookieOptionsWithDefaults = { path: '/', secure: true, isEssential: false, ...filteredOptions };\n }\n }\n\n if (cookieOptionsWithDefaults.isEssential || this.isConsentGiven()) {\n // Set the cookie if client side\n if (msdyn365Commerce.isBrowser) {\n this._cookies.set(cookieName, cookieValue, cookieOptionsWithDefaults);\n const clientCookieString = this.createCookieString(cookieName, cookieValue, cookieOptionsWithDefaults);\n this._clientCookieList.push(clientCookieString);\n return;\n }\n // If server side, convert the cookie into a header string and push it onto an array\n const serverCookieString = this.createCookieString(cookieName, cookieValue, cookieOptionsWithDefaults);\n this._serverCookieList.push(serverCookieString);\n } else {\n this._setCookieList.push(() => {\n this._cookies.set(cookieName, cookieValue, cookieOptionsWithDefaults);\n });\n }\n };\n\n /**\n * Gets the value stored in the cart cookie that contains the\n * cart context and information. Returns an empty string if no such value exists.\n *\n */\n public getCartCookie = (): string => {\n return this.get(msdyn365Commerce.CartCookie, true).value || '';\n };\n\n public getTargetIdCookie = (): string => {\n return this.get('_msdyn365___tuid_', true).value || '';\n };\n\n /**\n * Sets the cart cookie with a new expiry time time of one year\n * from the current date\n *\n * @param cart The object containing the current cart information\n * @param isAuthenticated Boolean representing whether current user is authenticated or not\n * @param setAlways Boolean representing if the cookie should be set regardless of whether the cookie exists or not\n */\n public setCartCookie = (cart: Cart, isAuthenticated: boolean, setAlways: boolean = false): void => {\n const prefix = isAuthenticated ? CartTokenPrefix.Auth : CartTokenPrefix.Anon;\n const cartCookieOptions: ICookieSetOptions = { isEssential: true, secure: true, sameSite: 'none' };\n const cookieValue = `${prefix}:${cart.Id}`;\n const existingCart = this.getCartCookie();\n\n // Unless explicity overridden using setAlways flag, do not set the cookie if the cookie value is the same as existing cookie value\n if (!setAlways && existingCart === cookieValue) {\n return;\n }\n\n if (this._options.cartExpirationInDays) {\n // 86400000 is 1 day in ms\n cartCookieOptions.expires = new Date(Date.now() + this._options.cartExpirationInDays * 86400000);\n }\n this.set(msdyn365Commerce.CartCookie, cookieValue, cartCookieOptions);\n };\n\n /**\n * Gets the value stored in the checkout cart cookie that contains the\n * checkout cart context and information. Returns an empty string if no such value exists.\n */\n public getCheckoutCartCookie = (): string => {\n return this.get(msdyn365Commerce.checkoutCartCookie, true).value || '';\n };\n\n /**\n * Sets the checkout cart cookie with a new expiry time time of one year\n * from the current date\n *\n * @param cart The object containing the current checkout cart information\n * @param isAuthenticated Boolean representing whether current user is authenticated or not\n * @param setAlways Boolean representing if the cookie should be set regardless of whether the cookie exists or not\n */\n public setCheckoutCartCookie = (cart: Cart, isAuthenticated: boolean, setAlways: boolean = false): void => {\n const prefix = isAuthenticated ? CartTokenPrefix.Auth : CartTokenPrefix.Anon;\n const checkoutCartCookieOptions: ICookieSetOptions = { isEssential: true, secure: true, sameSite: 'none' };\n const cookieValue = `${prefix}:${cart.Id}`;\n const existingCookie = this.getCheckoutCartCookie();\n\n // Unless explicity overridden using setAlways flag, do not set the cookie if the cookie value is the same as existing cookie value\n if (!setAlways && existingCookie === cookieValue) {\n return;\n }\n\n if (this._options.cartExpirationInDays) {\n // 86400000 is 1 day in ms\n checkoutCartCookieOptions.expires = new Date(Date.now() + this._options.cartExpirationInDays * 86400000);\n }\n this.set(msdyn365Commerce.checkoutCartCookie, cookieValue, checkoutCartCookieOptions);\n };\n\n /**\n * Remove checkout cart cookie.\n */\n public removeCheckoutCartCookie = (): void => {\n this.remove(msdyn365Commerce.checkoutCartCookie);\n };\n\n /**\n * Gets the value stored in the account selection cookie that contains the\n * account selection context and information. Returns an empty string if no such value exists.\n */\n public getAccountSelectionCookie = (): string => {\n return this.get(msdyn365Commerce.accountSelectionCookie, true).value || '';\n };\n\n /**\n *\n * @param isOBORequest Boolean representing whether if current user is on behalf of or not.\n * @param customerAccountNumber customer account number.\n * @param setAlways Boolean representing if the cookie should be set regardless of whether the cookie exists or not\n */\n public setAccountSelectionCookie = (isOBORequest: boolean, customerAccountNumber: string, setAlways: boolean = false): void => {\n const prefix = isOBORequest ? AccountSelectionTokenPrefix.Auth : AccountSelectionTokenPrefix.Anon;\n const accountSelectionCookieOptions: ICookieSetOptions = { isEssential: false, secure: true, sameSite: 'none' };\n const cookieValue = `${prefix}:${customerAccountNumber}`;\n const existingCookie = this.getAccountSelectionCookie();\n\n // Unless explicity overridden using setAlways flag, do not set the cookie if the cookie value is the same as existing cookie value\n if (!setAlways && existingCookie === cookieValue) {\n return;\n }\n this.set(msdyn365Commerce.accountSelectionCookie, cookieValue, accountSelectionCookieOptions);\n };\n\n /**\n * Remove account selection cookie.\n */\n public removeAccountSelectionCookie = (): void => {\n this.remove(msdyn365Commerce.accountSelectionCookie);\n };\n\n /**\n * Remove cookie\n *\n */\n public remove = (cookieName: string): void => {\n return this._cookies.remove(cookieName, { path: '/' });\n };\n\n /**\n * Get whether consent is given or not\n *\n */\n public isConsentGiven = (): boolean => {\n return this._options.isConsentRequired ? !!this._cookies.get(UserConsentCookieName) : true;\n };\n\n /**\n * Set consent cookie\n *\n */\n public setConsentCookie = (): void => {\n const sameSiteRequiredFlag = this._options.sameSiteRequired;\n const cookieOptionsWithDefaults: ICookieSetOptions = { path: '/', maxAge: 31536000, secure: true };\n\n if (sameSiteRequiredFlag) {\n cookieOptionsWithDefaults.sameSite = 'none';\n }\n\n this._cookies.set(UserConsentCookieName, Date.now(), cookieOptionsWithDefaults);\n const clientCookieString = this.createCookieString(UserConsentCookieName, 'now', cookieOptionsWithDefaults);\n this._clientCookieList.push(clientCookieString);\n\n this._setCookieList.forEach(setCookieFunction => setCookieFunction());\n if (process.env.CURRENT_ENVIRONMENT === 'web') {\n document.dispatchEvent(new Event(USER_CONSENT_GIVEN_EVENT));\n }\n };\n\n /**\n * Remove consent cookie\n *\n */\n public deleteConsentCookie = (): void => {\n return this._cookies.remove(UserConsentCookieName);\n };\n\n /**\n * Returns the list of server side cookies to set\n * only if currently executing server side\n */\n get serverCookies(): string[] {\n return msdyn365Commerce.isBrowser ? [] : Object.assign([], this._serverCookieList);\n }\n\n /**\n * Returns the list of client side cookies to set\n */\n get clientCookie(): string[] {\n return msdyn365Commerce.isBrowser ? Object.assign([], this._clientCookieList) : [];\n }\n\n private createCookieString = (cookieName: string, cookieValue: T, cookieOptionsWithDefaults: ICookieSetOptions): string => {\n let cookieString = `${cookieName}=${cookieValue}`;\n if (cookieOptionsWithDefaults) {\n const optionsString = this._appendCookieOptions(cookieOptionsWithDefaults);\n if (optionsString) {\n cookieString = `${cookieString}; ${optionsString}`;\n }\n }\n return cookieString;\n };\n\n private _appendCookieOptions = (options: ICookieSetOptions): string => {\n const cookieOptions: string[] = [];\n if (options.path) {\n cookieOptions.push(`Path=${options.path}`);\n }\n if (options.expires) {\n cookieOptions.push(`Expires=${options.expires}`);\n }\n if (options.maxAge) {\n cookieOptions.push(`Max-Age=${options.maxAge}`);\n }\n if (options.domain) {\n cookieOptions.push(`Domain=${options.domain}`);\n }\n if (options.secure) {\n cookieOptions.push(`Secure`);\n }\n if (options.httpOnly) {\n cookieOptions.push(`HttpOnly`);\n }\n if (options.sameSite) {\n cookieOptions.push(`SameSite=${options.sameSite}`);\n }\n return cookieOptions.length !== 0 ? cookieOptions.join('; ') : '';\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport axios from 'axios';\nimport { IRequestContext, msdyn365Commerce, IRequestContextForSegment } from '@msdyn365-commerce/core-internal';\nimport { IInternalTelemetry, LogLevel } from '@msdyn365-commerce/telemetry-internal';\n\ninterface ISegmentProvider {\n providerId: string;\n segmentIds: string[];\n}\n\nconst REQUEST_CONTEXT_PROPERTIES_FOR_SEG = ['clientIPAddress', 'cookieString', 'cookie', 'query', 'params', 'apiSettings', 'features'];\n\nexport const resolveMissingSegmentsOnClient = (requestContext: IRequestContext, userId: string, telemetry: IInternalTelemetry) => {\n if (!requestContext || !requestContext.missingSegments || requestContext.missingSegments.length) {\n return;\n }\n let domain = requestContext.canonicalDomain || '';\n if (msdyn365Commerce.isBrowser) {\n domain = window.location.hostname;\n }\n const missingSegments: ISegmentProvider[] = [];\n const neededMissingSegments = requestContext.missingSegments;\n Object.keys(neededMissingSegments).forEach((providerId: string) => {\n const segmentProvider: ISegmentProvider = {\n providerId: providerId,\n segmentIds: neededMissingSegments[providerId]\n };\n missingSegments.push(segmentProvider);\n });\n // if there is no misisng segments. return.\n if (missingSegments.length === 0) {\n return;\n }\n // add cookie string. So we are able to re-construct cookie obj when oneRf call Node to resolve segments.\n requestContext.cookieString = (document && document.cookie) || '';\n const segmentRequestId = requestContext.segmentRequestId;\n const missingSegmentResolvingUrl = `https://${domain}/_msdyn365/getsegment`;\n\n // only maintain selected properties of requestContext.\n const segRequestContext: IRequestContextForSegment = {};\n REQUEST_CONTEXT_PROPERTIES_FOR_SEG.forEach((property: string) => {\n if (property in requestContext && !!requestContext[property]) {\n segRequestContext[property] = requestContext[property];\n }\n });\n\n const requestContextObject = requestContext?.features?.disable_segment_requestContext ? requestContext : segRequestContext;\n\n axios({\n method: 'post',\n url: missingSegmentResolvingUrl,\n data: {\n segmentProviderList: missingSegments,\n userId: userId,\n requestContext: requestContextObject,\n ...(segmentRequestId && { segmentRequestId: segmentRequestId })\n }\n })\n // after post request, oneRf will process the request. Node will not receive any response.\n .then()\n .catch(err => telemetry.log(LogLevel.Error, `Error in resolving segments from AJAX call for ${domain}`, { exception: err }));\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ActionContext, CLIENT_HYDRATE_KEY, CLIENT_HYDRATE_TYPE } from '@msdyn365-commerce/action-internal';\nimport { RequestCache, ICacheKey, ICache } from '@msdyn365-commerce/cache-internal';\nimport {\n CoreContext,\n CultureInfoFormatter,\n IActionContext,\n IAny,\n ICoreContext,\n IDictionary,\n IGeneric,\n IModule,\n IModuleContract,\n IMSDyn365Window,\n IPartnerThemeSettings,\n IRequestContext,\n IRequestContextUrl,\n IVariants,\n msdyn365Commerce\n} from '@msdyn365-commerce/core-internal';\nimport {\n ClientAppInsightsJSLogger,\n LoggerType,\n EVENT_CLIENT_RENDER_START,\n EVENT_CLIENT_RENDER_STOP,\n CONTENT_SECURITY_POLICY_ERROR,\n EVENT_WEB_VITALS_CLS,\n EVENT_WEB_VITALS_FCP,\n EVENT_WEB_VITALS_FID,\n EVENT_WEB_VITALS_INP,\n EVENT_WEB_VITALS_LCP,\n EVENT_WEB_VITALS_TTFB,\n EXCEPTION_CLIENT_CACHE_HYDRATE,\n EXCEPTION_LOAD_DATA_EXCEPTION,\n EXCEPTION_PRODUCT_LIST_CLIENTSIDE_HYDRATION,\n expAttributeRenderer,\n GenericConsoleLogger,\n IEventClientRenderMetrics,\n IEventClientRenderProperties,\n IEventClientWebVitalsCLSMetrics,\n IEventId,\n IEventTime,\n ITelemetry,\n LogLevel,\n MESSAGE_CLIENT_RENDER_ERROR,\n StaticTelemetry,\n Telemetry,\n TelemetryEvent,\n InternalTelemetry,\n TSuccessNumber\n} from '@msdyn365-commerce/telemetry-internal';\nimport axios from 'axios';\nimport 'lazysizes';\nimport 'lazysizes/plugins/attrchange/ls.attrchange';\n// eslint-disable-next-line import/no-unassigned-import\nimport 'lazysizes/plugins/bgset/ls.bgset';\nimport { partition as _partition } from 'lodash';\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { onCLS, onFCP, onFID, onLCP, onINP, onTTFB } from 'web-vitals';\nimport {\n RSRequestInterceptor,\n RSRequestInterceptorErrorHandler,\n RSResponseInterceptor,\n RSResponseInterceptorErrorHandler\n} from '../_server/inteceptors/rs-logging-interceptor';\nimport SafeRenderModule from '../components/safe-render-module';\nimport {\n CLIENT_RENDER_COMPLETE_EVENT,\n CLIENT_RENDER_START_EVENT,\n DEPRECATED_CLIENT_RENDER_COMPLETE_EVENT,\n LAYOUT_MOUNT_POINT,\n PROCESS_TYPE,\n MODULE_CONFIG_KEY,\n CLIENT_ENTRY_POINTS_TYPE\n} from '../consts';\nimport { loadData } from '../data/load-data';\nimport { processComplexDataTypes } from '../hydrators/process-page-response';\nimport { IDisabledProperties } from '../store/authoring-edit-helper';\nimport { PageContext } from '../store/page-context';\nimport {\n getCurrencyCodeFromContext,\n isLazyRenderModuleEnabled,\n optimizedGetAllModules,\n shouldOptimizeHydrate,\n timeSliceLongJSTask\n} from '../utils/helpers';\nimport { SessionStorageContext } from '../utils/session-storage-utils';\nimport { CookieContext } from './../utils/cookie-utils';\nimport { resolveMissingSegmentsOnClient } from './../utils/resolve-segments-utils';\n\ntype windowinitialData = IGeneric;\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n interface ClientWindow extends IMSDyn365Window {\n ___initialData___: windowinitialData;\n cache: RequestCache;\n }\n}\n\ndeclare let window: ClientWindow;\n\naxios.interceptors.request.use(RSRequestInterceptor, RSRequestInterceptorErrorHandler);\naxios.interceptors.response.use(RSResponseInterceptor, RSResponseInterceptorErrorHandler);\n\nconst CLIENT_HYDRATE_CACHE_KEY: ICacheKey = {\n key: CLIENT_HYDRATE_KEY,\n typeName: CLIENT_HYDRATE_TYPE\n};\n\nexport const getRequestContext = (storeData: windowinitialData): IRequestContext => {\n const requestContext: IRequestContext = storeData.requestContext;\n\n // See if cookie compliance is disabled at the site level\n const disableCookieCompliance =\n (requestContext.app && requestContext.app.platform && requestContext.app.platform.disableCookieCompliance) || false;\n const cartSessionExpiration =\n (requestContext.app && requestContext.app.platform && requestContext.app.platform.cartSessionExpiration) || 0;\n const cookies = new CookieContext({\n isConsentRequired: !disableCookieCompliance,\n cartExpirationInDays: cartSessionExpiration,\n sameSiteRequired: requestContext.sameSiteRequired\n });\n\n try {\n // merge the query params from url back to request context in case if the page response is cached\n const urlSearchParams = new URLSearchParams(window.location.search);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const entries = Object.fromEntries((urlSearchParams as any).entries());\n Object.keys(entries || {}).map(param => {\n if (requestContext.query && !requestContext.query[param]) {\n requestContext.query[param] = entries[param] || '';\n }\n });\n } catch (e) {\n console.error('merging query parameters from url failed');\n }\n\n if (requestContext.telemetrySettings && storeData['_clientPlatformSetting']) {\n requestContext.telemetrySettings.operationalInsightsInstrumentationKey =\n storeData['_clientPlatformSetting'].secondaryInstrumentationKey;\n }\n requestContext.cookies = cookies;\n requestContext.sessionStorage = new SessionStorageContext(cookies);\n requestContext.headers = Object.freeze({});\n requestContext.url.requestUrl =\n typeof requestContext.url.requestUrl === 'string' ? new URL(requestContext.url.requestUrl) : requestContext.url.requestUrl;\n return requestContext;\n};\n\nconst setClientHydrateContext = (requestCache: ICache) => {\n requestCache.put(CLIENT_HYDRATE_CACHE_KEY, { item: true });\n};\n\nconst resetClientHydrateContext = (requestCache: ICache) => {\n requestCache.del(CLIENT_HYDRATE_CACHE_KEY);\n};\n\nconst getPathName = (requestContextUrl: IRequestContextUrl): string => {\n if (requestContextUrl && requestContextUrl.requestUrl && requestContextUrl.requestUrl.pathname) {\n return requestContextUrl.requestUrl.pathname;\n }\n return '';\n};\n\nconst isPaymentVerification = (requestContext: IRequestContext): boolean => {\n return requestContext.query?.pv === '1';\n};\n\nconst isCheckoutRoute = (requestContext: IRequestContext): boolean => {\n return (\n requestContext.app &&\n requestContext.app.routes &&\n requestContext.app.routes.checkout &&\n requestContext.app.routes.checkout.destinationUrl &&\n getPathName(requestContext.url) === requestContext.app.routes.checkout.destinationUrl\n );\n};\n\nconst activateExperiments = (requestContext: IRequestContext): void => {\n // Activate experiment if an experimentation connector has been registered and active experiments are provided\n // In a preview scenario, OneRF will not send a user ID and which we will not active the experiment\n if (\n msdyn365Commerce.experimentationConnector &&\n requestContext.features.experimentation &&\n requestContext.experiments &&\n requestContext.experiments.userId &&\n requestContext.experiments.activeExperiments &&\n requestContext.experiments.activeExperiments.length > 0\n ) {\n const experimentInfo = requestContext.experiments;\n // Split the experiment list into two lists, one whose experiments are coupled with a module and one whose experiments are not\n const [experimentsWithoutModuleId, experimentsWithModuleId] = _partition(experimentInfo.activeExperiments, (value: IVariants) => {\n return !value.moduleId;\n });\n // Activate experiments not tied to a module id\n msdyn365Commerce.experimentationConnector.provider.activateExperiment(experimentInfo.userId, experimentsWithoutModuleId, {\n Type: requestContext.device.Type\n });\n\n // Activate experiments once 30% of the module is visible\n const options: IntersectionObserverInit = {\n threshold: 0.3\n };\n const experimentMap: IDictionary = {};\n const experimentObserver = new IntersectionObserver((entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {\n entries.forEach((entry: IntersectionObserverEntry) => {\n if (entry.isIntersecting && entry.intersectionRatio >= 0.3) {\n const activatedExpId = entry.target.getAttribute(`data-exp`);\n if (activatedExpId) {\n // Find the experiment/variant combo associated with the experiment to activate\n msdyn365Commerce.experimentationConnector?.provider.activateExperiment(\n experimentInfo.userId,\n [experimentMap[activatedExpId]],\n {\n Type: requestContext.device.Type\n }\n );\n }\n // Once we the element has come into the view for the first time, we can stop observing it\n observer.unobserve(entry.target);\n }\n });\n }, options);\n for (let i = 0; i < experimentsWithModuleId.length; i++) {\n const currentExperiment = experimentsWithModuleId[i];\n const target = document.querySelector(`[data-exp=\"id:${currentExperiment.experimentId}\"]`);\n if (target) {\n experimentMap[`id:${currentExperiment.experimentId}`] = currentExperiment;\n experimentObserver.observe(target);\n }\n }\n }\n};\n\n/**\n * Method to hydrate the markup returned by server on the client.\n * @param requestContext request context object\n * @param pageContext page context object\n * @param coreContext core context object\n */\nconst hydrateClient = (requestContext: IRequestContext, pageContext: PageContext, coreContext: ICoreContext) => {\n const pageRoot = pageContext.pageRoot;\n const body = pageRoot.modules && pageRoot.modules.body;\n const props = body && body.length > 0 ? body[0] : pageRoot;\n const defaultPageConfig =\n (!!!requestContext?.features?.disable_moduleConfig_optimize &&\n pageContext.requestCache.getValue({ typeName: MODULE_CONFIG_KEY, key: props.id })) ||\n props.config;\n try {\n ReactDOM.hydrate(\n \n \n ,\n document.getElementById(LAYOUT_MOUNT_POINT)\n );\n } catch (err) {\n // If in dev mode or debug mode, throw the error so it's visible on the page.\n if ((process.env.NODE_ENV === 'development' || requestContext.params.isDebug) && !requestContext.params.isEditor) {\n throw err;\n // In editor mode, catch the error but don't throw so that the page doesn't freeze up\n } else if (requestContext.params.isEditor) {\n console.log(`Error running editor (client) render: ${err}`);\n }\n }\n};\n\n/**\n * Method to initialize authoring helper and register event to receive list of disabled properties when rendered in the context of site builder\n * @param requestContext request context object\n * @param pageContext page context object\n * @param coreContext core context object\n * @param actionContext action context object\n * @param moduleTelemetry module telemetry object\n */\nconst initAuthoringHelper = (\n requestContext: IRequestContext,\n pageContext: PageContext,\n coreContext: ICoreContext,\n actionContext: IActionContext,\n moduleTelemetry\n) => {\n const themeSettings: IPartnerThemeSettings = window.___initialData___.themeSettings ? window.___initialData___.themeSettings : {};\n\n return import('../utils/authoring-tools-helper').then(m => {\n const AuthoringToolsHelper = m.AuthoringToolsHelper;\n const authoringHelper = new AuthoringToolsHelper(actionContext, themeSettings, coreContext, pageContext, moduleTelemetry);\n window._msdyn365.authoringHelper = authoringHelper;\n\n const _msdyn365Data = window._msdyn365;\n _msdyn365Data.authoringHelper = authoringHelper;\n\n if (requestContext.params.isEditor) {\n // @ts-ignore\n document.addEventListener('_msdyn365_client_disabled_properties', (dpEvent: { detail: IDisabledProperties }) => {\n if (dpEvent && dpEvent.detail && dpEvent.detail) {\n Object.keys(dpEvent.detail.modules).map(key => {\n authoringHelper.updateDisabledProperties(key, dpEvent.detail.modules[key]);\n });\n }\n });\n }\n });\n};\n\nexport function clientRender(): void {\n const storeData = window.___initialData___;\n if (!storeData || typeof storeData !== 'object') {\n console.error(MESSAGE_CLIENT_RENDER_ERROR);\n return;\n }\n const removePlaceholderModules = (modulesDictionary: { [slot: string]: IModuleContract[] }) => {\n Object.keys(modulesDictionary || {}).forEach(slot => {\n modulesDictionary[slot] = modulesDictionary[slot].filter(a => a.typeName !== 'place-holder-for-container-preview');\n modulesDictionary[slot].forEach(module => module.modules && removePlaceholderModules(module.modules));\n });\n };\n const requestContext = getRequestContext(storeData);\n if (requestContext.params.isEditor) {\n removePlaceholderModules(storeData.pageRoot.modules);\n }\n\n // if request is not POST or is not a checkout route or is not a payment verification, clear all checkout session storage data.\n // TODO: Explore a way to move this logic to SSK\n if (!requestContext.requestFormData || !isCheckoutRoute(requestContext) || !isPaymentVerification(requestContext)) {\n requestContext.sessionStorage.removeCheckoutCartData();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const appCache = (msdyn365Commerce as any).getAppCache(requestContext);\n const pageContext = new PageContext(storeData, requestContext, appCache);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).__msdyn365__ = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).__msdyn365__.pageContext = pageContext;\n\n // Get the 1DS instance from the browser client. Initialized as part of base-page\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const oneDSWeb: any = window['oneDSWeb'];\n\n // Get the registered experiment listener\n const expListener = msdyn365Commerce.experimentationConnector?.listener;\n\n // Get application insights instrumentation key\n const appInsightsInstrumentationKey = requestContext.telemetrySettings.instrumentationKey || '';\n let msftClientAppInsightsJSLogger;\n if (appInsightsInstrumentationKey !== '') {\n msftClientAppInsightsJSLogger = new ClientAppInsightsJSLogger(\n LoggerType.MSFTApplicationInsightsLogger,\n appInsightsInstrumentationKey\n );\n }\n\n // Get operational insights instrumentation key\n const operationalInsightsInstrumentationKey = requestContext.telemetrySettings.operationalInsightsInstrumentationKey || '';\n let operationalClientAppInsightsJSLogger;\n if (operationalInsightsInstrumentationKey !== '') {\n operationalClientAppInsightsJSLogger = new ClientAppInsightsJSLogger(\n LoggerType.OperationalApplicationInsightsLogger,\n operationalInsightsInstrumentationKey\n );\n }\n\n // Set up internal SDK telemetry\n const internalTelemetry = StaticTelemetry;\n internalTelemetry.enableDataAnalytics(requestContext.features.enableDataAnalytics);\n internalTelemetry.registerWebAnalyticsPlugin(oneDSWeb);\n internalTelemetry.registerAttributeRenderer(expAttributeRenderer);\n if (appInsightsInstrumentationKey !== '') {\n internalTelemetry.registerTraceLogger({\n traceLogger: msftClientAppInsightsJSLogger\n });\n }\n\n internalTelemetry.setTelemetryRequestContext({\n siteId: '[[Placeholder]]',\n channelId: requestContext.channel?.RecordId ? requestContext.channel.RecordId.toString() : 'Unavailable',\n pageType: requestContext.urlTokens.pageType,\n pageId: pageContext.pageRoot.id\n });\n\n const correlationId = Telemetry.generateGuid();\n logWebVitals(internalTelemetry, correlationId);\n\n const targetId = requestContext?.tuid;\n if (targetId) {\n resolveMissingSegmentsOnClient(requestContext, targetId, internalTelemetry);\n }\n\n // Set up external module telemetry\n const moduleTelemetry = new Telemetry();\n moduleTelemetry.enableDataAnalytics(requestContext.features.enableDataAnalytics);\n moduleTelemetry.registerWebAnalyticsPlugin(oneDSWeb);\n moduleTelemetry.registerAttributeRenderer(expAttributeRenderer);\n if (operationalInsightsInstrumentationKey) {\n moduleTelemetry.registerTraceLogger({\n traceLogger: operationalClientAppInsightsJSLogger\n });\n }\n\n // If experimentaiton listener set up, add to event logging framework\n if (expListener && requestContext.features.experimentation) {\n internalTelemetry.registerExpLogger(expListener);\n\n moduleTelemetry.registerExpLogger(expListener);\n }\n\n // If in debug mode, add console loggers\n if (requestContext.params.isDebug) {\n internalTelemetry.registerTraceLogger({ traceLogger: GenericConsoleLogger, options: { isDebug: requestContext.params.isDebug } });\n moduleTelemetry.registerTraceLogger({ traceLogger: GenericConsoleLogger, options: { isDebug: requestContext.params.isDebug } });\n }\n\n const contentSecurityPolicy = requestContext.app && requestContext.app?.contentSecurityPolicy;\n\n // Logging CSP error only when CSP is enabled and enableReportOnlyMode is false\n if (contentSecurityPolicy && !contentSecurityPolicy?.disableContentSecurityPolicy && !contentSecurityPolicy?.enableReportOnlyMode) {\n const randomNumberGenerator = Math.floor(Math.random() * 100);\n\n document.addEventListener('securitypolicyviolation', e => {\n const cspReport = JSON.stringify({\n 'blocked-uri': e.blockedURI,\n 'document-uri': e.documentURI,\n 'original-policy': e.originalPolicy,\n 'violated-directive': e.violatedDirective\n });\n\n // Only logging all CSP errors for 25% of page request\n if (randomNumberGenerator < 25) {\n internalTelemetry.log(LogLevel.Error, CONTENT_SECURITY_POLICY_ERROR, { customTags: [cspReport] });\n }\n });\n }\n\n pageContext\n .putRequestedModulesInCacheOnClient(storeData, moduleTelemetry)\n .catch(error => {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_CLIENT_CACHE_HYDRATE, { exception: error });\n })\n .finally(async () => {\n await timeSliceLongJSTask(requestContext);\n\n window._msdyn365 = {\n requestContext: requestContext,\n telemetry: internalTelemetry\n };\n\n const actionContext = new ActionContext({\n id: 'Client Action Context',\n requestContext: requestContext,\n requestCache: pageContext.requestCache,\n telemetry: moduleTelemetry,\n appCache: null,\n spawnChildOnExecute: true\n });\n\n if (requestContext.params.isDebug) {\n window._msdyn365.cache = pageContext.requestCache;\n }\n const coreContext: ICoreContext = {\n actionContext: actionContext,\n app: requestContext.app,\n // @ts-ignore -- we don't actually have this prop defined on the interface\n internalTelemetry: internalTelemetry,\n telemetry: moduleTelemetry,\n request: requestContext,\n cultureFormatter: new CultureInfoFormatter(\n requestContext.locale,\n getCurrencyCodeFromContext(requestContext),\n requestContext.query\n )\n };\n let allModules: IModule[] = [];\n await timeSliceLongJSTask(requestContext);\n if (requestContext?.features?.loadData_optimization) {\n allModules = await optimizedGetAllModules(pageContext, requestContext);\n } else {\n allModules = await pageContext.allModules(requestContext, []);\n }\n\n const allowDispatchEvent = requestContext?.params?.isEditor || requestContext?.features?.enable_verbose_logs ? true : false;\n if (shouldOptimizeHydrate(requestContext)) {\n await optimizeClientHydrate(\n requestContext,\n pageContext,\n coreContext,\n actionContext,\n allModules,\n moduleTelemetry,\n internalTelemetry,\n correlationId\n );\n } else {\n if (requestContext.params.isEditor) {\n await initAuthoringHelper(requestContext, pageContext, coreContext, actionContext, moduleTelemetry);\n }\n\n // Fire event to let tooling know render starts. Tools on receiving this event, calls\n // initialziation and passes the rendering helper class instance that can be used by SDK to\n // get any information/context w.r.t tools\n if (allowDispatchEvent) {\n const event = new Event(CLIENT_RENDER_START_EVENT);\n document.dispatchEvent(event);\n }\n\n if (allowDispatchEvent) {\n internalTelemetry.trackEvent(EVENT_CLIENT_RENDER_START, {\n id: correlationId\n });\n internalTelemetry.startTimer(correlationId);\n }\n\n let initialPromise: Promise = Promise.resolve();\n const LAZYLOAD_ALL_SWITCH: boolean = requestContext.features.lazyload_all;\n\n initialPromise = initialPromise.then(async () => {\n try {\n return processComplexDataTypes(LAZYLOAD_ALL_SWITCH, PROCESS_TYPE.client, allModules, actionContext);\n } catch (error) {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_PRODUCT_LIST_CLIENTSIDE_HYDRATION, { exception: error });\n }\n });\n\n initialPromise.finally(() => {\n // put client hydrate flag into request cache.\n setupClientHydrateFlag(pageContext.requestCache);\n loadData(allModules, requestContext, internalTelemetry, moduleTelemetry, pageContext.requestCache, null)\n .then(() => {\n if (allowDispatchEvent) {\n internalTelemetry.trackEvent(\n EVENT_CLIENT_RENDER_STOP,\n {\n id: correlationId\n },\n {\n success: 1,\n time: internalTelemetry.stopTimer(correlationId)\n }\n );\n }\n })\n .catch(error => {\n if (allowDispatchEvent) {\n internalTelemetry.trackEvent(\n EVENT_CLIENT_RENDER_STOP,\n {\n id: correlationId\n },\n {\n success: 0,\n time: internalTelemetry.stopTimer(correlationId)\n }\n );\n }\n internalTelemetry.log(LogLevel.Error, EXCEPTION_LOAD_DATA_EXCEPTION, { exception: error });\n })\n .finally(() => {\n // remove client hydrate flag from request cache.\n resetClientHydrateContext(pageContext.requestCache);\n // Gets a reference to the same Telemetry, so that we can route existing log calls to new back-end without changing front-end API\n\n if (!shouldOptimizeHydrate(requestContext)) {\n hydrateClient(requestContext, pageContext, coreContext);\n }\n msdyn365Commerce.setClientHydrate(false);\n // Add the page view exp event id to the page level div\n const pageName = requestContext.telemetryPageName || requestContext.url.requestUrl.pathname;\n document.getElementById(LAYOUT_MOUNT_POINT)?.setAttribute('data-exp-event-id', `${pageName}.PageView`);\n // Activate any active experiments on the page\n activateExperiments(requestContext);\n\n // TODO (matt, 6/15/20): Manually firing page view event, undo once 1DS forwarding to framework implemented\n internalTelemetry.logEvent(TelemetryEvent.PageView, {\n title: requestContext.telemetryPageName || requestContext.url.requestUrl.pathname\n });\n\n if (allowDispatchEvent) {\n // Fire event to let tooling know render is complete\n const deprecatedEvent = new Event(DEPRECATED_CLIENT_RENDER_COMPLETE_EVENT);\n document.dispatchEvent(deprecatedEvent);\n\n document.dispatchEvent(new Event(CLIENT_RENDER_COMPLETE_EVENT));\n }\n });\n });\n }\n });\n\n // TODO (matt, 6/15/20): Manually firing page view event, undo once 1DS forwarding to framework implemented\n internalTelemetry.logEvent(TelemetryEvent.PageView, {\n title: requestContext.telemetryPageName || requestContext.url.requestUrl.pathname\n });\n}\n\nconst setupClientHydrateFlag = (requestCache: ICache) => {\n setClientHydrateContext(requestCache);\n msdyn365Commerce.setClientHydrate(true);\n};\n\nconst optimizeClientHydrate = async (\n requestContext: IRequestContext,\n pageContext: PageContext,\n coreContext: ICoreContext,\n actionContext: ActionContext,\n allModules: IModule[],\n moduleTelemetry: ITelemetry,\n internalTelemetry: InternalTelemetry,\n correlationId: string\n) => {\n try {\n // Await on instance data actions, other data actions are run asynchronously\n setupClientHydrateFlag(pageContext.requestCache);\n\n let modulesRenderedOnServer = allModules;\n if (isLazyRenderModuleEnabled(requestContext)) {\n modulesRenderedOnServer = allModules.filter(m => {\n const cacheItem = pageContext.requestCache.get({ typeName: CLIENT_ENTRY_POINTS_TYPE, key: m.typeName })?.item;\n return !cacheItem;\n });\n }\n await timeSliceLongJSTask(requestContext);\n\n await loadData(modulesRenderedOnServer, requestContext, internalTelemetry, moduleTelemetry, pageContext.requestCache, null);\n resetClientHydrateContext(pageContext.requestCache);\n const allowDispatchEvent = requestContext?.params?.isEditor || requestContext?.features?.enable_verbose_logs ? true : false;\n\n // Fire event to let tooling know render starts. Tools on receiving this event, calls\n // initialziation and passes the rendering helper class instance that can be used by SDK to\n // get any information/context w.r.t tools\n if (allowDispatchEvent) {\n const event = new Event(CLIENT_RENDER_START_EVENT);\n document.dispatchEvent(event);\n }\n\n if (requestContext?.features?.enable_verbose_logs) {\n internalTelemetry.trackEvent(EVENT_CLIENT_RENDER_START, {\n id: correlationId\n });\n internalTelemetry.startTimer(correlationId);\n }\n\n // hydrate client without waiting on all the data actions to complete\n hydrateClient(requestContext, pageContext, coreContext);\n msdyn365Commerce.setClientHydrate(false);\n\n if (allowDispatchEvent) {\n trackEvent(internalTelemetry, correlationId, EVENT_CLIENT_RENDER_STOP, 1);\n }\n\n if (requestContext.params.isEditor) {\n await initAuthoringHelper(requestContext, pageContext, coreContext, actionContext, moduleTelemetry);\n }\n\n const LAZYLOAD_ALL_SWITCH: boolean = requestContext.features.lazyload_all;\n\n try {\n await processComplexDataTypes(LAZYLOAD_ALL_SWITCH, PROCESS_TYPE.client, allModules, actionContext);\n } catch (error) {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_PRODUCT_LIST_CLIENTSIDE_HYDRATION, { exception: error });\n }\n\n // Add the page view exp event id to the page level div\n const pageName = requestContext.telemetryPageName || requestContext.url.requestUrl.pathname;\n document.getElementById(LAYOUT_MOUNT_POINT)?.setAttribute('data-exp-event-id', `${pageName}.PageView`);\n // Activate any active experiments on the page\n activateExperiments(requestContext);\n\n if (allowDispatchEvent) {\n // Fire event to let tooling know render is complete\n const deprecatedEvent = new Event(DEPRECATED_CLIENT_RENDER_COMPLETE_EVENT);\n document.dispatchEvent(deprecatedEvent);\n document.dispatchEvent(new Event(CLIENT_RENDER_COMPLETE_EVENT));\n }\n } catch (error) {\n if (requestContext.features.enable_verbose_logs) {\n trackEvent(internalTelemetry, correlationId, EVENT_CLIENT_RENDER_STOP, 0);\n }\n internalTelemetry.log(LogLevel.Error, EXCEPTION_LOAD_DATA_EXCEPTION, { exception: error });\n }\n};\n\nconst trackEvent = (internalTelemetry: InternalTelemetry, correlationId: string, eventName: string, success: TSuccessNumber) => {\n internalTelemetry.trackEvent(\n eventName,\n {\n id: correlationId\n },\n {\n success,\n time: internalTelemetry.stopTimer(correlationId)\n }\n );\n};\n\nconst logWebVitals = (internalTelemetry: InternalTelemetry, correlationId: string) => {\n onCLS(metric => {\n internalTelemetry.trackEvent(\n EVENT_WEB_VITALS_CLS,\n { id: correlationId },\n { value: metric.value }\n );\n });\n onFCP(metric => {\n internalTelemetry.trackEvent(EVENT_WEB_VITALS_FCP, { id: correlationId }, { time: metric.value });\n });\n onFID(metric => {\n internalTelemetry.trackEvent(EVENT_WEB_VITALS_FID, { id: correlationId }, { time: metric.value });\n });\n onLCP(metric => {\n internalTelemetry.trackEvent(EVENT_WEB_VITALS_LCP, { id: correlationId }, { time: metric.value });\n });\n onTTFB(metric => {\n internalTelemetry.trackEvent(EVENT_WEB_VITALS_TTFB, { id: correlationId }, { time: metric.value });\n });\n onINP(metric => {\n internalTelemetry.trackEvent(EVENT_WEB_VITALS_INP, { id: correlationId }, { time: metric.value });\n });\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IAny, IGeneric, MSDyn365Commerce, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\nimport * as React from 'react';\nimport { IBinding, IModuleBinder, IMSDyn365CommerceWithPrototype } from './models';\n\nexport const initializeApp = (bindings: IBinding) => {\n /**\n * Why we are using 'Prototype'. MSDyn365Commerce is defined in core packages and used in modules and C1 development.\n * whereas all registration, build information, commerce details etc available in runtime-internal package.\n * prototype help us declaring properties in core package and implementation in runtime-internal package.\n *\n * Following properties are not accessible by module or c1 developer.\n */\n (MSDyn365Commerce).prototype.bindings = bindings;\n\n (MSDyn365Commerce).prototype.moduleBinder = function(name: string): IModuleBinder {\n return this.bindings && this.bindings.modules && this.bindings.modules[name && name.toLowerCase()];\n };\n\n (MSDyn365Commerce).prototype.viewBinder = function(name: string): React.FC {\n return this.bindings && this.bindings.views && this.bindings.views[name];\n };\n\n (MSDyn365Commerce).prototype.componentBinder = function(name: string): React.FC {\n return this.bindings && this.bindings.components && this.bindings.components[name];\n };\n\n (MSDyn365Commerce).prototype.getPartnerOverrideAction = function(id: string): Function {\n return this.bindings && this.bindings.partnerDataActions && this.bindings.partnerDataActions[id];\n };\n\n (MSDyn365Commerce).prototype.dataAction = function(name: string): Function {\n return (\n (this.bindings && this.bindings.partnerDataActions && this.bindings.partnerDataActions[name]) ||\n (this.bindings && this.bindings.dataActions && this.bindings.dataActions[name])\n );\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (MSDyn365Commerce).prototype.getConnector = function(name: string): any {\n return this.bindings && this.bindings.connectors && this.bindings.connectors[name];\n };\n\n (MSDyn365Commerce).prototype.getAllModuleBinder = function(): IModuleBinder[] {\n return this.bindings && this.bindings.modules && Object.values(this.bindings.modules);\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Returns an npm package source.\n (MSDyn365Commerce).prototype.perfAnalysisBinder = function(): any {\n return this.bindings?.perfAnalysisLibBinding;\n };\n\n (MSDyn365Commerce).prototype.updatePrivateVariable = function(): void {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._env = process.env.NODE_ENV;\n };\n\n (>msdyn365Commerce).updatePrivateVariable();\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICache, ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport { IComponent, IComponentProps, ICoreContext, IModule, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\nimport { asSystemMetadata, EXCEPTION_NOMODULEBINDER, LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport React from 'react';\nimport * as path from 'path';\nimport { IMSDyn365CommerceExtension } from '../app-initialization/models';\nimport { getModuleName, getPageInsightsCacheKey, isPageInsightsEnabled } from '../utils/helpers';\nimport { PAGE_INSIGHTS_COMPONENTS_KEY } from '../consts';\n\nexport interface IModuleWithView extends IModule {\n View: React.FunctionComponent;\n}\n\nconst getModuleBinder = (typeName: string) => ((msdyn365Commerce as unknown) as IMSDyn365CommerceExtension).moduleBinder(typeName);\n\nconst getBinder = (lookupKey: string, moduleName: string, requestCache: ICache, pageInsightsEnabled: boolean) => {\n const view = ((msdyn365Commerce as unknown) as IMSDyn365CommerceExtension).componentBinder(lookupKey);\n if (view) {\n if (pageInsightsEnabled) {\n const componentInsightsKey = getPageInsightsCacheKey(PAGE_INSIGHTS_COMPONENTS_KEY);\n const componentInsights = requestCache.get<{}>(componentInsightsKey)?.item || {};\n componentInsights[`${moduleName}`] = `${lookupKey.replace(/\\|/g, '/')}.component.tsx`;\n requestCache.put(componentInsightsKey, { item: componentInsights });\n }\n\n return { key: lookupKey, view };\n }\n return undefined;\n};\n\n/* component will be read in following hierarchy\n 1) __local__/__local__|views/theme1/BuyBox/Components/PriceComponent\n 2) __local__/__local__|views/theme1/Components/PriceComponent\n 3) @msdyn-365-commerce-modules/theme1/views/BuyBox/Components/PriceComponent\n 4) @msdyn-365-commerce-modules/theme1/views/Components/PriceComponent\n */\nconst lookupFunc = (moduleBinder, themeBinder, name, requestCache: ICache, pageInsightsEnabled: boolean) => {\n name = name.toLowerCase();\n return (\n (themeBinder &&\n (getBinder(\n `__local__|__local__|themes|${themeBinder.name}|views|${moduleBinder.name}|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ) ||\n getBinder(\n `__local__|__local__|themes|${themeBinder.name}|views|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ) ||\n getBinder(\n `__local__|__local__|themes|${themeBinder.name}|views|components|${moduleBinder.name}|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ) ||\n getBinder(\n `${themeBinder.moduleNamespace}|${themeBinder.packageName}|modules|${themeBinder.name}|views|components|${moduleBinder.name}|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ) ||\n getBinder(\n `${themeBinder.moduleNamespace}|${themeBinder.packageName}|modules|${themeBinder.name}|views|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ))) ||\n getBinder(\n `${moduleBinder.moduleNamespace}|${moduleBinder.packageName}|views|${moduleBinder.name}|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n )\n );\n};\n\n/**\n * Component will be read from the module\n * @msdyn-365-commerce-modules/BuyBox/views/BuyBox/Components/PriceComponent\n */\nconst defaultComponentLookupFunc = (moduleBinder, name: string, requestCache: ICache, pageInsightsEnabled: boolean) => {\n const parentModuleBinder = getModuleBinder(getModuleName(moduleBinder.parentDefinitionPath));\n\n return (\n getBinder(\n `${moduleBinder.moduleNamespace}|${moduleBinder.packageName}|views|${moduleBinder.name}|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ) ||\n (parentModuleBinder &&\n getBinder(\n `${parentModuleBinder.moduleNamespace}|${parentModuleBinder.packageName}|views|${parentModuleBinder.name}|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ))\n );\n};\n\nconst getComponent = (name, moduleBinder, themeBinder, context: ICoreContext) => {\n if (!moduleBinder) {\n return { view: null };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const cache: ICache = (msdyn365Commerce as any).getAppCache(context.actionContext.requestContext);\n const pageInsightsEnabled = isPageInsightsEnabled(context.request.params);\n const cacheKey: ICacheKey = {\n key: `${name}|${moduleBinder.name}|${themeBinder ? themeBinder.name : 'no-theme'}`,\n typeName: '__ComponentCacheKey__'\n };\n const lookupKey = cache.getValue(cacheKey);\n const actionContextData: any = context.actionContext;\n const requestCache: ICache = actionContextData.requestCache;\n\n if (lookupKey) {\n context.telemetry.log(LogLevel.Debug, `lookup key for component [${cacheKey.key}] found at - [${lookupKey}]`);\n !msdyn365Commerce.isBrowser && actionContextData.requestCache.put(cacheKey, { item: lookupKey });\n return getBinder(lookupKey, moduleBinder.name, requestCache, pageInsightsEnabled) || { view: null };\n }\n\n let component = lookupFunc(moduleBinder, themeBinder, name, requestCache, pageInsightsEnabled);\n\n // If no component found in the theme, search in parent theme (in case of inherited theme)\n if (!component && themeBinder) {\n const parentThemeName = getModuleName(themeBinder.parentDefinitionPath);\n const parentThemeBinder = getModuleBinder(parentThemeName);\n component = lookupFunc(moduleBinder, parentThemeBinder, name, requestCache, pageInsightsEnabled);\n }\n\n // If no component file found, fall back to module's default component\n if (!component) {\n component = defaultComponentLookupFunc(moduleBinder, name, requestCache, pageInsightsEnabled);\n }\n\n if (component) {\n context.telemetry.log(LogLevel.Debug, `lookup key for component [${cacheKey.key}] found at - [${component.key}]`);\n cache.put(cacheKey, { item: component.key });\n actionContextData.requestCache.put(cacheKey, { item: component.key });\n return component;\n }\n\n return { view: null };\n};\n\nexport const createComponent = >(name: string, componentObj: T) => (props: IComponentProps) => {\n props.context.telemetry.log(LogLevel.Debug, `rendering component-'${name}' within module-'${props.id}-${props.typeName}'`);\n const moduleBinder = getModuleBinder(props.typeName);\n if (!moduleBinder) {\n props.context.telemetry.log(LogLevel.Error, EXCEPTION_NOMODULEBINDER, { values: [asSystemMetadata(props.typeName)] });\n return null;\n }\n let componentName = path.basename(__filename);\n if (componentName) {\n componentName = componentName.replace('.component.tsx', '');\n componentName = componentName.replace('.component.js', '');\n }\n\n const themeBinder = getModuleBinder(props.context.actionContext.requestContext.params.theme);\n let componentView = getComponent(componentName, moduleBinder, themeBinder, props.context);\n if (!componentView.view) {\n componentView = getComponent(name, moduleBinder, themeBinder, props.context);\n }\n const { view } = componentView;\n const mergedComponent = view ? { ...((componentObj as unknown) as object), ...view } : componentObj;\n const Component = mergedComponent.component;\n const propsDictionary = props as any;\n if (propsDictionary.addChunk && view) {\n propsDictionary.addChunk(view.cn);\n }\n\n return ;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICache, RequestCache } from '@msdyn365-commerce/cache-internal';\nimport {\n IAny,\n IExperimentationConnector,\n IGeneric,\n IRequestContext,\n MSDyn365Commerce,\n msdyn365Commerce,\n skipConsoleWarn\n} from '@msdyn365-commerce/core-internal';\nimport { initializeApp } from './initialization';\nimport { IBinding, IMSDyn365CommerceWithPrototype } from './models';\nimport { createComponent } from './render-component';\nimport { initBindings } from './utils';\n\ninterface IConnectors {\n experimentation: IExperimentationConnector;\n}\n\nconst requestCache: ICache = new RequestCache();\n\n/**\n * Helper method to inject createComponent method from runtime-internal.\n * We add a dummy createComponent method initially to avoid running into circular lookup of\n * ecommerce components\n */\nconst addCreateComponentHook = () => {\n (MSDyn365Commerce).prototype.updatePrivateVariable = function(): void {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this.createComponent = createComponent;\n };\n (>msdyn365Commerce).updatePrivateVariable();\n};\n\nexport const initializeClientApp = async (bindings: IBinding, connectors: IConnectors) => {\n skipConsoleWarn();\n addCreateComponentHook();\n initializeApp(bindings);\n const clientPlatformSettings = (window).___initialData___ && (window).___initialData___._clientPlatformSetting;\n await initBindings(bindings, clientPlatformSettings && clientPlatformSettings.enableModuleEntryPoints);\n\n (MSDyn365Commerce).prototype.updatePrivateVariable = function(): void {\n const appDatabv = (window).___appData___ && (window).___appData___.bv;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._buildVersion = appDatabv;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._experimentationConnector = connectors?.experimentation;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._platformSettings = clientPlatformSettings;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._versionDependentFeatureInfo = (window).___initialData___ && (window).___initialData___._versionDependentFeatureInfo;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._environmentVariable = (window).___initialData___ && (window).___initialData___._environmentVariable;\n };\n (>msdyn365Commerce).updatePrivateVariable();\n\n (MSDyn365Commerce).prototype.getAppCache = (requestContext: IRequestContext) => requestCache;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport path from 'path';\nimport { IBinding, IModuleBinder, IModuleBinderPartial } from './models';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const initBindings = async (bindings: IBinding, isModuleEntryPointsEnabled: boolean) => {\n await Promise.all(\n Object.keys(bindings.modules).map(async moduleKey => {\n const originalBinder: IModuleBinderPartial = (bindings.modules[moduleKey]);\n try {\n const binder: IModuleBinder = {};\n let fetchComponent;\n if (!isModuleEntryPointsEnabled) {\n fetchComponent = await originalBinder.c();\n }\n binder.component = isModuleEntryPointsEnabled\n ? function load() {\n return originalBinder.c();\n }\n : fetchComponent.default;\n binder.moduleDirectory = originalBinder.md;\n binder.dataActions = originalBinder.da;\n binder.packageName = originalBinder.p;\n binder.name = originalBinder.n;\n binder.definitionPath = path.join(originalBinder.md, `${originalBinder.n}.definition.json`);\n binder.parentDefinitionPath = originalBinder.pdp;\n binder.isNodeModule = originalBinder.iNM;\n binder.moduleNamespace = originalBinder.ns;\n binder.chunkName = `${originalBinder.ns}-${originalBinder.p}-${originalBinder.n}`;\n bindings.modules[moduleKey] = binder;\n } catch (e) {\n console.error(`failed to load module chunk :: ${moduleKey}`, e);\n }\n })\n );\n\n await Promise.all(\n Object.keys(bindings.views).map(async viewKey => {\n const viewComponent: any = bindings.views[viewKey];\n try {\n let fetchViewComponent;\n if (!isModuleEntryPointsEnabled) {\n fetchViewComponent = isModuleEntryPointsEnabled ? viewComponent.c() : await viewComponent.c();\n }\n (bindings.views[viewKey]).component = isModuleEntryPointsEnabled\n ? function load() {\n return viewComponent.c();\n }\n : fetchViewComponent.default;\n } catch (e) {\n console.error(`failed to load view chunk :: ${viewKey}`, e);\n }\n })\n );\n\n await Promise.all(\n Object.keys(bindings.components).map(async componentKey => {\n const ecommerceComponent: any = bindings.components[componentKey];\n try {\n const fetchEComComponent = await ecommerceComponent.c();\n (bindings.components[componentKey]).component = fetchEComComponent.default;\n } catch (e) {\n console.error(`failed to load component chunk :: ${componentKey}`, e);\n }\n })\n );\n};\n","/*******************************************************************************\n* Copyright (c) Microsoft Corporation.\n* All rights reserved. See LICENSE in the project root for license information.\n*******************************************************************************/\n\n\nimport 'custom-event-polyfill';\n\nimport { initializeClientApp, clientRender } from '@msdyn365-commerce/runtime-internal/dist/lib/client';\nconst { getUniqueRequestedAssets } = require('../common');\n\n// Fetches the registration object from a given file and dictionary name\n// If the module is not found or dictionary does not exist an empty object is returned\nconst fetchRegistrationObject = (registration, dictionaryName) => {\n return registration ? registration[dictionaryName] : {};\n};\n\n// Registers all the local and installed modules need to render the page client-side\nconst registerModules = () => {\n const bindings = window.__bindings__;\n // installed modules registration\n if (bindings) {\n return {\n modules: {\n ...bindings.modules\n },\n dataActions: {\n // load data actions in the order of the action overrides (installed and local)\n ...bindings.dataActions\n },\n partnerDataActions: {\n ...bindings.packageDataActions['__local__']\n },\n views: {\n ...bindings.viewDictionary\n }\n };\n }\n\n return {\n modules: {},\n dataActions: {},\n partnerDataActions: {},\n views: {}\n };\n};\n\nconst initializeConnectors = (connectorInformation = {}, connectorsRegistration, requestContext) => {\n let experimentationConnector;\n if (connectorsRegistration && connectorInformation) {\n const expConnectorName = connectorInformation.expConnector;\n if (expConnectorName && connectorsRegistration[expConnectorName]) {\n // Grab the stored config from the window object\n const config = window.___initialData___.experimentationConfig;\n // Grab the experimentation user ID\n const expUserId = requestContext && requestContext.experiments && requestContext.experiments.userId;\n // Initialize the provider and listener for client\n const experimentationProvider = connectorsRegistration[expConnectorName].provider;\n const experimentationListener = connectorsRegistration[expConnectorName].listener;\n\n if (!experimentationProvider || !experimentationListener) {\n return { experimentation: undefined };\n }\n\n experimentationProvider.initializeClientSide(config);\n experimentationListener.initializeClientSide(config, expUserId);\n experimentationConnector = { name: expConnectorName, provider: experimentationProvider, listener: experimentationListener };\n }\n }\n return { experimentation: experimentationConnector };\n};\n\nconst initializePerformanceUtils = async bindings => {\n return import(/* webpackChunkName: \"msdyn365-performance-chunk\" */ '@msdyn365-commerce/commerce-performance-analyzer').then(lib => {\n bindings.perfAnalysisLibBinding = lib;\n });\n};\n\nconst initializeClient = async () => {\n const requestedAssets = window.___initialData___ && getUniqueRequestedAssets(window.___initialData___);\n let bindings = { modules: {}, dataActions: {} };\n const requestContext = window.___initialData___ && window.___initialData___.requestContext;\n\n bindings = window.___initialData___ && registerModules(requestContext, requestedAssets);\n\n // component extensions registration\n try {\n bindings.components = fetchRegistrationObject(require('lib/component-registration'), 'componentDictionary');\n } catch (e) {\n if (e.code === 'MODULE_NOT_FOUND') {\n process.env.NODE_ENV === 'development' && console.log(`component registration files not found.`);\n }\n }\n\n // connectors registration\n try {\n bindings.connectors = fetchRegistrationObject(require('lib/connector-registration'), 'connectorDictionary');\n } catch (e) {\n if (e.code === 'MODULE_NOT_FOUND') {\n process.env.NODE_ENV === 'development' && console.log(`connector registration files not found.`);\n }\n }\n\n const connectorInformation = requestContext.connectors;\n const connectors = initializeConnectors(connectorInformation, bindings.connectors, requestContext);\n\n // eslint-disable-next-line camelcase\n const shouldRunPerformanceAnalysis = requestContext.features?.enable_performance_analysis && requestContext.params.isPerfAnalysis;\n if (shouldRunPerformanceAnalysis) {\n await initializePerformanceUtils(bindings);\n }\n\n await initializeClientApp(bindings, connectors);\n clientRender();\n};\n\nPromise.resolve().then(async () => {\n const initializeClientWithRetry = async retry => {\n if (retry > 3) {\n console.warn(`client initialization retry limit reached, Retry count: ${retry}`);\n // all retries failed but we should still render the page with the modules that are registered\n // safe render module will wrap the missing modules\n await initializeClient();\n return;\n }\n\n // Ideally, all the modules should be loaded by this time\n // However, loading does not guarantee execution of the script\n // in which case we should retry after a time window\n const bindings = window.__bindings__;\n if (!bindings) {\n setTimeout(() => initializeClientWithRetry(retry + 1), 500);\n return;\n }\n\n const lazyLoadedModules = window.___initialData___.requestCache.internalCache.__CEP__ || {};\n const modulesList = window.___initialData___._moduleList;\n const themesList = window.___initialData___._themeModulesList;\n const clientModulesList = new Set();\n modulesList.map(m => {\n if (m.typeName !== 'core-root' && !lazyLoadedModules[m.typeName.toUpperCase()]) {\n clientModulesList.add(m.typeName);\n }\n });\n themesList.map(m => m !== '' && clientModulesList.add(m));\n\n // make sure all the module chunks are loaded and executed before initializing the client\n let scriptsExecuted = true;\n Array.from(clientModulesList).map(m => {\n if (!bindings || !bindings.modules[m]) {\n scriptsExecuted = false;\n }\n });\n\n if (!bindings.packageDataActions?.['__local__']) {\n scriptsExecuted = false;\n }\n\n if (!scriptsExecuted) {\n setTimeout(() => initializeClientWithRetry(retry + 1), 500);\n return;\n }\n\n if (scriptsExecuted) {\n await initializeClient();\n } else {\n console.error(`client initialization failed, module scripts execution not complete. Retry count: ${retry}`);\n throw new Error(`client initialization failed, module scripts execution not complete. Retry count: ${retry}`);\n }\n };\n\n await initializeClientWithRetry(0);\n});\n","// This file is included in production builds as the first entry point in the bundle.\n// It must run before the rest of the bundle even executes, since it sets a variable that webpack uses\n// to resolve dynamic imports.\n\n// This variable is not global, it is a 'free' variable that is scoped to this bundle.\n__webpack_public_path__ = window.___publicPath___; // eslint-disable-line\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport React from 'react';\nimport { getRenderingHelper } from '../utils/helpers';\n\nexport type IAddModuleProps = {\n moduleId: string;\n slotId: string;\n enabled: boolean;\n mode: AddControlMode;\n index?: number;\n slotName?: string;\n parentId?: string;\n};\n\nexport enum AddControlMode {\n EmptySlot,\n Sibling\n}\nexport interface IAddModuleState {\n moduleId: string;\n}\n\n/**\n * Editable field component, containing all the logic for inline editable properties in editorial preview\n * Current support: text, image\n */\nexport class AddModuleControl extends React.Component {\n public constructor(props: IAddModuleProps) {\n super(props);\n this.state = {\n moduleId: props.moduleId\n };\n }\n public render(): JSX.Element | null {\n if (!this.props.enabled) {\n return null;\n }\n const localizedStrings = {\n insertModule:\n this.getLocalizedStringsfromTools('insertModule') !== ''\n ? this.getLocalizedStringsfromTools('insertModule')\n : 'Insert module',\n insertFragment:\n this.getLocalizedStringsfromTools('insertFragment') !== ''\n ? this.getLocalizedStringsfromTools('insertFragment')\n : 'Insert fragment',\n moveNotAllowed:\n this.getLocalizedStringsfromTools('moveNotAllowed') !== ''\n ? this.getLocalizedStringsfromTools('moveNotAllowed')\n : 'Move not allowed'\n };\n\n const button = (tooltip: string) => {\n return (\n \n
\n \n \n \n
\n
\n \n \n
\n \n );\n };\n if (this.props.mode === AddControlMode.Sibling) {\n return (\n
\n
\n
{button(`Add a module to ${this.props.slotName || this.props.slotId}`)}
\n
\n
\n );\n } else {\n const parentData = this.props.parentId ? `,p:${this.props.parentId}` : '';\n return (\n
\n
\n
{button(`Configure ${this.props.slotName || this.props.slotId}`)}
\n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n {localizedStrings.insertModule}\n {localizedStrings.insertFragment}\n {localizedStrings.moveNotAllowed}\n
\n
\n
\n );\n }\n }\n\n public toggleMenuDisplay = () => {\n const button = document.getElementById(this.getAddButtonId());\n const menu = document.getElementById(this.getAddButtonMenuId());\n if (button && menu) {\n if (menu.style.display === 'block') {\n menu.style.display = 'none';\n } else {\n menu.style.display = 'block';\n }\n }\n };\n\n public hideMenuDisplay = () => {\n const button = document.getElementById(this.getAddButtonId());\n const menu = document.getElementById(this.getAddButtonMenuId());\n if (button && menu) {\n menu.style.display = 'none';\n }\n };\n\n public getAddButtonId = () => {\n return this.props.index\n ? `add-${this.props.moduleId}-${this.props.slotId}-${this.props.index}`\n : `add-${this.props.moduleId}-${this.props.slotId}`;\n };\n\n public onKeyPressMenu = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n this.toggleMenuDisplay();\n } else if (event.key === 'Escape') {\n this.hideMenuDisplay();\n }\n };\n\n public onKeyPressAddModule = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n this.addModule();\n } else if (event.key === 'Escape') {\n this.hideMenuDisplay();\n }\n };\n\n public onKeyPressAddFragment = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n this.addFragment();\n } else if (event.key === 'Escape') {\n this.hideMenuDisplay();\n }\n };\n\n public getAddButtonMenuId = () => {\n return this.props.index\n ? `add-menu-${this.props.moduleId}-${this.props.slotId}-${this.props.index}`\n : `add-menu-${this.props.moduleId}-${this.props.slotId}`;\n };\n\n public addModule = () => {\n this.toggleMenuDisplay();\n const helper = getRenderingHelper();\n if (helper) {\n helper.addModule(this.props.moduleId, this.props.slotId, this.props.index || 0);\n }\n };\n\n public addFragment = () => {\n this.toggleMenuDisplay();\n const helper = getRenderingHelper();\n if (helper) {\n helper.addFragment(this.props.moduleId, this.props.slotId, this.props.index || 0);\n }\n };\n\n public getLocalizedStringsfromTools = (stringName: string): string => {\n const helper = getRenderingHelper();\n if (helper && typeof helper.getLocalizedString === 'function') {\n return helper.getLocalizedString(stringName);\n }\n return '';\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\nimport { IAny, IGeneric, msdyn365Commerce, IDictionary, IModule } from '@msdyn365-commerce/core-internal';\nimport path from 'path';\nimport { RequestCache } from '@msdyn365-commerce/cache-internal';\nimport { IModuleBinder, IModuleBinderPartial } from '../app-initialization/models';\nimport { loadData } from '../data/load-data';\nimport { CLIENT_ENTRY_POINTS_TYPE } from '../consts';\nimport { optimizedGetAllModules } from '../utils/helpers';\n\nexport type TAsyncClientRenderComponentProps = IGeneric & {\n typeName: string;\n requestCache: RequestCache;\n renderModuleAttributes: (props: IGeneric) => IDictionary;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n componentRef: React.RefObject>;\n renderView: React.FC;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mappedProps: any;\n lazyLoadHandler: () => void;\n scriptInitCompleted: boolean;\n};\n\n/**\n *\n */\nexport class AsyncClientRenderComponent extends React.Component {\n constructor(props) {\n super(props);\n }\n\n public loadScriptAsync = async (moduleChunk: string): Promise => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n document.body.appendChild(script);\n script.type = 'text/javascript';\n script.onload = () => {\n resolve();\n };\n script.onerror = e => {\n console.error(`failed to load module chunk :: ${moduleChunk}`, e);\n };\n script.src = `${moduleChunk}`;\n script.async = false;\n script.defer = false;\n });\n };\n\n public waitAndInitializeModule = async (retryCount: number): Promise => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const bindings = (window as any).__bindings__;\n const registeredModules = bindings.modules;\n\n // lets make sure the script execution is complete before attemtping to render the module\n if (!registeredModules[this.props.mappedProps.typeName] && retryCount < 5) {\n setTimeout(() => this.waitAndInitializeModule(++retryCount), 500);\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const pageContext = (window as any).__msdyn365__.pageContext;\n let allModules: IModule[] = [];\n if (pageContext?.requestContext?.features?.loadData_optimization) {\n allModules = await optimizedGetAllModules(pageContext, pageContext.requestContext);\n } else {\n allModules = await pageContext.allModules(pageContext.requestContext, []);\n }\n const currentModuleArray = allModules.filter(m => m.typeName === this.props.mappedProps.typeName);\n const currentModule = currentModuleArray && currentModuleArray.length > 0 ? currentModuleArray[0] : undefined;\n\n if (!currentModule) {\n return;\n }\n\n // reassign the data actions from window bindings to reflect new data actions from client module\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (msdyn365Commerce as any).bindings.dataActions = bindings.dataActions;\n await loadData(\n [currentModule],\n this.props.mappedProps.context.request,\n this.props.mappedProps.internalTelemetry,\n this.props.mappedProps.internalTelemetry,\n this.props.requestCache,\n null,\n []\n );\n this.props.lazyLoadHandler();\n };\n\n public componentDidMount = async (): Promise => {\n if (msdyn365Commerce.isBrowser) {\n if (this.props.scriptInitCompleted) {\n return this.waitAndInitializeModule(0);\n }\n\n const clientModuleChunks = this.props.requestCache.get({\n typeName: CLIENT_ENTRY_POINTS_TYPE,\n key: this.props.typeName\n })\n ? this.props.requestCache.get({ typeName: CLIENT_ENTRY_POINTS_TYPE, key: this.props.typeName })?.item\n : [];\n\n if (!clientModuleChunks || clientModuleChunks.length === 0) {\n return this.waitAndInitializeModule(0);\n } else {\n const chunksToBeAdded: string[] = [];\n clientModuleChunks?.map(chunk => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const scriptElements = document.getElementsByTagName('script') as any;\n let chunkExistsOnPage = false;\n\n for (const scriptEl of scriptElements) {\n if (scriptEl.src.includes(chunk)) {\n chunkExistsOnPage = true;\n }\n }\n\n if (!chunkExistsOnPage) {\n chunksToBeAdded.push(chunk);\n }\n });\n\n if (chunksToBeAdded.length === 0) {\n // if chunk exists on page, we can render the module with wait time for script execution to avoid race condition(in case if the script exeuction is incomplete)\n return this.waitAndInitializeModule(0);\n }\n\n // add the chunks to the page and render module after script load event\n await Promise.all(\n (chunksToBeAdded || []).map(async moduleChunk => {\n return this.loadScriptAsync(moduleChunk);\n })\n );\n\n return this.waitAndInitializeModule(0);\n }\n }\n };\n\n public render = (): React.ReactNode | null => {\n if (!this.props.scriptInitCompleted) {\n return
;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const registrationBindings = (window as any).__bindings__;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const registeredModules = (msdyn365Commerce as any).bindings.modules;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const platformSettings = (msdyn365Commerce as any).platformSettings;\n const isModuleEntryPointsEnabled = platformSettings && platformSettings.enableModuleEntryPoints;\n if (!registrationBindings.modules[this.props.typeName]) {\n return
;\n }\n\n Object.keys(registrationBindings.modules || []).map(moduleTypeName => {\n if (!registeredModules[moduleTypeName]) {\n const rawModuleRegistrationObj: IModuleBinderPartial = registrationBindings.modules[moduleTypeName];\n const newModuleRegistrationObj: IModuleBinder = {} as IModuleBinder;\n newModuleRegistrationObj.component = isModuleEntryPointsEnabled\n ? function load() {\n return rawModuleRegistrationObj.c();\n } // eslint-disable-next-line @typescript-eslint/no-explicit-any\n : (rawModuleRegistrationObj.c() as any).default;\n newModuleRegistrationObj.moduleDirectory = rawModuleRegistrationObj.md;\n newModuleRegistrationObj.dataActions = rawModuleRegistrationObj.da;\n newModuleRegistrationObj.packageName = rawModuleRegistrationObj.p;\n newModuleRegistrationObj.name = rawModuleRegistrationObj.n;\n newModuleRegistrationObj.definitionPath = path.join(\n rawModuleRegistrationObj.md,\n `${rawModuleRegistrationObj.n}.definition.json`\n );\n newModuleRegistrationObj.parentDefinitionPath = rawModuleRegistrationObj.pdp;\n newModuleRegistrationObj.isNodeModule = rawModuleRegistrationObj.iNM;\n newModuleRegistrationObj.moduleNamespace = rawModuleRegistrationObj.ns;\n newModuleRegistrationObj.chunkName = `${rawModuleRegistrationObj.ns}-${rawModuleRegistrationObj.p}-${rawModuleRegistrationObj.n}`;\n registeredModules[moduleTypeName] = newModuleRegistrationObj;\n }\n });\n\n const moduleBinder = registeredModules[this.props.typeName];\n const Component = isModuleEntryPointsEnabled ? moduleBinder?.component()?.default : moduleBinder.component;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const registeredViews = (msdyn365Commerce as any).bindings.views;\n Object.keys(registrationBindings.viewDictionary || []).map(viewRegistrationKey => {\n if (!registeredViews[viewRegistrationKey]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const rawViewRegistrationObj: any = registrationBindings.viewDictionary[viewRegistrationKey];\n const newViewComponent = isModuleEntryPointsEnabled\n ? function load() {\n return rawViewRegistrationObj.c();\n } // eslint-disable-next-line @typescript-eslint/no-explicit-any\n : rawViewRegistrationObj.c().default;\n registeredViews[viewRegistrationKey] = {};\n registeredViews[viewRegistrationKey].component = newViewComponent;\n }\n });\n\n return (\n \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 { IAny, IGeneric } from '@msdyn365-commerce/core-internal';\nimport React from 'react';\nimport { AddModuleControl, IAddModuleProps } from './add-module-control';\nimport SafeRenderModuleWithContext from './safe-render-module';\n\nexport type IAddModuleWrapperProps = {\n id: string;\n safeRenderProps: IGeneric;\n addModuleProps: IAddModuleProps;\n};\n/**\n * Add module wrapper component: Wraps the safe render component and add module control component inside a div tag to properly render modules with its respective add sibling box on site builder.\n */\nexport class AddModuleWrapper extends React.Component {\n public constructor(props: IAddModuleWrapperProps) {\n super(props);\n }\n public render(): JSX.Element {\n const { safeRenderProps, addModuleProps, ...props } = this.props;\n return (\n
\n \n \n
\n );\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICache, ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport { getPerformanceUtils, ICoreContext, IModule, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\nimport { asSystemMetadata, EXCEPTION_NOMODULEBINDER, LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport React from 'react';\n\nimport { IMSDyn365CommerceExtension } from '../app-initialization/models';\nimport { PAGE_INSIGHTS_VIEWS_KEY } from '../consts';\nimport { getModuleBinder, getModuleName, getPageInsightsCacheKey, isPageInsightsEnabled } from '../utils/helpers';\n\nexport interface IModuleWithView extends IModule {\n View: React.FunctionComponent;\n}\n\nconst getViewBinder = (moduleName: string, viewLookupKey: string, requestCache: ICache, pageInsightsEnabled: boolean) => {\n const view = ((msdyn365Commerce as unknown) as IMSDyn365CommerceExtension).viewBinder(viewLookupKey);\n if (view) {\n if (pageInsightsEnabled) {\n const viewCacheKey = getPageInsightsCacheKey(PAGE_INSIGHTS_VIEWS_KEY);\n const viewInsights = requestCache.get<{}>(viewCacheKey)?.item || {};\n viewInsights[`${moduleName}`] = `${viewLookupKey.replace(/\\|/g, '/')}.view.tsx`;\n requestCache.put(viewCacheKey, { item: viewInsights });\n }\n\n return { key: viewLookupKey, view };\n }\n return undefined;\n};\n\n/**\n * View will be read in following hierarchy\n * 1) __local__|__local__|themes|theme1|views|product-tile OR @msdyn-365-commerce-modules|theme1|modules|theme1|views|product-tile\n * 2) __local__|__local__|modules|product-tile|product-tile OR @msdyn-365-commerce-modules|product-tile|modules|product-tile|product-tile\n */\nconst viewLookupFunc = (moduleBinder, themeBinder, requestCache: ICache, pageInsightsEnabled: boolean) =>\n themeBinder &&\n (getViewBinder(\n moduleBinder.name,\n `__local__|__local__|themes|${themeBinder.name}|views|${moduleBinder.name}`,\n requestCache,\n pageInsightsEnabled\n ) ||\n getViewBinder(\n moduleBinder.name,\n `${themeBinder.moduleNamespace}|${themeBinder.packageName}|modules|${themeBinder.name}|views|${moduleBinder.name}`,\n requestCache,\n pageInsightsEnabled\n ));\n\n/**\n * View will be read from the module\n * __local__|__local__|modules|product-tile|product-tile OR @msdyn-365-commerce-modules|product-tile|modules|product-tile|product-tile\n */\nconst defaultViewLookupFunc = (moduleBinder, requestCache: ICache, pageInsightsEnabled: boolean) => {\n const parentModuleBinder = getModuleBinder(getModuleName(moduleBinder.parentDefinitionPath));\n\n return (\n getViewBinder(\n moduleBinder.name,\n `${moduleBinder.moduleNamespace}|${moduleBinder.packageName}|modules|${moduleBinder.name}|${moduleBinder.name}`,\n requestCache,\n pageInsightsEnabled\n ) ||\n (parentModuleBinder &&\n getViewBinder(\n moduleBinder.name,\n `${parentModuleBinder.moduleNamespace}|${parentModuleBinder.packageName}|modules|${parentModuleBinder.name}|${parentModuleBinder.name}`,\n requestCache,\n pageInsightsEnabled\n ))\n );\n};\n\nconst getView = (moduleBinder, themeBinder, context: ICoreContext) => {\n if (!moduleBinder) {\n return { view: null };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const cache: ICache = (msdyn365Commerce as any).getAppCache(context.actionContext.requestContext);\n const viewCacheKey: ICacheKey = {\n key: `${moduleBinder.name}|${themeBinder ? themeBinder.name : 'no-theme'}`,\n typeName: '__ViewCacheKey__'\n };\n const viewLookupKey = cache.getValue(viewCacheKey);\n const pageInsightsEnabled = isPageInsightsEnabled(context.request.params);\n\n const actionContextData: any = context.actionContext;\n const requestCache: ICache = actionContextData.requestCache;\n if (viewLookupKey) {\n !msdyn365Commerce.isBrowser && actionContextData.requestCache.put(viewCacheKey, { item: viewLookupKey });\n return getViewBinder(moduleBinder.name, viewLookupKey, requestCache, pageInsightsEnabled) || { view: null };\n }\n\n let viewLookup = viewLookupFunc(moduleBinder, themeBinder, requestCache, pageInsightsEnabled);\n\n // If no component found in the theme, search in parent theme (in case of inherited theme)\n if (!viewLookup && themeBinder) {\n const parentThemeName = getModuleName(themeBinder.parentDefinitionPath);\n const parentThemeBinder = getModuleBinder(parentThemeName);\n viewLookup = viewLookupFunc(moduleBinder, parentThemeBinder, requestCache, pageInsightsEnabled);\n }\n\n // If no view file found, fall back to module's default view\n if (!viewLookup) {\n viewLookup = defaultViewLookupFunc(moduleBinder, requestCache, pageInsightsEnabled);\n }\n\n if (viewLookup) {\n cache.put(viewCacheKey, { item: viewLookup.key });\n actionContextData.requestCache.put(viewCacheKey, { item: viewLookup.key });\n return viewLookup;\n }\n\n return { view: null };\n};\n\nconst renderViewForModule: React.FC = (props: T): React.ReactElement | null => {\n props.telemetry.log(LogLevel.Debug, `rendering view-'${props.typeName}' with id-'${props.id}'`);\n const moduleBinder = getModuleBinder(props.typeName);\n if (!moduleBinder) {\n props.context.telemetry.log(LogLevel.Error, EXCEPTION_NOMODULEBINDER, { values: [asSystemMetadata(props.typeName)] });\n return null;\n }\n\n const themeBinder = getModuleBinder(props.context.actionContext.requestContext.params.theme);\n const { view } = getView(moduleBinder, themeBinder, props.context);\n\n if (!view) {\n return props.context.actionContext.requestContext.params.isDebug ? (\n
\n

View not found - location searched at

\n

{`views/${moduleBinder.name}.view.tsx`}

\n

\n {themeBinder\n ? `views/${themeBinder.name}/${moduleBinder.name}.view.tsx`\n : `No theme [${props.context.actionContext.requestContext.params.theme}] found at local/src`}\n

\n

\n {themeBinder\n ? `${\n themeBinder.moduleNamespace !== '__local__'\n ? `${themeBinder.moduleNamespace}/${themeBinder.packageName}/`\n : ''\n }modules/${themeBinder.name}/views/${moduleBinder.name}.view.tsx`\n : `No theme [${props.context.actionContext.requestContext.params.theme}] found at node_modules`}\n

\n

{`${\n moduleBinder.moduleNamespace !== '__local__' ? `${moduleBinder.moduleNamespace}/${moduleBinder.packageName}/` : ''\n }modules/${moduleBinder.name}/${moduleBinder.name}.view.tsx`}

\n
\n ) : null;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const platformSettings = (msdyn365Commerce as any).platformSettings;\n const Component = platformSettings && platformSettings.enableModuleEntryPoints ? view?.component()?.default : view.component;\n // @ts-ignore\n if (props.addChunk) {\n // @ts-ignore\n props.addChunk(view.cn);\n }\n return ;\n};\n\nexport const renderView: React.FC = (props: T): React.ReactElement | null => {\n const performanceUtils = getPerformanceUtils(msdyn365Commerce, props.context.actionContext);\n\n const renderId = performanceUtils?.performanceUtilsPackage.Random.Guid.generateGuid();\n\n performanceUtils?.performanceUtilsPackage.runPreRenderViewPerformanceHook({\n moduleId: props.id,\n moduleTypeName: props.typeName,\n\n renderId: renderId,\n\n internalCache: performanceUtils.cache\n });\n\n const node = renderViewForModule(props);\n\n performanceUtils?.performanceUtilsPackage.runPostRenderViewPerformanceHook({\n moduleId: props.id,\n moduleTypeName: props.typeName,\n\n renderId: renderId,\n\n internalCache: performanceUtils.cache\n });\n\n return node;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IDictionary, IModule } from '@msdyn365-commerce/core-internal';\nimport { EXCEPTION_ERROR_CLIENT_BOUNDARY, InternalTelemetry, LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport { get as _get } from 'lodash';\nimport React, { useMemo } from 'react';\nimport { MODULE_CONFIG_ERRORS_KEY } from '../consts';\nimport { renderView } from './render-view';\nimport { TSafeRenderModuleProps, TSafeRenderModuleState } from './safe-render-module';\n\ntype ErrorType = 'empty' | 'unregistered' | 'error';\n\ninterface IErrorModuleProps extends IModule {\n id: string;\n errorType: ErrorType;\n error: Error;\n message?: string;\n}\n\nconst getStandardErrorModuleMarkup = (props: IErrorModuleProps) => {\n return (\n
\n
{props.id}' threw exception
\n
\n

\n

\n {props.error && props.error.toString()}\n

\n

\n

\n {props.message}\n

\n
\n
\n );\n};\n\n/**\n * The error module\n */\nexport const ErrorModule: React.SFC = (props: IErrorModuleProps) => {\n const params = _get(props, 'context.request.params', {});\n const { isDebug } = params;\n return isDebug || process.env.NODE_ENV === 'development' ? useMemo(() => getStandardErrorModuleMarkup(props), [props]) : null;\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const renderErrorOrPlaceHolderModules = (\n err: Error,\n internalTelemetry: InternalTelemetry,\n mappedProps: any,\n state: TSafeRenderModuleState,\n props: TSafeRenderModuleProps,\n isEditor: boolean,\n renderModuleAttributes: (props: { [x: string]: any }) => IDictionary\n): JSX.Element | undefined => {\n if (!isEditor) {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_ERROR_CLIENT_BOUNDARY, { exception: err });\n return (\n \n );\n }\n /* The following logic helps us retry rendering the component if it previously failed in editor scenario\n There are two cases where we should render the placeholder instead of trying to render the component when authoring\n\n 1. If error state is set because the module threw an error from rendering.\n In this case the module will have an entry in the cache for errors that was set in componentShouldUpdate.\n When a module is ready to retry rendering, clearing it's MODULE_CONFIG_ERRORS_KEY entry will force a retry.\n Should the component fail to render again, the state and cache entry will be re-updated with error(s)\n\n 2. If the module has known config errors, then we should show the placeholder div\n\n */\n let moduleError = props.store.requestCache.get({ typeName: MODULE_CONFIG_ERRORS_KEY, key: props.id });\n if (state.error && moduleError.item && moduleError.item.length > 0) {\n moduleError = [{ property: props.id, message: err.message }];\n } else if (mappedProps.configErrors && mappedProps.configErrors.length > 0) {\n moduleError = mappedProps.configErrors;\n }\n // In an editor scenario, if add/remove module without server refresh feature is enabled\n // SDK will have to place the placeholder module instead of OneRF\n if (\n isEditor &&\n moduleError &&\n moduleError.length > 0 &&\n _get(props, ['context', 'request', 'features', 'enableAuthoringRemoveAndAddModule'], false)\n ) {\n // error module doesnt render 'click here to configure' placeholder module anymore\n // an empty div with module markers data-i attributes is rendered instead\n const dataInfo = [`id:${mappedProps.id}`];\n mappedProps.slotId && dataInfo.push(`s:${mappedProps.slotId}`);\n mappedProps.parentId && dataInfo.push(`p:${mappedProps.parentId}`);\n mappedProps.typeName && dataInfo.push(`t:${mappedProps.typeName}`);\n return
;\n }\n return undefined;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport {\n CoreContext,\n getPerformanceUtils,\n IAddModuleSlot,\n IAny,\n IDictionary,\n IGeneric,\n IModule,\n IModuleContract,\n isAuthoringEditEnabled,\n msdyn365Commerce,\n SDK_FRAGMENT_NAME,\n WithContext\n} from '@msdyn365-commerce/core-internal';\nimport LazyLoad from 'react-lazy-load';\nimport {\n asSystemMetadata,\n EXCEPTION_MISSINGMODULECONFIG,\n EXCEPTION_MODULERENDERFAIL,\n EXCEPTION_NOMODULEBINDER,\n EXCEPTION_UNREGISTEREDMODULEID,\n InternalTelemetry,\n ITelemetry,\n LogLevel\n} from '@msdyn365-commerce/telemetry-internal';\nimport { get as _get } from 'lodash';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport { AsyncClientRenderComponent } from './module-client-render-component';\nimport {\n LAYOUT_MOUNT_POINT,\n MODULE_CONFIG_ERRORS_KEY,\n MODULE_LAYOUT_FIELD,\n SERVER_RENDER_ERROR_CACHE_KEY,\n MODULE_CONFIG_KEY\n} from '../consts';\nimport { PageContext } from '../store/page-context';\nimport { AddControlMode, AddModuleControl } from './add-module-control';\nimport { AddModuleWrapper } from './add-module-wrapper';\nimport { ErrorModule, renderErrorOrPlaceHolderModules } from './error-module';\nimport { renderView } from './render-view';\nimport { isLazyRenderModuleEnabled } from '../utils/helpers';\n\ntype ErrorInfo = {\n componentStack: string;\n};\n\nexport type TSafeRenderModuleState = {\n error?: Error;\n info?: ErrorInfo;\n isRegistered?: boolean;\n isConfigured?: boolean;\n isLazyLoaded?: boolean;\n mounted?: boolean;\n};\n\n/**\n * Known types on the props\n */\nexport type TSafeRenderModuleProps = IGeneric & {\n telemetry: ITelemetry;\n internalTelemetry: InternalTelemetry;\n};\n\n/**\n * Component to render module\n */\n@observer\nexport class SafeRenderModule extends React.Component {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private componentRef: React.RefObject>;\n private shouldDisplayErrors: boolean = false;\n private isRenderAttrributeCalled: boolean = false;\n private disableSSRErrorChecks?: boolean = false;\n private renderCallsCounter = 0;\n private mobxShouldComponentUpdate;\n\n public static getDerivedStateFromError(error: Error): TSafeRenderModuleState {\n return { error: error };\n }\n\n constructor(props: TSafeRenderModuleProps) {\n super(props);\n\n this.state = {\n error: undefined,\n info: undefined,\n isConfigured: true,\n isRegistered: true,\n mounted: false\n };\n this.componentRef = React.createRef();\n this.shouldDisplayErrors = props && props.context ? props.context.request.params.isDebug : true;\n\n // If App Setting to disable server-side rendering error checks is true then instead of rendering each module\n // separately and potentially containing each one in an error-boundary in case of an error,\n // safe-render-module will instead render all modules together in one pass for improved performance.\n this.disableSSRErrorChecks = props.context && props.app && props.app.platform && props.app.platform.disableServerSideErrorChecking;\n\n // In the event that this is being rendered in editor or debug mode we will override this setting to render each individual module separately\n // to catch module errors at the cost of performance\n this.disableSSRErrorChecks =\n this.disableSSRErrorChecks && !props.context.request.params.isDebug && !props.context.request.params.isEditor;\n\n this.props.internalTelemetry.log(\n LogLevel.Debug,\n `Safe Render module constructor type-'{typeName}' with id-'{id} and is ${\n this.disableSSRErrorChecks ? 'not ' : ''\n }running in error check mode.'`,\n {\n values: [asSystemMetadata(this.props.typeName), asSystemMetadata(this.props.id)]\n }\n );\n\n this.mobxShouldComponentUpdate = this.shouldComponentUpdate;\n this.shouldComponentUpdate = this.customShouldComponentUpdate;\n }\n\n public componentDidMount(): void {\n if (!this.state.mounted) {\n this.setState({ mounted: true });\n }\n\n if (this.isRenderAttrributeCalled) {\n return;\n }\n\n this._setErrorStates();\n this._setDataAttributes();\n\n this._initializePerformanceComponent();\n }\n\n public customShouldComponentUpdate(nextProps: TSafeRenderModuleProps, nextState: TSafeRenderModuleState): boolean {\n if (this._isEditorial()) {\n if (nextState.error) {\n this.props.store.requestCache.put(\n { typeName: MODULE_CONFIG_ERRORS_KEY, key: this.props.id },\n { item: [{ property: this.props.id, message: nextState.error.message }] }\n );\n }\n }\n\n return this.mobxShouldComponentUpdate(nextProps, nextState);\n }\n\n public componentDidUpdate(): void {\n if (this.isRenderAttrributeCalled) {\n return;\n }\n\n this._setErrorStates();\n this._setDataAttributes();\n }\n\n public componentDidCatch(error: Error, info: ErrorInfo): void {\n this.setState({ error, info });\n }\n\n public render(): JSX.Element | null {\n const performanceUtils = getPerformanceUtils(msdyn365Commerce, this.props.context.actionContext);\n\n const renderId = performanceUtils?.performanceUtilsPackage.Random.Guid.generateGuid();\n\n performanceUtils?.performanceUtilsPackage.runPreRenderPerformanceHook({\n moduleId: this.props.id,\n moduleTypeName: this.props.typeName,\n\n renderId: renderId,\n renderCallIndex: ++this.renderCallsCounter,\n\n internalCache: performanceUtils.cache\n });\n\n const node = this._renderModule();\n\n performanceUtils?.performanceUtilsPackage.runPostRenderPerformanceHook({\n moduleId: this.props.id,\n moduleTypeName: this.props.typeName,\n\n renderId: renderId,\n\n internalCache: performanceUtils.cache\n });\n\n return node;\n }\n\n private _initializePerformanceComponent(): void {\n const performanceUtils = getPerformanceUtils(msdyn365Commerce, this.props.context.actionContext);\n performanceUtils?.performanceUtilsPackage.initializePerformance(\n () => performanceUtils.cache,\n () => this.props.context.actionContext\n );\n }\n\n // eslint-disable-next-line complexity\n private _renderModule(): JSX.Element | null {\n const config = this.props.config;\n const { internalTelemetry } = this.props;\n internalTelemetry.log(LogLevel.Debug, `Safe Render module render type-'{typeName}' with id-'{id}'`, {\n values: [asSystemMetadata(this.props.typeName), asSystemMetadata(this.props.id)]\n });\n const isMounted = this.state.mounted;\n const mappedProps = mapStateToProps(this.props.store, this.props, isMounted);\n const { id, typeName } = mappedProps && mappedProps.id ? mappedProps : this.props;\n const configErrors = mappedProps.configErrors;\n\n // in development mode, check if there is any server render error for module. If so, render error module so developer can address the issue.\n if (process.env.NODE_ENV === 'development' && !this.props.store.requestContext.features.disable_render_module_server_error) {\n const serverRenderError =\n this.props.store.requestCache?.internalCache && this.props.store.requestCache.internalCache[SERVER_RENDER_ERROR_CACHE_KEY];\n\n if (serverRenderError) {\n const moduleWithError = serverRenderError[this.getModuleServerRenderCacheKeyName(this.props.id, this.props.typeName)];\n if (moduleWithError && moduleWithError.item) {\n return (\n \n );\n }\n }\n }\n\n const Component = mappedProps.component as React.ComponentClass;\n const lazyRenderModuleEnabled = isLazyRenderModuleEnabled(this.props.store.requestContext);\n\n // the component is missing and lazy loading isn't turned on (Either entirely OR for this specific module)\n if (!Component && (!lazyRenderModuleEnabled || !config?.clientRender)) {\n const message = internalTelemetry.stringFormat(EXCEPTION_UNREGISTEREDMODULEID, [id, typeName]);\n internalTelemetry.log(LogLevel.Error, message);\n return (\n \n );\n }\n\n const err = this.state.error || (configErrors && configErrors.length && new Error(configErrors.map(x => x.message).join(', ')));\n if (err) {\n const element = renderErrorOrPlaceHolderModules(\n err,\n internalTelemetry,\n mappedProps,\n this.state,\n this.props,\n this._isEditorial(),\n this.renderModuleAttributes\n );\n if (element) {\n return element;\n }\n }\n\n if (process.env.CURRENT_ENVIRONMENT === 'node') {\n if (config && config.hasOwnProperty('clientRender') && config.clientRender && !this._isEditorial()) {\n if (lazyRenderModuleEnabled) {\n return
;\n }\n\n return ;\n } else {\n return this._doServerSideRender(mappedProps, Component, internalTelemetry);\n }\n } else if (!this.state.mounted && this.props.store.deferred(this.props.id)) {\n // module needs two passes\n return null;\n } else if (config && config.hasOwnProperty('clientRender') && config.clientRender && !this._isEditorial()) {\n if (lazyRenderModuleEnabled) {\n if (this.state.isLazyLoaded) {\n return (\n \n );\n }\n return (\n \n \n \n );\n } else if (this.state.mounted) {\n return (\n \n );\n } else {\n return ;\n }\n }\n\n return (\n \n );\n }\n\n private lazyLoadHandler = () => {\n this.setState({ isLazyLoaded: true });\n };\n\n private renderModuleAttributes = (props: IGeneric): IDictionary => {\n this.isRenderAttrributeCalled = true;\n\n if (!props || !props.id) {\n return {};\n }\n\n // Construct telemetry attributes for module\n const telemetryId: string = props.friendlyName || props.id;\n const telemetryAttributes: IDictionary =\n this.props.internalTelemetry && this.props.internalTelemetry.setTelemetryAttribute\n ? this.props.internalTelemetry.setTelemetryAttribute(telemetryId)\n : {};\n\n const moduleAttributes: IDictionary = { 'data-m-t': props.typeName, ...telemetryAttributes };\n if (this.shouldDisplayErrors || this._isEditorial()) {\n moduleAttributes['data-i'] = this._setDataInfoAttribute(props);\n }\n\n if (props.platform && typeof props.platform === 'object') {\n Object.keys(props.platform).forEach(key => {\n moduleAttributes[`data-m-${key}`] = props.platform[key];\n });\n }\n\n // If a module is associated with an experiment, add this attribtue to track when to activate the experiment\n if (props.context.request && props.context.request.experiments?.moduleIdToExperimentIdMap) {\n if (props.context.request.experiments.moduleIdToExperimentIdMap[props.id]) {\n moduleAttributes[`data-exp`] = `id:${props.context.request.experiments.moduleIdToExperimentIdMap[props.id]}`;\n }\n }\n // In editor scenario, Authoring will update the module layout by sending us updates on\n // the MODULE_LAYOUT_FIELD in the config object\n\n if (this._isEditorial() && props.config && props.config[MODULE_LAYOUT_FIELD]) {\n moduleAttributes[`data-m-layout`] = props.config[MODULE_LAYOUT_FIELD];\n }\n\n return moduleAttributes;\n };\n\n /**\n * Set the data info attribute to be added to the modules\n * @param props The module props.\n */\n private _setDataInfoAttribute(props: IGeneric): string {\n const dataInfo = [`id:${props.id}`];\n props.slotId && dataInfo.push(`s:${props.slotId}`);\n props.parentId && dataInfo.push(`p:${props.parentId}`);\n props.typeName && dataInfo.push(`t:${props.typeName}`);\n props.friendlyName && dataInfo.push(`fn:${props.friendlyName}`);\n const moduleBinder = (msdyn365Commerce as any).moduleBinder(props.typeName);\n if (moduleBinder) {\n moduleBinder.$type && dataInfo.push(`mt:${moduleBinder.$type}`);\n }\n props.errorType && dataInfo.push(`e:${props.errorType}`);\n return `{${dataInfo.join(',')}}`;\n }\n\n /**\n * isEditor\n * Determines if request is coming from the editor\n */\n private _isEditorial(): boolean {\n return _get(this.props, ['context', 'request', 'params', 'isEditor'], false);\n }\n\n /**\n * Creates data info string to be used by cms e.g '{id:prop-id,s:content,p:parent-id}'\n */\n private _generateDataInfo(): string {\n const dataInfo = [`id:${this.props.id}`];\n this.props.slotId && dataInfo.push(`s:${this.props.slotId}`);\n this.props.parentId && dataInfo.push(`p:${this.props.parentId}`);\n this.props.typeName && dataInfo.push(`t:${this.props.typeName}`);\n this.props.friendlyName && dataInfo.push(`fn:${this.props.friendlyName}`);\n const moduleBinder = (msdyn365Commerce as any).moduleBinder(this.props.typeName);\n if (moduleBinder) {\n moduleBinder.$type && dataInfo.push(`mt:${moduleBinder.$type}`);\n }\n\n // Error scenarios\n // 1. Empty module\n // 2. Unregistered module\n // 3. Generic error\n !this.state.isConfigured && dataInfo.push('e:empty');\n !this.state.isRegistered && dataInfo.push('e:unregistered');\n this.state.error && dataInfo.push('e:error');\n\n return `{${dataInfo.join(',')}}`;\n }\n\n /**\n * Conducts the server side render and returns the result.\n * If disable SSR Error Checking flag is turned on, the React Element is returned immediately,\n * otherwise the render result is calculated using renderToString to catch errors\n * and defer modules (used for editor and debug scenarios)\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _doServerSideRender(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mappedProps: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Component: React.ComponentClass<{}, any>,\n internalTelemetry: InternalTelemetry\n ): JSX.Element {\n let renderHtmlString: string;\n const renderHtml = (\n \n \n \n );\n if (this.disableSSRErrorChecks) {\n // In non editorial or non debug mode and if app setting to disable server side error checking is turned on\n // return the JSX directly without computing the render result to save time and compute cost\n return renderHtml;\n } else {\n try {\n // eslint-disable-next-line\n renderHtmlString = require('react-dom/server').renderToString(renderHtml);\n if (!renderHtmlString.length) {\n // module returned null\n this.props.store.markModuleAsDeferred(this.props.id);\n }\n } catch (e) {\n this.addFailingModuleServerRenderToCache(e);\n\n internalTelemetry.log(LogLevel.Error, `Safe Render module Failed to render type-'{typeName}' with id-'{id}'`, {\n exception: e,\n values: [asSystemMetadata(this.props.typeName), asSystemMetadata(this.props.id)]\n });\n return (\n \n );\n }\n return React.createElement(SDK_FRAGMENT_NAME, { key: this.props.id, dangerouslySetInnerHTML: { __html: renderHtmlString } });\n }\n }\n\n private addFailingModuleServerRenderToCache(error: any) {\n const cacheKey = this.buildModuleServerRenderCacheKey(this.props.id, this.props.typeName);\n const cacheItem = {\n item: {\n moduleId: this.props.id,\n moduleType: this.props.typeName,\n errorName: error && error.name,\n errorMessage: error && error.message,\n errorStack: error && error.stack\n }\n };\n\n this.props.store.requestCache.put(cacheKey, cacheItem);\n }\n\n private buildModuleServerRenderCacheKey(moduleId: string, moduleType: string): ICacheKey {\n return {\n key: this.getModuleServerRenderCacheKeyName(moduleId, moduleType),\n typeName: SERVER_RENDER_ERROR_CACHE_KEY\n };\n }\n\n private getModuleServerRenderCacheKeyName(moduleId: string, moduleType: string): string {\n return `${moduleId}:${moduleType}`.toUpperCase();\n }\n\n /**\n * Assignes data-i and data-t attributes to child component if isEditor is enabled\n */\n private _setDataAttributes(): void {\n let refNode;\n if (this._isEditorial()) {\n // If type name only exists on the props then this module is not registered.\n if (this.state.error || !this.state.isRegistered || !this.state.isConfigured) {\n refNode = document.getElementById(this.props.id);\n } else if (this.componentRef.current) {\n /* eslint-disable react/no-find-dom-node */\n refNode = this.props.root\n ? document.getElementById(LAYOUT_MOUNT_POINT)\n : (ReactDOM.findDOMNode(this.componentRef.current) as Element);\n }\n }\n\n if (refNode && typeof refNode.setAttribute === 'function') {\n refNode.setAttribute('data-i', this._generateDataInfo());\n }\n }\n\n private _setErrorStates(): void {\n const isMounted = this.state.mounted;\n const mappedProps = mapStateToProps(this.props.store, this.props, isMounted);\n\n // Registration check\n const isRegistered = !!mappedProps.component;\n if (isRegistered !== this.state.isRegistered) {\n this.setState({ ...this.state, isRegistered: isRegistered });\n return;\n }\n\n // Configuration check\n const isConfigured = !(mappedProps.configErrors && mappedProps.configErrors.length > 0);\n if (isConfigured !== this.state.isConfigured) {\n this.setState({ ...this.state, isConfigured: isConfigured });\n return;\n }\n }\n}\n\nexport const getRenderSlotComponent = (\n requestCache: any,\n parentProps: IGeneric,\n moduleConfigs: IModuleContract[],\n slotId: string,\n addSiblingIndices?: number[],\n isMounted?: boolean\n): React.ReactNode[] => {\n if (!moduleConfigs) {\n return [];\n }\n\n const canAddAtIndex = (index: number) => {\n return addSiblingIndices ? addSiblingIndices.indexOf(index + 1) >= 0 : false;\n };\n // if addSiblingIndices is not undefined, we add the AddModuleControl components between each module; but in hidden state if index value isnt provider\n // this prevents re-rendering of the module when the AddModuleControl components are enabled/disabled\n // in preview mode, addSiblingIndices will be undefined and we will only render the modules\n return moduleConfigs.map((moduleConfig: IModuleContract, index: number) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const config =\n (!!!parentProps?.store?.requestContext?.features?.disable_moduleConfig_optimize &&\n requestCache.getValue({ typeName: MODULE_CONFIG_KEY, key: moduleConfig.id })) ||\n moduleConfig.config;\n return addSiblingIndices && isMounted ? (\n \n ) : (\n \n );\n });\n};\n\n/**\n * Maps the application state to the modules props\n * @param state The application state\n * @param ownProps The props for the specific module\n */\nexport const mapStateToProps = (store: PageContext, props: TSafeRenderModuleProps, isMounted?: boolean): IModule> => {\n try {\n const { internalTelemetry } = props;\n const moduleConfig = getModuleConfig(store, props.id);\n const requestCache = store.requestCache;\n if (!moduleConfig) {\n internalTelemetry.log(\n LogLevel.Error,\n internalTelemetry.stringFormat(EXCEPTION_MISSINGMODULECONFIG, [props.id, props.typeName])\n );\n return {} as IModule>;\n }\n\n // TODO - following statements introducing side effect in render method (props should not change in render). Please take a look after public preview\n // Pull value out of stuff that came from cache (doing this gives us reactivity via MobX)\n Object.keys(moduleConfig.data).forEach(key => {\n if (moduleConfig.data[key] && moduleConfig.data[key].Item) {\n moduleConfig.data[key] = moduleConfig.data[key].Item;\n }\n });\n\n const moduleBinder = (msdyn365Commerce as any).moduleBinder(moduleConfig.typeName);\n if (!moduleBinder && !isLazyRenderModuleEnabled(store.requestContext)) {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_NOMODULEBINDER, { values: [asSystemMetadata(moduleConfig.typeName)] });\n return {} as IModule>;\n }\n const enableAddModuleControls = isAuthoringEditEnabled(store.requestContext);\n const platformSettings = (msdyn365Commerce as any).platformSettings;\n const componentBinder =\n platformSettings && platformSettings.enableModuleEntryPoints\n ? moduleBinder && moduleBinder?.component()?.default\n : moduleBinder && moduleBinder.component;\n\n return {\n ...props,\n ...moduleConfig,\n component: componentBinder,\n slots: enableAddModuleControls\n ? getSlotDictionary(requestCache, props, moduleConfig.slotsForAddModule, isMounted)\n : getSlotDictionary(requestCache, props)\n };\n } catch (e) {\n props.internalTelemetry.log(LogLevel.Error, props.internalTelemetry.stringFormat(EXCEPTION_MODULERENDERFAIL, [props.id]), {\n exception: e\n });\n return {} as IModule>;\n }\n};\n\nconst getModuleConfig = (store: PageContext, moduleId: string): IModule => {\n return store.modules(moduleId);\n};\n\nconst getSlotDictionary = (\n requestCache: any,\n props: IGeneric,\n slotsForAddModule?: IAddModuleSlot[],\n isMounted?: boolean\n): IDictionary => {\n const slotDictionary: IDictionary = {};\n const { modules } = props;\n const slotsWithAddModuleControls = (slotsForAddModule || []).filter(a => !a.index && a.slotName);\n const addSiblingIndexDictionary: { [key: string]: number[] } = {};\n (slotsForAddModule || [])\n .filter(a => a.index && !a.slotName)\n .forEach(a => {\n addSiblingIndexDictionary[a.slotId] = a.index || [];\n });\n // removes placeholder 'click here to configure' modules\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const getNonPlaceholderModules = (mods: any[]) => {\n return mods.filter(a => a.typeName !== 'place-holder-for-container-preview');\n };\n if (modules) {\n Object.keys(modules).forEach((key: string) => {\n slotDictionary[key] = getRenderSlotComponent(\n requestCache,\n props,\n getNonPlaceholderModules(modules[key]),\n key,\n slotsForAddModule ? addSiblingIndexDictionary[key] || [] : undefined,\n isMounted\n );\n });\n }\n slotsWithAddModuleControls.forEach((slot: IAddModuleSlot) => {\n if (isMounted && (!modules || !modules[slot.slotId] || getNonPlaceholderModules(modules[slot.slotId]).length === 0)) {\n slotDictionary[slot.slotId] = [\n \n ];\n }\n });\n return slotDictionary;\n};\n\nconst SafeRenderModuleWithContext = WithContext(SafeRenderModule);\nexport default SafeRenderModuleWithContext;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Default mount point name\n */\nexport const LAYOUT_MOUNT_POINT = 'renderPage';\n\n/**\n * Default Proxy Address\n */\nexport const DEFAULT_PROXY_HOST = 'http://127.0.0.1';\n\n/**\n * Default Proxy Port\n */\nexport const DEFAULT_PROXY_PORT = 8888;\n\n/**\n * Default request timeout in ms (1m default);\n */\nexport const DEFAULT_REQUEST_TIMEOUT: number = parseInt(process.env.REQUEST_TIMEOUT || '60000', 10);\n\nexport const GLIMPSE_LOGGER_NAME = '__INTERNAL_GLIPMPSE_LOGGER_!@';\nexport const PAGE_LOGGER_NAME = '__PAGE_LOGGER__';\n\n/**\n * appCacheSetting Name\n */\n\nexport const CACHE_SETTING = '__CACHE_SETTINGS';\n\n/**\n * const for client entry points type\n */\nexport const CLIENT_ENTRY_POINTS_TYPE = '__CEP__';\n\n/**\n * PDP PageType Name\n */\nexport const PDP_PAGE_NAME = 'product';\n\n/**\n * Product recommendtion list\n */\nexport const PRODUCT_RECOMMENDATION_LIST = 'pal';\n\n/**\n * Frequently bought together recommendation list\n */\nexport const FREQUENTLY_BOUGHT_TOGETHER_LIST = 'fbt';\n\n/**\n * Picks for you recommendation list\n */\nexport const PICKS_FOR_YOU_LIST = 'picks';\n\n/**\n * Category PageType Name\n */\nexport const CATEGORY_PAGE_NAME = 'category';\n\n/**\n * List PageType Name\n */\nexport const LIST_PAGE_NAME = 'list';\n\n/*\n * Cache key for module\n */\nexport const MODULE_CACHE_KEY: string = '__M';\n\n/**\n * Cache key for module config\n */\nexport const MODULE_CONFIG_KEY: string = '__MC';\n\n/**\n * Cache key for module disabled properties\n */\nexport const MSDYN365_WYSIWYG_DISABLED_PROPS = '__MDP';\n\n/**\n * Cache key for module disabled properties\n */\nexport const MSDYN365_WYSIWYG_CANADDMODULE = '__MCA';\n\n/**\n * Cache key for module config errors\n */\nexport const MODULE_CONFIG_ERRORS_KEY: string = '__MCE';\n\n/**\n * Cache key for module data\n */\nexport const MODULE_DATA_KEY: string = '__MD';\n\n/**\n * Cache key for module resources\n */\nexport const MODULE_RESOURCES_KEY: string = '__MR';\n\n/**\n * Cache key for module action\n */\nexport const MODULE_ACTION_KEY: string = '__MA';\n\n/**\n * Cache key for module deferred render\n */\nexport const MODULE_DEFERRED_KEY: string = '__MDR';\n\n/**\n * Cache key for module view cache\n */\nexport const MODULE_VIEW_CACHE_KEY = '__VIEWCACHEKEY__';\n\n/**\n * Cache key for module render to string result\n */\nexport const MODULE_RENDER_RESULT_CACHE_KEY = '__MODULE_RENDER_RESULT__';\n\n/**\n * Server Render Error Cache key type\n */\nexport const SERVER_RENDER_ERROR_CACHE_KEY = '__SERVER_RENDER_ERROR__';\n\n/**\n * Cache key for page render results\n */\nexport const PAGE_RENDER_RESULT_CACHE_KEY = '__PAGE_RENDER_RESULT__';\n\n/**\n * Cache key for page insights view extensions\n */\nexport const PAGE_INSIGHTS_VIEWS_KEY = '__VIEW_INSIGHTS__';\n\n/**\n * Cache key for page insights view extensions\n */\nexport const PAGE_INSIGHTS_COMPONENTS_KEY = '__COMPONENT_INSIGHTS__';\n\n/**\n * Cache key for page insights view extensions\n */\nexport const PAGE_INSIGHTS_ACTIONS_KEY = '__ACTION_INSIGHTS__';\n\n/**\n * Cache key for page insights retail api data\n */\nexport const PAGE_INSIGHTS_API_KEY = '__API_INSIGHTS__';\n\n/**\n * The Prefix for the module lazyload feature switch\n */\nexport const LAZYLOAD_SWITCH_PREFIX = 'lazyload_';\n\n/**\n * DEPRECATED Client Render Complete Event Name\n */\nexport const DEPRECATED_CLIENT_RENDER_COMPLETE_EVENT = '_msdyn365_client_render_complete';\n\n/**\n * Client Data Update Event Name\n */\nexport const CLIENT_DATA_UPDATE_EVENT = '_msdyn365_client_data_update';\n\n/**\n * Client Render Complete Event Name\n */\nexport const CLIENT_RENDER_START_EVENT = '_msdyn365_client_render_start';\n\n/**\n * Client Render Complete Event Name\n */\nexport const CLIENT_RENDER_COMPLETE_EVENT = '_msdyn365_client_render_complete';\n\n/**\n * Event that fires when Authoring module or fragment add operation completes rendering\n */\nexport const AUTHORING_ADD_RENDER_COMPLETE_EVENT = '_msdyn365_authoring_add_render_complete';\n\n/**\n * User Consent Given Event Name\n */\nexport const USER_CONSENT_GIVEN_EVENT = '_msdyn365_user_consent_given';\n\n/**\n * Field name of the module layout that authoring sends\n */\nexport const MODULE_LAYOUT_FIELD = 'msdyn365__moduleLayout';\n\n/**\n * Process type enum\n */\nexport const enum PROCESS_TYPE {\n server = 'server',\n client = 'client'\n}\n/**\n * The retail server base URL request header key.\n */\nexport const RETAIL_SERVER_BASE_URL_HEADER_KEY = `x-rs-base-url`;\n/**\n * Error message for when the provider get experiments function fails.\n */\nexport const PROVIDER_GET_EXPERIMENTS_FAIL = 'Provider get experiments call failed. Retail Server Base URL: \"{retailServerBaseUrl}\"';\n\n/**\n * Error message for when the retail server api call fail.\n */\nexport const GET_FEATURE_STATES_API_CALL_FAIL = 'The retail server getFeatureStatesAsync API call failed.';\n\n/**\n * Error message for when the internal get feature states data action fail.\n */\nexport const GET_FEATURE_STATES_INTERNAL_DATA_ACTION_FAIL = 'The internal get feature states data action failed.';\n\n/**\n * Error message for when the internal get feature states data action fail.\n */\nexport const ERROR_PROCESSING_APP_SETTINGS = 'Error processing application settings.';\n\n/**\n * Error message for missing required chunks\n */\nexport const ERROR_MISSING_REQUIRED_CHUNKS = `Failed to get required chunks for module '{moduleId}' of type '{moduleType}'. List of missing chunks: '{listOfMissingChunks}'`;\n\n/**\n * The feature states.\n */\nexport const FEATURE_STATE = {\n ON: 'ON',\n OFF: 'OFF'\n};\n\n/**\n * Application settings configs feature management properties.\n */\nexport const APP_SETTINGS_CONFIG_PROPS = {\n DISABLED_WITH_FEATURE_FLAGS: 'disabledWithFeatureFlags',\n HIDDEN_WITH_FEATURE_FLAGS: 'hiddenWithFeatureFlags',\n DISABLED: 'disabled',\n HIDDEN: 'hidden'\n};\n\n/**\n * Cache type name for module css chunks\n */\nexport const MODULE_CSS_CACHE_TYPENAME = '__ModuleCssChunks__';\n\n/**\n * Cache key name for module css chunks\n */\nexport const MODULE_CSS_CACHE_KEY = 'module-css-chunks';\n\n/**\n * Cache key name for module css chunks\n */\nexport const INLINE_MODULE_CSS_CACHE_KEY = 'inline-module-css-chunks';\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICache } from '@msdyn365-commerce/cache-internal';\nimport {\n IDataActionOptions,\n IDictionary,\n IRequestContext,\n IResourceManager,\n IThemeModule,\n MSDyn365Commerce\n} from '@msdyn365-commerce/core-internal';\nimport * as React from 'react';\n\nexport interface IDataAction {\n moduleName?: string;\n id: string;\n name: string;\n path: string;\n runOn: ActionRuntime;\n options?: IDataActionOptions;\n}\n\nexport enum ActionRuntime {\n server,\n client,\n serverOnly\n}\n\nexport interface IModuleDefinition {\n name: string;\n}\n\nexport interface IModuleBinder {\n $type: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n componentAsync: () => Promise;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n component: any;\n dataActions: IDataAction[];\n definitionExtensions?: string[];\n definitionPath: string;\n isNodeModule: boolean;\n moduleNamespace: string;\n chunkName: string;\n name: string;\n packageName: string;\n pages?: IDictionary;\n parentDefinitionPath: string;\n path: string;\n segments: string[];\n moduleDirectory: string;\n themeSettings: string;\n}\n\nexport interface IModuleBinderPartial {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n c: () => Promise;\n mn: string;\n md: string;\n da: IDataAction[];\n p: string;\n n: string;\n pdp: string;\n iNM: boolean;\n ns: string;\n}\n\nexport interface IPrototype {\n prototype: IMSDyn365CommerceExtension;\n}\n\ninterface IDAPIBindings {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n modules: IDictionary;\n themes: IThemeModule[];\n}\n\nexport interface IBinding {\n modules: IDictionary;\n dataActions: IDictionary;\n partnerDataActions: IDictionary;\n views: IDictionary;\n components: IDictionary;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n connectors: IDictionary;\n dapi: IDAPIBindings;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- NPM package source.\n perfAnalysisLibBinding: any;\n}\n\nexport interface IMSDyn365CommerceExtension {\n bindings: IBinding;\n appCache: IDictionary;\n resourceManager: IResourceManager;\n getResourceManager(): IResourceManager;\n getPartnerOverrideAction(id: string): Function;\n dataAction(name: string): Function;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getConnector(name: string): any;\n getAppCache(requestContext: IRequestContext): ICache;\n moduleBinder(name: string): IModuleBinder;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n viewBinder(name: string): any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n componentBinder(name: string): any;\n getAllModuleBinder(): IModuleBinder[];\n updatePrivateVariable(): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Returns NPM package source.\n perfAnalysisBinder(): any;\n}\n\nexport type IMSDyn365CommerceWithPrototype = typeof MSDyn365Commerce & IPrototype;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ActionContext, addLocaleInformation, IRefreshConfigs } from '@msdyn365-commerce/action-internal';\nimport { ICache, ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport {\n IAction,\n IActionInput,\n IDataActionOptions,\n IDictionary,\n IModuleContract,\n IRequestContext,\n msdyn365Commerce\n} from '@msdyn365-commerce/core-internal';\nimport {\n asSystemMetadata,\n EXCEPTION_DATAACTION_EXECUTION,\n EXCEPTION_LOADDATA_ACTION_0,\n EXCEPTION_LOADDATA_ACTION_1,\n EXCEPTION_LOADDATA_ACTION_2,\n InternalTelemetry,\n ITelemetry,\n LogLevel,\n MESSAGE_CREATE_INPUT_LOADDATA\n} from '@msdyn365-commerce/telemetry-internal';\nimport { ActionRuntime, IDataAction } from '../app-initialization/models';\nimport { LAZYLOAD_SWITCH_PREFIX, PAGE_INSIGHTS_ACTIONS_KEY } from '../consts';\nimport { combineExtendedDataActionToModule } from '../utils/data-action-extension-helper';\nimport { getPageInsightsCacheKey, isPageInsightsEnabled, timeSliceLongJSTask } from '../utils/helpers';\n\nexport interface IDataActionMetadata {\n dataActionFunction: IAction;\n inputs: IActionInput[];\n name: string;\n runOn: ActionRuntime;\n id: string;\n options?: IDataActionOptions;\n}\n\n/**\n * Method which stores temporary async results in the cache for actions which\n * will be run at a later time\n * @param tempMetadataList The list of actions which need temporary AsyncResults\n * @param requestCache The request cache\n */\nconst storeTemporaryAsyncResults = (tempMetadataList: IDataActionMetadata[], requestCache: ICache): void => {\n const tempResultCacheItem = { item: { _type: 'AsyncResult', status: 'LOADING', runOn: 'client' } };\n\n // Insert fake temporary AsyncResults for actions that will be deferred to client\n tempMetadataList.forEach(tempMetadata => {\n // Non-observable and instance actions should not get a temp promise\n const firstInput = Array.isArray(tempMetadata.inputs) ? tempMetadata.inputs[0] : tempMetadata.inputs;\n if (\n !tempMetadata.dataActionFunction.prototype.isObservable ||\n !tempMetadata.inputs ||\n (firstInput && firstInput.dataCacheType && firstInput.dataCacheType() === 'instance')\n ) {\n return;\n }\n\n if (!Array.isArray(tempMetadata.inputs)) {\n tempMetadata.inputs = [tempMetadata.inputs];\n }\n\n tempMetadata.inputs.forEach(tempInput => {\n // Don't add temp promise if there is a mock or if the resolved data has already been inserted into the cache\n if (\n requestCache.get({ key: `${tempInput.getCacheObjectType()}:${tempInput.getCacheKey()}`, typeName: '__MOCK' }) ===\n undefined &&\n requestCache.get({ key: `${tempInput.getCacheKey()}`, typeName: tempInput.getCacheObjectType() }) === undefined\n ) {\n requestCache.put({ key: tempInput.getCacheKey(), typeName: tempInput.getCacheObjectType() }, tempResultCacheItem);\n }\n });\n });\n};\n\n/**\n * Runs all the data actions specificed in module definitions present on the page\n */\nexport const loadData = async (\n modules: IModuleContract[],\n context: IRequestContext,\n internalTelemetry: InternalTelemetry,\n moduleTelemetry: ITelemetry,\n requestCache: ICache,\n appCache: ICache | null,\n complexDataTypesPromises?: Promise[]\n): Promise => {\n if (!modules || modules.length === 0) {\n return [];\n }\n\n const dataActionMetadataList: IDataActionMetadata[] = [];\n const lazyLoadModuleIds: { [index: string]: boolean } = {};\n const tempMetadataList: IDataActionMetadata[] = [];\n\n // Note: What modules will need to be lazyloaded due to feature switches\n storeLazyloadModuleId(context, lazyLoadModuleIds);\n loadDataProcessing(modules, lazyLoadModuleIds, context, internalTelemetry, dataActionMetadataList, tempMetadataList, requestCache);\n storeTemporaryAsyncResults(tempMetadataList, requestCache);\n\n await timeSliceLongJSTask(context);\n\n if (dataActionMetadataList.length === 0) {\n // When there is no data actions, we still need to resolve complexTypePromises\n if (complexDataTypesPromises) {\n await Promise.all(complexDataTypesPromises);\n }\n return [];\n }\n\n const actionContext = new ActionContext({\n id: 'T1',\n requestContext: context,\n requestCache: requestCache,\n expectedActionCount: dataActionMetadataList.length,\n telemetry: moduleTelemetry,\n appCache\n });\n\n const promises = processDataActionMetadataList(actionContext, dataActionMetadataList, internalTelemetry);\n\n if (complexDataTypesPromises) {\n promises.push(...complexDataTypesPromises);\n }\n\n await Promise.all(promises);\n\n return actionContext.getRefreshActions();\n};\n\nconst fetchDataActionWithActionid = (lookupId: string) => {\n const dataActionFunction = (msdyn365Commerce).dataAction(lookupId);\n if (\n dataActionFunction &&\n dataActionFunction.default &&\n dataActionFunction.default.prototype &&\n dataActionFunction.default.prototype.inputFunc &&\n typeof dataActionFunction.default.prototype.inputFunc === 'function'\n ) {\n return dataActionFunction;\n }\n return null;\n};\n\nconst loadDataProcessing = (\n modules: IModuleContract[],\n lazyLoadModuleIds: IDictionary,\n context: IRequestContext,\n internalTelemetry: InternalTelemetry,\n dataActionMetadataList: IDataActionMetadata[],\n tempMetadataList: IDataActionMetadata[],\n requestCache: ICache\n) => {\n modules.forEach((moduleContract: IModuleContract) => {\n const moduleConfig = moduleContract.config;\n if (typeof moduleConfig === 'object' && moduleConfig && moduleConfig['clientRender'] === true) {\n lazyLoadModuleIds[moduleContract.id] = true;\n }\n\n const moduleBinderInitial = (msdyn365Commerce).moduleBinder(moduleContract.typeName);\n\n const moduleBinder = context.params.theme\n ? combineExtendedDataActionToModule(moduleBinderInitial, moduleContract.typeName, context.params.theme)\n : moduleBinderInitial;\n\n if (moduleBinder && moduleBinder.dataActions && moduleBinder.dataActions.length > 0) {\n moduleBinder.dataActions.forEach((dataAction: IDataAction) => {\n const lookupId = dataAction.id || dataAction.path;\n if (dataAction.name && lookupId) {\n let dataActionFunction = (msdyn365Commerce).dataAction(lookupId);\n if (\n dataActionFunction &&\n dataActionFunction.default &&\n dataActionFunction.default.prototype &&\n dataActionFunction.default.prototype.id\n ) {\n const newLookUpId = dataActionFunction.default.prototype.id;\n // if the dataAction function's id is different with lookup id, try to fetch the dataAction based on its id again.\n if (newLookUpId !== lookupId) {\n dataActionFunction = fetchDataActionWithActionid(newLookUpId) || dataActionFunction;\n }\n }\n if (\n dataActionFunction &&\n dataActionFunction.default &&\n dataActionFunction.default.prototype &&\n dataActionFunction.default.prototype.inputFunc &&\n typeof dataActionFunction.default.prototype.inputFunc === 'function'\n ) {\n try {\n processModuleDataAction(\n dataActionFunction,\n context,\n moduleContract,\n dataAction,\n dataActionMetadataList,\n internalTelemetry,\n lazyLoadModuleIds,\n tempMetadataList,\n requestCache\n );\n } catch (e) {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_LOADDATA_ACTION_0, {\n exception: new Error(EXCEPTION_LOADDATA_ACTION_1),\n values: [asSystemMetadata(dataAction.name || 'unnamed'), asSystemMetadata(moduleContract.id || 'unnamed')]\n });\n }\n } else {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_LOADDATA_ACTION_2, {\n exception: new Error(EXCEPTION_LOADDATA_ACTION_1),\n values: [asSystemMetadata(dataAction.path || 'unnamed'), asSystemMetadata(moduleContract.id || 'unnamed')]\n });\n }\n }\n });\n internalTelemetry.log(\n LogLevel.Debug,\n internalTelemetry.stringFormat(MESSAGE_CREATE_INPUT_LOADDATA, [\n (moduleContract.dataActions || []).map(d => d.name).join(' | '),\n moduleContract.typeName,\n moduleContract.id\n ])\n );\n }\n });\n};\n\nconst processModuleDataAction = (\n dataActionFunction,\n context: IRequestContext,\n moduleContract: IModuleContract,\n dataAction: IDataAction,\n dataActionMetadataList: IDataActionMetadata[],\n internalTelemetry: InternalTelemetry,\n lazyLoadModuleIds: IDictionary,\n tempMetadataList: IDataActionMetadata[],\n requestCache: ICache\n) => {\n let inputs;\n try {\n inputs = dataActionFunction.default.prototype.inputFunc({\n requestContext: context,\n config: moduleContract.config,\n data: moduleContract.data\n });\n const isArray = Array.isArray(inputs);\n moduleContract.dataActions = moduleContract.dataActions || [];\n addLocaleInformation(inputs, context.locale);\n moduleContract.dataActions.push({\n name: dataAction.name,\n entity: isArray ? inputs[0].getCacheObjectType() : inputs.getCacheObjectType(),\n inputs: isArray ? inputs.map((input: IActionInput) => input.getCacheKey()) : inputs.getCacheKey()\n });\n } catch (e) {\n internalTelemetry.log(LogLevel.Debug, 'Unable to create input for Module: {id}, Action: {name}', {\n values: [asSystemMetadata(moduleContract.id), asSystemMetadata(dataAction.name)]\n });\n moduleContract.dataActions = moduleContract.dataActions || [];\n moduleContract.dataActions.push({\n name: dataAction.name,\n entity: undefined,\n inputs: undefined\n });\n }\n\n const dataActionInsightsKey = getPageInsightsCacheKey(PAGE_INSIGHTS_ACTIONS_KEY);\n const pageInsightsEnabled = isPageInsightsEnabled(context.params);\n const dataActionsInsights = requestCache.get<{ Server: {}; Client: {} }>(dataActionInsightsKey)?.item || { Server: {}, Client: {} };\n if (inputs && dataAction) {\n // Add run on information to data action input\n inputs.runOn = convertRunOnToString(dataAction.runOn);\n }\n if (\n msdyn365Commerce.isBrowser ||\n (!context.features.lazyload_all &&\n (dataAction.runOn === ActionRuntime.server || dataAction.runOn === ActionRuntime.serverOnly) &&\n !lazyLoadModuleIds[moduleContract.id] &&\n !lazyLoadModuleIds[moduleContract.typeName])\n ) {\n if (pageInsightsEnabled) {\n dataActionsInsights.Server[moduleContract.typeName] = dataActionsInsights.Server[moduleContract.typeName] || {};\n dataActionsInsights.Server[moduleContract.typeName][dataAction.name] =\n dataActionsInsights.Server[moduleContract.typeName][dataAction.name] || {};\n dataActionsInsights.Server[moduleContract.typeName][dataAction.name] = dataAction.id || dataAction.path;\n requestCache.put(dataActionInsightsKey, { item: dataActionsInsights });\n }\n\n dataActionMetadataList.push({\n name: dataAction.name,\n runOn: dataAction.runOn,\n id: dataAction.id,\n inputs: inputs,\n dataActionFunction: dataActionFunction.default,\n ...(dataAction.options && { options: dataAction.options })\n });\n } else {\n if (pageInsightsEnabled) {\n dataActionsInsights.Client[moduleContract.typeName] = dataActionsInsights.Client[moduleContract.typeName] || {};\n dataActionsInsights.Client[moduleContract.typeName][dataAction.name] =\n dataActionsInsights.Client[moduleContract.typeName][dataAction.name] || {};\n dataActionsInsights.Client[moduleContract.typeName][dataAction.name] = dataAction.id || dataAction.path;\n requestCache.put(dataActionInsightsKey, { item: dataActionsInsights });\n }\n\n // If the data action is supposed to be run server only it should never\n // be placed in the temporary list that will eventually run client side.\n if (dataAction.runOn !== ActionRuntime.serverOnly) {\n tempMetadataList.push({\n name: dataAction.name,\n runOn: dataAction.runOn,\n id: dataAction.id,\n inputs: inputs,\n dataActionFunction: dataActionFunction.default\n });\n }\n }\n};\n\n//\nconst storeLazyloadModuleId = (renderingContext: IRequestContext, lazyLoadModuleIds: IDictionary) => {\n if (renderingContext.features) {\n Object.keys(renderingContext.features).forEach(switchName => {\n if (switchName.startsWith(LAZYLOAD_SWITCH_PREFIX) && renderingContext.features[switchName]) {\n lazyLoadModuleIds[switchName.replace(LAZYLOAD_SWITCH_PREFIX, '')] = true;\n }\n });\n }\n};\n\nexport const processDataActionMetadataList = (\n actionContext: ActionContext,\n dataActionMetadataList: IDataActionMetadata[],\n internalTelemetry: InternalTelemetry\n) => {\n return dataActionMetadataList\n .map(async (dataActionMetadata: IDataActionMetadata) => {\n // all client side actions are lazy loaded inorder not to interfere with the client hydrate.\n // therefore only return those promises that are non-observable and instance actions\n if (process.env.CURRENT_ENVIRONMENT === 'web') {\n await timeSliceLongJSTask(actionContext?.requestContext);\n const promise = actionContext\n .chainAction(dataActionMetadata.dataActionFunction, dataActionMetadata.inputs, dataActionMetadata.options)\n .catch(e => {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_DATAACTION_EXECUTION, {\n values: [asSystemMetadata(dataActionMetadata.id || dataActionMetadata.name)],\n exception: (e && e.error) || e\n });\n });\n\n // We still need to await non-observable client-side data actions (public-preview)\n if (!dataActionMetadata.dataActionFunction.prototype.isObservable) {\n return promise;\n }\n\n // we should await on observable 'instance' actions that are configured to runOn 'server'\n if (\n actionContext.requestContext.features &&\n !actionContext.requestContext.features.disable_inst_action_await &&\n isServerInstanceAction(dataActionMetadata)\n ) {\n return promise;\n }\n } else {\n return actionContext\n .chainAction(dataActionMetadata.dataActionFunction, dataActionMetadata.inputs, dataActionMetadata.options)\n .catch(e => {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_DATAACTION_EXECUTION, {\n values: [asSystemMetadata(dataActionMetadata.id || dataActionMetadata.name)],\n exception: (e && e.error) || e\n });\n });\n }\n })\n .filter(Boolean);\n};\n\nconst isServerInstanceAction = (dataActionMetadata: IDataActionMetadata) => {\n const firstInput = Array.isArray(dataActionMetadata.inputs) ? dataActionMetadata.inputs[0] : dataActionMetadata.inputs;\n return (\n dataActionMetadata.runOn === ActionRuntime.server &&\n dataActionMetadata.dataActionFunction.prototype.isObservable &&\n firstInput &&\n firstInput.dataCacheType &&\n firstInput.dataCacheType() === 'instance'\n );\n};\n\nexport const convertRunOnToString = (runtime: ActionRuntime) => {\n switch (runtime) {\n case ActionRuntime.client:\n return 'client';\n case ActionRuntime.server:\n return 'server';\n case ActionRuntime.serverOnly:\n return 'serverOnly';\n default:\n return 'server';\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModuleBinder } from '../app-initialization/models';\nimport { getModuleBinder } from '../utils/helpers';\n\nconst dataActionCustimizedMerge = (originDataAction, newDataAction, customizer) =>\n originDataAction\n .filter(originAction => !newDataAction.find(newAction => originAction[customizer] === newAction[customizer]))\n .concat(newDataAction);\n\nexport const combineExtendedDataActionToModule = (originalModuleBinder: IModuleBinder, moduleName: string, themeName: string) => {\n const themeBinder = getModuleBinder(themeName);\n if (!themeBinder || !originalModuleBinder) {\n return originalModuleBinder;\n }\n\n if (themeBinder.dataActions.length === 0) {\n return originalModuleBinder;\n }\n const themeDataActionsForModule = themeBinder.dataActions.filter(\n dataAction => dataAction.moduleName && dataAction.moduleName === moduleName\n );\n\n const moduleDataActions = originalModuleBinder.dataActions ? originalModuleBinder.dataActions : [];\n originalModuleBinder.dataActions = dataActionCustimizedMerge(moduleDataActions, themeDataActionsForModule, 'name');\n return originalModuleBinder;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\n\n/**\n * Generates a cache key from the given ApiSettings object\n */\nexport const getCacheKey = (apiSettings: ICommerceApiSettings, catalogId?: number) => {\n if (!apiSettings) {\n return '';\n }\n\n return `${apiSettings.channelId}-${apiSettings.oun}-${catalogId || 0} `;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CacheType, getCatalogIdForSdk, IActionContext, IActionInput, ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\nimport { getCacheKey } from '../utils/link-utils';\n\n/**\n * Links coming from OneRF will have the following structure\n */\nexport interface IServerLink {\n type: string;\n productId?: number;\n categoryId?: number;\n destinationUrl?: string;\n error?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [x: string]: any;\n}\n\n/**\n * Used by the URL builder to construct the formatted\n * category or product link\n */\nexport interface IPageTypeContext {\n category?: {\n Slug: string;\n RecordId: number;\n };\n product?: {\n Name: string;\n RecordId: number;\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- needed because type pageTypeContext in url builder allows additional properties\n [x: string]: any;\n}\n\n/**\n * Input Class for ProductLink related actions\n */\nexport class ProductLinkInput implements IActionInput {\n public categoryId: number;\n public productId: number | undefined;\n public channelId: number;\n public catalogId?: number;\n private apiSettings: ICommerceApiSettings;\n private locale: string;\n\n constructor(apiSettings: ICommerceApiSettings, categoryId: number, productId?: number, catalogId?: number | null, locale?: string) {\n this.categoryId = categoryId;\n this.productId = productId;\n this.channelId = apiSettings.channelId;\n this.apiSettings = apiSettings;\n this.catalogId = catalogId || 0;\n this.locale = locale || '';\n }\n\n public getCacheKey = () => `${getCacheKey(this.apiSettings, this.catalogId)}-${this.categoryId}-${this.productId}-${this.locale}`;\n public getCacheObjectType = () => 'ProductLink';\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * Input Class for CategoryLink related actions\n */\nexport class CategoryLinkInput implements IActionInput {\n public categoryId: number;\n public channelId: number;\n public catalogId?: number;\n private apiSettings: ICommerceApiSettings;\n private locale: string;\n\n constructor(apiSettings: ICommerceApiSettings, categoryId: number, catalogId?: number | null, locale?: string) {\n this.categoryId = categoryId;\n this.channelId = apiSettings.channelId;\n this.apiSettings = apiSettings;\n this.catalogId = catalogId || 0;\n this.locale = locale || '';\n }\n\n public getCacheKey = () => `${getCacheKey(this.apiSettings, this.catalogId)}-${this.categoryId}-${this.locale}`;\n public getCacheObjectType = () => 'CategoryLink';\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * ProductList metadata passed from CMS used to hydrate product list\n */\nexport interface IProductListMetaData {\n listType: string;\n productIds?: number[];\n categoryIds?: number[];\n discountIds?: string[];\n searchText?: string;\n includePageContext?: boolean;\n includeDescendentCategoryChildren?: boolean;\n includeCart?: boolean;\n personalization?: boolean;\n recommendationListId?: string;\n relationshipId?: string;\n pageSize?: number;\n}\n\n// Enum Representing all supported ProductList types\nexport enum ProductListType {\n algo,\n editorial,\n productByCategory,\n productBySearch,\n recommendation,\n relatedProducts,\n recentlyViewedProducts,\n promotional\n}\n\n/**\n * Input Class for ProductList related actions\n */\nexport class ProductListInput implements IActionInput {\n public listMetadata: IProductListMetaData;\n public channelId: number;\n public catalogId: number;\n private _cacheType: CacheType;\n private _cacheObjectType: string;\n private _cacheKey: string;\n\n constructor(listMetadata: IProductListMetaData, actionContext: IActionContext) {\n const requestContext = actionContext.requestContext;\n const catalogIdNumber = getCatalogIdForSdk(requestContext, 0);\n\n this.listMetadata = listMetadata;\n this.catalogId = catalogIdNumber ?? 0;\n this.channelId = requestContext.apiSettings.channelId;\n this._cacheObjectType = `ProductList-${listMetadata.listType}`;\n\n const query = requestContext.query || {};\n const skipToken = query.skip;\n const context = JSON.stringify(requestContext.urlTokens);\n const locale = actionContext.requestContext.locale || 'unknown';\n const baseCacheKey = `${this.channelId}-${this.catalogId}-${locale}-${JSON.stringify(listMetadata)}-${skipToken || ''}`;\n\n switch (ProductListType[listMetadata.listType]) {\n case ProductListType.productBySearch:\n // application cache if not reading from context\n this._cacheType = listMetadata.searchText ? 'application' : 'request';\n this._cacheKey = listMetadata.searchText ? baseCacheKey : `${baseCacheKey}-${query.q || ''}`;\n break;\n case ProductListType.productByCategory:\n this._cacheType = 'application';\n this._cacheKey = listMetadata.categoryIds && listMetadata.categoryIds.length ? baseCacheKey : `${baseCacheKey}-${context}`;\n break;\n case ProductListType.relatedProducts:\n this._cacheType = 'application';\n this._cacheKey = listMetadata.productIds && listMetadata.productIds.length ? baseCacheKey : `${baseCacheKey}-${context}`;\n break;\n case ProductListType.promotional:\n this._cacheType = 'application';\n this._cacheKey = listMetadata.discountIds && listMetadata.discountIds.length ? baseCacheKey : `${baseCacheKey}-${context}`;\n break;\n case ProductListType.editorial:\n case ProductListType.algo:\n case ProductListType.recommendation:\n default:\n this._cacheType = listMetadata.includeCart || listMetadata.personalization ? 'request' : 'application';\n this._cacheKey = `${baseCacheKey}-${context}`;\n }\n }\n\n public getCacheKey = () => this._cacheKey;\n public getCacheObjectType = () => this._cacheObjectType;\n public dataCacheType = (): CacheType => this._cacheType;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\nimport { ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\n\n/**\n * Generates a Image URL based on data return from retail server\n * @param imageUrl The image url returned by Retail Server\n * @param ctx The request context\n */\nexport const generateImageUrl = (imageUrl: string | undefined, apiSettings: ICommerceApiSettings): string | undefined => {\n if (imageUrl) {\n // Images hosted in CMS include schema\n if (imageUrl.startsWith('http')) {\n return imageUrl;\n }\n\n // Images hosted in Retail Server must be encoded and joined with the base image url\n return apiSettings.baseImageUrl + encodeURIComponent(imageUrl);\n } else {\n // d365Commerce.telemetry.warning(`Unable to generate a proper Image URL for Product: ${product.RecordId}`);\n return undefined;\n }\n};\n\n/**\n * Generates a Image URL for a product based on data return from retail server\n * @param product The Product returned by Retail Server\n * @param ctx The request context\n */\nexport const getProductImageUrls = (\n products: SimpleProduct[] | ProductSearchResult[],\n apiSettings: ICommerceApiSettings\n): SimpleProduct[] | ProductSearchResult[] => {\n const productsWithImageUrls: SimpleProduct[] | ProductSearchResult[] = [];\n\n products &&\n products.forEach(product => {\n if (product && product.RecordId) {\n product.PrimaryImageUrl = generateImageUrl(product.PrimaryImageUrl, apiSettings);\n productsWithImageUrls.push(product);\n }\n });\n\n return productsWithImageUrls;\n};\n\n/**\n * Uses the order in which the product ids were returned from the reco call to order\n * the results from the product hydration call\n *\n * @param itemIdOrder The order of product ids to observe\n * @param unorderedProductSearchResults Unordered set of hydrated products\n */\nexport const orderProductSearchResults = (\n itemIdOrder: number[],\n unorderedProductSearchResults: ProductSearchResult[]\n): ProductSearchResult[] => {\n return itemIdOrder.reduce((result: ProductSearchResult[], itemId: number) => {\n const product = unorderedProductSearchResults.find(element => element.RecordId === itemId);\n if (product) {\n result.push(product);\n }\n return result;\n }, []);\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * This setting defines inventory filtering options.\n */\nexport enum ProductListInventoryFilteringOptions {\n /**\n * Filter out all products out of stock.\n */\n HideOOS = 'hideOOS',\n\n /**\n * Sort products by availability, OOS goes last.\n */\n SortOOS = 'sortOOS',\n\n /**\n * No filtering selected.\n */\n Default = 'default'\n}\n\n/**\n * Get inventory sorting value based on channelInventoryConfiguration\n *\n * @param context The current action context\n * @param channelInventoryConfiguration The channelInventoryConfiguration\n */\nexport const getInventorySorting = channelInventoryConfiguration => {\n let sorting;\n if (channelInventoryConfiguration && channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId) {\n const sortColumnName = `Attr_${channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId}`;\n sorting = {\n Columns: [\n {\n ColumnName: sortColumnName,\n IsDescending: true\n }\n ]\n };\n }\n return sorting;\n};\n\n/**\n * Returns inventory in stock sortable refiner value.\n * @param channelInventoryConfiguration - The channelInventoryConfiguration.\n * @returns Refiners.\n */\nexport const getInventoryInStockSortableRefinerValue = channelInventoryConfiguration => {\n if (channelInventoryConfiguration && channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId) {\n return {\n RefinerRecordId: channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId,\n DataTypeValue: 6,\n LeftValueBoundString: 'true',\n RightValueBoundString: 'true',\n UnitText: '',\n RowNumber: 0,\n Count: 0,\n ExtensionProperties: [],\n RefinerSourceValue: 1\n };\n }\n return undefined;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport { IAction, IActionContext, versionGte } from '@msdyn365-commerce/core-internal';\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport {\n ProductSearchCriteria,\n ProductSearchResult,\n QueryResultSettings\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { CATEGORY_PAGE_NAME } from '../../consts';\nimport { getProductImageUrls } from '../../utils/product-list-utils';\nimport { ProductListInput } from '../hydrator-action-inputs';\nimport {\n getInventorySorting,\n getInventoryInStockSortableRefinerValue,\n ProductListInventoryFilteringOptions\n} from '../utils/inventory-util';\n\nexport const getProductsByCategoryList = async (input: ProductListInput, context: IActionContext): Promise => {\n let categoryId: number;\n const urlTokens = context.requestContext.urlTokens;\n\n // If the category ID has been provided from the list metadata use it, otherwise grab the category ID from context\n if (input.listMetadata.categoryIds && input.listMetadata.categoryIds.length > 0) {\n categoryId = input.listMetadata.categoryIds[0];\n } else if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME && urlTokens.recordId) {\n categoryId = +urlTokens.recordId;\n } else if (urlTokens && urlTokens.categories && urlTokens.categories.length > 0) {\n categoryId = +urlTokens.categories[0];\n } else {\n // Unable to determine category from list meta data or context\n throw new Error('CategoryId Missing for ProductsByCategory List');\n }\n context.telemetry.debug(`Category Id input to ProductsByCategory action : ${categoryId}`);\n const productSearchCriteria: ProductSearchCriteria = {\n Context: {\n ChannelId: +input.channelId,\n CatalogId: +input.catalogId\n },\n CategoryIds: [categoryId],\n SkipVariantExpansion: true,\n IncludeAttributes: true\n };\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: input.listMetadata.pageSize || 10\n }\n };\n\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const isHideAndSortByInventoryAvailabilitySupported = versionGte(rsVersion, '9.37');\n if (isHideAndSortByInventoryAvailabilitySupported) {\n let channelInventoryConfiguration = {};\n if (\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS ||\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS\n ) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const StoreOperationsDataActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g');\n channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({ callerContext: context });\n }\n\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\n const inventoryInStockRefinerValue = getInventoryInStockSortableRefinerValue(channelInventoryConfiguration);\n if (inventoryInStockRefinerValue) {\n productSearchCriteria.Refinement = [inventoryInStockRefinerValue];\n }\n }\n\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\n const sorting = getInventorySorting(channelInventoryConfiguration);\n if (sorting) {\n queryResultSettings.Sorting = sorting;\n }\n }\n }\n\n return searchByCriteriaAsync(\n {\n callerContext: context,\n queryResultSettings\n },\n productSearchCriteria\n )\n .then((products: ProductSearchResult[]) => {\n context.telemetry.debug('Products returned by ProductByCategory action', products);\n return getProductImageUrls(products, context.requestContext.apiSettings);\n })\n .catch(error => {\n context.telemetry.error(`Error running ProductByCategory action: ${error}`);\n throw new Error(error);\n });\n};\n\nexport const getProductsByCategoryListAction = createObservableDataAction({\n action: >getProductsByCategoryList,\n id: '@msdyn365-commerce/products-by-category'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport { getCatalogIdForSdk, IAction, IActionContext, ICookieContext, versionGte } from '@msdyn365-commerce/core-internal';\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport {\n ProductSearchCriteria,\n ProductSearchResult,\n QueryResultSettings\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductImageUrls } from '../../utils/product-list-utils';\nimport { ProductListInput } from '../hydrator-action-inputs';\nimport { RecentlyViewedProductItem } from './base';\nimport {\n getInventorySorting,\n getInventoryInStockSortableRefinerValue,\n ProductListInventoryFilteringOptions\n} from '../utils/inventory-util';\n\nexport const getProductsByRecentlyViewedList = async (input: ProductListInput, ctx: IActionContext): Promise => {\n const searchCriteriaInput: ProductSearchCriteria = {};\n const cookieContext: ICookieContext = ctx.requestContext.cookies;\n const catalogId = getCatalogIdForSdk(ctx.requestContext, null);\n searchCriteriaInput.Context = {\n ChannelId: ctx.requestContext.apiSettings.channelId,\n CatalogId: catalogId\n };\n searchCriteriaInput.IncludeAttributes = false;\n searchCriteriaInput.SkipVariantExpansion = true;\n const cookieName: string = '_msdyn365___recently_viewed_products';\n const cookieValue = cookieContext.get(cookieName).value;\n const productIds = cookieValue?.filter(value => value.catalogId === catalogId).map(value => value.productId) || [0];\n searchCriteriaInput.Ids = productIds;\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: input.listMetadata.pageSize || 10\n }\n };\n\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const isHideAndSortByInventoryAvailabilitySupported = versionGte(rsVersion, '9.37');\n if (isHideAndSortByInventoryAvailabilitySupported) {\n let channelInventoryConfiguration = {};\n if (\n ctx.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS ||\n ctx.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS\n ) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const StoreOperationsDataActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g');\n channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({ callerContext: ctx });\n }\n\n if (ctx.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\n const inventoryInStockRefinerValue = getInventoryInStockSortableRefinerValue(channelInventoryConfiguration);\n if (inventoryInStockRefinerValue) {\n searchCriteriaInput.Refinement = [inventoryInStockRefinerValue];\n }\n }\n\n if (ctx.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\n const sorting = getInventorySorting(channelInventoryConfiguration);\n if (sorting) {\n queryResultSettings.Sorting = sorting;\n }\n }\n }\n\n return searchByCriteriaAsync(\n {\n callerContext: ctx,\n queryResultSettings\n },\n searchCriteriaInput\n )\n .then((products: ProductSearchResult[]) => {\n ctx.telemetry.debug('Products returned by ProductByRecentlyViewed action', products);\n return getProductImageUrls(products, ctx.requestContext.apiSettings);\n })\n .catch(error => {\n ctx.telemetry.error(`Error running ProductByRecentlyViewed action: ${error}`);\n throw new Error(error);\n });\n};\n\nexport const getProductsByRecentlyViewedListAction = createObservableDataAction({\n action: >getProductsByRecentlyViewedList,\n id: '@msdyn365-commerce/products-by-recently-viewed'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n AsyncResult,\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n IDictionary\n} from '@msdyn365-commerce/core';\nimport { DataServiceQuery, executeAction, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { getProductImageUrls } from '../utils/product-list-utils';\n\nconst buildCacheKey = (base: string, apiSettings: ICommerceApiSettings, catalogId: Number | null): string => {\n return `${base}-chanId:${apiSettings.channelId}-catId:${catalogId}`;\n};\n\n/**\n * Product Input\n */\nexport class ProductInput implements IActionInput {\n public productId: number;\n public channelId: number;\n public catalogId: number | null;\n private apiSettings: ICommerceApiSettings;\n\n constructor(productId: number | string, apiSettings: ICommerceApiSettings, catalogId: number | null) {\n this.apiSettings = apiSettings;\n this.productId = +productId;\n this.channelId = apiSettings.channelId;\n this.catalogId = catalogId;\n }\n\n public getCacheKey = () => buildCacheKey(`RecordId-${this.productId.toString()}`, this.apiSettings, this.catalogId);\n public getCacheObjectType = () => 'SimpleProduct';\n public dataCacheType = (): CacheType => 'application';\n}\n\nfunction productsQuery(recordId?: number): DataServiceQuery {\n const key = recordId ? { RecordId: recordId } : null;\n return new DataServiceQuery('Products', 'Product', 'ProductClass', key);\n}\n\nfunction createGetByIdsInput(\n queryResultSettings: IQueryResultSettings,\n channelId: number,\n productIds: number[],\n catalogId: number | null\n): IDataServiceRequest {\n const query = productsQuery().resultSettings(queryResultSettings);\n return query.createDataServiceRequestForOperation(\n 'GetByIds',\n true,\n 'SimpleProductClass',\n 'true',\n { bypassCache: 'none', returnEntity: 'SimpleProduct' },\n { channelId: channelId, productIds: productIds, catalogId: catalogId }\n );\n}\n\nfunction getByIdsAsyncAction(\n context: IContext,\n channelId: number,\n productIds: number[],\n catalogId: number | null\n): AsyncResult {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const request = createGetByIdsInput(context.queryResultSettings, channelId, productIds, catalogId);\n return executeAction(request, context);\n}\n\n/**\n * Calls the Retail API and returns the product based on the passed ProductInput\n */\nexport async function getSimpleProductsAction(inputs: ProductInput[], ctx: IActionContext): Promise {\n if (!inputs || !Array.isArray(inputs) || inputs.length === 0) {\n ctx.trace('[getSimpleProductsAction] Invalid or empty inputs passed.');\n return [];\n }\n\n const productIdMapping: IDictionary = {};\n const productIds = inputs.map((input, idx) => {\n productIdMapping[input.productId] = idx;\n return input.productId;\n });\n\n return getByIdsAsyncAction({ callerContext: ctx }, inputs[0].channelId, productIds, inputs[0].catalogId).then(products => {\n if (!products) {\n return [];\n }\n const mappedProducts = (getProductImageUrls(products, ctx.requestContext.apiSettings)).reduce(\n (memo: SimpleProduct[], product: SimpleProduct | undefined) => {\n if (!product) {\n return memo;\n }\n const idx = productIdMapping[product.RecordId];\n memo[idx] = product;\n return memo;\n },\n []\n );\n\n // NOTE: This is not an ideal fix, but will resolve all current issues\n return inputs.map(input => {\n const foundProduct = mappedProducts.find(product => product && product.RecordId === input.productId);\n return foundProduct || {};\n });\n });\n}\n\nexport default createObservableDataAction({\n action: >getSimpleProductsAction,\n id: '@msdyn365-commerce/get-simple-products',\n isBatched: true\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport { getCustomerActionDataAction, GetCustomerInput } from '@msdyn365-commerce/core';\nimport { getCatalogIdForSdk, IAction, IActionContext, versionGte } from '@msdyn365-commerce/core-internal';\nimport { IContext } from '@msdyn365-commerce/retail-proxy';\nimport { readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { getElementsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/RecommendationsDataActions.g';\nimport {\n Cart,\n Customer,\n ProductSearchCriteria,\n ProductSearchResult,\n QueryResultSettings,\n RecommendationCriteria,\n RecommendedElement\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { CATEGORY_PAGE_NAME, FREQUENTLY_BOUGHT_TOGETHER_LIST, PDP_PAGE_NAME, PICKS_FOR_YOU_LIST } from '../../consts';\nimport { getProductImageUrls, orderProductSearchResults } from '../../utils/product-list-utils';\nimport { ProductInput } from '../get-simple-products';\nimport { ProductListInput } from '../hydrator-action-inputs';\nimport {\n getInventorySorting,\n getInventoryInStockSortableRefinerValue,\n ProductListInventoryFilteringOptions\n} from '../utils/inventory-util';\n\nconst actionInputError = (missingType: string) => {\n throw new Error(`Input ${missingType} is missing and required to run GetProductsByRecommendationId action`);\n};\n\nconst enum CartTokenPrefix {\n Auth = 't',\n Anon = 'p'\n}\n\n/**\n * Constructs the category context for a recommendation call. If page context is selected the category dervided from page context\n * (current page) will be used. If instead a spefic category is chosen as context that category will be used instead.\n *\n * @param recommendationCriteria The criteria that will be used for the recommendation API call\n * @param input The ProductListInput provided to the action\n * @param context The current action context\n */\nconst getCategoryIdForReco = (recommendationCriteria: RecommendationCriteria, input: ProductListInput, context: IActionContext) => {\n let categoryIds: number[] = [];\n\n if (input.listMetadata.includePageContext || !input.listMetadata.categoryIds || input.listMetadata.categoryIds.length === 0) {\n const urlTokens = context.requestContext.urlTokens;\n\n if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME) {\n if (urlTokens.recordId) {\n categoryIds = [+urlTokens.recordId];\n }\n }\n } else {\n // Use category from a specific context if provided\n if (input.listMetadata.categoryIds && input.listMetadata.categoryIds.length > 0) {\n categoryIds = input.listMetadata.categoryIds;\n }\n }\n\n recommendationCriteria.CategoryIds = categoryIds;\n};\n\n/**\n * Fetches the current active cart to be used when cart context\n * is selected for a reco list\n *\n * @param ctx The current action context\n */\nconst getCart = async (ctx: IActionContext): Promise => {\n let cart;\n if (ctx.requestContext && ctx.requestContext.cookies) {\n const cookies = ctx.requestContext && ctx.requestContext.cookies;\n const cartCookie = cookies.getCartCookie();\n const cartCookieParts = cartCookie.split(':');\n if (cartCookieParts && cartCookieParts.length === 2) {\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 }, cartCookieParts[1]);\n if (readCart && readCart.Id) {\n cart = readCart;\n }\n }\n }\n }\n return cart;\n};\n\n/**\n * Constructs the product context for a recommendation call. If cart context is selected, products currently in the active cart will\n * be used as the product ids for the recommendation call. Otherwise, if page context is selected the product derived from page context will be used.\n * Finally, if specific context is selected, a product id will be given to us from the ProductListInput which will be used to seed the product id for the reco call.\n *\n * @param recommendationCriteria The criteria that will be used for the recommendation API call\n * @param input The ProductListInput provided to the action\n * @param context The current action context\n */\nconst getProductIdForReco = async (recommendationCriteria: RecommendationCriteria, input: ProductListInput, context: IActionContext) => {\n let productIds: number[] = [];\n // If include cart is set true, fetch the product ids in the cart to append to the product ID list for the recommendation call\n if (input.listMetadata.includeCart) {\n const cart = await getCart(context);\n if (cart && cart.CartLines) {\n const validCartLines = cart.CartLines.filter(element => element.ProductId !== undefined);\n const cartProductIds = validCartLines.map(product => product.ProductId);\n context.telemetry.debug(`Products in cart: ${cartProductIds}`);\n // If the cart isn't empty, assign the products in the cart to the productIds for seeding\n if (cartProductIds && cartProductIds.length > 0) {\n productIds = cartProductIds;\n }\n }\n } else if (input.listMetadata.includePageContext || !input.listMetadata.productIds || input.listMetadata.productIds.length === 0) {\n const urlTokens = context.requestContext.urlTokens;\n\n if (urlTokens && urlTokens.recordId && urlTokens.pageType && urlTokens.pageType.toLowerCase() === PDP_PAGE_NAME) {\n productIds = [+urlTokens.recordId];\n }\n } else {\n // Use the product from specfic context\n if (input.listMetadata.productIds && input.listMetadata.productIds.length > 0) {\n productIds = [input.listMetadata.productIds[0]];\n }\n }\n\n return productIds;\n};\n\nconst getProductsByNewSearchByCriteria = async (\n input: ProductListInput,\n callerContext: IContext,\n channelInventoryConfiguration\n): Promise => {\n const context = callerContext.callerContext;\n const customer: Customer = await getCustomerActionDataAction(new GetCustomerInput(context.requestContext.apiSettings, ''), context);\n const customerAccountNumber = customer?.AccountNumber || context.requestContext.user.customerAccountNumber;\n const searchCriteria: ProductSearchCriteria = {\n // @ts-ignore\n CustomerAccountNumber: customerAccountNumber,\n RecommendationListId: input.listMetadata.recommendationListId,\n Context: {\n ChannelId: +context.requestContext.apiSettings.channelId,\n CatalogId: +input.catalogId\n },\n SkipVariantExpansion: true,\n IncludeAttributes: true\n };\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n\n // after 9.24 version, we dont need to use two retail server call - getElement + searchByCriteria to get all recommendation products.\n // we just need to use searchByCriteria.\n\n const sequentialCallForRecoProducts = versionGte(rsVersion, '9.24');\n if (sequentialCallForRecoProducts && !context.requestContext?.features?.disable_sequential_call_for_recoProducts) {\n try {\n getCategoryIdForReco(searchCriteria, input, context);\n searchCriteria.Ids = await getProductIdForReco(searchCriteria, input, context);\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: input.listMetadata.pageSize || 10\n }\n };\n\n const isHideAndSortByInventoryAvailabilitySupported = versionGte(rsVersion, '9.37');\n if (isHideAndSortByInventoryAvailabilitySupported) {\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\n const inventoryInStockRefinerValue = getInventoryInStockSortableRefinerValue(channelInventoryConfiguration);\n if (inventoryInStockRefinerValue) {\n searchCriteria.Refinement = [inventoryInStockRefinerValue];\n }\n }\n\n /**\n * Sort by inventory availability:\n * For other type expect editorial: it's supported since 9.37.\n * For editorial list type: it's supported since 9.44 since it depends on fix from retail server which is fixed on 9.44. But logic here is the same as other types.\n */\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\n const sorting = getInventorySorting(channelInventoryConfiguration);\n if (sorting) {\n queryResultSettings.Sorting = sorting;\n }\n }\n }\n\n let productSearchResults = await searchByCriteriaAsync(\n {\n callerContext: context,\n queryResultSettings\n },\n searchCriteria\n );\n if (productSearchResults.length) {\n let productSearchResultsTmp: ProductSearchResult[] = [];\n productSearchResultsTmp = productSearchResults.filter(item => {\n // @ts-ignore\n const isVariantProduct = !item.IsMasterProduct && item.MasterProductId !== 0;\n return !isVariantProduct;\n });\n productSearchResults = productSearchResultsTmp;\n // If the ProductSearchResult API finds the products then populate the product image urls and return\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\n if (productSearchResults.length > 0) {\n getProductImageUrls(productSearchResults, context.requestContext.apiSettings);\n return productSearchResults;\n }\n }\n } catch (e) {\n // In case of an error fall back to legacy flow\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\n }\n }\n return [];\n};\n\nexport const getProductsByRecommendationList = async (input: ProductListInput, context: IActionContext): Promise => {\n // If the recommendation list is picks for you and the user is not signed do not make the reco API call and return empty list of products\n const customerAccountNumber =\n context.requestContext && context.requestContext.user && context.requestContext.user.customerAccountNumber;\n if (input.listMetadata.recommendationListId === PICKS_FOR_YOU_LIST && !customerAccountNumber) {\n return [];\n }\n\n const recommendationCriteria: RecommendationCriteria = {};\n const proxyContext: IContext = { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } };\n recommendationCriteria.CatalogId = input.catalogId;\n\n let reccomendationListId;\n if (input.listMetadata.recommendationListId) {\n reccomendationListId = input.listMetadata.recommendationListId;\n } else {\n actionInputError(`recommendationListId (from listmetadata)`);\n }\n recommendationCriteria.ProductIds = await getProductIdForReco(recommendationCriteria, input, context);\n\n if ((input.listMetadata.personalization || reccomendationListId === PICKS_FOR_YOU_LIST) && customerAccountNumber) {\n recommendationCriteria.CustomerAccountNumber = customerAccountNumber;\n proxyContext.bypassCache = 'get';\n }\n\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const isHideAndSortByInventoryAvailabilitySupported = versionGte(rsVersion, '9.37');\n let channelInventoryConfiguration = {};\n if (isHideAndSortByInventoryAvailabilitySupported) {\n if (\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS ||\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS\n ) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const StoreOperationsDataActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g');\n channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({ callerContext: context });\n }\n }\n\n const products = await getProductsByNewSearchByCriteria(input, proxyContext, channelInventoryConfiguration);\n if (products.length > 0) {\n return products;\n }\n\n context.telemetry.debug(`Recommendation Criteria: ${JSON.stringify(recommendationCriteria)}`);\n\n // For FBT lists, a product or category seed must be provided or the request will error out. So we check to see if any have been provided and return empty list if none have\n if (reccomendationListId === FREQUENTLY_BOUGHT_TOGETHER_LIST) {\n if (\n recommendationCriteria.ProductIds &&\n recommendationCriteria.ProductIds.length === 0 &&\n recommendationCriteria.CategoryIds &&\n recommendationCriteria.CategoryIds.length === 0\n ) {\n return [];\n }\n }\n\n return getElementsAsync(proxyContext, reccomendationListId, recommendationCriteria)\n .then(async (recommendedElements: RecommendedElement[]) => {\n if (recommendedElements) {\n const productInputs: ProductInput[] = [];\n const productTypeId: string[] = [];\n const catalogIdNumber = getCatalogIdForSdk(context.requestContext, null);\n // Grab all the elements that are products and store the product ids\n for (let i = 0; i < recommendedElements.length; i++) {\n const element = recommendedElements[i];\n // Element type value of 1 indicates product type\n if (element.ElementId && element.ElementTypeValue === 1) {\n productInputs[i] = new ProductInput(+element.ElementId, context.requestContext.apiSettings, catalogIdNumber);\n productTypeId[i] = element.ElementId;\n }\n }\n context.telemetry.debug(`Running recommendation action for list ${input.listMetadata.recommendationListId}`);\n context.telemetry.debug(`Number of products returned: ${productTypeId.length}`);\n context.telemetry.debug('Product ids returned', productTypeId);\n\n if (productInputs.length) {\n const itemIds: number[] = productInputs.map(value => value.productId);\n const productSearchCriteria: ProductSearchCriteria = {\n Ids: itemIds,\n Context: {\n ChannelId: +context.requestContext.apiSettings.channelId,\n CatalogId: +input.catalogId\n },\n SkipVariantExpansion: true,\n IncludeAttributes: true\n };\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: input.listMetadata.pageSize || 10\n }\n };\n\n if (isHideAndSortByInventoryAvailabilitySupported) {\n if (\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS\n ) {\n const inventoryInStockRefinerValue = getInventoryInStockSortableRefinerValue(channelInventoryConfiguration);\n if (inventoryInStockRefinerValue) {\n productSearchCriteria.Refinement = [inventoryInStockRefinerValue];\n }\n }\n\n /**\n * Sort by inventory availability:\n * For other type expect editorial: it's supported since 9.37.\n * For editorial list type: it's supported since 9.44 since it depends on fix from retail server which is fixed on 9.44. But logic here is the same as other types.\n */\n if (\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS\n ) {\n const sorting = getInventorySorting(channelInventoryConfiguration);\n if (sorting) {\n queryResultSettings.Sorting = sorting;\n }\n }\n }\n\n try {\n let productSearchResults = await searchByCriteriaAsync(\n {\n callerContext: context,\n queryResultSettings\n },\n productSearchCriteria\n );\n // If the ProductSearchResult API finds the products then populate the product image urls and return\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\n if (productSearchResults.length > 0) {\n getProductImageUrls(productSearchResults, context.requestContext.apiSettings);\n productSearchResults = orderProductSearchResults(itemIds, productSearchResults);\n return productSearchResults;\n }\n } catch (e) {\n // In case of an error fall back to legacy flow\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\n }\n }\n }\n return [];\n })\n .catch(error => {\n context.telemetry.error(`Error running productByRecommendation action: ${error}`);\n throw new Error(error);\n });\n};\n\nexport const getProductsByRecommendationListAction = createObservableDataAction({\n action: >getProductsByRecommendationList,\n id: '@msdyn365-commerce/products-by-recommendation'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\nimport { getRelatedProductsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductImageUrls } from '../../utils/product-list-utils';\nimport { ProductListInput } from '../hydrator-action-inputs';\n\nconst actionInputError = (missingType: string) => {\n throw new Error(`Input ${missingType} is missing and required to run GetProductsByRelationship action`);\n};\n\nexport const getProductsByRelationshipIdList = async (input: ProductListInput, context: IActionContext): Promise => {\n let productId;\n let relationshipId;\n // Grab the product ID from the list meta data or context\n if (input.listMetadata.productIds && input.listMetadata.productIds.length > 0) {\n productId = input.listMetadata.productIds[0];\n } else if (context.requestContext.urlTokens && context.requestContext.urlTokens.itemId) {\n productId = +context.requestContext.urlTokens.itemId;\n } else {\n actionInputError('productId');\n }\n // The relationship ID must be provided with the list meta data\n if (input.listMetadata.relationshipId) {\n relationshipId = +input.listMetadata.relationshipId;\n } else {\n actionInputError('relationshipId');\n }\n context.telemetry.debug(`Product Id input to productByRelationship action: ${productId}`);\n context.telemetry.debug(`Relationship Id input to productByRelationship action: ${relationshipId}`);\n\n return getRelatedProductsAsync(\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\n productId,\n input.channelId,\n input.catalogId,\n relationshipId\n )\n .then((products: ProductSearchResult[]) => {\n context.telemetry.debug('Products returned by getRelatedProducts action', products);\n return getProductImageUrls(products, context.requestContext.apiSettings);\n })\n .catch(error => {\n context.telemetry.error(`Error running getRelatedProducts action: ${error}`);\n throw new Error(error);\n });\n};\n\nexport const getProductsByRelationshipIdListAction = createObservableDataAction({\n action: >getProductsByRelationshipIdList,\n id: '@msdyn365-commerce/products-by-relationship-id'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { GetCustomerInput, createObservableDataAction, getCustomerActionDataAction } from '@msdyn365-commerce/action-internal';\nimport { IAction, IActionContext, versionGte } from '@msdyn365-commerce/core-internal';\nimport { Customer, ProductSearchCriteria, ProductSearchResult, QueryResultSettings, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getProductImageUrls } from '../../utils/product-list-utils';\nimport { ProductListInput } from '../hydrator-action-inputs';\nimport {\n getInventorySorting,\n getInventoryInStockSortableRefinerValue,\n ProductListInventoryFilteringOptions\n} from '../utils/inventory-util';\n\nexport const getProductsByPromotionList = async (input: ProductListInput, context: IActionContext): Promise => {\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const APIEnabedVersion = versionGte(rsVersion, '9.48');\n if (!APIEnabedVersion) {\n return [];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- Need for GetProductPromotions API.,\n const productsDataActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g');\n\n // If the Discount Offer Id is not verified.\n if (!input.listMetadata.discountIds || (input.listMetadata.discountIds && input.listMetadata.discountIds.length === 0)) {\n context.telemetry.debug('Discount Offer Id should be verified');\n throw new Error('Discount Offer Id should be verified');\n }\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: input.listMetadata.pageSize || 10\n }\n };\n\n const customer: Customer = await getCustomerActionDataAction(new GetCustomerInput(context.requestContext.apiSettings, ''), context);\n const customerAccountNumber = customer?.AccountNumber || context.requestContext.user.customerAccountNumber;\n\n const productSearchCriteria: ProductSearchCriteria = {\n Ids: input.listMetadata.productIds,\n // @ts-ignore\n CustomerAccountNumber: customerAccountNumber,\n RecommendationListId: input.listMetadata.recommendationListId,\n Context: {\n ChannelId: +context.requestContext.apiSettings.channelId,\n CatalogId: +input.catalogId\n },\n SkipVariantExpansion: true,\n IncludeAttributes: true\n };\n\n const channelInventoryConfiguration = {};\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\n const inventoryInStockRefinerValue = getInventoryInStockSortableRefinerValue(channelInventoryConfiguration);\n if (inventoryInStockRefinerValue) {\n productSearchCriteria.Refinement = [inventoryInStockRefinerValue];\n }\n }\n\n /**\n * Sort by inventory availability:\n * For other type expect editorial: it's supported since 9.37.\n * For editorial list type: it's supported since 9.44 since it depends on fix from retail server which is fixed on 9.44. But logic here is the same as other types.\n */\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\n const sorting = getInventorySorting(channelInventoryConfiguration);\n if (sorting) {\n queryResultSettings.Sorting = sorting;\n }\n }\n\n return (\n productsDataActions\n .getProductPromotionsAsync(\n {\n callerContext: context,\n queryResultSettings: queryResultSettings\n },\n input.listMetadata.discountIds,\n {\n HeaderContext: {\n ChannelId: context.requestContext.apiSettings.channelId,\n CustomerAccountNumber: customerAccountNumber\n },\n LineContexts: [\n {\n CatalogId: input.catalogId\n }\n ]\n }\n )\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- ProductPromotion is introduced in 9.48 in retail proxy.\n .then((productPromotions: any[]) => {\n if (productPromotions.length > 0) {\n const productIds: number[] = productPromotions.map(p => p.ProductId);\n productSearchCriteria.Ids = productIds;\n return productsDataActions.searchByCriteriaAsync(\n {\n callerContext: context,\n queryResultSettings\n },\n productSearchCriteria\n );\n } else {\n throw new Error(`No product retrieved for configured discounts: ${input.listMetadata.discountIds}`);\n }\n })\n .then((productSearchResult: ProductSearchResult[]) => {\n context.telemetry.debug('Products returned by getProductsByPromotionList action', productSearchResult);\n return getProductImageUrls(productSearchResult, context.requestContext.apiSettings);\n })\n .catch(error => {\n context.telemetry.error(`Error running getProductsByPromotionList action: ${error}`);\n throw new Error(error);\n })\n );\n};\n\nexport const getProductsByPromotionListAction = createObservableDataAction({\n action: >getProductsByPromotionList,\n id: '@msdyn365-commerce/products-by-promotion'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\nimport { searchByTextAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductImageUrls } from '../../utils/product-list-utils';\nimport { ProductListInput } from '../hydrator-action-inputs';\n\nexport const getProductsBySearchList = async (input: ProductListInput, context: IActionContext): Promise => {\n let searchText: string;\n if (input.listMetadata.searchText) {\n searchText = input.listMetadata.searchText;\n } else if (context.requestContext.query && context.requestContext.query && context.requestContext.query.q) {\n searchText = context.requestContext.query.q;\n } else {\n throw new Error(\n 'Search text missing for ProductsBySearch. Query string ?q={searchText} or search text in list meta data must be present.'\n );\n }\n\n return searchByTextAsync(\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\n input.channelId,\n input.catalogId,\n searchText\n )\n .then((products: ProductSearchResult[]) => {\n context.telemetry.debug('Products returned by productsBySearch action:', products);\n return getProductImageUrls(products, context.requestContext.apiSettings);\n })\n .catch(error => {\n context.telemetry.error(`Error running productsBySearch action: ${error}`);\n throw new Error(error);\n });\n};\n\nexport const getProductsBySearchListAction = createObservableDataAction({\n action: >getProductsBySearchList,\n id: '@msdyn365-commerce/products-by-search'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, { IActionContext, IDictionary, IObservableAction } from '@msdyn365-commerce/core-internal';\nimport { ICache } from '@msdyn365-commerce/cache-internal';\nimport { IProductList } from '@msdyn365-commerce/retail-proxy/dist/data-types';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { EXCEPTION_PRODUCT_LIST_ACTION, INVALID_PRODUCT_LIST_TYPE } from '@msdyn365-commerce/telemetry-internal';\nimport { toJS } from 'mobx';\nimport { set as _set } from 'lodash';\nimport { MODULE_CONFIG_KEY } from '../consts';\nimport { IProductListMetaData, ProductListInput, ProductListType } from './hydrator-action-inputs';\nimport { getProductsByCategoryListAction } from './product-list-actions/products-by-category.action';\nimport { getProductsByRecentlyViewedListAction } from './product-list-actions/products-by-recentlyviewed.action';\nimport { getProductsByRecommendationListAction } from './product-list-actions/products-by-recommendation.action';\nimport { getProductsByRelationshipIdListAction } from './product-list-actions/products-by-relationship-id.action';\nimport { getProductsByPromotionListAction } from './product-list-actions/products-by-promotions.action';\nimport { getProductsBySearchListAction } from './product-list-actions/products-by-search.action';\nimport { shouldOptimizeHydrate } from '../utils/helpers';\n\n/**\n * Method to hydrate a product list from metadata provided by CMS\n * @param listMetaData The metadata for the product list from CMS\n */\nexport const hydrateProductList = async (\n listMetaData: IProductListMetaData,\n context: IActionContext,\n moduleId?: string,\n propertyToMapInConfig?: string\n): Promise => {\n let action: IObservableAction | undefined;\n const productListMetaData = (listMetaData);\n productListMetaData.products = [];\n\n switch (ProductListType[listMetaData.listType]) {\n case ProductListType.productBySearch:\n action = getProductsBySearchListAction;\n break;\n case ProductListType.productByCategory:\n action = getProductsByCategoryListAction;\n break;\n case ProductListType.relatedProducts:\n action = getProductsByRelationshipIdListAction;\n break;\n case ProductListType.recentlyViewedProducts:\n action = getProductsByRecentlyViewedListAction;\n break;\n case ProductListType.promotional:\n action = getProductsByPromotionListAction;\n break;\n case ProductListType.editorial:\n case ProductListType.algo:\n case ProductListType.recommendation:\n action = getProductsByRecommendationListAction;\n break;\n default:\n context.telemetry.error(INVALID_PRODUCT_LIST_TYPE, listMetaData.listType);\n productListMetaData.listMetadata = { error: INVALID_PRODUCT_LIST_TYPE };\n }\n\n if (action !== undefined) {\n return action(new ProductListInput(listMetaData, context), context)\n .then(productList => {\n productListMetaData.products = productList ?? [];\n productListMetaData.products = productListMetaData.products.filter(item => item && item.Name);\n updateListDataInRequestCache(context, productList, moduleId, propertyToMapInConfig);\n })\n .catch(error => {\n context.telemetry.error(EXCEPTION_PRODUCT_LIST_ACTION);\n context.telemetry.exception(error);\n productListMetaData.listMetadata = { error: EXCEPTION_PRODUCT_LIST_ACTION };\n updateListDataInRequestCache(context, productListMetaData.products, moduleId, propertyToMapInConfig);\n });\n }\n\n return;\n};\n\n/**\n * update list data in request cache when client optimize hydrate is enabled. This\n * @param context\n * @param products\n * @param moduleId\n * @param propertyToMapInConfig\n */\nconst updateListDataInRequestCache = (\n context: IActionContext,\n products: ProductSearchResult[],\n moduleId?: string,\n propertyToMapInConfig?: string\n) => {\n if (msdyn365Commerce.isBrowser && shouldOptimizeHydrate(context.requestContext) && moduleId && propertyToMapInConfig) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const requestCache: ICache = (context).requestCache;\n const cacheValue = requestCache.get>({\n typeName: MODULE_CONFIG_KEY,\n key: moduleId\n });\n if (cacheValue) {\n const config = toJS(cacheValue.item);\n config[propertyToMapInConfig].products = products;\n _set(config, [propertyToMapInConfig], config[propertyToMapInConfig]);\n requestCache.put({ typeName: MODULE_CONFIG_KEY, key: moduleId }, { item: config });\n }\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICache } from '@msdyn365-commerce/cache-internal';\nimport { EditError, IDictionary, IModuleContract, PROPERTY_INIT } from '@msdyn365-commerce/core-internal';\nimport { CLIENT_DATA_UPDATE_EVENT, MSDYN365_WYSIWYG_DISABLED_PROPS } from '../consts';\n\nconst MODULE_NAME_PATH = '__MODULE_NAME__';\n\nconst MODULE_TYPE_PATH = '__MODULE_TYPE__';\n\nconst PARENT_PROP_PATH = '__PARENT_PROP__';\n\nexport interface IDisabledProperties {\n modules: IDictionary;\n}\n\nexport const getWrappedProxyObject = (config: IDictionary<{}>, moduleName: string, typeName: string) => {\n if (typeof window === 'undefined') {\n return config;\n }\n\n return getProxyHandler(config, moduleName, typeName);\n};\n\n/**\n * Get parent module id\n */\nexport const disableChildModules = (parentModule: IModuleContract, requestCache: ICache) => {\n const slotKeys = Object.keys(parentModule.modules || []);\n for (let i = 0; i < slotKeys.length; ++i) {\n const childModules: IModuleContract[] = parentModule.modules![slotKeys[i]];\n for (let j = 0; j < childModules.length; ++j) {\n requestCache.put({ typeName: MSDYN365_WYSIWYG_DISABLED_PROPS, key: childModules[j].id }, { item: ['*'] });\n disableChildModules(childModules[j], requestCache);\n }\n }\n};\n\n/**\n * helper function to find module from page contract\n * @param moduleId module to be searched\n * @param pageRoot page root object\n */\nexport const findModule = (moduleId: string, pageRoot: IModuleContract): IModuleContract | undefined => {\n if (pageRoot.id === moduleId) {\n return pageRoot;\n }\n\n const slotKeys = Object.keys(pageRoot.modules || []);\n for (let i = 0; i < slotKeys.length; ++i) {\n const childModules: IModuleContract[] = pageRoot.modules![slotKeys[i]];\n for (let j = 0; j < childModules.length; ++j) {\n const res = findModule(moduleId, childModules[j]);\n if (res) {\n return res;\n }\n }\n }\n\n return undefined;\n};\n\n/**\n * Returns proxy object with get and set traps\n */\nconst getProxyHandler = (config: IDictionary<{}>, moduleName: string, moduleType: string): unknown => {\n const handler: ProxyHandler> = {\n get(target: IDictionary<{}>, key: string): IDictionary<{}> | string {\n // store current module name on the proxy object\n if (!target[MODULE_NAME_PATH]) {\n target[MODULE_NAME_PATH] = moduleName;\n }\n\n if (!target[MODULE_TYPE_PATH]) {\n target[MODULE_TYPE_PATH] = moduleType;\n }\n\n if (typeof target[key] === 'object' && target[key] !== null) {\n // store current prop path as parent and return new proxy (for objects)\n target[key][PARENT_PROP_PATH] = target[PARENT_PROP_PATH] ? `${target[PARENT_PROP_PATH]}.${key}` : key;\n return new Proxy(target[key], handler);\n } else {\n return target[key];\n }\n },\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set(target: IDictionary<{}>, key: string, newValue: any): boolean {\n let disabledProperties: string[] = [];\n const moduleId = target[MODULE_NAME_PATH];\n const typeName: string = target[MODULE_TYPE_PATH];\n\n if (!moduleId || !typeName) {\n return true;\n }\n\n let propertyPath = [key];\n\n if (target[PARENT_PROP_PATH]) {\n const parentPath = (target[PARENT_PROP_PATH]).split('.');\n propertyPath = key === '$type' ? parentPath : parentPath.concat([key]);\n }\n\n // Check for disabled properties only during component initialization\n // MSDYN365_WYSIWYG_INIT is triggered on component mount and whenever\n // there is a change in component props (componentWillReceiveProps)\n if (newValue === '__MSDYN365_WYSIWYG_INIT__') {\n disabledProperties = (window)._msdyn365.authoringHelper.getDisabledProperties(moduleId);\n\n if ((disabledProperties || []).length > 0) {\n // if the value is '*' all properties are disabled\n if (disabledProperties.length === 1 && disabledProperties[0] === '*') {\n throw new EditError('cannot set disabled property');\n }\n\n const fullPath = propertyPath.join('.');\n // properties disabled in template are disabled at root property path - and will only contain part of the updated property's full path\n // e.g. disabledProperties = ['heading','links'], updatedProperty = 'heading.text' and 'links.1.linkText' are disabled\n // we check for fullPath.startsWith(`${p}.`) to handle cases where 'heading' prop is disabled and edited property is 'headingLink'\n if (disabledProperties.filter(p => fullPath === p || fullPath.startsWith(`${p}.`)).length > 0) {\n throw new EditError('cannot set disabled property');\n }\n }\n\n // for events that are called as part of initialization, do no set any value\n // as the initialization is to check if a property is disabled\n const requiredProperties: string[] = getRequiredProperties(typeName) || [];\n throw new EditError('cannot set disabled property', PROPERTY_INIT, requiredProperties.includes(propertyPath.join('.')));\n }\n\n // If we reached here, it means component is not disabled, lets just\n // notify the site builder\n document.dispatchEvent(\n new CustomEvent(CLIENT_DATA_UPDATE_EVENT, {\n detail: { moduleId, value: newValue, property: propertyPath }\n })\n );\n return true;\n }\n };\n\n return new Proxy(config, handler);\n};\n\n/**\n * helper method to get required properties\n */\nconst getRequiredProperties = (typeName: string) => {\n if (!(typeof window === undefined)) {\n const authoringHelper = (window)._msdyn365.authoringHelper;\n return authoringHelper && authoringHelper.renderingHelper && authoringHelper.renderingHelper.moduleRequiredProperties(typeName);\n }\n\n return [];\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Http specific errors\n */\nexport class HttpException extends Error {\n public static Name: string = 'HttpException';\n // TODO: type these\n public statusCode: number;\n\n /**\n * Error class for representing server errors\n * @param code HTTP status code\n * @param message Http status message\n */\n constructor(code: number, message?: string) {\n super(message);\n this.statusCode = code;\n this.name = HttpException.Name;\n\n // As of Typescript 2.1 if we extend the Error object the prototype must be set explicitly\n // See: https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n Object.setPrototypeOf(this, HttpException.prototype);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { HttpException } from './HttpException';\n\n/**\n * HTTP error for 302 redirects\n */\nexport class HttpRedirectException extends HttpException {\n public static Name: string = 'HttpRedirectException';\n public location: string;\n\n constructor(location: string) {\n super(302);\n this.location = location;\n this.name = HttpRedirectException.Name;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICacheItem, ICache, ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport {\n IDictionary,\n IParsedQSP,\n IRenderingHelper,\n IRequestContext,\n msdyn365Commerce,\n SDK_FRAGMENT_NAME,\n SDK_FRAGMENT_NAME_REGEX,\n checkVersionForFeature,\n IPlatformSettings,\n IRenderingContext,\n IModule,\n IRequestContextParams\n} from '@msdyn365-commerce/core-internal';\nimport { EXCEPTION_EXPECTED501, IInternalTelemetry, StaticTelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { NextFunction, Request, Response } from 'express';\nimport * as fs from 'fs';\nimport { getCurrency } from 'locale-currency';\nimport { escape } from 'lodash';\nimport * as path from 'path';\nimport { ReactElement } from 'react';\nimport { renderToString } from 'react-dom/server';\nimport { Stream } from 'stream';\nimport { IRefreshConfigs, REFRESH_ACTIONS_CACHE_KEY } from '@msdyn365-commerce/action-internal';\nimport { toJS } from 'mobx';\nimport { THEME_MODULE } from '../_server/Definition/moduleDefinition';\nimport { HttpException } from '../_server/error';\nimport { IMSDyn365CommerceExtension } from '../app-initialization/models';\nimport { PageContext } from '../store/page-context';\n\nexport const MODULE_ERROR_TYPE_NAME_FOR_CACHE: string = '__ME';\nexport const EMPTY_MODULE_RESULT_VALUE = 'empty-module-result';\nexport const UNREGISTERED_MODULE_VALUE = 'unregistered-module';\n\n// Used to deprecate older modules starting SSK V2\nexport const SSK2_VERSION = '2.0.0';\n\n/**\n * Creates and returns an ICacheKey object for storing\n * results of module render errors inside the RequestCache\n *\n * @param id The id of the module that encountered an error\n */\nexport const createCacheKeyForModuleError = (id: string): ICacheKey => {\n return { typeName: MODULE_ERROR_TYPE_NAME_FOR_CACHE, key: id };\n};\n\n/**\n * Creates and returns an ICacheItem object that inidcates\n * a module render result was null or empty\n */\nexport const createCacheValueForEmptyModule = (): ICacheItem => {\n return { item: EMPTY_MODULE_RESULT_VALUE };\n};\n\n/**\n * Creates and returns an ICacheItem object that inidcates\n * a module was unregistered and thus not rendered\n */\nexport const createCacheValueForUnregisteredModule = (): ICacheItem => {\n return { item: UNREGISTERED_MODULE_VALUE };\n};\n\n/**\n * Utility function to async check if file exists\n * @param filePath file path to check\n */\nexport const fileExists = async (filePath: string, telemetry: IInternalTelemetry) => {\n return new Promise((resolve: (pathToFileThatExists?: string) => void, reject: () => void) => {\n if (!filePath) {\n resolve(undefined);\n }\n\n fs.access(filePath, fs.constants.R_OK, (err: NodeJS.ErrnoException | null) => {\n if (err) {\n resolve(undefined);\n }\n resolve(filePath);\n });\n });\n};\n\n/**\n * Utility function to access the site builder rendering helper\n */\nexport const getRenderingHelper = (): IRenderingHelper | undefined => {\n return (window)._msdyn365.authoringHelper && (window)._msdyn365.authoringHelper.renderingHelper;\n};\n\n/**\n * Converts a readable stream (that has yet to emit 'data') to a string\n *\n * @param stream Stream-like object\n */\nexport const streamToString = (stream: Stream): Promise => {\n return new Promise((resolve: (streamAsString: string) => void) => {\n const stringParts: string[] = [];\n stream.on('data', (buffer: Buffer) => {\n stringParts.push(buffer.toString());\n });\n stream.on('end', () => {\n resolve(stringParts.join(''));\n });\n });\n};\n\n/**\n * Checks is value is truthy\n * @param value value to check\n */\nexport const isTruthy = (value: number | boolean | string | undefined | null) => {\n if (value === undefined || value === null) {\n return false;\n }\n switch (String(value).toLocaleLowerCase()) {\n case '1':\n case 'true':\n case 'yes':\n return true;\n case '0':\n case 'false':\n case 'no':\n case 'undefined':\n case '':\n return false;\n default:\n return !!value;\n }\n};\n\n/**\n * Checks optional QSP value and returns as a structured type\n *\n * @param qspValue QSP value to check\n */\nexport const parseToQSPObject = (qspValue: TValue): IParsedQSP => {\n return {\n hasValue: qspValue !== undefined,\n isTruthy: isTruthy(String(qspValue)),\n value: qspValue\n };\n};\n\n/**\n * Server has allowed list of QSPs, so QSPs going through Server have be put beind a allowed list of QSP such as item.\n *\n * Example:\n * In localhost, we'll have `?debug=true` but when running through Server, this is equivalent to ?item=debug:true\n *\n * This method also supports parsing out a comma separated item list, makes assumption that everything is properly URIEncoded\n * e.g. ?item=debug:true,foo:bar,bar:123\n *\n * @param itemQueryString the `item` query string value\n */\nexport const parseItemQSP = (itemQueryString: string | undefined | null): IDictionary => {\n const result: IDictionary = {};\n if (itemQueryString === undefined || itemQueryString === null) {\n return result;\n }\n const decodedUriParts = decodeURIComponent(itemQueryString).split(',');\n decodedUriParts.forEach((qsp: string) => {\n const qspParts = qsp.split(':');\n if (qspParts && qspParts.length === 2) {\n const [key, value] = qspParts;\n if (key.length && value.length) {\n result[key] = value;\n }\n }\n });\n return result;\n};\n\nexport const LinkTag = (baseUrl: string, preloadAttribute: string, staticFlushQuery: string) => (src: string) =>\n ``;\n\nexport const CommentTag = (comment: string | object) => {\n if (typeof comment === 'object') {\n return Object.keys(comment)\n .map(key => ``)\n .join('');\n }\n return ``;\n};\n\n/**\n * Wraps express routes and makes sure to catch & rethrow any errors.\n * Actual handling will be done by the handlerServerError method that logs error and sends response\n * @param fn Function for wrapped route\n */\nexport const safeRoute = fn => (...args: any[]) =>\n fn(...args).catch((error: Error) => {\n args[2] && args[2](error);\n });\n\n/**\n * Sample helper\n * @param res Response\n */\nexport const throwHelper = (req: Request, res: Response, next: NextFunction, message: string) => {\n throw new HttpException(501, StaticTelemetry.stringFormat(EXCEPTION_EXPECTED501, [message]));\n};\n\nexport const getAbsoluteUri = (req): string => {\n return `${req.protocol}://${req.get('host')}${req.originalUrl}`;\n};\n\nexport const isPageInsightsEnabled = (params: IRequestContextParams): boolean => {\n return params?.pageInsights === 'all' || params?.pageInsights === 'info' || params?.pageInsights === 'error';\n};\n\n/**\n * Wrapped render to string method that replaces the SDK Fragment element with nothing\n * used as a drop-in for renderToString on elements where we blindly set innerHTML.\n *\n * @param element the element to render\n */\nexport const patchedRenderToString = (element: ReactElement, disableServerSideErrorChecking: boolean) => {\n const renderResult = renderToString(element);\n if (disableServerSideErrorChecking && !renderResult.startsWith(`<${SDK_FRAGMENT_NAME}`)) {\n return renderResult;\n }\n return renderResult.replace(SDK_FRAGMENT_NAME_REGEX, '');\n};\n\n/**\n * Checks if client side hydration should happen before loadData\n * @param requestContext Request context object\n */\nexport const shouldOptimizeHydrate = (requestContext: IRequestContext) => {\n const clientRenderOptimizationEnabled = requestContext.features && requestContext.features.optimize_client_hydrate;\n const clientRenderQsp = requestContext.query && requestContext.query.optimize_hydrate === 'true';\n return (clientRenderOptimizationEnabled || clientRenderQsp) && checkVersionForFeature('optimize_client_hydrate');\n};\n\nexport const CurrencyCodeIdentifier = 'cc';\nexport const getCurrencyCodeFromContext = (requestContext: IRequestContext) => {\n return (\n (requestContext && requestContext.query && requestContext.query[CurrencyCodeIdentifier]) ||\n (requestContext.cookies && requestContext.cookies.get(CurrencyCodeIdentifier).value) ||\n (requestContext.channel && requestContext.channel.Currency) ||\n getCurrency(requestContext.locale)\n );\n};\n\n/**\n * Extracts the name of the module from the path to its definition file\n * @param definitionPath path to the definition file\n */\nexport const getModuleName = (definitionPath: string) => {\n if (!definitionPath || definitionPath === '') {\n return '';\n }\n\n return path.basename(definitionPath, THEME_MODULE.DEFINITION_FILE);\n};\n\nexport const getPageInsightsCacheKey = (key: string): ICacheKey => {\n return {\n key,\n typeName: 'string'\n };\n};\n\n/**\n * Returns the binder object for the given module\n * @param typeName name of the module\n */\nexport const getModuleBinder = (typeName: string) => ((msdyn365Commerce)).moduleBinder(typeName);\n\n/**\n * Returns name of the parent module for given module name\n * @param moduleName name of the module\n */\nexport const getParentModuleName = (moduleName: string) => {\n const moduleBinder = getModuleBinder(moduleName);\n\n if (!moduleBinder) {\n return '';\n }\n\n return getModuleName(moduleBinder.parentDefinitionPath);\n};\n\n/**\n * helper to read actions to be refreshed from request cache.\n * @param requestCache request cache where refresh actions are stored\n * @returns list of refresh action configs\n */\nexport const getAllActionsToBeRefreshed = (requestCache: ICache) => {\n let allRefreshActions: IRefreshConfigs[] = [];\n const refreshActionsFromCache = requestCache.get(REFRESH_ACTIONS_CACHE_KEY);\n if (refreshActionsFromCache) {\n allRefreshActions = toJS(refreshActionsFromCache.item);\n }\n\n return allRefreshActions;\n};\n\nexport const isLazyRenderModuleEnabled = (requestContext: IRequestContext | IRenderingContext): boolean => {\n if ((requestContext)?.params?.isEditor || isTruthy((requestContext)?.query?.editorial)) {\n return false;\n }\n\n if (requestContext?.query?.disable_lazy_render_support) {\n return false;\n }\n\n return (\n isModuleEntryPointsEnabled(msdyn365Commerce.platformSettings || {}, requestContext) &&\n requestContext?.features?.disable_lazy_render_support !== true\n );\n};\n\nexport const isModuleEntryPointsEnabled = (\n platformSettings: IPlatformSettings,\n requestContext?: IRequestContext | IRenderingContext\n): boolean => {\n if (requestContext?.query?.enableModuleEntryPoints) {\n return true;\n }\n return platformSettings.enableModuleEntryPoints === true;\n};\n\n/**\n * Helper function which utilizes time slicing Settimeout method in a promise which helps in breaking long running JS task on the main thread.\n * Use with caution: a setTimeout promise creates a microtask which the event loop prioritizes execution which can again block the main thread more and increase LCP / TBT.\n *\n * @param requestContext\n */\nexport const timeSliceLongJSTask = async (requestContext: IRequestContext) => {\n if (requestContext?.features?.loadData_optimization) {\n await new Promise(resolve => setTimeout(resolve, 0));\n }\n};\n\nexport const optimizedGetAllModules = async (pageContext: PageContext, requestContext: IRequestContext): Promise => {\n const allModulesListArray: IModule[][] = [];\n const moduleList = pageContext.moduleList();\n for (let i = 0; i < moduleList.length; i++) {\n await timeSliceLongJSTask(requestContext);\n const result = await pageContext.allModules(requestContext, moduleList[i]);\n allModulesListArray.push(result);\n }\n return allModulesListArray.flat();\n};\n","/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nexports.parse = parse;\nexports.serialize = serialize;\n\n/**\n * Module variables.\n * @private\n */\n\nvar decode = decodeURIComponent;\nvar encode = encodeURIComponent;\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n * @param {string} str\n * @param {object} [options]\n * @return {object}\n * @public\n */\n\nfunction parse(str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string');\n }\n\n var obj = {}\n var opt = options || {};\n var pairs = str.split(';')\n var dec = opt.decode || decode;\n\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i];\n var index = pair.indexOf('=')\n\n // skip things that don't look like key=value\n if (index < 0) {\n continue;\n }\n\n var key = pair.substring(0, index).trim()\n\n // only assign once\n if (undefined == obj[key]) {\n var val = pair.substring(index + 1, pair.length).trim()\n\n // quoted values\n if (val[0] === '\"') {\n val = val.slice(1, -1)\n }\n\n obj[key] = tryDecode(val, dec);\n }\n }\n\n return obj;\n}\n\n/**\n * Serialize data into a cookie header.\n *\n * Serialize the a name value pair into a cookie string suitable for\n * http headers. An optional options object specified cookie parameters.\n *\n * serialize('foo', 'bar', { httpOnly: true })\n * => \"foo=bar; httpOnly\"\n *\n * @param {string} name\n * @param {string} val\n * @param {object} [options]\n * @return {string}\n * @public\n */\n\nfunction serialize(name, val, options) {\n var opt = options || {};\n var enc = opt.encode || encode;\n\n if (typeof enc !== 'function') {\n throw new TypeError('option encode is invalid');\n }\n\n if (!fieldContentRegExp.test(name)) {\n throw new TypeError('argument name is invalid');\n }\n\n var value = enc(val);\n\n if (value && !fieldContentRegExp.test(value)) {\n throw new TypeError('argument val is invalid');\n }\n\n var str = name + '=' + value;\n\n if (null != opt.maxAge) {\n var maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) {\n throw new TypeError('option maxAge is invalid')\n }\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) {\n if (typeof opt.expires.toUTCString !== 'function') {\n throw new TypeError('option expires is invalid');\n }\n\n str += '; Expires=' + opt.expires.toUTCString();\n }\n\n if (opt.httpOnly) {\n str += '; HttpOnly';\n }\n\n if (opt.secure) {\n str += '; Secure';\n }\n\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string'\n ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n\n/**\n * Try decoding a string using a decoding function.\n *\n * @param {string} str\n * @param {function} decode\n * @private\n */\n\nfunction tryDecode(str, decode) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n","module.exports = React;","module.exports = ReactDOM;","'use strict';\nvar $TypeError = TypeError;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991\n\nmodule.exports = function (it) {\n if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');\n return it;\n};\n","'use strict';\nvar isArray = require('../internals/is-array');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');\nvar bind = require('../internals/function-bind-context');\n\n// `FlattenIntoArray` abstract operation\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? bind(mapper, thisArg) : false;\n var element, elementLen;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n if (depth > 0 && isArray(element)) {\n elementLen = lengthOfArrayLike(element);\n targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;\n } else {\n doesNotExceedSafeInteger(targetIndex + 1);\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n};\n\nmodule.exports = flattenIntoArray;\n","'use strict';\nvar $ = require('../internals/export');\nvar flattenIntoArray = require('../internals/flatten-into-array');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\n// `Array.prototype.flat` method\n// https://tc39.es/ecma262/#sec-array.prototype.flat\n$({ target: 'Array', proto: true }, {\n flat: function flat(/* depthArg = 1 */) {\n var depthArg = arguments.length ? arguments[0] : undefined;\n var O = toObject(this);\n var sourceLen = lengthOfArrayLike(O);\n var A = arraySpeciesCreate(O, 0);\n A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity(depthArg));\n return A;\n }\n});\n","'use strict';\n// this method was added to unscopables after implementation\n// in popular engines, so it's moved to a separate module\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('flat');\n","'use strict';\nvar $ = require('../internals/export');\nvar iterate = require('../internals/iterate');\nvar createProperty = require('../internals/create-property');\n\n// `Object.fromEntries` method\n// https://github.com/tc39/proposal-object-from-entries\n$({ target: 'Object', stat: true }, {\n fromEntries: function fromEntries(iterable) {\n var obj = {};\n iterate(iterable, function (k, v) {\n createProperty(obj, k, v);\n }, { AS_ENTRIES: true });\n return obj;\n }\n});\n"],"names":["translate","locale","translationPath","fallback","translation","translations","toLowerCase","splitString","split","i","length","console","warn","e","AddToWishlistComponentActions","onClick","async","_event","props","state","_product$Dimensions","_product","_props$context$action","_productPrice$Discoun","_product$Name","user","context","request","product","data","waiting","isAuthenticated","signInUrl","window","location","assign","setWaiting","undefined","getSelectedProduct","doesProductExistInWishlist","removeFromWishlist","addToWishlist","variant","Dimensions","map","d","_d$DimensionValue","DimensionValue","Value","join","brandFromExt","ExtensionProperties","find","p","Key","StringValue","productPrice","getPriceForSelectedVariant","PriceForSelectedVariantInput","RecordId","actionContext","requestContext","channel","discount","DiscountLines","reduce","a","b","_b$Amount","Amount","pushGoogleAnalyticsEvent","event","ecommerce","currency","value","Price","items","recId","item_id","ProductNumber","ItemId","item_name","Name","index","item_variant","price","pid","item_brand","quantity","onDismiss","setContent","color","showAlert","wishlists","CommerceListLines","wishlistItem","ProductId","propagateSuccess","result","onSuccess","cartline","propagateError","onError","canAddMasterProduct","missingDimensions","filter","dimension","status","AsyncResult","resolve","callAddWishlistLine","Id","wishlistName","nameOfWishlist","customer","getCustomerAccount","AccountNumber","listData","CustomerId","CommerceListTypeValue","commerceList","createCommerceListAsync","callerContext","error","telemetry","warning","debug","wishlistId","productId","createdCommerceList","addLinesAsync","buildWishlistLine","update","createGetByCustomerInput","setCanRemove","wishlistTextMessage","addToWishlistMessage","addItemToWishlistError","removedFromWishlistMessage","removeItemFromWishlistError","wishlistLine","line","removeLinesAsync","customerInput","GetCustomerInput","apiSettings","getCustomer","AddToWishlistComponent","msdyn365Commerce","createComponentOverride","_objectSpread","component","useState","canRemove","content","React","removeFromWishlistButtonText","addToWishlistButtonText","ariaRole","showStatusMessage","showRemoveButton","showButtonText","className","disabled","showButtonTooltip","tooltipPosition","onClickHandler","ariaLabel","addToWishlistRef","removeFromWishlistRef","showMessage","showTooltip","tooltipPos","linkAriaRole","classnames","ref","role","UncontrolledTooltip","placement","trigger","target","Alert","isOpen","toggle","onDismissHandler","CatalogLabelComponent","catalogId","cartLine","CatalogId","isB2b","ArrayExtensions","hasElements","catalogs","catalog","item","CartLineItemFunctions","renderProductDimensions","Product","DimensionStrings","productDimension","DimensionTypeValue","key","colorString","configString","sizeString","IsGiftCard","amountString","styleString","discountLine","OfferId","OfferName","resources","discountStringText","PriceComponent","isSalesLine","CustomerContextualPrice","PeriodicDiscount","EffectiveAmount","BasePrice","id","typeName","EffectivePercentage","inventoryInformationLabel","inventoryCssName","inventoryLabelClassName","IsInvoiceLine","app","config","unitOfMeasureDisplayType","DefaultUnitOfMeasure","_props$context$reques","pickupDeliveryModeCode","PickupDeliveryModeCode","channelDeliveryOptionConfig","hasShippingMethod","_channelDeliveryOptio","DeliveryMode","PickupDeliveryModeCodes","some","deliveryMode","shippingChargeLines","ChargeLines","chargeLine","IsShipping","freightFee","chargeTotal","CalculatedAmount","priceComponent","freePriceText","shippingChargesText","_cartline$ChargeLines","otherCharges","chargeline","otherCharge","Description","SalesAgreementLineRecordId","salesAgreementPricePrompt","_props$primaryImageUr","productUrl","destructDimensionStrings","fallbackImageUrl","getFallbackImageUrl","productDimensions","imageSettings","cropFocalRegion","renderDisountLines","renderInventoryLabel","renderUnitOfMeasure","renderShippingLabel","renderOtherCharges","renderSalesAgreementPrompt","payLoad","getPayloadObject","telemetryContent","toString","productAttribute","getTelemetryAttributes","productName","imgeClassName","onChange","newValue","quantityOnChange","lineIndex","Image","src","primaryImageUrl","fallBackSrc","altText","gridSettings","loadFailureBehavior","Object","MsDyn365","isBrowser","href","NetAmount","NetAmountWithoutTax","NetPrice","salesAgreementLineId","showShippingChargesForLineItems","_generateQuantityandPrice","nodes","isOutOfStock","isQuantityEditable","push","quantityDisplayString","IncrementalQuantity","LineId","max","maxQuantity","currentCount","currentQuantity","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","isCartStateReady","isGiftCard","classNames","Quantity","_props$data$cartLine$","originalPriceText","cultureFormatter","formatCurrency","currentPriceText","DiscountAmount","cartState","priceEditorResources","CartLinePriceEditor","errorMessage","showStrikethroughPricing","originalPrice","getOriginalPrice","TradeAgreementPrice","renderCurrentPrice","initialPrice","itemProp","renderCurrentPriceWithOriginalPrice","discountAmount","discountPrice","saveAmtFmt","replace","ProductStockStatus","_ref","availabilityStatus","hideStatus","ProductStockStatusEnum","ONLINE","IN_STORE","OUT_OF_STOCK","DefaultFallbackImage","renderLabel","name","rating","ratingAriaLabel","roundedRating","toFixed","format","getRatingAriaLabel","ProductComponent","_product$ExtensionPro","savingsText","allowBack","quickViewButton","shouldHidePrice","setShouldHidePrice","getProductPageUrlSync","srcUrl","URL","baseUrl","queryString","search","pathname","updateProductUrl","attribute","baseImageUrl","productBadgeStatus","getProductBadgeUrl","showPriceInCartAttributeArray","findAllAttributes","AttributeValues","attributeValue","findAttributeValue","onTelemetryClick","AverageRating","imageUrl","emptyPlaceHolderImage","placeholderImageName","image","imageProps","bypassHideOnFailure","renderProductPlacementImage","PrimaryImageUrl","url","alt","badgeName","mfrAttr","findAttribute","mfrValue","_renderProductSkuMFR","Bazzarvoice","itemId","widgetType","inline_rating","disableSeo","renderRating","seePriceInCart","basePrice","adjustedPrice","AdjustedPrice","renderPrice","description","getProductStockStatus","hideStockStatus","quickview","selectedProductId","renderQuickView","PromoCode","constructor","super","_onInputChangeHandler","this","setState","promoCodeInputValue","trim","canApply","_applyPromotion","cart","appliedPromo","addPromoCode","promoCode","then","substatus","duplicatePromoCodeErrorText","invalidPromoCodeErrorText","catch","failedToAddPromoCodeErrorText","_onSubmitHandler","preventDefault","_applyPromotionHandler","_renderForm","promoPlaceholderText","promoCodeApplyButtonText","attributes","onSubmit","placeholder","Button","title","_removePromotion","code","currentTarget","getAttribute","removePromoCodes","promoCodes","failedToRemovePromoCodeErrorText","_calculateDiscount","CartLines","DiscountCode","DiscountCost","_renderAppliedPromoCode","Coupons","removePromotionHandler","promoCodTotalDiscount","count","coupon","Code","appliedPromoCodeHeadingText","removePromoAriaLabelFormat","removePromoText","TelemetryConstant","ApplyPromoCode","isCollapseOpen","shouldComponentUpdate","nextProps","nextState","render","promoCodeHeadingText","componentDictionary","c","require","cn","log","handleMissingImplementationDetails","functionName","connectorName","connectorType","Error","connectorDictionary","connectorProviderImpl","connectorListenerImpl","connectorDomainsList","default","provider","listener","connectorDomains","validateConnectorRegistration","connectorImpl","__proto__","initialize","getConfigForClientSideInit","initializeClientSide","getExperiments","getVariantsForUser","activateExperiment","logEvent","verifyExperimentationReigstration","validateCatalogId","currencyCode","priceCurrency","_props$context$reques2","OmniChannelMedia","NetAmountWithAllInclusiveTax","GrossAmount","ExtendedPrice","userId","JSON","stringify","eventName","payload","variantSet1","variantId","experimentId","variantSet2","variantSet3","variantSet4","Promise","experiments","friendlyName","type","State","Running","link","variations","Active","weight","Draft","createdDate","lastModifiedDate","lastModifiedBy","Paused","Archived","match","secretManager","CartIcon","observer","cartLabel","cartQtyLabel","cartItem","totalItemsInCart","qtyLabel","label","style","visibility","CartIconComponent","isChannelTypeB2B","cartLineItemFunctions","dimensionStrings","_productDimension$Dim","_productDimension$Dim2","_productDimension$Dim3","_productDimension$Dim4","ProductDimensionType","Color","Configuration","Size","Style","renderProductUnitPrice","renderDiscountLines","_discountLine$OfferId","Percentage","discountPercent","_discountLine$Percent","updatedPercent","DiscountLineTypeValue","DiscountLineType","TenderTypeDiscount","_discountLine$Effecti","effectiveAmount","Number","_chargeLine$Calculate","_cartline$ChargeLines2","_otherCharges$map","itemIndex","String","renderConfirmedShipDate","confirmedShipDate","StringExtensions","isNullOrEmpty","confirmedShipDateLabel","CartLineItemComponent","cartLineContentClassName","generateErrorMessage","generateQuantityAndPrice","unitOfMeasure","_props$maxQuantity","_props$data$product$I","htmlFor","FulfillmentStoreId","deliveryLocation","getDefaultColorSwatchSelected","productData","_colorAttribute$swatc","_colorAttribute$swatc2","_colorAttribute$swatc3","attributeValues","colorAttribute","_attributeValue$keyNa","keyName","toLocaleLowerCase","DimensionTypes","defaultSwatch","swatches","isDefault","productDetailsPageUrl","coreContext","sourceUrl","renderProductUnitOfMeasure","ratingAriaLabelText","reviewCount","ratingCountAriaLabelText","reviewCountArialableText","getReviewAriaLabel","isPriceMinMaxEnabled","priceResources","_context$app$config","contextConfig","fallbackImageSource","img","ProductComponentV2","_product$name","_product$recordId","_getProductImageUrlFr","_getProductPageUrlFro","ratingCountAriaLabel","productComparisonButton","isEnabledProductDescription","inventoryLabel","dimensionAvailabilities","swatchItemAriaLabel","recordId","MIN_VALUE","productImageUrlFromSwatch","dimensionToPreSelectInProductCard","none","productImageUrls","generateImageUrl","getProductImageUrlFromDefaultColorSwatch","productPageUrlFromSwatch","swatchValue","getProductPageUrlFromDefaultSwatch","productPageUrl","setProductPageUrl","productImageUrl","setProductImageUrl","selectedSwatchItems","Dictionary","enableStockCheck","updatePageAndImageUrl","swatchItem","dimensionType","setValue","isNullOrWhitespace","productPageUrlWithSwatch","includes","newUrl","searchParams","delete","swatchProductImageUrl","newImageUrl","isUnitOfMeasureEnabled","averageRating","totalRatings","defaultUnitOfMeasure","_item$keyName$toLocal","_item$keyName","_item$swatches$map","_item$swatches","dimensionTypeValue","dimensionsToDisplayOnProductCard","dimensionsInProductCard","shouldDisplayDimension","_item$recordId","_swatchItem$swatchVal","_swatchItem$swatchVal2","_dimensionAvailabilit","colorHexCode","swatchColorHexCode","swatchImageUrl","isDisabled","dimensionAvailability","_swatchItem$swatchVal3","swatch","ProductComponentV2SwatchComponent","onSelectDimension","hideRating","moduleTypeName","moduleId","avgRating","numberRatings","RatingComponent","ratingCount","readOnly","inventoryAvailabilityLabel","selectedDimensions","getValues","convertDimensionTypeToProductDimensionType","dimensionValue","renderProductComparisonButton","getCatalogId","getDefaultSwatchSelected","_productData$Attribut","_attributeSwatches$fi","attributeSwatches","_attributeValue$KeyNa","KeyName","Swatches","IsDefault","_product$RecordId","swatchProductImageUrls","ProductImageUrls","getProductImageUrlFromDefaultSwatch","SwatchValue","encodeURIComponent","TotalRatings","_item$KeyName$toLocal","_item$KeyName","_item$Swatches$map","_item$Swatches","_item$RecordId","_swatchItem$SwatchVal","_swatchItem$SwatchVal2","SwatchColorHexCode","SwatchImageUrl","_swatchItem$SwatchVal3","ProductComponentSwatchComponent","applyPromotionHandler","_event$currentTarget$","getRequestedModules","windowInitialData","modules","_moduleList","forEach","moduleType","_themeModulesList","concat","getRequestedModuleNames","requestedPackageNames","Set","___initialData___","m","add","Array","from","getUniqueRequestedAssets","_uniq","filterToUsedAssets","requestedAssetKeys","partnerModule","indexOf","n","t","r","o","addEventListener","persisted","timeStamp","performance","getEntriesByType","u","activationStart","f","document","prerendering","wasDiscarded","delta","entries","Date","now","Math","floor","random","navigationType","s","PerformanceObserver","supportedEntryTypes","getEntries","observe","buffered","l","requestAnimationFrame","visibilityState","v","h","g","T","y","removeEventListener","E","setTimeout","C","L","w","disconnect","startTime","firstHiddenTime","reportAllChanges","A","passive","capture","I","P","k","F","entryType","cancelable","processingStart","M","D","B","R","H","N","interactionId","min","O","interactionCount","q","durationThreshold","j","_","z","G","J","K","duration","latency","sort","splice","U","V","X","Y","readyState","Z","responseStart","TTLCache","options","removalThresholdInMs","intervalForRemovalInMs","_cache","Map","get","set","onRemoveCallback","clear","_cleanCache","keys","RequestVectorizer","next","bind","requestId","nextValue","SEP","RequestVectorizerInstance","regexGetRoundBraces","toLowerCaseDict","objectDictionary","prevValue","current","ttlRequestCache","RSResponseInterceptor","response","requestCache","activityId","headers","lowercaseHeaders","requestid","activityid","properties","elapsedTime","StaticTelemetry","stopTimer","parsedUrl","parse","baseURL","trackDependency","method","toUpperCase","resultCode","success","hostname","empty","_isEmpty2","ahs","authTokenSize","dependencyName","RSRequestInterceptor","requestHeaders","caseInsensitiveHeaderMap","oun","apiEndPoint","replaceString","requestIdVector","authorizationHeader","authorizationHeaderLength","authArray","caseInsensitiveRequestIdHeaderName","currentRequestId","startTimer","rv","replaceIdentifiers","isUrlLocalizationEnabled","parameterizeFeatureFlags","platformSettings","enableUrlLocalization","getPageTypeContextByIdAction","createObservableDataAction","action","input","pageTypeContext","ProductLinkInput","getByIdAsync","channelId","err","catalogid","checkVersionForFeature","getCatalogIdForSdk","getCategoriesAsync","categories","rootCategory","category","categoryId","localName","getFriendlyName","NameTranslations","rootCategoryWithNeutralizedName","NeutralizedName","slug","getCategorySlug","parameterize","currentCategory","ParentCategory","parentId","parentCategory","parentCategoryWithLocalizedName","getParameterizeFeatureFlagsWithRequestContext","Slug","searchForComplexType","obj","propertyToMapInConfig","promisesArray","isArray","children","linkObject","_context$requestConte","destinationUrl","requestUrl","features","disable_hydrator_link_locale","_context$requestConte2","queryParams","query","featureContext","add_external_link_domain","skip_external_link_catalogid","appendQueryParams","routeContext","getUrlSync","EXCEPTION_LINK_ACTION","exception","CategoryLinkInput","hydrateLink","hydrateProductList","processComplexDataTypes","lazyloadAllDataActions","processType","pageSlots","processComplexDataTypesAsync","all","lazyLoadAllDataActions","lazyLoadAllModuleQueryString","clientRenderAllModuleQueryString","lazyLoadModuleFeature","params","isEditor","currModule","currModuleConfig","clientRenderConfigSwitch","hasOwnProperty","runAllActionsInQueue","PageContext","pageData","resourceManager","_clientPlatformSetting","_environmentVariable","_versionDependentFeatureInfo","setEnvironmentVariableForCLient","environment","getAllEnvironmentVariable","isEmptyOrNullObject","EXCEPTION_BADPAGECONTEXT","c1AccessToken","pageRoot","getVersionDependentFeatureInfo","_putRequestedModulesInCacheOnServer","_initThemeModulesList","moduleList","resultArray","chunkIndex","_constructModuleMetaData","_requestContext$featu","loadData_optimization","moduleMetaData","setAppCacheEntries","appCacheEntries","put","CACHE_SETTING","setPlatformSettingsForClient","clientSideDataActionTimeoutInMs","shouldUseInstanceCache","disableActionRegOptimization","imageFallbackOptimize","enableModuleEntryPoints","isModuleEntryPointsEnabled","enableImageOptimizeEvents","enableModuleCssOptimization","clientTimeoutMapInMs","secondaryInstrumentationKey","getPlatformSettingsForClient","deferred","getValue","MODULE_DEFERRED_KEY","getResourceTextForPlaceholderPreview","resourceItem","MODULE_RESOURCES_KEY","clickToConfigure","markModuleAsDeferred","internalCache","EXCEPTION_INITIALDATAFAIL","cacheType","cacheBasedOnType","cachekey","_pageData$requestCont","cacheItem","_rehydrateAsyncResults","MODULE_CACHE_KEY","moduleItem","dataActions","_populateDataActionResultFromCache","cacheObjectType","cacheKey","cachedValueBasedOnInput","isAsyncResult","transaction","promiseResult","_resolveCacheRef","cacheRefInfo","Boolean","_this$requestContext$","themeName","theme","slots","moduleInstance","MODULE_CONFIG_KEY","MODULE_CONFIG_ERRORS_KEY","configErrors","MODULE_DATA_KEY","MODULE_ACTION_KEY","MSDYN365_WYSIWYG_DISABLED_PROPS","MSDYN365_WYSIWYG_CANADDMODULE","getModuleResources","enableAuthoringRemoveAndAddModule","getAllModuleBinder","moduleBinder","getParentModuleName","_type","metadata","reject","actions","actionMetaDataList","toJS","entity","inputs","isObservableArray","isAuthoringEditEnabled","getWrappedProxyObject","disabledProperties","slotsForAddModule","SessionStorageContext","_cookieContext","getDataFromStorage","setDataInStorage","getCheckoutCartData","getCheckoutCartKey","setCheckoutCartData","removeDataFromStorage","remove","removeCheckoutCartData","sessionStorage","startsWith","checkoutCartKeyPrefix","objString","getItem","setItem","removeItem","checkoutCartCookie","getCheckoutCartCookie","readCookie","cleanValue","substr","cleanupCookieValue","doNotParse","isParsingCookie","__assign","arguments","prototype","call","apply","Cookies","cookies","_this","changeListeners","HAS_DOCUMENT_COOKIE","cookie","parseCookies","_updateBrowserValues","parseOptions","_emitChange","getAll","name_1","_a","finalOptions","expires","maxAge","addChangeListener","callback","removeChangeListener","idx","UserConsentCookieName","CookieContext","cookieString","_setCookieList","_serverCookieList","_clientCookieList","cookieName","isEssential","isConsentGiven","cookieValue","_cookies","sameSiteRequiredFlag","_options","sameSiteRequired","cookieOptionsWithDefaults","path","secure","sameSite","filteredOptions","clientCookieString","createCookieString","serverCookieString","getCartCookie","CartCookie","getTargetIdCookie","setCartCookie","setAlways","prefix","cartCookieOptions","existingCart","cartExpirationInDays","setCheckoutCartCookie","checkoutCartCookieOptions","existingCookie","removeCheckoutCartCookie","getAccountSelectionCookie","accountSelectionCookie","setAccountSelectionCookie","isOBORequest","customerAccountNumber","accountSelectionCookieOptions","removeAccountSelectionCookie","isConsentRequired","setConsentCookie","setCookieFunction","dispatchEvent","Event","USER_CONSENT_GIVEN_EVENT","deleteConsentCookie","optionsString","_appendCookieOptions","cookieOptions","domain","httpOnly","req","REQUEST_CONTEXT_PROPERTIES_FOR_SEG","axios","use","RSErrorResponseHandler","statusCode","CLIENT_HYDRATE_CACHE_KEY","CLIENT_HYDRATE_KEY","CLIENT_HYDRATE_TYPE","resetClientHydrateContext","del","activateExperiments","experimentationConnector","experimentation","activeExperiments","experimentInfo","experimentsWithoutModuleId","experimentsWithModuleId","_partition2","Type","device","experimentMap","experimentObserver","IntersectionObserver","entry","isIntersecting","intersectionRatio","activatedExpId","_msdyn365Commerce$exp","unobserve","threshold","currentExperiment","querySelector","hydrateClient","pageContext","body","defaultPageConfig","disable_moduleConfig_optimize","ReactDOM","CoreContext","Provider","SafeRenderModule","store","root","getElementById","LAYOUT_MOUNT_POINT","isDebug","initAuthoringHelper","moduleTelemetry","themeSettings","authoringHelper","AuthoringToolsHelper","_msdyn365","dpEvent","detail","updateDisabledProperties","clientRender","_msdyn365Commerce$exp2","_requestContext$chann","_requestContext$app","storeData","MESSAGE_CLIENT_RENDER_ERROR","removePlaceholderModules","modulesDictionary","slot","module","disableCookieCompliance","platform","cartSessionExpiration","urlSearchParams","URLSearchParams","fromEntries","param","telemetrySettings","operationalInsightsInstrumentationKey","freeze","getRequestContext","requestFormData","routes","checkout","requestContextUrl","isCheckoutRoute","_requestContext$query","pv","isPaymentVerification","appCache","getAppCache","__msdyn365__","oneDSWeb","expListener","appInsightsInstrumentationKey","instrumentationKey","msftClientAppInsightsJSLogger","ClientAppInsightsJSLogger","LoggerType","MSFTApplicationInsightsLogger","operationalClientAppInsightsJSLogger","OperationalApplicationInsightsLogger","internalTelemetry","enableDataAnalytics","registerWebAnalyticsPlugin","registerAttributeRenderer","expAttributeRenderer","registerTraceLogger","traceLogger","setTelemetryRequestContext","siteId","pageType","urlTokens","pageId","correlationId","Telemetry","generateGuid","logWebVitals","targetId","tuid","resolveMissingSegmentsOnClient","missingSegments","canonicalDomain","neededMissingSegments","providerId","segmentProvider","segmentIds","segmentRequestId","missingSegmentResolvingUrl","segRequestContext","property","requestContextObject","disable_segment_requestContext","segmentProviderList","LogLevel","registerExpLogger","GenericConsoleLogger","contentSecurityPolicy","disableContentSecurityPolicy","enableReportOnlyMode","randomNumberGenerator","cspReport","blockedURI","documentURI","originalPolicy","violatedDirective","CONTENT_SECURITY_POLICY_ERROR","customTags","putRequestedModulesInCacheOnClient","EXCEPTION_CLIENT_CACHE_HYDRATE","finally","_requestContext$featu2","_requestContext$param","_requestContext$featu3","timeSliceLongJSTask","ActionContext","spawnChildOnExecute","cache","CultureInfoFormatter","getCurrencyCodeFromContext","allModules","optimizedGetAllModules","allowDispatchEvent","enable_verbose_logs","shouldOptimizeHydrate","optimizeClientHydrate","CLIENT_RENDER_START_EVENT","trackEvent","EVENT_CLIENT_RENDER_START","initialPromise","LAZYLOAD_ALL_SWITCH","lazyload_all","EXCEPTION_PRODUCT_LIST_CLIENTSIDE_HYDRATION","setupClientHydrateFlag","loadData","EVENT_CLIENT_RENDER_STOP","time","EXCEPTION_LOAD_DATA_EXCEPTION","_document$getElementB","setClientHydrate","pageName","telemetryPageName","setAttribute","TelemetryEvent","PageView","deprecatedEvent","DEPRECATED_CLIENT_RENDER_COMPLETE_EVENT","CLIENT_RENDER_COMPLETE_EVENT","setClientHydrateContext","_requestContext$param2","_requestContext$featu4","_requestContext$featu5","_document$getElementB2","modulesRenderedOnServer","isLazyRenderModuleEnabled","_pageContext$requestC","CLIENT_ENTRY_POINTS_TYPE","hadRecentInput","takeRecords","onCLS","metric","EVENT_WEB_VITALS_CLS","onFCP","EVENT_WEB_VITALS_FCP","onFID","EVENT_WEB_VITALS_FID","onLCP","EVENT_WEB_VITALS_LCP","onTTFB","EVENT_WEB_VITALS_TTFB","PerformanceEventTiming","onINP","EVENT_WEB_VITALS_INP","initializeApp","bindings","MSDyn365Commerce","viewBinder","views","componentBinder","components","getPartnerOverrideAction","partnerDataActions","dataAction","getConnector","connectors","values","perfAnalysisBinder","_this$bindings","perfAnalysisLibBinding","updatePrivateVariable","_env","process","getModuleBinder","getBinder","lookupKey","moduleName","pageInsightsEnabled","view","_requestCache$get","componentInsightsKey","getPageInsightsCacheKey","PAGE_INSIGHTS_COMPONENTS_KEY","componentInsights","lookupFunc","themeBinder","moduleNamespace","packageName","getComponent","isPageInsightsEnabled","actionContextData","Debug","parentThemeName","getModuleName","parentDefinitionPath","parentThemeBinder","defaultComponentLookupFunc","parentModuleBinder","createComponent","componentObj","EXCEPTION_NOMODULEBINDER","asSystemMetadata","componentName","componentView","Component","propsDictionary","addChunk","RequestCache","addCreateComponentHook","initializeClientApp","skipConsoleWarn","clientPlatformSettings","originalBinder","moduleKey","binder","fetchComponent","moduleDirectory","md","da","definitionPath","pdp","isNodeModule","iNM","ns","chunkName","viewComponent","viewKey","fetchViewComponent","ecommerceComponent","componentKey","fetchEComComponent","initBindings","appDatabv","___appData___","bv","_buildVersion","_experimentationConnector","_platformSettings","fetchRegistrationObject","registration","dictionaryName","initializeClient","registerModules","__bindings__","packageDataActions","viewDictionary","connectorInformation","connectorsRegistration","expConnectorName","expConnector","experimentationConfig","expUserId","experimentationProvider","experimentationListener","initializeConnectors","enable_performance_analysis","isPerfAnalysis","lib","initializePerformanceUtils","initializeClientWithRetry","_bindings$packageData","retry","lazyLoadedModules","__CEP__","modulesList","themesList","clientModulesList","scriptsExecuted","__webpack_public_path__","___publicPath___","AddControlMode","AsyncClientRenderComponent","loadScriptAsync","script","createElement","appendChild","onload","onerror","moduleChunk","defer","waitAndInitializeModule","mappedProps","retryCount","currentModuleArray","currentModule","lazyLoadHandler","componentDidMount","_this$props$requestCa","scriptInitCompleted","clientModuleChunks","chunksToBeAdded","chunk","scriptElements","getElementsByTagName","chunkExistsOnPage","scriptEl","_moduleBinder$compone","registrationBindings","registeredModules","rawModuleRegistrationObj","newModuleRegistrationObj","registeredViews","viewRegistrationKey","rawViewRegistrationObj","newViewComponent","componentRef","renderModuleAttributes","renderView","AddModuleControl","toggleMenuDisplay","button","getAddButtonId","menu","getAddButtonMenuId","display","hideMenuDisplay","slotId","onKeyPressMenu","onKeyPressAddModule","addModule","onKeyPressAddFragment","addFragment","helper","getRenderingHelper","getLocalizedStringsfromTools","stringName","getLocalizedString","enabled","localizedStrings","insertModule","insertFragment","moveNotAllowed","tooltip","onKeyDown","tabIndex","viewBox","mode","Sibling","slotName","parentData","AddModuleWrapper","_this$props","safeRenderProps","addModuleProps","_objectWithoutProperties","_excluded","SafeRenderModuleWithContext","getViewBinder","viewLookupKey","viewCacheKey","PAGE_INSIGHTS_VIEWS_KEY","viewInsights","viewLookupFunc","getView","viewLookup","defaultViewLookupFunc","performanceUtils","getPerformanceUtils","renderId","performanceUtilsPackage","Random","Guid","runPreRenderViewPerformanceHook","node","_view$component","renderViewForModule","runPostRenderViewPerformanceHook","ErrorModule","_get2","useMemo","message","getStandardErrorModuleMarkup","shouldDisplayErrors","isRenderAttrributeCalled","disableSSRErrorChecks","renderCallsCounter","isLazyLoaded","telemetryId","telemetryAttributes","setTelemetryAttribute","moduleAttributes","_isEditorial","_setDataInfoAttribute","moduleIdToExperimentIdMap","MODULE_LAYOUT_FIELD","info","isConfigured","isRegistered","mounted","disableServerSideErrorChecking","mobxShouldComponentUpdate","customShouldComponentUpdate","_setErrorStates","_setDataAttributes","_initializePerformanceComponent","componentDidUpdate","componentDidCatch","runPreRenderPerformanceHook","renderCallIndex","_renderModule","runPostRenderPerformanceHook","initializePerformance","isMounted","mapStateToProps","lazyRenderModuleEnabled","stringFormat","EXCEPTION_UNREGISTEREDMODULEID","errorType","x","element","renderErrorOrPlaceHolderModules","EXCEPTION_ERROR_CLIENT_BOUNDARY","componentStack","moduleError","dataInfo","LazyLoad","offsetTop","_this$props$store","lazyload_offset","$type","_generateDataInfo","_doServerSideRender","renderHtmlString","renderHtml","addFailingModuleServerRenderToCache","stack","SDK_FRAGMENT_NAME","dangerouslySetInnerHTML","__html","buildModuleServerRenderCacheKey","errorName","errorStack","getModuleServerRenderCacheKeyName","SERVER_RENDER_ERROR_CACHE_KEY","refNode","__decorate","moduleConfig","getModuleConfig","EXCEPTION_MISSINGMODULECONFIG","Item","enableAddModuleControls","getSlotDictionary","EXCEPTION_MODULERENDERFAIL","slotDictionary","slotsWithAddModuleControls","addSiblingIndexDictionary","getNonPlaceholderModules","mods","getRenderSlotComponent","parentProps","moduleConfigs","addSiblingIndices","canAddAtIndex","_parentProps$store","EmptySlot","WithContext","parseInt","PDP_PAGE_NAME","FREQUENTLY_BOUGHT_TOGETHER_LIST","PICKS_FOR_YOU_LIST","CATEGORY_PAGE_NAME","PAGE_INSIGHTS_ACTIONS_KEY","LAZYLOAD_SWITCH_PREFIX","CLIENT_DATA_UPDATE_EVENT","AUTHORING_ADD_RENDER_COMPLETE_EVENT","ActionRuntime","complexDataTypesPromises","dataActionMetadataList","lazyLoadModuleIds","tempMetadataList","storeLazyloadModuleId","loadDataProcessing","storeTemporaryAsyncResults","tempResultCacheItem","runOn","tempMetadata","firstInput","dataActionFunction","isObservable","dataCacheType","tempInput","getCacheObjectType","getCacheKey","expectedActionCount","promises","processDataActionMetadataList","getRefreshActions","moduleContract","moduleBinderInitial","combineExtendedDataActionToModule","originalModuleBinder","themeDataActionsForModule","moduleDataActions","dataActionCustimizedMerge","newDataAction","customizer","originAction","newAction","lookupId","newLookUpId","inputFunc","fetchDataActionWithActionid","processModuleDataAction","EXCEPTION_LOADDATA_ACTION_0","EXCEPTION_LOADDATA_ACTION_1","EXCEPTION_LOADDATA_ACTION_2","MESSAGE_CREATE_INPUT_LOADDATA","addLocaleInformation","dataActionInsightsKey","dataActionsInsights","Server","Client","convertRunOnToString","server","serverOnly","renderingContext","switchName","promise","chainAction","dataActionMetadata","EXCEPTION_DATAACTION_EXECUTION","disable_inst_action_await","isServerInstanceAction","runtime","client","ProductListType","ProductListInput","listMetadata","_cacheKey","_cacheObjectType","_cacheType","catalogIdNumber","listType","skipToken","skip","baseCacheKey","productBySearch","searchText","productByCategory","categoryIds","relatedProducts","productIds","promotional","discountIds","editorial","algo","recommendation","includeCart","personalization","getProductImageUrls","products","productsWithImageUrls","ProductListInventoryFilteringOptions","getInventorySorting","channelInventoryConfiguration","sorting","ProductAvailabilitySortableAttributeRecordId","Columns","ColumnName","IsDescending","getInventoryInStockSortableRefinerValue","RefinerRecordId","DataTypeValue","LeftValueBoundString","RightValueBoundString","UnitText","RowNumber","Count","RefinerSourceValue","getProductsByCategoryListAction","productSearchCriteria","Context","ChannelId","CategoryIds","SkipVariantExpansion","IncludeAttributes","queryResultSettings","Paging","Top","pageSize","versionGte","_context$requestConte3","_context$requestConte4","productListInventoryDisplay","HideOOS","SortOOS","StoreOperationsDataActions","getInventoryConfigurationAsync","inventoryInStockRefinerValue","Refinement","Sorting","searchByCriteriaAsync","getProductsByRecentlyViewedListAction","ctx","searchCriteriaInput","cookieContext","Ids","_ctx$requestContext$a","_ctx$requestContext$a2","_ctx$requestContext$a3","_ctx$requestContext$a4","ProductInput","buildCacheKey","base","createGetByIdsInput","DataServiceQuery","productsQuery","resultSettings","createDataServiceRequestForOperation","bypassCache","returnEntity","trace","productIdMapping","executeAction","getByIdsAsyncAction","mappedProducts","memo","isBatched","getProductIdForReco","recommendationCriteria","cartCookieParts","readCart","readAsync","getCart","cartProductIds","includePageContext","getProductsByNewSearchByCriteria","getCustomerActionDataAction","searchCriteria","CustomerAccountNumber","RecommendationListId","recommendationListId","rsVersion","disable_sequential_call_for_recoProducts","getCategoryIdForReco","productSearchResults","productSearchResultsTmp","IsMasterProduct","MasterProductId","getProductsByRecommendationListAction","proxyContext","reccomendationListId","missingType","actionInputError","ProductIds","isHideAndSortByInventoryAvailabilitySupported","_context$requestConte5","getElementsAsync","recommendedElements","productInputs","productTypeId","ElementId","ElementTypeValue","itemIds","_context$requestConte6","_context$requestConte7","unorderedProductSearchResults","orderProductSearchResults","getProductsByRelationshipIdListAction","relationshipId","getRelatedProductsAsync","getProductsByPromotionListAction","productsDataActions","getProductPromotionsAsync","HeaderContext","LineContexts","productPromotions","productSearchResult","getProductsBySearchListAction","searchByTextAsync","listMetaData","productListMetaData","recentlyViewedProducts","INVALID_PRODUCT_LIST_TYPE","productList","updateListDataInRequestCache","EXCEPTION_PRODUCT_LIST_ACTION","cacheValue","_set2","getProxyHandler","disableChildModules","parentModule","slotKeys","childModules","findModule","res","handler","Proxy","propertyPath","parentPath","getDisabledProperties","EditError","fullPath","requiredProperties","getRequiredProperties","PROPERTY_INIT","CustomEvent","renderingHelper","moduleRequiredProperties","HttpException","setPrototypeOf","HttpRedirectException","isTruthy","pageInsights","clientRenderOptimizationEnabled","optimize_client_hydrate","clientRenderQsp","optimize_hydrate","Currency","getCurrency","_requestContext$query2","disable_lazy_render_support","_requestContext$query3","allModulesListArray","flat","exports","str","TypeError","opt","pairs","dec","decode","pair","substring","val","slice","tryDecode","enc","encode","fieldContentRegExp","test","isNaN","isFinite","toUTCString","decodeURIComponent","$TypeError","it","lengthOfArrayLike","doesNotExceedSafeInteger","flattenIntoArray","original","source","sourceLen","start","depth","mapper","thisArg","elementLen","targetIndex","sourceIndex","mapFn","$","toObject","toIntegerOrInfinity","arraySpeciesCreate","proto","depthArg","addToUnscopables","iterate","createProperty","stat","iterable","AS_ENTRIES"],"sourceRoot":""}