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,SAASyc,QAAU,OAI9DJ,GAAY,EAEpB,CAEA,GAAIP,IAAgBD,GACbI,IAAqBE,IACpBE,EACJ,MAAO,CACHvB,WAAW,EACXI,WAAW,EACXH,YAAa,wEACbI,aAAc,CACVC,gBAAgB,EAChBC,qBAAqB,EACrBC,mBAAmB,EACnBC,eAAe,GAEnBP,0BAA2B,GAGnC,MAAMI,EAAiBU,IAAgBD,EACjCR,EAAsBY,IAAqBE,EAGjD,OAFAhJ,EAAiBR,QAAQ,iBAAkB,GAAGnM,KAAKwG,SAASoO,KAAkBC,IAAsBlW,EAA0B,IAAIkX,IAAc,MAEzI,CACHvB,WAAW,EACXI,WAAW,EACXH,YAAa,wCACbI,aAAc,CACVC,eAAgBU,IAAgBD,EAChCR,oBAAqBY,IAAqBE,EAC1Cb,kBAAmBW,IAAqBE,EACxCZ,cAAec,GAEnBrB,0BAA2B,EAEnC,CACA,MAAOlY,GAQH,OAPAW,EAAoBD,EAAwB,CACxC0G,MAAO3G,EAAwBiY,OAC/BvV,QAAS,sCAAsCnD,IAC/CsH,MAAO,CACHkP,WAAYjU,KAGb,CACHyV,WAAW,EACXC,YAAa,yBAAyBjY,IACtCkY,0BAA2B,EAEnC,CACJ,C","sources":["webpack://@msnews/shared-widgets/webpack/bootstrap","webpack://@msnews/shared-widgets/webpack/runtime/define property getters","webpack://@msnews/shared-widgets/webpack/runtime/global","webpack://@msnews/shared-widgets/webpack/runtime/hasOwnProperty shorthand","webpack://@msnews/shared-widgets/../../libs/isomorphic-util/dist/DOMHelpersCore.js","webpack://@msnews/shared-widgets/../../libs/isomorphic-util/dist/IsomorphicStorage.js","webpack://@msnews/shared-widgets/../../libs/isomorphic-util/dist/requestData.js","webpack://@msnews/shared-widgets/../../libs/isomorphic-util/dist/SSRInteropContract.js","webpack://@msnews/shared-widgets/../../libs/isomorphic-util/dist/DOMHelpers.js","webpack://@msnews/shared-widgets/../../libs/experiences-constants/dist/AuthCookieNames.js","webpack://@msnews/shared-widgets/../../libs/core-helper/dist/GetCookieCore.js","webpack://@msnews/shared-widgets/../../libs/core-helper/dist/TryParseJson.js","webpack://@msnews/shared-widgets/../../libs/experiences-constants/dist/Flights.js","webpack://@msnews/shared-widgets/../../libs/experimentation-helpers/dist/GetPeregrineFlights.js","webpack://@msnews/shared-widgets/../../libs/inline-head-common/dist/InlineHeadCommon.js","webpack://@msnews/shared-widgets/../../libs/cookie-utils/dist/cookie-helpers/AudienceModeCookie.js","webpack://@msnews/shared-widgets/../../libs/fundamentals/dist/utilities/ChinaCompliance.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/ErrorDispatcher.js","webpack://@msnews/shared-widgets/../../libs/experiences-constants/dist/Widgets.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/Utilities.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/ErrorLogging.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/LoadingIcon.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/GetOverrideParams.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/GetDataWidgetAttributes.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/AddMarkerToPageTimings.js","webpack://@msnews/shared-widgets/../../libs/core-helper/dist/ErrorHelper.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/isArray.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_freeGlobal.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_root.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_Symbol.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_getRawTag.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_objectToString.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_baseGetTag.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/isSymbol.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/isObjectLike.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_isKey.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/isObject.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_coreJsData.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_isMasked.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_toSource.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_baseIsNative.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/isFunction.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_getNative.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_getValue.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_nativeCreate.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_hashGet.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_hashHas.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_Hash.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_hashClear.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_hashDelete.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_hashSet.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_assocIndexOf.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/eq.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_listCacheDelete.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_ListCache.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_listCacheClear.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_listCacheGet.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_listCacheHas.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_listCacheSet.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_Map.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_getMapData.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_isKeyable.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_MapCache.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_mapCacheClear.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_mapCacheDelete.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_mapCacheGet.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_mapCacheHas.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_mapCacheSet.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/memoize.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_stringToPath.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_memoizeCapped.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_baseToString.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_arrayMap.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_castPath.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/toString.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_toKey.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/get.js","webpack://@msnews/shared-widgets/../../node_modules/lodash-es/_baseGet.js","webpack://@msnews/shared-widgets/../../libs/experimentation-helpers/dist/FlightHelpers.js","webpack://@msnews/shared-widgets/../../libs/diagnostics/dist/logging/Util.js","webpack://@msnews/shared-widgets/../../libs/diagnostics/dist/logging/Logger.js","webpack://@msnews/shared-widgets/../../libs/diagnostics/dist/logging/LiteLogger.js","webpack://@msnews/shared-widgets/../../libs/fundamentals/dist/webstorage/WebStorage.js","webpack://@msnews/shared-widgets/../../libs/fundamentals/dist/webstorage/LocalStorage.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/GetPcsResponse.js","webpack://@msnews/shared-widgets/../../libs/core-helper/dist/LodashLiteInline.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/WidgetInitializer.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/SetOneTrustScript.js","webpack://@msnews/shared-widgets/../../libs/widget-initializer/dist/WidgetsChanged.js"],"sourcesContent":["// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// © Microsoft Corporation. All rights reserved.\n/**\n * Checks if the DOM is available to access and use.\n * If you want to distinguish between server side rendering and client side rendering, prefer use `__WEBPACK_IS_NODE__` because it's a constant value that can be optimized by webpack.\n * @returns {boolean} - true if DOM is available, or false if it is not. This is typically true for\n * client side rendering and false for server side rendering.\n */\nexport function canUseDOM() {\n return !!(typeof window !== \"undefined\" && window.document && window.document.createElement && !window.isRenderServiceEnv);\n}\n//# sourceMappingURL=DOMHelpersCore.js.map","// © Microsoft Corporation. All rights reserved.\nlet storage = new Map();\nfunction getItem(key, fallback) {\n let found = storage.get(key);\n if (found === void 0 && fallback) {\n found = fallback();\n storage.set(key, found);\n }\n return found;\n}\n/**\n * Create a StorageBackend instance that wraps a getter function for the actual backend.\n */\nexport function createStoreWrapper(getBackend) {\n return {\n get: (key) => getBackend().get(key),\n set: (key, value) => getBackend().set(key, value),\n delete: (key) => getBackend().delete(key),\n clear: () => getBackend().clear(),\n has: (key) => getBackend().has(key)\n };\n}\nexport const IsomorphicStorage = Object.freeze({\n /**\n * Stores a value in storage.\n * @param key - The key to store the value under.\n * @param value - The value to store.\n * @returns This RequestStorage instance.\n */\n set(key, value) {\n storage.set(key, value);\n return this;\n },\n /**\n * Gets a value from storage.\n * @param key - The key to get the value for.\n * @param fallback - A function that provides a value if there is nothing stored under the key.\n * @returns The value stored under the key.\n * @remarks\n * The return result of the fallback function will be stored under the key for later access.\n */\n get: getItem,\n /**\n * Clears all values.\n */\n clear() {\n storage.clear();\n },\n /**\n *\n * @param key - The key to delete.\n * @returns true if the value was deleted; false otherwise.\n */\n delete(key) {\n return storage.delete(key);\n },\n /**\n * Determines whether there's a value for the given key.\n * @param key - The key to check.\n * @returns true if the key exists; false otherwise\n */\n has(key) {\n return storage.has(key);\n }\n});\nexport function setStorageBackend(backend) {\n storage = backend;\n}\n/**\n * Create an IsomorphicStorage-based value reference\n * @param value - The initial value\n * @returns { current: T } the object contains getter & setter to current value\n */\nexport function useIsomorphicStorageRef(value) {\n const key = Symbol();\n return {\n get current() {\n return IsomorphicStorage.get(key, () => value);\n },\n set current(nextValue) {\n IsomorphicStorage.set(key, nextValue);\n }\n };\n}\n//# sourceMappingURL=IsomorphicStorage.js.map","// © Microsoft Corporation. All rights reserved.\nimport { IsomorphicStorage } from \"./IsomorphicStorage\";\nimport { osatCookieExistsCookieName, osatCookieName } from \"./SSRInteropContract\";\nconst isomorphicStorageKey = \"__RequestDataInstance__\";\n/**\n * Singleton class to store client browser data sent through query param to Render Service.\n * This is only used under server environment.\n */\nclass RequestData {\n /**\n * Initialize the request data instance with passed in client properties\n */\n constructor(data, isPssrMode) {\n this.url = new URL(data.href);\n this.innerHeight = data.innerHeight;\n this.devicePixelRatio = data.devicePixelRatio;\n this.canUseCssGrid = data.canUseCssGrid;\n this.requestId = data.requestId;\n this.cookie = data.cookie;\n this.referer = data.referer;\n this.userAgent = data.userAgent;\n this.clientData = data.clientData;\n this.oneServiceHeaders = tryParseJson(data.oneServiceHeaders) || {};\n this.isPssrMode = isPssrMode;\n if (isPssrMode) {\n const osatCookieExists = getCookie(osatCookieExistsCookieName, this.cookie);\n const isOsateCookieValid = !!osatCookieExists && osatCookieExists === \"1\";\n const osatCookie = getCookie(osatCookieName, this.cookie);\n // When user is in interactive login scenario, OSATE is present but not valid,\n // so both conditions will fail and we will skip pure SSR\n // When OSAT is present and OSATE is valid (i.e. set to \"1\"), user has already signed in successfully\n // When both OSAT and OSATE are missing, user is not signed in (fallback to MUID for 1S calls)\n if ((isOsateCookieValid && osatCookie) || (!osatCookieExists && !osatCookie)) {\n this.msalAuthReady = true;\n if (osatCookie) {\n // When user has signed in, set JWT token in 1S request header for authentication\n this.oneServiceHeaders[\"Authorization\"] = `Bearer ${osatCookie}`;\n }\n return;\n }\n this.msalAuthReady = false;\n if (osatCookieExists && !isOsateCookieValid) {\n this.pssrRejectedReason = \"interactiveLogin\";\n }\n else if (osatCookieExists && !osatCookie) {\n this.pssrRejectedReason = \"missOSAT\";\n }\n else {\n this.pssrRejectedReason = \"missOSATE\";\n }\n }\n }\n /**\n * Returns singleton class instance.\n * @returns RequestData\n */\n static getInstance() {\n const instance = IsomorphicStorage.get(isomorphicStorageKey);\n if (instance) {\n return instance;\n }\n if (global[\"TEST_ENV\"]) {\n return resetRequestData({\n href: \"http://localhost:8080/\",\n innerHeight: 768,\n devicePixelRatio: 1,\n canUseCssGrid: false,\n requestId: \"0\",\n cookie: \"\",\n userAgent: \"\",\n referer: \"\",\n oneServiceHeaders: \"\"\n });\n }\n // Throw error if the request data has not been set as this should never be the case.\n // This likely highlights that the request data was not initialized when handling a\n // request when server side rendering.\n // TODO - http://osgvsowi/24832691 renable throwing an error.\n // This is currently disabled as other singletons that are initialized at import time use\n // this they will throw an error before anyone has the chance to initialize the request data\n return resetRequestData({\n href: \"http://localhost:8080/\",\n innerHeight: 0,\n devicePixelRatio: 0,\n canUseCssGrid: false,\n requestId: \"0\",\n cookie: \"\",\n userAgent: \"\",\n referer: \"\",\n oneServiceHeaders: \"\"\n });\n }\n /**\n * Reset singleton class instance with passed in info and client settings\n * @returns RequestData\n */\n static resetInstance(data, isPssr = false) {\n const newInstance = new RequestData(data, isPssr);\n IsomorphicStorage.set(isomorphicStorageKey, newInstance);\n return newInstance;\n }\n}\n/**\n * Helper to get cookie content from cookie string\n *\n * @param name cookie name\n * @param cookieString cookie string with which to search for the content by `name`\n * @returns\n */\nfunction getCookie(name, cookieString) {\n if (cookieString && name) {\n const re = new RegExp(\"\\\\b\" + name + \"\\\\s*=\\\\s*([^;]*)\", \"i\");\n const match = re.exec(cookieString);\n return (match && match.length > 1 ? match[1] : null);\n }\n return null;\n}\n/**\n * Helper to safely parse JSON\n * @param json The JSON string to parse\n * @returns The parsed JSON object, or undefined if invalid.\n */\nfunction tryParseJson(json) {\n try {\n if (json) {\n return JSON.parse(json);\n }\n }\n catch (ex) {\n // tslint:disable-next-line:no-empty\n }\n}\n/**\n * Export function to reset the request data singleton.\n * This must be used to set the request data.\n */\nexport const resetRequestData = RequestData.resetInstance;\n/**\n * Export get instance function for testing\n */\nexport const getRequestData = () => (RequestData.getInstance());\n//# sourceMappingURL=requestData.js.map","// © Microsoft Corporation. All rights reserved.\nimport { breakpoints } from \"./SSRInteropContractHelpers\";\n/**\n * The param-name prefix used when serializing params onto the query string.\n */\nexport const SSRRequestDataPrefix = \"rd\";\n/**\n * `OSATE` (OneService access token exists) is a client readable companions cookie dropped together with the\n * `OSAT`(OneService Access Token) cookie to indicate the existence of the `OSAT` cookie.\n * `OSATE` cookie is usually set to expire 6 months from creation, while `OSAT` expires at token expiry (~1-24h)\n *\n * Thus if `OSATE` cookie exists without the accompanying `OSAT` cookie to conclude that\n * a session exists, but the token has expired, which must be re-acquired/re-validated via client-side JS.\n *\n * The `OSATE` can also be deleted manually during various interactive login/logout scenarios to semantically\n * indicate that the `OSAT` token must be re-established/re-validated on client-side JS.\n *\n * 1) Thus if only one of `OSAT` or `OSATE` exists, that indicates PSSR code cannot render the page and thus must\n * fallback to client-side rendering.\n * 2) If both are missing that means the user has logged out, or never established\n * an auth session, which should enable PSSR.\n * 3) If both exists that means the token inside `OSAT` is valid and can be used in PSSR.\n */\nexport const osatCookieExistsCookieName = \"OSATE\";\n/**\n * OneService Access Token cookie used to autheticate 1S calls under PSSR mode.\n * Expires at the time of token expiry (~1-24hr based on MSO tenant auth configuration)\n * Please see detailed notes under `osatCookieExistsCookieName`\n */\nexport const osatCookieName = \"OSAT\";\n/**\n * Defines the \"interop\" contract between client and server-side renderer.\n * All of these values will be serialized into request parameters to be passed\n * on the HTTP request to the SSR server.\n */\nexport const SSRContract = {\n ver: \"0.1.0\",\n spec: {\n // IWindow\n innerWidth: {\n clientValue: () => window.innerWidth\n },\n innerHeight: {\n clientValue: () => window.innerHeight\n },\n outerWidth: {\n clientValue: () => window.outerWidth\n },\n breakpoint: {\n clientValue: () => identifyBreakpoint(window.innerWidth, breakpoints)\n },\n locationHash: {\n clientValue: () => window.location.hash\n },\n locationHref: {\n clientValue: () => window.location.href\n },\n locationHost: {\n clientValue: () => window.location.host\n },\n locationHostName: {\n clientValue: () => window.location.hostname\n },\n locationOrigin: {\n clientValue: () => window.location.origin\n },\n locationPathName: {\n clientValue: () => window.location.pathname\n },\n locationProtocol: {\n clientValue: () => window.location.protocol\n },\n locationSearch: {\n clientValue: () => window.location.search\n },\n screenTop: {\n clientValue: () => window.screenTop\n },\n screenY: {\n clientValue: () => window.screenY\n },\n // IBrowser\n canUseCssGrid: {\n clientValue: () => ((window.CSS && window.CSS.supports && CSS.supports(\"display\", \"grid\")) || false)\n },\n // IDevice\n devicePixelRatio: {\n clientValue: () => window.devicePixelRatio\n },\n // ILocale\n language: {\n clientValue: () => document.documentElement.lang\n },\n direction: {\n clientValue: () => document.documentElement.dir\n }\n }\n};\n/**\n * Identifies current breakpoint based on window width. Same implementation as \"\"@microsoft/fast-layouts-react\"\"\n * The package has been deprecated and prevented dependency projects to use react version later than 16. So removing these dependencies.\n */\nfunction identifyBreakpoint(windowWidth, breakpoints) {\n for (let breakpoint = breakpoints.length - 1; breakpoint >= 0; breakpoint--) {\n if (windowWidth >= breakpoints[breakpoint]) {\n return breakpoint;\n }\n }\n}\n//# sourceMappingURL=SSRInteropContract.js.map","// © Microsoft Corporation. All rights reserved.\nimport { canUseDOM } from \"./DOMHelpersCore\";\nimport { getRequestData } from \"./requestData\";\n/**\n * Get window.navigator.userAgent in an isomorphic manner.\n */\nexport function getUserAgent() {\n return canUseDOM() ? window.navigator.userAgent : getRequestData().userAgent;\n}\n/**\n * Get window.location.href in an isomorphic manner.\n */\nexport function getLocationHref() {\n return canUseDOM() ? window.location.href : getRequestData().url.href;\n}\n/**\n * Get window.location.hostname in an isomorphic manner.\n */\nexport function getLocationHostname() {\n return canUseDOM() ? window.location.hostname : getRequestData().url.hostname;\n}\n/**\n * Get window.location.host in an isomorphic manner.\n */\nexport function getLocationHost() {\n return canUseDOM() ? window.location.host : getRequestData().url.host;\n}\n/**\n * Get window.location.origin in an isomorphic manner.\n */\nexport function getLocationOrigin() {\n return canUseDOM() ? window.location.origin : getRequestData().url.origin;\n}\n/**\n * Get window.location.search in an isomorphic manner.\n */\nexport function getLocationSearch() {\n return canUseDOM() ? window.location.search : getRequestData().url.search;\n}\n/**\n * Get window.location.pathname in an isomorphic manner.\n */\nexport function getLocationPathname() {\n return canUseDOM() ? window.location.pathname : getRequestData().url.pathname;\n}\n/**\n * Get window.location.protocol in an isomorphic manner.\n */\nexport function getLocationProtocol() {\n return canUseDOM() ? window.location.protocol : getRequestData().url.protocol;\n}\n/**\n * Get window.location.hash in an isomorphic manner.\n */\nexport function getLocationHash() {\n return canUseDOM() ? window.location.hash : getRequestData().url.hash;\n}\n/**\n * Get the current URL in an isomorphic manner.\n */\nexport function getCurrentUrl() {\n return getLocationOrigin() + getLocationPathname();\n}\n/**\n * Get document.cookie in an isomorphic manner.\n */\nexport function getCookieString() {\n return canUseDOM() ? window.document.cookie : getRequestData().cookie;\n}\n/**\n * Get window.document.getElementById(elementId).\n */\nexport function getDocumentElementById(elementId) {\n if (!canUseDOM()) {\n throw new Error(\"getDocumentElementById is unsupported server side. This call should be wrapped in canUseDOM().\");\n }\n return window.document.getElementById(elementId);\n}\n/**\n * Get window.document.getDocumentElementsByTagName(tagName).\n */\nexport function getDocumentElementsByTagName(tagName) {\n if (!canUseDOM()) {\n throw new Error(\"getDocumentElementsByTagName is unsupported server side. This call should be wrapped in canUseDOM().\");\n }\n return window.document.getElementsByTagName(tagName);\n}\n/**\n * Get window.document.getDocumentElementsByClassName(className).\n */\nexport function getDocumentElementsByClassName(className) {\n if (!canUseDOM()) {\n throw new Error(\"getDocumentElementsByClassName is unsupported server side. This call should be wrapped in canUseDOM().\");\n }\n return window.document.getElementsByClassName(className);\n}\n/**\n * Get indexedDB in an isomorphic manner.\n * Todo (http://osgvsowi/23753462), provide actual functionality for indexedDB on the server side.\n */\nexport function getIndexedDB() {\n return canUseDOM() ? window.indexedDB : null;\n}\n/**\n * Get window.innerHeight in an isomorphic manner.\n * Todo (http://osgvsowi/23876778), remove the need for server to know about innerWidth by limiting layout options or use CSS based solution.\n */\nexport function getInnerHeight() {\n return canUseDOM() ? window.innerHeight : getRequestData().innerHeight;\n}\n/**\n * Get window.devicePixelRatio in an isomorphic manner.\n */\nexport function getDevicePixelRatio() {\n return canUseDOM() ? window.devicePixelRatio : getRequestData().devicePixelRatio;\n}\n/**\n * Get CSS Grid support in an isomorphic manner\n */\nexport function getCssGridSupport() {\n return !!(canUseDOM() ? (window.CSS && window.CSS.supports && CSS.supports(\"display\", \"grid\")) : getRequestData().canUseCssGrid);\n}\n/**\n * Get variable font support in an isomorphic manner\n * TODO: SSR currently does not support custom fonts.\n */\nexport function getVariableFontSupport() {\n if (!canUseDOM()) {\n throw new Error(\"SSR currently does not support custom fonts.\");\n }\n return !!(window.CSS && window.CSS.supports && CSS.supports(\"(font-variation-settings: normal)\"));\n}\n/**\n * Returns a script element using several default values.\n * Not supported server side.\n * @param src The absolute URL for the script src. Default is undefined, blank is okay.\n * @param id The id to assign the script element. default is \"\" so no id.\n * @param loadAsync Should the script load asynchronously. Default is true.\n * @param crossOrigin Set the script crossorigin attribute. Default is anonymous.\n * @param className The optional className to assign the script element.\n * @returns {HTMLScriptElement} the script element. not using const so it can be overridden by caller.\n */\nexport function createScriptTag(src = undefined, id = undefined, loadAsync = true, crossOrigin = \"anonymous\", className, onload) {\n if (!canUseDOM()) {\n throw new Error(\"createScriptTag is unsupported server side. This call should be wrapped in canUseDOM().\");\n }\n const scriptElement = document.createElement(\"script\");\n if (id) {\n scriptElement.id = id;\n }\n if (className) {\n scriptElement.setAttribute(\"class\", className);\n }\n if (onload) {\n scriptElement.onload = onload;\n }\n scriptElement.type = \"text/javascript\";\n if (src) {\n if (window && window.trustedTypesURLValidation) {\n scriptElement.src = window.trustedTypesURLValidation(src, \"scriptSrcUrlPolicy\");\n }\n else {\n scriptElement.src = src;\n }\n scriptElement.async = loadAsync;\n scriptElement.crossOrigin = crossOrigin;\n }\n // @ts-ignore\n if (window && window.NONCE_ID) {\n // @ts-ignore\n scriptElement.nonce = window.NONCE_ID;\n }\n return scriptElement;\n}\n//# sourceMappingURL=DOMHelpers.js.map","// © Microsoft Corporation. All rights reserved.\n/**\n * Enum for different auth cookie names\n * @enum\n */\nexport var AuthCookieName;\n(function (AuthCookieName) {\n AuthCookieName[\"Anon\"] = \"ANON\";\n AuthCookieName[\"AppAnon\"] = \"APP_ANON\";\n AuthCookieName[\"Unknown\"] = \"\";\n})(AuthCookieName || (AuthCookieName = {}));\n/**\n * List of http-readable cookies that indicate the presence of an auth cookie\n * IMPORTANT NOTE: If this is updated, please update the list in WebWorkerInitializer.ts as well\n */\nexport var AuthCookieExistsCookieName;\n(function (AuthCookieExistsCookieName) {\n AuthCookieExistsCookieName[\"AnonCookieExists\"] = \"ace\";\n AuthCookieExistsCookieName[\"AppAnonCookieExists\"] = \"aace\";\n})(AuthCookieExistsCookieName || (AuthCookieExistsCookieName = {}));\n/**\n * Original source is Constants.ts\n * Child cookie name, used to signal if rpsUser is child account.\n */\nexport const childCookieName = \"child\";\n//# sourceMappingURL=AuthCookieNames.js.map","// © Microsoft Corporation. All rights reserved.\n/**\n * Returns the cookie content given a name\n * @param cookieString {string} - cookie string (usually comes via `document.cookie` for client-side JS)\n * @param name {string} - cookie name\n * @returns the value of the cookie or `null`, if the key is not found.\n */\nexport function getCookieCore(cookieString, name) {\n if (cookieString) {\n const re = new RegExp(\"\\\\b\" + name + \"\\\\s*=\\\\s*([^;]*)\", \"i\");\n const match = re.exec(cookieString);\n return (match && match.length > 1 ? match[1] : null);\n }\n return null;\n}\n//# sourceMappingURL=GetCookieCore.js.map","// © Microsoft Corporation. All rights reserved.\n/**\n * Helper to parse a JSON string to the corresponding object/value, optionally casting\n * it to the preferred type.\n * @param jsonString - The json string to parse\n * @returns The parse object value or null if the string is not valid or failed to parse.\n */\nexport function tryParseJson(jsonString) {\n try {\n if (jsonString) {\n return JSON.parse(jsonString);\n }\n // eslint-disable-next-line no-empty\n }\n catch (ex) { }\n return null;\n}\n//# sourceMappingURL=TryParseJson.js.map","// © Microsoft Corporation. All rights reserved.\n/**\n * Config Service v3 endpoint\n */\nexport const CrsV3Endpoint = \"v3\";\n/**\n * Config Service v3.1 endpoint\n * Will be used for experimentation only.\n */\nexport const CrsV31Endpoint = \"v3.1\";\n/**\n * Config Service Path\n */\nexport const CrsPath = \"/resolver/api/resolve/\";\n/**\n * Prong2 flight prefix\n */\nexport const Prong2FlightPrefix = \"prg-pr2-\";\n/**\n * Peregrine widget specific flights prefix\n */\nexport const widgetFlightsPrefix = \"prg-pw-\";\n/**\n * Peregrine flights with prefix\n */\nexport const PeregrineFlightPrefix = \"prg-\";\n/**\n * Git configs indexedDB caching flight\n */\nexport const GitConfigsIndexedDbTreatment = \"prg-gitconfigs-t\";\n/**\n * Remove page experiments from target scope flight\n */\nexport const RemoveCrsFDHeadTreatment = \"prg-crsfdheadrem\";\n/**\n * Treatment flight for using Akamai-CRS for Prong 1.\n */\nexport const Prong1AkamaiCRSCallTreatmentId = \"prg-1sw-akp1crs\";\n/**\n * Prong 1 flights with prefix\n */\nexport const Prong1FlightsPrefix = \"prg-1sw-\";\n/**\n * Treatment flight for using Akamai endpoint to retrieve CRS configs.\n */\nexport const AkamaiCRSCallTreatmentId = \"prg-callcrsfrakm\";\n/** Treatment flight for disabling welcome greeting & weather one liner in Anaheim */\nexport const AnaheimDisableWeatherInHeadFlight = \"prg-ntp-noweahd\";\n/**\n * Treatment flight for using Akamai-CRS for cn domains in ntp.\n */\nexport const NtpChinaChinaCRSCallTreatmentId = \"prg-akntpcrscncl\";\n/**\n * Akamai base url to call crs used for when treatment flight is detected.\n * Will be used in the ntp flight.\n */\n// eslint-disable-next-line msnews-experiences-rules/no-hardcode-asset-path\nexport const AkamaiBaseUrl = \"https://assets.msn.com\";\n/**\n * Akamai base url to call crs used for when treatment flight is detected.\n * Will be used in the China flight.\n */\nexport const ChinaAkamaiBaseUrl = \"https://assets.msn.cn\";\n/**\n * Treatment flight for using long PCS cache duration for Prong 2.\n */\nexport const Prong2PcsDurationTreatmentId = \"prg-pr2-pcsdur\";\n/**\n * Treatment flight for using manual PCS cache treatment for Prong 2.\n */\nexport const Prong2ManualPcsCacheTreatmentId = \"prg-pr2-manupcs\";\n/**\n * Treatment flight for using Akamai host for Prong2 PCS API\n */\nexport const Prong2PcsApiUseAkamaiEndpoint = \"prg-pr2-akmpcs\";\n/**\n * Treatment flight id for removing the x-ms-flightId header from ads call.\n */\nexport const RemoveFlightIdHeaderTreatment = \"remflighthead\";\n/**\n * Treatment flight id for passing page type to ads calls (native, display, video)\n */\nexport const PassAllAdTypesPageTypeTreatment = \"prg-ad-pgtype\";\n/**\n * Treatment flight id for passing MSFT member id 280 to Xandr ads calls (display, video)\n */\nexport const PassXandrMSFTMemberIdTreatment = \"prg-ad-mbid\";\n/**\n * Treatment flight id for switching UT endpoint to msn domain for AST SDK in display ad\n */\nexport const DisplayAdUseMSNDomainEndpointTreatment = \"prg-ad-astmsn\";\n/**\n * Holdout treatment flight id for switching AST to microsoft domain for display ad\n */\nexport const DisplayAdUseMicrosoftDomainASTSdkHoldoutTreatment = \"prg-ad-astmsft-rf\";\n/**\n * Treatment flight id for sending assigned flights (id and numberline) in display ad request\n */\nexport const DisplayAdPassFlightsTreatment = \"prg-ad-dispflts-t\";\n/**\n * Treatment flight id for sending AST more debug informaton on performance\n */\nexport const EnableDisplayCustomEventTreatment = \"prg-ad-astce\";\n//# sourceMappingURL=Flights.js.map","// © Microsoft Corporation. All rights reserved.\nimport { PeregrineFlightPrefix, Prong1FlightsPrefix, Prong2FlightPrefix, widgetFlightsPrefix } from \"@msnews/experiences-constants\";\n/**\n * Goes through the array of flights that is given and will filter out any flight that doesn't start with prg-pw.\n * @param flights Array\n * @returns specific flights\n */\nexport function getPeregrineWidgetFlights(flights) {\n return getPeregrineFlights(flights, widgetFlightsPrefix);\n}\n/**\n * Goes through the array of flights that is given and will filter out any flight that doesn't start with\n * prg-. It then sorts them and returns a new string[].\n * @param flights Array of flights that we will filter through and return only the peregrine\n * @param flightPrefix Prefix of the flight ids used for the filter\n * @returns specific flights\n */\nexport function getPeregrineFlights(flights, flightPrefix = PeregrineFlightPrefix) {\n const prefixLen = flightPrefix.length;\n const prgPrefixFlights = [];\n if (flights && flights.length) {\n flights.forEach(item => {\n const cleanItem = item && item.trim();\n if (cleanItem\n && cleanItem.length >= prefixLen\n // much faster to do a substring for the first few characters\n // than to do a lowercase on the whole flight string (also faster than case-insensitive regex)\n && cleanItem.substring(0, prefixLen).toLowerCase() === flightPrefix) {\n prgPrefixFlights.push(cleanItem.toLowerCase());\n }\n });\n prgPrefixFlights.sort();\n }\n return prgPrefixFlights;\n}\n/**\n * Goes through the array of flights that is given and will retrun the correct prefix to filter out any\n * unwanted flights. By default this will return the prefix to only keep flights with prefix 'prg-'\n * @param flights Array of flights that we will filter through\n * @param shouldUseWPOnlyFlights Flag to keep only prg-pw- flights\n * @param appType App type\n * @returns prefix for flights to keep\n */\nexport function getFlightsFilterPrefix(flights, shouldUseWPOnlyFlights = false, appType = \"\") {\n let filterPrefix = PeregrineFlightPrefix;\n if (shouldUseWPOnlyFlights) {\n filterPrefix = widgetFlightsPrefix;\n }\n else if (appType.toLocaleLowerCase() === \"windowsShell\" /* AppType.WindowsShell */.toLocaleLowerCase() ||\n appType.toLocaleLowerCase() === \"windowsShellV2\" /* AppType.WindowsShellV2 */.toLocaleLowerCase()) {\n filterPrefix = Prong1FlightsPrefix;\n }\n else if (appType.toLocaleLowerCase() === \"winWidgets\" /* AppType.WindowsNewsWidgets */.toLocaleLowerCase()\n && !isVpTest()) {\n filterPrefix = Prong2FlightPrefix;\n }\n return filterPrefix;\n}\n/**\n * Checks if the current page is a VP test page\n * We will not import extra libraries due to circle dependencies\n * @returns boolean\n */\nfunction isVpTest() {\n return window?.location?.search?.includes(\"reqsrc=vp\") || !!window?.location?.search?.includes(\"vptest\");\n}\n//# sourceMappingURL=GetPeregrineFlights.js.map","// © Microsoft Corporation. All rights reserved.\nimport { canUseDOM, getLocationHostname, getLocationSearch } from \"@msnews/isomorphic-util\";\nimport { getAudienceModeFromCookies } from \"@msnews/cookie-utils\";\nimport { getFlightsFilterPrefix, getPeregrineFlights } from \"@msnews/experimentation-helpers\";\nimport { isChinaCompliance } from \"@msnews/fundamentals\";\nimport { tryParseJson } from \"@msnews/core-helper\";\n/**\n * Initialize the inline-head-common module logic.\n * This currently includes the following:\n * - Fetching the CRS call early\n * @param options - Options for the inlineHead initialization call\n */\nexport function init(initOptions = {}) {\n const result = {};\n try {\n if (!canUseDOM()) {\n return result;\n }\n const clientSettings = parseClientSettings();\n let crsAppType = clientSettings.apptype?.toLocaleLowerCase();\n const crsOptions = initOptions.crsOptions || {};\n // Only turn on early CRS call for Prong 2 and MSN HP. Due to shared init logic for app types\n // Until universal shipping - All other app types will have to opt-in to early CRS call via flights or update similarly\n if (crsAppType === \"winwidgets\" || crsAppType === \"homepage\" || crsAppType === \"travel\") {\n crsOptions.crsPrefetch = true;\n }\n // Turn on early CRS call if it's set by the host page for widgets.\n if (clientSettings.widgetAttributes?.clientPerf?.earlyCRSCall) {\n crsOptions.crsPrefetch = true;\n }\n // flight name for edgeChromium exceeds the 20 characters limit\n if (crsAppType === \"edgechromium\") {\n crsAppType = \"edgechr\";\n }\n // shouldUsePWOnlyFlights is typically set by the host page in the widgets page.\n // Widget initializer adds WidgetAttributes exist in the host into client settings for appEnvironment to consume.\n const shouldUsePWOnlyFlights = !!clientSettings.widgetAttributes?.clientPerf?.shouldUsePWOnlyFlights;\n const { all, prg } = parseFlights(shouldUsePWOnlyFlights, crsAppType);\n // Early CRS call is currently enabled based on the flight\n // and the feature switch enablement by each canvas\n const earlyCRSCall = crsOptions.crsPrefetch || (all.includes(\"inlinecrscall\") || all.includes(`icrscall-${crsAppType}`));\n if (earlyCRSCall) {\n fetchCRS(clientSettings, prg, crsOptions);\n result.inlineCRS = true;\n }\n }\n catch (ex) {\n // eslint-disable-next-line no-console\n console.error(\"InlineHeadCommon: \" + ex);\n }\n return result;\n}\n/**\n * Prepares the request object for the CRS call and fetch the response.\n * The method will attempt to fetch from assets.msn.com first, and then fallback\n * to www.msn.com if the first attempt fails. The resulting promise will be cached\n * in the global scope for the ConfigService to consume later when requested by the page.\n * @param clientSettings - Parsed version of the client settings value from the document\n * @param prgExperiments - The list of `prg-` prefixed experiments to be passed to the CRS call\n * @param crsOptions - Options to modify the fetch sequence\n */\nfunction fetchCRS(clientSettings, prgExperiments, crsOptions) {\n const audienceMode = getAudienceModeFromCookies(document.cookie, clientSettings);\n const { apptype, browser, domain: pcsDomain, bundleInfo: { v: bundleVersion } = {}, deviceFormFactor, locale: { content, display } = {}, ocid, os, pagetype: pageType, servicesEndpoints: { crs } = {} } = clientSettings;\n // for widget scenarios we don't want to use the PCS provided domain\n // as the host page domain can be completely different than the PCS call,\n // so we use the current host in that case\n const domain = (tryGetWidgetElement() ? getLocationHostname() : pcsDomain) || \"\";\n if (!apptype || !bundleVersion || !crs) {\n return;\n }\n const currentRequestTargetScope = {\n audienceMode,\n browser,\n deviceFormFactor,\n domain,\n locale: { content, display },\n ocid,\n os,\n platform: \"web\",\n pageType,\n pageExperiments: prgExperiments\n };\n const params = new URLSearchParams([\n [\"expType\", \"AppConfig\"],\n [\"expInstance\", \"default\"],\n [\"apptype\", apptype],\n [\"v\", bundleVersion]\n // Note we don't add the target scope object here as the URLSearchParams adds a lot of\n // escape characters that bloats the payload. Instead we add it as raw JSON string below\n ]);\n // If url has dev only query string params, send this dev/test traffic to int1 environment instead of prod.\n const locationSearch = getLocationSearch();\n const devQueryParam = locationSearch.includes(\"?item=\") || locationSearch.includes(\"&item=\")\n ? \"&citem=dev:true&instance=Int1\"\n : \"\";\n const crsPathAndQuery = `${crs.path}${crs.v}/config/?${params}&targetScope=${JSON.stringify(currentRequestTargetScope)}${devQueryParam}`;\n const fetchHelper = (domain) => {\n const url = new URL(`https://${domain}${crsPathAndQuery}`);\n const { timeout = 5000 } = crsOptions;\n // this is checked in the early CRS promise in ConfigService.ts\n window.crsRequestData = { url: url.toString() };\n let abortSignal;\n if (timeout >= 0) {\n const ctrl = new AbortController();\n setTimeout(() => ctrl.abort(), timeout);\n abortSignal = ctrl.signal;\n }\n return fetch(url, {\n signal: abortSignal\n });\n };\n const compliantSuperMsnDomain = `msn.${isChinaCompliance(location, clientSettings) ? \"cn\" : \"com\"}`;\n // this value is often empty, but if it's not, we should use it as the domain\n const { domain: serverSpecifiedCrsOrigin } = crs;\n const serverSpecifiedCrsDomain = serverSpecifiedCrsOrigin && new URL(serverSpecifiedCrsOrigin).host;\n // enable existing path in ConfigService.ts to fetch result from global promise variable\n let crsPromise = fetchHelper(serverSpecifiedCrsDomain || `assets.${compliantSuperMsnDomain}`);\n if (!crsOptions.disableFallback) {\n crsPromise = crsPromise.catch(() => {\n // only *.msn.com should fallback to the host page domain, otherwise for things like bing.com, it should\n // fallback to www.msn.com\n const { hostname } = location;\n const fallbackDomain = hostname.match(/\\.msn\\.(com|cn)$/)\n ? hostname\n : `www.${compliantSuperMsnDomain}`;\n return fetchHelper(fallbackDomain);\n });\n }\n window.crsPromise = crsPromise;\n}\n/**\n * Parses the flights list from the document -- supports both normal and widget modes.\n * @param shouldUsePWOnlyFlights - Flag to keep only prg-pw- flights\n * @param appType - App type\n * @returns\n */\nexport function parseFlights(shouldUsePWOnlyFlights = false, appType = \"\") {\n const allFlights = tryGetFlights(getPageDatasetValue(\"info\")) || [];\n // When data-canvas-info is present, we use instead of getting prg- flights from all flights.\n let prgFlights = tryGetFlights(getPageDatasetValue(\"canvasInfo\"));\n if (!prgFlights) {\n const prgFilterPrefix = getFlightsFilterPrefix(allFlights, shouldUsePWOnlyFlights, appType);\n prgFlights = getPeregrineFlights(allFlights, prgFilterPrefix);\n }\n return {\n all: allFlights,\n prg: prgFlights\n };\n}\n/**\n * Parses the client settings value from the document -- supports both normal and widget modes.\n * @returns The core client settings object\n */\nfunction parseClientSettings() {\n return tryParseJson(getPageDatasetValue(\"clientSettings\")) || {};\n}\n/**\n * Helper to get one of the well-known dataset values from the document.\n * @param key - The key to get from the dataset\n * @returns The value of the dataset key, or undefined if not found\n */\nfunction getPageDatasetValue(key) {\n // Note that we look at the head dataset first because that's the majority of the cases.\n // We only query for the widget scenario if the head dataset doesn't have the value.\n return document.head.dataset[key]\n || tryGetWidgetElement()?.dataset[key];\n}\n/**\n * Cached widget element value from a previous query -- since we query for both\n * `clientSettings` and `info` values, caching this will save on another DOM query\n */\nlet widgetElement;\n/**\n * Queries the document for the widget element and caches the result.\n * @returns The widget element, or null if not found\n */\nfunction tryGetWidgetElement() {\n if (widgetElement === undefined) {\n widgetElement = document.getElementsByClassName(\"peregrine-widget-settings\")[0] || null;\n }\n return widgetElement;\n}\n/** Helper to reset internal state for UTs */\nexport function _resetInlineHeadCommon() {\n widgetElement = undefined;\n}\n/**\n * Parse head dataset and get the flights in lower case and sorted order.\n * @param key info or canvasInfo\n * @returns Array of flights present in the dataset\n */\nfunction tryGetFlights(flightString) {\n if (!flightString || !flightString.startsWith(\"f:\")) {\n // Return undefined if the dataset is not present or empty.\n // Example: data-canvas-info or data-canvas-info: \"\" or data-canvas-info: \"string without f:\"\n return;\n }\n const reduced = ((flightString.match(/f:\\s*([^;]+)/i)) || [])[1];\n if (!reduced) {\n // Return empty array if the flight string is empty.\n // Example: data-canvas-info: \"f:;\"\n // This is a valid case where the flight string is empty.\n return [];\n }\n // Example: data-canvas-info: \"f:flight1,flight2,flight3;\"\n // Returns [\"flight1\", \"flight2\", \"flight3\"]\n return reduced.toLowerCase().split(\",\")?.sort();\n}\n//# sourceMappingURL=InlineHeadCommon.js.map","// © Microsoft Corporation. All rights reserved.\nimport { childCookieName } from \"@msnews/experiences-constants\";\nimport { getCookieCore, tryParseJson } from \"@msnews/core-helper\";\n/**\n * Common helper function to get the audience mode from the cookie string.\n * @param cookieString - The cookie string to parse for the aace/child mode value.\n * @param clientSettings - The client settings from PCS\n * @returns The audience mode calculated from the cookies.\n */\nexport function getAudienceModeFromCookies(cookieString, clientSettings) {\n // Set Kids audience mode based on conditions below, otherwise use PCS provided Audience mode.\n let audienceMode;\n // There are two auth endpoints in production, at the time of this comment. One is a Prime based auth-endpoint (that is still being used by few Peregrine canvases)\n // and the second is a dedicated Peregrine endpoint hosted by OneService. In both endpoints, AACE cookie is dropped independent of the child cookie.\n // In Prime based auth endpoint, if the account is identified as Child account, a Child cookie is being dropped. In practice, we see that the value of that cookie is 0,\n // but the cookie is only dropped for Child accounts, so it's enough to check for just the presence of that cookie.\n // In OneService based auth endpoint (that is used by most of the Peregrine canvases), if an account is identified as Child account, auth service drops an AACE cookie\n // with a value of {\"child\": 1} for child accounts and {\"child\": 0} otherwise.\n // Until we move over to the newer (1S based) auth endpoint, we still have to honor both ways of identifying a child account.\n const aaceCookie = decodeURIComponent(getCookieCore(cookieString, \"aace\" /* AuthCookieExistsCookieName.AppAnonCookieExists */));\n const { child } = (aaceCookie && tryParseJson(aaceCookie)) || {};\n const childCookie = getCookieCore(cookieString, childCookieName);\n if (aaceCookie && (child === 1 || childCookie)) {\n audienceMode = \"kids\" /* AudienceModeType.Kids */;\n }\n else {\n audienceMode = clientSettings.audienceMode || \"adult\" /* AudienceModeType.Adult */;\n }\n return audienceMode;\n}\n//# sourceMappingURL=AudienceModeCookie.js.map","// © Microsoft Corporation. All rights reserved.\n/**\n * Gets if the current page should be considered as a China compliance context.\n * @param pageUrl - The current page URL info with the following info:\n * - hostname: The hostname of the current page URL.\n * - search: The search part of the current page URL.\n * @param clientSettings - The client settings of the page.\n * @returns `true` if the current page should be considered as a China compliance context; otherwise, `false`.\n */\nexport function isChinaCompliance(pageUrl, clientSettings) {\n const isChina = pageUrl.hostname.toLowerCase().endsWith(\".cn\")\n // PCS sends isChinaCompliance to be true when it meets appropriate conditions.\n // This flag is not present or will be undefined when PCS conditions aren't met.\n || clientSettings.isChinaCompliance\n // Widget Initializer set this flag when host page ask to use China domain\n || clientSettings.useCnDomain\n // Sapphire mini app sets this flag to true or false based on app configuration\n || pageUrl.search.match(/isChinaBuild=true/i)\n // For testing/debugging on localhost, item=revip:cn\n || pageUrl.search.match(/item=revip:cn/);\n return !!isChina;\n}\n//# sourceMappingURL=ChinaCompliance.js.map","// © Microsoft Corporation. All rights reserved.\nexport var CustomEventPayloadStage;\n(function (CustomEventPayloadStage) {\n CustomEventPayloadStage[\"INITIALIZE\"] = \"initialize\";\n CustomEventPayloadStage[\"CHANGE\"] = \"change\";\n CustomEventPayloadStage[\"ALL\"] = \"all\";\n})(CustomEventPayloadStage || (CustomEventPayloadStage = {}));\nexport const CustomWidgetErrorEvent = \"CustomWidgetErrorEvent\";\n/**\n * Dispatch custom event when some errors arised.\n * @param name - Event name\n * @param payload - Payload for event message\n */\nexport function dispatchCustomEvent(name, payload) {\n window.dispatchEvent(new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n type: \"AppError\",\n payload\n }\n }));\n}\n/**\n * Get data for custom widget event\n * @param event - CustomWidgetErrorEvent\n */\nexport function getDispatchedCustomEventPayload(event) {\n if (event.type !== CustomWidgetErrorEvent) {\n return null;\n }\n const payload = event.detail?.payload || {};\n return {\n stage: payload.stage,\n message: payload.message,\n extra: payload.extra\n };\n}\n//# sourceMappingURL=ErrorDispatcher.js.map","// © Microsoft Corporation. All rights reserved.\n/**\n * Widget group div class name in the DOM\n */\nexport const widgetGroupClassName = \"peregrine-widgetgroup\";\n/**\n * Widgets div class name in the DOM\n */\nexport const widgetClassName = \"peregrine-widgets\";\n/**\n * Widget settings div\n */\nexport const widgetSettingsClassName = \"peregrine-widget-settings\";\n/**\n * Widgets script core bundle class name in the DOM\n */\nexport const coreBundleClassName = \"peregrine-core-bundle\";\n/**\n * Widget info attribute (used in both 'peregrine-widgetgroup' divs and 'peregrine-widgets' divs)\n */\nexport const widgetInfoAttribute = \"data-widget\";\n/**\n * Widget render state attribute\n */\nexport const widgetRenderStateAttribute = \"data-widget-state\";\n/**\n * Attribute name of the pcsData.info in head element\n */\nexport const headTagDataInfoAttribute = \"data-info\";\n/**\n * Attribute name of the pcsData.clientSettings in head element\n */\nexport const headTagtClientSettingAttribute = \"data-client-settings\";\n/**\n * Attribute name of the pcsData.canvasInfo in head element\n */\nexport const headTagtCanvasInfo = \"data-canvas-info\";\n/**\n * App type name of sharedWidgets app\n */\nexport const sharedWidgetsAppTypeName = \"sharedWidgets\";\n/**\n * App type name of MSN studio app\n */\nexport const msnStudioAppTypeName = \"msnStudio\";\n/**\n * App type name of bingHomepage app\n */\nexport const bingHomepageAppTypeName = \"bingHomepage\";\n/**\n * Page type of bingHomepage app (default search page)\n */\nexport const bingHomepagePageType = \"widgetfeed\";\n/**\n * Page type of bingHomepage app (no search results page)\n */\nexport const bingNoResultsPageType = \"bingNoResultsPage\";\n/**\n * Page name of bingHomepage app\n */\nexport const bingHomepagePageName = \"widgetfeed\";\n/**\n * Ocid of bingHomepage app\n */\nexport const bingHomepageOcid = \"BingHp01\";\n/**\n * Ocid of sharedWidgets app\n */\nexport const sharedWidgetsOcid = \"hpwidget\";\n/**\n * Ocid of sharedWidgets app\n */\nexport const msnStudioOcid = \"msnstudio\";\n/**\n * Page Product of bingHomepage app\n */\nexport const bingHomepageProductName = \"bing\";\n/**\n * Widget Custom Event name\n */\nexport const widgetCustomEventName = \"PeregrineWidgetEvent\";\n/**\n * App type name of distribution app\n */\nexport const distributionAppTypeName = \"distribution\";\n/**\n * Page type of distribution app\n */\nexport const distributionPageType = \"widgetfeed\";\n/**\n * Page name of distribution app\n */\nexport const distributionPageName = \"widgetfeed\";\n/**\n * Ocid of distribution app\n */\nexport const distributionOcid = \"distribution\";\n/**\n * Page Product of distribution app\n */\nexport const distributionProductName = \"distribution\";\n/**\n* Static Server Endpoint name\n*/\nexport const staticServerEndpoint = \"staticview.msn.com\";\n/**\n* Static Server Endpoint name for cn domain\n*/\nexport const staticServerEndpointCnDomain = \"staticview.msn.cn\";\n/**\n * PCS Response cache key\n */\nexport const pwPcsResponseCacheKey = \"pw-pcsresponse\";\n/**\n * Duration of time until PCS response is considered valid from cache.\n * 172800000 = 2 days in milliseconds\n * 2 days: because telemetry pipeline would throw away events with activity id older than 2 days\n */\nexport const pwPcsResponseCacheDuration = 172800000;\n/**\n * Duration of time until PCS response is considered valid from cache for Prong 2\n * 30000 = 30 seconds in milliseconds\n * 30 seconds: because Prong 2 has several flights where a live call to PCS is needed for updating the\n * response info and cannot rely on the stale info in the cache from longer periods.\n*/\nexport const pwPcsResponseProng2CacheDuration = 30000;\n/**\n * Duration of time until PCS response is considered valid from cache for always cached app\n * 2592000000 = 30 days in milliseconds\n * for always cached app, the concept is that we always want user to load the \"previous app version\" from cache.\n * Then we use an app cache manager to update the cache in the background.\n * Then the cache mamanger will decide if current app version is to old and current page view need to be reloaded\n * ideally the cache duration can be set to a very long time like 1 year, which is depends on how long the history app\n * bundles are stored in the server. But for now, we set it to 30 days.\n * NOTE: to understand the SRM issue, we use a very short cache duration for now. Then plan to gradually increase it, until we see the SRM issue happens.\n */\nexport const alwaysCachedAppPcsResponseCacheDuration = 86400000; // 24hrs\n/**\n * Loading icon class name\n */\nexport const widgetLoadingIconClassName = \"peregrine-widget-load-icon\";\n/**\n * EdgeChromium expected widget cards local storage key.\n */\nexport const expectedWidgetsCardsLocalStorageKey = \"expected-widget-cards\";\nexport const widgetsCardsArgsKey = \"widgets-cards-args\";\n//# sourceMappingURL=Widgets.js.map","// © Microsoft Corporation. All rights reserved.\nimport { canUseDOM } from \"@msnews/isomorphic-util\";\n/**\n * Check if widgets loading is supported by the host page\n * @returns true if widgets is supported for rendering else false.\n */\nexport function shouldRenderWidgets() {\n // Make sure that this script runs on proper environment\n // Example: IE11 doesn't support fetch: https://www.caniuse.com/?search=fetch\n if (!canUseDOM()\n || typeof location === \"undefined\"\n || typeof fetch === \"undefined\") {\n console.error(\"Missing required global features.\");\n return false;\n }\n // Check if browser has following support in order to classify as a modern browser.\n // This will help render React or Web component based Widget(s) on modern browsers.\n // If host page accidentally calls widget-initializer script on unsupported browser,\n // this will protect host page, by not rendering widgets on unsupported browser.\n if (typeof customElements === \"undefined\"\n || typeof ShadowRoot === \"undefined\"\n || typeof HTMLTemplateElement === \"undefined\") {\n console.error(\"Not sure if this is modern browser to render widgets!\");\n return false;\n }\n return true;\n}\n/**\n * Get random guid as RID/ActivityId since PCS call is not made yet\n * @returns GUID\n */\nexport function getRandomGuid() {\n return \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = Math.random() * 16 | 0;\n const v = c == \"x\" ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\n/**\n * Use pg.p as telemetry => pageProduct if provided by the host page.\n * For windows, use pg.p as entwindowsdash if query=\"enterprise\" is found in pcsAdditionalQsp else use windowsdash.\n * By default use pg.p as appType\n * @param appType appType found in the data-widget json.\n * @param pageProduct pageProduct found in the telemetry object in data-widget json.\n * @param pcsAdditionalQsp pcsAdditionalQsp attribute in the data-widget json. Example: \"locale=en-US®ion=US&query=enterprise\"\n * @returns pg.p (pageProduct) to be used by the widget initializer app errors.\n */\nexport function getTelemetryPageProduct(appType, pageProduct = null, pcsAdditionalQsp = null) {\n // Use pageProduct as pg.p if specified by the host page. Example:\n // data-widget: { telemetry: { pageProduct: \"bing\"}} then we will return \"bing\" as pg.p\n if (pageProduct && pageProduct.length > 0) {\n return pageProduct;\n }\n // Applicable to AppTypes: winwidgets and windowsnewsplus\n // \"query\" in pcsAdditionalQsp is typically used by prong2 to distinguish pg.p\n // Based on this query prong2 differentiate enteprise and retail app errors.\n if (appType === \"windowsNewsPlus\" /* AppType.WindowsNewsPlus */ || appType === \"winWidgets\" /* AppType.WindowsNewsWidgets */) {\n return pcsAdditionalQsp && pcsAdditionalQsp.includes(\"query=enterprise\")\n ? \"entwindowsdash\"\n : \"windowsdash\";\n }\n // Default pg.p as appType\n return appType;\n}\n/**\n * Check if Prong2 MarketSelector enabled\n * @returns true if Prong2 MarketSelector enable else false.\n */\nexport function isMarketSelectorEnabled(appType, flights) {\n return appType === \"winWidgets\" /* AppType.WindowsNewsWidgets */ && flights.includes(\"prg-pr2-marketsel\");\n}\n//# sourceMappingURL=Utilities.js.map","// © Microsoft Corporation. All rights reserved.\nimport { CustomEventPayloadStage, CustomWidgetErrorEvent, dispatchCustomEvent } from \"./ErrorDispatcher\";\nimport { getRandomGuid, getTelemetryPageProduct } from \"./Utilities\";\nlet loggingEndpoint;\nexport let dataWidgetAttributes;\nexport let clientSettings;\nexport let navigatorObj;\n/**\n * Set logging metadata like appType, pageType and market\n * @param dataWidgetAttr\n */\nexport function setLoggingMetadata(dataWidgetAttr, clientSettingsParam) {\n if (dataWidgetAttr) {\n dataWidgetAttributes = dataWidgetAttr;\n }\n if (clientSettingsParam) {\n clientSettings = clientSettingsParam;\n }\n if (!navigatorObj) {\n // window.navigator doesn't exist in IE 11\n // https://caniuse.com/?search=navigator\n const { connection = {}, deviceMemory = \"\", hardwareConcurrency } = window.navigator || {};\n navigatorObj = {\n connectionEffectiveType: connection && connection.effectiveType,\n deviceMemory,\n hardwareConcurrency\n };\n }\n}\n/**\n * Logs error to the given endpoint (e.g. otf). ONLY USE FROM INLINE SCRIPTS.\n * @param message - The error message\n * @param appErrorId - The app error id to be logged\n * @param propertyBag - The blob to store additional error information\n */\nexport async function logError(message, appErrorId, propertyBag) {\n try {\n const settingsObject = {};\n const params = getLoggingParameters(settingsObject);\n let iKey = \"\";\n if (params && params[\"apikey\"]) {\n iKey = getIKeyValue(params[\"apikey\"]);\n }\n const payload = await getLoggingPayload(appErrorId, message, iKey, propertyBag);\n dispatchError(message, params, payload);\n if (params && payload) {\n // Print app error on console\n console.error(payload);\n // fire and forget\n navigator.sendBeacon(\"https://\" + loggingEndpoint + \"/OneCollector/1.0\" + formatParams(params), payload);\n }\n else {\n // eslint-disable-next-line @cs-core/no-console-logs\n console.log(\"missing required params. \" + message);\n }\n }\n catch (error) {\n // eslint-disable-next-line @cs-core/no-console-logs\n console.log(`Error ${error} logging the app error. ${message}`);\n dispatchError(message, {}, \"\");\n }\n}\n/**\n * Verify if the core JS files loaded.\n * NOTE: We cannot verify the experience bundle directly as Experiences does not show up in webpackJsonp.\n * !IMPORTANT!:\n * The same function exists mostly the same in libs\\page-error-handling\\src\\CommonErrorHandlers.ts. Update that function with any changes.\n * @param bundlesToVerify - Use to customize the names of the bundles to verify. Default is [\"vendors\", \"common\", \"microsoft\"]\n * @param errorMessage - Use to customize the logged error message. Default is\"Error when loading bundle(s): \".\n * @param timeout - Use to customize the timeout. Default is 10 seconds.\n * @param callback - on failure call the specified function\n */\nexport function verifyJSLoading(bundlesToVerify = [\"vendors\", \"common\", \"microsoft\"], errorMessage = \"Error when loading bundle(s): \", timeout = 15000, callback) {\n setTimeout(() => {\n const webpackJsonp = window.webpackJsonp;\n if (webpackJsonp) {\n const webpackLength = webpackJsonp.length;\n // The upperbound should always be 1 more than the bundle count.\n const expectedBundlesLength = bundlesToVerify.length + 1;\n if (webpackLength < expectedBundlesLength) {\n if (webpackLength === (expectedBundlesLength - 1)) {\n // experience failed to load so reset array to the generic name and do not cycle thru list.\n bundlesToVerify = [\"experience\"];\n }\n else {\n // An error occured loading our JS files. See which one failed to load.\n const slicedArray = webpackJsonp.slice(0, expectedBundlesLength);\n slicedArray.forEach(bundle => {\n if (bundle.length && bundle[0][0]) {\n bundlesToVerify = bundlesToVerify.splice(bundlesToVerify.indexOf(bundle[0][0]), 1);\n }\n });\n }\n try {\n logError(errorMessage + bundlesToVerify.toString(), 20202, {});\n }\n finally {\n if (callback) {\n callback();\n }\n }\n }\n }\n }, timeout);\n}\n/**\n * Dispatch common error to host page\n * @param message - The error message\n * @param params - The logging parameters\n * @param payload - The logging payload\n */\nfunction dispatchError(message, params, payload) {\n dispatchCustomEvent(CustomWidgetErrorEvent, {\n stage: CustomEventPayloadStage.ALL,\n message,\n extra: {\n payload,\n params\n }\n });\n}\n/**\n * Gets data to set the logging parameters\n * @param settingsObject - The object containing client settings\n */\nfunction getLoggingParameters(settingsObject) {\n if (settingsObject) {\n const { pcsInfo, pageGenTime } = settingsObject;\n const uploadTime = new Date(pageGenTime).getTime();\n const isProd = !pcsInfo || pcsInfo.env === \"prod\";\n // JSLL endpoints\n loggingEndpoint = isProd\n ? `browser.events.data.msn.${dataWidgetAttributes.useCnDomain ? \"cn\" : \"com\"}`\n : `events-sandbox.data.msn.${dataWidgetAttributes.useCnDomain ? \"cn\" : \"com\"}`;\n const apikey = isProd\n ? \"0ded60c75e44443aa3484c42c1c43fe8-9fc57d3f-fdac-4bcf-b927-75eafe60192e-7279\"\n : \"f8857dedc6f54ca8962cfb713e01e7d7-e9250191-fe0b-446f-95ae-07516262f98c-7028\";\n return {\n cors: \"true\",\n \"content-type\": \"application/x-json-stream\",\n \"client-id\": \"NO_AUTH\",\n \"client-version\": \"1DS-Web-JS-2.2.2\",\n apikey: apikey,\n \"upload-time\": uploadTime,\n w: \"0\",\n anoncknm: \"app_anon\"\n };\n }\n return null;\n}\n/**\n * Gets data to set the logging payload\n * @param appErrorId - The app error id to be logged\n * @param message - The error message\n * @param iKey - The key for authenticating on 1DS endpoint\n * @param propertyBag - The blob to store additional error information\n * @param flightIds - The flight ids\n */\nasync function getLoggingPayload(appErrorId, message, iKey, propertyBag) {\n if (!dataWidgetAttributes) {\n return;\n }\n const { appType, pageType, cm, telemetry = {}, pcsAdditionalQsp = \"\" } = dataWidgetAttributes;\n const { pageProduct, pagetype: telemetryPageType } = telemetry;\n const reportingPageType = telemetryPageType || pageType || \"dhp\";\n // Add all data widget attributes (ex: apptype, pagetype, cm, cookie info, etc.) into property bag.\n propertyBag = propertyBag || {};\n propertyBag.dataWidgetAttributes = dataWidgetAttributes;\n // Instrument PCS and client's build number and environment.\n if (clientSettings) {\n const { bundleInfo, pcsInfo } = clientSettings;\n if (pcsInfo) {\n propertyBag.pcsVersion = pcsInfo.v;\n propertyBag.pcsEnv = pcsInfo.env;\n }\n const { alias, v } = bundleInfo || {};\n // Capture build version info\n propertyBag.build = v;\n propertyBag.buildAlias = alias;\n }\n // Add network diagnostics when available\n if (navigatorObj) {\n propertyBag.navigator = navigatorObj;\n }\n // NOTE: since the PCS API call is not made by the host page yet, we do not know rid/aid.\n // Hence we need to generate RID at client\n const rid = getRandomGuid();\n // @ts-ignore\n const tryGetCustomAppErrorEventNameAsync = typeof window === \"object\" && window._tryGetCustomAppErrorEventNameAsync;\n const name = typeof tryGetCustomAppErrorEventNameAsync === \"function\" && await tryGetCustomAppErrorEventNameAsync() || \"MS.News.Web.AppError\";\n // Setting RID=AID might not be correct. The more complex logic in the bundles may determine that we have already burned this as a RID\n // and generate a new one different from AID. But it's better than nothing and we cannot see AID on app error reports right now.\n // Most of the time when we are not using app cache these two will be the same.\n const payload = {\n name: name,\n time: new Date().toISOString(),\n ver: \"4.0\",\n iKey: `o:${iKey}`,\n data: {\n baseData: {},\n baseType: \"MS.News.Web.Base\",\n page: {\n name: \"default\",\n product: getTelemetryPageProduct(appType, pageProduct, pcsAdditionalQsp),\n type: isProng2AppType(appType) ? \"dhp\" : reportingPageType,\n content: {\n category: \"standaloneError\"\n }\n },\n browser: {\n // Assume that cookie consent is not provided so muid is not being sent from cookie\n clientId: \"\"\n },\n flight: {\n id: \"\"\n },\n request: {\n activityId: rid,\n requestId: rid,\n afdMuid: clientSettings && clientSettings.fd_muid ? clientSettings.fd_muid : \"\"\n },\n locale: {\n mkt: cm\n },\n extSchema: {\n id: appErrorId,\n severity: 0,\n pb: propertyBag,\n message: message\n }\n }\n };\n return payload ? JSON.stringify(payload) : null;\n}\n/**\n * Format query string parameters\n * @param params - The logging params\n */\nfunction formatParams(params) {\n return \"?\" + Object\n .keys(params)\n .map(function (key) {\n return key + \"=\" + encodeURIComponent(params[key]);\n }).join(\"&\");\n}\n/**\n * Extracts the value of iKey from apikey\n * @param apikey - The value of apikey for 1DS authentication\n */\nfunction getIKeyValue(apikey) {\n if (apikey) {\n const iKeyIndex = apikey.indexOf(\"-\");\n if (iKeyIndex > 0) {\n return apikey.substring(0, iKeyIndex);\n }\n }\n return \"\";\n}\n/**\n * Helper to tell if app is prong2\n * @param appType The type to evaluate\n * @returns True if appType corresponds to a vesion of prong2, False otherwise\n */\nexport function isProng2AppType(appType) {\n return appType === \"windowsNewsPlus\" /* AppType.WindowsNewsPlus */ || appType === \"winWidgets\" /* AppType.WindowsNewsWidgets */;\n}\n/**\n * NOTE: TOBE USED ONLY FOR UNIT TESTS\n */\nexport function resetIntermediateState() {\n dataWidgetAttributes = undefined;\n clientSettings = undefined;\n navigatorObj = undefined;\n}\n//# sourceMappingURL=ErrorLogging.js.map","// © Microsoft Corporation. All rights reserved.\nimport { widgetGroupClassName, widgetLoadingIconClassName } from \"@msnews/experiences-constants\";\n/**\n * Local variable to store the state of loading icon in widget initializer\n */\nlet loadingIconRemoved = false;\n/**\n * Once this timeout is hit, loading icon will be removed on the host page\n */\nconst LOADING_ICON_REMOVAL_TIMEOUT = 5000;\n/**\n * Add loading icon under peregrine widget group div\n * @param renderWidgetsIcon This boolean value is provided by the host page\n * @param peregrineWidgetGroupDiv\n */\nexport function addLoadingIcon(dataWidgetAttributes) {\n if (!dataWidgetAttributes\n || !dataWidgetAttributes.clientPerf\n || !dataWidgetAttributes.clientPerf.shouldShowLoadingIcon) {\n return;\n }\n const peregrineWidgetGroupDiv = getWidgetGroupDiv();\n if (!peregrineWidgetGroupDiv) {\n return;\n }\n const widgetLoadingIconImg = document.createElement(\"img\");\n widgetLoadingIconImg.setAttribute(\"class\", widgetLoadingIconClassName);\n widgetLoadingIconImg.setAttribute(\"src\", getLoadingImageUrl(dataWidgetAttributes.useCnDomain));\n widgetLoadingIconImg.setAttribute(\"alt\", \"Loading\");\n widgetLoadingIconImg.setAttribute(\"style\", \"display:block;margin:auto;\");\n peregrineWidgetGroupDiv.appendChild(widgetLoadingIconImg);\n // This handler will enable us to remove \"loading\" icon later in the core bundles.\n window._pw_removeLoadingIcon = removeLoadingIcon;\n // After a given timeout, remove the loading icon\n setTimeout(removeLoadingIcon, LOADING_ICON_REMOVAL_TIMEOUT);\n}\n/**\n * Removes loading icon element from the host page under peregrine-widgetgroup div\n */\nfunction removeLoadingIcon() {\n if (loadingIconRemoved) {\n return;\n }\n const peregrineWidgetGroupDiv = getWidgetGroupDiv();\n if (!peregrineWidgetGroupDiv) {\n return;\n }\n const widgetLoadingIconElement = peregrineWidgetGroupDiv.getElementsByClassName(widgetLoadingIconClassName)[0];\n if (widgetLoadingIconElement) {\n peregrineWidgetGroupDiv.removeChild(widgetLoadingIconElement);\n loadingIconRemoved = true;\n }\n}\n/**\n * Get loading image asset url\n * @param useCnDomain\n * @returns Loading asset url\n */\nfunction getLoadingImageUrl(useCnDomain) {\n return `https://assets.msn.${useCnDomain ? \"cn\" : \"com\"}/staticsb/statics/latest/widget/LoadingImg.gif`;\n}\n/**\n * Get div with class name \"peregrine-widgetgroup\"\n * @returns specific div\n */\nfunction getWidgetGroupDiv() {\n return document.body.getElementsByClassName(widgetGroupClassName)[0];\n}\n/**\n * TO BE USED ONLY FOR UNIT TEST CONTEXT\n */\nexport function resetLocalVariables() {\n loadingIconRemoved = false;\n}\n//# sourceMappingURL=LoadingIcon.js.map","// © Microsoft Corporation. All rights reserved.\n/**\n * Get override params for appType, pageType and cm.\n */\nexport function getOverrideParams() {\n const queryParams = location.search && location.search.replace(\"?\", \"\").split(\"&\");\n // This ensures that overrideParams will be always defined so no need to check undefined or null in the caller.\n const overrideParams = {};\n if (!queryParams) {\n return overrideParams;\n }\n // Loop through query params and set appType, pageType and cm in overrideParams.\n // Example:\n // QSP item=appType:windowsShell.\n // This will set overrideParams.appType to be windowsShell\n // overrideParams.pageType and overrideParams.cm will be null.\n for (let i = 0; i < queryParams.length; i++) {\n const itemQsp = queryParams[i];\n const pair = itemQsp.split(\"=\");\n if (pair.length !== 2) {\n continue;\n }\n // Following QSPs are used in statics context/debugging.\n const qspKey = decodeURIComponent(pair[0]);\n const qspValue = decodeURIComponent(pair[1]);\n if (qspKey === \"instance\") {\n overrideParams.staticsAttributes = {\n ...overrideParams.staticsAttributes,\n instance: qspValue\n };\n }\n if (qspKey === \"staticsEnv\") {\n overrideParams.staticsAttributes = {\n ...overrideParams.staticsAttributes,\n staticsEnv: qspValue\n };\n }\n // Following code is for item QSPs.\n if (\n // decodeURIComponent exist in all browsers. https://www.caniuse.com/?search=decodeURIComponent\n qspKey === \"item\"\n && qspValue) {\n const itemPair = qspValue.split(\":\");\n if (itemPair\n && itemPair.length === 2\n && itemPair[0]\n && itemPair[1]) {\n const value = itemPair[1];\n // Add instance=intpr or instance=intperf QSP if item=pcsenv:intpr or item=pcsenv:intperf\n const pcsEnvQsp = (itemPair[0] === \"pcsenv\" && (value === \"intpr\" || value === \"intperf\")) && `instance=${value}`;\n overrideParams.pcsAdditionalQsp = `${overrideParams.pcsAdditionalQsp ? `${overrideParams.pcsAdditionalQsp}&` : \"\"}${pcsEnvQsp || itemQsp}`;\n switch (itemPair[0]) {\n case \"appType\":\n overrideParams.appType = value;\n break;\n case \"pageType\":\n overrideParams.pageType = value;\n break;\n case \"cm\":\n overrideParams.cm = value;\n break;\n case \"dl\":\n overrideParams.dl = value;\n break;\n case \"useCnDomain\":\n overrideParams.useCnDomain = value === \"true\";\n break;\n case \"reportingOcid\":\n overrideParams.telemetry = {\n ...overrideParams.telemetry,\n ocid: value\n };\n break;\n case \"tmpl\":\n overrideParams.telemetry = {\n ...overrideParams.telemetry,\n tmpl: value\n };\n break;\n case \"feedOcid\":\n overrideParams.feed = {\n ...overrideParams.feed,\n ocid: value\n };\n break;\n case \"feedApiKey\":\n overrideParams.feed = {\n ...overrideParams.feed,\n apiKey: value\n };\n break;\n case \"shouldPreFetchPcsResponse\":\n overrideParams.clientPerf = {\n ...overrideParams.clientPerf,\n shouldPreFetchPcsResponse: value === \"true\"\n };\n break;\n case \"shouldUsePWOnlyFlights\":\n overrideParams.clientPerf = {\n ...overrideParams.clientPerf,\n shouldUsePWOnlyFlights: value === \"true\"\n };\n break;\n case \"shouldShowLoadingIcon\":\n overrideParams.clientPerf = {\n ...overrideParams.clientPerf,\n shouldShowLoadingIcon: value === \"true\"\n };\n break;\n }\n }\n }\n }\n return overrideParams;\n}\nexport const PcsMicrosoftStartEnvironment = \"microsoftstart\";\nexport const PcsMicrosoftStartQueryParam = \"item=pcsenv:microsoftstart\";\n/**\n * For debugging purpose: get pcs env from query string param\n * @param appType\n * @returns string (www, int, int1 or microsoftstart)\n */\nexport function getPcsEnvironment(appType = \"\", pcsAdditionalQsp = \"\") {\n const queryParams = location.search?.replace(\"?\", \"\").split(\"&\");\n if (queryParams) {\n // indexOf exist in IE9 and above. https://www.caniuse.com/?search=indexof\n if (queryParams.indexOf(\"item=pcsenv:int1\") > -1) {\n return \"int1\";\n }\n if (queryParams.indexOf(\"item=pcsenv:int\") > -1\n || queryParams.indexOf(\"item=pcsenv:intpr\") > -1\n || queryParams.indexOf(\"item=pcsenv:intperf\") > -1) {\n return \"int\";\n }\n if (appType === \"distribution\" /* AppType.Distribution */ || queryParams.indexOf(PcsMicrosoftStartQueryParam) > -1) {\n return PcsMicrosoftStartEnvironment;\n }\n }\n const inlineQueryParams = pcsAdditionalQsp && pcsAdditionalQsp.replace(\"?\", \"\").split(\"&\");\n if (inlineQueryParams) {\n if (inlineQueryParams.indexOf(PcsMicrosoftStartQueryParam) > -1) {\n return PcsMicrosoftStartEnvironment;\n }\n }\n // Default behavior\n return \"www\";\n}\n//# sourceMappingURL=GetOverrideParams.js.map","// © Microsoft Corporation. All rights reserved.\nimport { getOverrideParams, getPcsEnvironment } from \"./GetOverrideParams\";\nimport { logError, setLoggingMetadata } from \"./ErrorLogging\";\nimport { widgetGroupClassName, widgetInfoAttribute } from \"@msnews/experiences-constants\";\n/**\n * Gets the attribute data for widget.\n * These attributes include appType, pageType, cm, pcs-environment and pcs-additional-qsp\n * @returns DataWidgetAttributes with the above data.\n */\nexport function getDataWidgetAttributes() {\n // Parse appropriate div and get data-widget attribute.\n const peregrineGroupDiv = document.body.getElementsByClassName(widgetGroupClassName);\n // getAttribute exist in all browsers. https://www.caniuse.com/?search=element.getAttribute\n const dataWidget = peregrineGroupDiv && peregrineGroupDiv[0]?.getAttribute(widgetInfoAttribute);\n if (!dataWidget) {\n // Cannot log app error here since we need appType, page type and market from DataWidgetAttributes as mandatory params to log app error.\n console.error(\"Missing getElementsByClassName, peregrine-widgetgroup or data-widget\");\n return;\n }\n let dataWidgetInlineParams = {};\n try {\n // Get appType and pageType from data-widget attribute.\n // JSON.parse exist in IE8 and above and in most other browsers: https://www.caniuse.com/?search=JSON.parse\n // JSON.parse Throws a SyntaxError exception so wrapping in try-catch.\n dataWidgetInlineParams = JSON.parse(dataWidget);\n }\n catch (e) {\n // Cannot log app error here since we need appType, page type and market from DataWidgetAttributes as mandatory params to log app error.\n console.error(\"dataWidget to parse is not valid JSON\");\n return;\n }\n // Debug only: set override params if exist.\n // location.search exist in all browsers: https://www.caniuse.com/?search=location.search\n const overrideParams = getOverrideParams();\n const appType = overrideParams.appType || dataWidgetInlineParams.appType;\n const dataWidgetAttributes = {\n appType,\n cm: overrideParams.cm || dataWidgetInlineParams.cm,\n dl: overrideParams.dl || dataWidgetInlineParams.dl,\n clientPerf: overrideParams.clientPerf || dataWidgetInlineParams.clientPerf,\n feed: overrideParams.feed || dataWidgetInlineParams.feed,\n pageType: overrideParams.pageType || dataWidgetInlineParams.pageType,\n pcsEnvironment: getPcsEnvironment(appType, dataWidgetInlineParams.pcsAdditionalQsp),\n telemetry: overrideParams.telemetry || dataWidgetInlineParams.telemetry,\n // useCnDomain will be always set to true or false.\n // This will not be undefined\n useCnDomain: overrideParams.useCnDomain || dataWidgetInlineParams.useCnDomain || false,\n // This property bag is typically used by the host page to pass run time properties to Peregrine widgets.\n // Overriding of propertyBag using QSP against propertyBag in div, is not supported.\n // To test propertyBag, please add propertyBag to host page div directly in data-widget json.\n propertyBag: dataWidgetInlineParams.propertyBag,\n staticsAttributes: overrideParams.staticsAttributes || dataWidgetInlineParams.staticsAttributes\n };\n // Set app error meta data attributes\n setLoggingMetadata(dataWidgetAttributes);\n if (!dataWidgetAttributes.appType || !dataWidgetAttributes.pageType || !dataWidgetAttributes.pcsEnvironment) {\n let missingProp = \"Missing required params in \" + widgetInfoAttribute;\n missingProp += \"\\n\\tappType: \" + dataWidgetAttributes.appType + \"\\n\\tpageType: \" + dataWidgetAttributes.pageType + \"\\n\\tpcsEnvironment: \" + dataWidgetAttributes.pcsEnvironment;\n logError(missingProp, 43711, {});\n return;\n }\n const queryStringParams = [];\n // Get query params from overrides: typically page QSPs\n if (overrideParams.pcsAdditionalQsp) {\n queryStringParams.push(overrideParams.pcsAdditionalQsp);\n }\n // Get query params from div pcsAdditionalQsp inline\n if (dataWidgetInlineParams.pcsAdditionalQsp) {\n queryStringParams.push(dataWidgetInlineParams.pcsAdditionalQsp);\n }\n // Get cm query param from div inline\n if (dataWidgetAttributes.cm) {\n queryStringParams.push(`cm=${dataWidgetAttributes.cm}`);\n }\n // Get dl query param from div inline\n if (dataWidgetAttributes.dl) {\n queryStringParams.push(`dl=${dataWidgetAttributes.dl}`);\n }\n // Merge query params that are present\n if (queryStringParams && queryStringParams.length > 0) {\n dataWidgetAttributes.pcsAdditionalQsp = queryStringParams.join(\"&\");\n }\n return dataWidgetAttributes;\n}\n//# sourceMappingURL=GetDataWidgetAttributes.js.map","// © Microsoft Corporation. All rights reserved.\nconst appTimingsWindowPropertyName = \"_appTimings\";\n/**\n * Add given perf marker to pageTimings global object\n * TODO: We could use this function from diagnostic package but importing that is adding lot of unnecessary code\n * and that is bloating size of widgetInitializer.js from 7 kb to few mb.\n * @param marker name\n */\nexport function addMarkerToPageTimings(marker) {\n if (!performance || !performance.now) {\n return;\n }\n const pageTimings = window._pageTimings || (window._pageTimings = {});\n pageTimings[marker] = Math.round(performance.now());\n}\n/**\n * Add given perf marker to appTimings object\n * @param marker name\n */\nexport function addAppTraceMarker(marker) {\n if (!performance || !performance.now) {\n return;\n }\n const appTimings = window[appTimingsWindowPropertyName] || (window[appTimingsWindowPropertyName] = {});\n appTimings[marker] = performance.now();\n}\n/**\n * Gets current window._pageTimings object\n */\nexport function getPageTimings() {\n if (typeof window === \"object\" && window !== null) {\n return window._pageTimings || (window._pageTimings = {});\n }\n return {};\n}\n//# sourceMappingURL=AddMarkerToPageTimings.js.map","// © Microsoft Corporation. All rights reserved.\n/**\n * Converts the given error object to its string representation based on\n * the type of the input object.\n * @param error - the error object to convert to a string.\n * @param tryIncludeErrorStack - If true, will try to get the stack of the error\n * if the error is an actual Error object that has a stack.\n * @returns {string} - The string representation of the error.\n */\nexport function stringifyError(error, tryIncludeErrorStack) {\n if (error instanceof Error) {\n const message = error.toString();\n return tryIncludeErrorStack && error.stack\n ? `${message}, Stack: ${error.stack}`\n : message;\n }\n else if (typeof error === \"string\") {\n return error;\n }\n else {\n return tryStringifyJson(error);\n }\n}\n/**\n * Attempts to stringify json. Empty string in case of serialization error.\n * @param value - the JS value to convert to a string.\n * @returns {string} - Stringify'ed object\n */\nexport function tryStringifyJson(value) {\n // JSON.stringify returns `undefined` if `undefined` is passed\n // unlike how it handles `null` which is correctly converted to \"null\".\n // So we explicitly handle the undefined scenario here.\n if (value === undefined) {\n return \"undefined\";\n }\n try {\n return JSON.stringify(value);\n }\n catch {\n return \"[serialization-error]\";\n }\n}\n/**\n * Convert the given error \"value\" to an Error object.\n * It will retain the original error message if given an actual Error object\n * or otherwise the string representation of the input value will be used to create a new Error object.\n * @param error - The unknown error value to convert to an Error object.\n * @returns {Error} - The Error object created from the input value.\n */\nexport function toErrorObj(error) {\n return error instanceof Error\n ? error\n : new Error(stringifyError(error));\n}\n//# sourceMappingURL=ErrorHelper.js.map","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nexport default isKey;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nexport default baseGet;\n","// © Microsoft Corporation. All rights reserved.\nimport { CrsV31Endpoint, CrsV3Endpoint, Prong2ManualPcsCacheTreatmentId, Prong2PcsApiUseAkamaiEndpoint, Prong2PcsDurationTreatmentId, RemoveCrsFDHeadTreatment } from \"@msnews/experiences-constants\";\n/**\n * Remove the prefix and suffix of flightInfo and generate a flight list for prong 2.\n * @param flightInfo sample: \"f:prg-sp-liveapi,cprg-c-ads-dl;\"\n * @returns flight string list\n */\nexport function getProng2FlightList(flightInfo) {\n if (flightInfo.startsWith(\"f:\")) {\n flightInfo = flightInfo.substring(2);\n }\n if (flightInfo.endsWith(\";\")) {\n flightInfo = flightInfo.substring(0, flightInfo.length - 1);\n }\n return flightInfo.split(\",\");\n}\n/**\n * Check if Git configs should be used\n * @param {string} version - CRS version. Example: v2 or v3 (case sensitive)\n * @param {string} configIndexDocId. Example: cms/api/amp/experienceConfigIndex/BBUsYQa\n * @param {string} apptype. Example: edgeChromium\n * @returns true if git configs are supported\n */\nexport function shouldUseGitConfigs(version, configIndexDocId, apptype) {\n // If app type is not defined or empty, do not use Git configs.\n // For local dev scenarion of individual experiences running in standalone, app type is blank.\n // Also app type is MUST param in Git configs, if app type is not present, we do not want to attempt Git configs too in prod.\n // If version is not present or it is not v3 and or v3.1, do not support Git configs\n if (!apptype || !version || (version < CrsV3Endpoint)) {\n return false;\n }\n // Return true if this does not have configIndexDocId\n return !configIndexDocId;\n}\n/**\n * Checks if flight exist (prg-crs31) if it does out new crs version will point to V3.1,\n * otherwise we will point to the value that is in PCS head data. (Service endpoints).\n * @param version CRS Version from PCS head data\n * @param flights flights from current request.\n * @returns version of crs to be used. (V3 or V3.1) V3.1 will be flight based.\n */\nexport function tryGetCrsVersion(version, flights, appType) {\n try {\n // Excluding weather and fiance app types from this flight b/c they are SSR enabled, therefore not going to afd\n // when making the crs request, which is necessary for this flight.\n return version &&\n flights &&\n flights.includes(RemoveCrsFDHeadTreatment) &&\n (appType !== \"weather\" /* AppType.Weather */ && appType !== \"finance\" /* AppType.Finance */) ? CrsV31Endpoint : version;\n }\n catch (error) {\n // flights is not an array\n }\n return version;\n}\n/**\n * Determine if 1S request should use fdhead QSP.\n */\nexport function shouldOneServiceUseFdheadQsp(replaceOneServiceQspOverrides, isNtpSsr = false) {\n const { itemOverrides } = replaceOneServiceQspOverrides || {};\n // Check override QSP. Example: item=should1sUseFdheadQsp:true or item=should1sUseFdheadQsp:false\n const itemQsp = itemOverrides && itemOverrides.find(item => item.key === \"should1sUseFdheadQsp\");\n if (itemQsp && itemQsp.value) {\n return itemQsp.value === \"true\";\n }\n // NTP SSR do not use fdhead QSP.\n if (isNtpSsr) {\n return false;\n }\n // Debug/test flags\n const qspFlights = itemOverrides && itemOverrides.find(item => item.key === \"flights\" || item.key.toLowerCase() === \"appendflights\");\n if (qspFlights && qspFlights.value && qspFlights.value.length > 0) {\n return true;\n }\n // Default\n return false;\n}\nfunction hasFlightInPcsResponse(pcsResponse, targetFlight) {\n const flightInfo = pcsResponse?.pcsData?.info || \"\";\n const flights = flightInfo.substring(2, flightInfo.length - 1).split(\",\");\n return flights.includes(targetFlight);\n}\n/**\n * Determine which PCS cache duration to use for Prong2.\n */\nexport function shouldDisableProng2CustomPcsCacheDuration(pcsResponse) {\n // If the flight is present, do not use the custom cache duration.\n return hasFlightInPcsResponse(pcsResponse, Prong2PcsDurationTreatmentId);\n}\n/**\n * Determine if Prong2 timeout PCS cache should be disabled.\n */\nexport function shouldDisableProng2TimeoutPcsCache(flights) {\n return !!(flights && flights.includes(Prong2ManualPcsCacheTreatmentId));\n}\n/**\n * Determine if we should only check Prong2 flights.\n * @param appType appType\n * @returns\n */\nexport function shouldOnlyCheckProng2Flights(appType) {\n return appType === \"winWidgets\" /* AppType.WindowsNewsWidgets */;\n}\n/**\n * Determine whether PCS requst should use Akamai endpoint\n */\nexport function shouldProng2PcsApiUseAkamaiEndpoint(pcsResponse) {\n return hasFlightInPcsResponse(pcsResponse, Prong2PcsApiUseAkamaiEndpoint);\n}\n//# sourceMappingURL=FlightHelpers.js.map","// © Microsoft Corporation. All rights reserved.\n/**\n * Utility method to extract query string param in url.\n * @param name - Query param name\n * @returns Query param value\n */\nexport function getQueryParameterByName(locationHref, name) {\n const nameRegEx = name.replace(/[[\\]]/g, \"\\\\$&\");\n const regex = new RegExp(\"[?&]\" + nameRegEx + \"(=([^]*)|&|#|$)\");\n const queryNameValueMatches = regex.exec(locationHref);\n if (!queryNameValueMatches) {\n return null;\n }\n // the second group would contain the value of the param\n const queryValue = queryNameValueMatches[2];\n return decodeURIComponent(queryValue.replace(/\\+/g, \" \")) || \"\";\n}\n//# sourceMappingURL=Util.js.map","// © Microsoft Corporation. All rights reserved.\nimport { LiteLogger } from \"./LiteLogger\";\n/**\n * Set the logger instance.\n * @param _logger The logger instance to change to.\n */\nexport function setLogger(_logger) {\n logger = _logger;\n}\n/** Logger used by everyone. Default is LiteLogger. Please set up desired logger implementaiton with setLogger(). */\nexport let logger = new LiteLogger();\n//# sourceMappingURL=Logger.js.map","// © Microsoft Corporation. All rights reserved.\nimport { getQueryParameterByName } from \"./Util\";\nimport { canUseDOM } from \"@msnews/isomorphic-util\";\n/**\n * Logger that simply logs to console with minimum dependencies.\n * Used for bootstrap/inline script where we don't need any logging nor its dependencies.\n */\nexport class LiteLogger {\n /**\n * The constructor\n */\n constructor() {\n if (canUseDOM()) {\n this.isDebugEnabled = ((getQueryParameterByName(window.location.href, \"debug\") || \"\").toLowerCase() in { 1: 1, true: 1 }) ||\n ((getQueryParameterByName(window.location.href, \"reqsrc\") || \"\").toLowerCase() === \"vp\");\n // On debug mode, make webpack_require available as global function\n // so any code in packages could be triggered from console. Handy for debugging.\n if (this.isDebugEnabled && !global[\"TEST_ENV\"]) {\n window.webpackRequire = __webpack_require__;\n }\n }\n else {\n this.isDebugEnabled = false; // isDebugEnabled should be set explictly using the setDebug method\n }\n }\n /**\n * Returns the logging service\n * @returns {ILoggingService}\n */\n getLoggingService() {\n return null;\n }\n /**\n * Checks whether we're running in debug mode.\n * @returns True when either debug=1 or debug=true is present as a query param, otherwise false.\n */\n isDebug() {\n return this.isDebugEnabled;\n }\n /**\n * Override the isDebug setting. Useful when server side rendering.\n */\n setDebug(isDebug) {\n this.isDebugEnabled = isDebug;\n }\n /**\n * Set the tags to filter logs.\n * @param tags Tags to filter logs. If empty, do not filter.\n */\n setTags(tags) {\n // Not supported in console logger at the moment\n }\n /**\n * Log console message.\n * Note that these are not output to the console unless you're in debug mode.\n * @param message - Message to log.\n * @param tags - Optional tags for specifying log type for filtering logs.\n */\n log(message, tags) {\n if (this.isDebug()) {\n console.info(message);\n }\n }\n /**\n * Log error message.\n * @param message - Message to log\n */\n logError(message) {\n console.error(message);\n }\n /**\n * Lazy log console message. Use this when the message being constructed is complex or expensive so that it's only evaluated if needed.\n * Note that the callback is not invoked and the message is not output unless you're in debug mode.\n * @param getMessage - The function to call to get message to log\n */\n logCallback(getMessage) {\n if (this.isDebug()) {\n console.info(getMessage());\n }\n }\n /**\n * Log the objects to the console.\n * Note that these are not output to the console unless you're in debug mode.\n * @param message - Array of messages to log\n */\n logObjects(...message) {\n if (this.isDebug()) {\n console.log(...message);\n }\n }\n /**\n * Log the object to the console.\n * Note that these are not output to the console unless you're in debug mode.\n * @param message - Array of messages to log\n */\n logSingleObject(message, isMetrics) {\n if (this.isDebug()) {\n console.log(message);\n }\n }\n}\n//# sourceMappingURL=LiteLogger.js.map","// © Microsoft Corporation. All rights reserved.\n// Provides utility functions to get and set data from browser webStorage.\nimport { tryParseJson } from \"../utilities/Parsing\";\nimport { logger } from \"@msnews/diagnostics\";\n/**\n * Base class for localeStorage and sessionStorage abstractions\n */\nexport class WebStorage {\n /**\n * Check if the web storage is supported\n * @returns {boolean} true if supported\n */\n get supported() {\n return !!this.storage;\n }\n /**\n * Local storage object for persistent storage\n * @param storage Storage used.\n */\n constructor(storage) {\n this.storage = storage;\n }\n /**\n * Get given key's value from web storage\n * @param {string} key - Key name\n * @returns {string} Key value\n */\n getItem(key) {\n if (this.supported) {\n return this.storage.getItem(key);\n }\n }\n /**\n * Gets the value from local storage using the key.\n * @param {string} key - the storage key to store under\n * @param {T} defaultValue - the default value to return if parsing fails\n * @returns {T} The parsed JSON value\n */\n getObject(key, defaultValue) {\n const value = this.getItem(key);\n if (value != null) {\n const parsedObj = tryParseJson(value);\n if (parsedObj != null) {\n return parsedObj;\n }\n }\n return defaultValue;\n }\n /**\n * Gets given index location key from web storage\n * @param {string} key - Key name\n * @returns {string} Key value\n */\n key(index) {\n if (this.supported && index >= 0) {\n return this.storage.key(index);\n }\n }\n /**\n * Returns all the keys under the storage\n */\n keys() {\n return this.supported\n ? Object.keys(this.storage)\n : [];\n }\n /**\n * Sets the given value after stringifying as JSON\n * @param {string} key - the storage key to store under\n * @param {T} value - the value to serialize and store\n */\n setObject(key, value) {\n (value !== undefined)\n ? this.setItem(key, JSON.stringify(value))\n : this.removeItem(key);\n }\n /**\n * Removes the given key from storage and returns the existing value parsed\n * @param {string} key - the key to remove.\n */\n removeObject(key) {\n const value = this.removeItem(key);\n if (value != null) {\n return tryParseJson(value);\n }\n }\n /**\n * Set given key's value to local storage\n * @param {string} key - Key name\n * @param {string} value - Key value\n * @param {boolean} ignoreError - log error instead of throwing\n */\n setItem(key, value, ignoreError = true) {\n if (this.supported) {\n try {\n if (!value) {\n throw \"Attempted to store null/undefined value: \" + value;\n }\n this.storage.setItem(key, value);\n }\n catch (e) {\n if (ignoreError) {\n logger.logError(e);\n }\n else {\n throw e;\n }\n }\n }\n else if (!ignoreError) {\n throw new Error(\"WebStorage not supported\");\n }\n }\n /**\n * Get entry count of storage\n * @returns storage.length\n */\n get length() {\n if (this.supported) {\n return this.storage.length;\n }\n }\n /**\n * Remove key item from local storage\n * @param {string} key - Key name\n * @returns {string} Key value\n */\n removeItem(key) {\n if (this.supported) {\n const value = this.getItem(key);\n this.storage.removeItem(key);\n return value;\n }\n }\n /**\n * Removes all key/value pairs from storage, if there are any\n */\n clear() {\n if (this.supported) {\n this.storage.clear();\n }\n }\n /**\n * Removes all keys containing the given substring in the storage key\n * @param {string} substring The substring to check\n */\n removeSubstringKeys(substring) {\n if (!this.supported || !substring) {\n return;\n }\n const matchingKeys = [];\n for (let index = 0; index < this.storage.length; index++) {\n const storageKey = this.key(index);\n if (storageKey && storageKey.includes(substring)) {\n matchingKeys.push(storageKey);\n }\n }\n for (let index = 0; index < matchingKeys.length; index++) {\n this.removeItem(matchingKeys[index]);\n }\n }\n}\n//# sourceMappingURL=WebStorage.js.map","// © Microsoft Corporation. All rights reserved.\nimport { WebStorage } from \"./WebStorage\";\nimport { canUseDOM } from \"@msnews/isomorphic-util\";\n/* eslint-disable msnews-experiences-rules/no-direct-api-usage */\n/**\n * Local storage class for persistent storage\n */\nexport class LocalStorage extends WebStorage {\n constructor() {\n let storage = null;\n if (canUseDOM()) {\n try {\n storage = localStorage;\n }\n catch (ex) {\n // Getting local storage failed. Can happen in Chrome when user has disabled cookies.\n }\n }\n super(storage);\n }\n}\n/**\n * Set the local storage instance. Useful when setting up mock storage instance.\n * @param _storage The local storage instance to change to.\n */\nexport function setLocalStorage(_storage) {\n safeLocalStorage = _storage;\n}\n/**\n * Get the local storage instance. This should be used in place of window.localStorage\n * as the browser API would throw exception on browsers with cookies disabled.\n * @return The local storage instance.\n */\nexport function getLocalStorage() {\n return safeLocalStorage;\n}\nlet safeLocalStorage = new LocalStorage();\n//# sourceMappingURL=LocalStorage.js.map","// © Microsoft Corporation. All rights reserved.\nimport { addAppTraceMarker, addMarkerToPageTimings, getPageTimings } from \"./AddMarkerToPageTimings\";\nimport { isProng2AppType, logError } from \"./ErrorLogging\";\nimport { memoizeLite, stringifyError } from \"@msnews/core-helper\";\nimport { pwPcsResponseCacheDuration, alwaysCachedAppPcsResponseCacheDuration, pwPcsResponseCacheKey, staticServerEndpoint, staticServerEndpointCnDomain } from \"@msnews/experiences-constants\";\nimport { get } from \"lodash-es\";\nimport { shouldProng2PcsApiUseAkamaiEndpoint } from \"@msnews/experimentation-helpers\";\nimport { getLocalStorage } from \"@msnews/core\";\n/**\n * Timeout in miliseconds to terminate PCS or Statics network call.\n */\nconst timeoutInMs = 15000;\n// page timings keys\nconst pcsRetry = \"PcsRetry\";\nconst pcsCached = \"PcsCached\";\nconst pcsNoCacheReason = \"PcsNoCacheReason\";\n/**\n * Data Widget Attributes specified by the host page in the Div and override QSPs\n */\nlet dataWidgetAttributes;\n/**\n * This is used to delay writing response to local storage later.\n */\nlet pcsNetworkResponse;\n/**\n * This function calls and gets PCS response for client-setting, user data-info, and core-bundle scripts to render widgets.\n * @param hostPageAttributes contains the specific appType, pageType, cm and pcsAdditionalQsp information.\n * @returns an async response that contains the needed information above.\n */\nexport async function getPcsResponse(hostPageAttributes) {\n if (!hostPageAttributes) {\n return null;\n }\n const pageTimings = getPageTimings();\n pageTimings[pcsRetry] = 0;\n pageTimings[pcsCached] = 0;\n // Add perf marker and app trace marker on global timings objects\n addMarkerToPageTimings(\"WidgetsPcsCallStart\");\n addAppTraceMarker(\"WidgetsPcsCall-start\");\n // Set dataWidgetAttributes for global function\n dataWidgetAttributes = hostPageAttributes;\n let pcsCachedResponse = null;\n // Get PCS response from cache if specified by the host page by setting \"shouldPreFetchPcsResponse\" to be true\n const { appType, clientPerf } = dataWidgetAttributes;\n if ((clientPerf && clientPerf.shouldPreFetchPcsResponse)\n // Temporary remove appType === AppType.WindowsNewsWidgets for CRS spike experiment\n || appType && (appType === \"distribution\" /* AppType.Distribution */)) {\n // Set handler on global object so this can be called at a later point in time\n setHandlerToWritePcsResponseToCache();\n // Get PCS response from cache.\n pcsCachedResponse = await getPcsResponseFromCache();\n }\n else if (window.__useCachedApp) {\n // Get PCS response from cache.\n pcsCachedResponse = await getPcsResponseFromCache();\n }\n if (!pcsCachedResponse && clientPerf && clientPerf.customPrefetchStrategy) {\n let strategy = null;\n if (typeof clientPerf.customPrefetchStrategy === \"string\") {\n strategy = get(window, clientPerf.customPrefetchStrategy, null);\n }\n if (strategy) {\n try {\n pcsCachedResponse = await strategy;\n pcsCachedResponse = tryUpdatePcsResponse(pcsCachedResponse, dataWidgetAttributes.useCnDomain);\n }\n catch (error) {\n pcsCachedResponse = null;\n }\n }\n }\n // If \"shouldPreFetchPcsResponse\" was not specified by the host page or cached response was not valid,\n // proceed making live call to PCS\n if (!pcsCachedResponse) {\n pcsNetworkResponse = await tryGetPcsResponseFromNetwork();\n }\n else {\n pageTimings[pcsCached] = 1;\n }\n // If PCS response from network was not valid, try to return the cached response regardless of the cache duration to avoid blank page.\n if (!pcsNetworkResponse && window.__useCachedApp) {\n pcsCachedResponse = await getPcsResponseFromCache(true);\n }\n // set handler to update the cache for next time; Immediately update PCS response in cache to get new AID/RID\n if (window.__useCachedApp) {\n setTryGetPcsResponseFromNetworkForFutureCaching();\n }\n // Add perf marker and app trace marker on global timings objects\n addMarkerToPageTimings(\"WidgetsPcsCallEnd\");\n addAppTraceMarker(\"WidgetsPcsCall-end\");\n return pcsNetworkResponse || pcsCachedResponse;\n}\n/**\n * This function calls and gets PCS response from PCS API and gets client-setting, user data-info, and core-bundle scripts to render widgets.\n * This is global promise since we want the ability to call from widget initializer as well as from Peregrine bundles (later in page cycle).\n * @returns an async response that contains the needed information above.\n */\nlet tryGetPcsResponseFromNetwork = memoizeLite(async () => {\n if (!dataWidgetAttributes) {\n logError(\"dataWidgetAttributes is null in getPcsResponseFromNetwork\", 43715, {});\n return null;\n }\n // Set a 15-second timeout for PCS API call\n let timer;\n let responseData;\n const fetchUrl = buildPcsFetchUrl();\n try {\n const timeoutPromise = new Promise((resolve) => {\n timer = setTimeout(() => {\n // Log an app error if PCS API call timed out\n logError(\"PCS Widgets API call timed out. Trying to get response from statics\", 43713, { url: fetchUrl });\n resolve(null);\n }, timeoutInMs);\n });\n const pcsFetchPromise = fetch(fetchUrl, { credentials: \"include\" }).then(async (pcsResponse) => {\n if (timer) {\n clearTimeout(timer);\n }\n if (pcsResponse.ok) {\n return await pcsResponse.json();\n }\n const afdAId = tryGetAfdActivityIdFromHeaders(pcsResponse);\n logError(\"Verify PCS response for pcsData and bundleData for request url\", 43716, { fetchUrl, afdAId });\n return null;\n });\n // Race between PCS and a timeout based promise\n responseData = await Promise.race([pcsFetchPromise, timeoutPromise]);\n }\n catch (e) {\n if (timer) {\n clearTimeout(timer);\n }\n // This line of code sends app error only if prong2 page is visible when app type is prong2 app type.\n // If page is not visible in prong2 app type, don't send app error as that is a background refresh.\n const { appType, isCallFromWidgetsChanged } = dataWidgetAttributes || {};\n if (!(isProng2AppType(appType) && isCallFromWidgetsChanged)) {\n // If this is not prong2 app type, send this app error anyways.\n logError(\"Fetch failed for PCS url\", 43715, { originalUrl: fetchUrl, error: stringifyError(e, false) });\n }\n }\n // If response was null or respone was invalid, try get response from static fallback\n if (!validatePcsResponse(responseData)) {\n responseData = await getStaticFallbackPage(fetchUrl);\n }\n // RETRY! If response was still not valid, try getting from static fallback again as a last chance.\n // Make sure that user network is online before retrying.\n const online = (navigator && navigator.onLine) || true;\n if (online && !validatePcsResponse(responseData)) {\n responseData = await getStaticFallbackPage(fetchUrl, true);\n }\n return tryUpdatePcsResponse(responseData, dataWidgetAttributes.useCnDomain);\n});\n/**\n * Get static fall back page if PCS call is not successful\n * @param url - Widget Url\n * @param thisIsRetry - This is used to send different set of app errors\n * @returns StaticResponse\n */\nexport async function getStaticFallbackPage(url, thisIsRetry = false) {\n const { instance, staticsEnv } = dataWidgetAttributes && dataWidgetAttributes.staticsAttributes || {};\n const pageTimings = getPageTimings();\n pageTimings[pcsRetry] = (pageTimings[pcsRetry] || 0) + 1;\n if (instance) {\n url += `&instance=${instance}`;\n }\n if (staticsEnv) {\n url += `&staticsEnv=${staticsEnv}`;\n }\n const originalUrl = new URL(url);\n let staticUrl = url.replace(originalUrl.hostname, staticServerEndpoint);\n if (originalUrl.hostname.includes(\".cn\")) {\n staticUrl = url.replace(originalUrl.hostname, staticServerEndpointCnDomain);\n }\n // Set a 15-second timeout for Static call\n let timer;\n try {\n const timeoutPromise = new Promise((resolve) => {\n timer = setTimeout(() => {\n // Log an app error if Static Response timed out\n const [attempt, errorId] = thisIsRetry ? [\"second\", 52009] : [\"first\", 52006];\n logError(`PCS static Response timed out in ${attempt} attempt`, errorId, { originalUrl: url, staticUrl: staticUrl });\n resolve(null);\n }, timeoutInMs);\n });\n const staticFetchPromise = fetch(staticUrl, { credentials: \"include\" }).then(async (staticResponse) => {\n if (timer) {\n clearTimeout(timer);\n }\n const afdAId = tryGetAfdActivityIdFromHeaders(staticResponse);\n if (staticResponse.ok) {\n return await staticResponse.json();\n }\n else {\n // log error for not loading static page\n const [attempt, errorId] = thisIsRetry ? [\"second\", 52010] : [\"first\", 52004];\n logError(`Response not-ok in ${attempt} attempt to get PCS staticview`, errorId, { originalUrl: url, staticUrl: staticUrl, afdAId });\n return null;\n }\n });\n // Race between PCS and a timeout based promise\n const responeFromRace = await Promise.race([staticFetchPromise, timeoutPromise]);\n return responeFromRace;\n }\n catch (e) {\n if (timer) {\n clearTimeout(timer);\n }\n // log exception while loading static page\n const [attempt, errorId] = thisIsRetry ? [\"second\", 52011] : [\"first\", 52005];\n logError(`Exception in ${attempt} attempt to get PCS static response`, errorId, { error: stringifyError(e, false), originalUrl: url, staticUrl: staticUrl });\n return null;\n }\n}\n/**\n * Get PCS response from storage if it was stored in last 24 hours and if it is valid.\n * @param ignoreDuration - Ignore cache duration and return cached response\n * @returns PCS response from browser storage\n */\nexport async function getPcsResponseFromCache(ignoreDuration = false) {\n try {\n const key = getPcsResponseCacheKey();\n let pcsResponse = JSON.parse(localStorage.getItem(key));\n if (!pcsResponse && window.__bridgeSdk && window.__useCachedApp) {\n // try to get PCS from native storage\n const cachedResponseStr = await window.__bridgeSdk.promiseWithTimeout?.(window.__bridgeSdk.loadDataAsync?.({ key }), 500).then((res) => res ? JSON.parse(res).value : null);\n if (cachedResponseStr) {\n pcsResponse = JSON.parse(cachedResponseStr);\n }\n }\n const { appType } = dataWidgetAttributes || {};\n const storageTimestamp = pcsResponse && pcsResponse.storageTimestamp;\n const pcsUrlCached = pcsResponse && pcsResponse.pcsUrl;\n const currentPcsUrl = buildPcsFetchUrl();\n if (!pcsResponse) {\n // NOTE: JSON.parse(null|0|false) doesn't throw exception, so we need to check for falsy values explicitly\n logPcsNoCacheReason(\"Empty cache response\");\n }\n if (\n // for always cached app in offline mode, return valid cached response immediately without checking cache duration\n ((window.__useCachedApp && !navigator.onLine)\n // if PCS from network failed, return cached response immediately without checking cache duration\n || ignoreDuration)\n && pcsUrlCached === currentPcsUrl && validatePcsResponse(pcsResponse)) {\n return pcsResponse;\n }\n if (appType && appType === \"winWidgets\" /* AppType.WindowsNewsWidgets */) {\n if (dataWidgetAttributes.useCnDomain && shouldProng2PcsApiUseAkamaiEndpoint(pcsResponse)) {\n // if the PCS cache contains the PCS API Akamai migration flight, set pcs env to Akamai endpoint for the next PCS request\n dataWidgetAttributes.pcsEnvironment = \"assets\";\n }\n // Temporary remove the Prong2's cache for CRS spike experiment\n // Return after the akamai endpoint check\n return null;\n }\n const cacheDuration = window.__useCachedApp ? alwaysCachedAppPcsResponseCacheDuration : pwPcsResponseCacheDuration;\n const now = new Date().getTime();\n const isCacheStale = storageTimestamp ? (now - storageTimestamp) >= cacheDuration : true;\n if (!isCacheStale\n // Check if pcs cached url matches current pcs url\n && pcsUrlCached === currentPcsUrl\n // Validate cached response\n && validatePcsResponse(pcsResponse)) {\n return pcsResponse;\n }\n else {\n if (isCacheStale) {\n logPcsNoCacheReason(\"Cache is stale\");\n }\n else if (pcsUrlCached !== currentPcsUrl) {\n logPcsNoCacheReason(\"Cached PCS URL does not match current PCS URL\");\n }\n else {\n logPcsNoCacheReason(\"Cached PCS response is not valid\");\n }\n }\n }\n catch (e) {\n const msg = \"Error reading PCS response from local storage\";\n logPcsNoCacheReason(msg);\n logError(msg, 52007, { error: stringifyError(e, true) });\n }\n return null;\n}\n/**\n * log reason for not caching PCS response in LoadTime Telemetry for debugging\n * @param reason Reason for not caching PCS response\n */\nfunction logPcsNoCacheReason(reason) {\n const pageTimings = getPageTimings();\n if (!pageTimings[pcsNoCacheReason]) {\n pageTimings[pcsNoCacheReason] = reason;\n }\n}\n/**\n * This handler will enable us to call PCS API later point in time and write response to local storage.\n */\nfunction setHandlerToWritePcsResponseToCache() {\n window._pw_cachePcsResponse = async () => {\n try {\n const pcsResponse = await tryGetPcsResponseFromNetwork();\n updateCache(pcsResponse);\n }\n catch (e) {\n logError(\"Error writing PCS response to local storage\", 52008, { error: stringifyError(e, true) });\n }\n };\n}\n/**\n * For always cached app, we want to make sure that the PCS flight info and bundle info is matching with the GitConfig. So we will use a App cache manager to manage the cache flow.\n */\nfunction setTryGetPcsResponseFromNetworkForFutureCaching() {\n // immediately update the cache for next time asynchronously, then resolve the\n const getResponseFromNetworkPromise = new Promise((resolve) => {\n tryGetPcsResponseFromNetwork().then((response) => {\n updateCache(response);\n resolve(response);\n });\n });\n window._pw_tryGetPcsResponseFromNetwork = getResponseFromNetworkPromise;\n}\n/**\n * a helper function to update cache\n * @param pcsResponse response object to be stored in cache\n */\nfunction updateCache(pcsResponse) {\n if (pcsResponse) {\n pcsResponse.storageTimestamp = new Date().getTime();\n pcsResponse.pcsUrl = buildPcsFetchUrl();\n const key = getPcsResponseCacheKey();\n localStorage.setItem(key, JSON.stringify(pcsResponse));\n if (window.__bridgeSdk && window.__useCachedApp) {\n // update cache in native storage\n window.__bridgeSdk.saveDataAsync?.({ key, value: JSON.stringify(pcsResponse) }).catch((e) => {\n logError(\"Error writing PCS response to native storage\", 52008, { error: stringifyError(e, true) });\n });\n }\n }\n else {\n logError(\"PCS response was null\", 52008, {});\n }\n}\n/**\n * Clear PCS response from browser storage\n */\nexport function clearPcsCache() {\n // for always cached app, never clear the cache, we only update the cache when we get the new PCS response.\n // this is to make sure the app works in offline mode.\n if (window.__useCachedApp) {\n return;\n }\n localStorage.removeItem(getPcsResponseCacheKey());\n}\n/**\n * Check if PCS response is valid\n * @param PCS response\n * @returns true if response is valid, false otherwise\n */\nfunction validatePcsResponse(response) {\n return response\n && response.pcsData\n && response.pcsData.info\n && response.pcsData.clientSettings\n && response.bundleData\n && response.bundleData.bootstrappingRefs;\n}\n/**\n * Update response per business logic\n */\nfunction tryUpdatePcsResponse(response, useCnDomain) {\n if (!validatePcsResponse(response)) {\n return null;\n }\n // PCS currently does not send this property, so we need to use the host page provided value to set it\n // Add useCnDomain in client settings so all subsequent endpoints will be switched to use .cn instead of .com\n response.pcsData.clientSettings.useCnDomain = useCnDomain;\n // Add widget attribute on client settings so bundles can read required properties\n response.pcsData.clientSettings.widgetAttributes = dataWidgetAttributes;\n return response;\n}\n/**\n * Get PCS response cache key from Constant, AppType and PageType\n * @returns Cache Key\n */\nfunction getPcsResponseCacheKey() {\n if (!dataWidgetAttributes) {\n return \"\";\n }\n const { appType, cm, pageType } = dataWidgetAttributes;\n return `${pwPcsResponseCacheKey}_${appType}_${pageType}_${cm}`;\n}\n/**\n * Build PCS fetch url from DataWidgetAttributes\n * @returns PCS fetch url\n */\nfunction buildPcsFetchUrl() {\n if (!dataWidgetAttributes) {\n return \"\";\n }\n const { appType, useCnDomain, pageType, pcsEnvironment = \"www\", pcsAdditionalQsp } = dataWidgetAttributes;\n const isMarketSelectorEnabled = getLocalStorage().getItem(\"Prong2MarketSelectorEnabled\");\n const pcsUrl = getLocalStorage().getItem(\"Prong2PcsUrl\");\n if (isMarketSelectorEnabled === \"1\" && pcsUrl && pcsUrl.includes(\"/pcs/api/widget/\")) {\n // PCS url in 1S response contains locale and region query params, so we need to remove them\n return `${pcsUrl}${pcsAdditionalQsp ? `&${pcsAdditionalQsp.split(\"&\").filter(param => !param.startsWith(\"locale=\") && !param.startsWith(\"region=\")).join(\"&\")}` : \"\"}`;\n }\n return `https://${pcsEnvironment}.msn.${useCnDomain ? \"cn\" : \"com\"}/pcs/api/widget/${appType}/${pageType || \"\"}${pcsAdditionalQsp ? `?${pcsAdditionalQsp}` : \"\"}`;\n}\n/**\n * Return AFD provided activity id from response header.\n * @param response from server\n * @returns AFD activity id\n */\nfunction tryGetAfdActivityIdFromHeaders(response) {\n if (!response || !response.headers) {\n return \"\";\n }\n // Return string sequence representing the values of the retrieved header or null if this header is not set.\n // This doesn't throw error if not found.\n return response.headers.get(\"x-msedge-ref\") || \"\";\n}\n/**\n * TO BE USED FOR UNIT TESTING ONLY\n */\nexport function setLocalVariables(attributes) {\n if (attributes) {\n dataWidgetAttributes = attributes;\n }\n tryGetPcsResponseFromNetwork.cache.clear();\n}\n/**\n * Clear memoize cache.\n */\nexport function clearNetworkCachedResponse() {\n if (tryGetPcsResponseFromNetwork) {\n tryGetPcsResponseFromNetwork.cache.clear();\n }\n}\n//# sourceMappingURL=GetPcsResponse.js.map","// © Microsoft Corporation. All rights reserved.\n/**\n * A functionally limited, but lite implementation of lodash memoize helper\n * to help memoize the value of an argumentless function.\n */\nexport function memoizeLite(fn) {\n let cachedValue;\n let invokedOnce = false;\n const memoizedFn = function () {\n if (!invokedOnce) {\n invokedOnce = true;\n cachedValue = fn();\n }\n return cachedValue;\n };\n // helper to clear memoization cache value\n memoizedFn.cache = {\n clear: () => {\n invokedOnce = false;\n cachedValue = undefined;\n }\n };\n return memoizedFn;\n}\n//# sourceMappingURL=LodashLiteInline.js.map","// © Microsoft Corporation. All rights reserved.\nimport * as inlineHeadCommon from \"@msnews/inline-head-common\";\nimport { CustomEventPayloadStage, CustomWidgetErrorEvent, dispatchCustomEvent } from \"./ErrorDispatcher\";\nimport { coreBundleClassName, headTagDataInfoAttribute, headTagtCanvasInfo, headTagtClientSettingAttribute, widgetGroupClassName, widgetSettingsClassName } from \"@msnews/experiences-constants\";\nimport { isOneTrustScriptData, setOneTrustScript } from \"./SetOneTrustScript\";\nimport { setLoggingMetadata, verifyJSLoading } from \"./ErrorLogging\";\nimport { addLoadingIcon } from \"./LoadingIcon\";\nimport { createScriptTag } from \"@msnews/isomorphic-util\";\nimport { getDataWidgetAttributes } from \"./GetDataWidgetAttributes\";\nimport { clearPcsCache, getPcsResponse } from \"./GetPcsResponse\";\nimport { shouldRenderWidgets } from \"./Utilities\";\nimport { getPageTimings } from \"./AddMarkerToPageTimings\";\n/**\n * Widget Initializer routine.\n * This file is not used by any code in the msnews-experinces repo.\n * This script is expected to run on non-Peregrine pages as a standalone script and help include Peregrine experiences.\n * 1. This script expects following div in the DOM.\n
\n * 2. This script should read the div and call PCS with above appType, pageType, cm (optional) and pcsAdditionalQsp (optional)\n * 3. Add info and clientSettings obtained from PCS response to the DOM.\n * 4. Start downloading Peregrine core bundles.\n * @param options - \"string\" for backwards compatibility to support logging telemetry join id.\n * WidgetInitializerOptions should be used going forward with a predefined contract.\n * This options are added to global object __pw_options for Peregrine bundles to consume.\n */\nexport async function startWidgetInitializer(options) {\n // Return if host page browser isn't supported.\n if (!shouldRenderWidgets()) {\n return;\n }\n // wait until network is online before trying to make network calls\n // NOTE: cacheable widget app works offline, so we don't need to wait for network to be online\n if (!window.__useCachedApp && navigator && navigator.onLine === false) {\n const waitForNetwork = new Promise(resolve => {\n window.addEventListener(\"online\", () => resolve(), { once: true });\n });\n await waitForNetwork;\n }\n // Only call PCS if the bundle