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1wB,OAG3B,GAAI0wB,EAAItrD,KAAM,CACZ,IAAKgsD,EAAmBC,KAAKX,EAAItrD,MAC/B,MAAM,IAAIwpD,UAAU,0BAGtB6B,GAAO,UAAYC,EAAItrD,KAGzB,GAAIsrD,EAAInG,QAAS,CACf,GAAuC,mBAA5BmG,EAAInG,QAAQiH,YACrB,MAAM,IAAI5C,UAAU,6BAGtB6B,GAAO,aAAeC,EAAInG,QAAQiH,cAGhCd,EAAIxD,WACNuD,GAAO,cAGLC,EAAIprD,SACNmrD,GAAO,YAGT,GAAIC,EAAIpF,SAAU,CAIhB,OAHuC,iBAAjBoF,EAAIpF,SACtBoF,EAAIpF,SAASziD,cAAgB6nD,EAAIpF,UAGnC,KAAK,EACHmF,GAAO,oBACP,MACF,IAAK,MACHA,GAAO,iBACP,MACF,IAAK,SACHA,GAAO,oBACP,MACF,IAAK,OACHA,GAAO,kBACP,MACF,QACE,MAAM,IAAI7B,UAAU,+BAI1B,OAAO6B,GAlKT,IAAII,EAASY,mBACTN,EAAS3C,mBAUT4C,EAAqB,wCAkKzB,SAASH,EAAUR,EAAKI,GACtB,IACE,OAAOA,EAAOJ,GACd,MAAOv1C,GACP,OAAOu1C,wBCvMXn0B,EAAOuyB,QAAUlnD,2BCAjB20B,EAAOuyB,QAAUl0B","sources":["webpack://mattressfirm/./src/connectors/msdyn365-geoLookup-maxmind/msdyn365-geoLookup-maxmind.provider.ts?c852","webpack://mattressfirm/./src/connectors/msdyn365-geoLookup-maxmind/msdyn365-seg-test-1.provider.ts?9d7c","webpack://mattressfirm/./src/themes/mattressfirm/views/components/carticon.component.tsx?9dbe","webpack://mattressfirm/./src/themes/mattressfirm/views/components/delivery-message/deliverymessage.component.tsx?e440","webpack://mattressfirm/./src/themes/mattressfirm/views/components/price/split-price.tsx?ee35","webpack://mattressfirm/./src/themes/mattressfirm/views/components/price/price.component.tsx?5d2f","webpack://mattressfirm/./src/themes/mattressfirm/views/components/product.component.tsx?8ce2","webpack://mattressfirm/./src/Utilities/convert-to-titlecase.ts?8d6f","webpack://mattressfirm/./src/themes/mattressfirm/views/components/rating.component.tsx?6883","webpack://mattressfirm/./src/themes/mattressfirm/views/components/selectable-card/selectable-card.component.tsx?a7a2","webpack://mattressfirm/./lib/component-registration.js?266e","webpack://mattressfirm/./lib/connector-registration.js?87e5","webpack://mattressfirm/./src/connectors/msdyn365-exp-test/msdyn365-exp-test.listener.ts?1431","webpack://mattressfirm/./src/connectors/msdyn365-exp-test/msdyn365-exp-test.provider.ts?04ad","webpack://mattressfirm/./src/connectors/optimizely-connector/optimizely-connector.listener.ts?70d1","webpack://mattressfirm/./src/interface/IExperimentation.ts?1508","webpack://mattressfirm/./src/connectors/optimizely-connector/optimizely-connector.provider.ts?10b7","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/common/index.js?2b98","webpack://mattressfirm/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/web-vitals/dist/web-vitals.js?1850","webpack://mattressfirm/../../../../src/_server/inteceptors/ttl-cache.ts?e0fd","webpack://mattressfirm/../../../../src/_server/inteceptors/request-vectorizer.ts?c150","webpack://mattressfirm/../../../../src/_server/inteceptors/rs-logging-interceptor.ts?662d","webpack://mattressfirm/../../../../src/hydrators/link-actions/page-type-context-by-id.ts?6c79","webpack://mattressfirm/../../../src/hydrators/process-page-response.ts?c773","webpack://mattressfirm/../../../src/hydrators/link-hydrator.ts?6237","webpack://mattressfirm/../../../src/store/page-context.ts?7400","webpack://mattressfirm/../../../src/utils/session-storage-utils.ts?6e42","webpack://mattressfirm/../../../src/utils/resolve-segments-utils.ts?6007","webpack://mattressfirm/../../../src/_client/client-render.tsx?dd81","webpack://mattressfirm/../../../src/app-initialization/initialization.ts?f0ba","webpack://mattressfirm/../../../src/app-initialization/render-component.tsx?9b51","webpack://mattressfirm/../../../src/app-initialization/client-initialization.ts?84a7","webpack://mattressfirm/../../../src/app-initialization/utils.ts?39fc","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/entry/module-entrypoints-client.js?cde1","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/entry/webpack-public-path.js?7553","webpack://mattressfirm/../../../src/components/add-module-control.tsx?59cd","webpack://mattressfirm/../../../src/components/module-client-render-component.tsx?9466","webpack://mattressfirm/../../../src/components/add-module-wrapper.tsx?05b8","webpack://mattressfirm/../../../src/components/render-view.tsx?751d","webpack://mattressfirm/../../../src/components/error-module.tsx?67fa","webpack://mattressfirm/../../../src/components/safe-render-module.tsx?04c3","webpack://mattressfirm/../../src/consts.ts?a6b5","webpack://mattressfirm/../../../src/app-initialization/models.ts?a775","webpack://mattressfirm/../../../src/data/load-data.ts?fc90","webpack://mattressfirm/../../../src/utils/data-action-extension-helper.ts?35ec","webpack://mattressfirm/../../../src/utils/link-utils.ts?3f81","webpack://mattressfirm/../../../src/hydrators/hydrator-action-inputs.ts?51eb","webpack://mattressfirm/../../../../src/hydrators/utils/inventory-util.ts?0972","webpack://mattressfirm/../../../../src/hydrators/product-list-actions/products-by-category.action.ts?6ed5","webpack://mattressfirm/../../../../src/hydrators/product-list-actions/products-by-recentlyviewed.action.ts?f746","webpack://mattressfirm/../../../src/hydrators/get-simple-products.ts?1a66","webpack://mattressfirm/../../../../src/hydrators/product-list-actions/products-by-recommendation.action.ts?6f98","webpack://mattressfirm/../../../../src/hydrators/product-list-actions/products-by-relationship-id.action.ts?6e59","webpack://mattressfirm/../../../../src/hydrators/product-list-actions/products-by-promotions.action.ts?412e","webpack://mattressfirm/../../../../src/hydrators/product-list-actions/products-by-search.action.ts?f730","webpack://mattressfirm/../../../src/hydrators/product-list-hydrator.ts?e2b4","webpack://mattressfirm/../../../src/store/authoring-edit-helper.ts?e511","webpack://mattressfirm/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/universal-cookie/es6/utils.js?c36d","webpack://mattressfirm/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/universal-cookie/es6/Cookies.js?2bbb","webpack://mattressfirm/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/universal-cookie/es6/index.js?87b9","webpack://mattressfirm/../../../src/utils/cookie-utils.ts?31b7","webpack://mattressfirm/../../../../src/_server/error/HttpException.ts?621a","webpack://mattressfirm/../../../../src/_server/error/HttpRedirectException.ts?19b2","webpack://mattressfirm/../../../src/utils/helpers.ts?7637","webpack://mattressfirm/../../../src/utils/product-list-utils.ts?20d3","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/does-not-exceed-safe-integer.js?905d","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/flatten-into-array.js?5fb7","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.flat.js?010b","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.unscopables.flat.js?fd5e","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.object.from-entries.js?c866","webpack://mattressfirm/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/cookie/index.js?7cab","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import { WebServiceClient } from '@maxmind/geoip2-node';\r\nimport msdyn365Commerce, { IGeoLocation, IGeoLookupProvider, IRequestContext, ISecretValue } from '@msdyn365-commerce/core';\r\n\r\n// tslint:disable-next-line:completed-docs\r\nclass MsDyn365GeoLookupConnector implements IGeoLookupProvider {\r\n\r\n public initialize(): Promise {\r\n return Promise.resolve(true);\r\n }\r\n\r\n public async getGeoInformation(ip: string, ctx: IRequestContext): Promise {\r\n const secretAccountId: ISecretValue | undefined = await msdyn365Commerce.secretManager?.getSecretValue('mm-account-id', ctx.apiSettings.baseUrl);\r\n const secretLicenseKey: ISecretValue | undefined = await msdyn365Commerce.secretManager?.getSecretValue('mm-license-key', ctx.apiSettings.baseUrl);\r\n const client = new WebServiceClient(secretAccountId?.value || '', secretLicenseKey?.value || '');\r\n const maxmindData = await client.city(ip);\r\n const state = maxmindData.subdivisions && maxmindData.subdivisions.length > 0 ? maxmindData.subdivisions[0].isoCode : '';\r\n // Metro code property added for targetting functionlaity (Murali)\r\n const metroCode = maxmindData.location && maxmindData.location.metroCode && maxmindData.location.metroCode.toString() || '';\r\n const geoLocation: IGeoLocation = {\r\n country: maxmindData.country?.isoCode,\r\n city: maxmindData.city?.names.en,\r\n region: state,\r\n zipCode: maxmindData.postal?.code,\r\n metroCode\r\n };\r\n return Promise.resolve(geoLocation);\r\n }\r\n}\r\n\r\nconst connector = new MsDyn365GeoLookupConnector();\r\nexport default connector;","/*!\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 { ISegmentationProvider, ISementations } from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\nconst UserConsentCookieName = '_msdyn365___ucc_';\r\nconst cookieOptionsWithDefaults = { path: '/', maxAge: 31536000, secure: true };\r\n\r\n// set cookie to track sessions for new site\r\nconst cookies = new Cookies();\r\ncookies.set(UserConsentCookieName, Date.now(), cookieOptionsWithDefaults);\r\n\r\n/**\r\n * A basic implementation of the ExperimentationProvider interface used for testing\r\n */\r\nclass MsDyn365GeoLookupTestConnector implements ISegmentationProvider {\r\n private testSegments = {\r\n 101: '25'\r\n };\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public initialize(config: any): Promise {\r\n console.log(`MsDyn365 Segmentation Test Connector called with config: ${JSON.stringify(config)}`);\r\n return Promise.resolve(true);\r\n }\r\n\r\n public async getSegmentations(userId: string, segmentationIds: string[]): Promise {\r\n console.log(`MsDyn365 Segmentation Test Connector will resolve segments - ${segmentationIds} for ${userId}`);\r\n\r\n return Promise.resolve(this.testSegments);\r\n }\r\n}\r\n\r\nconst connector = new MsDyn365GeoLookupTestConnector();\r\nexport default connector;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { getUrlSync, IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nexport interface ICartIconData {\r\n cart?: ICartState;\r\n}\r\n\r\nexport interface ICartIconComponentProps extends IComponentProps {\r\n className?: string;\r\n cartLabel: string;\r\n cartQtyLabel: string;\r\n telemetryContent?: ITelemetryContent;\r\n isParentCustomModule?: boolean;\r\n iconURL?: string;\r\n}\r\n\r\nexport interface ICartIconComponent extends IComponent {\r\n}\r\n\r\nconst CartIconComponentActions = {};\r\n\r\n/**\r\n *\r\n * CartIcon component.\r\n * @extends {React.FC}\r\n */\r\nconst CartIcon: React.FC = observer((props: ICartIconComponentProps) => {\r\n const { cartLabel, cartQtyLabel, data: { cart }, isParentCustomModule, iconURL } = props;\r\n const cartLink = getUrlSync('cart', props.context.actionContext);\r\n // If there are invoice lines, don't update mini cart item quantity\r\n const cartItem = cart ? cart.totalItemsInCart : 0;\r\n const qtyLabel = format(cartQtyLabel, cartItem);\r\n const label = format(cartLabel, cartItem);\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, 'cart-icon', '');\r\n const attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n const style: React.CSSProperties = {\r\n visibility: cart ? 'visible' : 'hidden'\r\n };\r\n if (isParentCustomModule) {\r\n return (\r\n \r\n \r\n {cartItem > 0 &&
\r\n {qtyLabel}\r\n
}\r\n \r\n );\r\n }\r\n return (\r\n \r\n
\r\n {qtyLabel}\r\n
\r\n \r\n );\r\n});\r\n\r\n// @ts-expect-error\r\nexport const CartIconComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'CartIcon',\r\n { component: CartIcon, ...CartIconComponentActions }\r\n);\r\n\r\n\r\nexport default CartIconComponent;","import { ICoreContext, IGeneric, IAny } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\nimport { IBrandListData } from '../../../../../modules/mfrm-buybox/mfrm-buybox.view';\r\nimport { _getSoonestDeliveryDate, _makeDeliveryMessage } from '../../../../../Utilities/product-search-result-utils';\r\nimport { ProductSearchResultExtended } from '../../../custom-components/product-search-result-items';\r\nimport CustomSkeleton from '../../../custom-components/CustomSkeleton';\r\ninterface IDeliveryMessage {\r\n product?: ProductSearchResultExtended;\r\n context: ICoreContext>;\r\n isMasterProduct?: boolean;\r\n attributeValues?: AttributeValue[];\r\n extensionProperties?: CommerceProperty[];\r\n lowestPriceVariantRecordId?: string;\r\n}\r\n\r\n//TODO: common method; move to general utility file. AND change return type to an Enumeration\r\nexport const _getProductType = (shippingInformation: string | undefined): string => {\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'delivery') {\r\n return 'Core';\r\n }\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'parcel') {\r\n return 'Small Parcel';\r\n }\r\n if (shippingInformation && shippingInformation.toLowerCase() === 'drop ship') {\r\n return 'Drop Ship';\r\n }\r\n return '';\r\n};\r\n\r\nexport const computeItemLines = (\r\n product: IDeliveryMessage['product'],\r\n defaultVariantId: number | undefined,\r\n lowestPriceVariantRecordId: string | undefined\r\n) => {\r\n if (product?.IsMasterProduct) {\r\n if (defaultVariantId && defaultVariantId !== 0) {\r\n return defaultVariantId.toString();\r\n }\r\n if (lowestPriceVariantRecordId && lowestPriceVariantRecordId !== '') {\r\n return lowestPriceVariantRecordId;\r\n }\r\n }\r\n return product?.RecordId.toString();\r\n};\r\n\r\nconst DeliveryMessage: React.FC = ({\r\n product,\r\n context,\r\n attributeValues,\r\n extensionProperties,\r\n lowestPriceVariantRecordId\r\n}) => {\r\n let productDeliveryMessage = '';\r\n const { app } = context;\r\n const shippingInformationSmall = attributeValues && attributeValues.find(\r\n (attr: AttributeValue) => attr.Name?.trim() === app.config.smallParcelAttributeKey\r\n )?.TextValue?.toLowerCase();\r\n\r\n const defaultVariantShippingInformation = extensionProperties && extensionProperties.find(\r\n (property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantShippingInformation\"\r\n )?.Value?.StringValue;\r\n\r\n if ((_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Core') {\r\n productDeliveryMessage = product?.deliveryByMessage ?? '';\r\n } else if ((\r\n (_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Small Parcel' ||\r\n (_getProductType(defaultVariantShippingInformation || shippingInformationSmall)) === 'Drop Ship'\r\n )) {\r\n let deliveryDays =\r\n attributeValues && attributeValues.find(attr => attr.Name?.trim() === app.config.leadTime)?.TextValue;\r\n if (\r\n (deliveryDays === '' || deliveryDays === undefined || deliveryDays === null) &&\r\n app.config.brandList &&\r\n app.config.brandList.length > 0\r\n ) {\r\n const brand =\r\n attributeValues &&\r\n attributeValues.find(\r\n attr =>\r\n app.config.brandBackofficeAttributePlp &&\r\n attr.Name?.trim() === app.config.brandBackofficeAttributePlp\r\n )?.TextValue?.toLowerCase();\r\n\r\n if (brand !== undefined && brand !== null && brand !== '') {\r\n app.config.brandList.map((singleBrand: IBrandListData) => {\r\n if (singleBrand.brandName.toLowerCase() === brand) {\r\n deliveryDays =\r\n singleBrand.brandLeadtime !== undefined &&\r\n singleBrand.brandLeadtime !== '' &&\r\n singleBrand.brandLeadtime !== null\r\n ? singleBrand.brandLeadtime\r\n : '';\r\n }\r\n });\r\n }\r\n deliveryDays = app.config.brandList[0].brandLeadtime;\r\n }\r\n if (deliveryDays && productDeliveryMessage === '') {\r\n productDeliveryMessage = _makeDeliveryMessage(deliveryDays);\r\n }\r\n }\r\n\r\n return productDeliveryMessage ? (\r\n
\r\n {productDeliveryMessage}\r\n
\r\n ) : ;\r\n};\r\n\r\nexport default DeliveryMessage;","export const splitPrice = (price: number | boolean | undefined) => {\r\n if (price === 0) {\r\n return { dollars: \"0\", cents: \"\" };\r\n }\r\n const formattedPrice = price?.toLocaleString(\"en-US\", {\r\n style: \"currency\",\r\n currency: \"USD\"\r\n });\r\n\r\n const priceArr = formattedPrice?.match(/(\\d|,)+/g);\r\n\r\n const dollars = priceArr?.[0] || \"0\";\r\n const cents = priceArr?.[1] || \"00\";\r\n\r\n return { dollars, cents };\r\n};\r\n","import React from 'react';\r\nimport { splitPrice } from \"./split-price\";\r\n\r\nexport interface PriceProps {\r\n standard: number;\r\n current: number | false | undefined;\r\n}\r\n\r\nexport const Price:React.FC = ({ standard, current }) => {\r\n const { dollars: standardDollars, cents: standardCents } = splitPrice(\r\n standard\r\n );\r\n const { dollars: currentDollars, cents: currentCents } = splitPrice(current);\r\n\r\n return (\r\n
\r\n {current && (\r\n
\r\n ${currentDollars}\r\n {currentCents}\r\n
\r\n )}\r\n
\r\n ${standardDollars}\r\n {standardCents}\r\n {current &&
}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Price;\r\n","import { getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n format,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n onTelemetryClick\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { PriceComponent, RatingComponent, IPriceComponentResources } from '@msdyn365-commerce/components';\r\nimport { CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport MsDyn365, {\r\n IComponent,\r\n IComponentProps,\r\n ICoreContext,\r\n IGridSettings,\r\n IImageData,\r\n IImageSettings,\r\n IImageProps,\r\n Image,\r\n IRequestContext,\r\n msdyn365Commerce,\r\n RichTextComponent\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeValue, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport React from 'react';\r\n// VSI Customization - starts\r\nimport { convertToTitlecase } from '../../../../Utilities/convert-to-titlecase';\r\nimport { getBVAttributeValues } from '../../../../Utilities/get-bv-attributes';\r\nimport { buildProductBadge, parseBadgeData } from '../../../../Utilities/get-product-badge';\r\nimport { parseBrandName } from '../../../../Utilities/get-product-brand';\r\nimport {\r\n _coreProductATPCall,\r\n _getEyebrowMessage,\r\n _getSoonestDeliveryDate,\r\n _makeDeliveryMessage\r\n} from '../../../../Utilities/product-search-result-utils';\r\nimport { FinancingPerMonthComponent } from '../../custom-components/financing-per-month-component';\r\nimport DeliveryMessage from './delivery-message';\r\nimport { BVRatingSummary } from '../../../../Utilities/components/BVRatingSummary';\r\nimport { removeSpecialChars } from '../../../../Utilities/allRegex';\r\nimport CustomSkeleton from '../../custom-components/CustomSkeleton';\r\nimport { ErrorBoundary } from '../../../../common/components/error-boundary';\r\n// VSI Customization - ends\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 eyebrowMessage?: string | undefined;\r\n badgeAttribute?: string;\r\n deliveryMessage?: string;\r\n isRefinersEnabled?: boolean;\r\n // VSI Customization - Copied following 3 props from OOTB product.component to be used in product recommendations for Cart\r\n ratingCountAriaLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n // Customized props for product recommendation on Cart page\r\n displayShopNow?: boolean;\r\n showBvRatings?: boolean;\r\n shopNowBtnText?: string;\r\n}\r\n\r\nexport interface IEyebrowMessageDimensions {\r\n height: number;\r\n visibleHeight: number;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent { }\r\n\r\nconst PriceComponentActions = {};\r\n\r\n// tslint:disable-next-line: max-func-body-length cyclomatic-complexity\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 eyebrowMessage,\r\n badgeAttribute,\r\n deliveryMessage,\r\n isRefinersEnabled,\r\n displayShopNow,\r\n shopNowBtnText,\r\n showBvRatings\r\n}) => {\r\n // VSI Customization - starts\r\n const {\r\n app: {\r\n config: { brandBackofficeAttributePlp, enableAttributeBasedRating }\r\n }\r\n } = context;\r\n const getEyebrowElementRef = React.useRef(null);\r\n const eyebrowElement = getEyebrowElementRef.current?.querySelector('.mfrm-eyebrow__button-plp') as Element;\r\n const [isTruncated, setTruncated] = React.useState({\r\n height: eyebrowElement?.scrollHeight,\r\n visibleHeight: eyebrowElement?.clientHeight\r\n });\r\n\r\n const badgeAttributeToUse = context.app.config.productBadgeAttribute;\r\n // VSI Customization - ends\r\n const product = data.product;\r\n if (!product) {\r\n return null;\r\n }\r\n // VSI Customization - starts\r\n /** When enabled rating values will be picked from BazaarVoice attributes created on product.\r\n * If disabled rating will be shown from OOTB properties on a product.\r\n * This will be used for PLP and product-collection/product recommendations\r\n */\r\n const { AttributeValues, ExtensionProperties } = product;\r\n let isBVratings = false;\r\n if (AttributeValues && AttributeValues?.find(attr => attr.Name?.trim() === \"BVAverageOverallRating\")) {\r\n isBVratings = true;\r\n }\r\n const averageRating = enableAttributeBasedRating && AttributeValues && isBVratings ? getBVAttributeValues(AttributeValues, 'BVAverageOverallRating') : _parseValue(product?.AverageRating);\r\n const totalRatings = enableAttributeBasedRating && AttributeValues && isBVratings ? getBVAttributeValues(AttributeValues, 'BVTotalReviewCount') : _parseValue(product?.TotalRatings);\r\n React.useEffect(() => {\r\n function handleResize(): void {\r\n setTruncated({\r\n height: eyebrowElement?.scrollHeight,\r\n visibleHeight: eyebrowElement?.clientHeight\r\n });\r\n }\r\n handleResize();\r\n if (MsDyn365.isBrowser) {\r\n window.addEventListener('resize', handleResize);\r\n return () => window.removeEventListener('resize', handleResize);\r\n } else {\r\n return () => null;\r\n }\r\n }, [eyebrowElement?.scrollHeight, eyebrowElement?.clientHeight]);\r\n // VSI Customization - ends\r\n const lowestPriceVariantRecordId = AttributeValues?.find(\r\n attr => attr.Name?.trim() === context.app.config.EcomLowestPriceVariantRecIdKey\r\n )?.TextValue;\r\n const unbxdDefaultVariant = product && product.ExtensionProperties?.find((property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantID\")?.Value?.LongValue;\r\n const queryBasedSelection = context.app.config.queryBasedVariantSelection;\r\n const fallBackImage = context.app.config.placeholderImageName;\r\n const defaultOrLowestVariantRecordId = unbxdDefaultVariant! > 0 ? unbxdDefaultVariant : product.RecordId;\r\n let productUrl = getProductPageUrlSync(removeSpecialChars(product?.Name!, context) || '', queryBasedSelection ? product.MasterProductId || product.RecordId : product.RecordId, context && context.actionContext, undefined);\r\n\r\n if (allowBack) {\r\n productUrl = updateProductUrl(productUrl, context);\r\n }\r\n if (queryBasedSelection) {\r\n const variantIdQueryParams = productUrl.includes('?') ? `&variantid=${defaultOrLowestVariantRecordId}` : `?variantid=${defaultOrLowestVariantRecordId}`;\r\n productUrl += variantIdQueryParams;\r\n }\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', defaultOrLowestVariantRecordId!.toString());\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n // VSI Customization -starts\r\n // #17772: Check the master product, if false then add size Refinement property otherwise show Starting at\r\n let sizeValue =\r\n product && !product?.IsMasterProduct && product?.ExtensionProperties && product?.ExtensionProperties?.length > 0\r\n ? product?.ExtensionProperties.find(i => i.Key === \"Size\")?.Value?.StringValue\r\n : '';\r\n sizeValue = sizeValue && convertToTitlecase(sizeValue);\r\n\r\n // Flag used on cart page to display ratings & shop now button\r\n const isCustomizedDesign = displayShopNow;\r\n\r\n if (typeName === 'product-collection') {\r\n // VSI Customization -starts\r\n const brandName = parseBrandName(AttributeValues, brandBackofficeAttributePlp);\r\n const productTitleWithBrandname = brandName ? `${brandName} ${product.Name}` : product.Name;\r\n // VSI Customization -end\r\n // tslint:disable:max-line-length\r\n return (\r\n \r\n
\r\n \r\n {
{renderProductBadge(badgeAttributeToUse, AttributeValues, context.request)}
}\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, product.PrimaryImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext, fallBackImage)}\r\n
\r\n \r\n
\r\n {/* VSI Customization - START */}\r\n {/* (ADO:23447) Added only class name conditionally as discounted price based on product.component if BasePrice > Price then it will be discounted else not */}\r\n product.Price\r\n ? 'msc-product discounted'\r\n : 'msc-product'\r\n : 'msc-product'\r\n }\r\n href={productUrl}\r\n onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating,\r\n ratingAriaLabel\r\n )}\r\n {...attribute}\r\n >\r\n {/* Todo: 'Starting at' string will be replaced with relevant resources */} {/* For cart page, price will be shown after name */}\r\n {!isCustomizedDesign &&\r\n <>\r\n {sizeValue ? sizeValue : product.Price !== 0 ? 'Starting at ' : ''}\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText\r\n )}\r\n \r\n }\r\n {!isCustomizedDesign &&\r\n \r\n {productTitleWithBrandname && productTitleWithBrandname.length > 40\r\n ? `${productTitleWithBrandname.slice(0, 40)}...`\r\n : productTitleWithBrandname}\r\n \r\n }\r\n {isCustomizedDesign &&\r\n \r\n {productTitleWithBrandname}\r\n \r\n }\r\n {isCustomizedDesign &&\r\n
\r\n {renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText\r\n )}\r\n
\r\n }\r\n {/* todo : will be added when required in next sprints */}\r\n {!context.app.config.hideRating &&\r\n renderRating(context, typeName, id, averageRating, totalRatings, ratingAriaLabel)}\r\n {isCustomizedDesign &&\r\n \r\n }\r\n {/* VSI Customization - END */}\r\n \r\n
\r\n {/* OOB Quick View */}\r\n {/* {quickViewButton && renderQuickView(quickViewButton, product.RecordId)} */}\r\n
\r\n
\r\n );\r\n } else {\r\n const priceComponent = renderPrice(\r\n context,\r\n typeName,\r\n id,\r\n product.BasePrice,\r\n product.Price,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText\r\n );\r\n const isSearchResultContainer = typeName === 'search-result-container' || typeName === 'mfrm-search-result-container';\r\n const brandName = parseBrandName(AttributeValues, brandBackofficeAttributePlp);\r\n return (\r\n // tslint:disable-next-line: react-this-binding-issue jsx-no-lambda\r\n \r\n
setProductUrl(productUrl)}>\r\n \r\n {isSearchResultContainer && (\r\n
\r\n {renderProductBadge(badgeAttributeToUse, AttributeValues, context.request)}\r\n
\r\n )}\r\n
\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, product.PrimaryImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext, fallBackImage)}\r\n
\r\n \r\n\r\n
\r\n {/* VSI Customization - START */}\r\n
\r\n {/* VSI Customization - END */}\r\n {isSearchResultContainer && eyebrowMessage && (\r\n
\r\n
\r\n \r\n {isTruncated.height > isTruncated.visibleHeight ? (\r\n \r\n ) : (\r\n false\r\n )}\r\n
\r\n
\r\n )}\r\n {isSearchResultContainer && !eyebrowMessage && eyebrowMessage?.length !== 0 && !showBvRatings && (\r\n \r\n )}\r\n {isSearchResultContainer && eyebrowMessage?.length === 0 && !showBvRatings && (\r\n
\r\n
 
\r\n
\r\n )}\r\n {!context.app.config.hideRating && (data.product && showBvRatings) ? :\r\n (renderRating(context, typeName, id, averageRating, totalRatings, ratingAriaLabel) ? renderRating(context, typeName, id, averageRating, totalRatings, ratingAriaLabel) :\r\n
\r\n
 
\r\n
\r\n )}\r\n {/* VSI Customization - START */}\r\n
\r\n {/* VSI Customization - END */}\r\n \r\n \r\n {brandName ? `${brandName} ${product.Name}` : product.Name}\r\n \r\n\r\n {/* original price */}\r\n {!isSearchResultContainer && priceComponent}\r\n {renderDescription(product.Description)}\r\n \r\n {/* {deliveryMessage && <>{deliveryMessage}} */}\r\n \r\n
\r\n {/* new price */}\r\n {isSearchResultContainer\r\n ? product.Price\r\n ? priceComponent && (\r\n \r\n )\r\n : priceComponent\r\n : null}\r\n {/* OOB Quick View */}\r\n {/* {quickViewButton && renderQuickView(quickViewButton, product.RecordId)} */}\r\n
\r\n
\r\n );\r\n }\r\n // VSI Customization - Ends here\r\n};\r\n// VSI Customization - Starts here\r\nfunction _parseValue(productRating?: string | number): number {\r\n const value = +(productRating || 0);\r\n return Math.round(value * 10) / 10;\r\n}\r\n// VSI Customization - Ends here\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 setProductUrl(productUrl: string): void {\r\n if (MsDyn365.isBrowser) {\r\n window.location.href = productUrl;\r\n }\r\n}\r\n\r\nfunction renderDescription(description?: string): JSX.Element | null {\r\n return

