{"version":3,"file":"scripts-head.min.js","mappings":"mBAAe,SAASA,EAAQC,GAEA,YAAxBC,SAASC,WACTF,IAGKC,SAASE,iBACdF,SAASE,iBAAiB,mBAAoBH,GAI9CC,SAASG,YAAY,sBAAsB,WACX,aAAxBH,SAASC,YAA2BF,GAC5C,GAER,CCNAK,OAAOC,UCcQ,SAASA,EAAUC,G,IAAYC,EAAAA,UAAAA,OAAAA,QAAAA,IAAAA,UAAAA,GAAAA,UAAAA,GAAU,IACpD,OAAIC,MAAMC,QAAQH,GAAoBI,QAAQC,IAAIL,EAAWM,KAAI,SAACC,G,OAAMR,EAAUQ,EAAGN,E,KACxD,MAAtBH,OAAOE,GACRI,QAAQI,QAAQV,OAAOE,IACvB,IAAII,SAAQ,SAACK,EAAKC,GACdlB,GAAQ,WACJ,GAA0B,MAAtBM,OAAOE,GACP,IAAMW,EAAQC,KAAKC,MACbC,EAAUC,aAAY,WACE,MAAtBjB,OAAOE,IACPgB,cAAcF,GACdL,EAAIX,OAAOE,KACJY,KAAKC,MAAQF,EAAQV,IAC5Be,cAAcF,GACdJ,EAAI,IAAIO,MAAM,mBAAqDjB,OAAlCC,EAAQ,4BAAqC,OAAXD,KAE3E,GAAG,UAEHS,EAAIX,OAAOE,GAEnB,GACJ,GACV,EDnCAF,OAAON,QAAUA,OETiB,IAAnBM,OAAOoB,UAAyBpB,OAAOoB,QAAU,K","sources":["webpack:///./Client/Common/src/js/core/onReady.js","webpack:///./Client/Mach/src/js/index.head.js","webpack:///./Client/Common/src/js/core/ensureLib.js","webpack:///./Client/Common/src/js/core/findApiFix.js"],"sourcesContent":["export default function onReady(callback) {\n // in case the document is already rendered\n if (document.readyState !== 'loading') {\n callback();\n }\n // modern browsers\n else if (document.addEventListener) {\n document.addEventListener('DOMContentLoaded', callback);\n }\n // IE <= 8\n else {\n document.attachEvent('onreadystatechange', function () {\n if (document.readyState === 'complete') callback();\n });\n }\n}\n","/**\n * This script is loaded in the HEAD of the document.\n * Accessing vendor externals that are loaded in the body,\n * in this file or any dependencies will break this script.\n */\nimport onReady from 'Common/core/onReady';\nimport findApiFix from 'Common/core/findApiFix';\nimport ensureLib from 'Common/core/ensureLib';\n\nwindow.ensureLib = ensureLib;\nwindow.onReady = onReady;\nfindApiFix();\n","import onReady from './onReady';\n\n/**\n * Get a promise that resolves when a global namespace becomes available (defined).\n * Times out if not found after specified timeout.\n * @param {string|string[]} globalName - name or array of names of library(s)\n * @param {number} [timeout=30000] - milliseconds\n * @returns {Promise<*>} A promise resolving to the library / namespace object.\n *\n * @example\n * window.ensureLib('$').then(function withJquery($) {\n * $('#input').val('hello, world');\n * });\n *\n * window.ensureLib(['RewardsController', 'PasswordResetController'], 1000)\n * .then(([RewardsController, PasswordResetController]) => {\n * RewardsController.init(...);\n * PasswordResetController.init(...);\n * })\n * .catch((e) => {\n * console.error(e);\n * });\n */\nexport default function ensureLib(globalName, timeout = 30000) {\n if (Array.isArray(globalName)) return Promise.all(globalName.map((n) => ensureLib(n, timeout)));\n return window[globalName] != null\n ? Promise.resolve(window[globalName])\n : new Promise((res, rej) => {\n onReady(() => {\n if (window[globalName] == null) {\n const start = Date.now();\n const handler = setInterval(() => {\n if (window[globalName] != null) {\n clearInterval(handler);\n res(window[globalName]);\n } else if (Date.now() > start + timeout) {\n clearInterval(handler);\n rej(new Error(`Timed out after ${timeout}ms waiting for library: ${globalName}`));\n }\n }, 100);\n } else {\n res(window[globalName]);\n }\n });\n });\n}\n","export default function FindApiFix() {\n if (typeof window.FindApi === 'undefined') window.FindApi = null;\n}\n"],"names":["onReady","callback","document","readyState","addEventListener","attachEvent","window","ensureLib","globalName","timeout","Array","isArray","Promise","all","map","n","resolve","res","rej","start","Date","now","handler","setInterval","clearInterval","Error","FindApi"],"sourceRoot":""}