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ASyZ,GAAKzZ,EAAS0Z,GAAK,GAAK,CAC1C,CACF,CAoBwBC,CAAeP,IAEnCE,EAAc1B,EAAkB2B,GAChCtP,EAAQ,EAEDA,EAAQqP,GAAaD,EAAMpP,GAASsP,EAAMtP,KACjD,KAAOA,EAAQuP,GAAa3B,EAAsBwB,EAAOpP,KAEzD,OAAOoP,CACT,gCCvGF,IAAI7B,EAAI,EAAQ,IACZoC,EAAU,EAAQ,KAClBC,EAA2B,EAAQ,KACnC/B,EAAQ,EAAQ,IAChBgC,EAAa,EAAQ,KACrBC,EAAa,EAAQ,IACrBC,EAAqB,EAAQ,KAC7BC,EAAiB,EAAQ,KACzBC,EAAgB,EAAQ,IAExBC,EAAyBN,GAA4BA,EAAyBrkB,UA0BlF,GAhBAgiB,EAAE,CAAEyB,OAAQ,UAAWC,OAAO,EAAMkB,MAAM,EAAMjB,SAP5BU,GAA4B/B,GAAM,WAEpDqC,EAAgC,QAAEla,KAAK,CAAExF,KAAM,WAA0B,IAAK,WAA0B,GAC1G,KAIuE,CACrE,QAAW,SAAU4f,GACnB,IAAIC,EAAIN,EAAmBhf,KAAM8e,EAAW,YACxCS,EAAaR,EAAWM,GAC5B,OAAOrf,KAAKP,KACV8f,EAAa,SAAUd,GACrB,OAAOQ,EAAeK,EAAGD,KAAa5f,MAAK,WAAc,OAAOgf,CAAG,GACrE,EAAIY,EACJE,EAAa,SAAUnS,GACrB,OAAO6R,EAAeK,EAAGD,KAAa5f,MAAK,WAAc,MAAM2N,CAAG,GACpE,EAAIiS,EAER,KAIGT,GAAWG,EAAWF,GAA2B,CACpD,IAAIW,EAASV,EAAW,WAAWtkB,UAAmB,QAClD2kB,EAAgC,UAAMK,GACxCN,EAAcC,EAAwB,UAAWK,EAAQ,CAAEC,QAAQ,GAEvE","sources":["webpack://Msdyn365.Commerce.Online/../../src/action-registrar.ts?ed12","webpack://Msdyn365.Commerce.Online/../../src/create-data-action.vnext.ts?cb4f","webpack://Msdyn365.Commerce.Online/../../src/wrap-data-action.ts?c6a2","webpack://Msdyn365.Commerce.Online/../../src/action-error.ts?76a5","webpack://Msdyn365.Commerce.Online/../../src/action-runtime-utils.ts?df0b","webpack://Msdyn365.Commerce.Online/../../../src/cache/retail-cache-helper.ts?35f4","webpack://Msdyn365.Commerce.Online/../../src/event-emitter.ts?da67","webpack://Msdyn365.Commerce.Online/../../src/action-executor.ts?e3c4","webpack://Msdyn365.Commerce.Online/../../../src/actions/get-catalogs.ts?b35c","webpack://Msdyn365.Commerce.Online/../../src/helpers.ts?e5d2","webpack://Msdyn365.Commerce.Online/../../src/action-context.ts?0ab9","webpack://Msdyn365.Commerce.Online/../../../src/actions/get-media-locations.ts?b49d","webpack://Msdyn365.Commerce.Online/../../../src/actions/get-additional-media-locations.ts?d6e0","webpack://Msdyn365.Commerce.Online/../../../src/actions/get-customer.ts?6b9b","webpack://Msdyn365.Commerce.Online/../../src/ICache.ts?b706","webpack://Msdyn365.Commerce.Online/../../src/cache-utils.ts?471a","webpack://Msdyn365.Commerce.Online/../../src/request-cache.ts?b274","webpack://Msdyn365.Commerce.Online/../../src/index.ts?0e3e","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/action-internal/node_modules/uuid/lib/bytesToUuid.js?8945","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/action-internal/node_modules/uuid/lib/rng-browser.js?6f88","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/action-internal/node_modules/uuid/v1.js?088e","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/delete-property-or-throw.js?7ade","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/engine-ff-version.js?f9b6","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/engine-is-ie-or-edge.js?efc4","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/internals/engine-webkit-version.js?f2a8","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.sort.js?ab69","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.promise.finally.js?b513"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n ActionPostHook,\n ActionPostReaderHook,\n ActionPreHook,\n ActionPreReaderHook,\n IAnyAction,\n msdyn365Commerce\n} from '@msdyn365-commerce/core-internal';\nimport { LogLevel, StaticTelemetry } from '@msdyn365-commerce/telemetry-internal';\n\nconst DEPRECATED_HOOK_TYPES = ['pre', 'post', 'preRead', 'postRead'];\n\nexport namespace ActionRegistrar {\n type ActionHook = ActionPreHook | ActionPostHook;\n\n export type ActionRegistration = {\n action?: IAnyAction;\n pre?: Set;\n post?: Set>;\n preRead?: Set;\n postRead?: Set>;\n preReader?: Set;\n postReader?: Set>;\n };\n\n interface IActionDictionary {\n [actionKey: string]: ActionRegistration;\n }\n\n const dataActionRegister: IActionDictionary = {};\n\n export const getRegistration = (id?: string): ActionRegistration | undefined => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((msdyn365Commerce).getPartnerOverrideAction && id) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const partnerDataAction = (msdyn365Commerce).getPartnerOverrideAction(id);\n if (partnerDataAction && partnerDataAction.default) {\n dataActionRegister[id].action = partnerDataAction.default;\n } else if (partnerDataAction && partnerDataAction.prototype && partnerDataAction.prototype.Action) {\n dataActionRegister[id].action = partnerDataAction;\n }\n }\n\n if (id) {\n return dataActionRegister[id];\n }\n\n return undefined;\n };\n\n export const unwrapAction = (action: IAnyAction): IAnyAction => {\n if (action && action.prototype && !action.prototype.isAction) {\n // registered action is an action wrapper. Unwrap it.\n return >action.prototype.Action;\n }\n return action;\n };\n /**\n * Gets the action registered with id\n * @param id - ID to look up action\n */\n export const getAction = (id?: string): IAnyAction | undefined => {\n if (!id) {\n return;\n }\n const registeredAction = getRegistration(id);\n if (registeredAction) {\n return >registeredAction.action;\n }\n return;\n };\n\n /**\n * registers action. Does nothing if action is already registered\n * @param id - ID to register action with\n * @param action - action to register\n */\n export const registerAction = (id: string, dataAction: IAnyAction): IAnyAction | undefined => {\n if (!id || !dataAction) {\n // unable to register no id or action\n return;\n }\n\n const actionRegister = dataActionRegister;\n\n if (actionRegister[id]) {\n const registration = actionRegister[id];\n registration.action = dataAction;\n return >actionRegister[id].action;\n } else {\n const registration = { action: dataAction };\n actionRegister[id] = registration;\n return dataAction;\n }\n };\n\n const registerHook = (\n hookType: 'pre' | 'post' | 'preRead' | 'postRead' | 'preReader' | 'postReader'\n ) => (id: string, hook: HookType) => {\n // deprecate read only hook\n if (!msdyn365Commerce.isBrowser && DEPRECATED_HOOK_TYPES.indexOf(hookType) > -1) {\n StaticTelemetry.log(\n LogLevel.Warning,\n `Data action hooks are deprecated and will be removed in later versions. Please use data action overrides to extend data actions. The related action of this ${hookType} hook is - ${id}`\n );\n }\n\n const registration = getRegistration(id);\n // coerce hook into an iterable\n const hooks = Array.isArray(hook) ? hook : [hook];\n if (!registration) {\n // If the registration does not exist init one with just the hooks\n const newRegistration: { [id: string]: unknown } = {};\n newRegistration[hookType] = new Set(hooks);\n dataActionRegister[id] = newRegistration;\n } else {\n // If the registration does exist merge new hooks with existing hooks\n const hookRegistration = registration[hookType] || new Set();\n hooks.forEach(h => {\n hookRegistration.add(h);\n });\n // @ts-ignore\n registration[hookType] = hookRegistration;\n }\n return hook;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export const registerPostHook = registerHook | ActionPostHook[]>('post');\n export const registerPreHook = registerHook('pre');\n export const registerPreReadOnlyHook = registerHook('preRead');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export const registerPostReadOnlyHook = registerHook | ActionPostHook[]>('postRead');\n export const registerPreReaderHook = registerHook('preReader');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export const registerPostReaderHook = registerHook | ActionPostReaderHook[]>('postReader');\n\n export const getPreHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.pre;\n };\n\n export const getPostHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.post;\n };\n\n export const getPreReadHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.preRead;\n };\n\n export const getPostReadHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.postRead;\n };\n\n export const getPreReaderHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.preReader;\n };\n export const getPostReaderHooks = (id: string) => {\n const actionRegistration = getRegistration(id);\n return actionRegistration && actionRegistration.postReader;\n };\n\n /**\n * Resolves the action and returns first action in action chain. Registers action if not yet registered\n * @param id - Action id to look up or register under\n * @param action - Action function\n */\n export const resolveAction = (id: string, action: IAnyAction): IAnyAction | undefined => {\n return getAction(id) || >registerAction(id, action) || action;\n };\n\n export const resolveRegistration = (\n id: string,\n action: IAnyAction,\n preHooks?: ActionPreHook[],\n postHooks?: ActionPostHook[],\n preReadHooks?: ActionPreHook[],\n postReadHooks?: ActionPostHook[],\n preReaderHooks?: ActionPreReaderHook[],\n postReaderHooks?: ActionPostReaderHook[]\n ) => {\n const resolvedAction = resolveAction(id, action);\n if (!resolvedAction) {\n return;\n }\n preHooks && registerPreHook(id, preHooks);\n postHooks && registerPostHook(id, postHooks);\n preReadHooks && registerPreReadOnlyHook(id, preReadHooks);\n postReadHooks && registerPostReadOnlyHook(id, postReadHooks);\n preReaderHooks && registerPreReaderHook(id, preReaderHooks);\n postReaderHooks && registerPostReaderHook(id, postReaderHooks);\n return getRegistration(id);\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext, IActionInput, IActionWrapperPrototype, IObservableAction } from '@msdyn365-commerce/core-internal';\nimport { AsyncResult } from '@msdyn365-commerce/retail-proxy';\nimport { dataActionOptions, wrapDataAction } from './wrap-data-action';\n\n/**\n * Higher order function which exposes the current method as an action\n * @param action The action method\n * @param isBatched If the service call can handle batched requests efficiently\n * @param input Optional parameter of a single instance or an array of IActionInputs that will be passed to the action method.\n */\nexport const createObservableDataAction = (options: dataActionOptions): IObservableAction => {\n const wrappedAction = wrapDataAction(\n options,\n (arg1: IActionInput | IActionInput[], arg2: IActionContext): AsyncResult => {\n return new AsyncResult((resolve, reject) => {\n arg2.chainAction(options.action, arg1)\n .then(result => {\n resolve(result);\n })\n .catch(error => {\n reject(error);\n });\n });\n }\n );\n (wrappedAction.prototype).setProperty('isObservable', true);\n return >wrappedAction;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IAction, IActionInput, IObservableAction } from '@msdyn365-commerce/core-internal';\nimport { ActionRegistrar } from './action-registrar';\n\nexport type dataActionOptions = {\n action: IAction;\n isBatched?: boolean;\n id?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n input?: (...args: any[]) => IActionInput | IActionInput[];\n};\n\ntype IActionWrap = IAction | IObservableAction;\n\n/**\n * Wraps a data action with the associated action wrap.\n * @param options\n * @param actionWrap\n */\nexport const wrapDataAction = (options: dataActionOptions, actionWrap: IActionWrap): IActionWrap => {\n if (!options) {\n throw new Error('wrapDataAction called with invalid options. Options should have atleast action defined');\n }\n\n if (!options.action) {\n throw new Error(\n `Received invalid actions when attempting to parse options. Input name: ${options.input ? options.input.name : 'undefined'}`\n );\n }\n\n let inputFunc = options.input!;\n let id = options.id;\n let isBatched = options.isBatched!;\n options.action.prototype = {\n id,\n isBatched,\n isAction: true\n };\n\n actionWrap.prototype = {\n id,\n isAction: false,\n _action: options.action,\n set RegistrationId(registrationId: string) {\n options.action.prototype.RegistrationId = registrationId;\n },\n get RegistrationId(): string {\n return options.action.prototype.RegistrationId || '';\n },\n set inputFunc(func: Function) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (inputFunc) = func;\n },\n get inputFunc(): Function {\n return inputFunc;\n },\n get isBatched(): boolean {\n return isBatched;\n },\n set isBatched(_isBatched: boolean) {\n isBatched = _isBatched;\n },\n get Action(): IAction {\n return options.action;\n },\n set Action(newAction: IAction) {\n // There are no getter/setters on the action function prototype so this behaves as expected.\n inputFunc = newAction.prototype.input || inputFunc;\n id = newAction.prototype.id || id;\n isBatched = newAction.prototype.isBatched || isBatched;\n newAction.prototype = { ...newAction.prototype, ...options.action.prototype };\n options.action = newAction;\n },\n setProperty: (propertyName: string, value: unknown) => {\n options.action.prototype[propertyName] = value;\n actionWrap.prototype[propertyName] = options.action.prototype[propertyName];\n }\n };\n if (actionWrap.prototype.id) {\n ActionRegistrar.registerAction(actionWrap.prototype.id, actionWrap);\n }\n\n return actionWrap;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Known action error failure states\n */\nexport const enum ActionErrorStatus {\n Timeout = 'Timeout',\n HookTimeout = 'Hook Timeout',\n ServiceUnavailable = 'Service Unavailable'\n}\n\n/**\n * Action Error Wrapper\n */\nexport class ActionError extends Error {\n public static readonly Name: string = 'ActionError';\n\n public error?: unknown;\n public status?: ActionErrorStatus;\n\n /**\n * Checks if an object is an action error\n */\n public static isActionError(error: unknown): boolean {\n return error instanceof Error && (error).name === ActionError.Name;\n }\n\n public static isTimeoutError(error: unknown): boolean {\n return error && (error).status === ActionErrorStatus.Timeout;\n }\n\n public static isServiceUnavailable(error: unknown): boolean {\n return error && (error).status === ActionErrorStatus.ServiceUnavailable;\n }\n\n /**\n * Action Errors\n * @param error Original Error\n */\n constructor(error: ActionErrorStatus | Error);\n constructor(error: Error) {\n super();\n this.name = ActionError.Name;\n if (error instanceof Error) {\n this.message = error.message;\n this.error = error;\n } else {\n if (error === ActionErrorStatus.Timeout) {\n this.status = error;\n this.message = 'Action Timeout';\n } else if (error === ActionErrorStatus.HookTimeout) {\n this.status = error;\n this.message = 'Action hook Timeout';\n } else if (error === ActionErrorStatus.ServiceUnavailable) {\n this.status = error;\n this.message = 'Action failed due to service unavailable';\n } else if (typeof error === 'string') {\n this.message = error;\n } else {\n this.error = error;\n }\n }\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, ActionError.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 { AppCache, ICache } from '@msdyn365-commerce/cache-internal';\nimport { IActionInput } from '@msdyn365-commerce/core-internal';\n\n/**\n * Method to indicate if the action should look in app cache for data\n * @param input ActionInput\n */\nexport const shouldReadFromAppCache = (input: IActionInput, appCache: ICache | null): boolean => {\n return !!appCache && input && input.dataCacheType !== undefined && input.dataCacheType() !== 'none';\n};\n\n/**\n * Method to indicate if the action should write in app cache\n * @param input ActionInput\n */\nexport const shouldWriteToAppCache = (input: IActionInput, appCache: ICache | null): boolean => {\n return isAppCacheData(input, appCache);\n};\n\n/**\n * Method to indicate if the action's cache type is application\n * @param input ActionInput\n */\nexport const isAppCacheData = (input: IActionInput, appCache: ICache | null): boolean => {\n if (!appCache) {\n return false;\n }\n\n if (input) {\n if (input.dataCacheType !== undefined && input.dataCacheType() === 'application') {\n return true;\n }\n\n // if an entity has a cache setting defined, we cache that entity - caching retail proxy actions\n return (appCache).hasCacheSetting(input.getCacheObjectType());\n }\n\n return false;\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, ICacheItem, ICacheSource } from '@msdyn365-commerce/cache-internal';\nimport { IActionInput, IRequestContext, msdyn365Commerce, verboseLogger } from '@msdyn365-commerce/core-internal';\nimport { AsyncResult, DataServiceRequest, isAsyncResult } from '@msdyn365-commerce/retail-proxy';\nimport { IInternalTelemetry, ITelemetry } from '@msdyn365-commerce/telemetry-internal';\n\nconst GET_FROM_RETURNIDENTIFIER: string = '___GET__FROM__RETURNIDENTIIER___';\n\nexport const addLocaleInformation = (inputs: IActionInput | IActionInput[], locale: string): void => {\n const isArray = Array.isArray(inputs);\n if (isArray) {\n const actionInputs = (inputs || []) as IActionInput[];\n actionInputs.forEach(input => {\n if (input instanceof DataServiceRequest && !input.getCacheKey().endsWith(`-${locale}`)) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const tmp = input._cacheKeyFromInput;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n input._cacheKeyFromInput = `${tmp}-${locale}`;\n }\n });\n } else {\n if (inputs instanceof DataServiceRequest && !inputs.getCacheKey().endsWith(`-${locale}`)) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const tmp = inputs._cacheKeyFromInput;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n inputs._cacheKeyFromInput = `${tmp}-${locale}`;\n }\n }\n};\n\nconst _resolveCacheEntryReference = (\n dataServiceRequest: DataServiceRequest,\n item: any,\n requestCache: ICache,\n appCache: ICache,\n shouldReadFromAppCache?: boolean,\n isWrappingPromise?: boolean,\n isObservable: boolean = true\n) => {\n const cacheValueAsArray = (item.key as string[])\n .map(key => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType;\n\n const value = requestCache.get({ typeName: cacheObjectType, key });\n if (!value && shouldReadFromAppCache && appCache) {\n appCache.copyTo({ typeName: cacheObjectType, key }, requestCache, isObservable);\n }\n\n if (!value || !value.item) {\n return undefined;\n }\n\n const valueItem: any = value.item;\n\n if (isAsyncResult(valueItem)) {\n return valueItem.result;\n }\n\n return valueItem;\n })\n .filter(data => data !== undefined && data !== null);\n\n if ((item.key as string[]).length > cacheValueAsArray.length) {\n return;\n }\n\n // If we are returning a Promise that represents a future collection, we need to unwrap it\n // @ts-ignore -- accessing a private class variable (_query) which is a valid JS\n const isReturnTypeACollection = dataServiceRequest._query.isReturnTypeACollection;\n\n return cacheValueAsArray && cacheValueAsArray.length > 0\n ? isReturnTypeACollection && !isWrappingPromise\n ? cacheValueAsArray\n : cacheValueAsArray[0]\n : undefined;\n};\n\nconst logTelemetrySource = (\n cacheValue: ICacheItem,\n dataServiceRequest: DataServiceRequest,\n cacheKey: string,\n context: IRequestContext,\n telemetry?: ITelemetry | IInternalTelemetry\n) => {\n if (!telemetry) {\n return;\n }\n if (!msdyn365Commerce.isBrowser) {\n switch (cacheValue.s!) {\n case ICacheSource.AppCache: {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType || 'none';\n\n verboseLogger(context, telemetry, 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}', {\n values: [cacheObjectType, cacheKey, 'AppCache']\n });\n break;\n }\n case ICacheSource.RequestCache: {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType || 'none';\n\n verboseLogger(context, telemetry, 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}', {\n values: [cacheObjectType, cacheKey, 'RequestCache']\n });\n break;\n }\n default: {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType || 'none';\n\n verboseLogger(context, telemetry, 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}', {\n values: [cacheObjectType, cacheKey, 'Default']\n });\n break;\n }\n }\n }\n};\n\nconst readCacheEntriesBasedOnCacheKeyFromReturnType = (\n dataServiceRequest: DataServiceRequest,\n requestCache: ICache,\n appCache: ICache,\n shouldReadFromAppCache: boolean,\n context: IRequestContext,\n telemetry?: ITelemetry | IInternalTelemetry,\n isObservable: boolean = true\n): any => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyFromReturnType = dataServiceRequest._cacheKeyFromReturnType;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyIdentifierFromReturnType = dataServiceRequest._cacheKeyIdentifierFromReturnType;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType;\n\n if (cacheKeyFromReturnType.length === 0) {\n return { entry: null, shouldRefresh: false };\n }\n let shouldRefreshAll = true;\n const cacheEntries = cacheKeyFromReturnType\n .map((entry: any) => {\n const key = `${cacheKeyIdentifierFromReturnType}-${entry}`;\n\n let cacheValue = requestCache.get({ typeName: cacheObjectType, key });\n\n if (!cacheValue && shouldReadFromAppCache && appCache) {\n cacheValue = appCache.copyTo({ typeName: cacheObjectType, key }, requestCache, isObservable);\n }\n\n if (!cacheValue || !cacheValue.item) {\n return null;\n }\n // according to the logic, will treat the entries to shouldRefresh when all entries have shouldRefresh.\n if (!cacheValue.shouldRefresh) {\n shouldRefreshAll = false;\n }\n logTelemetrySource(cacheValue, dataServiceRequest, key, context, telemetry);\n\n return cacheValue.item;\n })\n .filter(Boolean);\n\n // @ts-ignore -- accessing a private class variable (_query) which is a valid JS\n const isReturnTypeACollection = dataServiceRequest._query.isReturnTypeACollection;\n const cacheEntriesReturn = cacheEntries && cacheEntries.length > 0 ? (isReturnTypeACollection ? cacheEntries : cacheEntries[0]) : null;\n return { entry: cacheEntriesReturn, shouldRefresh: shouldRefreshAll };\n};\n\nexport const readCacheEntries = (\n dataServiceRequest: DataServiceRequest,\n requestCache: ICache,\n appCache: ICache,\n shouldReadFromAppCache: boolean = false,\n context: IRequestContext,\n telemetry?: ITelemetry | IInternalTelemetry,\n isObservable: boolean = true\n): any => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyFromReturnType = dataServiceRequest._cacheKeyFromReturnType;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType;\n\n if (!requestCache || (!dataServiceRequest.getCacheKey() && cacheKeyFromReturnType.length === 0) || !cacheObjectType) {\n return { entry: null, shouldRefresh: false };\n }\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyFromInput = dataServiceRequest._cacheKeyFromInput;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyIdentifierFromReturnType = dataServiceRequest._cacheKeyIdentifierFromReturnType;\n\n if (cacheKeyFromInput === GET_FROM_RETURNIDENTIFIER || (cacheKeyIdentifierFromReturnType && cacheKeyFromReturnType.length !== 0)) {\n const entries = readCacheEntriesBasedOnCacheKeyFromReturnType(\n dataServiceRequest,\n requestCache,\n appCache,\n shouldReadFromAppCache,\n context,\n telemetry,\n isObservable\n );\n if (entries && entries.entry) {\n return entries;\n }\n }\n const cacheKey = { typeName: cacheObjectType, key: cacheKeyFromInput };\n\n let cachedValueBasedOnInput = requestCache.get(cacheKey);\n if (cachedValueBasedOnInput) {\n cachedValueBasedOnInput = { ...cachedValueBasedOnInput };\n } else if (shouldReadFromAppCache && appCache) {\n cachedValueBasedOnInput = appCache.copyTo(cacheKey, requestCache, isObservable);\n }\n\n if (!cachedValueBasedOnInput) {\n return readCacheEntriesBasedOnCacheKeyFromReturnType(\n dataServiceRequest,\n requestCache,\n appCache,\n shouldReadFromAppCache,\n context,\n telemetry,\n isObservable\n );\n }\n logTelemetrySource(cachedValueBasedOnInput, dataServiceRequest, cacheKeyFromInput, context, telemetry);\n\n if (cachedValueBasedOnInput.item instanceof AsyncResult) {\n if (cachedValueBasedOnInput.item.status !== 'LOADING') {\n cachedValueBasedOnInput.item = cachedValueBasedOnInput.item.result || cachedValueBasedOnInput.item.error;\n } else {\n const asyncResult = cachedValueBasedOnInput.item.then(result => {\n if (typeof result !== 'object' || result.$ref !== true) {\n return result;\n }\n\n return _resolveCacheEntryReference(\n dataServiceRequest,\n result,\n requestCache,\n appCache,\n shouldReadFromAppCache,\n isObservable\n );\n });\n return { entry: asyncResult, shouldRefresh: cachedValueBasedOnInput.shouldRefresh };\n }\n }\n\n if (\n typeof cachedValueBasedOnInput.item !== 'object' ||\n (cachedValueBasedOnInput.item &&\n // @ts-ignore -- $ref property does not exists in type object\n cachedValueBasedOnInput.item.$ref !== true)\n ) {\n return { entry: cachedValueBasedOnInput.item, shouldRefresh: cachedValueBasedOnInput.shouldRefresh };\n }\n\n const cachedValueBasedOnInputItem: any = cachedValueBasedOnInput.item;\n\n const resolvedRef = _resolveCacheEntryReference(\n dataServiceRequest,\n cachedValueBasedOnInput.item,\n requestCache,\n appCache,\n shouldReadFromAppCache,\n isAsyncResult(cachedValueBasedOnInputItem),\n isObservable\n );\n return { entry: resolvedRef, shouldRefresh: cachedValueBasedOnInput.shouldRefresh };\n};\n\nconst _saveEntityToCache = (\n dataServiceRequest: DataServiceRequest,\n data: any,\n requestCache: ICache,\n appCache: ICache,\n isCacheTypeApplication: boolean,\n isInstance: boolean = false\n): { [cacheKey: string]: any } | undefined => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyFromInput = dataServiceRequest._cacheKeyFromInput;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyIdentifierFromReturnType = dataServiceRequest._cacheKeyIdentifierFromReturnType;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const dataServiceRequestQuery = dataServiceRequest._query;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType;\n\n if (!data || (!cacheKeyFromInput && !cacheKeyIdentifierFromReturnType)) {\n return;\n }\n\n const cacheEntries: any = {};\n const results = data;\n\n // using Object.prototype instead of Array.isArray because results can be Observable Array which can't be detected with Array.isArray\n if (!dataServiceRequestQuery.isReturnTypeACollection || Object.prototype.toString.call(results) !== '[object Array]') {\n if (cacheKeyIdentifierFromReturnType) {\n const key = `${cacheKeyIdentifierFromReturnType}-${results[cacheKeyIdentifierFromReturnType]}`;\n cacheEntries[key] = results;\n if (cacheKeyFromInput) {\n let existingCacheItem = requestCache.get({\n typeName: cacheObjectType,\n key: cacheKeyFromInput\n });\n if (existingCacheItem) {\n existingCacheItem = { ...existingCacheItem };\n }\n\n if (\n existingCacheItem &&\n existingCacheItem.item &&\n (!(existingCacheItem.item instanceof AsyncResult) || existingCacheItem.item.status === 'SUCCESS') &&\n (typeof existingCacheItem.item !== 'object' ||\n (existingCacheItem &&\n existingCacheItem.item &&\n // @ts-ignore -- $ref property does not exists in type object\n existingCacheItem?.item?.$ref !== true))\n ) {\n cacheEntries[cacheKeyFromInput] = results;\n } else {\n cacheEntries[cacheKeyFromInput] = {\n $ref: true,\n type: cacheObjectType,\n identifier: cacheKeyIdentifierFromReturnType,\n key: [key],\n // @ts-ignore -- accessing a private class variable which is a valid JS\n count: dataServiceRequest._totalCount\n };\n }\n }\n } else {\n cacheEntries[cacheKeyFromInput] = results;\n }\n } else if (!cacheKeyIdentifierFromReturnType) {\n cacheEntries[cacheKeyFromInput] = results;\n } else {\n const cacheValue = results\n .map((result: { [x: string]: any }) => {\n const identifierValue = result[cacheKeyIdentifierFromReturnType];\n if (identifierValue) {\n const key = `${cacheKeyIdentifierFromReturnType}-${identifierValue}`;\n cacheEntries[key] = result;\n return key;\n }\n })\n .filter(Boolean);\n let existingCacheItem = requestCache.get({\n typeName: cacheObjectType,\n key: cacheKeyFromInput\n });\n if (existingCacheItem) {\n existingCacheItem = { ...existingCacheItem };\n }\n if (\n existingCacheItem &&\n existingCacheItem.item &&\n (!(existingCacheItem.item instanceof AsyncResult) || existingCacheItem.item.status === 'SUCCESS') &&\n (typeof existingCacheItem.item !== 'object' ||\n (existingCacheItem &&\n existingCacheItem.item &&\n // @ts-ignore -- $ref property does not exists in type object\n existingCacheItem.item.$ref !== true))\n ) {\n cacheEntries[cacheKeyFromInput] = results;\n } else {\n if (existingCacheItem) {\n // @ts-ignore - _cacheObjectType does not exist in type ICacheItem\n const existingCacheObjectType = existingCacheItem._cacheObjectType;\n // @ts-ignore - _cacheKeyIdentifierFromReturnType does not exist in type ICacheItem\n const existingCacheKeyIdentifierFromReturnType = existingCacheItem._cacheKeyIdentifierFromReturnType;\n // @ts-ignore - _query does not exist in type ICacheItem\n const existingCacheIsReturnTypeACollection = existingCacheItem._query.isReturnTypeACollection;\n // @ts-ignore - _totalCount does not exist in type ICacheItem\n const existingCacheTotalCount = existingCacheItem._totalCount;\n\n cacheEntries[cacheKeyFromInput] = {\n $ref: true,\n type: existingCacheObjectType,\n identifier: existingCacheKeyIdentifierFromReturnType,\n isCollection: existingCacheIsReturnTypeACollection,\n key: cacheValue,\n count: existingCacheTotalCount\n };\n }\n }\n }\n\n if (cacheEntries) {\n Object.keys(cacheEntries).map(entryKey => {\n requestCache.put(\n { typeName: cacheObjectType, key: entryKey },\n { item: cacheEntries[entryKey], ...(isInstance && { instance: 'instance' }) }\n );\n\n if (appCache && isCacheTypeApplication) {\n appCache.put(\n { typeName: cacheObjectType, key: entryKey },\n { item: cacheEntries[entryKey], ...(isInstance && { instance: 'instance' }) }\n );\n }\n });\n }\n\n return cacheEntries;\n};\n\nexport const saveCacheEntries = (\n dataServiceRequest: DataServiceRequest,\n data: AsyncResult | any,\n requestCache: ICache,\n appCache: ICache,\n isCacheTypeApplication: boolean,\n isInstance: boolean = false\n): { [cacheKey: string]: any } | undefined => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyFromInput = dataServiceRequest._cacheKeyFromInput;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheKeyIdentifierFromReturnType = dataServiceRequest._cacheKeyIdentifierFromReturnType;\n // @ts-ignore -- accessing a private class variable which is a valid JS\n const cacheObjectType = dataServiceRequest._cacheObjectType;\n\n // if return Entity is collection\n // if entity type has identifier/primary key\n // 1. cache array of primay key value of returned entity collection on input cache key\n // 2. cache individual entity on primary key\n // else\n // 1. cache output on input cache key\n //\n // else if entity type has identifier/primary key\n // 2. cache output entity on primary key\n if (!data || (!cacheKeyFromInput && !cacheKeyIdentifierFromReturnType) || !cacheObjectType) {\n return;\n }\n\n if (data instanceof AsyncResult) {\n // For a loading Promise, cache based on input cachekey, and then cache output again once complete\n if (data.status === 'LOADING') {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n data.then((result: any) => {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n if (dataServiceRequest._totalCount !== undefined) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n data.metadata.count = dataServiceRequest._totalCount;\n }\n // @ts-ignore -- accessing a private class variable which is a valid JS\n if (dataServiceRequest && dataServiceRequest._otherOdata) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n data.metadata.others = dataServiceRequest._otherOdata;\n }\n\n _saveEntityToCache(dataServiceRequest, result, requestCache, appCache, isCacheTypeApplication, isInstance);\n return result;\n });\n requestCache.put(\n { typeName: cacheObjectType, key: cacheKeyFromInput },\n { item: data, ...(isInstance && { instance: 'instance' }) }\n );\n\n if (appCache && isCacheTypeApplication) {\n appCache.put(\n { typeName: cacheObjectType, key: cacheKeyFromInput },\n { item: data, ...(isInstance && { instance: 'instance' }) }\n );\n }\n // For a completed promise, save the action results to the cache\n } else {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n if (dataServiceRequest._totalCount !== undefined) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n data.metadata.count = dataServiceRequest._totalCount;\n }\n // @ts-ignore -- accessing a private class variable which is a valid JS\n if (dataServiceRequest && dataServiceRequest._otherOdata) {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n data.metadata.others = dataServiceRequest._otherOdata;\n }\n _saveEntityToCache(dataServiceRequest, data.result, requestCache, appCache, isCacheTypeApplication, isInstance);\n return data.result;\n }\n } else {\n return _saveEntityToCache(dataServiceRequest, data, requestCache, appCache, isCacheTypeApplication, isInstance);\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 { EventEmitter } from 'events';\n\n/** EventEmitter is available in node, but not on the browser,\n * this class attempts to polyfill that so the action context can remain Isomorphic\n */\n/* @internal*/\n\n/**\n * Type for event emitter listener callback\n */\nexport type ListenerCallback = (...args0: T) => void;\n\n/**\n * Generic cast type\n */\nexport type GenericCallback = (...args: any) => void;\n\n/**\n * Custom isomorphic event emitter implementation\n *\n * @export\n * @class CustomEventEmitter\n */\nclass CustomEventEmitter {\n private listeners: Map = new Map();\n private eventEmitter: EventEmitter | null = typeof window !== undefined ? null : new EventEmitter();\n\n public on(event: string, callback: ListenerCallback): void {\n if (!!this.eventEmitter) {\n this.eventEmitter.on(event, callback);\n } else {\n let listeners = this.listeners.get(event);\n if (!!!listeners) {\n listeners = [];\n this.listeners.set(event, listeners);\n }\n\n listeners.push(callback);\n }\n }\n\n public emit(event: string, ...args: T): boolean {\n if (!!this.eventEmitter) {\n return this.eventEmitter.emit(event, args);\n }\n\n const listeners = this.listeners.get(event);\n\n if (listeners && listeners.length) {\n listeners.forEach(listener => {\n listener(...args);\n });\n return true;\n }\n\n return false;\n }\n\n public removeAllListeners(event: string): void {\n if (!!this.eventEmitter) {\n this.eventEmitter.removeAllListeners(event);\n } else {\n this.listeners.delete(event);\n }\n }\n}\n\nexport default new CustomEventEmitter();\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICache, ICacheItem, ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport {\n CacheType,\n IActionContext,\n IActionInput,\n IAnyAction,\n IDataActionOptions,\n msdyn365Commerce,\n verboseLogger,\n checkVersionForFeature,\n getPerformanceUtils\n} from '@msdyn365-commerce/core-internal';\nimport { AsyncResult, DataServiceRequest, ErrorTypeEnum, isAsyncResult, ProxyError } from '@msdyn365-commerce/retail-proxy';\nimport { asSystemMetadata, ITelemetry, LogLevel, StaticTelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { get as _get, uniqWith } from 'lodash';\nimport { toJS } from 'mobx';\nimport uuidv1 from 'uuid/v1';\n\nimport { ActionError, ActionErrorStatus } from './action-error';\nimport { ActionRegistrar } from './action-registrar';\nimport { isAppCacheData, shouldReadFromAppCache, shouldWriteToAppCache } from './action-runtime-utils';\nimport { readCacheEntries, saveCacheEntries } from './cache/retail-cache-helper';\nimport EventHelper from './event-emitter';\n\nconst defaultTimeoutInMS: number = 4000;\nconst defaultHookTimeoutInMS: number = 1000;\nexport const CLIENT_HYDRATE_KEY = 'clientHydrateKey';\nexport const CLIENT_HYDRATE_TYPE = 'clientHydrate';\n\nconst Timer = (timeoutInMS: number, message: unknown) => new Promise(resolve => setTimeout(resolve.bind(resolve, message), timeoutInMS));\n\nconst ActionTimer = (timeoutInMS: number) =>\n new Promise((_resolve, reject) => setTimeout(reject.bind(reject, ActionErrorStatus.Timeout), timeoutInMS));\n\nconst ObservableActionTimer = (timeoutInMS: number) =>\n new AsyncResult((_resolve, reject) => setTimeout(reject.bind(reject, ActionErrorStatus.Timeout), timeoutInMS));\n\n/* @internal */\n/**\n * This class contains the logic to batch and de-dupe the actions that can be executed.\n * This class is also responsible for checking and saving the action response to cache.\n */\nexport default class ActionExecutor {\n public readonly action: Function;\n public readonly cacheType: CacheType;\n private readonly isBatched: boolean;\n private readonly eventId: string;\n private readonly isObservable: boolean;\n\n private inputs: IActionInput[];\n /**\n * @param action the action to execute\n * @param inputs the action input\n */\n constructor(action: Function, inputs: IActionInput[], telemetry: ITelemetry, dataActionOption?: IDataActionOptions) {\n this.action = action;\n this.eventId = uuidv1();\n this.inputs = [...inputs]; // Cloning it DO NOT use the reference\n this.isBatched = action.prototype.isBatched;\n\n this.isObservable = action.prototype.isObservable;\n\n // Cache all the calls on browser\n const masterInput = inputs[0];\n\n if (masterInput && masterInput.dataCacheType) {\n this.cacheType = masterInput.dataCacheType();\n } else if (masterInput && masterInput.shouldCacheOutput) {\n this.cacheType = masterInput.shouldCacheOutput() ? 'request' : 'none';\n telemetry.trace('shouldCacheOutput property has been deprecated. Please update the IActionInput to use dataCacheType');\n } else {\n this.cacheType = (dataActionOption && dataActionOption.cacheType) || 'none';\n // for data actions who do not have dataCacheType function, we add customer defined cachtype to the action.\n // this is used for later check if the data acton should be read from app cache.\n inputs.forEach(input => {\n input.dataCacheType = () => this.cacheType;\n });\n telemetry.trace('Neither dataCacheType nor shouldCacheOutput are set. Caching strategy will fall back to \"none\"');\n }\n }\n\n /**\n *\n * @param inputs add more inputs\n */\n public addInputs(inputs: IActionInput[]): void {\n this.inputs.push(...inputs);\n }\n\n /** Execute the action */\n public async execute(\n context: IActionContext,\n requestCache: ICache,\n appCache: ICache | null,\n bypassAppCache?: boolean,\n refreshingInputs: IActionInput[] = []\n ): Promise {\n const unique: IActionInput[] =\n refreshingInputs && refreshingInputs.length > 0\n ? this._removeDuplicates(refreshingInputs)\n : this._removeDuplicates(this.inputs);\n if (!unique.length) {\n return [];\n }\n\n const actionId = this._getActionIdFromInputs(unique);\n\n const performanceUtils = getPerformanceUtils(msdyn365Commerce, context);\n const executionId = performanceUtils?.performanceUtilsPackage.Random.Guid.generateGuid();\n\n performanceUtils?.performanceUtilsPackage.runPreReadonlyDataActionPerformanceHook({\n actionId,\n executionId,\n internalCache: performanceUtils.cache\n });\n\n const result = await this._executeDataAction(context, requestCache, appCache, bypassAppCache, refreshingInputs, unique, actionId);\n\n performanceUtils?.performanceUtilsPackage.runPostReadonlyDataActionPerformanceHook({\n actionId,\n executionId,\n internalCache: performanceUtils.cache\n });\n\n return result;\n }\n\n private async _executeDataAction(\n context: IActionContext,\n requestCache: ICache,\n appCache: ICache | null,\n bypassAppCache: boolean | undefined,\n refreshingInputs: IActionInput[],\n unique: IActionInput[],\n actionId: string\n ): Promise {\n const isRefreshingAction = refreshingInputs && refreshingInputs.length > 0;\n\n this._runPreReadHooks(actionId, unique, context)\n .then(() => null)\n .catch(err => null);\n\n // execte preReaderHook\n this._runPreReaderHooks(actionId, unique, context)\n .then(() => null)\n .catch(err => null);\n const [uncached, needsRefresh]: IActionInput[][] = this._checkForCachedData(\n unique,\n context,\n requestCache,\n appCache,\n bypassAppCache,\n isRefreshingAction\n );\n\n if (!uncached.length) {\n // excute readOnly post hook with all cached actions ouptput\n await this._fetchOutputsAndRunPostReadHook(actionId, unique, requestCache, context);\n return needsRefresh;\n } else {\n const cachedActions = unique.filter(value => !uncached.includes(value));\n if (cachedActions.length) {\n // fetch the output for all cached data action, and run readOnly hooks. The uncached actions will be excuted later.\n await this._fetchOutputsAndRunPostReadHook(actionId, cachedActions, requestCache, context);\n }\n }\n\n let outputs: any[] = [];\n\n // VNext observable promise based flow\n // Create the AsyncResult and immediately return it\n if (this.isObservable) {\n if (this.isBatched) {\n this._executeBatchedObservableActions(uncached, requestCache, appCache, context, isRefreshingAction);\n } else {\n this._executeObservableAction(uncached[0], requestCache, appCache, context, isRefreshingAction);\n }\n return needsRefresh;\n }\n\n if (this.isBatched) {\n // TODO: Have a max batch count on the action\n outputs = await this._actionWrapper(uncached, context, isRefreshingAction);\n\n if (outputs && outputs.length !== uncached.length) {\n // TODO Throw\n context.telemetry.log(\n LogLevel.Trace,\n 'Length of input array {uncached_length} does not meet the output array {outputs_length}',\n { values: [uncached.length, outputs.length] }\n );\n }\n } else {\n outputs[0] = await this._actionWrapper(uncached[0], context, isRefreshingAction);\n }\n\n if (!outputs || outputs.length === 0) {\n return needsRefresh;\n }\n\n this._saveResponseToCache(uncached, outputs, context, requestCache, appCache);\n return needsRefresh;\n }\n\n // the retail proxy data actions who do not have return type should not interact with cache.\n private _checkShouldInteractWithCache(input: IActionInput, typeName: string | undefined): boolean {\n return !(input instanceof DataServiceRequest) || !!typeName;\n }\n\n private async _fetchOutputsAndRunPostReadHook(\n actionId: string,\n inputs: IActionInput[],\n requestCache: ICache,\n context: IActionContext\n ): Promise {\n const outputs = inputs.map(i => {\n const cacheKey = { typeName: i.getCacheObjectType(), key: i.getCacheKey() };\n // if the retail data action does not have return type, we do not read the output from cache.\n let cacheItem;\n if (this._checkShouldInteractWithCache(i, cacheKey.typeName)) {\n cacheItem = requestCache.get>(cacheKey);\n }\n return !!cacheItem ? requestCache.getValue(cacheKey) : null;\n });\n this._runPostReadHooks(actionId, inputs, outputs, context)\n .then(() => null)\n .catch(err => null);\n this._runPostReaderHooks(actionId, inputs, outputs, context)\n .then(() => null)\n .catch(err => null);\n }\n private _removeDuplicates(inputs: IActionInput[]): IActionInput[] {\n if (!this.isBatched) {\n return inputs;\n }\n\n return uniqWith(\n inputs,\n (inputA: IActionInput, inputB: IActionInput) =>\n inputA.getCacheKey() === inputB.getCacheKey() && inputA.getCacheObjectType() === inputB.getCacheObjectType()\n );\n }\n\n private _getActionIdFromInputs(inputs: IActionInput | IActionInput[]): string {\n let inputsActionId;\n for (const input of Array.isArray(inputs) ? inputs : [inputs]) {\n if (typeof input.getActionId === 'function') {\n inputsActionId = input.getActionId();\n }\n }\n return inputsActionId || (>this.action).prototype.id;\n }\n\n private _getActionFromId(actionId?: string): Function {\n let { action } = this;\n if (actionId) {\n const registration = ActionRegistrar.resolveRegistration(actionId, >action);\n if (registration) {\n action = >registration.action;\n return ActionRegistrar.unwrapAction(>action);\n }\n }\n return action;\n }\n\n private async _runPreReadHooks(id: string, inputs: IActionInput | IActionInput[], context: IActionContext): Promise {\n const preReadHooks = ActionRegistrar.getPreReadHooks(id);\n if (!preReadHooks) {\n return;\n }\n\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n\n const preReadHooksArray = Array.from(preReadHooks);\n return preReadHooksArray.reduce(async (previousTask, currentTask) => {\n await previousTask;\n try {\n await Promise.race([timer, currentTask(inputs, context)]);\n } catch (error) {\n const actionId = id || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution hook of action_id '{id}', returning null\",\n {\n values: [asSystemMetadata(actionId)],\n exception: error\n },\n LogLevel.Trace\n );\n }\n return Promise.resolve();\n }, Promise.resolve());\n }\n\n private async _runPostReaderHooks(\n id: string,\n inputs: IActionInput | IActionInput[],\n actionResult: unknown,\n context: IActionContext\n ): Promise {\n const postReaderHooks = ActionRegistrar.getPostReaderHooks(id);\n if (!postReaderHooks) {\n return;\n }\n\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n const postReaderHooksArray = Array.from(postReaderHooks);\n return postReaderHooksArray.reduce(async (previousTask, currentTask) => {\n await previousTask;\n try {\n await Promise.race([timer, currentTask(inputs, actionResult, context)]);\n } catch (error) {\n const actionId = id || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution hook of action_id '{id}', returning null\",\n {\n values: [asSystemMetadata(actionId)],\n exception: error\n },\n LogLevel.Trace\n );\n }\n return Promise.resolve();\n }, Promise.resolve());\n }\n\n private async _runPreReaderHooks(id: string, inputs: IActionInput | IActionInput[], context: IActionContext): Promise {\n const preReaderHooks = ActionRegistrar.getPreReaderHooks(id);\n if (!preReaderHooks) {\n return;\n }\n\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n\n const preReaderHooksArray = Array.from(preReaderHooks);\n return preReaderHooksArray.reduce(async (previousTask, currentTask) => {\n await previousTask;\n try {\n await Promise.race([timer, currentTask(inputs, context)]);\n } catch (error) {\n const actionId = id || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution hook of action_id '{id}', returning null\",\n {\n values: [asSystemMetadata(actionId)],\n exception: error\n },\n LogLevel.Trace\n );\n }\n return Promise.resolve();\n }, Promise.resolve());\n }\n\n private async _runPreHooks(\n id: string,\n inputs: IActionInput | IActionInput[],\n context: IActionContext\n ): Promise {\n const preHooks = ActionRegistrar.getPreHooks(id);\n if (!preHooks) {\n return;\n }\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n\n const preHooksArray = Array.from(preHooks);\n return preHooksArray.reduce(async (previousTask, currentTask) => {\n const prevInput = await previousTask;\n let tmpNextInput: unknown;\n try {\n tmpNextInput = await Promise.race([timer, currentTask(prevInput, context)]);\n } catch (error) {\n throw error;\n }\n const finalNextInput: IActionInput | IActionInput[] =\n tmpNextInput === ActionErrorStatus.HookTimeout || !tmpNextInput ? prevInput : tmpNextInput;\n return Promise.resolve(finalNextInput);\n }, Promise.resolve(inputs));\n }\n\n private async _runPostReadHooks(\n id: string,\n inputs: IActionInput | IActionInput[],\n actionResult: unknown,\n context: IActionContext\n ): Promise {\n const postHooks = ActionRegistrar.getPostReadHooks(id);\n\n if (!postHooks) {\n return;\n }\n\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n const postReadHooksArray = Array.from(postHooks);\n return postReadHooksArray.reduce(async (previousTask, currentTask) => {\n await previousTask;\n try {\n await Promise.race([timer, currentTask(inputs, actionResult, context)]);\n } catch (error) {\n const actionId = id || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution hook of action_id '{id}', returning null\",\n {\n values: [asSystemMetadata(actionId)],\n exception: error\n },\n LogLevel.Trace\n );\n }\n return Promise.resolve();\n }, Promise.resolve());\n }\n\n private async _runPostHooks(\n id: string,\n inputs: IActionInput | IActionInput[],\n actionResult: unknown,\n context: IActionContext\n ): Promise {\n const postHooks = ActionRegistrar.getPostHooks(id);\n if (!postHooks) {\n return;\n }\n const hookTimeout = Number(_get(context, 'requestContext.query.actionHookTimeout')) || defaultHookTimeoutInMS;\n const timer = Timer(hookTimeout, ActionErrorStatus.HookTimeout);\n const postHooksArray = Array.from(postHooks);\n return postHooksArray.reduce(async (previousTask, currentTask) => {\n const prevOutput = await previousTask;\n let tmpNextOutput: unknown;\n try {\n tmpNextOutput = await Promise.race([timer, currentTask(inputs, prevOutput, context)]);\n } catch (error) {\n throw error;\n }\n const finalNextOutput = tmpNextOutput === ActionErrorStatus.HookTimeout || !tmpNextOutput ? prevOutput : tmpNextOutput;\n return Promise.resolve(finalNextOutput);\n }, Promise.resolve(actionResult));\n }\n\n /**\n * Add performance logging before and after calling the action?\n */\n // eslint-disable-next-line complexity\n private async _actionWrapper(inputs: IActionInput | IActionInput[], context: IActionContext, isRefreshing?: boolean): Promise {\n const actionId = this._getActionIdFromInputs(inputs);\n const action = this._getActionFromId(actionId);\n\n try {\n // Run pre data action hooks\n const _inputs = await this._runPreHooks(actionId, inputs, context);\n if (_inputs) {\n inputs = _inputs;\n }\n } catch (e) {\n const convertedError = this._convertToJSError(e);\n StaticTelemetry.log(\n LogLevel.Error,\n `Error executing pre-hooks for ${\n isRefreshing ? 'Refreshing' : ''\n } action '{actionName}', returning null. Error '{errorName}'. CorrelationId: '{CorrelationId}'`,\n {\n values: [\n actionId || (action && action.name) || 'unnamed',\n convertedError.name || convertedError.message,\n (convertedError).data ? (convertedError).data.CorrelationId : ''\n ],\n exception: e\n }\n );\n return new ActionError(e);\n }\n let actionResult;\n try {\n const timeOut = Number(_get(context, 'requestContext.query.actionTimeout'));\n const features = _get(context, 'requestContext.features', {});\n const serverSideCustomerTimeout =\n msdyn365Commerce.platformSettings && msdyn365Commerce.platformSettings.serverSideDataActionTimeoutInMs;\n const clientSideCustomerTimeout =\n msdyn365Commerce.platformSettings && msdyn365Commerce.platformSettings.clientSideDataActionTimeoutInMs;\n let promises;\n if (process.env.CURRENT_ENVIRONMENT === 'node' && (features.action_timeout || serverSideCustomerTimeout)) {\n const timeOutValue = (features.action_timeout && timeOut ? timeOut : serverSideCustomerTimeout) || defaultTimeoutInMS;\n promises = [this.isObservable ? ObservableActionTimer(timeOutValue) : ActionTimer(timeOutValue), action(inputs, context)];\n } else if (typeof window !== 'undefined' && msdyn365Commerce.isBrowser && clientSideCustomerTimeout) {\n promises = [\n this.isObservable ? ObservableActionTimer(clientSideCustomerTimeout) : ActionTimer(clientSideCustomerTimeout),\n action(inputs, context)\n ];\n } else {\n promises = [action(inputs, context)];\n }\n // run the data action\n actionResult = await Promise.race(promises);\n } catch (e) {\n if (e.message && e.message.length > 0 && !e.message.includes('Action id')) {\n e.message = `Action id: ${actionId}, Error message: ${e.message}`;\n }\n const convertedError = this._convertToJSError(e);\n StaticTelemetry.log(\n LogLevel.Error,\n `Error executing ${\n isRefreshing ? 'Refreshing' : ''\n } action '{actionName}', returning null. Error '{errorName}'. CorrelationId: '{CorrelationId}'`,\n {\n values: [\n actionId || (action && action.name) || 'unnamed',\n convertedError.name || convertedError.message,\n (convertedError).data ? (convertedError).data.CorrelationId : ''\n ],\n exception: e\n }\n );\n let error = new ActionError(e);\n // For AsyncResult, we need to signal that this was a rejection by throwing\n if (this.isObservable) {\n // Proxy Errors come wrapped as an array\n if (Array.isArray(e)) {\n error =\n e[0]._errorCode === ErrorTypeEnum.SERVICE_UNAVAILABLE\n ? new ActionError(ActionErrorStatus.ServiceUnavailable)\n : ProxyError.toError(e[0]);\n } else {\n error =\n e._errorCode === ErrorTypeEnum.SERVICE_UNAVAILABLE\n ? new ActionError(ActionErrorStatus.ServiceUnavailable)\n : new ActionError(e);\n }\n }\n\n throw error;\n }\n\n try {\n // Run post data action hooks\n const result = await this._runPostHooks(actionId, inputs, actionResult, context);\n if (result) {\n actionResult = result;\n }\n this._runPostReadHooks(actionId, inputs, actionResult, context)\n .then(() => null)\n .catch(err => null);\n this._runPostReaderHooks(actionId, inputs, actionResult, context)\n .then(() => null)\n .catch(err => null);\n } catch (e) {\n const convertedError = this._convertToJSError(e);\n StaticTelemetry.log(\n LogLevel.Error,\n `Error executing post-hooks for ${\n isRefreshing ? 'Refreshing' : ''\n } action '{actionName}', returning null. Error '{errorName}'. CorrelationId: '{CorrelationId}'`,\n {\n values: [\n actionId || (action && action.name) || 'unnamed',\n convertedError.name || convertedError.message,\n (convertedError).data ? (convertedError).data.CorrelationId : ''\n ],\n exception: e\n }\n );\n }\n return actionResult;\n }\n\n private _shouldUseInstanceCache = () => {\n return checkVersionForFeature('instance_cache') || msdyn365Commerce.platformSettings?.shouldUseInstanceCache;\n };\n\n private _saveResponseToCache(\n uncached: IActionInput[],\n outputs: any[],\n context: IActionContext,\n requestCache: ICache,\n appCache: ICache | null\n ): void {\n uncached.forEach((i, idx) => {\n const actionId = this._getActionIdFromInputs(i);\n if (i instanceof DataServiceRequest && !!i.getCacheObjectType()) {\n try {\n const appCacheData = appCache;\n const disableUsingInstanceCache =\n context.requestContext.features && context.requestContext.features.disable_instance_cache;\n const usingInstanceCache = !disableUsingInstanceCache && this._shouldUseInstanceCache();\n saveCacheEntries(i, outputs[idx], requestCache, appCacheData, shouldWriteToAppCache(i, appCache), usingInstanceCache);\n } catch (e) {\n const { action } = this;\n const actionName = actionId || (action && action.name) || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution action '{actionName}', returning null\",\n {\n values: [asSystemMetadata(actionName)],\n exception: e\n },\n LogLevel.Trace\n );\n\n return null;\n }\n } else {\n const entityId = i.getCacheKey();\n const entityType = i.getCacheObjectType();\n\n if (!!entityId && !!entityType) {\n const entry = outputs[idx];\n const cacheKey = { typeName: entityType, key: entityId };\n if (ActionError.isActionError(entry)) {\n if (!ActionError.isTimeoutError(entry)) {\n requestCache.put(cacheKey, { item: ((entry)).error, error: true });\n }\n // else do nothing\n } else {\n if (appCache && shouldWriteToAppCache(i, appCache)) {\n appCache.put(cacheKey, { item: entry });\n }\n const cacheEntry = { item: entry };\n if (i.dataCacheType && i.dataCacheType() === 'instance') {\n Object.assign(cacheEntry, { instance: 'instance' });\n }\n requestCache.put(cacheKey, cacheEntry);\n }\n }\n }\n });\n }\n\n /**\n * Method that executes a set of batchable observable data actions\n * @param uncached The uncached action inputs\n * @param requestCache The request cache\n * @param appCache The application cache, if available\n * @param context The action context\n */\n private _executeBatchedObservableActions(\n uncached: IActionInput[],\n requestCache: ICache,\n appCache: ICache | null,\n context: IActionContext,\n isRefreshing: boolean = false\n ): void {\n const unresolvedSet = new Set();\n const uncachedInputs: IActionInput[] = [];\n // Create an OP for each input in the batch that does not yet exist in cache\n const asyncOutputs = uncached\n .map((input, index) => {\n unresolvedSet.add(index);\n const executor = (resolve: any, reject: any) => {\n // When the side promise completes, update each individual OP to have it's piece of the entire batched result\n new Promise((innerResolve, innerReject) => {\n const onEventIdCompletion = (value: any) => {\n innerResolve(<{}>value);\n };\n\n const onEventIdFinalCompletion = () => {\n innerResolve();\n };\n\n const onEventIdFailure = (error: any) => {\n innerReject(error);\n };\n\n // Standard success event\n EventHelper.on(`${this.eventId}-complete-${index}-${input.getCacheKey()}`, onEventIdCompletion);\n\n // No response closing event\n EventHelper.on(`${this.eventId}-final-complete-${index}-${input.getCacheKey()}`, onEventIdFinalCompletion);\n\n // Failure event\n EventHelper.on(`${this.eventId}-failure`, onEventIdFailure);\n })\n .then(result => {\n EventHelper.removeAllListeners(`${this.eventId}-complete-${index}-${input.getCacheKey()}`);\n EventHelper.removeAllListeners(`${this.eventId}-final-complete-${index}-${input.getCacheKey()}`);\n resolve(result);\n })\n .catch(error => {\n EventHelper.removeAllListeners(`${this.eventId}-failure`);\n reject(error);\n });\n };\n\n // Already cached OP logic (rerun)\n // we only try to fetch the saved promise from cache when the retail proxy data action has cached type\n let cachedPromise;\n if (this._checkShouldInteractWithCache(input, input.getCacheObjectType())) {\n cachedPromise = requestCache.getValue({ key: input.getCacheKey(), typeName: input.getCacheObjectType() });\n }\n if (cachedPromise && isAsyncResult(cachedPromise) && !isRefreshing) {\n (>cachedPromise).run(executor);\n return;\n }\n\n // Not yet cached OP logic (initialize, run)\n uncachedInputs.push(input);\n return new AsyncResult(executor);\n })\n .filter(Boolean);\n\n // Save never before cached OPs to cache\n this._saveResponseToCache(uncachedInputs, asyncOutputs, context, requestCache, appCache);\n\n // Run the actual action\n this._actionWrapper(uncached, context, isRefreshing)\n .then((actionResults: unknown[]) => {\n // Emit events with the associated result so that each individual OP in the cache\n // can be updated appropriately\n actionResults.forEach((actionResult, index) => {\n unresolvedSet.delete(index);\n EventHelper.emit(`${this.eventId}-complete-${index}-${uncached[index].getCacheKey()}`, actionResult);\n });\n })\n .catch(error => {\n EventHelper.emit(`${this.eventId}-failure`, error);\n })\n .finally(() => {\n // In the event some inputs do not have results, we need to resolve the promises anyhow\n unresolvedSet.forEach(unresolvedIndex => {\n const index = unresolvedIndex;\n EventHelper.emit(`${this.eventId}-final-complete-${index}-${uncached[index].getCacheKey()}`);\n });\n });\n }\n\n /**\n * Executes a standard (non-batched) observable data action\n * @param input The action input\n * @param requestCache The request cache\n * @param appCache The application cache, if available\n * @param context The action context\n */\n private _executeObservableAction(\n input: IActionInput,\n requestCache: ICache,\n appCache: ICache | null,\n context: IActionContext,\n isRefreshing: boolean = false\n ): void {\n const cacheKey = { key: input.getCacheKey(), typeName: input.getCacheObjectType() };\n const executor = (resolve: any, reject: any) => {\n this._actionWrapper(input, context, isRefreshing)\n .then(result => {\n resolve(result);\n })\n .catch(error => {\n // If error is timeout error, lookup app-cache if there\n // is a valid entity for the given cacheKey in app-cache\n if (ActionError.isServiceUnavailable(error) && isAppCacheData(input, appCache)) {\n const cachedItem = appCache?.getValue(cacheKey);\n if (cachedItem) {\n return resolve(cachedItem);\n }\n }\n return reject(error);\n });\n };\n // we only try to fetch the saved promise from cache when the retail proxy data action has cached type\n let cachedPromise;\n if (this._checkShouldInteractWithCache(input, input.getCacheObjectType())) {\n cachedPromise = requestCache.getValue({ key: input.getCacheKey(), typeName: input.getCacheObjectType() });\n }\n // If OP is already in cache, just rerun it\n if (cachedPromise && isAsyncResult(cachedPromise) && !isRefreshing) {\n (>cachedPromise).run(executor);\n return;\n }\n\n // Uncached promises need to be saved to cache\n const asyncOutput = new AsyncResult(executor);\n this._saveResponseToCache([input], [asyncOutput], context, requestCache, appCache);\n }\n\n private _checkForCachedData(\n inputs: IActionInput[],\n context: IActionContext,\n requestCache: ICache,\n appCache: ICache | null,\n bypassCache?: boolean,\n refreshing?: boolean\n ): IActionInput[][] {\n const mock = _get(context, 'requestContext.query.actionMock');\n\n if (mock) {\n inputs = this._interceptCacheForMocks(inputs, context, requestCache);\n }\n\n const clientHydrateCacheKey: ICacheKey = {\n key: CLIENT_HYDRATE_KEY,\n typeName: CLIENT_HYDRATE_TYPE\n };\n const isClientHydrate = requestCache.getValue(clientHydrateCacheKey);\n const disableUsingInstanceCache = context.requestContext.features && context.requestContext.features.disable_instance_cache;\n const usingInstanceCache = !disableUsingInstanceCache && this._shouldUseInstanceCache();\n // if the cache type is set a none don't check cache for data and return inputs for execution\n // lazyresponse == true means it has been called from load-data on browser. In this case, data is already present in request-cache due to run on server side\n if (this.cacheType === 'none' || refreshing) {\n // we should keep read from cache when a dataAction\n // 1. run on server\n // 2. none cache type\n // 3. action running as part of initial page load (client hydration).\n // This is important to stay consistent with what we render on server.\n // 4. when instance cache feature is on.\n if (!(this.cacheType === 'none' && inputs[0].runOn === 'server' && isClientHydrate && usingInstanceCache) || refreshing) {\n return [inputs, []];\n }\n }\n\n const uncached: IActionInput[] = [];\n const refresh: IActionInput[] = [];\n // eslint-disable-next-line complexity\n inputs.forEach((i, idx) => {\n const actionId = this._getActionIdFromInputs(i);\n const cacheKey = { typeName: i.getCacheObjectType(), key: i.getCacheKey() };\n // if the retail proxy action does not have return type, we do not check if its in the cache\n if (i instanceof DataServiceRequest && !cacheKey.typeName) {\n uncached.push(i);\n return;\n }\n let cacheItem: ICacheItem | undefined = requestCache.get(cacheKey);\n if (cacheItem && isAsyncResult(cacheItem.item) && (>cacheItem.item).status === 'FAILED') {\n if (!i.runOn || i.runOn !== 'serverOnly') {\n uncached.push(i);\n }\n } else if (cacheItem && cacheItem.item && cacheItem.item.status === 'LOADING' && cacheItem.item.runOn === 'client') {\n // Ideally, an action configured to runOn client should never interfere with actions running on server.\n // However, it is possible that parent action with runon 'server' could be dependent on an action that is configured\n // by partner to be runOn 'client'. In this case, the child action implicitly becomes a server action. Therefore, lets\n // include such actions in the uncached list so that it gets picked and executed later.\n uncached.push(i);\n } else if (i instanceof DataServiceRequest) {\n try {\n if (bypassCache && context.requestContext.features && !!!context.requestContext.features.disable_bypass_request_cache) {\n uncached.push(i);\n } else {\n const appCacheData = appCache;\n const cacheEntries = readCacheEntries(\n i,\n requestCache,\n appCacheData,\n !!!bypassCache && shouldReadFromAppCache(i, appCache),\n context.requestContext,\n undefined,\n !!this.isObservable\n );\n if (!cacheEntries.entry) {\n uncached.push(i);\n }\n if (cacheEntries && cacheEntries.shouldRefresh) {\n refresh.push(i);\n }\n }\n } catch (e) {\n const { action } = this;\n const actionName = actionId || (action && action.name) || 'unnamed';\n verboseLogger(\n context && context.requestContext,\n context.telemetry,\n \"Error execution action '{actionName}', returning null\",\n {\n values: [asSystemMetadata(actionName)],\n exception: e\n },\n LogLevel.Trace\n );\n uncached.push(i);\n }\n } else {\n if (bypassCache && context.requestContext.features && !context.requestContext.features.disable_bypass_request_cache) {\n uncached.push(i);\n } else {\n if (!cacheItem && !!!bypassCache && appCache && shouldReadFromAppCache(i, appCache)) {\n cacheItem = appCache.copyTo(cacheKey, requestCache, !!this.isObservable);\n if (cacheItem && cacheItem.shouldRefresh) {\n refresh.push(i);\n }\n }\n\n if (!cacheItem || !cacheItem.item) {\n uncached.push(i);\n return;\n }\n }\n }\n });\n return [uncached, refresh];\n }\n\n /**\n * Searches cache for mocks matching the inputs\n * @param inputs Current action inputs\n * @param context Current action context\n * @param requestCache Current request cache\n */\n private _interceptCacheForMocks(inputs: IActionInput[], context: IActionContext, requestCache: ICache): IActionInput[] {\n const uncached: IActionInput[] = [];\n const actionId: string = this.action.prototype.id;\n inputs.forEach(i => {\n let mockItem = this._getMockItem(i.getCacheObjectType(), i.getCacheKey(), requestCache);\n if (!mockItem && actionId) {\n mockItem = this._getMockItem(actionId, i.getCacheKey(), requestCache);\n }\n let existingItem;\n if (this._checkShouldInteractWithCache(i, i.getCacheObjectType())) {\n existingItem = requestCache.get({ typeName: i.getCacheObjectType(), key: i.getCacheKey() });\n }\n\n if (!!mockItem && !!mockItem.item && !existingItem) {\n const mockItemJSObject = toJS(mockItem.item);\n if (this.isObservable) {\n requestCache.put(\n { typeName: i.getCacheObjectType(), key: i.getCacheKey() },\n { item: AsyncResult.resolve(mockItemJSObject) }\n );\n } else {\n requestCache.put({ typeName: i.getCacheObjectType(), key: i.getCacheKey() }, { item: toJS(mockItemJSObject) });\n }\n } else {\n uncached.push(i);\n }\n });\n return uncached;\n }\n\n private _getMockItem(cacheNamespace: string, cacheKey: string, requestCache: ICache): ICacheItem | undefined {\n return (\n requestCache.get({ typeName: '__MOCK', key: `${cacheNamespace}:${cacheKey}` }) ||\n requestCache.get({ typeName: '__MOCK', key: `${cacheNamespace}:*` })\n );\n }\n\n private _convertToJSError(e: any): Error {\n // Proxy Error usually comes wrapped in an array\n // If it is, unbox it and conver to regular Error\n if (Array.isArray(e)) {\n const proxyError: ProxyError = e[0];\n if (proxyError.ErrorCode) {\n return ProxyError.toError(proxyError);\n }\n } else if (e.ErrorCode) {\n return ProxyError.toError(e);\n }\n // Return regular Error if not ProxyError\n return new Error(e.message || '');\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProductCatalog } from '@msdyn365-commerce/retail-proxy';\nimport {\n CacheType,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric,\n IRequestContext\n} from '@msdyn365-commerce/core-internal';\nimport { getCatalogsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CatalogsDataActions.g';\nimport { createObservableDataAction } from '../create-data-action.vnext';\n\nconst buildCacheKey = (base: string, apiSettings: ICommerceApiSettings, locale?: string): string => {\n return `${base}-chanId:${apiSettings.channelId}-catId:${apiSettings.catalogId}${locale ? `-${locale}` : ''}`;\n};\n\n/**\n * Input for get-catalogs data action.\n */\nexport class CatalogsInput implements IActionInput {\n public readonly channelId: number;\n\n public readonly customerAccountNumber?: string;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n private readonly locale?: string;\n\n public constructor(context: IRequestContext, customerAccountNumber?: string) {\n this.channelId = context.apiSettings.channelId ? Number(context.apiSettings.channelId) : 0;\n this.customerAccountNumber = customerAccountNumber ? customerAccountNumber : context.user.customerAccountNumber;\n this.apiSettings = context.apiSettings;\n this.locale = context.locale || '';\n }\n\n /**\n * Get Cache Key.\n * @returns - Cache key string.\n */\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- customer account number can be undefined.\n // Removing customer account number dependency as API does not need customer account number and cache is of request type.\n // Keeping the contract same not to break backward compatibility.\n public getCacheKey = (): string => buildCacheKey(`${this.channelId}`, this.apiSettings, this.locale);\n\n /**\n * Get Cache object type.\n * @returns - Cache object type.\n */\n public getCacheObjectType = (): string => 'productCatalogs';\n\n /**\n * Get data cache type.\n * @returns - Cache type enum.\n */\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData - The input data passed to the createInput method.\n * @param customerAccountNumber - Customer account number.\n * @returns - Catalogs input.\n */\nexport const createCatalogsInput = (inputData: ICreateActionContext>, customerAccountNumber?: string): IActionInput => {\n if (!inputData.requestContext.user.isAuthenticated) {\n throw new Error('Unable to get product catalog. User is not authenticated.');\n }\n return new CatalogsInput(inputData.requestContext, customerAccountNumber);\n};\n\n/**\n * Calls the Retail API and returns the product catalog for an user.\n * @param input - Catalogs Input.\n * @param context - Current context.\n * @returns - Product catalog for the user.\n */\nexport async function getCatalogAction(input: CatalogsInput, context: IActionContext): Promise {\n const productCatalogs = await getCatalogsAsync({ callerContext: context }, input.channelId, true);\n return productCatalogs;\n}\n\n/**\n * The GetProductCatalogs Data Action\n * Returns product catalogs.\n */\nexport const getCatalogActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/get-catalogs',\n action: getCatalogAction as IAction,\n input: createCatalogsInput\n});\n\nexport default getCatalogActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext, IRequestContext, IRequestContextParams } from '@msdyn365-commerce/core-internal';\nimport { ProductCatalog } from '@msdyn365-commerce/retail-proxy';\nimport { CatalogsInput, getCatalogActionDataAction } from './actions/get-catalogs';\n\n/**\n * Returns catalog name for a given catalog id\n * @param context Action Context\n * @param context Catalog Id\n */\nexport const getCatalogName = async (context: IActionContext, catalogId: number): Promise => {\n if (!context || !context.requestContext || !context.requestContext.apiSettings) {\n return '';\n }\n\n const customerAccountNumber = context.requestContext.user.customerAccountNumber;\n const productCatalogs = await getCatalogActionDataAction(new CatalogsInput(context.requestContext, customerAccountNumber), context);\n\n return findCatalogName(productCatalogs, catalogId);\n};\n\n/**\n * Returns true if data action cache needs to be bypassed\n * @param requestContext rendering context\n * @returns cachebypass status\n */\nexport const shouldByPassCache = (requestContext: IRequestContext) => {\n return (requestContext.query && !!requestContext.query.cachebypass) || isPageInsightsEnabled(requestContext.params);\n};\n\nconst isPageInsightsEnabled = (params: IRequestContextParams): boolean => {\n return params?.pageInsights === 'all' || params?.pageInsights === 'info' || params?.pageInsights === 'error';\n};\n\n/**\n * Matches the catalog if with the productCatalogs response and returns catalog name\n * @param productCatalogs Product catalogs response\n * @param catalogId Catalog id to search in Product catalogs response\n * @returns Catalog name\n */\nexport const findCatalogName = (productCatalogs: ProductCatalog[], catalogId: number): string => {\n let catalogName = '';\n productCatalogs &&\n productCatalogs.forEach((catalog: ProductCatalog) => {\n if (catalog.RecordId === catalogId && catalog.Name) {\n catalogName = catalog.Name;\n }\n });\n return catalogName;\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, ICacheItem, ICacheKey, ICacheSource, RequestCache } from '@msdyn365-commerce/cache-internal';\nimport {\n IAction,\n IActionContext,\n IActionInput,\n IDataActionOptions,\n msdyn365Commerce,\n verboseLogger\n} from '@msdyn365-commerce/core-internal';\nimport { AsyncResult, DataServiceRequest, isAsyncResult } from '@msdyn365-commerce/retail-proxy';\nimport {\n asSystemMetadata,\n GenericConsoleLogger,\n ITelemetry,\n LogLevel,\n StaticTelemetry,\n Telemetry\n} from '@msdyn365-commerce/telemetry-internal';\nimport uuidv1 from 'uuid/v1';\nimport ActionExecutor from './action-executor';\nimport { ActionRegistrar } from './action-registrar';\nimport { shouldWriteToAppCache } from './action-runtime-utils';\nimport { addLocaleInformation, readCacheEntries, saveCacheEntries } from './cache/retail-cache-helper';\nimport EventHelper from './event-emitter';\nimport { shouldByPassCache } from './helpers';\n\n/**\n * Cache key for actions which needs to be refreshed after page render\n */\nexport const REFRESH_ACTIONS_CACHE_KEY: ICacheKey = {\n typeName: '__REFRESH_CONFIGS_TYPE__',\n key: '__refresh_cache_key'\n};\n\n/**\n * This interface is used in ActionContext only, for saving information needed to refresh data actions.\n *\n */\nexport interface IRefreshConfigs {\n actionInputs: IActionInput[];\n paramExecutor: ActionExecutor;\n}\n/**\n * This class contains the primary logic which controls the execution flow of the action runtime\n *\n */\n/* @internal*/\n/**\n *\n */\nexport class ActionContext implements IActionContext {\n public static maxDepth: number = 200;\n\n public readonly executionParams: ActionExecutor[] = [];\n public readonly requestContext: any;\n\n /**\n * Telemetry object to log information\n */\n public telemetry: ITelemetry;\n\n private readonly requestCache: ICache;\n private readonly appCache: ICache | null = null;\n private readonly cacheKeyMap: string[] = [];\n private readonly refreshConfigs: IRefreshConfigs[] = [];\n\n /**\n * Action context creates a new instance for every tier of execution,\n * This number specifies the depth/current tier in the execution flow\n */\n private readonly currentExecutionTier: number;\n\n /**\n * Thread ID\n */\n private readonly threadId: string;\n\n /**\n * Event ID\n * Unique ID for each action context, automatically generated\n */\n private readonly eventId: string;\n\n /**\n * Whether the current context as executed\n */\n private hasRun: boolean = false;\n\n /**\n * When this number is > 0, the current context will wait for all the actions to\n * be queued before kicking off execution.\n * This number is decremented for every action that is successful in current tier.\n */\n private expectedActionsInCurrentTier: number;\n\n /**\n * variable tracking the current number of actions that are in queue, context will wait for this to match the expected count\n */\n private currentActionsInQueue: number = 0;\n\n /**\n * Object to track the next tier number.\n */\n private nextTierCounter: { next: number } = { next: 0 };\n\n /**\n * When true will span a new independent action context when an action is executed resetting depth limits\n * Otherwise will invoke the action in the current context.\n */\n private spawnChildOnExecute: boolean = false;\n\n /**\n * @param currentExecutionTier: Current execution tier in the data fetch pipeline, max is currently 7\n * @param expectedActionCount: This value specifies the expected number of actions to be queued before\n * we kick off execution in the current tier\n */\n constructor(args: {\n id: string;\n requestContext: any;\n requestCache: ICache;\n appCache: ICache | null;\n currentExecutionTier?: number;\n expectedActionCount?: number;\n spawnChildOnExecute?: boolean;\n telemetry?: ITelemetry;\n }) {\n const {\n id,\n requestContext,\n requestCache,\n appCache,\n currentExecutionTier,\n expectedActionCount,\n spawnChildOnExecute,\n telemetry\n } = args;\n this.threadId = id;\n this.eventId = uuidv1();\n\n this.currentExecutionTier = currentExecutionTier || 0;\n if (this.currentExecutionTier === 0) {\n this.nextTierCounter = { next: 0 };\n }\n\n this.expectedActionsInCurrentTier = expectedActionCount || 0;\n this.requestCache = requestCache;\n this.requestContext = requestContext || {};\n this.spawnChildOnExecute = Boolean(spawnChildOnExecute);\n\n // If a telemetry object has been passed in use that telemetry object, otherwise create a new Telemetry object\n if (telemetry) {\n this.telemetry = telemetry;\n } else {\n // register default console logger\n const moduleTelemetry = new Telemetry();\n const isDebug = requestContext.params && requestContext.params.isDebug;\n\n // register tracelogger only in development environment or debug is true.\n (process.env.NODE_ENV === 'development' || isDebug) &&\n moduleTelemetry.registerTraceLogger({ traceLogger: GenericConsoleLogger, options: { isDebug: isDebug } });\n\n this.telemetry = moduleTelemetry;\n }\n\n /**\n * @deprecated\n * Trace is an alias for telemetry.log(LogLevel.Trace, message)\n * Use the telemetry object directly.\n */\n this.trace = (message: string) => {\n this.telemetry.log(LogLevel.Debug, message);\n };\n\n // enable app cache only if the disable_app_cache feature switch is false\n if (requestContext.features && !!!requestContext.features.disable_app_cache) {\n this.appCache = appCache;\n }\n }\n\n public getRefreshActions(): IRefreshConfigs[] {\n return this.refreshConfigs;\n }\n\n /**\n * Chains an action method to the current context for execution\n * @param action - action method\n * @param inputs - action input\n */\n public chainAction(\n _action: IAction,\n inputs: IActionInput | IActionInput[],\n actionOption?: IDataActionOptions\n ): Promise {\n const action = ActionRegistrar.unwrapAction(_action);\n addLocaleInformation(inputs, this.requestContext.locale);\n if (!action || !inputs) {\n // Decrement the expected actions on this tier since this action was incorrectly configured\n this.expectedActionsInCurrentTier--;\n if (this.currentActionsInQueue < this.expectedActionsInCurrentTier) {\n return Promise.resolve(null);\n }\n\n if (!this.hasRun) {\n return this.runAllActionsInQueue().then(() => null);\n }\n\n return Promise.resolve(null);\n }\n\n if (this.isMaxDepthExceeded()) {\n this.debug('Max depth exceeded - not running further.');\n return Promise.resolve(null);\n }\n\n if (this.hasRun) {\n // If the parent action decides to queue another action after the current tier completes execution\n // then set the hasRun to false, so the action can fire right away\n this.hasRun = false;\n this.executionParams.length = 0;\n this.currentActionsInQueue = 0;\n }\n\n this.currentActionsInQueue++;\n const isBatched = action.prototype.isBatched;\n const inputsArray = (isBatched ? inputs : [inputs]);\n\n let current = this.executionParams.find(a => a.action === action);\n if (current && isBatched) {\n current.addInputs(inputsArray);\n } else {\n const inputIdentifier = `${inputsArray[0].getCacheObjectType()}||${inputsArray[0].getCacheKey()}`;\n if (!this.cacheKeyMap.find(key => key === inputIdentifier)) {\n current = new ActionExecutor(action, inputsArray, this.telemetry, actionOption);\n this.executionParams.push(current);\n this.cacheKeyMap.push(inputIdentifier);\n }\n }\n\n const asyncResult = new AsyncResult(async (resolve, reject) => {\n if (this.currentActionsInQueue < this.expectedActionsInCurrentTier) {\n // Hold the thread until the entire tier is populated\n await new Promise((innerResolve: Function) => {\n const onEventIdCompletion = (tierNum: number) => {\n if (tierNum === this.currentExecutionTier) {\n innerResolve();\n }\n };\n EventHelper.on<[number]>(`${this.eventId}:completed`, onEventIdCompletion);\n });\n EventHelper.removeAllListeners(`${this.eventId}:completed`);\n }\n\n if (!this.hasRun) {\n await this.runAllActionsInQueue();\n }\n\n const outputs = inputsArray.map(i => {\n if (i instanceof DataServiceRequest) {\n try {\n const appCacheData = this.appCache;\n const entry = readCacheEntries(i, this.requestCache, appCacheData, false, this.requestContext, StaticTelemetry);\n return entry.entry;\n } catch (e) {\n this.debug(\n `Error execution action type '[${i && i.getCacheObjectType()}' and cache key '[{${i &&\n i.getCacheKey()}}]', returning null`\n );\n return null;\n }\n } else {\n const cacheKey = { typeName: i.getCacheObjectType(), key: i.getCacheKey() };\n const cacheItem = this.requestCache.get>(cacheKey);\n const cacheValue = !!cacheItem ? this.requestCache.getValue(cacheKey) : null;\n\n if (cacheItem && !!cacheItem.error) {\n throw cacheValue;\n } else {\n if (cacheItem && !msdyn365Commerce.isBrowser) {\n if (cacheItem.refreshStartTimeInMS) {\n verboseLogger(\n this.requestContext,\n StaticTelemetry,\n 'dataAction with {actiontype}, {cacheKey}. last refresh time {lastRefresh}',\n {\n values: [\n asSystemMetadata(i.getCacheObjectType() || 'none'),\n asSystemMetadata(i.getCacheKey()),\n asSystemMetadata(cacheItem.refreshStartTimeInMS)\n ]\n }\n );\n }\n switch (cacheItem.s!) {\n case ICacheSource.AppCache: {\n verboseLogger(\n this.requestContext,\n StaticTelemetry,\n 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}',\n {\n values: [\n asSystemMetadata(i.getCacheObjectType() || 'none'),\n asSystemMetadata(i.getCacheKey()),\n asSystemMetadata('AppCache')\n ]\n }\n );\n break;\n }\n case ICacheSource.RequestCache: {\n verboseLogger(\n this.requestContext,\n StaticTelemetry,\n 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}',\n {\n values: [\n asSystemMetadata(i.getCacheObjectType() || 'none'),\n asSystemMetadata(i.getCacheKey()),\n asSystemMetadata('RequestCache')\n ]\n }\n );\n break;\n }\n default: {\n verboseLogger(\n this.requestContext,\n StaticTelemetry,\n 'dataAction with {actiontype}, {cacheKey}. source {cacheSource}',\n {\n values: [\n asSystemMetadata(i.getCacheObjectType() || 'none'),\n asSystemMetadata(i.getCacheKey()),\n asSystemMetadata('Undefined')\n ]\n }\n );\n }\n }\n }\n return cacheValue;\n }\n }\n });\n\n this.cacheKeyMap.splice(0, this.cacheKeyMap.length);\n\n // Batched observable actions need to be merged into a single AsyncResult\n if (isBatched && action.prototype.isObservable) {\n resolve(\n Promise.all(outputs).then(results => {\n // Because AsyncResult sometimes get mangled by MobX, we need to ensure mangled ones are still unwrapped\n return results.map(result => {\n return result && result._type === 'AsyncResult' ? result.result : result;\n });\n })\n );\n } else {\n // We need to pass along the metadata explicitly to the outer AsyncResult\n if (isAsyncResult(outputs[0]) && !isBatched) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n outputs[0].then(() => {\n asyncResult.metadata = outputs[0].metadata;\n });\n }\n\n resolve(isBatched ? outputs : (outputs.length && outputs[0]) || null);\n }\n });\n\n return asyncResult;\n }\n\n /**\n * Helper method to update cache\n * @param input The input\n * @param data The data\n */\n public update(inputs: IActionInput | IActionInput[], data: T): T {\n if (inputs && data) {\n // If an array of actionInputs has been passed, an equal amount of data items must be present\n const dataArray = (Array.isArray(inputs) ? data : [data]);\n const inputArray = Array.isArray(inputs) ? inputs : [inputs];\n if (inputArray.length !== dataArray.length) {\n throw new Error('Array of action inputs was passed to actionContext Update, and did not match length of input data array.');\n }\n addLocaleInformation(inputArray, this.requestContext.locale);\n inputArray.map((i, idx) => {\n if (i instanceof DataServiceRequest) {\n try {\n const appCacheData = this.appCache;\n saveCacheEntries(i, dataArray[idx], this.requestCache, appCacheData, shouldWriteToAppCache(i, this.appCache));\n } catch (e) {\n this.debug(\n `Error in updating cache with input '[${i.getCacheObjectType()}]' - '[${i.getCacheKey()}]', returning null`\n );\n this.error(e);\n }\n } else {\n // When updating OPs, only result can be updated, passed OPs will also be unwrapped.\n if (isAsyncResult(dataArray[idx])) {\n dataArray[idx] = (>dataArray[idx]).result;\n }\n\n const cacheKey = { typeName: i.getCacheObjectType(), key: i.getCacheKey() };\n this.requestCache.put(cacheKey, { item: dataArray[idx] });\n if (this.appCache && shouldWriteToAppCache(i, this.appCache)) {\n this.appCache.put(cacheKey, { item: dataArray[idx] });\n }\n }\n });\n\n if (Array.isArray(inputs)) {\n return (inputs.map(input => {\n return this.requestCache.getValue({ typeName: input.getCacheObjectType(), key: input.getCacheKey() });\n }));\n } else {\n return this.requestCache.getValue({ typeName: inputs.getCacheObjectType(), key: inputs.getCacheKey() });\n }\n }\n\n // For scenarios where data/input was bad, we just return original data\n return data;\n }\n\n /**\n * Helper method to log trace using telemetry\n * @param message message to log to console\n */\n public trace = (message: string): void => {\n this.telemetry.log(LogLevel.Debug, 'Depth: {currentExecutionTier}\\tID: {threadId}\\tMessage: {message}', {\n values: [this.currentExecutionTier, this.threadId, message]\n });\n };\n\n /**\n * Helper method to log error using telemetry\n * @param message message to log to console\n */\n public error = (message: string): void => {\n this.telemetry.log(LogLevel.Error, 'Depth: {currentExecutionTier}\\tID: {threadId}\\tMessage: {message}', {\n values: [this.currentExecutionTier, this.threadId, message]\n });\n };\n\n /**\n * Helper method to log debug using telemetry\n * @param message message to log to console\n */\n public debug = (message: string): void => {\n this.telemetry.log(LogLevel.Debug, 'Depth: {currentExecutionTier}\\tID: {threadId}\\tMessage: {message}', {\n values: [this.currentExecutionTier, this.threadId, message]\n });\n };\n\n /**\n * Helper method to data cache from cache\n * if cachekey is null or empty, it returns all entries of cacheObjectType\n * @param cacheObjectType entity type that was cached\n * @param cacheKey cache key against which the object is cached\n * @throws if cacheObjecttype is null or empty\n */\n public get(cacheObjectType: string, cacheKey: string): T | T[] | null {\n if (!cacheObjectType) {\n throw new Error('Cannot have null or empty cacheObjectType');\n }\n\n if (!cacheKey) {\n throw new Error('Cannot have null or empty cacheKey');\n }\n\n const preparedCacheKey = { typeName: cacheObjectType, key: cacheKey };\n let cachedItem = this.requestCache.get(preparedCacheKey);\n\n if (process.env.CURRENT_ENVIRONMENT === 'node' && !cachedItem && this.appCache) {\n cachedItem = this.appCache.get(preparedCacheKey);\n }\n\n if (!cachedItem) {\n return null;\n }\n\n if (typeof cachedItem.item !== 'object' || cachedItem.item.$ref !== true) {\n return cachedItem.item;\n }\n\n return Array.isArray(cachedItem.item.key) ? (cachedItem.item.key)\n .map(key => this.getItemFromCache({ typeName: cacheObjectType, key }))\n .filter(Boolean) : null;\n }\n\n /**\n * Helper method to data cache from cache\n * if cachekey is null or empty, it returns all entries of cacheObjectType\n * @param input The input\n * @param data The data\n * @throws if cacheObjecttype is null or empty\n */\n public getAll(cacheObjectType: string): T[] | null {\n if (!cacheObjectType) {\n throw new Error('Cannot have null or empty cacheObjectType');\n }\n\n let cachedEntries = this.requestCache.getAllItems(cacheObjectType);\n if (!cachedEntries) {\n if (process.env.CURRENT_ENVIRONMENT === 'node' && this.appCache) {\n cachedEntries = this.appCache && this.appCache.getAllItems(cacheObjectType);\n }\n\n if (!cachedEntries) {\n return null;\n }\n }\n\n return Object.keys(cachedEntries)\n .filter(key => typeof cachedEntries![key].item !== 'object' || cachedEntries![key].item.$ref !== true)\n .map(key => cachedEntries![key].item);\n }\n\n /**\n * Executes all the actions in the current context in parallel\n */\n public async runAllActionsInQueue(): Promise {\n const { threadId, requestContext, requestCache, appCache, nextTierCounter, executionParams } = this;\n if (!executionParams.length) {\n this.trace('No actions to execute - not running further.');\n return;\n }\n // Increment the tier each pass through run all actions\n if (this.isMaxDepthExceeded()) {\n this.trace('Max depth exceeded - not running further.');\n return;\n }\n\n // When kicking off the next tier,\n // set the max number of chain actions the can be expected from child actions\n // equal to the number of actions that are executing in current tier\n const expectedNumberOfChildThreads = executionParams.length;\n\n let nextTierStartingDepth;\n if (this.spawnChildOnExecute) {\n nextTierStartingDepth = nextTierCounter.next + 1;\n } else {\n nextTierStartingDepth = ++nextTierCounter.next;\n }\n\n const nextTier = new ActionContext({\n id: threadId,\n requestContext: requestContext,\n requestCache: requestCache,\n appCache: appCache,\n currentExecutionTier: nextTierStartingDepth,\n expectedActionCount: expectedNumberOfChildThreads,\n telemetry: this.telemetry\n });\n\n const refreshconfigslocal: Set = new Set();\n\n nextTier.nextTierCounter = { next: nextTierStartingDepth };\n // DO NOT Trace using current action context, use only secondaryContext to remain consistent with actions\n const promises: Promise[] = executionParams.map(param => {\n // TODO: should we read from input about the cacheability?\n return param.execute(nextTier, requestCache, appCache, shouldByPassCache(this.requestContext), []).then(refreshActions => {\n // refresh the data actions which need to be refreshed.\n if (refreshActions.length) {\n refreshconfigslocal.add({\n paramExecutor: param,\n actionInputs: refreshActions\n });\n\n this.refreshConfigs.push({\n paramExecutor: param,\n actionInputs: refreshActions\n });\n\n const cacheValue = requestCache.get(REFRESH_ACTIONS_CACHE_KEY);\n const refreshConfigs = cacheValue ? cacheValue.item : [];\n refreshConfigs.push({\n paramExecutor: param,\n actionInputs: refreshActions\n });\n requestCache.put(REFRESH_ACTIONS_CACHE_KEY, {\n item: refreshConfigs\n });\n }\n\n // If the current chain action completes execution\n // decrement the max number of threads that we expect\n // from the next tier\n nextTier.expectedActionsInCurrentTier--;\n\n if (!nextTier.hasRun) {\n // First check if the next tier has any actions\n // then check if the number of thread match expected\n if (nextTier.currentActionsInQueue > 0 && nextTier.currentActionsInQueue === nextTier.expectedActionsInCurrentTier) {\n return nextTier.runAllActionsInQueue();\n }\n }\n });\n });\n\n // Wait until all the actions in current tier are run to completion\n return Promise.all(promises)\n .then(() => {\n if (refreshconfigslocal.size > 0 && requestContext.features && !!requestContext.features.disable_appcache_refresh_await) {\n refreshconfigslocal.forEach(rf => {\n const refreshRequestCache = new RequestCache();\n const refreshContext = new ActionContext({\n id: 'Refresh Context',\n requestContext: requestContext,\n requestCache: new RequestCache(),\n telemetry: this.telemetry,\n appCache: appCache,\n spawnChildOnExecute: true\n });\n\n rf.paramExecutor\n .execute(\n refreshContext,\n refreshRequestCache,\n this.appCache,\n shouldByPassCache(this.requestContext),\n rf.actionInputs\n )\n .then(() =>\n verboseLogger(\n this.requestContext,\n StaticTelemetry,\n `BackgroundRefresh - Executed refresh with action input ${rf.actionInputs[0].getCacheObjectType()}-${rf.actionInputs[0].getCacheKey()}`\n )\n )\n .catch(error => {\n StaticTelemetry.log(\n LogLevel.Warning,\n `BackgroundRefresh - Error execution refresh with action input ${rf.actionInputs[0].getCacheObjectType()}-${rf.actionInputs[0].getCacheKey()}`\n );\n });\n });\n }\n this._endCurrentTier();\n })\n .catch(error => {\n this._endCurrentTier();\n throw error;\n });\n }\n\n /**\n * Returns true if current tier has exceeded max depth\n */\n private isMaxDepthExceeded = (): boolean => {\n const maxDepth =\n (this.requestContext &&\n this.requestContext.app &&\n this.requestContext.app.platform &&\n this.requestContext.app.platform.maxDepth) ||\n ActionContext.maxDepth;\n return this.nextTierCounter.next > maxDepth;\n };\n\n /**\n * Retrieves item from request cache and fallsback to app cache if not found\n */\n private getItemFromCache = (cacheKey: ICacheKey): T | undefined => {\n let cachedItem = this.requestCache.get(cacheKey);\n\n if (cachedItem) {\n return cachedItem.item;\n }\n\n if (process.env.CURRENT_ENVIRONMENT === 'node' && this.appCache) {\n cachedItem = this.appCache.get(cacheKey);\n }\n\n return cachedItem ? cachedItem.item : undefined;\n };\n\n /**\n * Signals the end of current tier so actions can return the response\n */\n private _endCurrentTier = (): void => {\n this.hasRun = true;\n EventHelper.emit(`${this.eventId}:completed`, this.currentExecutionTier);\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n generateImageUrlForOmniChanel,\n IAction,\n IActionContext,\n IActionInput,\n IRequestContext,\n versionGte\n} from '@msdyn365-commerce/core-internal';\nimport { getMediaLocationsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\n// @ts-ignore\nimport { MediaLocation, MediaType } from '@msdyn365-commerce/retail-proxy';\nimport { createObservableDataAction } from '../create-data-action.vnext';\n\n/**\n * The action input class for the getMediaLocationsForSelectedVariant data action.\n */\nexport class MediaLocationsInput implements IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public catalogId: number;\n\n private readonly locale?: string;\n\n constructor(context: IRequestContext, productId: number, channelId: number, catalogId?: number) {\n this.productId = productId;\n this.channelId = channelId;\n this.catalogId = catalogId || 0;\n this.locale = context.locale;\n }\n\n public getCacheKey = () => `${this.productId}-${this.channelId}-${this.catalogId}-${this.locale}}`;\n\n public getCacheObjectType = () => 'ProductMediaLocations';\n\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * The action method for the getMediaLocationsForSelectedVariant data action.\n * @param input\n * @param ctx\n */\nexport async function getMediaLocationsForProductAction(input: MediaLocationsInput, ctx: IActionContext): Promise {\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const OmniChannelMediaFeatureVersion = versionGte(rsVersion, '9.43');\n if (!OmniChannelMediaFeatureVersion) {\n return [];\n }\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- Need for Omni feature.,\n const types = require('@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g');\n\n // TODO: once the dynamicProvider api for fetching the media locations from the azureCms is implemented\n // we should uncomment these code so we can preview the product in edit mode without publish the product.\n // if (ctx.requestContext.params && ctx.requestContext.params.isEditor) {\n // return getOmniChannelMediaInfoAsync(ctx.requestContext, input.productId);\n // }\n\n let productMediaLocations = [];\n try {\n productMediaLocations = await getMediaLocationsAsync(\n {\n callerContext: ctx,\n queryResultSettings: {\n Paging: { Top: Number.parseInt(ctx.requestContext?.app?.platform?.defaultPageSizeForAPI ?? 100, 10) }\n }\n },\n input.productId,\n input.channelId,\n input.catalogId\n );\n } catch (error) {\n ctx.telemetry.error(`Error running getMediaLocationsAsync action: ${error}`);\n return [];\n }\n\n // Filtering product images and videos only\n let productImagesAndVideos = productMediaLocations.filter(\n // @ts-ignore\n media => media.MediaTypeValue === types.MediaType.Image || media.MediaTypeValue === types.MediaType.Video\n );\n if (productImagesAndVideos.length === 0) {\n return [];\n }\n\n // sorting the images by display order settings.\n productImagesAndVideos = productImagesAndVideos.sort((a, b) => {\n // @ts-ignore\n if (typeof a.DisplayOrder === 'undefined' && typeof b.DisplayOrder === 'undefined') {\n return 0;\n // @ts-ignore\n } else if (typeof a.DisplayOrder === 'undefined') {\n return 1;\n // @ts-ignore\n } else if (typeof b.DisplayOrder === 'undefined') {\n return -1;\n } else {\n // @ts-ignore\n return a.DisplayOrder - b.DisplayOrder;\n }\n });\n const productMedia = productImagesAndVideos.map((mediaLocation: MediaLocation) => {\n const mediaLoc = { ...mediaLocation };\n // @ts-ignore\n if (mediaLoc.MediaTypeValue === types.MediaType.Image) {\n mediaLoc.Uri = generateImageUrlForOmniChanel(ctx.requestContext.apiSettings, mediaLocation.Uri);\n }\n return mediaLoc;\n });\n\n return productMedia;\n}\n\n/**\n * The getMediaLocationsForSelectedVariant data action\n * Gets the currently selected variant for the page via the getSelectedVariant data action,\n * and then gets the media location information for the variant via the MediaLocations RetailServer API.\n */\nexport const getMediaLocationsForSelectedVariantActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/get-mediaLocations',\n action: >getMediaLocationsForProductAction\n});\n\nexport default getMediaLocationsForProductAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n generateImageUrlForOmniChanel,\n IAction,\n IActionContext,\n IActionInput,\n IRequestContext,\n versionGte\n} from '@msdyn365-commerce/core-internal';\n// @ts-ignore\nimport { MediaLocation, MediaType } from '@msdyn365-commerce/retail-proxy';\nimport { createObservableDataAction } from '../create-data-action.vnext';\n\nexport enum MediaLocationType {\n All,\n Image,\n Video,\n File\n}\n\n/**\n * The action input class for the getAdditionalMediaLocationsForSelectedVariant data action.\n */\nexport class AdditionalMediaLocationsInput implements IActionInput {\n public productId: number;\n\n public channelId: number;\n\n public catalogId: number;\n\n // defaulting to image for backwards compatibility, old version filters Image by default.\n public typeFilter: MediaLocationType;\n\n private readonly locale?: string;\n\n constructor(context: IRequestContext, productId: number, channelId: number, catalogId?: number, typeFilter = MediaLocationType.All) {\n this.productId = productId;\n this.channelId = channelId;\n this.catalogId = catalogId || 0;\n this.typeFilter = typeFilter;\n this.locale = context.locale;\n }\n\n public getCacheKey = () => `${this.productId}-${this.channelId}-${this.catalogId}-${this.locale}}-${this.typeFilter}`;\n\n public getCacheObjectType = () => 'ProductAdditionalMediaLocations';\n\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * The action method for the getAdditionalMediaLocationsForSelectedVariant data action.\n * @param input\n * @param ctx\n */\nexport async function getAdditionalMediaLocationsForProductAction(\n input: AdditionalMediaLocationsInput,\n ctx: IActionContext\n): Promise {\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const OmniChannelAdditionalMediaFeatureVersion = versionGte(rsVersion, '9.46');\n if (!OmniChannelAdditionalMediaFeatureVersion) {\n return [];\n }\n // the types and productActions are not available in all versions of retail-proxy, so they are imported by direct reference after comparing the version to the minimum required(9.46)\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- Need for Omni feature.,\n const types = require('@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g');\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- Need for Omni feature.,\n const productActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g');\n\n // TODO: once the dynamicProvider api for fetching the media locations from the azureCms is implemented\n // we should uncomment these code so we can preview the product in edit mode without publish the product.\n // if (ctx.requestContext.params && ctx.requestContext.params.isEditor) {\n // return getOmniChannelMediaInfoAsync(ctx.requestContext, input.productId);\n // }\n\n let productMediaLocations = [];\n try {\n productMediaLocations = await productActions.searchMediaLocationsAsync(\n {\n callerContext: ctx,\n queryResultSettings: {\n Paging: { Top: Number.parseInt(ctx.requestContext?.app?.platform?.defaultPageSizeForAPI ?? 100, 10) }\n }\n },\n {\n ProductId: input.productId,\n ChannelId: input.channelId,\n CatalogId: input.catalogId,\n MediaUsageTypeValue: 1\n }\n );\n } catch (error) {\n ctx.telemetry.error(`Error running searchMediaLocationsAsync action: ${error}`);\n return [];\n }\n\n // Need to add a second enum for MediaTypeValue because the RetailServer API returns a different enum for the MediaTypeValue property,\n // where default is \"None\" instead of \"All\"\n let filteredMedia: MediaLocation[] = [];\n switch (input.typeFilter) {\n case MediaLocationType.Image:\n // @ts-ignore\n filteredMedia = productMediaLocations.filter(media => media.MediaTypeValue === types.MediaType.Image);\n break;\n case MediaLocationType.Video:\n // @ts-ignore\n filteredMedia = productMediaLocations.filter(media => media.MediaTypeValue === types.MediaType.Video);\n break;\n case MediaLocationType.File:\n // @ts-ignore\n filteredMedia = productMediaLocations.filter(media => media.MediaTypeValue === types.MediaType.File);\n break;\n default:\n filteredMedia = productMediaLocations;\n }\n if (filteredMedia.length === 0) {\n return [];\n }\n\n // sorting the images by display order settings.\n filteredMedia = filteredMedia.sort((a, b) => {\n // @ts-ignore\n if (typeof a.DisplayOrder === 'undefined' && typeof b.DisplayOrder === 'undefined') {\n return 0;\n // @ts-ignore\n } else if (typeof a.DisplayOrder === 'undefined') {\n return 1;\n // @ts-ignore\n } else if (typeof b.DisplayOrder === 'undefined') {\n return -1;\n } else {\n // @ts-ignore\n return a.DisplayOrder - b.DisplayOrder;\n }\n });\n const productMedia = filteredMedia.map((mediaLocation: MediaLocation) => {\n mediaLocation.Uri = generateImageUrlForOmniChanel(ctx.requestContext.apiSettings, mediaLocation.Uri);\n mediaLocation.AltText = mediaLocation.AltText;\n return mediaLocation;\n });\n return productMedia;\n}\n\n/**\n * The getAdditionalMediaLocationsForSelectedVariantActionDataAction data action\n * Gets the currently selected variant for the page via the getSelectedVariant data action,\n * and then gets the media location information for the variant via the MediaLocations RetailServer API.\n */\nexport const getAdditionalMediaLocationsForSelectedVariantActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/get-additional-mediaLocations',\n action: >getAdditionalMediaLocationsForProductAction\n});\n\nexport default getAdditionalMediaLocationsForProductAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core-internal';\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport { readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CustomersDataActions.g';\nimport { createObservableDataAction } from '../create-data-action.vnext';\n\n/**\n * Input class for get customer data action.\n */\nexport class GetCustomerInput implements IActionInput {\n public customerAccountNumber?: string;\n\n private readonly apiSettings: ICommerceApiSettings;\n\n private readonly cacheType?: CacheType;\n\n public constructor(apiSettings: ICommerceApiSettings, accountNumber?: string, cacheType?: CacheType) {\n this.customerAccountNumber = accountNumber;\n this.apiSettings = apiSettings;\n this.cacheType = cacheType;\n }\n\n /**\n * GetCacheKey.\n * @returns - Returns string.\n */\n public getCacheKey = (): string => `Customer-${this.customerAccountNumber}-chanId:${this.apiSettings.channelId}`;\n\n /**\n * GetCacheObjectType.\n * @returns - Cache Object Type string.\n */\n public getCacheObjectType = (): string => 'Customer';\n\n /**\n * DataCacheType.\n * @returns - CacheType string.\n */\n public dataCacheType = (): CacheType => {\n return this.cacheType ? this.cacheType : 'request';\n };\n}\n\n/**\n * Creates the input required to make the retail api call.\n * @param inputData -- The input data passed to the createInput method.\n * @returns - GetCustomer input.\n */\nexport const createGetCustomerInput = (inputData: ICreateActionContext>): GetCustomerInput => {\n const { user, apiSettings } = inputData.requestContext;\n if (!user.token || !user.isAuthenticated) {\n throw new Error('[getCustomer][createInput]: User is not Authenticated.');\n }\n\n return new GetCustomerInput(apiSettings);\n};\n\n/**\n * GetCustomerAction.\n * @param input - GetCustomerInput.\n * @param ctx - Action Context.\n * @returns - Customer information.\n */\nconst getCustomerAction = async (input: GetCustomerInput, ctx: IActionContext): Promise => {\n if (input && ctx.requestContext.user.isAuthenticated) {\n try {\n return readAsync({ callerContext: ctx, bypassCache: 'get' }, '').then(response => {\n return Array.isArray(response) ? response[0] : response;\n });\n } catch (error) {\n ctx.telemetry.error(`Error running getCustomer action: ${error}`);\n return {};\n }\n }\n\n ctx.telemetry.warning('[getCustomer]Invalid input passed to action');\n return {};\n};\n\n/**\n * The customer data action.\n */\nexport const getCustomerActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce/get-customer',\n action: >getCustomerAction,\n input: createGetCustomerInput\n});\n\nexport default getCustomerActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IDictionary } from '@msdyn365-commerce/core-internal';\n\nexport enum ICacheSource {\n RequestCache,\n AppCache\n}\n\nexport interface ICacheKey {\n key: string;\n typeName: string;\n}\n\nexport interface ICacheItem {\n item: T;\n shouldRefresh?: boolean;\n error?: boolean;\n instance?: string;\n // property to indicate the source whether it is app/request\n s?: ICacheSource;\n /**\n * Flag to track the when the item start refreshing.\n */\n refreshStartTimeInMS?: number;\n lastRefreshTime?: Date;\n}\n\nexport interface ICompressCache {\n data: T;\n isCompressed: boolean;\n}\n\nexport interface ICacheItemOptions {\n ttr?: number;\n ttl?: number;\n cacheKeySuffix?: string;\n}\nexport interface ICacheStats {\n keys?: number;\n hits?: number;\n misses?: number;\n totalKeySize?: number;\n totalValueSize?: number;\n valueSizePerKey?: object;\n}\n\n/**\n * Interface exposing methods for caching\n */\nexport interface ICache {\n /**\n * @function {put} - Method to insert an item in the cache\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @param cacheItem {ICacheItem} - item that needs to be inserted in the cache\n * @param options {ICacheItemOptions} - Optional cache item options\n */\n put(cacheKey: ICacheKey, item: ICacheItem, options?: ICacheItemOptions): boolean;\n\n /**\n * @function {get} - Method to get the cached item\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @return {ICacheItem} - cached value against the given cache key\n */\n get(cacheKey: ICacheKey): ICacheItem | undefined;\n\n /**\n * @function {getValue} - Method to get the cached item\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @return {T} - cached value against the given cache key\n */\n getValue(cacheKey: ICacheKey): T | undefined;\n\n /**\n * @function {getAllItems} - Method to get all cached items for a given type\n * @param typeName {typeName} - typeName for which all items need to be fetched\n * @return {ICacheItem} - dictionary of cache items of the given typeName\n */\n getAllItems(typeName: string): IDictionary> | undefined;\n\n /**\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @param toCache {ICache} - cache object to which the item needs to be copied\n * @return {ICacheItem} - cache item that was copied\n */\n copyTo(cacheKey: ICacheKey, toCache: ICache, isObservable?: boolean): ICacheItem | undefined;\n\n /**\n * @function {del} - Method to delete an item from the cache\n * @param key {ICacheKey[]} - Array of ICacheGetData items whose values need to be deleted from cache\n * @return {number} - returns true if the cache key is deleted successfully. Does not throw errors.\n */\n del(cacheKey: ICacheKey): boolean;\n\n /**\n * @function {flushAll} - Method to flush all data from the cache\n */\n flushAll(): void;\n\n /**\n * @function {getStats} - Returns statstics about the cache (number of keys, value size in bytes, etc)\n */\n getStats?(): ICacheStats;\n\n /**\n * @function {flushStats} - Flush the stats\n */\n flushStats?(): void;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICacheKey } from './ICache';\n\nexport const MODULE_CSS_CACHE_KEY = 'MODULE-CSS-CHUNKS';\nexport const MODULE_CSS_CACHE_TYPENAME = '__MODULECSSCHUNKS__';\n\nexport const normalizeCacheKey = (cacheKey: ICacheKey): ICacheKey => {\n return {\n typeName: cacheKey.typeName.toUpperCase(),\n key: cacheKey.key.toUpperCase()\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IDictionary } from '@msdyn365-commerce/core-internal';\nimport { isAsyncResult } from '@msdyn365-commerce/retail-proxy';\nimport { observable, set, transaction } from 'mobx';\nimport { normalizeCacheKey } from './cache-utils';\nimport { ICache, ICacheItem, ICacheKey, ICacheSource } from './ICache';\n\n/**\n * Client cache implementation\n */\nexport class RequestCache implements ICache {\n private internalCache: { [typeName: string]: IDictionary> } = {};\n\n /**\n * @function {put} - Method to insert an item in the cache\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @param cacheItem {ICacheItem} - item that needs to be inserted in the cache\n */\n public put(cacheKey: ICacheKey, item: ICacheItem): boolean {\n if (!cacheKey.typeName) {\n throw new Error(`Invalid type (${cacheKey.typeName} specified)`);\n }\n\n if (!cacheKey.key) {\n throw new Error(`Invalid key (${cacheKey.key} specified) for typeName: ${cacheKey.typeName}`);\n }\n\n item.s = item.s !== undefined ? item.s : ICacheSource.RequestCache;\n const { typeName, key } = normalizeCacheKey(cacheKey);\n if (this.internalCache[typeName] === undefined) {\n this.internalCache[typeName] = {};\n }\n return transaction(() => {\n let cacheItem: ICacheItem = >this.internalCache[typeName][key];\n\n // For updating AsyncResults, only update result\n if (cacheItem && isAsyncResult(cacheItem.item)) {\n if (cacheItem.item.status !== 'LOADING') {\n set(cacheItem.item, 'status', 'LOADING');\n }\n set(cacheItem.item, 'result', item.item);\n // Auto resolve promises whos result is being set, as they are essentially being force-completed\n set(cacheItem.item, 'status', 'SUCCESS');\n } else if (cacheItem) {\n set(cacheItem, 'item', item.item);\n } else {\n if (!isAsyncResult(item.item)) {\n cacheItem = observable>({ ...item }, undefined, {\n deep: true,\n name: `T:${typeName}_K:${key}`\n });\n } else {\n cacheItem = item;\n }\n this.internalCache[typeName][key] = cacheItem;\n }\n\n return true;\n });\n }\n\n /**\n * @function {get} - Method to get the cached item\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @return {IAny} - cached value against the given cache key\n */\n public get(cacheKey: ICacheKey): ICacheItem | undefined {\n if (!cacheKey) {\n throw new Error(`Invalid cacheKey: ${cacheKey}`);\n }\n\n if (!cacheKey.typeName) {\n throw new Error(`Invalid cacheKey type: ${cacheKey.typeName}`);\n }\n\n cacheKey = normalizeCacheKey(cacheKey);\n return this.internalCache[cacheKey.typeName] ? >this.internalCache[cacheKey.typeName][cacheKey.key] : undefined;\n }\n\n /**\n * @function {get} - Method to get the cached item\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @return {IAny} - cached value against the given cache key\n */\n public getAllItems(typeName: string): IDictionary> | undefined {\n if (!typeName) {\n throw new Error(`typeName cannot be empty`);\n }\n\n return >>this.internalCache[typeName.toUpperCase()];\n }\n\n /**\n * @function {getValue} - Method to get the cached item\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @return {IAny} - cached value against the given cache key\n */\n public getValue(cacheKey: ICacheKey): T | undefined {\n const cachedItem: ICacheItem | undefined = this.get(cacheKey);\n return cachedItem ? this._value(cachedItem) : undefined;\n }\n\n /**\n * @param cacheKey {ICacheKey} - object to build the cache key\n * @param toCache {ICache} - cache object to which the item needs to be copied\n * @return {ICacheItem} - cache item that was copied\n */\n public copyTo(cacheKey: ICacheKey, toCache: ICache): ICacheItem | undefined {\n throw new Error('Not Implemented');\n }\n\n /**\n * @function {del} - Method to delete an item from the cache\n * @param key {ICacheKey} - Array of ICacheGetData items whose values need to be deleted from cache\n * @return {number} - returns true if the cache key is deleted successfully. Does not throw errors.\n */\n public del(cacheKey: ICacheKey): boolean {\n cacheKey = normalizeCacheKey(cacheKey);\n const cacheType = this.internalCache[cacheKey.typeName];\n if (cacheType && cacheType[cacheKey.key]) {\n delete cacheType[cacheKey.key];\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @function {flushAll} - Method to flush all data from the cache\n */\n public flushAll(): void {\n this.internalCache = {};\n }\n\n /**\n * @function {keys} - Method to fetch all the keys in the cache\n * @return {string[]} - returns a list of all the keys in the cache\n */\n public keys(): string[] {\n return Object.keys(this.internalCache);\n }\n\n /**\n * Get the value out of a cache item\n * This returns the raw value of the item, it will *not* be a MobX observable value\n * @param item The observable cache item to retireve the value from\n */\n private _value(item: ICacheItem): T {\n return item.item;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport * from './create-data-action';\nexport * from './create-data-action.vnext';\nexport * from './create-data-action-hook';\nexport * from './action-context';\nexport * from './action-executor';\nexport * from './cache/client-cache';\nexport * from './cache/simple-cache';\nexport * from './event-emitter';\nexport * from './mock-helper';\nexport * from './cache/retail-cache-helper';\nexport * from './action-registrar';\nexport * from './helpers';\nexport * from './actions/get-media-locations';\nexport * from './actions/get-additional-media-locations';\nexport * from './actions/get-customer';\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","'use strict';\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (O, P) {\n if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));\n};\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n","'use strict';\nvar UA = require('../internals/engine-user-agent');\n\nmodule.exports = /MSIE|Trident/.test(UA);\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\nvar webkit = userAgent.match(/AppleWebKit\\/(\\d+)\\./);\n\nmodule.exports = !!webkit && +webkit[1];\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar deletePropertyOrThrow = require('../internals/delete-property-or-throw');\nvar toString = require('../internals/to-string');\nvar fails = require('../internals/fails');\nvar internalSort = require('../internals/array-sort');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar FF = require('../internals/engine-ff-version');\nvar IE_OR_EDGE = require('../internals/engine-is-ie-or-edge');\nvar V8 = require('../internals/engine-v8-version');\nvar WEBKIT = require('../internals/engine-webkit-version');\n\nvar test = [];\nvar nativeSort = uncurryThis(test.sort);\nvar push = uncurryThis(test.push);\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar STRICT_METHOD = arrayMethodIsStrict('sort');\n\nvar STABLE_SORT = !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 70;\n if (FF && FF > 3) return;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 603;\n\n var result = '';\n var code, chr, value, index;\n\n // generate an array with more 512 elements (Chakra and old V8 fails only in this case)\n for (code = 65; code < 76; code++) {\n chr = String.fromCharCode(code);\n\n switch (code) {\n case 66: case 69: case 70: case 72: value = 3; break;\n case 68: case 71: value = 4; break;\n default: value = 2;\n }\n\n for (index = 0; index < 47; index++) {\n test.push({ k: chr + index, v: value });\n }\n }\n\n test.sort(function (a, b) { return b.v - a.v; });\n\n for (index = 0; index < test.length; index++) {\n chr = test[index].k.charAt(0);\n if (result.charAt(result.length - 1) !== chr) result += chr;\n }\n\n return result !== 'DGBEFHACIJK';\n});\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (y === undefined) return -1;\n if (x === undefined) return 1;\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n return toString(x) > toString(y) ? 1 : -1;\n };\n};\n\n// `Array.prototype.sort` method\n// https://tc39.es/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n if (comparefn !== undefined) aCallable(comparefn);\n\n var array = toObject(this);\n\n if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);\n\n var items = [];\n var arrayLength = lengthOfArrayLike(array);\n var itemsLength, index;\n\n for (index = 0; index < arrayLength; index++) {\n if (index in array) push(items, array[index]);\n }\n\n internalSort(items, getSortCompare(comparefn));\n\n itemsLength = lengthOfArrayLike(items);\n index = 0;\n\n while (index < itemsLength) array[index] = items[index++];\n while (index < arrayLength) deletePropertyOrThrow(array, index++);\n\n return array;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar fails = require('../internals/fails');\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar speciesConstructor = require('../internals/species-constructor');\nvar promiseResolve = require('../internals/promise-resolve');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\n\n// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829\nvar NON_GENERIC = !!NativePromiseConstructor && fails(function () {\n // eslint-disable-next-line unicorn/no-thenable -- required for testing\n NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });\n});\n\n// `Promise.prototype.finally` method\n// https://tc39.es/ecma262/#sec-promise.prototype.finally\n$({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {\n 'finally': function (onFinally) {\n var C = speciesConstructor(this, getBuiltIn('Promise'));\n var isFunction = isCallable(onFinally);\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n }\n});\n\n// makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`\nif (!IS_PURE && isCallable(NativePromiseConstructor)) {\n var method = getBuiltIn('Promise').prototype['finally'];\n if (NativePromisePrototype['finally'] !== method) {\n defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });\n }\n}\n"],"names":["DEPRECATED_HOOK_TYPES","ActionRegistrar","dataActionRegister","getRegistration","id","msdyn365Commerce","getPartnerOverrideAction","partnerDataAction","default","action","prototype","Action","unwrapAction","isAction","getAction","registeredAction","registerAction","dataAction","actionRegister","registration","registerHook","hookType","hook","isBrowser","indexOf","StaticTelemetry","log","LogLevel","Warning","hooks","Array","isArray","hookRegistration","Set","forEach","h","add","newRegistration","registerPostHook","registerPreHook","registerPreReadOnlyHook","registerPostReadOnlyHook","registerPreReaderHook","registerPostReaderHook","getPreHooks","actionRegistration","pre","getPostHooks","post","getPreReadHooks","preRead","getPostReadHooks","postRead","getPreReaderHooks","preReader","getPostReaderHooks","postReader","resolveAction","resolveRegistration","preHooks","postHooks","preReadHooks","postReadHooks","preReaderHooks","postReaderHooks","createObservableDataAction","options","wrappedAction","wrapDataAction","actionWrap","Error","input","name","inputFunc","isBatched","_action","RegistrationId","registrationId","func","_isBatched","newAction","_objectSpread","setProperty","propertyName","value","arg1","arg2","AsyncResult","resolve","reject","chainAction","then","result","catch","error","ActionError","constructor","super","this","Name","message","status","Object","setPrototypeOf","static","shouldReadFromAppCache","appCache","undefined","dataCacheType","shouldWriteToAppCache","isAppCacheData","hasCacheSetting","getCacheObjectType","GET_FROM_RETURNIDENTIFIER","addLocaleInformation","inputs","locale","DataServiceRequest","getCacheKey","endsWith","tmp","_cacheKeyFromInput","_resolveCacheEntryReference","dataServiceRequest","item","requestCache","isWrappingPromise","isObservable","arguments","length","cacheValueAsArray","key","map","cacheObjectType","_cacheObjectType","get","typeName","copyTo","valueItem","isAsyncResult","filter","data","isReturnTypeACollection","_query","logTelemetrySource","cacheValue","cacheKey","context","telemetry","s","ICacheSource","AppCache","verboseLogger","values","RequestCache","readCacheEntriesBasedOnCacheKeyFromReturnType","cacheKeyFromReturnType","_cacheKeyFromReturnType","cacheKeyIdentifierFromReturnType","_cacheKeyIdentifierFromReturnType","entry","shouldRefresh","shouldRefreshAll","cacheEntries","Boolean","cacheEntriesReturn","readCacheEntries","cacheKeyFromInput","entries","cachedValueBasedOnInput","$ref","cachedValueBasedOnInputItem","resolvedRef","_saveEntityToCache","isCacheTypeApplication","isInstance","dataServiceRequestQuery","results","toString","call","identifierValue","existingCacheItem","existingCacheObjectType","existingCacheKeyIdentifierFromReturnType","existingCacheIsReturnTypeACollection","existingCacheTotalCount","_totalCount","type","identifier","isCollection","count","_existingCacheItem","keys","entryKey","put","instance","saveCacheEntries","metadata","_otherOdata","others","listeners","Map","eventEmitter","window","EventEmitter","on","event","callback","set","push","emit","_len","args","_key","listener","removeAllListeners","delete","defaultHookTimeoutInMS","CLIENT_HYDRATE_KEY","CLIENT_HYDRATE_TYPE","Timer","timeoutInMS","Promise","setTimeout","bind","ActionTimer","_resolve","ActionExecutor","dataActionOption","_shouldUseInstanceCache","_msdyn365Commerce$pla","checkVersionForFeature","platformSettings","shouldUseInstanceCache","eventId","uuidv1","masterInput","cacheType","shouldCacheOutput","trace","addInputs","async","bypassAppCache","refreshingInputs","unique","_removeDuplicates","actionId","_getActionIdFromInputs","performanceUtils","getPerformanceUtils","executionId","performanceUtilsPackage","Random","Guid","generateGuid","runPreReadonlyDataActionPerformanceHook","internalCache","cache","_executeDataAction","runPostReadonlyDataActionPerformanceHook","isRefreshingAction","_runPreReadHooks","err","_runPreReaderHooks","uncached","needsRefresh","_checkForCachedData","_fetchOutputsAndRunPostReadHook","cachedActions","includes","outputs","_executeBatchedObservableActions","_executeObservableAction","_actionWrapper","Trace","_saveResponseToCache","_checkShouldInteractWithCache","i","cacheItem","getValue","_runPostReadHooks","_runPostReaderHooks","_uniqWith","inputA","inputB","inputsActionId","getActionId","_getActionFromId","hookTimeout","Number","_get2","timer","from","reduce","previousTask","currentTask","race","requestContext","asSystemMetadata","exception","actionResult","prevInput","tmpNextInput","finalNextInput","prevOutput","tmpNextOutput","finalNextOutput","isRefreshing","_inputs","_runPreHooks","e","convertedError","_convertToJSError","CorrelationId","serverSideDataActionTimeoutInMs","clientSideCustomerTimeout","clientSideDataActionTimeoutInMs","promises","_errorCode","ErrorTypeEnum","SERVICE_UNAVAILABLE","ProxyError","toError","_runPostHooks","idx","appCacheData","usingInstanceCache","features","disable_instance_cache","actionName","entityId","entityType","isActionError","isTimeoutError","cacheEntry","assign","unresolvedSet","uncachedInputs","asyncOutputs","index","executor","innerResolve","innerReject","EventHelper","onEventIdFinalCompletion","cachedPromise","run","actionResults","finally","unresolvedIndex","isServiceUnavailable","cachedItem","asyncOutput","bypassCache","refreshing","_interceptCacheForMocks","clientHydrateCacheKey","isClientHydrate","runOn","refresh","disable_bypass_request_cache","existingItem","mockItem","_getMockItem","mockItemJSObject","toJS","cacheNamespace","proxyError","ErrorCode","CatalogsInput","customerAccountNumber","buildCacheKey","base","channelId","apiSettings","catalogId","user","getCatalogsAsync","callerContext","createCatalogsInput","inputData","isAuthenticated","shouldByPassCache","query","cachebypass","isPageInsightsEnabled","params","pageInsights","REFRESH_ACTIONS_CACHE_KEY","ActionContext","executionParams","cacheKeyMap","refreshConfigs","hasRun","currentActionsInQueue","nextTierCounter","next","spawnChildOnExecute","Debug","currentExecutionTier","threadId","debug","isMaxDepthExceeded","maxDepth","app","platform","getItemFromCache","_endCurrentTier","expectedActionCount","expectedActionsInCurrentTier","moduleTelemetry","Telemetry","isDebug","registerTraceLogger","traceLogger","GenericConsoleLogger","disable_app_cache","getRefreshActions","actionOption","runAllActionsInQueue","inputsArray","current","find","a","inputIdentifier","asyncResult","tierNum","refreshStartTimeInMS","splice","all","_type","update","dataArray","inputArray","preparedCacheKey","getAll","cachedEntries","getAllItems","expectedNumberOfChildThreads","nextTierStartingDepth","nextTier","refreshconfigslocal","param","execute","refreshActions","paramExecutor","actionInputs","size","disable_appcache_refresh_await","rf","refreshRequestCache","refreshContext","getMediaLocationsForProductAction","ctx","versionGte","process","types","require","productMediaLocations","_ctx$requestContext$a","_ctx$requestContext","getMediaLocationsAsync","queryResultSettings","Paging","Top","parseInt","defaultPageSizeForAPI","productId","productImagesAndVideos","media","MediaTypeValue","MediaType","Image","Video","sort","b","DisplayOrder","productMedia","mediaLocation","mediaLoc","Uri","generateImageUrlForOmniChanel","MediaLocationType","getAdditionalMediaLocationsForProductAction","productActions","searchMediaLocationsAsync","ProductId","ChannelId","CatalogId","MediaUsageTypeValue","filteredMedia","typeFilter","File","AltText","GetCustomerInput","accountNumber","getCustomerActionDataAction","readAsync","response","warning","token","normalizeCacheKey","toUpperCase","transaction","observable","deep","_value","toCache","del","flushAll","byteToHex","substr","module","exports","buf","offset","bth","join","getRandomValues","crypto","msCrypto","rnds8","Uint8Array","rnds","r","Math","random","_nodeId","_clockseq","rng","bytesToUuid","_lastMSecs","_lastNSecs","node","clockseq","seedBytes","msecs","Date","getTime","nsecs","dt","tl","tmh","n","tryToString","$TypeError","TypeError","O","P","firefox","match","UA","test","webkit","$","uncurryThis","aCallable","toObject","lengthOfArrayLike","deletePropertyOrThrow","fails","internalSort","arrayMethodIsStrict","FF","IE_OR_EDGE","V8","WEBKIT","nativeSort","FAILS_ON_UNDEFINED","FAILS_ON_NULL","STRICT_METHOD","STABLE_SORT","code","chr","String","fromCharCode","k","v","charAt","target","proto","forced","comparefn","array","itemsLength","items","arrayLength","x","y","getSortCompare","IS_PURE","NativePromiseConstructor","getBuiltIn","isCallable","speciesConstructor","promiseResolve","defineBuiltIn","NativePromisePrototype","real","onFinally","C","isFunction","method","unsafe"],"sourceRoot":""}