{description}

;\r\n}\r\n\r\n// Render Quick View\r\n// function 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(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\r\n avgRating?: number,\r\n totalRatings?: number,\r\n ariaLabel?: string\r\n): JSX.Element | null {\r\n if (avgRating && avgRating !== 0) {\r\n const numRatings = (totalRatings && totalRatings.toString()) || '0';\r\n const ratingAriaLabel = getRatingAriaLabel(avgRating, ariaLabel);\r\n\r\n return (\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n}\r\n\r\nfunction renderPrice(\r\n context: ICoreContext,\r\n typeName: string,\r\n id: string,\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 return basePrice ? (\r\n \r\n ) : null;\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 * @param fallBackImage - Placeholder Image from App settings\r\n * @returns React component for product image.\r\n */\r\nfunction renderProductPlacementImage(\r\n productCardimageSettings?: IImageSettings, gridSettings?: IGridSettings,\r\n imageUrl?: string, fallbackImageUrl?: string, altText?: string, requestContext?: IRequestContext, fallBackImage?: string): JSX.Element | null {\r\n\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\r\n const emptyPlaceHolderImage = fallBackImage || '';\r\n let fallbackImageSource = fallbackImageUrl;\r\n if (emptyPlaceHolderImage && fallbackImageUrl) {\r\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\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 = { gridSettings };\r\n\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n \r\n );\r\n}\r\n// VSI Customization - starts\r\n\r\nfunction renderProductBadge(\r\n attributeName: string | undefined,\r\n attributes: AttributeValue[] | undefined,\r\n requestContext: IRequestContext\r\n): JSX.Element | undefined {\r\n const badgeData =\r\n attributeName &&\r\n attributes?.find(\r\n currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === attributeName.toLowerCase().trim()\r\n )?.TextValue;\r\n if (!badgeData) {\r\n return;\r\n }\r\n\r\n // split badge data into its separate badges\r\n const badges = badgeData.split(',');\r\n\r\n // parse badge data to get its schedule and image src\r\n const parsedBadges = badges.map(badge => parseBadgeData(badge, requestContext));\r\n // build product badge image components\r\n const finalizedBadges = parsedBadges.map(parsedBadge => parsedBadge && buildProductBadge(parsedBadge, requestContext));\r\n\r\n return finalizedBadges && <>{finalizedBadges};\r\n}\r\n\r\n// VSI Customization - ends\r\n\r\n// @ts-ignore\r\nexport const ProductComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride<\r\n IProductComponent\r\n>('Product', { component: ProductCard, ...PriceComponentActions });\r\n\r\nexport default ProductComponent;","export const convertToTitlecase = (stringValue?: string, stopConvert?: boolean) => {\r\n // this stopConvert flag will use to stop conversion in specific scenario\r\n return stopConvert\r\n ? stringValue\r\n : stringValue?.replace(/\\w\\S*/g, txt => {\r\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\r\n });\r\n};\r\n","import React, { useEffect, useState } from 'react';\r\n\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\n\r\nexport interface IRatingComponentProps extends IComponentProps<{}> {\r\n readOnly: boolean;\r\n ariaLabel: string;\r\n avgRating: number;\r\n ratingCount?: string;\r\n initialRating?: number;\r\n hideCount?: boolean;\r\n className?: string;\r\n onChange?(value: number): void;\r\n}\r\nexport interface IRatingComponent extends IComponent {\r\n onSliderChanged(): (\r\n event: React.ChangeEvent,\r\n props: IRatingComponentProps,\r\n setRating: (rating: IRatingState) => void\r\n ) => void;\r\n onMouseOver(): (event: React.MouseEvent, rating: IRatingState, setRating: (rating: IRatingState) => void) => void;\r\n onClick(): (event: React.MouseEvent, props: IRatingComponentProps, setRating: (rating: IRatingState) => void) => void;\r\n onMouseLeave(): (event: React.MouseEvent, rating: IRatingState, setRating: (rating: IRatingState) => void) => void;\r\n}\r\n\r\ninterface IRatingState {\r\n rating: number;\r\n lastSelectedRating: number;\r\n}\r\n\r\nconst roundUpMin: number = 0.75;\r\nconst roundMidMin: number = 0.25;\r\nconst maxRating: number = 5;\r\n\r\nconst RatingComponentActions = {\r\n onSliderChanged(\r\n event: React.ChangeEvent,\r\n props: IRatingComponentProps,\r\n setRating: (rating: IRatingState) => void\r\n ): void {\r\n const value = Number.parseInt(event.target.value, 10);\r\n setRating({ rating: value, lastSelectedRating: value });\r\n\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n },\r\n onMouseLeave(_event: React.MouseEvent, rating: IRatingState, setRating: (rating: IRatingState) => void): void {\r\n setRating({ rating: rating.lastSelectedRating, lastSelectedRating: rating.lastSelectedRating });\r\n },\r\n onMouseOver(event: React.MouseEvent, rating: IRatingState, setRating: (rating: IRatingState) => void): void {\r\n setRating({ rating: getIndex(event), lastSelectedRating: rating.lastSelectedRating });\r\n },\r\n onClick(event: React.MouseEvent, props: IRatingComponentProps, setRating: (rating: IRatingState) => void): void {\r\n if (!props.readOnly) {\r\n const index = getIndex(event);\r\n setRating({ rating: index, lastSelectedRating: index });\r\n\r\n if (props.onChange) {\r\n props.onChange(index);\r\n }\r\n }\r\n }\r\n};\r\n\r\nconst Rating: React.FC = (props: IRatingComponentProps) => {\r\n const initialRating = props.readOnly ? props.avgRating : props.initialRating || 0;\r\n const [rating, setRating] = useState({ rating: initialRating, lastSelectedRating: initialRating });\r\n useEffect(() => {\r\n const newRating = props.readOnly ? props.avgRating : props.initialRating || 0;\r\n setRating({ rating: newRating, lastSelectedRating: newRating });\r\n }, [props]);\r\n const onChange = (event: React.ChangeEvent) => {\r\n RatingComponentActions.onSliderChanged(event, props, setRating);\r\n };\r\n const onMouseLeave = (event: React.MouseEvent) => {\r\n RatingComponentActions.onMouseLeave(event, rating, setRating);\r\n };\r\n const onMouseOver = (event: React.MouseEvent) => {\r\n RatingComponentActions.onMouseOver(event, rating, setRating);\r\n };\r\n const onClick = (event: React.MouseEvent) => {\r\n RatingComponentActions.onClick(event, props, setRating);\r\n };\r\n\r\n return (\r\n
0 ? 'msc-no-ratings' : ''} ${props.className ? props.className : ''}`}>\r\n {starControl(props.readOnly, rating.rating, props.ariaLabel, onChange)}\r\n
\r\n {renderStars(rating.rating, props, onMouseOver, onClick)}\r\n
\r\n {/* VSI Customization - START */}\r\n \r\n ({props.ratingCount})\r\n \r\n {/* VSI Customization - END */}\r\n
\r\n );\r\n};\r\n\r\n// Set default props\r\nRating.defaultProps = {\r\n avgRating: 0\r\n} as Partial;\r\n\r\nconst starControl = (\r\n readOnly: boolean,\r\n currentRating: number,\r\n ariaLabel: string,\r\n onChange: (event: React.ChangeEvent) => void\r\n): JSX.Element => {\r\n if (readOnly) {\r\n return
{ariaLabel}
;\r\n }\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst renderStars = (\r\n rating: number,\r\n props: IRatingComponentProps,\r\n mouseOver: (event: React.MouseEvent) => void,\r\n onClick: (event: React.MouseEvent) => void\r\n): JSX.Element[] => {\r\n const floor = Math.floor(rating);\r\n const remainder = rating - floor;\r\n const filled = remainder < roundUpMin ? floor : floor + 1;\r\n const half = roundMidMin <= remainder && remainder < roundUpMin ? filled + 1 : 0;\r\n const stars = [];\r\n\r\n for (let i = 1; i <= maxRating; i++) {\r\n const glyphClass = filled >= i ? 'msc-rating__star' : half === i ? 'msc-rating__half-star' : 'msc-rating__empty-star';\r\n stars.push(\r\n \r\n );\r\n }\r\n\r\n return stars;\r\n};\r\n\r\nconst getIndex = (event: React.MouseEvent): number => {\r\n const target = event.target as HTMLElement;\r\n return Number.parseInt(target.getAttribute('data-index')!, 10);\r\n};\r\n\r\n// @ts-ignore\r\nexport const RatingComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'Rating',\r\n { component: Rating, ...RatingComponentActions }\r\n);\r\n\r\nexport default RatingComponent;\r\n","import React from 'react';\r\nimport { Price } from '../price/price.component';\r\nexport interface SelectableCardProps {\r\n img: React.ReactNode;\r\n productName: string;\r\n ratings?: React.ReactNode;\r\n standardPrice?: false | number;\r\n currentPrice?: false | number | undefined;\r\n eyebrowText?: string;\r\n isActive?: boolean\r\n}\r\n\r\nconst SelectableCard:React.FC = ({ img, productName, ratings, standardPrice, currentPrice, eyebrowText, isActive = true }) => {\r\n return (\r\n
\r\n
{img}
\r\n
\r\n
{eyebrowText}
\r\n
{productName}
\r\n {ratings && (\r\n
\r\n {ratings}\r\n
\r\n )}\r\n {standardPrice && }\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default SelectableCard;","/**\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__|themes|mattressfirm|views|components|addtocart|addtocart'] = {\n c: () => require('partner/themes/mattressfirm/views/components/addtocart/addtocart.component.tsx'),\n cn: '__local__-__local__-addtocart'\n };\ncomponentDictionary['__local__|__local__|themes|mattressfirm|views|components|carticon'] = {\n c: () => require('partner/themes/mattressfirm/views/components/carticon.component.tsx'),\n cn: '__local__-__local__-carticon'\n };\ncomponentDictionary['__local__|__local__|themes|mattressfirm|views|components|cartlineitem'] = {\n c: () => require('partner/themes/mattressfirm/views/components/cartlineitem.component.tsx'),\n cn: '__local__-__local__-cartlineitem'\n };\ncomponentDictionary['__local__|__local__|themes|mattressfirm|views|components|delivery-message|deliverymessage'] = {\n c: () => require('partner/themes/mattressfirm/views/components/delivery-message/deliverymessage.component.tsx'),\n cn: '__local__-__local__-deliverymessage'\n };\ncomponentDictionary['__local__|__local__|themes|mattressfirm|views|components|price|price'] = {\n c: () => require('partner/themes/mattressfirm/views/components/price/price.component.tsx'),\n cn: '__local__-__local__-price'\n };\ncomponentDictionary['__local__|__local__|themes|mattressfirm|views|components|product'] = {\n c: () => require('partner/themes/mattressfirm/views/components/product.component.tsx'),\n cn: '__local__-__local__-product'\n };\ncomponentDictionary['__local__|__local__|themes|mattressfirm|views|components|promocode'] = {\n c: () => require('partner/themes/mattressfirm/views/components/promocode.component.tsx'),\n cn: '__local__-__local__-promocode'\n };\ncomponentDictionary['__local__|__local__|themes|mattressfirm|views|components|rating'] = {\n c: () => require('partner/themes/mattressfirm/views/components/rating.component.tsx'),\n cn: '__local__-__local__-rating'\n };\ncomponentDictionary['__local__|__local__|themes|mattressfirm|views|components|selectable-card|selectable-card'] = {\n c: () => require('partner/themes/mattressfirm/views/components/selectable-card/selectable-card.component.tsx'),\n cn: '__local__-__local__-selectable-card'\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 = '100';\n \n let connectorProviderImpl = require('partner/connectors/msdyn365-geoLookup-maxmind/msdyn365-seg-test-1.provider');\n if (!connectorProviderImpl.default) {\n throw new Error('segmentation Connector provider 100 does not have a default export. Check the provider file of the connector for a default export.');\n }\n connectorDictionary[connectorName] = {provider: connectorProviderImpl.default};\n }\n\n {\n const connectorName = 'Optimizely';\n \n let connectorProviderImpl = require('@msdyn365-commerce-thirdpartyconnectors/exp-connector-optimizely/dist/lib/connectors/optimizely-connector/optimizely-connector.provider');\n let connectorListenerImpl = require('@msdyn365-commerce-thirdpartyconnectors/exp-connector-optimizely/dist/lib/connectors/optimizely-connector/optimizely-connector.listener');\n let connectorDomainsList = '';\n if (!connectorProviderImpl.default) {\n throw new Error('Exp Connector provider Optimizely 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 Optimizely 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\n {\n const connectorName = 'geoLookup-maxmind';\n \n if (isServer()) {\n let connectorProviderImpl = require('partner/connectors/msdyn365-geoLookup-maxmind/msdyn365-geoLookup-maxmind.provider');\n if (!connectorProviderImpl.default) {\n throw new Error('Geo Lookup Connector provider geoLookup-maxmind does not have a default export. Check the provider file of the connector for a default export.');\n }\n connectorDictionary[connectorName] = {provider: connectorProviderImpl.default};\n }\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 verifySegmentationRegistration('100');\n\n\n if (isServer()) {\n verifyGeoLookupRegistration('geoLookup-maxmind');}\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 { 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 */\nimport { IExpLogger } from '../../interface';\nimport * as optimizely from '@optimizely/optimizely-sdk';\n\n// tslint:disable: no-any\n\n/**\n * Optimizely listener implementation\n */\nclass OptimizelyConnectorListener implements IExpLogger {\n private userId:string = '';\n private optimizelyClientInstance:optimizely.Client | undefined;\n public initializeClientSide(config?: any, userId?: string): boolean {\n if(!config){\n return false;\n }\n this.userId = userId || '';\n try {\n this.optimizelyClientInstance = optimizely.createInstance(\n { datafile: config }\n );\n } catch(e) {\n throw e;\n }\n return true;\n\n\n }\n\n // Call the track event to pass eventKey, userId and the custom payload info\n public logEvent(eventName: string, payload: any, attributes?: any): void {\n \n // We dont have any user attributes to pass \n attributes = null;\n\n // Optimizely expects revenue to come in cents so we convert the revenue dollar amount in the payload to cents\n if (payload.revenue) {\n payload.revenue = parseFloat(payload.revenue) * 100\n }\n // @ts-ignore Ignore argument of type null for attributes\n this.optimizelyClientInstance && this.optimizelyClientInstance.track(eventName, this.userId, attributes, payload);\n }\n}\n\nconst connectorListener = new OptimizelyConnectorListener();\nexport default connectorListener;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n// tslint:disable:no-any\n/**\n * State of an experiment\n */\n\nexport enum State {\n Draft = 'Draft',\n Active = 'Active',\n Running = 'Running',\n Paused = 'Paused',\n Archived = 'Archived'\n}\n\n/**\n * Variations on each experiment\n */\nexport interface IVariations {\n // friendly name of a variation\n // required\n friendlyName: string;\n\n // unique id or key for the variation\n // required\n id: string;\n\n // variation status\n // required. Can be defaulted to active\n status: State;\n\n // variation weight\n // Optional\n weight?: string;\n}\n\n/**\n * Experiments\n */\nexport interface IExperiments {\n // Friendly name\n // Required\n friendlyName: string;\n\n // unique id or key of the experiment\n // required\n id: string;\n\n // variation status\n // required\n status: State;\n\n // array of variations\n // required\n variations: IVariations[];\n\n // Created Date\n createdDate?: string;\n\n // Last modified date\n lastModifiedDate?: string;\n\n // Last modified by\n lastModifiedBy?: string;\n\n // Description\n description?: string;\n\n // Type\n type?: string;\n\n // Link url\n link?: string;\n\n resultLink?: string;\n}\n/**\n * Experiment results interface to display connector name and experiments related to the connector\n */\nexport interface IExperimentsResult {\n name?: string;\n experiments?: IExperiments[];\n}\n\n/**\n * Variants\n */\n\nexport interface IVariants {\n // Unique Id or key of the variant\n // Required\n variantId: string;\n\n // unique id or key of the experiment\n // required\n experimentId: string;\n}\n\n\nexport interface ISecretValue {\n value: string;\n id?: string;\n error?: Error;\n expiresOn: number;\n}\n\n/**\n * Used to fetch any customer secret values stored in Retail Server Keyvault\n * An initialized class implementing this interface is passed to the initialize method.\n * \n * Note that the secretManager is only available server-side. Functions that run client side (initializeClientSide, activate)\n * will not be able to use the secretManager\n */\nexport interface ISecretManager {\n getSecretValue(secretKey: string, baseRetailServerUrl: string): Promise;\n}\n\nexport interface IExperimentationProvider {\n /**\n * Allows the experimentation connector to do any startup related tasks\n * using the config provided by the partner.\n *\n * This method is only called once during server startup.\n * @param config The config provided by the partner in connector settings.\n * @param secretManager Class used to retrieve secrets stored in retail server key vault\n */\n initialize(config: any, secretManager: ISecretManager): Promise;\n\n /**\n * Returns the configuration that should be passed to the experimentation connector\n * when it is initialized client-side\n */\n getConfigForClientSideInit(): Promise;\n\n /**\n * Initailizes the experimentation provider on the browser (client-side) so that\n * it may activate experiments for a user.\n *\n * @param config The config that is required to initialize the experimentation connector\n * client-side. The result of getConfigForClientSideInit() is passed into this method\n */\n initializeClientSide(config: any): boolean;\n\n /**\n * Returns a list of all the experiments currently configured whether active or not.\n * This list will be cached and periodically refreshed.\n * @param retailServerBaseUrl The retail server base URL.\n * @param connectorName The optimizely conector name.\n * @param page Optional argument that specifies the page to return.\n * @param items Optional argument that specifies the maximum number of objects to return per request.\n */\n getExperiments(retailServerBaseUrl: string, connectorName: string, page?: string, items?: string): Promise;\n\n /**\n * Returns a list of experiments and variants a user will be a part of based\n * off the userId. Optional attributes can provide the connector with additional criteria\n * to determine which experiments a user should be a part of.\n *\n * @param userId userId unique to a user if signed in or unique to a session if user is anonymous.\n * userId will be generated from hash if user is signed-in to deterministically generate sanatized userIds.\n * @param attributes Optional user related attributes\n */\n getVariantsForUser(userId: string, attributes?: { [index: string]: string }): IVariants[];\n\n /**\n * Activates experiment(s) a user is currently being served. This call will be made\n * client-side after the connector has been initialized client-side\n *\n * @param userId userId unique to a user if signed in or unique to a session if user is anonymous.\n * userId will be generated from hash if user is signed-in to deterministically generate sanatized userIds.\n * @param experiments The experiments the user is participating in.\n * @param attributes Optional user related attributes\n */\n activateExperiment(userId: string, experiments: IVariants[], attributes?: { [index: string]: string }): boolean;\n}\n\nexport declare enum TelemetryEvent {\n PageView = \"PageView\",\n ProductPageView = \"ProductPageView\",\n AddToCart = \"AddToCart\",\n RemoveFromCart = \"RemoveFromCart\",\n UpdateInCart = \"UpdateInCart\",\n CheckOut = \"CheckOut\",\n Purchase = \"Purchase\",\n Custom = \"Custom\"\n}\n\nexport declare type TelemetryEventContent = IPageViewInfo | ICartInfo | IProductTransaction | ICustomEvent;\n/***\n * @property title {string} - Page title\n * @property location {string} - Page location\n * @property page {string} - Page info\n */\nexport interface IPageViewInfo {\n title: string;\n location?: string;\n page?: string;\n}\n/***\n * @property productInfo {IProductInfo} - Product information\n * @property quantity {number} - Quantity of this product involved in this event\n */\nexport interface ICartInfo {\n products: IProductInfo[];\n orderId: string;\n cartId: string;\n cartVersion: string;\n}\n/***\n * @property productChannelId {string} - Product channel ID\n * @property productChannelName {string} - Product channel name\n * @property productCategoryId {string} - Product category ID\n * @property productCategoryName {string} - Product category name\n * @property productId {string} - Product ID\n * @property productName {string} - Product name\n * @property productSku {string} - Product SKU\n * @property productPrice {string} - Product price\n * @property productQuantity {string} - Product quantity\n * @property productCurrency {string} - Product currency code\n */\nexport interface IProductInfo {\n productChannelId: string;\n productChannelName: string;\n productCategoryId: string;\n productCategoryName: string;\n productId: string;\n productName: string;\n productSku: string;\n productPrice: string;\n productQuantity: string;\n productCurrency: string;\n}\n/***\n * @property id {string} - Transaction ID\n * @property affiliation {string} - Origin of this transaction (e.g. Online Store)\n * @property revenue {number} - Revenue from this transaction\n * @property tax {number} - Tax amount\n * @property shippingCost {number} - Shipping cost\n * @property products {IProductInfo[]} - List of products in this transaction\n */\nexport interface IProductTransaction {\n id: string;\n affiliation?: string;\n revenue?: number;\n tax?: number;\n shippingCost?: number;\n products?: IProductInfo[];\n}\n/***\n * @property contentCategory {string} - Custom event category\n * @property contentAction {object} - Custom event content\n */\nexport interface ICustomEvent {\n contentCategory: string;\n contentAction?: {};\n}\n\nexport interface IExpLogger {\n /**\n * Performs any client-side initialization and setup for the event logger\n * @param config The config that is required to initialize the logger client-side\n * @param userId The current user being tracked\n */\n // tslint:disable-next-line:no-any\n initializeClientSide?(config?: any, userId?: string): void;\n\n /**\n * Logs the given event and payload\n * @param eventName Name of event to log\n * @param payload Extra parameters dependent on the eventType\n * @param attributes User attributes\n */\n // tslint:disable-next-line:no-any\n logEvent(eventName: string, payload: any, attributes?: any): void;\n}\n\nexport interface IExperimentationConnector {\n name: string;\n provider: IExperimentationProvider;\n listener?: IExperimentationProvider;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\nimport { IExperimentationProvider, IExperiments, IVariants, IVariations, State, IExperimentsResult, ISecretManager } from '../../interface/';\nimport * as optimizely from '@optimizely/optimizely-sdk';\nimport axios from 'axios';\n\n/**\n * An implementation of ExperimentationProvider interface for optimizely connector\n */\nclass OptimizelyConnector implements IExperimentationProvider {\n private optimizelyClientInstance: optimizely.Client | undefined;\n private secretManager!: ISecretManager;\n private projectId: string = '';\n private currentProjectSdkKey: string = '';\n private mapToIExperimentationStatus = (status: string): State => {\n switch (status) {\n case 'running': return State.Running;\n case 'paused': return State.Paused;\n case 'archived': return State.Archived;\n case 'campaign_paused': return State.Paused;\n default: return State.Draft;\n }\n }\n\n public async initialize(config: any, secretManager: ISecretManager): Promise {\n // Refresh time is provided in seconds to match consistency\n // of other cache settings but optimizely expects ms\n this.optimizelyClientInstance = optimizely.createInstance({\n sdkKey: config.sdkKey,\n datafileOptions: {\n autoUpdate: true,\n updateInterval: (+config.refreshTime) * 1000 || 1800000\n }\n });\n this.currentProjectSdkKey = config.sdkKey;\n this.secretManager = secretManager;\n this.projectId = config.projectId;\n try {\n const ready = await this.optimizelyClientInstance.onReady();\n if (!ready.success) {\n throw new Error(ready.reason ? ready.reason : 'connector initialization fails');\n }\n } catch (err) {\n throw err;\n }\n return true;\n }\n\n public async getExperiments(retailServerBaseUrl: string, connectorName: string, page?: string, items?: string): Promise {\n if (!retailServerBaseUrl) {\n throw new Error('Retail server base URL not provided.');\n }\n\n if (!this.projectId) {\n throw new Error('Project Id not provided.');\n }\n\n let getExperimentsUrl = new URL(`https://api.optimizely.com/v2/experiments?project_id=${this.projectId}`);\n if (page) {\n getExperimentsUrl.searchParams.append(\"page\", page);\n }\n\n if (items) {\n // Adding a fallback to 100 experimens when items > 100 \n // as Optimizely returns a maximum of 100 experiments per request \n if (parseInt(items) > 100) {\n items = '100';\n }\n getExperimentsUrl.searchParams.append(\"per_page\", items)\n }\n\n const experimentList: IExperiments[] = [];\n let experimentsResult: IExperimentsResult = {\n name: connectorName,\n experiments: experimentList\n };\n\n const secretVal = await this.secretManager.getSecretValue('OptimizelyAccessToken', retailServerBaseUrl);\n\n if(!secretVal.value) {\n throw new Error('Could not fetch the secret value! Please make sure the secret value exists in your key vault');\n }\n\n\n const res = await axios.get(getExperimentsUrl.href,\n {\n headers:\n { Authorization: `Bearer ${secretVal.value}` }\n });\n\n const data = res.data ? res.data : [];\n if (data && Array.isArray(data)) {\n for (let i = 0; i < data.length; i++) {\n const variations: IVariations[] = [];\n const experiments = data[i];\n const experiment_variations = experiments.variations;\n\n // Extract the required variation properties first\n if (experiment_variations.length > 0) {\n for (let j = 0; j < experiment_variations.length; j++) {\n // Map the status of variation for an experiment received from Optimizely to IExperimentation- Status\n const variationStatus = this.mapToIExperimentationStatus(experiment_variations[j].status);\n let variationName = experiment_variations[j].name || experiment_variations[j].key;\n\n const variation: IVariations = {\n friendlyName: variationName,\n id: (experiment_variations[j].variation_id).toString(),\n status: variationStatus,\n weight: (experiment_variations[j].weight).toString()\n }\n variations.push(variation);\n }\n }\n\n // Map the status of experiment received from Optimizely to IExperimentation- Status\n const experimentStatus = this.mapToIExperimentationStatus(experiments.status);\n const experimentUrl = `https://app.optimizely.com/v2/projects/${experiments.project_id}/experiments/${experiments.id}/variations`;\n const experimentResultUrl = `https://app.optimizely.com/v2/projects/${experiments.project_id}/results/experiments/${experiments.id}`;\n\n const experiment: IExperiments = {\n friendlyName: experiments.name,\n description: experiments.description,\n type: experiments.type,\n id: (experiments.id).toString(),\n status: experimentStatus,\n variations: variations,\n link: experimentUrl,\n createdDate: experiments.created,\n lastModifiedDate: experiments.last_modified,\n lastModifiedBy: '',\n resultLink: experimentResultUrl\n };\n experimentList.push(experiment);\n experimentsResult = {\n name: connectorName,\n experiments: experimentList\n };\n }\n }\n return Promise.resolve(experimentsResult);\n }\n\n public async getConfigForClientSideInit(): Promise {\n if (!this.currentProjectSdkKey) {\n return {}\n }\n const DATAFILE_URL = `https://cdn.optimizely.com/datafiles/${this.currentProjectSdkKey}.json`;\n const datafile = await axios.get(DATAFILE_URL, {\n headers: {\n 'Content-Type': 'application/json',\n }\n });\n return datafile.data;\n }\n\n public initializeClientSide(config: any): boolean {\n this.optimizelyClientInstance = optimizely.createInstance(\n { datafile: config }\n );\n return true;\n }\n\n public getVariantsForUser(userId: string, attributes?: { [index: string]: string } | undefined): IVariants[] {\n if (!this.optimizelyClientInstance) {\n console.error('the connector is not initilized')\n return [];\n }\n const config = this.optimizelyClientInstance.getOptimizelyConfig();\n const experimentsMap = config && config.experimentsMap;\n if (!experimentsMap) {\n return [];\n }\n let variantsList: IVariants[] = []\n Object.keys(experimentsMap).forEach((expKey) => {\n const experiment = experimentsMap[expKey];\n const variationMap = experiment.variationsMap;\n const variation = Object.values(variationMap);\n const variationKey = this.optimizelyClientInstance ? this.optimizelyClientInstance.getVariation(expKey, userId, attributes) : null;\n\n for (let i = 0; i < variation.length; i++) {\n const variationId = variation[i].id;\n if (variation[i].key === variationKey) {\n variantsList.push({ variantId: variationId, experimentId: experiment.id });\n break;\n }\n }\n });\n return variantsList;\n }\n\n public activateExperiment(userId: string, experiments: IVariants[], attributes?: { [index: string]: string } | undefined): boolean {\n if (this.optimizelyClientInstance) {\n // Build mapping of experiment id to experiment key\n const expIdToExpKey = {};\n const config = this.optimizelyClientInstance.getOptimizelyConfig();\n const experimentsMap = config && config.experimentsMap;\n if (!experimentsMap) {\n return false;\n }\n Object.keys(experimentsMap).forEach((expKey) => {\n const experiment = experimentsMap[expKey];\n expIdToExpKey[experiment.id] = expKey;\n });\n\n for (let i = 0; i < experiments.length; i++) {\n const experimentKey = expIdToExpKey[experiments[i].experimentId];\n this.optimizelyClientInstance.activate(experimentKey, userId, attributes);\n }\n }\n return true;\n }\n\n public validateRegistration(config: any): boolean {\n return true;\n }\n}\n\nconst connector = new OptimizelyConnector();\nexport default connector;\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 currenlty 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","/*!\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\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, 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 { CookieContext } from '../../utils/cookie-utils';\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: CookieContext = new CookieContext();\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.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 // If the Discount Offer Id are more than 5.\n const discountLimits = 5;\n if (input.listMetadata.discountIds && input.listMetadata.discountIds.length > discountLimits) {\n context.telemetry.debug(`Discount Offer Id should be limited within ${discountLimits}`);\n throw new Error(`Discount Offer Id should be limited within ${discountLimits}`);\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 LineContexts: [{}]\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 const productIds: number[] = productPromotions.map(p => p.ProductId);\n\n return productsDataActions.searchByCriteriaAsync(\n {\n callerContext: context,\n queryResultSettings\n },\n productSearchCriteria\n );\n })\n .then((productSearchResult: ProductSearchResult[]) => {\n let productSearchResultsTmp: ProductSearchResult[] = [];\n productSearchResultsTmp = productSearchResult.filter(item => {\n // @ts-ignore\n const isVariantProduct = !item.IsMasterProduct && item.MasterProductId !== 0;\n return !isVariantProduct;\n });\n productSearchResult = productSearchResultsTmp;\n\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","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\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 * 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","'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","/*!\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;"],"names":["initialize","Promise","resolve","ip","ctx","_msdyn365Commerce$sec","_msdyn365Commerce$sec2","_maxmindData$country","_maxmindData$city","_maxmindData$postal","secretAccountId","msdyn365Commerce","secretManager","getSecretValue","apiSettings","baseUrl","secretLicenseKey","client","WebServiceClient","value","maxmindData","city","state","subdivisions","length","isoCode","metroCode","location","toString","geoLocation","country","names","en","region","zipCode","postal","code","Cookies","set","Date","now","path","maxAge","secure","constructor","testSegments","101","config","console","log","JSON","stringify","userId","segmentationIds","this","CartIcon","observer","props","cartLabel","cartQtyLabel","data","cart","isParentCustomModule","iconURL","cartLink","getUrlSync","context","actionContext","cartItem","totalItemsInCart","qtyLabel","format","label","payLoad","getPayloadObject","telemetryContent","attributes","getTelemetryAttributes","style","visibility","React","Object","assign","title","className","href","onClick","onTelemetryClick","src","alt","width","height","CartIconComponent","createComponentOverride","_objectSpread","component","_getProductType","shippingInformation","toLowerCase","computeItemLines","product","defaultVariantId","lowestPriceVariantRecordId","IsMasterProduct","RecordId","_ref","_attributeValues$find","_extensionProperties$","attributeValues","extensionProperties","productDeliveryMessage","app","shippingInformationSmall","find","attr","_attr$Name","Name","trim","smallParcelAttributeKey","TextValue","defaultVariantShippingInformation","property","Key","Value","StringValue","_product$deliveryByMe","deliveryByMessage","_attributeValues$find2","deliveryDays","_attr$Name2","leadTime","brandList","_attributeValues$find3","brand","_attr$Name3","brandBackofficeAttributePlp","map","singleBrand","brandName","undefined","brandLeadtime","_makeDeliveryMessage","CustomSkeleton","type","splitPrice","price","dollars","cents","formattedPrice","toLocaleString","currency","priceArr","match","Price","standard","current","standardDollars","standardCents","currentDollars","currentCents","_parseValue","productRating","Math","round","renderLabel","name","rating","ratingAriaLabel","getRatingAriaLabel","roundedRating","toFixed","renderRating","typeName","id","avgRating","totalRatings","ariaLabel","numRatings","RatingComponent","ratingCount","readOnly","renderPrice","basePrice","adjustedPrice","savingsText","freePriceText","originalPriceText","currentPriceText","BasePrice","AdjustedPrice","CustomerContextualPrice","PriceComponent","renderProductPlacementImage","productCardimageSettings","gridSettings","imageUrl","fallbackImageUrl","altText","requestContext","fallBackImage","emptyPlaceHolderImage","fallbackImageSource","image","fallBackSrc","imageProps","imageSettings","cropFocalRegion","Image","loadFailureBehavior","bypassHideOnFailure","renderProductBadge","attributeName","_attributes$find","badgeData","currAttribute","finalizedBadges","split","badge","parseBadgeData","parsedBadge","buildProductBadge","ProductComponent","_getEyebrowElementRef","_AttributeValues$find","_product$ExtensionPro","_product$ExtensionPro2","_product$ExtensionPro3","allowBack","quickViewButton","eyebrowMessage","badgeAttribute","deliveryMessage","isRefinersEnabled","displayShopNow","shopNowBtnText","showBvRatings","enableAttributeBasedRating","getEyebrowElementRef","eyebrowElement","querySelector","isTruncated","setTruncated","scrollHeight","visibleHeight","clientHeight","badgeAttributeToUse","productBadgeAttribute","AttributeValues","ExtensionProperties","isBVratings","averageRating","getBVAttributeValues","AverageRating","TotalRatings","handleResize","MsDyn365","isBrowser","window","addEventListener","removeEventListener","EcomLowestPriceVariantRecIdKey","unbxdDefaultVariant","LongValue","queryBasedSelection","queryBasedVariantSelection","placeholderImageName","defaultOrLowestVariantRecordId","productUrl","getProductPageUrlSync","removeSpecialChars","MasterProductId","srcUrl","URL","request","queryString","search","pathname","updateProductUrl","variantIdQueryParams","includes","attribute","sizeValue","i","convertToTitlecase","stringValue","stopConvert","replace","txt","charAt","toUpperCase","substr","isCustomizedDesign","parseBrandName","productTitleWithBrandname","ErrorBoundary","telemetry","cultureFormatter","formatCurrency","PrimaryImageUrl","slice","hideRating","Button","color","priceComponent","isSearchResultContainer","role","setProductUrl","ref","RichTextComponent","text","BVRatingSummary","itemId","ItemId","variantId","description","Description","DeliveryMessage","FinancingPerMonthComponent","pageType","sellingPrice","activeVariantId","productId","activeColorVariantId","RatingComponentActions","onSliderChanged","event","setRating","Number","parseInt","target","lastSelectedRating","onChange","onMouseLeave","_event","onMouseOver","getIndex","index","Rating","initialRating","useState","useEffect","newRating","starControl","renderStars","tabIndex","defaultProps","currentRating","min","max","step","mouseOver","floor","remainder","filled","half","stars","glyphClass","push","key","getAttribute","img","productName","ratings","standardPrice","currentPrice","eyebrowText","isActive","componentDictionary","c","require","cn","error","handleMissingImplementationDetails","functionName","connectorName","connectorType","Error","isServer","document","connectorDictionary","connectorProviderImpl","default","provider","connectorListenerImpl","connectorDomainsList","listener","connectorDomains","validateConnectorRegistration","segmentationProvider","__proto__","getSegmentations","e","verifySegmentationRegistration","geoLookupProvider","getGeoInformation","verifyGeoLookupRegistration","initializeClientSide","logEvent","eventName","payload","variantSet1","experimentId","variantSet2","variantSet3","variantSet4","getConfigForClientSideInit","getExperiments","experiments","friendlyName","status","State","Running","link","variations","Active","weight","Draft","createdDate","lastModifiedDate","lastModifiedBy","Paused","Archived","getVariantsForUser","activateExperiment","optimizelyClientInstance","optimizely","datafile","revenue","parseFloat","track","projectId","currentProjectSdkKey","mapToIExperimentationStatus","sdkKey","datafileOptions","autoUpdate","updateInterval","refreshTime","ready","onReady","success","reason","err","retailServerBaseUrl","page","items","getExperimentsUrl","searchParams","append","experimentList","experimentsResult","secretVal","res","axios","headers","Authorization","Array","isArray","experiment_variations","j","variationStatus","variation","variation_id","experimentStatus","experimentUrl","project_id","experimentResultUrl","experiment","created","last_modified","resultLink","DATAFILE_URL","getOptimizelyConfig","experimentsMap","variantsList","keys","forEach","expKey","variationMap","variationsMap","values","variationKey","getVariation","variationId","expIdToExpKey","experimentKey","activate","validateRegistration","getRequestedModules","windowInitialData","result","modules","_moduleList","moduleType","_themeModulesList","concat","getRequestedModuleNames","requestedPackageNames","Set","___initialData___","m","add","from","getUniqueRequestedAssets","_uniq","filterToUsedAssets","requestedAssetKeys","partnerModule","indexOf","n","t","r","a","o","persisted","timeStamp","performance","getEntriesByType","u","activationStart","f","prerendering","wasDiscarded","delta","entries","random","navigationType","s","PerformanceObserver","supportedEntryTypes","then","getEntries","observe","buffered","d","l","requestAnimationFrame","p","visibilityState","v","h","g","T","y","E","setTimeout","C","L","w","disconnect","startTime","firstHiddenTime","reportAllChanges","b","A","passive","capture","I","P","k","F","entryType","cancelable","processingStart","M","D","B","R","H","N","interactionId","O","interactionCount","q","durationThreshold","_","z","G","J","K","duration","latency","sort","splice","U","V","X","Y","readyState","Z","responseStart","TTLCache","options","removalThresholdInMs","intervalForRemovalInMs","_cache","Map","get","onRemoveCallback","clear","_cleanCache","delete","RequestVectorizer","next","bind","requestId","nextValue","SEP","RequestVectorizerInstance","regexGetRoundBraces","toLowerCaseDict","objectDictionary","reduce","prevValue","toLocaleLowerCase","ttlRequestCache","RSResponseInterceptor","response","requestCache","activityId","lowercaseHeaders","requestid","activityid","properties","elapsedTime","StaticTelemetry","stopTimer","parsedUrl","url","parse","baseURL","trackDependency","method","resultCode","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","async","input","pageTypeContext","ProductLinkInput","getByIdAsync","callerContext","channelId","catalogid","checkVersionForFeature","getCatalogIdForSdk","getCategoriesAsync","categories","rootCategory","category","categoryId","localName","getFriendlyName","locale","NameTranslations","rootCategoryWithNeutralizedName","NeutralizedName","slug","getCategorySlug","parameterize","currentCategory","ParentCategory","parentId","parentCategory","parentCategoryWithLocalizedName","getParameterizeFeatureFlagsWithRequestContext","Slug","catch","searchForComplexType","obj","moduleId","propertyToMapInConfig","promisesArray","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","catalogId","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","user","c1AccessToken","pageRoot","getVersionDependentFeatureInfo","_putRequestedModulesInCacheOnServer","_initThemeModulesList","moduleList","resultArray","item","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","debug","MODULE_CACHE_KEY","moduleItem","dataActions","_populateDataActionResultFromCache","cacheObjectType","cacheKey","cachedValueBasedOnInput","isAsyncResult","transaction","promiseResult","_resolveCacheRef","cacheRefInfo","filter","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","AsyncResult","reject","actions","resources","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","REQUEST_CONTEXT_PROPERTIES_FOR_SEG","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","hydrateClient","pageContext","coreContext","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","cookies","CookieContext","isConsentRequired","cartExpirationInDays","sameSiteRequired","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","channel","urlTokens","pageId","correlationId","Telemetry","generateGuid","logWebVitals","targetId","tuid","resolveMissingSegmentsOnClient","missingSegments","domain","canonicalDomain","neededMissingSegments","providerId","segmentProvider","segmentIds","cookieString","cookie","segmentRequestId","missingSegmentResolvingUrl","segRequestContext","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","Event","CLIENT_RENDER_START_EVENT","dispatchEvent","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","some","PerformanceEventTiming","prototype","onINP","EVENT_WEB_VITALS_INP","initializeApp","bindings","MSDyn365Commerce","viewBinder","views","componentBinder","components","getPartnerOverrideAction","partnerDataActions","dataAction","getConnector","connectors","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","arguments","connectorsRegistration","expConnectorName","expConnector","experimentationConfig","expUserId","experimentationProvider","experimentationListener","initializeConnectors","enable_performance_analysis","isPerfAnalysis","lib","initializePerformanceUtils","initializeClientWithRetry","_bindings$packageData","retry","warn","lazyLoadedModules","__CEP__","modulesList","themesList","clientModulesList","scriptsExecuted","__webpack_public_path__","___publicPath___","AddControlMode","AsyncClientRenderComponent","super","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","render","_moduleBinder$compone","registrationBindings","registeredModules","moduleTypeName","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","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","setState","isLazyLoaded","_props$context$reques","telemetryId","telemetryAttributes","setTelemetryAttribute","moduleAttributes","_isEditorial","_setDataInfoAttribute","moduleIdToExperimentIdMap","MODULE_LAYOUT_FIELD","info","isConfigured","isRegistered","mounted","disableServerSideErrorChecking","mobxShouldComponentUpdate","shouldComponentUpdate","customShouldComponentUpdate","_setErrorStates","_setDataAttributes","_initializePerformanceComponent","nextProps","nextState","componentDidUpdate","componentDidCatch","runPreRenderPerformanceHook","renderCallIndex","_renderModule","runPostRenderPerformanceHook","initializePerformance","isMounted","mapStateToProps","lazyRenderModuleEnabled","stringFormat","EXCEPTION_UNREGISTEREDMODULEID","errorType","x","join","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","errorMessage","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","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","USER_CONSENT_GIVEN_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","ProductListType","ProductListInput","listMetadata","_cacheKey","_cacheObjectType","_cacheType","catalogIdNumber","listType","skipToken","skip","baseCacheKey","productBySearch","searchText","productByCategory","categoryIds","relatedProducts","productIds","promotional","discountIds","editorial","algo","recommendation","includeCart","personalization","ProductListInventoryFilteringOptions","getInventorySorting","channelInventoryConfiguration","sorting","ProductAvailabilitySortableAttributeRecordId","Columns","ColumnName","IsDescending","getInventoryInStockSortableRefinerValue","RefinerRecordId","DataTypeValue","LeftValueBoundString","RightValueBoundString","UnitText","RowNumber","Count","RefinerSourceValue","getProductsByCategoryListAction","recordId","productSearchCriteria","Context","ChannelId","CatalogId","CategoryIds","SkipVariantExpansion","IncludeAttributes","queryResultSettings","Paging","Top","pageSize","versionGte","_context$requestConte3","_context$requestConte4","productListInventoryDisplay","HideOOS","SortOOS","StoreOperationsDataActions","getInventoryConfigurationAsync","inventoryInStockRefinerValue","Refinement","Sorting","searchByCriteriaAsync","products","getProductImageUrls","getProductsByRecentlyViewedListAction","searchCriteriaInput","cookieContext","cookieValue","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","idx","executeAction","getByIdsAsyncAction","mappedProducts","memo","isBatched","getProductIdForReco","recommendationCriteria","cartCookieParts","getCartCookie","isAuthenticated","readCart","readAsync","Id","getCart","CartLines","cartProductIds","ProductId","includePageContext","getProductsByNewSearchByCriteria","customer","getCustomerActionDataAction","GetCustomerInput","searchCriteria","CustomerAccountNumber","AccountNumber","customerAccountNumber","RecommendationListId","recommendationListId","rsVersion","disable_sequential_call_for_recoProducts","getCategoryIdForReco","productSearchResults","productSearchResultsTmp","getProductsByRecommendationListAction","proxyContext","reccomendationListId","missingType","actionInputError","ProductIds","isHideAndSortByInventoryAvailabilitySupported","_context$requestConte5","getElementsAsync","recommendedElements","productInputs","productTypeId","ElementId","ElementTypeValue","itemIds","_context$requestConte6","_context$requestConte7","orderProductSearchResults","getProductsByRelationshipIdListAction","relationshipId","getRelatedProductsAsync","getProductsByPromotionListAction","_input$listMetadata$d","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","handler","Proxy","newValue","propertyPath","parentPath","getDisabledProperties","EditError","fullPath","requiredProperties","getRequiredProperties","PROPERTY_INIT","CustomEvent","renderingHelper","moduleRequiredProperties","readCookie","cleanValue","cleanupCookieValue","doNotParse","isParsingCookie","__assign","call","apply","_this","changeListeners","HAS_DOCUMENT_COOKIE","parseCookies","_updateBrowserValues","parseOptions","_emitChange","getAll","name_1","_a","finalOptions","expires","addChangeListener","callback","removeChangeListener","UserConsentCookieName","_setCookieList","_serverCookieList","_clientCookieList","cookieName","isEssential","isConsentGiven","_cookies","sameSiteRequiredFlag","_options","cookieOptionsWithDefaults","sameSite","filteredOptions","clientCookieString","createCookieString","serverCookieString","CartCookie","getTargetIdCookie","setCartCookie","setAlways","prefix","cartCookieOptions","existingCart","setCheckoutCartCookie","checkoutCartCookieOptions","existingCookie","removeCheckoutCartCookie","getAccountSelectionCookie","accountSelectionCookie","setAccountSelectionCookie","isOBORequest","accountSelectionCookieOptions","removeAccountSelectionCookie","setConsentCookie","setCookieFunction","deleteConsentCookie","optionsString","_appendCookieOptions","cookieOptions","httpOnly","req","HttpException","setPrototypeOf","HttpRedirectException","isTruthy","String","pageInsights","clientRenderOptimizationEnabled","optimize_client_hydrate","clientRenderQsp","optimize_hydrate","Currency","getCurrency","_requestContext$query2","disable_lazy_render_support","_requestContext$query3","allModulesListArray","flat","productsWithImageUrls","generateImageUrl","baseImageUrl","encodeURIComponent","itemIdOrder","unorderedProductSearchResults","$TypeError","TypeError","exports","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","str","opt","pairs","dec","decode","pair","substring","val","tryDecode","enc","encode","fieldContentRegExp","test","isNaN","isFinite","toUTCString","decodeURIComponent"],"sourceRoot":""}