From bebed8f8460de6fc0b2ba71bba7ec09b510309ad Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Mon, 20 Jan 2025 09:02:24 +0100 Subject: [PATCH] Refactor(Tx decoding): use transaction preview endpoint (#4783) --- apps/web/package.json | 2 +- .../public/fallback-ce627215c0e4a9af.js.map | 1 + apps/web/public/sw.js.map | 1 + apps/web/public/workbox-b52a85cb.js.map | 1 + .../web/public/worker-a1b55571f2865253.js.map | 1 + .../batch/BatchSidebar/BatchTxItem.tsx | 8 +- .../TxData/DecodedData/index.test.tsx | 2 +- .../TxDetails/TxData/DecodedData/index.tsx | 2 +- .../TxData/MigrationToL2TxData/index.tsx | 11 +- .../ExecTransaction/index.tsx | 30 +-- .../OnChainConfirmation/index.tsx | 8 +- .../transactions/TxDetails/TxData/index.tsx | 62 +++-- .../transactions/TxDetails/index.tsx | 8 +- .../src/components/tx-flow/SafeTxProvider.tsx | 2 + .../RecoverAccountFlowReview.tsx | 6 +- .../ReviewSignMessageOnChain.test.tsx | 9 +- .../components/tx/DecodedTx/index.test.tsx | 244 ++++++++++-------- .../web/src/components/tx/DecodedTx/index.tsx | 74 ++---- .../SignOrExecuteForm/SignOrExecuteForm.tsx | 7 +- .../__tests__/SignOrExecute.test.tsx | 13 +- .../__snapshots__/SignOrExecute.test.tsx.snap | 81 +++++- .../components/tx/SignOrExecuteForm/hooks.ts | 25 +- .../components/tx/SignOrExecuteForm/index.tsx | 25 +- .../ChangeThreshold/index.tsx | 6 +- .../SettingsChange/SettingsChange.stories.tsx | 4 +- .../SettingsChange/SettingsChange.test.tsx | 4 +- .../tx/confirmation-views/SwapOrder/index.tsx | 6 +- .../ConfirmationView.test.tsx.snap | 94 +------ .../tx/confirmation-views/index.tsx | 60 ++--- .../tx/confirmation-views/types.d.ts | 2 +- .../tx/confirmation-views/useTxPreview.ts | 29 +++ apps/web/src/features/tx-notes/TxNote.tsx | 4 +- apps/web/src/features/tx-notes/TxNoteForm.tsx | 9 +- .../src/hooks/__tests__/useDecodeTx.test.ts | 113 -------- apps/web/src/hooks/useDecodeTx.ts | 33 --- yarn.lock | 10 +- 36 files changed, 446 insertions(+), 551 deletions(-) create mode 100644 apps/web/public/fallback-ce627215c0e4a9af.js.map create mode 100644 apps/web/public/sw.js.map create mode 100644 apps/web/public/workbox-b52a85cb.js.map create mode 100644 apps/web/public/worker-a1b55571f2865253.js.map create mode 100644 apps/web/src/components/tx/confirmation-views/useTxPreview.ts delete mode 100644 apps/web/src/hooks/__tests__/useDecodeTx.test.ts delete mode 100644 apps/web/src/hooks/useDecodeTx.ts diff --git a/apps/web/package.json b/apps/web/package.json index 0c9eef25b6..ee56a90fd2 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -55,7 +55,7 @@ "@safe-global/protocol-kit": "^4.1.3", "@safe-global/safe-apps-sdk": "^9.1.0", "@safe-global/safe-client-gateway-sdk": "v1.60.1", - "@safe-global/safe-gateway-typescript-sdk": "3.22.6", + "@safe-global/safe-gateway-typescript-sdk": "3.22.7-beta.2", "@safe-global/safe-modules-deployments": "^2.2.1", "@safe-global/store": "workspace:^", "@sentry/react": "^7.91.0", diff --git a/apps/web/public/fallback-ce627215c0e4a9af.js.map b/apps/web/public/fallback-ce627215c0e4a9af.js.map new file mode 100644 index 0000000000..c2bef66f50 --- /dev/null +++ b/apps/web/public/fallback-ce627215c0e4a9af.js.map @@ -0,0 +1 @@ +{"version":3,"file":"../public/fallback-ce627215c0e4a9af.js","mappings":";;;;;;AAAA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,MAAM;AACN;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;;AAEtC;AACA;AACA;;AAEA,4BAA4B;AAC5B;AACA;AACA;AACA,6BAA6B;;;;;;;UCvL7B;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA,GAAG;UACH;UACA;;UAEA;UACA;UACA;;;;;;;AC5BA;AACA,UAAU,yBAAyB;AACnC,kBAAkB,WAAqC;AACvD,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,cAAc,OAAO;AACrB,KAAK;AACL;AACA;AACA,KAAK,gBAAgB,OAAO,sFAAsF,OAAO;AACzH;AACA,KAAK;AACL,E","sources":["webpack://_N_E/../../node_modules/process/browser.js","webpack://_N_E/webpack/bootstrap","webpack://_N_E/./node_modules/@ducanh2912/next-pwa/dist/fallback.js"],"sourcesContent":["// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// 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\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","self.fallback = async (_)=>{\n let { destination: e, url: A } = _, s = {\n document: process.env.__PWA_FALLBACK_DOCUMENT__,\n image: process.env.__PWA_FALLBACK_IMAGE__,\n audio: process.env.__PWA_FALLBACK_AUDIO__,\n video: process.env.__PWA_FALLBACK_VIDEO__,\n font: process.env.__PWA_FALLBACK_FONT__\n }[e];\n return s ? caches.match(s, {\n ignoreSearch: !0\n }) : \"\" === e && process.env.__PWA_FALLBACK_DATA__ && A.match(/\\/_next\\/data\\/.+\\/.+\\.json$/i) ? caches.match(process.env.__PWA_FALLBACK_DATA__, {\n ignoreSearch: !0\n }) : Response.error();\n};"],"names":[],"sourceRoot":"","ignoreList":[0,2]} \ No newline at end of file diff --git a/apps/web/public/sw.js.map b/apps/web/public/sw.js.map new file mode 100644 index 0000000000..9d4c4a0608 --- /dev/null +++ b/apps/web/public/sw.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sw.js","sources":["../../../../../../private/var/folders/13/rtgd1cjn26s1_h84mwc15wsw0000gn/T/2b96fb319d36b1ec586fc1d3d3485838/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/ivan/Sites/safe-wallet-web/node_modules/workbox-routing/registerRoute.mjs';\nimport {NetworkFirst as workbox_strategies_NetworkFirst} from '/Users/ivan/Sites/safe-wallet-web/node_modules/workbox-strategies/NetworkFirst.mjs';\nimport {ExpirationPlugin as workbox_expiration_ExpirationPlugin} from '/Users/ivan/Sites/safe-wallet-web/node_modules/workbox-expiration/ExpirationPlugin.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/Users/ivan/Sites/safe-wallet-web/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {StaleWhileRevalidate as workbox_strategies_StaleWhileRevalidate} from '/Users/ivan/Sites/safe-wallet-web/node_modules/workbox-strategies/StaleWhileRevalidate.mjs';\nimport {RangeRequestsPlugin as workbox_range_requests_RangeRequestsPlugin} from '/Users/ivan/Sites/safe-wallet-web/node_modules/workbox-range-requests/RangeRequestsPlugin.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/ivan/Sites/safe-wallet-web/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/ivan/Sites/safe-wallet-web/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/Users/ivan/Sites/safe-wallet-web/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\nimportScripts(\n \"/fallback-ce627215c0e4a9af.js\",\n \"/worker-a1b55571f2865253.js\"\n);\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"/_next/dynamic-css-manifest.json\",\n \"revision\": \"327d99051ff9b955879a096d0c408fdd\"\n },\n {\n \"url\": \"/_next/static/chunks/1109.311da7577bd75f02.js\",\n \"revision\": \"311da7577bd75f02\"\n },\n {\n \"url\": \"/_next/static/chunks/1124.333d243742cbb359.js\",\n \"revision\": \"333d243742cbb359\"\n },\n {\n \"url\": \"/_next/static/chunks/1231.b9decf335c5cbc46.js\",\n \"revision\": \"b9decf335c5cbc46\"\n },\n {\n \"url\": \"/_next/static/chunks/1249.00c9e0c2f7068e1e.js\",\n \"revision\": \"00c9e0c2f7068e1e\"\n },\n {\n \"url\": \"/_next/static/chunks/1283.6574939fa1379ed9.js\",\n \"revision\": \"6574939fa1379ed9\"\n },\n {\n \"url\": \"/_next/static/chunks/130-006d267803262a43.js\",\n \"revision\": \"006d267803262a43\"\n },\n {\n \"url\": \"/_next/static/chunks/1303.09435412a920d04f.js\",\n \"revision\": \"09435412a920d04f\"\n },\n {\n \"url\": \"/_next/static/chunks/1347.317b71ff619f242b.js\",\n \"revision\": \"317b71ff619f242b\"\n },\n {\n \"url\": \"/_next/static/chunks/1398.ecece00b32d6492f.js\",\n \"revision\": \"ecece00b32d6492f\"\n },\n {\n \"url\": \"/_next/static/chunks/1412.4b808687d9a90505.js\",\n \"revision\": \"4b808687d9a90505\"\n },\n {\n \"url\": \"/_next/static/chunks/1459.a6598582d0579457.js\",\n \"revision\": \"a6598582d0579457\"\n },\n {\n \"url\": \"/_next/static/chunks/1555.243465643bf0bc11.js\",\n \"revision\": \"243465643bf0bc11\"\n },\n {\n \"url\": \"/_next/static/chunks/1633.6a332b29d92c5a31.js\",\n \"revision\": \"6a332b29d92c5a31\"\n },\n {\n \"url\": \"/_next/static/chunks/1711.c7643f2ed6f8a755.js\",\n \"revision\": \"c7643f2ed6f8a755\"\n },\n {\n \"url\": \"/_next/static/chunks/1738.0ef16edf0985186f.js\",\n \"revision\": \"0ef16edf0985186f\"\n },\n {\n \"url\": \"/_next/static/chunks/1787.8fe79cd662301f66.js\",\n \"revision\": \"8fe79cd662301f66\"\n },\n {\n \"url\": \"/_next/static/chunks/1825.5f57ff725f4d11d6.js\",\n \"revision\": \"5f57ff725f4d11d6\"\n },\n {\n \"url\": \"/_next/static/chunks/184-121cf427ab9f8bc0.js\",\n \"revision\": \"121cf427ab9f8bc0\"\n },\n {\n \"url\": \"/_next/static/chunks/19.9f80c188c606f8b7.js\",\n \"revision\": \"9f80c188c606f8b7\"\n },\n {\n \"url\": \"/_next/static/chunks/2106.fac9e591769e8d7e.js\",\n \"revision\": \"fac9e591769e8d7e\"\n },\n {\n \"url\": \"/_next/static/chunks/2148.5a307990dad5b0c4.js\",\n \"revision\": \"5a307990dad5b0c4\"\n },\n {\n \"url\": \"/_next/static/chunks/2149.c1dda51872cad079.js\",\n \"revision\": \"c1dda51872cad079\"\n },\n {\n \"url\": \"/_next/static/chunks/2214.65ad425a4383bbd1.js\",\n \"revision\": \"65ad425a4383bbd1\"\n },\n {\n \"url\": \"/_next/static/chunks/2317.b71aa16ee70895e4.js\",\n \"revision\": \"b71aa16ee70895e4\"\n },\n {\n \"url\": \"/_next/static/chunks/2365.bb561a860e37108a.js\",\n \"revision\": \"bb561a860e37108a\"\n },\n {\n \"url\": \"/_next/static/chunks/2546.763d563b266f352a.js\",\n \"revision\": \"763d563b266f352a\"\n },\n {\n \"url\": \"/_next/static/chunks/2608.500ca55f950e7064.js\",\n \"revision\": \"500ca55f950e7064\"\n },\n {\n \"url\": \"/_next/static/chunks/2667.90d08143a640b28f.js\",\n \"revision\": \"90d08143a640b28f\"\n },\n {\n \"url\": \"/_next/static/chunks/2805.f8faaa0b4f69eeab.js\",\n \"revision\": \"f8faaa0b4f69eeab\"\n },\n {\n \"url\": \"/_next/static/chunks/2956.1dead871f8aaf762.js\",\n \"revision\": \"1dead871f8aaf762\"\n },\n {\n \"url\": \"/_next/static/chunks/2958.bfff3cee82d88170.js\",\n \"revision\": \"bfff3cee82d88170\"\n },\n {\n \"url\": \"/_next/static/chunks/3027.5cbb55c04954327a.js\",\n \"revision\": \"5cbb55c04954327a\"\n },\n {\n \"url\": \"/_next/static/chunks/3127.eafa5e591fbed6b0.js\",\n \"revision\": \"eafa5e591fbed6b0\"\n },\n {\n \"url\": \"/_next/static/chunks/3336.37190864aa64efff.js\",\n \"revision\": \"37190864aa64efff\"\n },\n {\n \"url\": \"/_next/static/chunks/3390.de4ea4b3d9f84464.js\",\n \"revision\": \"de4ea4b3d9f84464\"\n },\n {\n \"url\": \"/_next/static/chunks/344.c2910f681ffea15f.js\",\n \"revision\": \"c2910f681ffea15f\"\n },\n {\n \"url\": \"/_next/static/chunks/349.0959f4df74ad69c0.js\",\n \"revision\": \"0959f4df74ad69c0\"\n },\n {\n \"url\": \"/_next/static/chunks/3517.0a2547d7e8f0a6a1.js\",\n \"revision\": \"0a2547d7e8f0a6a1\"\n },\n {\n \"url\": \"/_next/static/chunks/3710.23f5a72ee06fb8be.js\",\n \"revision\": \"23f5a72ee06fb8be\"\n },\n {\n \"url\": \"/_next/static/chunks/3732.e1534b7623efc005.js\",\n \"revision\": \"e1534b7623efc005\"\n },\n {\n \"url\": \"/_next/static/chunks/379.fbc4bee1b36d92ca.js\",\n \"revision\": \"fbc4bee1b36d92ca\"\n },\n {\n \"url\": \"/_next/static/chunks/392.efb3d11d96aee4a0.js\",\n \"revision\": \"efb3d11d96aee4a0\"\n },\n {\n \"url\": \"/_next/static/chunks/402.7b98b50977d2bf9a.js\",\n \"revision\": \"7b98b50977d2bf9a\"\n },\n {\n \"url\": \"/_next/static/chunks/4027.d2a754e7dc9a8ce9.js\",\n \"revision\": \"d2a754e7dc9a8ce9\"\n },\n {\n \"url\": \"/_next/static/chunks/4073-91c898d9ee3d5a19.js\",\n \"revision\": \"91c898d9ee3d5a19\"\n },\n {\n \"url\": \"/_next/static/chunks/4077.603ff13e277efa44.js\",\n \"revision\": \"603ff13e277efa44\"\n },\n {\n \"url\": \"/_next/static/chunks/4133-30168758e98cdcba.js\",\n \"revision\": \"30168758e98cdcba\"\n },\n {\n \"url\": \"/_next/static/chunks/4135.49e9464ac6c733d0.js\",\n \"revision\": \"49e9464ac6c733d0\"\n },\n {\n \"url\": \"/_next/static/chunks/4144.c1464bc57369bafe.js\",\n \"revision\": \"c1464bc57369bafe\"\n },\n {\n \"url\": \"/_next/static/chunks/4178.38e626fdf1b86baf.js\",\n \"revision\": \"38e626fdf1b86baf\"\n },\n {\n \"url\": \"/_next/static/chunks/4326.8c1e3d71f5fafe78.js\",\n \"revision\": \"8c1e3d71f5fafe78\"\n },\n {\n \"url\": \"/_next/static/chunks/4354.fefbb997d6ca34df.js\",\n \"revision\": \"fefbb997d6ca34df\"\n },\n {\n \"url\": \"/_next/static/chunks/4365.b763cf8a31828ae8.js\",\n \"revision\": \"b763cf8a31828ae8\"\n },\n {\n \"url\": \"/_next/static/chunks/4524.0f9a0a48cc58f3a3.js\",\n \"revision\": \"0f9a0a48cc58f3a3\"\n },\n {\n \"url\": \"/_next/static/chunks/4587.9bb1a56ea705e776.js\",\n \"revision\": \"9bb1a56ea705e776\"\n },\n {\n \"url\": \"/_next/static/chunks/4612.20c3816d6fed7263.js\",\n \"revision\": \"20c3816d6fed7263\"\n },\n {\n \"url\": \"/_next/static/chunks/4669.028814e5a8809335.js\",\n \"revision\": \"028814e5a8809335\"\n },\n {\n \"url\": \"/_next/static/chunks/4682.ea4f13177709c383.js\",\n \"revision\": \"ea4f13177709c383\"\n },\n {\n \"url\": \"/_next/static/chunks/469.6aa8d6a0928d1bb4.js\",\n \"revision\": \"6aa8d6a0928d1bb4\"\n },\n {\n \"url\": \"/_next/static/chunks/4718.dbb6ae833fc46bf3.js\",\n \"revision\": \"dbb6ae833fc46bf3\"\n },\n {\n \"url\": \"/_next/static/chunks/4801.ac751c9d18b95ce1.js\",\n \"revision\": \"ac751c9d18b95ce1\"\n },\n {\n \"url\": \"/_next/static/chunks/4809.44e7c2b173380886.js\",\n \"revision\": \"44e7c2b173380886\"\n },\n {\n \"url\": \"/_next/static/chunks/4820.2ed6c9a59deb2ecf.js\",\n \"revision\": \"2ed6c9a59deb2ecf\"\n },\n {\n \"url\": \"/_next/static/chunks/4877.380797cd6a3d800e.js\",\n \"revision\": \"380797cd6a3d800e\"\n },\n {\n \"url\": \"/_next/static/chunks/4884.eea4acd604194bb0.js\",\n \"revision\": \"eea4acd604194bb0\"\n },\n {\n \"url\": \"/_next/static/chunks/4916.4a4c419ba2777f4c.js\",\n \"revision\": \"4a4c419ba2777f4c\"\n },\n {\n \"url\": \"/_next/static/chunks/4a7cc7e1.9d664b83a1fe3723.js\",\n \"revision\": \"9d664b83a1fe3723\"\n },\n {\n \"url\": \"/_next/static/chunks/4b26d002.d73f6d17f4ced72a.js\",\n \"revision\": \"d73f6d17f4ced72a\"\n },\n {\n \"url\": \"/_next/static/chunks/5059.c43d5a25e29b71c5.js\",\n \"revision\": \"c43d5a25e29b71c5\"\n },\n {\n \"url\": \"/_next/static/chunks/5063.848afc6548e1949c.js\",\n \"revision\": \"848afc6548e1949c\"\n },\n {\n \"url\": \"/_next/static/chunks/5117.5442f4be779aefbf.js\",\n \"revision\": \"5442f4be779aefbf\"\n },\n {\n \"url\": \"/_next/static/chunks/5153.88ba5931097cbe6c.js\",\n \"revision\": \"88ba5931097cbe6c\"\n },\n {\n \"url\": \"/_next/static/chunks/5156.70f55208fcf67e27.js\",\n \"revision\": \"70f55208fcf67e27\"\n },\n {\n \"url\": \"/_next/static/chunks/5190.46cc3db9e38df008.js\",\n \"revision\": \"46cc3db9e38df008\"\n },\n {\n \"url\": \"/_next/static/chunks/5223.9755a2792b2999f2.js\",\n \"revision\": \"9755a2792b2999f2\"\n },\n {\n \"url\": \"/_next/static/chunks/5273.c0f36a06e2f6b32d.js\",\n \"revision\": \"c0f36a06e2f6b32d\"\n },\n {\n \"url\": \"/_next/static/chunks/531.f8a2a633bb7f7782.js\",\n \"revision\": \"f8a2a633bb7f7782\"\n },\n {\n \"url\": \"/_next/static/chunks/5369.b0988a1ca1788348.js\",\n \"revision\": \"b0988a1ca1788348\"\n },\n {\n \"url\": \"/_next/static/chunks/5376.5761bfd20ee4ae4c.js\",\n \"revision\": \"5761bfd20ee4ae4c\"\n },\n {\n \"url\": \"/_next/static/chunks/5410.cc0654e16dca7443.js\",\n \"revision\": \"cc0654e16dca7443\"\n },\n {\n \"url\": \"/_next/static/chunks/5423.508f8b736bd872e3.js\",\n \"revision\": \"508f8b736bd872e3\"\n },\n {\n \"url\": \"/_next/static/chunks/5566-88c48848fc889c12.js\",\n \"revision\": \"88c48848fc889c12\"\n },\n {\n \"url\": \"/_next/static/chunks/5577.a6e688eac17900e0.js\",\n \"revision\": \"a6e688eac17900e0\"\n },\n {\n \"url\": \"/_next/static/chunks/5596.79ce304ffc3bc3b3.js\",\n \"revision\": \"79ce304ffc3bc3b3\"\n },\n {\n \"url\": \"/_next/static/chunks/5634.109e8c8bd1ad80d9.js\",\n \"revision\": \"109e8c8bd1ad80d9\"\n },\n {\n \"url\": \"/_next/static/chunks/5699-9556f5a7ce25f211.js\",\n \"revision\": \"9556f5a7ce25f211\"\n },\n {\n \"url\": \"/_next/static/chunks/5878.af13ab06ae540070.js\",\n \"revision\": \"af13ab06ae540070\"\n },\n {\n \"url\": \"/_next/static/chunks/5915.e9e17a886c149fcc.js\",\n \"revision\": \"e9e17a886c149fcc\"\n },\n {\n \"url\": \"/_next/static/chunks/5981.7234f619fa5f1141.js\",\n \"revision\": \"7234f619fa5f1141\"\n },\n {\n \"url\": \"/_next/static/chunks/6025.82739d104cbc4a45.js\",\n \"revision\": \"82739d104cbc4a45\"\n },\n {\n \"url\": \"/_next/static/chunks/6042.2472c200dba2c634.js\",\n \"revision\": \"2472c200dba2c634\"\n },\n {\n \"url\": \"/_next/static/chunks/6070.edaeab83c0db62b0.js\",\n \"revision\": \"edaeab83c0db62b0\"\n },\n {\n \"url\": \"/_next/static/chunks/6123.a93cee232624dba4.js\",\n \"revision\": \"a93cee232624dba4\"\n },\n {\n \"url\": \"/_next/static/chunks/6171.aedb3b89a87c7683.js\",\n \"revision\": \"aedb3b89a87c7683\"\n },\n {\n \"url\": \"/_next/static/chunks/6213-e59604a715a8a164.js\",\n \"revision\": \"e59604a715a8a164\"\n },\n {\n \"url\": \"/_next/static/chunks/6356.5aa1d2b055d88b94.js\",\n \"revision\": \"5aa1d2b055d88b94\"\n },\n {\n \"url\": \"/_next/static/chunks/6403.49d5584b6ae97199.js\",\n \"revision\": \"49d5584b6ae97199\"\n },\n {\n \"url\": \"/_next/static/chunks/6459-d8566cecb0852b0a.js\",\n \"revision\": \"d8566cecb0852b0a\"\n },\n {\n \"url\": \"/_next/static/chunks/6464.696770e32fd07912.js\",\n \"revision\": \"696770e32fd07912\"\n },\n {\n \"url\": \"/_next/static/chunks/6483.641538fa2c6544f4.js\",\n \"revision\": \"641538fa2c6544f4\"\n },\n {\n \"url\": \"/_next/static/chunks/6514.dd07bf9f0d9f9e89.js\",\n \"revision\": \"dd07bf9f0d9f9e89\"\n },\n {\n \"url\": \"/_next/static/chunks/6605.b0a78835af422520.js\",\n \"revision\": \"b0a78835af422520\"\n },\n {\n \"url\": \"/_next/static/chunks/6630.bbde2a694857d215.js\",\n \"revision\": \"bbde2a694857d215\"\n },\n {\n \"url\": \"/_next/static/chunks/6679.e57e83fbe1480cf9.js\",\n \"revision\": \"e57e83fbe1480cf9\"\n },\n {\n \"url\": \"/_next/static/chunks/6697.d8e0dac6b86574ea.js\",\n \"revision\": \"d8e0dac6b86574ea\"\n },\n {\n \"url\": \"/_next/static/chunks/6706.d8aa7bb36df62fe5.js\",\n \"revision\": \"d8aa7bb36df62fe5\"\n },\n {\n \"url\": \"/_next/static/chunks/6760.d7ff4fca573b1745.js\",\n \"revision\": \"d7ff4fca573b1745\"\n },\n {\n \"url\": \"/_next/static/chunks/6780-c56502af24f4ac40.js\",\n \"revision\": \"c56502af24f4ac40\"\n },\n {\n \"url\": \"/_next/static/chunks/6802.db4406366238e37e.js\",\n \"revision\": \"db4406366238e37e\"\n },\n {\n \"url\": \"/_next/static/chunks/6817.13c1672d777a0eec.js\",\n \"revision\": \"13c1672d777a0eec\"\n },\n {\n \"url\": \"/_next/static/chunks/6872.1e9d79127bf664ba.js\",\n \"revision\": \"1e9d79127bf664ba\"\n },\n {\n \"url\": \"/_next/static/chunks/6913.9425952231bf920e.js\",\n \"revision\": \"9425952231bf920e\"\n },\n {\n \"url\": \"/_next/static/chunks/6968.b962eb18ec792779.js\",\n \"revision\": \"b962eb18ec792779\"\n },\n {\n \"url\": \"/_next/static/chunks/6973-859001847f9a89dd.js\",\n \"revision\": \"859001847f9a89dd\"\n },\n {\n \"url\": \"/_next/static/chunks/69cc6c6e.296cda1bf9ae4a91.js\",\n \"revision\": \"296cda1bf9ae4a91\"\n },\n {\n \"url\": \"/_next/static/chunks/7050.619d0ea819e403d7.js\",\n \"revision\": \"619d0ea819e403d7\"\n },\n {\n \"url\": \"/_next/static/chunks/718.776573caf21215e2.js\",\n \"revision\": \"776573caf21215e2\"\n },\n {\n \"url\": \"/_next/static/chunks/7192.04ac27166473f079.js\",\n \"revision\": \"04ac27166473f079\"\n },\n {\n \"url\": \"/_next/static/chunks/7240.ab2e7ea88f48c55a.js\",\n \"revision\": \"ab2e7ea88f48c55a\"\n },\n {\n \"url\": \"/_next/static/chunks/7377.3b032bd089ab361b.js\",\n \"revision\": \"3b032bd089ab361b\"\n },\n {\n \"url\": \"/_next/static/chunks/7450.7c90371e5d765d9f.js\",\n \"revision\": \"7c90371e5d765d9f\"\n },\n {\n \"url\": \"/_next/static/chunks/746.f6fc5e607547b2de.js\",\n \"revision\": \"f6fc5e607547b2de\"\n },\n {\n \"url\": \"/_next/static/chunks/7479.691913d53e4a34db.js\",\n \"revision\": \"691913d53e4a34db\"\n },\n {\n \"url\": \"/_next/static/chunks/7499.77b065089d67b7a1.js\",\n \"revision\": \"77b065089d67b7a1\"\n },\n {\n \"url\": \"/_next/static/chunks/7514.47daf8757ba27cd5.js\",\n \"revision\": \"47daf8757ba27cd5\"\n },\n {\n \"url\": \"/_next/static/chunks/7591.f0cdeb6c3a84f0a9.js\",\n \"revision\": \"f0cdeb6c3a84f0a9\"\n },\n {\n \"url\": \"/_next/static/chunks/7604.bc43bc963aa9e719.js\",\n \"revision\": \"bc43bc963aa9e719\"\n },\n {\n \"url\": \"/_next/static/chunks/7647.e8c67cad7a42eb61.js\",\n \"revision\": \"e8c67cad7a42eb61\"\n },\n {\n \"url\": \"/_next/static/chunks/7661.abcf8f525ca5f0d1.js\",\n \"revision\": \"abcf8f525ca5f0d1\"\n },\n {\n \"url\": \"/_next/static/chunks/7699.bbae8b71a00f5137.js\",\n \"revision\": \"bbae8b71a00f5137\"\n },\n {\n \"url\": \"/_next/static/chunks/7790.fb261ba20f1767e0.js\",\n \"revision\": \"fb261ba20f1767e0\"\n },\n {\n \"url\": \"/_next/static/chunks/783.519b840ebbcd632c.js\",\n \"revision\": \"519b840ebbcd632c\"\n },\n {\n \"url\": \"/_next/static/chunks/7877.1d4da334d1b925af.js\",\n \"revision\": \"1d4da334d1b925af\"\n },\n {\n \"url\": \"/_next/static/chunks/7975.71c2baef810ef52a.js\",\n \"revision\": \"71c2baef810ef52a\"\n },\n {\n \"url\": \"/_next/static/chunks/7992-339662065dab70b9.js\",\n \"revision\": \"339662065dab70b9\"\n },\n {\n \"url\": \"/_next/static/chunks/8038.5a92e42444091c3b.js\",\n \"revision\": \"5a92e42444091c3b\"\n },\n {\n \"url\": \"/_next/static/chunks/8073.0b1413d3ef6cfd93.js\",\n \"revision\": \"0b1413d3ef6cfd93\"\n },\n {\n \"url\": \"/_next/static/chunks/8200.a20afc43f1c1d029.js\",\n \"revision\": \"a20afc43f1c1d029\"\n },\n {\n \"url\": \"/_next/static/chunks/8208.30987ac743096803.js\",\n \"revision\": \"30987ac743096803\"\n },\n {\n \"url\": \"/_next/static/chunks/8226.c3eea1a146ab907d.js\",\n \"revision\": \"c3eea1a146ab907d\"\n },\n {\n \"url\": \"/_next/static/chunks/824.ee0e6583dabe1d39.js\",\n \"revision\": \"ee0e6583dabe1d39\"\n },\n {\n \"url\": \"/_next/static/chunks/8326.37263ebac0aa141b.js\",\n \"revision\": \"37263ebac0aa141b\"\n },\n {\n \"url\": \"/_next/static/chunks/8352.09a7be7496bf96cd.js\",\n \"revision\": \"09a7be7496bf96cd\"\n },\n {\n \"url\": \"/_next/static/chunks/8411.4acf0eed204328b0.js\",\n \"revision\": \"4acf0eed204328b0\"\n },\n {\n \"url\": \"/_next/static/chunks/8422-fb209977a9c64efe.js\",\n \"revision\": \"fb209977a9c64efe\"\n },\n {\n \"url\": \"/_next/static/chunks/8473.cf6825cb7909ad71.js\",\n \"revision\": \"cf6825cb7909ad71\"\n },\n {\n \"url\": \"/_next/static/chunks/8528.12ac46cb6762dd32.js\",\n \"revision\": \"12ac46cb6762dd32\"\n },\n {\n \"url\": \"/_next/static/chunks/8562.6bb47840f4b434cf.js\",\n \"revision\": \"6bb47840f4b434cf\"\n },\n {\n \"url\": \"/_next/static/chunks/8623.6503cb45eb8f14fd.js\",\n \"revision\": \"6503cb45eb8f14fd\"\n },\n {\n \"url\": \"/_next/static/chunks/8803.93c25c28a21d2a5e.js\",\n \"revision\": \"93c25c28a21d2a5e\"\n },\n {\n \"url\": \"/_next/static/chunks/8828.3f32610220d849fd.js\",\n \"revision\": \"3f32610220d849fd\"\n },\n {\n \"url\": \"/_next/static/chunks/8887.c22ada1c7c54a7e7.js\",\n \"revision\": \"c22ada1c7c54a7e7\"\n },\n {\n \"url\": \"/_next/static/chunks/8b9c9d49.7dbc6b0cb816a3f8.js\",\n \"revision\": \"7dbc6b0cb816a3f8\"\n },\n {\n \"url\": \"/_next/static/chunks/9051-ea44537a6036c1cb.js\",\n \"revision\": \"ea44537a6036c1cb\"\n },\n {\n \"url\": \"/_next/static/chunks/9062.cd887934c71d71b3.js\",\n \"revision\": \"cd887934c71d71b3\"\n },\n {\n \"url\": \"/_next/static/chunks/9097-4d8a491a271005c5.js\",\n \"revision\": \"4d8a491a271005c5\"\n },\n {\n \"url\": \"/_next/static/chunks/9168.b2144f122e2e99c6.js\",\n \"revision\": \"b2144f122e2e99c6\"\n },\n {\n \"url\": \"/_next/static/chunks/9190.0d80e80b457a10da.js\",\n \"revision\": \"0d80e80b457a10da\"\n },\n {\n \"url\": \"/_next/static/chunks/9198.c9cddb89cf1823ad.js\",\n \"revision\": \"c9cddb89cf1823ad\"\n },\n {\n \"url\": \"/_next/static/chunks/920.70c152baddfb50ff.js\",\n \"revision\": \"70c152baddfb50ff\"\n },\n {\n \"url\": \"/_next/static/chunks/9210.25d8dc80225efbb6.js\",\n \"revision\": \"25d8dc80225efbb6\"\n },\n {\n \"url\": \"/_next/static/chunks/9276.4fe311507b373e2e.js\",\n \"revision\": \"4fe311507b373e2e\"\n },\n {\n \"url\": \"/_next/static/chunks/9279.4d865b223e01f797.js\",\n \"revision\": \"4d865b223e01f797\"\n },\n {\n \"url\": \"/_next/static/chunks/9536.ef827e12654ac57b.js\",\n \"revision\": \"ef827e12654ac57b\"\n },\n {\n \"url\": \"/_next/static/chunks/9544.6030dff2e8e9e93e.js\",\n \"revision\": \"6030dff2e8e9e93e\"\n },\n {\n \"url\": \"/_next/static/chunks/9609.64a2cb5e28f9cd3e.js\",\n \"revision\": \"64a2cb5e28f9cd3e\"\n },\n {\n \"url\": \"/_next/static/chunks/9641.e058f112403e63ec.js\",\n \"revision\": \"e058f112403e63ec\"\n },\n {\n \"url\": \"/_next/static/chunks/9657-c27fcf1589fa452b.js\",\n \"revision\": \"c27fcf1589fa452b\"\n },\n {\n \"url\": \"/_next/static/chunks/9742-06cf9a875e67f008.js\",\n \"revision\": \"06cf9a875e67f008\"\n },\n {\n \"url\": \"/_next/static/chunks/9826.f9b5a0b813d2e821.js\",\n \"revision\": \"f9b5a0b813d2e821\"\n },\n {\n \"url\": \"/_next/static/chunks/9827.5acc62ae5b376628.js\",\n \"revision\": \"5acc62ae5b376628\"\n },\n {\n \"url\": \"/_next/static/chunks/9875.1e7416f200fbc9b6.js\",\n \"revision\": \"1e7416f200fbc9b6\"\n },\n {\n \"url\": \"/_next/static/chunks/9909.53c2459dbcbf26f1.js\",\n \"revision\": \"53c2459dbcbf26f1\"\n },\n {\n \"url\": \"/_next/static/chunks/9913.3c14037415ceca89.js\",\n \"revision\": \"3c14037415ceca89\"\n },\n {\n \"url\": \"/_next/static/chunks/9922.9678e0131028ac58.js\",\n \"revision\": \"9678e0131028ac58\"\n },\n {\n \"url\": \"/_next/static/chunks/9924.6533d0cc1a525b93.js\",\n \"revision\": \"6533d0cc1a525b93\"\n },\n {\n \"url\": \"/_next/static/chunks/9949.6842e6575500565f.js\",\n \"revision\": \"6842e6575500565f\"\n },\n {\n \"url\": \"/_next/static/chunks/9977.7dca3411e14e0f0e.js\",\n \"revision\": \"7dca3411e14e0f0e\"\n },\n {\n \"url\": \"/_next/static/chunks/b1e2b62c.0f89cefa8dbb9d27.js\",\n \"revision\": \"0f89cefa8dbb9d27\"\n },\n {\n \"url\": \"/_next/static/chunks/dfa224f5.43b130a8e09f3a17.js\",\n \"revision\": \"43b130a8e09f3a17\"\n },\n {\n \"url\": \"/_next/static/chunks/fec483df.a0056abc9a0fdb59.js\",\n \"revision\": \"a0056abc9a0fdb59\"\n },\n {\n \"url\": \"/_next/static/chunks/framework-b00c04ef0b16dbdc.js\",\n \"revision\": \"b00c04ef0b16dbdc\"\n },\n {\n \"url\": \"/_next/static/chunks/main-d90ccbaa45cbc5ed.js\",\n \"revision\": \"d90ccbaa45cbc5ed\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/403-0e602738484d0c76.js\",\n \"revision\": \"0e602738484d0c76\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/404-34cd16ef11cc6a61.js\",\n \"revision\": \"34cd16ef11cc6a61\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/_error-3102a18a08ab3181.js\",\n \"revision\": \"3102a18a08ab3181\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/_offline-c55b7b246f04cc0b.js\",\n \"revision\": \"c55b7b246f04cc0b\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/addOwner-13dc8865dbcd51e2.js\",\n \"revision\": \"13dc8865dbcd51e2\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/address-book-013f88ad068b4aff.js\",\n \"revision\": \"013f88ad068b4aff\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/apps-e630037306f5338f.js\",\n \"revision\": \"e630037306f5338f\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/apps/bookmarked-23fa6fd88dc4ac03.js\",\n \"revision\": \"23fa6fd88dc4ac03\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/apps/custom-586bb9dfc27da137.js\",\n \"revision\": \"586bb9dfc27da137\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/apps/open-c4a5a75ad742c131.js\",\n \"revision\": \"c4a5a75ad742c131\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/balances-27fa6d59cc32a8d2.js\",\n \"revision\": \"27fa6d59cc32a8d2\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/balances/nfts-2d72c6c2eb4b657f.js\",\n \"revision\": \"2d72c6c2eb4b657f\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/bridge-98a9fca1a01df215.js\",\n \"revision\": \"98a9fca1a01df215\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/cookie-d654e2b387f51478.js\",\n \"revision\": \"d654e2b387f51478\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/home-83da910ca5884945.js\",\n \"revision\": \"83da910ca5884945\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/imprint-fe3d6162615b26b9.js\",\n \"revision\": \"fe3d6162615b26b9\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/index-d0e9c9ba47f0aedc.js\",\n \"revision\": \"d0e9c9ba47f0aedc\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/licenses-a49dfdc6270dbc75.js\",\n \"revision\": \"a49dfdc6270dbc75\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/new-safe/advanced-create-1c91a1f7965e6be4.js\",\n \"revision\": \"1c91a1f7965e6be4\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/new-safe/create-546d78201e36b0f1.js\",\n \"revision\": \"546d78201e36b0f1\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/new-safe/load-5e055a3a06f2e487.js\",\n \"revision\": \"5e055a3a06f2e487\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/privacy-ad71b33782b55f77.js\",\n \"revision\": \"ad71b33782b55f77\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/settings-fb9abcd34a40c1e8.js\",\n \"revision\": \"fb9abcd34a40c1e8\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/settings/appearance-1d0a9aad047bb1a1.js\",\n \"revision\": \"1d0a9aad047bb1a1\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/settings/cookies-e70d40057f4d33e1.js\",\n \"revision\": \"e70d40057f4d33e1\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/settings/data-53f2754307071060.js\",\n \"revision\": \"53f2754307071060\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/settings/environment-variables-bcd9111902514c9e.js\",\n \"revision\": \"bcd9111902514c9e\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/settings/modules-e217250dd344fbb6.js\",\n \"revision\": \"e217250dd344fbb6\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/settings/notifications-d99409a97d23f0f8.js\",\n \"revision\": \"d99409a97d23f0f8\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/settings/safe-apps-2deea902a57d9fd8.js\",\n \"revision\": \"2deea902a57d9fd8\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/settings/security-2a605ba8bc358004.js\",\n \"revision\": \"2a605ba8bc358004\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/settings/setup-8e46a3781e40dae5.js\",\n \"revision\": \"8e46a3781e40dae5\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/share/safe-app-15a836af82f902e9.js\",\n \"revision\": \"15a836af82f902e9\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/stake-9584604699c778f4.js\",\n \"revision\": \"9584604699c778f4\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/swap-823ecc20b3019a4b.js\",\n \"revision\": \"823ecc20b3019a4b\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/terms-ef576a2454f97dab.js\",\n \"revision\": \"ef576a2454f97dab\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/transactions-807a86340099901d.js\",\n \"revision\": \"807a86340099901d\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/transactions/history-059e063e6a05c51f.js\",\n \"revision\": \"059e063e6a05c51f\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/transactions/messages-df9d79860992f407.js\",\n \"revision\": \"df9d79860992f407\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/transactions/msg-77f2cdef54e70dde.js\",\n \"revision\": \"77f2cdef54e70dde\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/transactions/queue-e0b344024fecfa7b.js\",\n \"revision\": \"e0b344024fecfa7b\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/transactions/tx-afde4da2f22ec73b.js\",\n \"revision\": \"afde4da2f22ec73b\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/wc-f79ad2d1fb40786d.js\",\n \"revision\": \"f79ad2d1fb40786d\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/welcome-a8c839e48be8aad2.js\",\n \"revision\": \"a8c839e48be8aad2\"\n },\n {\n \"url\": \"/_next/static/chunks/pages/welcome/accounts-4ef86f9f58e0952a.js\",\n \"revision\": \"4ef86f9f58e0952a\"\n },\n {\n \"url\": \"/_next/static/chunks/polyfills-42372ed130431b0a.js\",\n \"revision\": \"846118c33b2c0e922d7b3a7676f81f6f\"\n },\n {\n \"url\": \"/_next/static/chunks/webpack-b1461eb0c463b129.js\",\n \"revision\": \"b1461eb0c463b129\"\n },\n {\n \"url\": \"/_next/static/css/0325ce811b47b8bc.css\",\n \"revision\": \"0325ce811b47b8bc\"\n },\n {\n \"url\": \"/_next/static/css/04726b1217d1b556.css\",\n \"revision\": \"04726b1217d1b556\"\n },\n {\n \"url\": \"/_next/static/css/05a8af68d0e1304a.css\",\n \"revision\": \"05a8af68d0e1304a\"\n },\n {\n \"url\": \"/_next/static/css/09002e41251ee8cf.css\",\n \"revision\": \"09002e41251ee8cf\"\n },\n {\n \"url\": \"/_next/static/css/0f51dd2a0a2abeb0.css\",\n \"revision\": \"0f51dd2a0a2abeb0\"\n },\n {\n \"url\": \"/_next/static/css/2a6e3a4c7e6b70e2.css\",\n \"revision\": \"2a6e3a4c7e6b70e2\"\n },\n {\n \"url\": \"/_next/static/css/2e2090e6ff8ceaf1.css\",\n \"revision\": \"2e2090e6ff8ceaf1\"\n },\n {\n \"url\": \"/_next/static/css/344ef1f8fb641131.css\",\n \"revision\": \"344ef1f8fb641131\"\n },\n {\n \"url\": \"/_next/static/css/3d2cd67431c93f08.css\",\n \"revision\": \"3d2cd67431c93f08\"\n },\n {\n \"url\": \"/_next/static/css/52b93df3cd851532.css\",\n \"revision\": \"52b93df3cd851532\"\n },\n {\n \"url\": \"/_next/static/css/54474aff04c0fc2a.css\",\n \"revision\": \"54474aff04c0fc2a\"\n },\n {\n \"url\": \"/_next/static/css/5be783eccb2c32ad.css\",\n \"revision\": \"5be783eccb2c32ad\"\n },\n {\n \"url\": \"/_next/static/css/5e4baa0f74056ec0.css\",\n \"revision\": \"5e4baa0f74056ec0\"\n },\n {\n \"url\": \"/_next/static/css/65f736d7bfbde7c1.css\",\n \"revision\": \"65f736d7bfbde7c1\"\n },\n {\n \"url\": \"/_next/static/css/6ac58b9175dd1129.css\",\n \"revision\": \"6ac58b9175dd1129\"\n },\n {\n \"url\": \"/_next/static/css/7208e8689272f471.css\",\n \"revision\": \"7208e8689272f471\"\n },\n {\n \"url\": \"/_next/static/css/784d84c21f2990dc.css\",\n \"revision\": \"784d84c21f2990dc\"\n },\n {\n \"url\": \"/_next/static/css/80ffdb28e727e1c2.css\",\n \"revision\": \"80ffdb28e727e1c2\"\n },\n {\n \"url\": \"/_next/static/css/911fc349ecb8f7c7.css\",\n \"revision\": \"911fc349ecb8f7c7\"\n },\n {\n \"url\": \"/_next/static/css/939cbc230d3fa941.css\",\n \"revision\": \"939cbc230d3fa941\"\n },\n {\n \"url\": \"/_next/static/css/942e49f1b49b6c1f.css\",\n \"revision\": \"942e49f1b49b6c1f\"\n },\n {\n \"url\": \"/_next/static/css/9b4ea1f5ea781b62.css\",\n \"revision\": \"9b4ea1f5ea781b62\"\n },\n {\n \"url\": \"/_next/static/css/a69c3f158294584d.css\",\n \"revision\": \"a69c3f158294584d\"\n },\n {\n \"url\": \"/_next/static/css/ac8a3544ab91705a.css\",\n \"revision\": \"ac8a3544ab91705a\"\n },\n {\n \"url\": \"/_next/static/css/b3e4b275752bb003.css\",\n \"revision\": \"b3e4b275752bb003\"\n },\n {\n \"url\": \"/_next/static/css/c93cb5ebdf6d3e9a.css\",\n \"revision\": \"c93cb5ebdf6d3e9a\"\n },\n {\n \"url\": \"/_next/static/css/d7651ab49f490f49.css\",\n \"revision\": \"d7651ab49f490f49\"\n },\n {\n \"url\": \"/_next/static/css/dab84b8c732b93fc.css\",\n \"revision\": \"dab84b8c732b93fc\"\n },\n {\n \"url\": \"/_next/static/css/e422ad43397e1fce.css\",\n \"revision\": \"e422ad43397e1fce\"\n },\n {\n \"url\": \"/_next/static/css/eef19045765aba2d.css\",\n \"revision\": \"eef19045765aba2d\"\n },\n {\n \"url\": \"/_next/static/css/f189af51725c9949.css\",\n \"revision\": \"f189af51725c9949\"\n },\n {\n \"url\": \"/_next/static/css/f9fe9c327901a01d.css\",\n \"revision\": \"f9fe9c327901a01d\"\n },\n {\n \"url\": \"/_next/static/css/fb1edc5e5eaa6761.css\",\n \"revision\": \"fb1edc5e5eaa6761\"\n },\n {\n \"url\": \"/_next/static/css/ff0a082329b16806.css\",\n \"revision\": \"ff0a082329b16806\"\n },\n {\n \"url\": \"/_next/static/z1ClolYUDxZyEjVoStA1G/_buildManifest.js\",\n \"revision\": \"c0806a98b491d69156ec734e79f79b39\"\n },\n {\n \"url\": \"/_next/static/z1ClolYUDxZyEjVoStA1G/_ssgManifest.js\",\n \"revision\": \"b6652df95db52feb4daf4eca35380933\"\n },\n {\n \"url\": \"/_offline\",\n \"revision\": \"z1ClolYUDxZyEjVoStA1G\"\n },\n {\n \"url\": \"/fallback-ce627215c0e4a9af.js\",\n \"revision\": \"7599dba0a56d64555b034299468b622d\"\n },\n {\n \"url\": \"/favicon.ico\",\n \"revision\": \"7c2c266aceb63742058e915d8dd391f6\"\n },\n {\n \"url\": \"/favicons/android-chrome-192x192.png\",\n \"revision\": \"19efadb2c661b56521219343362949a5\"\n },\n {\n \"url\": \"/favicons/android-chrome-512x512.png\",\n \"revision\": \"4cda437e0ac8396c58fd7ee2e61f8166\"\n },\n {\n \"url\": \"/favicons/apple-touch-icon.png\",\n \"revision\": \"1f9e0d9e93ba6941121d4691c12857f2\"\n },\n {\n \"url\": \"/favicons/favicon-16x16.png\",\n \"revision\": \"2cac7200a93e5f8c06f8be6eb3ca8986\"\n },\n {\n \"url\": \"/favicons/favicon-32x32.png\",\n \"revision\": \"4611cfa5a923455b3537d809155ff55a\"\n },\n {\n \"url\": \"/favicons/favicon-dot.ico\",\n \"revision\": \"e57487f20c8a9741a4e897286be51a25\"\n },\n {\n \"url\": \"/favicons/favicon.ico\",\n \"revision\": \"7c2c266aceb63742058e915d8dd391f6\"\n },\n {\n \"url\": \"/favicons/logo_120x120.png\",\n \"revision\": \"f56fd1d76437d60f0df3c39d158932be\"\n },\n {\n \"url\": \"/favicons/mstile-144x144.png\",\n \"revision\": \"2797afb5bebdb70f8508e271aca7905b\"\n },\n {\n \"url\": \"/favicons/mstile-150x150.png\",\n \"revision\": \"33aac20f32ec219f84b63bca73ef4f24\"\n },\n {\n \"url\": \"/favicons/mstile-310x150.png\",\n \"revision\": \"55b94b9668cdf3eaeb2ff9b14990e3d9\"\n },\n {\n \"url\": \"/favicons/mstile-310x310.png\",\n \"revision\": \"d8dbdbf0cdb6beb11f3cc2ea9c58d4b2\"\n },\n {\n \"url\": \"/favicons/mstile-70x70.png\",\n \"revision\": \"1a813460797fe6ece9d93692b28dac47\"\n },\n {\n \"url\": \"/favicons/safari-pinned-tab.svg\",\n \"revision\": \"d9d8075003bf00b8b6057f061cc323e4\"\n },\n {\n \"url\": \"/fonts/DMSans700.woff2\",\n \"revision\": \"bb9e00c4795eafe47da4aa58faa31206\"\n },\n {\n \"url\": \"/fonts/DMSansRegular.woff2\",\n \"revision\": \"870d6016de57ba7fd21216bcd31e9653\"\n },\n {\n \"url\": \"/fonts/fonts.css\",\n \"revision\": \"a0aca74e5d3e6b03c3394f40e9b0f5f7\"\n },\n {\n \"url\": \"/images/address-book/address-book.svg\",\n \"revision\": \"b794ba7f8860fedba9893671693aab58\"\n },\n {\n \"url\": \"/images/address-book/no-entries.svg\",\n \"revision\": \"23c6d763473b04b2ea7f86ac1ae963bc\"\n },\n {\n \"url\": \"/images/apps/add-custom-app.svg\",\n \"revision\": \"a6ad2c62914cd4b130e4356bab375155\"\n },\n {\n \"url\": \"/images/apps/app-placeholder.svg\",\n \"revision\": \"c9881914f33c15d14f2c68d8c8524490\"\n },\n {\n \"url\": \"/images/apps/apps-demo.svg\",\n \"revision\": \"963a511a49c4087db15da4f1f06b4079\"\n },\n {\n \"url\": \"/images/apps/apps-icon.svg\",\n \"revision\": \"9bd20e47f80b048ee31823e064826111\"\n },\n {\n \"url\": \"/images/apps/batch-icon.svg\",\n \"revision\": \"311a8643bf6433e9db636ed0ebc55f06\"\n },\n {\n \"url\": \"/images/apps/bookmark.svg\",\n \"revision\": \"55e78088269556fc2e082f1095d5bd06\"\n },\n {\n \"url\": \"/images/apps/bookmarked.svg\",\n \"revision\": \"e2301b5db49e3af12f4ee44d91ac7445\"\n },\n {\n \"url\": \"/images/apps/code-icon.svg\",\n \"revision\": \"1ba53640f514f54cd26aab83238ad6e8\"\n },\n {\n \"url\": \"/images/apps/explore.svg\",\n \"revision\": \"3b431d5eca78e65ba3dd9208d9e75287\"\n },\n {\n \"url\": \"/images/apps/grid-view-icon.svg\",\n \"revision\": \"a9fb0ddb02f642ce08c513dc1734aacb\"\n },\n {\n \"url\": \"/images/apps/list-view-icon.svg\",\n \"revision\": \"0b99c2d602af7427013e743fd71da016\"\n },\n {\n \"url\": \"/images/apps/network-error.svg\",\n \"revision\": \"1ce0c08148c04d5384efcb697f2fe8d1\"\n },\n {\n \"url\": \"/images/balances/no-assets.svg\",\n \"revision\": \"021b6ec43cf8cb4830224a035067c405\"\n },\n {\n \"url\": \"/images/common/add-outlined.svg\",\n \"revision\": \"c611267898be27a1081ec29305c04cce\"\n },\n {\n \"url\": \"/images/common/add.svg\",\n \"revision\": \"aa9b46af12bc8a9ee5387f5d63275c92\"\n },\n {\n \"url\": \"/images/common/alert.svg\",\n \"revision\": \"3080f58439524b917c9406b078763bd1\"\n },\n {\n \"url\": \"/images/common/arrow-down.svg\",\n \"revision\": \"a84bdab6dde6625fa978b6c8d72724c4\"\n },\n {\n \"url\": \"/images/common/arrow-nw.svg\",\n \"revision\": \"ce2cda85d81f4ef834bf520a64f1c9e9\"\n },\n {\n \"url\": \"/images/common/arrow-se.svg\",\n \"revision\": \"d741cac0d659082021bab492b39e3e96\"\n },\n {\n \"url\": \"/images/common/arrow-top-right.svg\",\n \"revision\": \"81fcf81370ab74a483c3cd2d04fde0de\"\n },\n {\n \"url\": \"/images/common/asterix.svg\",\n \"revision\": \"3079871a9a8fb6437b8e0a2c5d2a4d40\"\n },\n {\n \"url\": \"/images/common/bar-chart.svg\",\n \"revision\": \"60c1b25cc156f18fa65db5ecf2b520e5\"\n },\n {\n \"url\": \"/images/common/batch.svg\",\n \"revision\": \"667fa08aff4931442799f91c408825b0\"\n },\n {\n \"url\": \"/images/common/block.svg\",\n \"revision\": \"335cb6d2448eb833e1333c3c904f683d\"\n },\n {\n \"url\": \"/images/common/bridge.svg\",\n \"revision\": \"ca765a349d3834cefef75646bb704d5e\"\n },\n {\n \"url\": \"/images/common/cancel.svg\",\n \"revision\": \"2a08f1bf3d9762b0c743f782b462e56d\"\n },\n {\n \"url\": \"/images/common/caret-down.svg\",\n \"revision\": \"1754bee20f6c52665ff74e6eff9372ee\"\n },\n {\n \"url\": \"/images/common/check-filled.svg\",\n \"revision\": \"d63ad02c106c92aefb228a5f99cdcfe8\"\n },\n {\n \"url\": \"/images/common/check.svg\",\n \"revision\": \"6e48f7876b2beaa9d096a9e0f10b98f2\"\n },\n {\n \"url\": \"/images/common/circle-check.svg\",\n \"revision\": \"a07821e3d6ec6f5684895933808d7108\"\n },\n {\n \"url\": \"/images/common/circle-partial-fill.svg\",\n \"revision\": \"9c02c6275d0efe76ecd5129dc1631093\"\n },\n {\n \"url\": \"/images/common/circle.svg\",\n \"revision\": \"0534f7e4917ee736d1cc277e538746d7\"\n },\n {\n \"url\": \"/images/common/clock.svg\",\n \"revision\": \"70453e1b3b5170a0ac9689236e1037d5\"\n },\n {\n \"url\": \"/images/common/close.svg\",\n \"revision\": \"aec2680a3b2d47b8be3409c36e51bcec\"\n },\n {\n \"url\": \"/images/common/connection-dots.svg\",\n \"revision\": \"3a462cad5f8bec4833f9643722eeec52\"\n },\n {\n \"url\": \"/images/common/copy.svg\",\n \"revision\": \"49b0a644d0615ea6415939ba46c27d0b\"\n },\n {\n \"url\": \"/images/common/created.svg\",\n \"revision\": \"1246b58e5e6c1087e8ab477ebfb632db\"\n },\n {\n \"url\": \"/images/common/delete.svg\",\n \"revision\": \"08177dc867b6dbbe54a705f185ea6b14\"\n },\n {\n \"url\": \"/images/common/discord-icon.svg\",\n \"revision\": \"c5614f368dcb02a62606173280f738fd\"\n },\n {\n \"url\": \"/images/common/document_signature.svg\",\n \"revision\": \"b48f7244ad56664cf82f5680e34556f9\"\n },\n {\n \"url\": \"/images/common/dot.svg\",\n \"revision\": \"278f6b72e45595d101bb8e59a44ca106\"\n },\n {\n \"url\": \"/images/common/download-cloud.svg\",\n \"revision\": \"921b102009ee206f4d732565e1d3c77a\"\n },\n {\n \"url\": \"/images/common/drag.svg\",\n \"revision\": \"26eb4c9b4dcac1f2f65436b88d15800f\"\n },\n {\n \"url\": \"/images/common/edit.svg\",\n \"revision\": \"15be3179a68f3d3a30af73ef9112d945\"\n },\n {\n \"url\": \"/images/common/empty-batch.svg\",\n \"revision\": \"a46af4d941dd63430c1716eddae2d18f\"\n },\n {\n \"url\": \"/images/common/error.png\",\n \"revision\": \"c4f282a19c5d166847205a13c4e93e04\"\n },\n {\n \"url\": \"/images/common/export.svg\",\n \"revision\": \"1163371cc04e04b75212256972473401\"\n },\n {\n \"url\": \"/images/common/gas-station.svg\",\n \"revision\": \"2ba58e75cae2768c0d0f5958e5a007cc\"\n },\n {\n \"url\": \"/images/common/gnosis-chain-logo.png\",\n \"revision\": \"a4bf18b5966de9cb9d39537e35ab5b3e\"\n },\n {\n \"url\": \"/images/common/ic-rocket-speedup.svg\",\n \"revision\": \"c14e4c55a136127d9f26cfa489d8bc89\"\n },\n {\n \"url\": \"/images/common/ic-swaps.svg\",\n \"revision\": \"b14c5dfb7753da99f0cba2d84bbdce03\"\n },\n {\n \"url\": \"/images/common/import.svg\",\n \"revision\": \"2e1f441e70f0dc50f6b3ffb2c9162e99\"\n },\n {\n \"url\": \"/images/common/kiln.svg\",\n \"revision\": \"da0db695c7127510a948d478f26a2b32\"\n },\n {\n \"url\": \"/images/common/lightbulb.svg\",\n \"revision\": \"7dc0e4b2474e7a427baf33fe6e35d063\"\n },\n {\n \"url\": \"/images/common/link.svg\",\n \"revision\": \"22f4af99f056d33c717b80cd81ad148c\"\n },\n {\n \"url\": \"/images/common/loading.svg\",\n \"revision\": \"b73d68db0914dcd69df158a37557da12\"\n },\n {\n \"url\": \"/images/common/lock-small.svg\",\n \"revision\": \"8f48a210e138a9e4bd9242613da30116\"\n },\n {\n \"url\": \"/images/common/lock-warning.svg\",\n \"revision\": \"99d329a645cf942500ddcf4268c9ca36\"\n },\n {\n \"url\": \"/images/common/lock.svg\",\n \"revision\": \"96fafbf3b8bca808ef15384c52c0f81d\"\n },\n {\n \"url\": \"/images/common/minus.svg\",\n \"revision\": \"2e4f7911ca62d816e88c6cedbe0825f0\"\n },\n {\n \"url\": \"/images/common/multisend.svg\",\n \"revision\": \"304f0ba02d7c1b22e93b17a394d52640\"\n },\n {\n \"url\": \"/images/common/network-error.svg\",\n \"revision\": \"bbcb2e994e4b5fb1068e2821d6a97c61\"\n },\n {\n \"url\": \"/images/common/nft-atomic0.svg\",\n \"revision\": \"a3ba2de8e6337a105954fbcca2d91450\"\n },\n {\n \"url\": \"/images/common/nft-blur.svg\",\n \"revision\": \"b6083df604d38f303c207f7fc723a475\"\n },\n {\n \"url\": \"/images/common/nft-etherscan.svg\",\n \"revision\": \"d5d73127f3660199fe51fb8ac4f7073d\"\n },\n {\n \"url\": \"/images/common/nft-gnosisscan.svg\",\n \"revision\": \"f10c48b716894dfde81f3bc38ac1bebc\"\n },\n {\n \"url\": \"/images/common/nft-opensea.svg\",\n \"revision\": \"574b35d5296d88d6752656b55450cf61\"\n },\n {\n \"url\": \"/images/common/nft-placeholder.png\",\n \"revision\": \"e21d5701dc5386b933624b0676115970\"\n },\n {\n \"url\": \"/images/common/nft-polygonscan.svg\",\n \"revision\": \"fec0858183a9d7da71527c41d6725458\"\n },\n {\n \"url\": \"/images/common/nft-zapper.svg\",\n \"revision\": \"5a50ed5ff41188da774fa82d2564fbd8\"\n },\n {\n \"url\": \"/images/common/nft-zerion.svg\",\n \"revision\": \"92ae353910b3db7a61789e1786430361\"\n },\n {\n \"url\": \"/images/common/nft.svg\",\n \"revision\": \"5cbca4cd1e0608354fc60eeff565d717\"\n },\n {\n \"url\": \"/images/common/notifications.svg\",\n \"revision\": \"a70bc899f4b977c2a5cae0089a5729e0\"\n },\n {\n \"url\": \"/images/common/outreach-popup-avatar.png\",\n \"revision\": \"4c20eaf2de10d8a3121facbd6db84ff7\"\n },\n {\n \"url\": \"/images/common/owners.svg\",\n \"revision\": \"5921b22351f303cb6d171bce4e512d38\"\n },\n {\n \"url\": \"/images/common/plus.svg\",\n \"revision\": \"425166be62ac1284f134a31d91ce9b9b\"\n },\n {\n \"url\": \"/images/common/propose-recovery-dark.svg\",\n \"revision\": \"88f4fc7671954add1bd7e96464d50a5d\"\n },\n {\n \"url\": \"/images/common/propose-recovery-light.svg\",\n \"revision\": \"58d5d13c97cff1c6bab7165b9951622c\"\n },\n {\n \"url\": \"/images/common/qr.svg\",\n \"revision\": \"36608a0a6d4cf6835112c19041bf6a49\"\n },\n {\n \"url\": \"/images/common/question.svg\",\n \"revision\": \"a00faa931c34a434919601d6bcd52949\"\n },\n {\n \"url\": \"/images/common/ramp_logo.svg\",\n \"revision\": \"68047084576dc6e339f1a38ddf0c27ca\"\n },\n {\n \"url\": \"/images/common/recovery-pending.svg\",\n \"revision\": \"395d0a0f4d5d0e9226a7a78051de754e\"\n },\n {\n \"url\": \"/images/common/recovery-plus.svg\",\n \"revision\": \"8cb155655657b8f9573ef98a32d7b533\"\n },\n {\n \"url\": \"/images/common/recovery.svg\",\n \"revision\": \"736a46a9924c67c6287a6efbb6a9899e\"\n },\n {\n \"url\": \"/images/common/recovery_custom.svg\",\n \"revision\": \"bf008ede842ca1524deb8c4f52379332\"\n },\n {\n \"url\": \"/images/common/recovery_sygnum.svg\",\n \"revision\": \"a4bfdcbf094474b2223606f1a210b48d\"\n },\n {\n \"url\": \"/images/common/relayer.svg\",\n \"revision\": \"82783a0bac87bd2aabf5b90ef7803173\"\n },\n {\n \"url\": \"/images/common/rocket.svg\",\n \"revision\": \"72720d578bbef6d257833fa18b864a45\"\n },\n {\n \"url\": \"/images/common/safe-pass-logo.svg\",\n \"revision\": \"e385ff33e5431e20130d0de20a6e8af9\"\n },\n {\n \"url\": \"/images/common/safe-pass-star.svg\",\n \"revision\": \"6109f1b4b6cbc0c3959078c76b7694b1\"\n },\n {\n \"url\": \"/images/common/safe-swap-dark.svg\",\n \"revision\": \"a4f15d40f9c5f459c25da8a057591b53\"\n },\n {\n \"url\": \"/images/common/safe-swap.svg\",\n \"revision\": \"22a5ff91d08a72086ca647d0aa60d67b\"\n },\n {\n \"url\": \"/images/common/safe-token.svg\",\n \"revision\": \"4a9a460e867863ed1b4d3c922fe51a63\"\n },\n {\n \"url\": \"/images/common/save-address.svg\",\n \"revision\": \"17c777058efeeb60ff95d12b6ad1845e\"\n },\n {\n \"url\": \"/images/common/search.svg\",\n \"revision\": \"3cb7672d6bee591a6fd2da6326033f39\"\n },\n {\n \"url\": \"/images/common/share.svg\",\n \"revision\": \"0c0e14f67e137692a5f74bec58bd433d\"\n },\n {\n \"url\": \"/images/common/shield-off.svg\",\n \"revision\": \"fc83939577ae609d4b2d1dbec7664b12\"\n },\n {\n \"url\": \"/images/common/shield.svg\",\n \"revision\": \"128f56828d7e459d0763f1d87832bd11\"\n },\n {\n \"url\": \"/images/common/stake-illustration-dark.svg\",\n \"revision\": \"6112ba4663740b9f7f2dd6452f3d97de\"\n },\n {\n \"url\": \"/images/common/stake-illustration-light.svg\",\n \"revision\": \"6d0f3d86902754028cf662555b97eb04\"\n },\n {\n \"url\": \"/images/common/stake.svg\",\n \"revision\": \"933a1b161f14a4689b89f2dd61c71e7d\"\n },\n {\n \"url\": \"/images/common/success.svg\",\n \"revision\": \"36f26701291fe049b54ce6e2ba1bbd7c\"\n },\n {\n \"url\": \"/images/common/swap-empty-dark.svg\",\n \"revision\": \"6ffddff8c8dab263fcd8ca6d760252f9\"\n },\n {\n \"url\": \"/images/common/swap-empty-light.svg\",\n \"revision\": \"da1bbb41f65ec12b3f715f3c60015287\"\n },\n {\n \"url\": \"/images/common/swap.svg\",\n \"revision\": \"70cd3364287dc37167a599b64557747f\"\n },\n {\n \"url\": \"/images/common/token-placeholder.svg\",\n \"revision\": \"5f16b1719073372a27ebb56e5943d629\"\n },\n {\n \"url\": \"/images/common/tx-failed.svg\",\n \"revision\": \"b2db37260b13a482cf84d070719cd126\"\n },\n {\n \"url\": \"/images/common/walletconnect.svg\",\n \"revision\": \"aef942bac7c65f3c25acc7056b0ac22c\"\n },\n {\n \"url\": \"/images/common/zkemail-logo.svg\",\n \"revision\": \"5d8b506835dff4dd03f9e438a7e94438\"\n },\n {\n \"url\": \"/images/logo-no-text.svg\",\n \"revision\": \"ee5e743e3e65f57d162125fdf7b9db11\"\n },\n {\n \"url\": \"/images/logo-round.svg\",\n \"revision\": \"2aba3dd8dae2cd853af57221d1342a2f\"\n },\n {\n \"url\": \"/images/logo-text.svg\",\n \"revision\": \"f7fc75dd382efdf08890438825890626\"\n },\n {\n \"url\": \"/images/logo.svg\",\n \"revision\": \"37870ef3577cf7e920dfc68794fa4f0c\"\n },\n {\n \"url\": \"/images/messages/created.svg\",\n \"revision\": \"8510aa6814f278add75d9cb352a4ddf1\"\n },\n {\n \"url\": \"/images/messages/dot.svg\",\n \"revision\": \"278f6b72e45595d101bb8e59a44ca106\"\n },\n {\n \"url\": \"/images/messages/link.svg\",\n \"revision\": \"c7f1d663290422b02bf9f80fb861a076\"\n },\n {\n \"url\": \"/images/messages/no-messages.svg\",\n \"revision\": \"2c3057dfe93b3d9c5c774ff5a9109065\"\n },\n {\n \"url\": \"/images/messages/required.svg\",\n \"revision\": \"0c5baf7feb1084ea7ebdb2996ec22b2b\"\n },\n {\n \"url\": \"/images/messages/signed.svg\",\n \"revision\": \"896874195bf6ebf147fdd544103574da\"\n },\n {\n \"url\": \"/images/notifications/alert.svg\",\n \"revision\": \"25e97d0dbcec0f0cb423e5e54036beb2\"\n },\n {\n \"url\": \"/images/notifications/error.svg\",\n \"revision\": \"e0b948225d3b8a9b10dfeb5dd0b62259\"\n },\n {\n \"url\": \"/images/notifications/info.svg\",\n \"revision\": \"589f76fde2e7446599496736c82ff635\"\n },\n {\n \"url\": \"/images/notifications/no-notifications.svg\",\n \"revision\": \"9dd6ec9ae60336a91e35c3b9d2b656dd\"\n },\n {\n \"url\": \"/images/notifications/push-notification.svg\",\n \"revision\": \"f53966517e12984fb462007e8e625007\"\n },\n {\n \"url\": \"/images/notifications/success.svg\",\n \"revision\": \"cd8f57f75f6431166ae020d77f2bec15\"\n },\n {\n \"url\": \"/images/notifications/warning.svg\",\n \"revision\": \"ed50f462de0d623bb86369cb99e75cb1\"\n },\n {\n \"url\": \"/images/open/safe-creation-error.svg\",\n \"revision\": \"9a0447332a5fe51e959f5544cdfa24b4\"\n },\n {\n \"url\": \"/images/open/safe-creation-process.gif\",\n \"revision\": \"b232de4b89ac482dc33066427e80cf69\"\n },\n {\n \"url\": \"/images/open/safe-creation.svg\",\n \"revision\": \"84cde3c71bbcdf993721626cc030e0dd\"\n },\n {\n \"url\": \"/images/safe-logo-green.png\",\n \"revision\": \"ac689047aaea47dca71b4331252fcb5b\"\n },\n {\n \"url\": \"/images/settings/data/file.svg\",\n \"revision\": \"e4eac9adb73bc68f9c25beca16a989a8\"\n },\n {\n \"url\": \"/images/settings/permissions/shield.svg\",\n \"revision\": \"4f2069e4b4b0d5d8eb8614b3cbfc6656\"\n },\n {\n \"url\": \"/images/settings/setup/replace-owner.svg\",\n \"revision\": \"a75bc6717561817eca68732aae7b64b0\"\n },\n {\n \"url\": \"/images/settings/spending-limit/asset-amount.svg\",\n \"revision\": \"911548a4251e251fc2a6f95a7a0832b1\"\n },\n {\n \"url\": \"/images/settings/spending-limit/beneficiary.svg\",\n \"revision\": \"e47828231bf3ab5b4507aed0361a5591\"\n },\n {\n \"url\": \"/images/settings/spending-limit/speed.svg\",\n \"revision\": \"cd07739c68241ecf67f917842ae0474c\"\n },\n {\n \"url\": \"/images/settings/spending-limit/time.svg\",\n \"revision\": \"80c93be9029566ae82b7651ca61f2a68\"\n },\n {\n \"url\": \"/images/sidebar/address-book.svg\",\n \"revision\": \"61734a65aec273f784bb1afe545b0d7c\"\n },\n {\n \"url\": \"/images/sidebar/apps.svg\",\n \"revision\": \"14cd4269b90a881cecf137a2b7e52a84\"\n },\n {\n \"url\": \"/images/sidebar/assets.svg\",\n \"revision\": \"493fa4ffa31c4056b27f22f90cdd8408\"\n },\n {\n \"url\": \"/images/sidebar/copy-bold.svg\",\n \"revision\": \"a9a7ad975520b906ff64d94d9c8304bc\"\n },\n {\n \"url\": \"/images/sidebar/help-center.svg\",\n \"revision\": \"7b634b3e5887d92b510212cb187d464b\"\n },\n {\n \"url\": \"/images/sidebar/home.svg\",\n \"revision\": \"02f8afac00da891db2e044162409e084\"\n },\n {\n \"url\": \"/images/sidebar/link-bold.svg\",\n \"revision\": \"4fa3ad23c10f296c4a2a1d867decd82c\"\n },\n {\n \"url\": \"/images/sidebar/link.svg\",\n \"revision\": \"75bbc7a3e4d09740999c52fd32be7a49\"\n },\n {\n \"url\": \"/images/sidebar/multichain-account.svg\",\n \"revision\": \"1ff9cfca9d27201f60f3559fdf1ad5c9\"\n },\n {\n \"url\": \"/images/sidebar/qr-bold.svg\",\n \"revision\": \"52e329671ae7949b2e7b5043d61f9cef\"\n },\n {\n \"url\": \"/images/sidebar/settings.svg\",\n \"revision\": \"4818266683f2f5750842bc206231dfc8\"\n },\n {\n \"url\": \"/images/sidebar/transactions.svg\",\n \"revision\": \"5eddf8d0dbbd5c98e840197e946f1d8e\"\n },\n {\n \"url\": \"/images/sidebar/whats-new.svg\",\n \"revision\": \"cf48d417e8371e0f9a02e915cada4506\"\n },\n {\n \"url\": \"/images/social-share.png\",\n \"revision\": \"8ba7450871feae9e62b3c0650df5da2d\"\n },\n {\n \"url\": \"/images/transactions/blockaid-icon.svg\",\n \"revision\": \"580bc9cb5b10cc3146cc8f12d6c42758\"\n },\n {\n \"url\": \"/images/transactions/circle-cross-red.svg\",\n \"revision\": \"f2a32e0b90c0d0a8eb67d0edf89612a7\"\n },\n {\n \"url\": \"/images/transactions/custom.svg\",\n \"revision\": \"3467f5a9cf765e8a408092da8761ccc8\"\n },\n {\n \"url\": \"/images/transactions/ghost.svg\",\n \"revision\": \"af68f86284ecffc9550072237991c884\"\n },\n {\n \"url\": \"/images/transactions/incoming.svg\",\n \"revision\": \"90ccd2bd76916db264b7e7e1bdc87956\"\n },\n {\n \"url\": \"/images/transactions/nestedTx.svg\",\n \"revision\": \"917220d086e55f547ebb2ebbb3a90409\"\n },\n {\n \"url\": \"/images/transactions/new-tx.svg\",\n \"revision\": \"bb9e8307da71fd66883162d424f768de\"\n },\n {\n \"url\": \"/images/transactions/no-transactions.svg\",\n \"revision\": \"fb1284a44ca314e104aafa91a98177f1\"\n },\n {\n \"url\": \"/images/transactions/outgoing.svg\",\n \"revision\": \"64d807a86381cda5d6c154c395510136\"\n },\n {\n \"url\": \"/images/transactions/recovery-execution.svg\",\n \"revision\": \"afdbecb8120f799fa41076526ca6401d\"\n },\n {\n \"url\": \"/images/transactions/recovery-recoverer.svg\",\n \"revision\": \"769cd6a790ed5a0a8140f51507d5add2\"\n },\n {\n \"url\": \"/images/transactions/redefine-dark-mode.png\",\n \"revision\": \"21249e199cfa0e681519ceb1902a27cd\"\n },\n {\n \"url\": \"/images/transactions/redefine.png\",\n \"revision\": \"1dc34252a49edd255607596bd30d7cf7\"\n },\n {\n \"url\": \"/images/transactions/replace-tx.svg\",\n \"revision\": \"eca2163f4c58fb45643e62b67da56586\"\n },\n {\n \"url\": \"/images/transactions/rocket.svg\",\n \"revision\": \"996a01c8c32fc824dff2efc1f88bf1eb\"\n },\n {\n \"url\": \"/images/transactions/settings.svg\",\n \"revision\": \"02dcae4bc18f8a6c795ec4dab347ffe3\"\n },\n {\n \"url\": \"/images/transactions/signature.svg\",\n \"revision\": \"72573b1d6f986ae42d52610103623601\"\n },\n {\n \"url\": \"/images/transactions/tenderly-dark.svg\",\n \"revision\": \"c51b99991874e4970c6d50be0e503e23\"\n },\n {\n \"url\": \"/images/transactions/tenderly-light.svg\",\n \"revision\": \"576e35475da7abc4b52d590e5680327f\"\n },\n {\n \"url\": \"/images/transactions/transactions.svg\",\n \"revision\": \"6957c5af293938abc6c18025e9904a1e\"\n },\n {\n \"url\": \"/images/transactions/zodiac-roles.svg\",\n \"revision\": \"3f53346b97fca29ba3ec0dd0d7d77d13\"\n },\n {\n \"url\": \"/images/welcome/load-safe.svg\",\n \"revision\": \"725c9e02f26b5adc63d1b9780615268c\"\n },\n {\n \"url\": \"/images/welcome/logo-google.svg\",\n \"revision\": \"e19c89a11dc80dbc78ce7148c2194d10\"\n },\n {\n \"url\": \"/images/welcome/new-safe.svg\",\n \"revision\": \"7ae995cfcf2faaeaf0493d47661e4687\"\n },\n {\n \"url\": \"/safe.webmanifest\",\n \"revision\": \"6bf2ede1e89df768f788a59188da77c1\"\n },\n {\n \"url\": \"/worker-a1b55571f2865253.js\",\n \"revision\": \"d27b9f68569e44519526173ed5ab615a\"\n }\n], {\n \"ignoreURLParametersMatching\": [/^utm_/, /^fbclid$/]\n});\nworkbox_precaching_cleanupOutdatedCaches();\n\n\n\nworkbox_routing_registerRoute(\"/\", new workbox_strategies_NetworkFirst({ \"cacheName\":\"start-url\", plugins: [{ cacheWillUpdate: async ({ response: e })=>e && \"opaqueredirect\" === e.type ? new Response(e.body, { status: 200, statusText: \"OK\", headers: e.headers }) : e }, { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/^https:\\/\\/fonts\\.(?:gstatic)\\.com\\/.*/i, new workbox_strategies_CacheFirst({ \"cacheName\":\"google-fonts-webfonts\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 4, maxAgeSeconds: 31536000 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/^https:\\/\\/fonts\\.(?:googleapis)\\.com\\/.*/i, new workbox_strategies_StaleWhileRevalidate({ \"cacheName\":\"google-fonts-stylesheets\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 4, maxAgeSeconds: 604800 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/\\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i, new workbox_strategies_StaleWhileRevalidate({ \"cacheName\":\"static-font-assets\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 4, maxAgeSeconds: 604800 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/\\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i, new workbox_strategies_StaleWhileRevalidate({ \"cacheName\":\"static-image-assets\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 64, maxAgeSeconds: 2592000 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/\\/_next\\/static.+\\.js$/i, new workbox_strategies_CacheFirst({ \"cacheName\":\"next-static-js-assets\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 64, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/\\/_next\\/image\\?url=.+$/i, new workbox_strategies_StaleWhileRevalidate({ \"cacheName\":\"next-image\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 64, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/\\.(?:mp3|wav|ogg)$/i, new workbox_strategies_CacheFirst({ \"cacheName\":\"static-audio-assets\", plugins: [new workbox_range_requests_RangeRequestsPlugin(), new workbox_expiration_ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/\\.(?:mp4|webm)$/i, new workbox_strategies_CacheFirst({ \"cacheName\":\"static-video-assets\", plugins: [new workbox_range_requests_RangeRequestsPlugin(), new workbox_expiration_ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/\\.(?:js)$/i, new workbox_strategies_StaleWhileRevalidate({ \"cacheName\":\"static-js-assets\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 48, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/\\.(?:css|less)$/i, new workbox_strategies_StaleWhileRevalidate({ \"cacheName\":\"static-style-assets\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/\\/_next\\/data\\/.+\\/.+\\.json$/i, new workbox_strategies_StaleWhileRevalidate({ \"cacheName\":\"next-data\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(/\\.(?:json|xml|csv)$/i, new workbox_strategies_NetworkFirst({ \"cacheName\":\"static-data-assets\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(({ sameOrigin: e, url: { pathname: t } })=>!(!e || t.startsWith(\"/api/auth/callback\")) && !!t.startsWith(\"/api/\"), new workbox_strategies_NetworkFirst({ \"cacheName\":\"apis\",\"networkTimeoutSeconds\":10, plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 16, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(({ request: e, url: { pathname: t }, sameOrigin: a })=>\"1\" === e.headers.get(\"RSC\") && \"1\" === e.headers.get(\"Next-Router-Prefetch\") && a && !t.startsWith(\"/api/\"), new workbox_strategies_NetworkFirst({ \"cacheName\":\"pages-rsc-prefetch\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(({ request: e, url: { pathname: t }, sameOrigin: a })=>\"1\" === e.headers.get(\"RSC\") && a && !t.startsWith(\"/api/\"), new workbox_strategies_NetworkFirst({ \"cacheName\":\"pages-rsc\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(({ url: { pathname: e }, sameOrigin: t })=>t && !e.startsWith(\"/api/\"), new workbox_strategies_NetworkFirst({ \"cacheName\":\"pages\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 86400 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\nworkbox_routing_registerRoute(({ sameOrigin: e })=>!e, new workbox_strategies_NetworkFirst({ \"cacheName\":\"cross-origin\",\"networkTimeoutSeconds\":10, plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 32, maxAgeSeconds: 3600 }), { handlerDidError: async ({ request: e })=>\"undefined\" != typeof self ? self.fallback(e) : Response.error() }] }), 'GET');\n\n\n\n\n"],"names":["importScripts","self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching","workbox_precaching_cleanupOutdatedCaches","workbox_routing_registerRoute","workbox_strategies_NetworkFirst","cacheName","plugins","cacheWillUpdate","async","response","e","type","Response","body","status","statusText","headers","handlerDidError","request","fallback","error","workbox_strategies_CacheFirst","workbox_expiration_ExpirationPlugin","maxEntries","maxAgeSeconds","workbox_strategies_StaleWhileRevalidate","workbox_range_requests_RangeRequestsPlugin","sameOrigin","pathname","t","startsWith","networkTimeoutSeconds","a","get"],"mappings":"0nBAqBAA,cACE,gCACA,+BASFC,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,8CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,oDACPC,SAAY,oBAEd,CACED,IAAO,oDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,oDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,oDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,+CACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,oDACPC,SAAY,oBAEd,CACED,IAAO,oDACPC,SAAY,oBAEd,CACED,IAAO,oDACPC,SAAY,oBAEd,CACED,IAAO,qDACPC,SAAY,oBAEd,CACED,IAAO,gDACPC,SAAY,oBAEd,CACED,IAAO,qDACPC,SAAY,oBAEd,CACED,IAAO,qDACPC,SAAY,oBAEd,CACED,IAAO,wDACPC,SAAY,oBAEd,CACED,IAAO,0DACPC,SAAY,oBAEd,CACED,IAAO,0DACPC,SAAY,oBAEd,CACED,IAAO,8DACPC,SAAY,oBAEd,CACED,IAAO,sDACPC,SAAY,oBAEd,CACED,IAAO,iEACPC,SAAY,oBAEd,CACED,IAAO,6DACPC,SAAY,oBAEd,CACED,IAAO,2DACPC,SAAY,oBAEd,CACED,IAAO,0DACPC,SAAY,oBAEd,CACED,IAAO,+DACPC,SAAY,oBAEd,CACED,IAAO,wDACPC,SAAY,oBAEd,CACED,IAAO,wDACPC,SAAY,oBAEd,CACED,IAAO,sDACPC,SAAY,oBAEd,CACED,IAAO,yDACPC,SAAY,oBAEd,CACED,IAAO,uDACPC,SAAY,oBAEd,CACED,IAAO,0DACPC,SAAY,oBAEd,CACED,IAAO,0EACPC,SAAY,oBAEd,CACED,IAAO,iEACPC,SAAY,oBAEd,CACED,IAAO,+DACPC,SAAY,oBAEd,CACED,IAAO,yDACPC,SAAY,oBAEd,CACED,IAAO,0DACPC,SAAY,oBAEd,CACED,IAAO,qEACPC,SAAY,oBAEd,CACED,IAAO,kEACPC,SAAY,oBAEd,CACED,IAAO,+DACPC,SAAY,oBAEd,CACED,IAAO,gFACPC,SAAY,oBAEd,CACED,IAAO,kEACPC,SAAY,oBAEd,CACED,IAAO,wEACPC,SAAY,oBAEd,CACED,IAAO,oEACPC,SAAY,oBAEd,CACED,IAAO,mEACPC,SAAY,oBAEd,CACED,IAAO,gEACPC,SAAY,oBAEd,CACED,IAAO,gEACPC,SAAY,oBAEd,CACED,IAAO,uDACPC,SAAY,oBAEd,CACED,IAAO,sDACPC,SAAY,oBAEd,CACED,IAAO,uDACPC,SAAY,oBAEd,CACED,IAAO,8DACPC,SAAY,oBAEd,CACED,IAAO,sEACPC,SAAY,oBAEd,CACED,IAAO,uEACPC,SAAY,oBAEd,CACED,IAAO,kEACPC,SAAY,oBAEd,CACED,IAAO,oEACPC,SAAY,oBAEd,CACED,IAAO,iEACPC,SAAY,oBAEd,CACED,IAAO,oDACPC,SAAY,oBAEd,CACED,IAAO,yDACPC,SAAY,oBAEd,CACED,IAAO,kEACPC,SAAY,oBAEd,CACED,IAAO,qDACPC,SAAY,oCAEd,CACED,IAAO,mDACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,yCACPC,SAAY,oBAEd,CACED,IAAO,wDACPC,SAAY,oCAEd,CACED,IAAO,sDACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,yBAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,eACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,mDACPC,SAAY,oCAEd,CACED,IAAO,kDACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,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,IAAIgB,mBAAoC,CAAEC,WAAY,GAAIC,cAAe,QAAU,CAAEP,gBAAiBT,OAASU,QAASR,KAAM,oBAAsBf,KAAOA,KAAKwB,SAAST,GAAKE,SAASQ,YAAe,OAC3djB,EAAAA,eAA8B,EAAGe,QAASR,EAAGX,KAAO6B,SAAUC,GAAKF,WAAYK,KAAM,MAAQtB,EAAEM,QAAQiB,IAAI,QAAUD,IAAMH,EAAEC,WAAW,UAAU,IAAI1B,EAAAA,aAAgC,CAAEC,UAAY,YAAaC,QAAS,CAAC,IAAIgB,mBAAoC,CAAEC,WAAY,GAAIC,cAAe,QAAU,CAAEP,gBAAiBT,OAASU,QAASR,KAAM,oBAAsBf,KAAOA,KAAKwB,SAAST,GAAKE,SAASQ,YAAe,OACjajB,EAAAA,eAA8B,EAAGJ,KAAO6B,SAAUlB,GAAKiB,WAAYE,KAAMA,IAAMnB,EAAEoB,WAAW,UAAU,IAAI1B,eAAgC,CAAEC,UAAY,QAASC,QAAS,CAAC,IAAIgB,mBAAoC,CAAEC,WAAY,GAAIC,cAAe,QAAU,CAAEP,gBAAiBT,OAASU,QAASR,KAAM,oBAAsBf,KAAOA,KAAKwB,SAAST,GAAKE,SAASQ,YAAe,OACjXjB,EAAAA,eAA8B,EAAGwB,WAAYjB,MAAOA,GAAG,IAAIN,eAAgC,CAAEC,UAAY,eAAe0B,sBAAwB,GAAIzB,QAAS,CAAC,IAAIgB,mBAAoC,CAAEC,WAAY,GAAIC,cAAe,OAAS,CAAEP,gBAAiBT,OAASU,QAASR,KAAM,oBAAsBf,KAAOA,KAAKwB,SAAST,GAAKE,SAASQ,YAAe","ignoreList":[]} \ No newline at end of file diff --git a/apps/web/public/workbox-b52a85cb.js.map b/apps/web/public/workbox-b52a85cb.js.map new file mode 100644 index 0000000000..d527ac60ed --- /dev/null +++ b/apps/web/public/workbox-b52a85cb.js.map @@ -0,0 +1 @@ +{"version":3,"file":"workbox-b52a85cb.js","sources":["../../node_modules/workbox-core/_version.js","../../node_modules/workbox-core/_private/logger.js","../../node_modules/workbox-core/models/messages/messageGenerator.js","../../node_modules/workbox-core/_private/WorkboxError.js","../../node_modules/workbox-routing/_version.js","../../node_modules/workbox-routing/utils/constants.js","../../node_modules/workbox-routing/utils/normalizeHandler.js","../../node_modules/workbox-routing/Route.js","../../node_modules/workbox-routing/RegExpRoute.js","../../node_modules/workbox-routing/Router.js","../../node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js","../../node_modules/workbox-routing/registerRoute.js","../../node_modules/workbox-strategies/_version.js","../../node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.js","../../node_modules/workbox-core/_private/cacheNames.js","../../node_modules/workbox-core/_private/cacheMatchIgnoreParams.js","../../node_modules/workbox-core/_private/Deferred.js","../../node_modules/workbox-core/models/quotaErrorCallbacks.js","../../node_modules/workbox-strategies/StrategyHandler.js","../../node_modules/workbox-core/_private/timeout.js","../../node_modules/workbox-core/_private/getFriendlyURL.js","../../node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","../../node_modules/workbox-strategies/Strategy.js","../../node_modules/workbox-core/_private/dontWaitFor.js","../../node_modules/idb/build/wrap-idb-value.js","../../node_modules/idb/build/index.js","../../node_modules/workbox-expiration/_version.js","../../node_modules/workbox-expiration/models/CacheTimestampsModel.js","../../node_modules/workbox-expiration/CacheExpiration.js","../../node_modules/workbox-range-requests/_version.js","../../node_modules/workbox-range-requests/createPartialResponse.js","../../node_modules/workbox-range-requests/utils/parseRangeHeader.js","../../node_modules/workbox-range-requests/utils/calculateEffectiveBoundaries.js","../../node_modules/workbox-core/_private/waitUntil.js","../../node_modules/workbox-precaching/_version.js","../../node_modules/workbox-precaching/utils/createCacheKey.js","../../node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js","../../node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js","../../node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","../../node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","../../node_modules/workbox-core/copyResponse.js","../../node_modules/workbox-precaching/PrecacheStrategy.js","../../node_modules/workbox-precaching/PrecacheController.js","../../node_modules/workbox-precaching/PrecacheRoute.js","../../node_modules/workbox-precaching/utils/generateURLVariations.js","../../node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","../../node_modules/workbox-strategies/CacheFirst.js","../../node_modules/workbox-expiration/ExpirationPlugin.js","../../node_modules/workbox-core/registerQuotaErrorCallback.js","../../node_modules/workbox-strategies/NetworkFirst.js","../../node_modules/workbox-range-requests/RangeRequestsPlugin.js","../../node_modules/workbox-strategies/StaleWhileRevalidate.js","../../node_modules/workbox-precaching/cleanupOutdatedCaches.js","../../node_modules/workbox-precaching/utils/deleteOutdatedCaches.js","../../node_modules/workbox-core/clientsClaim.js","../../node_modules/workbox-precaching/precacheAndRoute.js","../../node_modules/workbox-precaching/precache.js","../../node_modules/workbox-precaching/addRoute.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:7.0.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst logger = (process.env.NODE_ENV === 'production'\n ? null\n : (() => {\n // Don't overwrite this value if it's already set.\n // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923\n if (!('__WB_DISABLE_DEV_LOGS' in globalThis)) {\n self.__WB_DISABLE_DEV_LOGS = false;\n }\n let inGroup = false;\n const methodToColorMap = {\n debug: `#7f8c8d`,\n log: `#2ecc71`,\n warn: `#f39c12`,\n error: `#c0392b`,\n groupCollapsed: `#3498db`,\n groupEnd: null, // No colored prefix on groupEnd\n };\n const print = function (method, args) {\n if (self.__WB_DISABLE_DEV_LOGS) {\n return;\n }\n if (method === 'groupCollapsed') {\n // Safari doesn't print all console.groupCollapsed() arguments:\n // https://bugs.webkit.org/show_bug.cgi?id=182754\n if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n console[method](...args);\n return;\n }\n }\n const styles = [\n `background: ${methodToColorMap[method]}`,\n `border-radius: 0.5em`,\n `color: white`,\n `font-weight: bold`,\n `padding: 2px 0.5em`,\n ];\n // When in a group, the workbox prefix is not displayed.\n const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];\n console[method](...logPrefix, ...args);\n if (method === 'groupCollapsed') {\n inGroup = true;\n }\n if (method === 'groupEnd') {\n inGroup = false;\n }\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n const api = {};\n const loggerMethods = Object.keys(methodToColorMap);\n for (const key of loggerMethods) {\n const method = key;\n api[method] = (...args) => {\n print(method, args);\n };\n }\n return api;\n })());\nexport { logger };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = process.env.NODE_ENV === 'production' ? fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:routing:7.0.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array}\n *\n * @private\n */\nexport const validMethods = [\n 'DELETE',\n 'GET',\n 'HEAD',\n 'PATCH',\n 'POST',\n 'PUT',\n];\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n if (handler && typeof handler === 'object') {\n if (process.env.NODE_ENV !== 'production') {\n assert.hasMethod(handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return handler;\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(handler, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return { handle: handler };\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof workbox-routing\n */\nclass Route {\n /**\n * Constructor for Route class.\n *\n * @param {workbox-routing~matchCallback} match\n * A callback function that determines whether the route matches a given\n * `fetch` event by returning a non-falsy value.\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(match, handler, method = defaultMethod) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(match, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'match',\n });\n if (method) {\n assert.isOneOf(method, validMethods, { paramName: 'method' });\n }\n }\n // These values are referenced directly by Router so cannot be\n // altered by minificaton.\n this.handler = normalizeHandler(handler);\n this.match = match;\n this.method = method;\n }\n /**\n *\n * @param {workbox-routing-handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response\n */\n setCatchHandler(handler) {\n this.catchHandler = normalizeHandler(handler);\n }\n}\nexport { Route };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * {@link workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * @memberof workbox-routing\n * @extends workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n /**\n * If the regular expression contains\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n * the captured values will be passed to the\n * {@link workbox-routing~handlerCallback} `params`\n * argument.\n *\n * @param {RegExp} regExp The regular expression to match against URLs.\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(regExp, handler, method) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(regExp, RegExp, {\n moduleName: 'workbox-routing',\n className: 'RegExpRoute',\n funcName: 'constructor',\n paramName: 'pattern',\n });\n }\n const match = ({ url }) => {\n const result = regExp.exec(url.href);\n // Return immediately if there's no match.\n if (!result) {\n return;\n }\n // Require that the match start at the first character in the URL string\n // if it's a cross-origin request.\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n // behind this behavior.\n if (url.origin !== location.origin && result.index !== 0) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` +\n `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +\n `handle cross-origin requests if they match the entire URL.`);\n }\n return;\n }\n // If the route matches, but there aren't any capture groups defined, then\n // this will return [], which is truthy and therefore sufficient to\n // indicate a match.\n // If there are capture groups, then it will return their values.\n return result.slice(1);\n };\n super(match, handler, method);\n }\n}\nexport { RegExpRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { defaultMethod } from './utils/constants.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\n/**\n * The Router can be used to process a `FetchEvent` using one or more\n * {@link workbox-routing.Route}, responding with a `Response` if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof workbox-routing\n */\nclass Router {\n /**\n * Initializes a new Router.\n */\n constructor() {\n this._routes = new Map();\n this._defaultHandlerMap = new Map();\n }\n /**\n * @return {Map>} routes A `Map` of HTTP\n * method name ('GET', etc.) to an array of all the corresponding `Route`\n * instances that are registered.\n */\n get routes() {\n return this._routes;\n }\n /**\n * Adds a fetch event listener to respond to events when a route matches\n * the event's request.\n */\n addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const { request } = event;\n const responsePromise = this.handleRequest({ request, event });\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n }));\n }\n /**\n * Adds a message event listener for URLs to cache from the window.\n * This is useful to cache resources loaded on the page prior to when the\n * service worker started controlling it.\n *\n * The format of the message data sent from the window should be as follows.\n * Where the `urlsToCache` array may consist of URL strings or an array of\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n *\n * ```\n * {\n * type: 'CACHE_URLS',\n * payload: {\n * urlsToCache: [\n * './script1.js',\n * './script2.js',\n * ['./script3.js', {mode: 'no-cors'}],\n * ],\n * },\n * }\n * ```\n */\n addCacheListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('message', ((event) => {\n // event.data is type 'any'\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (event.data && event.data.type === 'CACHE_URLS') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const { payload } = event.data;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n }\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n if (typeof entry === 'string') {\n entry = [entry];\n }\n const request = new Request(...entry);\n return this.handleRequest({ request, event });\n // TODO(philipwalton): TypeScript errors without this typecast for\n // some reason (probably a bug). The real type here should work but\n // doesn't: `Array | undefined>`.\n })); // TypeScript\n event.waitUntil(requestPromises);\n // If a MessageChannel was used, reply to the message on success.\n if (event.ports && event.ports[0]) {\n void requestPromises.then(() => event.ports[0].postMessage(true));\n }\n }\n }));\n }\n /**\n * Apply the routing rules to a FetchEvent object to get a Response from an\n * appropriate Route's handler.\n *\n * @param {Object} options\n * @param {Request} options.request The request to handle.\n * @param {ExtendableEvent} options.event The event that triggered the\n * request.\n * @return {Promise|undefined} A promise is returned if a\n * registered route can handle the request. If there is no matching\n * route and there's no `defaultHandler`, `undefined` is returned.\n */\n handleRequest({ request, event, }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'handleRequest',\n paramName: 'options.request',\n });\n }\n const url = new URL(request.url, location.href);\n if (!url.protocol.startsWith('http')) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n }\n return;\n }\n const sameOrigin = url.origin === location.origin;\n const { params, route } = this.findMatchingRoute({\n event,\n request,\n sameOrigin,\n url,\n });\n let handler = route && route.handler;\n const debugMessages = [];\n if (process.env.NODE_ENV !== 'production') {\n if (handler) {\n debugMessages.push([`Found a route to handle this request:`, route]);\n if (params) {\n debugMessages.push([\n `Passing the following params to the route's handler:`,\n params,\n ]);\n }\n }\n }\n // If we don't have a handler because there was no matching route, then\n // fall back to defaultHandler if that's defined.\n const method = request.method;\n if (!handler && this._defaultHandlerMap.has(method)) {\n if (process.env.NODE_ENV !== 'production') {\n debugMessages.push(`Failed to find a matching route. Falling ` +\n `back to the default handler for ${method}.`);\n }\n handler = this._defaultHandlerMap.get(method);\n }\n if (!handler) {\n if (process.env.NODE_ENV !== 'production') {\n // No handler so Workbox will do nothing. If logs is set of debug\n // i.e. verbose, we should print out this information.\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // We have a handler, meaning Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n debugMessages.forEach((msg) => {\n if (Array.isArray(msg)) {\n logger.log(...msg);\n }\n else {\n logger.log(msg);\n }\n });\n logger.groupEnd();\n }\n // Wrap in try and catch in case the handle method throws a synchronous\n // error. It should still callback to the catch handler.\n let responsePromise;\n try {\n responsePromise = handler.handle({ url, request, event, params });\n }\n catch (err) {\n responsePromise = Promise.reject(err);\n }\n // Get route's catch handler, if it exists\n const catchHandler = route && route.catchHandler;\n if (responsePromise instanceof Promise &&\n (this._catchHandler || catchHandler)) {\n responsePromise = responsePromise.catch(async (err) => {\n // If there's a route catch handler, process that first\n if (catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n try {\n return await catchHandler.handle({ url, request, event, params });\n }\n catch (catchErr) {\n if (catchErr instanceof Error) {\n err = catchErr;\n }\n }\n }\n if (this._catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n return this._catchHandler.handle({ url, request, event });\n }\n throw err;\n });\n }\n return responsePromise;\n }\n /**\n * Checks a request and URL (and optionally an event) against the list of\n * registered routes, and if there's a match, returns the corresponding\n * route along with any params generated by the match.\n *\n * @param {Object} options\n * @param {URL} options.url\n * @param {boolean} options.sameOrigin The result of comparing `url.origin`\n * against the current origin.\n * @param {Request} options.request The request to match.\n * @param {Event} options.event The corresponding event.\n * @return {Object} An object with `route` and `params` properties.\n * They are populated if a matching route was found or `undefined`\n * otherwise.\n */\n findMatchingRoute({ url, sameOrigin, request, event, }) {\n const routes = this._routes.get(request.method) || [];\n for (const route of routes) {\n let params;\n // route.match returns type any, not possible to change right now.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const matchResult = route.match({ url, sameOrigin, request, event });\n if (matchResult) {\n if (process.env.NODE_ENV !== 'production') {\n // Warn developers that using an async matchCallback is almost always\n // not the right thing to do.\n if (matchResult instanceof Promise) {\n logger.warn(`While routing ${getFriendlyURL(url)}, an async ` +\n `matchCallback function was used. Please convert the ` +\n `following route to use a synchronous matchCallback function:`, route);\n }\n }\n // See https://github.com/GoogleChrome/workbox/issues/2079\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params = matchResult;\n if (Array.isArray(params) && params.length === 0) {\n // Instead of passing an empty array in as params, use undefined.\n params = undefined;\n }\n else if (matchResult.constructor === Object && // eslint-disable-line\n Object.keys(matchResult).length === 0) {\n // Instead of passing an empty object in as params, use undefined.\n params = undefined;\n }\n else if (typeof matchResult === 'boolean') {\n // For the boolean value true (rather than just something truth-y),\n // don't set params.\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n params = undefined;\n }\n // Return early if have a match.\n return { route, params };\n }\n }\n // If no match was found above, return and empty object.\n return {};\n }\n /**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to associate with this\n * default handler. Each method has its own default.\n */\n setDefaultHandler(handler, method = defaultMethod) {\n this._defaultHandlerMap.set(method, normalizeHandler(handler));\n }\n /**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setCatchHandler(handler) {\n this._catchHandler = normalizeHandler(handler);\n }\n /**\n * Registers a route with the router.\n *\n * @param {workbox-routing.Route} route The route to register.\n */\n registerRoute(route) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(route, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route, 'match', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.isType(route.handler, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route.handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.handler',\n });\n assert.isType(route.method, 'string', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.method',\n });\n }\n if (!this._routes.has(route.method)) {\n this._routes.set(route.method, []);\n }\n // Give precedence to all of the earlier routes by adding this additional\n // route to the end of the array.\n this._routes.get(route.method).push(route);\n }\n /**\n * Unregisters a route with the router.\n *\n * @param {workbox-routing.Route} route The route to unregister.\n */\n unregisterRoute(route) {\n if (!this._routes.has(route.method)) {\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\n method: route.method,\n });\n }\n const routeIndex = this._routes.get(route.method).indexOf(route);\n if (routeIndex > -1) {\n this._routes.get(route.method).splice(routeIndex, 1);\n }\n else {\n throw new WorkboxError('unregister-route-route-not-registered');\n }\n }\n}\nexport { Router };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n if (!defaultRouter) {\n defaultRouter = new Router();\n // The helpers that use the default Router assume these listeners exist.\n defaultRouter.addFetchListener();\n defaultRouter.addCacheListener();\n }\n return defaultRouter;\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call {@link workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {workbox-routing.Route} The generated `Route`.\n *\n * @memberof workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n let route;\n if (typeof capture === 'string') {\n const captureUrl = new URL(capture, location.href);\n if (process.env.NODE_ENV !== 'production') {\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n throw new WorkboxError('invalid-string', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n // We want to check if Express-style wildcards are in the pathname only.\n // TODO: Remove this log message in v4.\n const valueToCheck = capture.startsWith('http')\n ? captureUrl.pathname\n : capture;\n // See https://github.com/pillarjs/path-to-regexp#parameters\n const wildcards = '[*:?+]';\n if (new RegExp(`${wildcards}`).exec(valueToCheck)) {\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n `character (${wildcards}). Strings are now always interpreted as ` +\n `exact matches; use a RegExp for partial or wildcard matches.`);\n }\n }\n const matchCallback = ({ url }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (url.pathname === captureUrl.pathname &&\n url.origin !== captureUrl.origin) {\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\n `${url.toString()}. This route will only handle cross-origin requests ` +\n `if they match the entire URL.`);\n }\n }\n return url.href === captureUrl.href;\n };\n // If `capture` is a string then `handler` and `method` must be present.\n route = new Route(matchCallback, handler, method);\n }\n else if (capture instanceof RegExp) {\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\n route = new RegExpRoute(capture, handler, method);\n }\n else if (typeof capture === 'function') {\n // If `capture` is a function then `handler` and `method` must be present.\n route = new Route(capture, handler, method);\n }\n else if (capture instanceof Route) {\n route = capture;\n }\n else {\n throw new WorkboxError('unsupported-route-type', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.registerRoute(route);\n return route;\n}\nexport { registerRoute };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:strategies:7.0.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nexport const cacheOkAndOpaquePlugin = {\n /**\n * Returns a valid response (to allow caching) if the status is 200 (OK) or\n * 0 (opaque).\n *\n * @param {Object} options\n * @param {Response} options.response\n * @return {Response|null}\n *\n * @private\n */\n cacheWillUpdate: async ({ response }) => {\n if (response.status === 200 || response.status === 0) {\n return response;\n }\n return null;\n },\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nfunction stripParams(fullURL, ignoreParams) {\n const strippedURL = new URL(fullURL);\n for (const param of ignoreParams) {\n strippedURL.searchParams.delete(param);\n }\n return strippedURL.href;\n}\n/**\n * Matches an item in the cache, ignoring specific URL params. This is similar\n * to the `ignoreSearch` option, but it allows you to ignore just specific\n * params (while continuing to match on the others).\n *\n * @private\n * @param {Cache} cache\n * @param {Request} request\n * @param {Object} matchOptions\n * @param {Array} ignoreParams\n * @return {Promise}\n */\nasync function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {\n const strippedRequestURL = stripParams(request.url, ignoreParams);\n // If the request doesn't include any ignored params, match as normal.\n if (request.url === strippedRequestURL) {\n return cache.match(request, matchOptions);\n }\n // Otherwise, match by comparing keys\n const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });\n const cacheKeys = await cache.keys(request, keysOptions);\n for (const cacheKey of cacheKeys) {\n const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);\n if (strippedRequestURL === strippedCacheKeyURL) {\n return cache.match(cacheKey, matchOptions);\n }\n }\n return;\n}\nexport { cacheMatchIgnoreParams };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The Deferred class composes Promises in a way that allows for them to be\n * resolved or rejected from outside the constructor. In most cases promises\n * should be used directly, but Deferreds can be necessary when the logic to\n * resolve a promise must be separate.\n *\n * @private\n */\nclass Deferred {\n /**\n * Creates a promise and exposes its resolve and reject functions as methods.\n */\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n}\nexport { Deferred };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\n// Can't change Function type right now.\n// eslint-disable-next-line @typescript-eslint/ban-types\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheMatchIgnoreParams } from 'workbox-core/_private/cacheMatchIgnoreParams.js';\nimport { Deferred } from 'workbox-core/_private/Deferred.js';\nimport { executeQuotaErrorCallbacks } from 'workbox-core/_private/executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { timeout } from 'workbox-core/_private/timeout.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\nfunction toRequest(input) {\n return typeof input === 'string' ? new Request(input) : input;\n}\n/**\n * A class created every time a Strategy instance instance calls\n * {@link workbox-strategies.Strategy~handle} or\n * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and\n * cache actions around plugin callbacks and keeps track of when the strategy\n * is \"done\" (i.e. all added `event.waitUntil()` promises have resolved).\n *\n * @memberof workbox-strategies\n */\nclass StrategyHandler {\n /**\n * Creates a new instance associated with the passed strategy and event\n * that's handling the request.\n *\n * The constructor also initializes the state that will be passed to each of\n * the plugins handling this request.\n *\n * @param {workbox-strategies.Strategy} strategy\n * @param {Object} options\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params] The return value from the\n * {@link workbox-routing~matchCallback} (if applicable).\n */\n constructor(strategy, options) {\n this._cacheKeys = {};\n /**\n * The request the strategy is performing (passed to the strategy's\n * `handle()` or `handleAll()` method).\n * @name request\n * @instance\n * @type {Request}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * The event associated with this request.\n * @name event\n * @instance\n * @type {ExtendableEvent}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * A `URL` instance of `request.url` (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `url` param will be present if the strategy was invoked\n * from a workbox `Route` object.\n * @name url\n * @instance\n * @type {URL|undefined}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * A `param` value (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `param` param will be present if the strategy was invoked\n * from a workbox `Route` object and the\n * {@link workbox-routing~matchCallback} returned\n * a truthy value (it will be that value).\n * @name params\n * @instance\n * @type {*|undefined}\n * @memberof workbox-strategies.StrategyHandler\n */\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(options.event, ExtendableEvent, {\n moduleName: 'workbox-strategies',\n className: 'StrategyHandler',\n funcName: 'constructor',\n paramName: 'options.event',\n });\n }\n Object.assign(this, options);\n this.event = options.event;\n this._strategy = strategy;\n this._handlerDeferred = new Deferred();\n this._extendLifetimePromises = [];\n // Copy the plugins list (since it's mutable on the strategy),\n // so any mutations don't affect this handler instance.\n this._plugins = [...strategy.plugins];\n this._pluginStateMap = new Map();\n for (const plugin of this._plugins) {\n this._pluginStateMap.set(plugin, {});\n }\n this.event.waitUntil(this._handlerDeferred.promise);\n }\n /**\n * Fetches a given request (and invokes any applicable plugin callback\n * methods) using the `fetchOptions` (for non-navigation requests) and\n * `plugins` defined on the `Strategy` object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - `requestWillFetch()`\n * - `fetchDidSucceed()`\n * - `fetchDidFail()`\n *\n * @param {Request|string} input The URL or request to fetch.\n * @return {Promise}\n */\n async fetch(input) {\n const { event } = this;\n let request = toRequest(input);\n if (request.mode === 'navigate' &&\n event instanceof FetchEvent &&\n event.preloadResponse) {\n const possiblePreloadResponse = (await event.preloadResponse);\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = this.hasCallback('fetchDidFail')\n ? request.clone()\n : null;\n try {\n for (const cb of this.iterateCallbacks('requestWillFetch')) {\n request = await cb({ request: request.clone(), event });\n }\n }\n catch (err) {\n if (err instanceof Error) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownErrorMessage: err.message,\n });\n }\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (most likely from a `fetch` event) different\n // from the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const callback of this.iterateCallbacks('fetchDidSucceed')) {\n fetchResponse = await callback({\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n // `originalRequest` will only exist if a `fetchDidFail` callback\n // is being used (see above).\n if (originalRequest) {\n await this.runCallbacks('fetchDidFail', {\n error: error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n }\n /**\n * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on\n * the response generated by `this.fetch()`.\n *\n * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,\n * so you do not have to manually call `waitUntil()` on the event.\n *\n * @param {Request|string} input The request or URL to fetch and cache.\n * @return {Promise}\n */\n async fetchAndCachePut(input) {\n const response = await this.fetch(input);\n const responseClone = response.clone();\n void this.waitUntil(this.cachePut(input, responseClone));\n return response;\n }\n /**\n * Matches a request from the cache (and invokes any applicable plugin\n * callback methods) using the `cacheName`, `matchOptions`, and `plugins`\n * defined on the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillByUsed()\n * - cachedResponseWillByUsed()\n *\n * @param {Request|string} key The Request or URL to use as the cache key.\n * @return {Promise} A matching response, if found.\n */\n async cacheMatch(key) {\n const request = toRequest(key);\n let cachedResponse;\n const { cacheName, matchOptions } = this._strategy;\n const effectiveRequest = await this.getCacheKey(request, 'read');\n const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { cacheName });\n cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {\n cachedResponse =\n (await callback({\n cacheName,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n event: this.event,\n })) || undefined;\n }\n return cachedResponse;\n }\n /**\n * Puts a request/response pair in the cache (and invokes any applicable\n * plugin callback methods) using the `cacheName` and `plugins` defined on\n * the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillByUsed()\n * - cacheWillUpdate()\n * - cacheDidUpdate()\n *\n * @param {Request|string} key The request or URL to use as the cache key.\n * @param {Response} response The response to cache.\n * @return {Promise} `false` if a cacheWillUpdate caused the response\n * not be cached, and `true` otherwise.\n */\n async cachePut(key, response) {\n const request = toRequest(key);\n // Run in the next task to avoid blocking other cache reads.\n // https://github.com/w3c/ServiceWorker/issues/1397\n await timeout(0);\n const effectiveRequest = await this.getCacheKey(request, 'write');\n if (process.env.NODE_ENV !== 'production') {\n if (effectiveRequest.method && effectiveRequest.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(effectiveRequest.url),\n method: effectiveRequest.method,\n });\n }\n // See https://github.com/GoogleChrome/workbox/issues/2818\n const vary = response.headers.get('Vary');\n if (vary) {\n logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` +\n `has a 'Vary: ${vary}' header. ` +\n `Consider setting the {ignoreVary: true} option on your strategy ` +\n `to ensure cache matching and deletion works as expected.`);\n }\n }\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await this._ensureResponseSafeToCache(response);\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` +\n `will not be cached.`, responseToCache);\n }\n return false;\n }\n const { cacheName, matchOptions } = this._strategy;\n const cache = await self.caches.open(cacheName);\n const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');\n const oldResponse = hasCacheUpdateCallback\n ? await cacheMatchIgnoreParams(\n // TODO(philipwalton): the `__WB_REVISION__` param is a precaching\n // feature. Consider into ways to only add this behavior if using\n // precaching.\n cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions)\n : null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response ` +\n `for ${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);\n }\n catch (error) {\n if (error instanceof Error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n }\n for (const callback of this.iterateCallbacks('cacheDidUpdate')) {\n await callback({\n cacheName,\n oldResponse,\n newResponse: responseToCache.clone(),\n request: effectiveRequest,\n event: this.event,\n });\n }\n return true;\n }\n /**\n * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and\n * executes any of those callbacks found in sequence. The final `Request`\n * object returned by the last plugin is treated as the cache key for cache\n * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have\n * been registered, the passed request is returned unmodified\n *\n * @param {Request} request\n * @param {string} mode\n * @return {Promise}\n */\n async getCacheKey(request, mode) {\n const key = `${request.url} | ${mode}`;\n if (!this._cacheKeys[key]) {\n let effectiveRequest = request;\n for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {\n effectiveRequest = toRequest(await callback({\n mode,\n request: effectiveRequest,\n event: this.event,\n // params has a type any can't change right now.\n params: this.params, // eslint-disable-line\n }));\n }\n this._cacheKeys[key] = effectiveRequest;\n }\n return this._cacheKeys[key];\n }\n /**\n * Returns true if the strategy has at least one plugin with the given\n * callback.\n *\n * @param {string} name The name of the callback to check for.\n * @return {boolean}\n */\n hasCallback(name) {\n for (const plugin of this._strategy.plugins) {\n if (name in plugin) {\n return true;\n }\n }\n return false;\n }\n /**\n * Runs all plugin callbacks matching the given name, in order, passing the\n * given param object (merged ith the current plugin state) as the only\n * argument.\n *\n * Note: since this method runs all plugins, it's not suitable for cases\n * where the return value of a callback needs to be applied prior to calling\n * the next callback. See\n * {@link workbox-strategies.StrategyHandler#iterateCallbacks}\n * below for how to handle that case.\n *\n * @param {string} name The name of the callback to run within each plugin.\n * @param {Object} param The object to pass as the first (and only) param\n * when executing each callback. This object will be merged with the\n * current plugin state prior to callback execution.\n */\n async runCallbacks(name, param) {\n for (const callback of this.iterateCallbacks(name)) {\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n await callback(param);\n }\n }\n /**\n * Accepts a callback and returns an iterable of matching plugin callbacks,\n * where each callback is wrapped with the current handler state (i.e. when\n * you call each callback, whatever object parameter you pass it will\n * be merged with the plugin's current state).\n *\n * @param {string} name The name fo the callback to run\n * @return {Array}\n */\n *iterateCallbacks(name) {\n for (const plugin of this._strategy.plugins) {\n if (typeof plugin[name] === 'function') {\n const state = this._pluginStateMap.get(plugin);\n const statefulCallback = (param) => {\n const statefulParam = Object.assign(Object.assign({}, param), { state });\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n return plugin[name](statefulParam);\n };\n yield statefulCallback;\n }\n }\n }\n /**\n * Adds a promise to the\n * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}\n * of the event event associated with the request being handled (usually a\n * `FetchEvent`).\n *\n * Note: you can await\n * {@link workbox-strategies.StrategyHandler~doneWaiting}\n * to know when all added promises have settled.\n *\n * @param {Promise} promise A promise to add to the extend lifetime promises\n * of the event that triggered the request.\n */\n waitUntil(promise) {\n this._extendLifetimePromises.push(promise);\n return promise;\n }\n /**\n * Returns a promise that resolves once all promises passed to\n * {@link workbox-strategies.StrategyHandler~waitUntil}\n * have settled.\n *\n * Note: any work done after `doneWaiting()` settles should be manually\n * passed to an event's `waitUntil()` method (not this handler's\n * `waitUntil()` method), otherwise the service worker thread my be killed\n * prior to your work completing.\n */\n async doneWaiting() {\n let promise;\n while ((promise = this._extendLifetimePromises.shift())) {\n await promise;\n }\n }\n /**\n * Stops running the strategy and immediately resolves any pending\n * `waitUntil()` promises.\n */\n destroy() {\n this._handlerDeferred.resolve(null);\n }\n /**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Request} options.request\n * @param {Response} options.response\n * @return {Promise}\n *\n * @private\n */\n async _ensureResponseSafeToCache(response) {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const callback of this.iterateCallbacks('cacheWillUpdate')) {\n responseToCache =\n (await callback({\n request: this.request,\n response: responseToCache,\n event: this.event,\n })) || undefined;\n pluginsUsed = true;\n if (!responseToCache) {\n break;\n }\n }\n if (!pluginsUsed) {\n if (responseToCache && responseToCache.status !== 200) {\n responseToCache = undefined;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${this.request.url}' ` +\n `is an opaque response. The caching strategy that you're ` +\n `using will not cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${this.request.url}' ` +\n `returned a status code of '${response.status}' and won't ` +\n `be cached as a result.`);\n }\n }\n }\n }\n }\n return responseToCache;\n }\n}\nexport { StrategyHandler };\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Returns a promise that resolves and the passed number of milliseconds.\n * This utility is an async/await-friendly version of `setTimeout`.\n *\n * @param {number} ms\n * @return {Promise}\n * @private\n */\nexport function timeout(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { StrategyHandler } from './StrategyHandler.js';\nimport './_version.js';\n/**\n * An abstract base class that all other strategy classes must extend from:\n *\n * @memberof workbox-strategies\n */\nclass Strategy {\n /**\n * Creates a new instance of the strategy and sets all documented option\n * properties as public instance properties.\n *\n * Note: if a custom strategy class extends the base Strategy class and does\n * not need more than these properties, it does not need to define its own\n * constructor.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n * `fetch()` requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n */\n constructor(options = {}) {\n /**\n * Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n *\n * @type {string}\n */\n this.cacheName = cacheNames.getRuntimeName(options.cacheName);\n /**\n * The list\n * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * used by this strategy.\n *\n * @type {Array}\n */\n this.plugins = options.plugins || [];\n /**\n * Values passed along to the\n * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}\n * of all fetch() requests made by this strategy.\n *\n * @type {Object}\n */\n this.fetchOptions = options.fetchOptions;\n /**\n * The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n *\n * @type {Object}\n */\n this.matchOptions = options.matchOptions;\n }\n /**\n * Perform a request strategy and returns a `Promise` that will resolve with\n * a `Response`, invoking all relevant plugin callbacks.\n *\n * When a strategy instance is registered with a Workbox\n * {@link workbox-routing.Route}, this method is automatically\n * called when the route matches.\n *\n * Alternatively, this method can be used in a standalone `FetchEvent`\n * listener by passing it to `event.respondWith()`.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n */\n handle(options) {\n const [responseDone] = this.handleAll(options);\n return responseDone;\n }\n /**\n * Similar to {@link workbox-strategies.Strategy~handle}, but\n * instead of just returning a `Promise` that resolves to a `Response` it\n * it will return an tuple of `[response, done]` promises, where the former\n * (`response`) is equivalent to what `handle()` returns, and the latter is a\n * Promise that will resolve once any promises that were added to\n * `event.waitUntil()` as part of performing the strategy have completed.\n *\n * You can await the `done` promise to ensure any extra work performed by\n * the strategy (usually caching responses) completes successfully.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n * @return {Array} A tuple of [response, done]\n * promises that can be used to determine when the response resolves as\n * well as when the handler has completed all its work.\n */\n handleAll(options) {\n // Allow for flexible options to be passed.\n if (options instanceof FetchEvent) {\n options = {\n event: options,\n request: options.request,\n };\n }\n const event = options.event;\n const request = typeof options.request === 'string'\n ? new Request(options.request)\n : options.request;\n const params = 'params' in options ? options.params : undefined;\n const handler = new StrategyHandler(this, { event, request, params });\n const responseDone = this._getResponse(handler, request, event);\n const handlerDone = this._awaitComplete(responseDone, handler, request, event);\n // Return an array of promises, suitable for use with Promise.all().\n return [responseDone, handlerDone];\n }\n async _getResponse(handler, request, event) {\n await handler.runCallbacks('handlerWillStart', { event, request });\n let response = undefined;\n try {\n response = await this._handle(request, handler);\n // The \"official\" Strategy subclasses all throw this error automatically,\n // but in case a third-party Strategy doesn't, ensure that we have a\n // consistent failure when there's no response or an error response.\n if (!response || response.type === 'error') {\n throw new WorkboxError('no-response', { url: request.url });\n }\n }\n catch (error) {\n if (error instanceof Error) {\n for (const callback of handler.iterateCallbacks('handlerDidError')) {\n response = await callback({ error, event, request });\n if (response) {\n break;\n }\n }\n }\n if (!response) {\n throw error;\n }\n else if (process.env.NODE_ENV !== 'production') {\n logger.log(`While responding to '${getFriendlyURL(request.url)}', ` +\n `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` +\n `a handlerDidError plugin.`);\n }\n }\n for (const callback of handler.iterateCallbacks('handlerWillRespond')) {\n response = await callback({ event, request, response });\n }\n return response;\n }\n async _awaitComplete(responseDone, handler, request, event) {\n let response;\n let error;\n try {\n response = await responseDone;\n }\n catch (error) {\n // Ignore errors, as response errors should be caught via the `response`\n // promise above. The `done` promise will only throw for errors in\n // promises passed to `handler.waitUntil()`.\n }\n try {\n await handler.runCallbacks('handlerDidRespond', {\n event,\n request,\n response,\n });\n await handler.doneWaiting();\n }\n catch (waitUntilError) {\n if (waitUntilError instanceof Error) {\n error = waitUntilError;\n }\n }\n await handler.runCallbacks('handlerDidComplete', {\n event,\n request,\n response,\n error: error,\n });\n handler.destroy();\n if (error) {\n throw error;\n }\n }\n}\nexport { Strategy };\n/**\n * Classes extending the `Strategy` based class should implement this method,\n * and leverage the {@link workbox-strategies.StrategyHandler}\n * arg to perform all fetching and cache logic, which will ensure all relevant\n * cache, cache options, fetch options and plugins are used (per the current\n * strategy instance).\n *\n * @name _handle\n * @instance\n * @abstract\n * @function\n * @param {Request} request\n * @param {workbox-strategies.StrategyHandler} handler\n * @return {Promise}\n *\n * @memberof workbox-strategies.Strategy\n */\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A helper function that prevents a promise from being flagged as unused.\n *\n * @private\n **/\nexport function dontWaitFor(promise) {\n // Effective no-op.\n void promise.then(() => { });\n}\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:expiration:7.0.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { openDB, deleteDB } from 'idb';\nimport '../_version.js';\nconst DB_NAME = 'workbox-expiration';\nconst CACHE_OBJECT_STORE = 'cache-entries';\nconst normalizeURL = (unNormalizedUrl) => {\n const url = new URL(unNormalizedUrl, location.href);\n url.hash = '';\n return url.href;\n};\n/**\n * Returns the timestamp model.\n *\n * @private\n */\nclass CacheTimestampsModel {\n /**\n *\n * @param {string} cacheName\n *\n * @private\n */\n constructor(cacheName) {\n this._db = null;\n this._cacheName = cacheName;\n }\n /**\n * Performs an upgrade of indexedDB.\n *\n * @param {IDBPDatabase} db\n *\n * @private\n */\n _upgradeDb(db) {\n // TODO(philipwalton): EdgeHTML doesn't support arrays as a keyPath, so we\n // have to use the `id` keyPath here and create our own values (a\n // concatenation of `url + cacheName`) instead of simply using\n // `keyPath: ['url', 'cacheName']`, which is supported in other browsers.\n const objStore = db.createObjectStore(CACHE_OBJECT_STORE, { keyPath: 'id' });\n // TODO(philipwalton): once we don't have to support EdgeHTML, we can\n // create a single index with the keyPath `['cacheName', 'timestamp']`\n // instead of doing both these indexes.\n objStore.createIndex('cacheName', 'cacheName', { unique: false });\n objStore.createIndex('timestamp', 'timestamp', { unique: false });\n }\n /**\n * Performs an upgrade of indexedDB and deletes deprecated DBs.\n *\n * @param {IDBPDatabase} db\n *\n * @private\n */\n _upgradeDbAndDeleteOldDbs(db) {\n this._upgradeDb(db);\n if (this._cacheName) {\n void deleteDB(this._cacheName);\n }\n }\n /**\n * @param {string} url\n * @param {number} timestamp\n *\n * @private\n */\n async setTimestamp(url, timestamp) {\n url = normalizeURL(url);\n const entry = {\n url,\n timestamp,\n cacheName: this._cacheName,\n // Creating an ID from the URL and cache name won't be necessary once\n // Edge switches to Chromium and all browsers we support work with\n // array keyPaths.\n id: this._getId(url),\n };\n const db = await this.getDb();\n const tx = db.transaction(CACHE_OBJECT_STORE, 'readwrite', {\n durability: 'relaxed',\n });\n await tx.store.put(entry);\n await tx.done;\n }\n /**\n * Returns the timestamp stored for a given URL.\n *\n * @param {string} url\n * @return {number | undefined}\n *\n * @private\n */\n async getTimestamp(url) {\n const db = await this.getDb();\n const entry = await db.get(CACHE_OBJECT_STORE, this._getId(url));\n return entry === null || entry === void 0 ? void 0 : entry.timestamp;\n }\n /**\n * Iterates through all the entries in the object store (from newest to\n * oldest) and removes entries once either `maxCount` is reached or the\n * entry's timestamp is less than `minTimestamp`.\n *\n * @param {number} minTimestamp\n * @param {number} maxCount\n * @return {Array}\n *\n * @private\n */\n async expireEntries(minTimestamp, maxCount) {\n const db = await this.getDb();\n let cursor = await db\n .transaction(CACHE_OBJECT_STORE)\n .store.index('timestamp')\n .openCursor(null, 'prev');\n const entriesToDelete = [];\n let entriesNotDeletedCount = 0;\n while (cursor) {\n const result = cursor.value;\n // TODO(philipwalton): once we can use a multi-key index, we\n // won't have to check `cacheName` here.\n if (result.cacheName === this._cacheName) {\n // Delete an entry if it's older than the max age or\n // if we already have the max number allowed.\n if ((minTimestamp && result.timestamp < minTimestamp) ||\n (maxCount && entriesNotDeletedCount >= maxCount)) {\n // TODO(philipwalton): we should be able to delete the\n // entry right here, but doing so causes an iteration\n // bug in Safari stable (fixed in TP). Instead we can\n // store the keys of the entries to delete, and then\n // delete the separate transactions.\n // https://github.com/GoogleChrome/workbox/issues/1978\n // cursor.delete();\n // We only need to return the URL, not the whole entry.\n entriesToDelete.push(cursor.value);\n }\n else {\n entriesNotDeletedCount++;\n }\n }\n cursor = await cursor.continue();\n }\n // TODO(philipwalton): once the Safari bug in the following issue is fixed,\n // we should be able to remove this loop and do the entry deletion in the\n // cursor loop above:\n // https://github.com/GoogleChrome/workbox/issues/1978\n const urlsDeleted = [];\n for (const entry of entriesToDelete) {\n await db.delete(CACHE_OBJECT_STORE, entry.id);\n urlsDeleted.push(entry.url);\n }\n return urlsDeleted;\n }\n /**\n * Takes a URL and returns an ID that will be unique in the object store.\n *\n * @param {string} url\n * @return {string}\n *\n * @private\n */\n _getId(url) {\n // Creating an ID from the URL and cache name won't be necessary once\n // Edge switches to Chromium and all browsers we support work with\n // array keyPaths.\n return this._cacheName + '|' + normalizeURL(url);\n }\n /**\n * Returns an open connection to the database.\n *\n * @private\n */\n async getDb() {\n if (!this._db) {\n this._db = await openDB(DB_NAME, 1, {\n upgrade: this._upgradeDbAndDeleteOldDbs.bind(this),\n });\n }\n return this._db;\n }\n}\nexport { CacheTimestampsModel };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { CacheTimestampsModel } from './models/CacheTimestampsModel.js';\nimport './_version.js';\n/**\n * The `CacheExpiration` class allows you define an expiration and / or\n * limit on the number of responses stored in a\n * [`Cache`](https://developer.mozilla.org/en-US/docs/Web/API/Cache).\n *\n * @memberof workbox-expiration\n */\nclass CacheExpiration {\n /**\n * To construct a new CacheExpiration instance you must provide at least\n * one of the `config` properties.\n *\n * @param {string} cacheName Name of the cache to apply restrictions to.\n * @param {Object} config\n * @param {number} [config.maxEntries] The maximum number of entries to cache.\n * Entries used the least will be removed as the maximum is reached.\n * @param {number} [config.maxAgeSeconds] The maximum age of an entry before\n * it's treated as stale and removed.\n * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)\n * that will be used when calling `delete()` on the cache.\n */\n constructor(cacheName, config = {}) {\n this._isRunning = false;\n this._rerunRequested = false;\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(cacheName, 'string', {\n moduleName: 'workbox-expiration',\n className: 'CacheExpiration',\n funcName: 'constructor',\n paramName: 'cacheName',\n });\n if (!(config.maxEntries || config.maxAgeSeconds)) {\n throw new WorkboxError('max-entries-or-age-required', {\n moduleName: 'workbox-expiration',\n className: 'CacheExpiration',\n funcName: 'constructor',\n });\n }\n if (config.maxEntries) {\n assert.isType(config.maxEntries, 'number', {\n moduleName: 'workbox-expiration',\n className: 'CacheExpiration',\n funcName: 'constructor',\n paramName: 'config.maxEntries',\n });\n }\n if (config.maxAgeSeconds) {\n assert.isType(config.maxAgeSeconds, 'number', {\n moduleName: 'workbox-expiration',\n className: 'CacheExpiration',\n funcName: 'constructor',\n paramName: 'config.maxAgeSeconds',\n });\n }\n }\n this._maxEntries = config.maxEntries;\n this._maxAgeSeconds = config.maxAgeSeconds;\n this._matchOptions = config.matchOptions;\n this._cacheName = cacheName;\n this._timestampModel = new CacheTimestampsModel(cacheName);\n }\n /**\n * Expires entries for the given cache and given criteria.\n */\n async expireEntries() {\n if (this._isRunning) {\n this._rerunRequested = true;\n return;\n }\n this._isRunning = true;\n const minTimestamp = this._maxAgeSeconds\n ? Date.now() - this._maxAgeSeconds * 1000\n : 0;\n const urlsExpired = await this._timestampModel.expireEntries(minTimestamp, this._maxEntries);\n // Delete URLs from the cache\n const cache = await self.caches.open(this._cacheName);\n for (const url of urlsExpired) {\n await cache.delete(url, this._matchOptions);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (urlsExpired.length > 0) {\n logger.groupCollapsed(`Expired ${urlsExpired.length} ` +\n `${urlsExpired.length === 1 ? 'entry' : 'entries'} and removed ` +\n `${urlsExpired.length === 1 ? 'it' : 'them'} from the ` +\n `'${this._cacheName}' cache.`);\n logger.log(`Expired the following ${urlsExpired.length === 1 ? 'URL' : 'URLs'}:`);\n urlsExpired.forEach((url) => logger.log(` ${url}`));\n logger.groupEnd();\n }\n else {\n logger.debug(`Cache expiration ran and found no entries to remove.`);\n }\n }\n this._isRunning = false;\n if (this._rerunRequested) {\n this._rerunRequested = false;\n dontWaitFor(this.expireEntries());\n }\n }\n /**\n * Update the timestamp for the given URL. This ensures the when\n * removing entries based on maximum entries, most recently used\n * is accurate or when expiring, the timestamp is up-to-date.\n *\n * @param {string} url\n */\n async updateTimestamp(url) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(url, 'string', {\n moduleName: 'workbox-expiration',\n className: 'CacheExpiration',\n funcName: 'updateTimestamp',\n paramName: 'url',\n });\n }\n await this._timestampModel.setTimestamp(url, Date.now());\n }\n /**\n * Can be used to check if a URL has expired or not before it's used.\n *\n * This requires a look up from IndexedDB, so can be slow.\n *\n * Note: This method will not remove the cached entry, call\n * `expireEntries()` to remove indexedDB and Cache entries.\n *\n * @param {string} url\n * @return {boolean}\n */\n async isURLExpired(url) {\n if (!this._maxAgeSeconds) {\n if (process.env.NODE_ENV !== 'production') {\n throw new WorkboxError(`expired-test-without-max-age`, {\n methodName: 'isURLExpired',\n paramName: 'maxAgeSeconds',\n });\n }\n return false;\n }\n else {\n const timestamp = await this._timestampModel.getTimestamp(url);\n const expireOlderThan = Date.now() - this._maxAgeSeconds * 1000;\n return timestamp !== undefined ? timestamp < expireOlderThan : true;\n }\n }\n /**\n * Removes the IndexedDB object store used to keep track of cache expiration\n * metadata.\n */\n async delete() {\n // Make sure we don't attempt another rerun if we're called in the middle of\n // a cache expiration.\n this._rerunRequested = false;\n await this._timestampModel.expireEntries(Infinity); // Expires all.\n }\n}\nexport { CacheExpiration };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:range-requests:7.0.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { calculateEffectiveBoundaries } from './utils/calculateEffectiveBoundaries.js';\nimport { parseRangeHeader } from './utils/parseRangeHeader.js';\nimport './_version.js';\n/**\n * Given a `Request` and `Response` objects as input, this will return a\n * promise for a new `Response`.\n *\n * If the original `Response` already contains partial content (i.e. it has\n * a status of 206), then this assumes it already fulfills the `Range:`\n * requirements, and will return it as-is.\n *\n * @param {Request} request A request, which should contain a Range:\n * header.\n * @param {Response} originalResponse A response.\n * @return {Promise} Either a `206 Partial Content` response, with\n * the response body set to the slice of content specified by the request's\n * `Range:` header, or a `416 Range Not Satisfiable` response if the\n * conditions of the `Range:` header can't be met.\n *\n * @memberof workbox-range-requests\n */\nasync function createPartialResponse(request, originalResponse) {\n try {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-range-requests',\n funcName: 'createPartialResponse',\n paramName: 'request',\n });\n assert.isInstance(originalResponse, Response, {\n moduleName: 'workbox-range-requests',\n funcName: 'createPartialResponse',\n paramName: 'originalResponse',\n });\n }\n if (originalResponse.status === 206) {\n // If we already have a 206, then just pass it through as-is;\n // see https://github.com/GoogleChrome/workbox/issues/1720\n return originalResponse;\n }\n const rangeHeader = request.headers.get('range');\n if (!rangeHeader) {\n throw new WorkboxError('no-range-header');\n }\n const boundaries = parseRangeHeader(rangeHeader);\n const originalBlob = await originalResponse.blob();\n const effectiveBoundaries = calculateEffectiveBoundaries(originalBlob, boundaries.start, boundaries.end);\n const slicedBlob = originalBlob.slice(effectiveBoundaries.start, effectiveBoundaries.end);\n const slicedBlobSize = slicedBlob.size;\n const slicedResponse = new Response(slicedBlob, {\n // Status code 206 is for a Partial Content response.\n // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206\n status: 206,\n statusText: 'Partial Content',\n headers: originalResponse.headers,\n });\n slicedResponse.headers.set('Content-Length', String(slicedBlobSize));\n slicedResponse.headers.set('Content-Range', `bytes ${effectiveBoundaries.start}-${effectiveBoundaries.end - 1}/` +\n `${originalBlob.size}`);\n return slicedResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`Unable to construct a partial response; returning a ` +\n `416 Range Not Satisfiable response instead.`);\n logger.groupCollapsed(`View details here.`);\n logger.log(error);\n logger.log(request);\n logger.log(originalResponse);\n logger.groupEnd();\n }\n return new Response('', {\n status: 416,\n statusText: 'Range Not Satisfiable',\n });\n }\n}\nexport { createPartialResponse };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {string} rangeHeader A Range: header value.\n * @return {Object} An object with `start` and `end` properties, reflecting\n * the parsed value of the Range: header. If either the `start` or `end` are\n * omitted, then `null` will be returned.\n *\n * @private\n */\nfunction parseRangeHeader(rangeHeader) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(rangeHeader, 'string', {\n moduleName: 'workbox-range-requests',\n funcName: 'parseRangeHeader',\n paramName: 'rangeHeader',\n });\n }\n const normalizedRangeHeader = rangeHeader.trim().toLowerCase();\n if (!normalizedRangeHeader.startsWith('bytes=')) {\n throw new WorkboxError('unit-must-be-bytes', { normalizedRangeHeader });\n }\n // Specifying multiple ranges separate by commas is valid syntax, but this\n // library only attempts to handle a single, contiguous sequence of bytes.\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range#Syntax\n if (normalizedRangeHeader.includes(',')) {\n throw new WorkboxError('single-range-only', { normalizedRangeHeader });\n }\n const rangeParts = /(\\d*)-(\\d*)/.exec(normalizedRangeHeader);\n // We need either at least one of the start or end values.\n if (!rangeParts || !(rangeParts[1] || rangeParts[2])) {\n throw new WorkboxError('invalid-range-values', { normalizedRangeHeader });\n }\n return {\n start: rangeParts[1] === '' ? undefined : Number(rangeParts[1]),\n end: rangeParts[2] === '' ? undefined : Number(rangeParts[2]),\n };\n}\nexport { parseRangeHeader };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {Blob} blob A source blob.\n * @param {number} [start] The offset to use as the start of the\n * slice.\n * @param {number} [end] The offset to use as the end of the slice.\n * @return {Object} An object with `start` and `end` properties, reflecting\n * the effective boundaries to use given the size of the blob.\n *\n * @private\n */\nfunction calculateEffectiveBoundaries(blob, start, end) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(blob, Blob, {\n moduleName: 'workbox-range-requests',\n funcName: 'calculateEffectiveBoundaries',\n paramName: 'blob',\n });\n }\n const blobSize = blob.size;\n if ((end && end > blobSize) || (start && start < 0)) {\n throw new WorkboxError('range-not-satisfiable', {\n size: blobSize,\n end,\n start,\n });\n }\n let effectiveStart;\n let effectiveEnd;\n if (start !== undefined && end !== undefined) {\n effectiveStart = start;\n // Range values are inclusive, so add 1 to the value.\n effectiveEnd = end + 1;\n }\n else if (start !== undefined && end === undefined) {\n effectiveStart = start;\n effectiveEnd = blobSize;\n }\n else if (end !== undefined && start === undefined) {\n effectiveStart = blobSize - end;\n effectiveEnd = blobSize;\n }\n return {\n start: effectiveStart,\n end: effectiveEnd,\n };\n}\nexport { calculateEffectiveBoundaries };\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A utility method that makes it easier to use `event.waitUntil` with\n * async functions and return the result.\n *\n * @param {ExtendableEvent} event\n * @param {Function} asyncFn\n * @return {Function}\n * @private\n */\nfunction waitUntil(event, asyncFn) {\n const returnPromise = asyncFn();\n event.waitUntil(returnPromise);\n return returnPromise;\n}\nexport { waitUntil };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:precaching:7.0.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function createCacheKey(entry) {\n if (!entry) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If a precache manifest entry is a string, it's assumed to be a versioned\n // URL, like '/app.abcd1234.js'. Return as-is.\n if (typeof entry === 'string') {\n const urlObject = new URL(entry, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n const { revision, url } = entry;\n if (!url) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If there's just a URL and no revision, then it's also assumed to be a\n // versioned URL.\n if (!revision) {\n const urlObject = new URL(url, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n // Otherwise, construct a properly versioned URL using the custom Workbox\n // search parameter along with the revision info.\n const cacheKeyURL = new URL(url, location.href);\n const originalURL = new URL(url, location.href);\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n return {\n cacheKey: cacheKeyURL.href,\n url: originalURL.href,\n };\n}\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to determine the\n * of assets that were updated (or not updated) during the install event.\n *\n * @private\n */\nclass PrecacheInstallReportPlugin {\n constructor() {\n this.updatedURLs = [];\n this.notUpdatedURLs = [];\n this.handlerWillStart = async ({ request, state, }) => {\n // TODO: `state` should never be undefined...\n if (state) {\n state.originalRequest = request;\n }\n };\n this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {\n if (event.type === 'install') {\n if (state &&\n state.originalRequest &&\n state.originalRequest instanceof Request) {\n // TODO: `state` should never be undefined...\n const url = state.originalRequest.url;\n if (cachedResponse) {\n this.notUpdatedURLs.push(url);\n }\n else {\n this.updatedURLs.push(url);\n }\n }\n }\n return cachedResponse;\n };\n }\n}\nexport { PrecacheInstallReportPlugin };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to translate URLs into\n * the corresponding cache key, based on the current revision info.\n *\n * @private\n */\nclass PrecacheCacheKeyPlugin {\n constructor({ precacheController }) {\n this.cacheKeyWillBeUsed = async ({ request, params, }) => {\n // Params is type any, can't change right now.\n /* eslint-disable */\n const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) ||\n this._precacheController.getCacheKeyForURL(request.url);\n /* eslint-enable */\n return cacheKey\n ? new Request(cacheKey, { headers: request.headers })\n : request;\n };\n this._precacheController = precacheController;\n }\n}\nexport { PrecacheCacheKeyPlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n * construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n if (supportStatus === undefined) {\n const testResponse = new Response('');\n if ('body' in testResponse) {\n try {\n new Response(testResponse.body);\n supportStatus = true;\n }\n catch (error) {\n supportStatus = false;\n }\n }\n supportStatus = false;\n }\n return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * This method is intentionally limited to same-origin responses, regardless of\n * whether CORS was used or not.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof workbox-core\n */\nasync function copyResponse(response, modifier) {\n let origin = null;\n // If response.url isn't set, assume it's cross-origin and keep origin null.\n if (response.url) {\n const responseURL = new URL(response.url);\n origin = responseURL.origin;\n }\n if (origin !== self.location.origin) {\n throw new WorkboxError('cross-origin-copy-response', { origin });\n }\n const clonedResponse = response.clone();\n // Create a fresh `ResponseInit` object by cloning the headers.\n const responseInit = {\n headers: new Headers(clonedResponse.headers),\n status: clonedResponse.status,\n statusText: clonedResponse.statusText,\n };\n // Apply any user modifications.\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n // Create the new response from the body stream and `ResponseInit`\n // modifications. Note: not all browsers support the Response.body stream,\n // so fall back to reading the entire body into memory as a blob.\n const body = canConstructResponseFromBodyStream()\n ? clonedResponse.body\n : await clonedResponse.blob();\n return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from 'workbox-strategies/Strategy.js';\nimport './_version.js';\n/**\n * A {@link workbox-strategies.Strategy} implementation\n * specifically designed to work with\n * {@link workbox-precaching.PrecacheController}\n * to both cache and fetch precached assets.\n *\n * Note: an instance of this class is created automatically when creating a\n * `PrecacheController`; it's generally not necessary to create this yourself.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-precaching\n */\nclass PrecacheStrategy extends Strategy {\n /**\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}\n * of all fetch() requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor(options = {}) {\n options.cacheName = cacheNames.getPrecacheName(options.cacheName);\n super(options);\n this._fallbackToNetwork =\n options.fallbackToNetwork === false ? false : true;\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);\n }\n /**\n * @private\n * @param {Request|string} request A request to run this strategy for.\n * @param {workbox-strategies.StrategyHandler} handler The event that\n * triggered the request.\n * @return {Promise}\n */\n async _handle(request, handler) {\n const response = await handler.cacheMatch(request);\n if (response) {\n return response;\n }\n // If this is an `install` event for an entry that isn't already cached,\n // then populate the cache.\n if (handler.event && handler.event.type === 'install') {\n return await this._handleInstall(request, handler);\n }\n // Getting here means something went wrong. An entry that should have been\n // precached wasn't found in the cache.\n return await this._handleFetch(request, handler);\n }\n async _handleFetch(request, handler) {\n let response;\n const params = (handler.params || {});\n // Fall back to the network if we're configured to do so.\n if (this._fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +\n `found. Falling back to the network.`);\n }\n const integrityInManifest = params.integrity;\n const integrityInRequest = request.integrity;\n const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;\n // Do not add integrity if the original request is no-cors\n // See https://github.com/GoogleChrome/workbox/issues/3096\n response = await handler.fetch(new Request(request, {\n integrity: request.mode !== 'no-cors'\n ? integrityInRequest || integrityInManifest\n : undefined,\n }));\n // It's only \"safe\" to repair the cache if we're using SRI to guarantee\n // that the response matches the precache manifest's expectations,\n // and there's either a) no integrity property in the incoming request\n // or b) there is an integrity, and it matches the precache manifest.\n // See https://github.com/GoogleChrome/workbox/issues/2858\n // Also if the original request users no-cors we don't use integrity.\n // See https://github.com/GoogleChrome/workbox/issues/3096\n if (integrityInManifest &&\n noIntegrityConflict &&\n request.mode !== 'no-cors') {\n this._useDefaultCacheabilityPluginIfNeeded();\n const wasCached = await handler.cachePut(request, response.clone());\n if (process.env.NODE_ENV !== 'production') {\n if (wasCached) {\n logger.log(`A response for ${getFriendlyURL(request.url)} ` +\n `was used to \"repair\" the precache.`);\n }\n }\n }\n }\n else {\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this.cacheName,\n url: request.url,\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url));\n logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n }\n return response;\n }\n async _handleInstall(request, handler) {\n this._useDefaultCacheabilityPluginIfNeeded();\n const response = await handler.fetch(request);\n // Make sure we defer cachePut() until after we know the response\n // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737\n const wasCached = await handler.cachePut(request, response.clone());\n if (!wasCached) {\n // Throwing here will lead to the `install` handler failing, which\n // we want to do if *any* of the responses aren't safe to cache.\n throw new WorkboxError('bad-precaching-response', {\n url: request.url,\n status: response.status,\n });\n }\n return response;\n }\n /**\n * This method is complex, as there a number of things to account for:\n *\n * The `plugins` array can be set at construction, and/or it might be added to\n * to at any time before the strategy is used.\n *\n * At the time the strategy is used (i.e. during an `install` event), there\n * needs to be at least one plugin that implements `cacheWillUpdate` in the\n * array, other than `copyRedirectedCacheableResponsesPlugin`.\n *\n * - If this method is called and there are no suitable `cacheWillUpdate`\n * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.\n *\n * - If this method is called and there is exactly one `cacheWillUpdate`, then\n * we don't have to do anything (this might be a previously added\n * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).\n *\n * - If this method is called and there is more than one `cacheWillUpdate`,\n * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,\n * we need to remove it. (This situation is unlikely, but it could happen if\n * the strategy is used multiple times, the first without a `cacheWillUpdate`,\n * and then later on after manually adding a custom `cacheWillUpdate`.)\n *\n * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.\n *\n * @private\n */\n _useDefaultCacheabilityPluginIfNeeded() {\n let defaultPluginIndex = null;\n let cacheWillUpdatePluginCount = 0;\n for (const [index, plugin] of this.plugins.entries()) {\n // Ignore the copy redirected plugin when determining what to do.\n if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {\n continue;\n }\n // Save the default plugin's index, in case it needs to be removed.\n if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {\n defaultPluginIndex = index;\n }\n if (plugin.cacheWillUpdate) {\n cacheWillUpdatePluginCount++;\n }\n }\n if (cacheWillUpdatePluginCount === 0) {\n this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);\n }\n else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {\n // Only remove the default plugin; multiple custom plugins are allowed.\n this.plugins.splice(defaultPluginIndex, 1);\n }\n // Nothing needs to be done if cacheWillUpdatePluginCount is 1\n }\n}\nPrecacheStrategy.defaultPrecacheCacheabilityPlugin = {\n async cacheWillUpdate({ response }) {\n if (!response || response.status >= 400) {\n return null;\n }\n return response;\n },\n};\nPrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {\n async cacheWillUpdate({ response }) {\n return response.redirected ? await copyResponse(response) : response;\n },\n};\nexport { PrecacheStrategy };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { waitUntil } from 'workbox-core/_private/waitUntil.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { PrecacheInstallReportPlugin } from './utils/PrecacheInstallReportPlugin.js';\nimport { PrecacheCacheKeyPlugin } from './utils/PrecacheCacheKeyPlugin.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport { PrecacheStrategy } from './PrecacheStrategy.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] The cache to use for precaching.\n * @param {string} [options.plugins] Plugins to use when precaching as well\n * as responding to fetch events for precached assets.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor({ cacheName, plugins = [], fallbackToNetwork = true, } = {}) {\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n this._strategy = new PrecacheStrategy({\n cacheName: cacheNames.getPrecacheName(cacheName),\n plugins: [\n ...plugins,\n new PrecacheCacheKeyPlugin({ precacheController: this }),\n ],\n fallbackToNetwork,\n });\n // Bind the install and activate methods to the instance.\n this.install = this.install.bind(this);\n this.activate = this.activate.bind(this);\n }\n /**\n * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and\n * used to cache assets and respond to fetch events.\n */\n get strategy() {\n return this._strategy;\n }\n /**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n */\n precache(entries) {\n this.addToCacheList(entries);\n if (!this._installAndActiveListenersAdded) {\n self.addEventListener('install', this.install);\n self.addEventListener('activate', this.activate);\n this._installAndActiveListenersAdded = true;\n }\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {Array} entries\n * Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise}\n */\n install(event) {\n // waitUntil returns Promise\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const installReportPlugin = new PrecacheInstallReportPlugin();\n this.strategy.plugins.push(installReportPlugin);\n // Cache entries one at a time.\n // See https://github.com/GoogleChrome/workbox/issues/2528\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n await Promise.all(this.strategy.handleAll({\n params: { cacheKey },\n request,\n event,\n }));\n }\n const { updatedURLs, notUpdatedURLs } = installReportPlugin;\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, notUpdatedURLs);\n }\n return { updatedURLs, notUpdatedURLs };\n });\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise}\n */\n activate(event) {\n // waitUntil returns Promise\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const cache = await self.caches.open(this.strategy.cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * @param {string} url A cache key whose SRI you want to look up.\n * @return {string} The subresource integrity associated with the cache key,\n * or undefined if it's not set.\n */\n getIntegrityForCacheKey(cacheKey) {\n return this._cacheKeysToIntegrities.get(cacheKey);\n }\n /**\n * This acts as a drop-in replacement for\n * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this.strategy.cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @return {workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n return (options) => {\n options.request = new Request(url);\n options.params = Object.assign({ cacheKey }, options.params);\n return this.strategy.handle(options);\n };\n }\n}\nexport { PrecacheController };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { Route } from 'workbox-routing/Route.js';\nimport { generateURLVariations } from './utils/generateURLVariations.js';\nimport './_version.js';\n/**\n * A subclass of {@link workbox-routing.Route} that takes a\n * {@link workbox-precaching.PrecacheController}\n * instance and uses it to match incoming requests and handle fetching\n * responses from the precache.\n *\n * @memberof workbox-precaching\n * @extends workbox-routing.Route\n */\nclass PrecacheRoute extends Route {\n /**\n * @param {PrecacheController} precacheController A `PrecacheController`\n * instance used to both match requests and respond to fetch events.\n * @param {Object} [options] Options to control how requests are matched\n * against the list of precached URLs.\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\n constructor(precacheController, options) {\n const match = ({ request, }) => {\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(request.url, options)) {\n const cacheKey = urlsToCacheKeys.get(possibleURL);\n if (cacheKey) {\n const integrity = precacheController.getIntegrityForCacheKey(cacheKey);\n return { cacheKey, integrity };\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url));\n }\n return;\n };\n super(match, precacheController.strategy);\n }\n}\nexport { PrecacheRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a [cache-first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#cache-first-falling-back-to-network)\n * request strategy.\n *\n * A cache first strategy is useful for assets that have been revisioned,\n * such as URLs like `/styles/example.a8f5f1.css`, since they\n * can be cached for long periods of time.\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass CacheFirst extends Strategy {\n /**\n * @private\n * @param {Request|string} request A request to run this strategy for.\n * @param {workbox-strategies.StrategyHandler} handler The event that\n * triggered the request.\n * @return {Promise}\n */\n async _handle(request, handler) {\n const logs = [];\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: this.constructor.name,\n funcName: 'makeRequest',\n paramName: 'request',\n });\n }\n let response = await handler.cacheMatch(request);\n let error = undefined;\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`No response found in the '${this.cacheName}' cache. ` +\n `Will respond with a network request.`);\n }\n try {\n response = await handler.fetchAndCachePut(request);\n }\n catch (err) {\n if (err instanceof Error) {\n error = err;\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Got response from network.`);\n }\n else {\n logs.push(`Unable to get a response from the network.`);\n }\n }\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`Found a cached response in the '${this.cacheName}' cache.`);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n for (const log of logs) {\n logger.log(log);\n }\n messages.printFinalResponse(response);\n logger.groupEnd();\n }\n if (!response) {\n throw new WorkboxError('no-response', { url: request.url, error });\n }\n return response;\n }\n}\nexport { CacheFirst };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { registerQuotaErrorCallback } from 'workbox-core/registerQuotaErrorCallback.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { CacheExpiration } from './CacheExpiration.js';\nimport './_version.js';\n/**\n * This plugin can be used in a `workbox-strategy` to regularly enforce a\n * limit on the age and / or the number of cached requests.\n *\n * It can only be used with `workbox-strategy` instances that have a\n * [custom `cacheName` property set](/web/tools/workbox/guides/configure-workbox#custom_cache_names_in_strategies).\n * In other words, it can't be used to expire entries in strategy that uses the\n * default runtime cache name.\n *\n * Whenever a cached response is used or updated, this plugin will look\n * at the associated cache and remove any old or extra responses.\n *\n * When using `maxAgeSeconds`, responses may be used *once* after expiring\n * because the expiration clean up will not have occurred until *after* the\n * cached response has been used. If the response has a \"Date\" header, then\n * a light weight expiration check is performed and the response will not be\n * used immediately.\n *\n * When using `maxEntries`, the entry least-recently requested will be removed\n * from the cache first.\n *\n * @memberof workbox-expiration\n */\nclass ExpirationPlugin {\n /**\n * @param {ExpirationPluginOptions} config\n * @param {number} [config.maxEntries] The maximum number of entries to cache.\n * Entries used the least will be removed as the maximum is reached.\n * @param {number} [config.maxAgeSeconds] The maximum age of an entry before\n * it's treated as stale and removed.\n * @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)\n * that will be used when calling `delete()` on the cache.\n * @param {boolean} [config.purgeOnQuotaError] Whether to opt this cache in to\n * automatic deletion if the available storage quota has been exceeded.\n */\n constructor(config = {}) {\n /**\n * A \"lifecycle\" callback that will be triggered automatically by the\n * `workbox-strategies` handlers when a `Response` is about to be returned\n * from a [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache) to\n * the handler. It allows the `Response` to be inspected for freshness and\n * prevents it from being used if the `Response`'s `Date` header value is\n * older than the configured `maxAgeSeconds`.\n *\n * @param {Object} options\n * @param {string} options.cacheName Name of the cache the response is in.\n * @param {Response} options.cachedResponse The `Response` object that's been\n * read from a cache and whose freshness should be checked.\n * @return {Response} Either the `cachedResponse`, if it's\n * fresh, or `null` if the `Response` is older than `maxAgeSeconds`.\n *\n * @private\n */\n this.cachedResponseWillBeUsed = async ({ event, request, cacheName, cachedResponse, }) => {\n if (!cachedResponse) {\n return null;\n }\n const isFresh = this._isResponseDateFresh(cachedResponse);\n // Expire entries to ensure that even if the expiration date has\n // expired, it'll only be used once.\n const cacheExpiration = this._getCacheExpiration(cacheName);\n dontWaitFor(cacheExpiration.expireEntries());\n // Update the metadata for the request URL to the current timestamp,\n // but don't `await` it as we don't want to block the response.\n const updateTimestampDone = cacheExpiration.updateTimestamp(request.url);\n if (event) {\n try {\n event.waitUntil(updateTimestampDone);\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n // The event may not be a fetch event; only log the URL if it is.\n if ('request' in event) {\n logger.warn(`Unable to ensure service worker stays alive when ` +\n `updating cache entry for ` +\n `'${getFriendlyURL(event.request.url)}'.`);\n }\n }\n }\n }\n return isFresh ? cachedResponse : null;\n };\n /**\n * A \"lifecycle\" callback that will be triggered automatically by the\n * `workbox-strategies` handlers when an entry is added to a cache.\n *\n * @param {Object} options\n * @param {string} options.cacheName Name of the cache that was updated.\n * @param {string} options.request The Request for the cached entry.\n *\n * @private\n */\n this.cacheDidUpdate = async ({ cacheName, request, }) => {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(cacheName, 'string', {\n moduleName: 'workbox-expiration',\n className: 'Plugin',\n funcName: 'cacheDidUpdate',\n paramName: 'cacheName',\n });\n assert.isInstance(request, Request, {\n moduleName: 'workbox-expiration',\n className: 'Plugin',\n funcName: 'cacheDidUpdate',\n paramName: 'request',\n });\n }\n const cacheExpiration = this._getCacheExpiration(cacheName);\n await cacheExpiration.updateTimestamp(request.url);\n await cacheExpiration.expireEntries();\n };\n if (process.env.NODE_ENV !== 'production') {\n if (!(config.maxEntries || config.maxAgeSeconds)) {\n throw new WorkboxError('max-entries-or-age-required', {\n moduleName: 'workbox-expiration',\n className: 'Plugin',\n funcName: 'constructor',\n });\n }\n if (config.maxEntries) {\n assert.isType(config.maxEntries, 'number', {\n moduleName: 'workbox-expiration',\n className: 'Plugin',\n funcName: 'constructor',\n paramName: 'config.maxEntries',\n });\n }\n if (config.maxAgeSeconds) {\n assert.isType(config.maxAgeSeconds, 'number', {\n moduleName: 'workbox-expiration',\n className: 'Plugin',\n funcName: 'constructor',\n paramName: 'config.maxAgeSeconds',\n });\n }\n }\n this._config = config;\n this._maxAgeSeconds = config.maxAgeSeconds;\n this._cacheExpirations = new Map();\n if (config.purgeOnQuotaError) {\n registerQuotaErrorCallback(() => this.deleteCacheAndMetadata());\n }\n }\n /**\n * A simple helper method to return a CacheExpiration instance for a given\n * cache name.\n *\n * @param {string} cacheName\n * @return {CacheExpiration}\n *\n * @private\n */\n _getCacheExpiration(cacheName) {\n if (cacheName === cacheNames.getRuntimeName()) {\n throw new WorkboxError('expire-custom-caches-only');\n }\n let cacheExpiration = this._cacheExpirations.get(cacheName);\n if (!cacheExpiration) {\n cacheExpiration = new CacheExpiration(cacheName, this._config);\n this._cacheExpirations.set(cacheName, cacheExpiration);\n }\n return cacheExpiration;\n }\n /**\n * @param {Response} cachedResponse\n * @return {boolean}\n *\n * @private\n */\n _isResponseDateFresh(cachedResponse) {\n if (!this._maxAgeSeconds) {\n // We aren't expiring by age, so return true, it's fresh\n return true;\n }\n // Check if the 'date' header will suffice a quick expiration check.\n // See https://github.com/GoogleChromeLabs/sw-toolbox/issues/164 for\n // discussion.\n const dateHeaderTimestamp = this._getDateHeaderTimestamp(cachedResponse);\n if (dateHeaderTimestamp === null) {\n // Unable to parse date, so assume it's fresh.\n return true;\n }\n // If we have a valid headerTime, then our response is fresh iff the\n // headerTime plus maxAgeSeconds is greater than the current time.\n const now = Date.now();\n return dateHeaderTimestamp >= now - this._maxAgeSeconds * 1000;\n }\n /**\n * This method will extract the data header and parse it into a useful\n * value.\n *\n * @param {Response} cachedResponse\n * @return {number|null}\n *\n * @private\n */\n _getDateHeaderTimestamp(cachedResponse) {\n if (!cachedResponse.headers.has('date')) {\n return null;\n }\n const dateHeader = cachedResponse.headers.get('date');\n const parsedDate = new Date(dateHeader);\n const headerTime = parsedDate.getTime();\n // If the Date header was invalid for some reason, parsedDate.getTime()\n // will return NaN.\n if (isNaN(headerTime)) {\n return null;\n }\n return headerTime;\n }\n /**\n * This is a helper method that performs two operations:\n *\n * - Deletes *all* the underlying Cache instances associated with this plugin\n * instance, by calling caches.delete() on your behalf.\n * - Deletes the metadata from IndexedDB used to keep track of expiration\n * details for each Cache instance.\n *\n * When using cache expiration, calling this method is preferable to calling\n * `caches.delete()` directly, since this will ensure that the IndexedDB\n * metadata is also cleanly removed and open IndexedDB instances are deleted.\n *\n * Note that if you're *not* using cache expiration for a given cache, calling\n * `caches.delete()` and passing in the cache's name should be sufficient.\n * There is no Workbox-specific method needed for cleanup in that case.\n */\n async deleteCacheAndMetadata() {\n // Do this one at a time instead of all at once via `Promise.all()` to\n // reduce the chance of inconsistency if a promise rejects.\n for (const [cacheName, cacheExpiration] of this._cacheExpirations) {\n await self.caches.delete(cacheName);\n await cacheExpiration.delete();\n }\n // Reset this._cacheExpirations to its initial state.\n this._cacheExpirations = new Map();\n }\n}\nexport { ExpirationPlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from './_private/logger.js';\nimport { assert } from './_private/assert.js';\nimport { quotaErrorCallbacks } from './models/quotaErrorCallbacks.js';\nimport './_version.js';\n/**\n * Adds a function to the set of quotaErrorCallbacks that will be executed if\n * there's a quota error.\n *\n * @param {Function} callback\n * @memberof workbox-core\n */\n// Can't change Function type\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction registerQuotaErrorCallback(callback) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(callback, 'function', {\n moduleName: 'workbox-core',\n funcName: 'register',\n paramName: 'callback',\n });\n }\n quotaErrorCallbacks.add(callback);\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Registered a callback to respond to quota errors.', callback);\n }\n}\nexport { registerQuotaErrorCallback };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [network first](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#network-first-falling-back-to-cache)\n * request strategy.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS](https://enable-cors.org/).\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass NetworkFirst extends Strategy {\n /**\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n * `fetch()` requests made by this strategy.\n * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n * @param {number} [options.networkTimeoutSeconds] If set, any network requests\n * that fail to respond within the timeout will fallback to the cache.\n *\n * This option can be used to combat\n * \"[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}\"\n * scenarios.\n */\n constructor(options = {}) {\n super(options);\n // If this instance contains no plugins with a 'cacheWillUpdate' callback,\n // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.\n if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {\n this.plugins.unshift(cacheOkAndOpaquePlugin);\n }\n this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;\n if (process.env.NODE_ENV !== 'production') {\n if (this._networkTimeoutSeconds) {\n assert.isType(this._networkTimeoutSeconds, 'number', {\n moduleName: 'workbox-strategies',\n className: this.constructor.name,\n funcName: 'constructor',\n paramName: 'networkTimeoutSeconds',\n });\n }\n }\n }\n /**\n * @private\n * @param {Request|string} request A request to run this strategy for.\n * @param {workbox-strategies.StrategyHandler} handler The event that\n * triggered the request.\n * @return {Promise}\n */\n async _handle(request, handler) {\n const logs = [];\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: this.constructor.name,\n funcName: 'handle',\n paramName: 'makeRequest',\n });\n }\n const promises = [];\n let timeoutId;\n if (this._networkTimeoutSeconds) {\n const { id, promise } = this._getTimeoutPromise({ request, logs, handler });\n timeoutId = id;\n promises.push(promise);\n }\n const networkPromise = this._getNetworkPromise({\n timeoutId,\n request,\n logs,\n handler,\n });\n promises.push(networkPromise);\n const response = await handler.waitUntil((async () => {\n // Promise.race() will resolve as soon as the first promise resolves.\n return ((await handler.waitUntil(Promise.race(promises))) ||\n // If Promise.race() resolved with null, it might be due to a network\n // timeout + a cache miss. If that were to happen, we'd rather wait until\n // the networkPromise resolves instead of returning null.\n // Note that it's fine to await an already-resolved promise, so we don't\n // have to check to see if it's still \"in flight\".\n (await networkPromise));\n })());\n if (process.env.NODE_ENV !== 'production') {\n logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n for (const log of logs) {\n logger.log(log);\n }\n messages.printFinalResponse(response);\n logger.groupEnd();\n }\n if (!response) {\n throw new WorkboxError('no-response', { url: request.url });\n }\n return response;\n }\n /**\n * @param {Object} options\n * @param {Request} options.request\n * @param {Array} options.logs A reference to the logs array\n * @param {Event} options.event\n * @return {Promise}\n *\n * @private\n */\n _getTimeoutPromise({ request, logs, handler, }) {\n let timeoutId;\n const timeoutPromise = new Promise((resolve) => {\n const onNetworkTimeout = async () => {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`Timing out the network response at ` +\n `${this._networkTimeoutSeconds} seconds.`);\n }\n resolve(await handler.cacheMatch(request));\n };\n timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);\n });\n return {\n promise: timeoutPromise,\n id: timeoutId,\n };\n }\n /**\n * @param {Object} options\n * @param {number|undefined} options.timeoutId\n * @param {Request} options.request\n * @param {Array} options.logs A reference to the logs Array.\n * @param {Event} options.event\n * @return {Promise}\n *\n * @private\n */\n async _getNetworkPromise({ timeoutId, request, logs, handler, }) {\n let error;\n let response;\n try {\n response = await handler.fetchAndCachePut(request);\n }\n catch (fetchError) {\n if (fetchError instanceof Error) {\n error = fetchError;\n }\n }\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Got response from network.`);\n }\n else {\n logs.push(`Unable to get a response from the network. Will respond ` +\n `with a cached response.`);\n }\n }\n if (error || !response) {\n response = await handler.cacheMatch(request);\n if (process.env.NODE_ENV !== 'production') {\n if (response) {\n logs.push(`Found a cached response in the '${this.cacheName}'` + ` cache.`);\n }\n else {\n logs.push(`No response found in the '${this.cacheName}' cache.`);\n }\n }\n }\n return response;\n }\n}\nexport { NetworkFirst };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { createPartialResponse } from './createPartialResponse.js';\nimport './_version.js';\n/**\n * The range request plugin makes it easy for a request with a 'Range' header to\n * be fulfilled by a cached response.\n *\n * It does this by intercepting the `cachedResponseWillBeUsed` plugin callback\n * and returning the appropriate subset of the cached response body.\n *\n * @memberof workbox-range-requests\n */\nclass RangeRequestsPlugin {\n constructor() {\n /**\n * @param {Object} options\n * @param {Request} options.request The original request, which may or may not\n * contain a Range: header.\n * @param {Response} options.cachedResponse The complete cached response.\n * @return {Promise} If request contains a 'Range' header, then a\n * new response with status 206 whose body is a subset of `cachedResponse` is\n * returned. Otherwise, `cachedResponse` is returned as-is.\n *\n * @private\n */\n this.cachedResponseWillBeUsed = async ({ request, cachedResponse, }) => {\n // Only return a sliced response if there's something valid in the cache,\n // and there's a Range: header in the request.\n if (cachedResponse && request.headers.has('range')) {\n return await createPartialResponse(request, cachedResponse);\n }\n // If there was no Range: header, or if cachedResponse wasn't valid, just\n // pass it through as-is.\n return cachedResponse;\n };\n }\n}\nexport { RangeRequestsPlugin };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { cacheOkAndOpaquePlugin } from './plugins/cacheOkAndOpaquePlugin.js';\nimport { Strategy } from './Strategy.js';\nimport { messages } from './utils/messages.js';\nimport './_version.js';\n/**\n * An implementation of a\n * [stale-while-revalidate](https://developer.chrome.com/docs/workbox/caching-strategies-overview/#stale-while-revalidate)\n * request strategy.\n *\n * Resources are requested from both the cache and the network in parallel.\n * The strategy will respond with the cached version if available, otherwise\n * wait for the network response. The cache is updated with the network response\n * with each successful request.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).\n * Opaque responses are cross-origin requests where the response doesn't\n * support [CORS](https://enable-cors.org/).\n *\n * If the network request fails, and there is no cache match, this will throw\n * a `WorkboxError` exception.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-strategies\n */\nclass StaleWhileRevalidate extends Strategy {\n /**\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n * `fetch()` requests made by this strategy.\n * @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n */\n constructor(options = {}) {\n super(options);\n // If this instance contains no plugins with a 'cacheWillUpdate' callback,\n // prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.\n if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {\n this.plugins.unshift(cacheOkAndOpaquePlugin);\n }\n }\n /**\n * @private\n * @param {Request|string} request A request to run this strategy for.\n * @param {workbox-strategies.StrategyHandler} handler The event that\n * triggered the request.\n * @return {Promise}\n */\n async _handle(request, handler) {\n const logs = [];\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: this.constructor.name,\n funcName: 'handle',\n paramName: 'request',\n });\n }\n const fetchAndCachePromise = handler.fetchAndCachePut(request).catch(() => {\n // Swallow this error because a 'no-response' error will be thrown in\n // main handler return flow. This will be in the `waitUntil()` flow.\n });\n void handler.waitUntil(fetchAndCachePromise);\n let response = await handler.cacheMatch(request);\n let error;\n if (response) {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`Found a cached response in the '${this.cacheName}'` +\n ` cache. Will update with the network response in the background.`);\n }\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n logs.push(`No response found in the '${this.cacheName}' cache. ` +\n `Will wait for the network response.`);\n }\n try {\n // NOTE(philipwalton): Really annoying that we have to type cast here.\n // https://github.com/microsoft/TypeScript/issues/20006\n response = (await fetchAndCachePromise);\n }\n catch (err) {\n if (err instanceof Error) {\n error = err;\n }\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.groupCollapsed(messages.strategyStart(this.constructor.name, request));\n for (const log of logs) {\n logger.log(log);\n }\n messages.printFinalResponse(response);\n logger.groupEnd();\n }\n if (!response) {\n throw new WorkboxError('no-response', { url: request.url, error });\n }\n return response;\n }\n}\nexport { StaleWhileRevalidate };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { deleteOutdatedCaches } from './utils/deleteOutdatedCaches.js';\nimport './_version.js';\n/**\n * Adds an `activate` event listener which will clean up incompatible\n * precaches that were created by older versions of Workbox.\n *\n * @memberof workbox-precaching\n */\nfunction cleanupOutdatedCaches() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('activate', ((event) => {\n const cacheName = cacheNames.getPrecacheName();\n event.waitUntil(deleteOutdatedCaches(cacheName).then((cachesDeleted) => {\n if (process.env.NODE_ENV !== 'production') {\n if (cachesDeleted.length > 0) {\n logger.log(`The following out-of-date precaches were cleaned up ` +\n `automatically:`, cachesDeleted);\n }\n }\n }));\n }));\n}\nexport { cleanupOutdatedCaches };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst SUBSTRING_TO_FIND = '-precache-';\n/**\n * Cleans up incompatible precaches that were created by older versions of\n * Workbox, by a service worker registered under the current scope.\n *\n * This is meant to be called as part of the `activate` event.\n *\n * This should be safe to use as long as you don't include `substringToFind`\n * (defaulting to `-precache-`) in your non-precache cache names.\n *\n * @param {string} currentPrecacheName The cache name currently in use for\n * precaching. This cache won't be deleted.\n * @param {string} [substringToFind='-precache-'] Cache names which include this\n * substring will be deleted (excluding `currentPrecacheName`).\n * @return {Array} A list of all the cache names that were deleted.\n *\n * @private\n * @memberof workbox-precaching\n */\nconst deleteOutdatedCaches = async (currentPrecacheName, substringToFind = SUBSTRING_TO_FIND) => {\n const cacheNames = await self.caches.keys();\n const cacheNamesToDelete = cacheNames.filter((cacheName) => {\n return (cacheName.includes(substringToFind) &&\n cacheName.includes(self.registration.scope) &&\n cacheName !== currentPrecacheName);\n });\n await Promise.all(cacheNamesToDelete.map((cacheName) => self.caches.delete(cacheName)));\n return cacheNamesToDelete;\n};\nexport { deleteOutdatedCaches };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport './_version.js';\n/**\n * Claim any currently available clients once the service worker\n * becomes active. This is normally used in conjunction with `skipWaiting()`.\n *\n * @memberof workbox-core\n */\nfunction clientsClaim() {\n self.addEventListener('activate', () => self.clients.claim());\n}\nexport { clientsClaim };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * {@link workbox-precaching.precache} and\n * {@link workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See the\n * {@link workbox-precaching.PrecacheRoute} options.\n *\n * @memberof workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * {@link workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * {@link workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.precache(entries);\n}\nexport { precache };\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { PrecacheRoute } from './PrecacheRoute.js';\nimport './_version.js';\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}\n * options.\n *\n * @memberof workbox-precaching\n */\nfunction addRoute(options) {\n const precacheController = getOrCreatePrecacheController();\n const precacheRoute = new PrecacheRoute(precacheController, options);\n registerRoute(precacheRoute);\n}\nexport { addRoute };\n"],"names":["self","_","e","messageGenerator","fallback","code","args","msg","length","JSON","stringify","WorkboxError","Error","constructor","errorCode","details","super","this","name","normalizeHandler","handler","handle","Route","match","method","setCatchHandler","catchHandler","RegExpRoute","regExp","url","result","exec","href","origin","location","index","slice","Router","_routes","Map","_defaultHandlerMap","routes","addFetchListener","addEventListener","event","request","responsePromise","handleRequest","respondWith","addCacheListener","data","type","payload","requestPromises","Promise","all","urlsToCache","map","entry","Request","waitUntil","ports","then","postMessage","URL","protocol","startsWith","sameOrigin","params","route","findMatchingRoute","has","get","err","reject","_catchHandler","catch","async","catchErr","matchResult","Array","isArray","Object","keys","undefined","setDefaultHandler","set","registerRoute","push","unregisterRoute","routeIndex","indexOf","splice","defaultRouter","getOrCreateDefaultRouter","capture","captureUrl","matchCallback","RegExp","moduleName","funcName","paramName","cacheOkAndOpaquePlugin","cacheWillUpdate","response","status","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","cacheName","filter","value","join","cacheNames","userCacheName","stripParams","fullURL","ignoreParams","strippedURL","param","searchParams","delete","Deferred","promise","resolve","quotaErrorCallbacks","Set","toRequest","input","StrategyHandler","strategy","options","_cacheKeys","assign","_strategy","_handlerDeferred","_extendLifetimePromises","_plugins","plugins","_pluginStateMap","plugin","fetch","mode","FetchEvent","preloadResponse","possiblePreloadResponse","originalRequest","hasCallback","clone","cb","iterateCallbacks","thrownErrorMessage","message","pluginFilteredRequest","fetchResponse","fetchOptions","callback","error","runCallbacks","fetchAndCachePut","responseClone","cachePut","cacheMatch","key","cachedResponse","matchOptions","effectiveRequest","getCacheKey","multiMatchOptions","caches","ms","setTimeout","String","replace","responseToCache","_ensureResponseSafeToCache","cache","open","hasCacheUpdateCallback","oldResponse","strippedRequestURL","keysOptions","ignoreSearch","cacheKeys","cacheKey","cacheMatchIgnoreParams","put","executeQuotaErrorCallbacks","newResponse","state","statefulCallback","statefulParam","doneWaiting","shift","destroy","pluginsUsed","Strategy","responseDone","handleAll","_getResponse","_awaitComplete","_handle","waitUntilError","dontWaitFor","idbProxyableTypes","cursorAdvanceMethods","cursorRequestMap","WeakMap","transactionDoneMap","transactionStoreNamesMap","transformCache","reverseTransformCache","idbProxyTraps","target","prop","receiver","IDBTransaction","objectStoreNames","objectStore","wrap","wrapFunction","func","IDBDatabase","prototype","transaction","IDBCursor","advance","continue","continuePrimaryKey","includes","apply","unwrap","storeNames","tx","call","sort","transformCachableValue","done","unlisten","removeEventListener","complete","DOMException","cacheDonePromiseForTransaction","object","IDBObjectStore","IDBIndex","some","c","Proxy","instanceOfAny","IDBRequest","success","promisifyRequest","newValue","readMethods","writeMethods","cachedMethods","getMethod","targetFuncName","useIndex","isWrite","storeName","store","oldTraps","_extends","CACHE_OBJECT_STORE","normalizeURL","unNormalizedUrl","hash","CacheTimestampsModel","_db","_cacheName","_upgradeDb","db","objStore","createObjectStore","keyPath","createIndex","unique","_upgradeDbAndDeleteOldDbs","blocked","indexedDB","deleteDatabase","oldVersion","deleteDB","setTimestamp","timestamp","id","_getId","getDb","durability","getTimestamp","expireEntries","minTimestamp","maxCount","cursor","openCursor","entriesToDelete","entriesNotDeletedCount","urlsDeleted","version","upgrade","blocking","terminated","openPromise","newVersion","openDB","bind","CacheExpiration","config","_isRunning","_rerunRequested","_maxEntries","maxEntries","_maxAgeSeconds","maxAgeSeconds","_matchOptions","_timestampModel","Date","now","urlsExpired","updateTimestamp","isURLExpired","expireOlderThan","Infinity","createPartialResponse","originalResponse","rangeHeader","headers","boundaries","normalizedRangeHeader","trim","toLowerCase","rangeParts","start","Number","end","parseRangeHeader","originalBlob","blob","effectiveBoundaries","blobSize","size","effectiveStart","effectiveEnd","calculateEffectiveBoundaries","slicedBlob","slicedBlobSize","slicedResponse","Response","statusText","asyncFn","returnPromise","createCacheKey","urlObject","revision","cacheKeyURL","originalURL","PrecacheInstallReportPlugin","updatedURLs","notUpdatedURLs","handlerWillStart","cachedResponseWillBeUsed","PrecacheCacheKeyPlugin","precacheController","cacheKeyWillBeUsed","_precacheController","getCacheKeyForURL","supportStatus","copyResponse","modifier","clonedResponse","responseInit","Headers","modifiedResponseInit","body","testResponse","canConstructResponseFromBodyStream","PrecacheStrategy","_fallbackToNetwork","fallbackToNetwork","copyRedirectedCacheableResponsesPlugin","_handleInstall","_handleFetch","integrityInManifest","integrity","integrityInRequest","noIntegrityConflict","_useDefaultCacheabilityPluginIfNeeded","defaultPluginIndex","cacheWillUpdatePluginCount","entries","defaultPrecacheCacheabilityPlugin","redirected","PrecacheController","_urlsToCacheKeys","_urlsToCacheModes","_cacheKeysToIntegrities","install","activate","addToCacheList","_installAndActiveListenersAdded","urlsToWarnAbout","cacheMode","firstEntry","secondEntry","warningMessage","console","warn","installReportPlugin","credentials","currentlyCachedRequests","expectedCacheKeys","values","deletedURLs","getURLsToCacheKeys","getCachedURLs","getIntegrityForCacheKey","matchPrecache","createHandlerBoundToURL","getOrCreatePrecacheController","PrecacheRoute","urlsToCacheKeys","possibleURL","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","urlWithoutIgnoredParams","test","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","generateURLVariations","isFresh","_isResponseDateFresh","cacheExpiration","_getCacheExpiration","updateTimestampDone","cacheDidUpdate","_config","_cacheExpirations","purgeOnQuotaError","add","registerQuotaErrorCallback","deleteCacheAndMetadata","dateHeaderTimestamp","_getDateHeaderTimestamp","dateHeader","headerTime","getTime","isNaN","p","unshift","_networkTimeoutSeconds","networkTimeoutSeconds","logs","promises","timeoutId","_getTimeoutPromise","networkPromise","_getNetworkPromise","race","fetchError","clearTimeout","fetchAndCachePromise","currentPrecacheName","substringToFind","cacheNamesToDelete","deleteOutdatedCaches","cachesDeleted","clients","claim","addRoute"],"mappings":"6CAEA,IACIA,KAAK,uBAAyBC,GAClC,CACA,MAAOC,GAAG,CCEV,MCgBaC,EAdIC,CAACC,KAASC,KACvB,IAAIC,EAAMF,EAIV,OAHIC,EAAKE,OAAS,IACdD,GAAO,OAAOE,KAAKC,UAAUJ,MAE1BC,CAAG,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AUwH,SAASkP,IACvB1W,EAAUwH,SAAS3O,KAAKgH,aAAaC,QACrCE,IAAcyW,IAGtB,aADMta,QAAQC,IAAIua,EAAmBra,KAAK0D,GAAcnH,KAAK+K,OAAOhD,OAAOZ,MACpE2W,CAAkB,EDdLC,CAAqB5W,GAAWrD,MAAMka,QAOnD,GAEX,iBEhBA,WACIhe,KAAK2C,iBAAiB,YAAY,IAAM3C,KAAKie,QAAQC,SACzD,qBCQA,SAA0BrF,EAASpQ,ICInC,SAAkBoQ,GACa6B,KACR9T,SAASiS,EAChC,CDNIjS,CAASiS,GEAb,SAAkBpQ,GACd,MAAMyO,EAAqBwD,KAE3BnV,EADsB,IAAIoV,GAAczD,EAAoBzO,GAEhE,CFHI0V,CAAS1V,EACb","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]} \ No newline at end of file diff --git a/apps/web/public/worker-a1b55571f2865253.js.map b/apps/web/public/worker-a1b55571f2865253.js.map new file mode 100644 index 0000000000..8c846bb72f --- /dev/null +++ b/apps/web/public/worker-a1b55571f2865253.js.map @@ -0,0 +1 @@ +{"version":3,"file":"../public/worker-a1b55571f2865253.js","mappings":";;;;;;;AAAa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,wBAAwB;AACxB,wBAAwB;AACxB;;;;;;;;ACJa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,sBAAsB,GAAG,mBAAmB,GAAG,oBAAoB;AACzF,gBAAgB,mBAAO,CAAC,GAAS;AACjC;AACA;AACA;AACA,cAAc,QAAQ,EAAE,SAAS,EAAE,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;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F,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe,GAAG,iBAAiB,GAAG,sBAAsB,GAAG,oBAAoB;AACnF;AACA;AACA;AACA;AACA;AACA,sCAAsC,EAAE,IAAI,GAAG;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,8BAA8B,aAAa;AAC3C;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,UAAU,IAAI,aAAa;AAC5D,wCAAwC,gBAAgB;AACxD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,+CAA+C,oCAAoC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,cAAc,oCAAoC;AACjH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,eAAe;AACf;;;;;;;AC7FA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,MAAM;AACN;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;;AAEtC;AACA;AACA;;AAEA,4BAA4B;AAC5B;AACA;AACA;AACA,6BAA6B;;;;;;;UCvL7B;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA,GAAG;UACH;UACA;;UAEA;UACA;UACA;;;;;WC5BA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;;;;;;;ACPD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA,oBAAoB,eAAe;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,oBAAM;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,8BAA8B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAM;AACrB,eAAe,qBAAM;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO,2BAA2B,OAAO;AACxD;AACA;AACA,+BAA+B,OAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,EAAE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,YAAY;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,wCAAwC,MAAM;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA,2CAA2C,QAAQ,wEAAwE,KAAK;;AAEhI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,QAAQ;AACvD;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,qBAAM;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAS;AAClB,4CAA4C,yBAAW;AACvD;AACA;AACA;AACA;AACA,SAAS,yBAAW;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,MAAM;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,iBAAiB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,aAAa,GAAG,KAAK;AACjD;AACA;AACA;AACA,+BAA+B,iBAAiB,IAAI,SAAS,GAAG,SAAS;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,IAAI;AACvD,KAAK;AACL;AACA,mBAAmB,MAAM,IAAI;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,GAAG;AACf;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa,WAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,yBAAyB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,QAAQ;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B,6BAA6B,QAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2BAA2B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS,mBAAK;AACd;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ,UAAU,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA,qCAAqC;AACrC;AACA,YAAY,oBAAM;AAClB,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kEAAkB,IAAE;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,EAAE;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gCAAkB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAE6/B;AAC7/B;;;ACrlE0C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,WAAW;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,gBAAgB,eAAe,UAAU;AAC1F;AACA;AACA,yCAAyC,WAAW;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,wCAAwC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,gBAAgB,eAAe;AAC/B;AACA;AACA,2BAA2B,UAAU,GAAG,qBAAqB;AAC7D;AACA;AACA,qCAAqC,WAAW;AAChD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,kCAAkC;AAC/D;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4GAA4G;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gCAAkB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gBAAgB,mCAAmC,UAAU;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEmD;AACnD;;;ACxZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,IAAI,KAAK,cAAc;AACnD;AACA;AACA,sFAAsF,QAAQ;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,IAAI;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,SAAS,+BAAiB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;;AAE4D;AAC5D;;;AC1NA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEqG;;;ACxLlC;AACN;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,yCAAyC,IAAI;AAC9E;AACA,wBAAwB,IAAI;AAC5B;AACA;AACA,oBAAoB,IAAI,sDAAsD,IAAI;AAClF,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,UAAU,IAAI;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,CAAC;;AAE2B;;;AC9FwC;AACuB;AAC0G;AACtJ;AAClB;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gBAAgB,GAAG,gBAAgB;AAC7D;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM;;AAEzB;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,MAAM,kBAAI;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gCAAkB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,kBAAI;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gBAAgB,sCAAsC,SAAS;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,cAAc;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yBAAY;AACrB;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,gCAAkB;AAClF,IAAI,yBAAY;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,SAAS;AAClE;AACA,uEAAuE,SAAS;AAChF,0EAA0E,SAAS;AACnF,sEAAsE,SAAS;AAC/E;AACA;AACA,6EAA6E,SAAS;AACtF;AACA;AACA,iGAAiG,sBAAsB;AACvH,oGAAoG,sBAAsB;AAC1H,oGAAoG,sBAAsB;AAC1H,2GAA2G,sBAAsB;AACjI;AACA;AACA;AACA,0BAA0B,YAAY;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,uCAAuC;AACvC;AACA;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF,qBAAqB;AACxG;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,gCAAgC;AAC7E;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAO;AAC3B,+CAA+C;AAC/C;AACA;AACA;AACA,sBAAsB;AACtB;AACA,mCAAmC,MAAM,gCAAkB,yCAAyC;AACpG;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0BAA0B,mBAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB;AACA;AACA;AACA,uFAAuF,eAAe;AACtG;AACA;AACA,0BAA0B,gCAAkB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mIAAmI;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iCAAiC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAM,QAAQ,gCAAkB;AACzC;AACA,yBAAyB,gCAAkB,IAAI,mBAAmB;AAClE;AACA;AACA;AACA,qEAAqE,eAAe;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA,2CAA2C,QAAQ,kBAAkB,QAAQ;AAC7E;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA,2BAA2B,SAAS,IAAI,QAAQ,oBAAoB,kBAAkB;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yBAAW;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,aAAa;AACtC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,aAAa;AACtC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,cAAc,SAAS,GAAG,kBAAkB;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,aAAa;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kCAAkC;AACtD,iCAAiC,6BAA6B,kBAAkB,0CAA0C;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;AACA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,6BAA6B;AACxC;AACA,qBAAqB,yCAAyC;AAC9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,SAAS;AACpC,2BAA2B,SAAS;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEmW;AACnW;;;ACloC0F;AAC1C;AACa;AAChC;;AAE7B,MAAM,sBAAI;AACV,MAAM,qBAAO;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,qBAAO,CAAC;AACrC;AACA;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iHAAiH,WAAW;AAC5H;AACA;AACA,yDAAyD,cAAc,4BAA4B,cAAc,cAAc,GAAG,eAAe;AACjJ;AACA;AACA;AACA,MAAM,2BAAa,OAAO,YAAY;AACtC;AACA;AACA,6BAA6B,aAAa;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,WAAW;AAC/C,cAAc,sBAAsB,YAAY,UAAU;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAAa;AACxB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,yCAAyC,cAAc;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,uBAAuB,EAAE,aAAa;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,qCAAqC,IAAI,KAAK;AACzF;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,GAAG;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,kBAAkB,GAAG,gBAAgB;AACnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,UAAU;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,uBAAS;AACb,SAAS,0BAAY;AACrB,SAAS,uBAAS;AAClB,QAAQ,uBAAS,GAAG,MAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,uBAAS;AACpB;AACA;AACA;AACA;AACA,qBAAqB,0BAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,0BAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,0BAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,2BAAa;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,yCAAyC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAAa;AAC/B;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,qCAAqC;AAC/E;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,KAAK;AACxD,cAAc,oCAAoC,GAAG,IAAI;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2BAAa;AACnC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAAa;AAC/B;AACA;AACA;AACA,iDAAiD,eAAe,aAAa,oDAAoD;AACjI;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,uEAAuE,wBAAwB,WAAW;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,wBAAwB,aAAa,oDAAoD;AACpK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,eAAe,gCAAgC;AACxF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yCAAyC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sBAAsB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,KAAK;AAC7C,cAAc,oCAAoC,GAAG,IAAI;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,YAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,kBAAkB,2BAAa;AAC/B;AACA;AACA;AACA,sBAAsB,2BAAa;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,YAAY;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD,IAAI,iCAAiC;AACrC,qBAAqB,iCAAiC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAAa;AACxB;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,yBAAY;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,yBAAY;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,kBAAkB,KAAK,SAAS;AACpC,IAAI,kBAAkB,KAAK,SAAS;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,CAAC,sBAAI,EAAE,qBAAO;AAC7B;AACA,eAAe,CAAC,sBAAI,EAAE,qBAAO;;AAEiD;AAC9E;;;ACloCiC;AACe;AACT;AAC4E;AAC1C;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;;AAEvC;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,MAAM;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,UAAU,QAAQ;AAClB,UAAU,QAAQ;AAClB,UAAU,QAAQ;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sBAAsB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,8BAAa;AACnB,MAAM,iCAAgB;AACtB,MAAM,kCAAiB;AACvB,IAAI,0BAAS;AACb,SAAS,6BAAY;AACrB,SAAS,0BAAS;AAClB,QAAQ,0BAAS,GAAG,MAAM,CAAC,8BAAa,EAAE,iCAAgB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,kCAAiB;AACrE;AACA;AACA,SAAS;AACT;AACA,WAAW,0BAAS;AACpB;AACA;AACA;AACA,gBAAgB,uBAAM;AACtB,qBAAqB,6BAAY;AACjC;AACA,qBAAqB,kCAAiB;AACtC,qBAAqB,kCAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAM;AACtB,qBAAqB,6BAAY;AACjC,8BAA8B,kCAAiB;AAC/C,yBAAyB,kCAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAM;AACtB,qBAAqB,6BAAY;AACjC,8BAA8B,kCAAiB;AAC/C,yBAAyB,kCAAiB;AAC1C;AACA;AACA,SAAS,uBAAM,GAAG,WAAW;AAC7B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iHAAiH,WAAW;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA,gJAAgJ,qBAAqB;AACrK,+HAA+H,WAAW;AAC1I;AACA;AACA,yBAAyB,WAAW;AACpC,wHAAwH,WAAW;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,8BAAa,OAAO,YAAY;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,2BAAU;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,8BAAa;AAC3B;AACA,SAAS;AACT;AACA;AACA;AACA,cAAc,8BAAa;AAC3B;AACA,SAAS;AACT;AACA;AACA,cAAc,8BAAa;AAC3B;AACA;AACA;AACA;AACA,0BAA0B,2BAAU;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,4CAA4C,GAAG,mBAAmB;AAC1G;AACA;AACA;AACA,cAAc,8BAAa;AAC3B;AACA,SAAS;AACT;AACA;AACA;AACA,cAAc,8BAAa;AAC3B;AACA,SAAS;AACT;AACA;AACA,cAAc,8BAAa;AAC3B;AACA;AACA;AACA;AACA,0BAA0B,2BAAU;AACpC;AACA;AACA;AACA;AACA;AACA,wCAAwC,4CAA4C,GAAG,MAAM;AAC7F;AACA;AACA;AACA,kBAAkB,8BAAa;AAC/B;AACA,aAAa;AACb;AACA;AACA;AACA,cAAc,8BAAa;AAC3B;AACA,SAAS;AACT;AACA;AACA,uBAAuB,WAAW;AAClC,cAAc,SAAS,YAAY,UAAU;AAC7C;AACA,eAAe,2BAAU,GAAG,0BAA0B;AACtD;AACA;AACA;AACA;AACA;AACA,qDAAqD,UAAU;AAC/D,KAAK;AACL;AACA,mBAAmB,kCAAkC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,mBAAmB,6CAA6C;AAClI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAK;AACd;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,eAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,sBAAK;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,MAAM;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,YAAY,UAAU;AACtB,YAAY,aAAa;AACzB;AACA,mDAAmD,YAAY;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iCAAgB;AACzB;AACA,cAAc,qCAAoB;AAClC;AACA;AACA,cAAc,qCAAoB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,UAAU;AACtB;AACA;AACA,kBAAkB,qCAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qCAAoB;AAC7B,WAAW,8BAAa;AACxB;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,iCAAgB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,kBAAkB,KAAK,SAAS;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,oBAAoB;AAChC,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,8BAAa;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oBAAM;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,8BAAa;AAC/B;AACA,KAAK;AACL;AACA,cAAc,8BAAa;AAC3B,KAAK;AACL,WAAW,yBAAY,CAAC,gCAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gCAAkB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;A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EAAC;;;ACxCD,SAAS,qBAAgB;AACzB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,gBAAgB,qBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAG;AACZ;AACA;AACA,eAAe,qBAAgB;AAC/B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAgB;AAC/B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,qBAAgB;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAM;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAgB;AAC/B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAgB;AAC/B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAgB;AAC/B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qBAAgB;AACnC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qBAAgB;AACnC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qBAAgB;AAChC,gBAAgB,qBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;A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AASC;AAClC,EAAC;AAEM,MAAMC,uCAAuC;IAClD,MAAMF,UAAU;IAChB,MAAMC,aAAa;IAEnB,OAAOP,WAAeA,CAACM,SAASC;AAClC,EAAC;;;ACvCD,4BAA4B;AAC5B;AACA;AACA;AACO,MAAM,gBAAO;AACpB;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,KAAK;AAC3D;AACA,8BAA8B,KAAK;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI;AACT;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,0CAA0C;AACvF;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACyC;AACU;AACnD,SAAS,gBAAS;AAClB;AACA;AACA;AACA;AACA,iCAAiC,gBAAS;AAC1C;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB,gBAAS,IAAI,IAAI,gBAAS,WAAW,mBAAmB;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,0EAA0E,gBAAS,OAAO;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gBAAS;AAClD,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA,6BAA6B,KAAK;AAClC,gCAAgC,gBAAO,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gBAAgB,UAAU,MAAM;AACpC;AACA;AACA;AACA;AACA,QAAQ,gBAAgB,UAAU,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAM;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,qBAAc;AAC9B,IAAI,aAAM,uCAAuC,8BAA8B;AAC/E;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAM;AACV;AACA;AACA,KAAK;AACL,IAAI,aAAM;AACV;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACO;AACP,IAAI,aAAM;AACV,yDAAyD;AACzD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,aAAM,8BAA8B,MAAM,OAAO;AACzD;AACA,SAAS;AACT;AACA;AACA;;AC/NA;AACA;AACA;AACA;AACA;AACA;AACqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,IAAI,qBAAc;AAClB;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAO;AACvB;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,mCAAmC,YAAO;AAC1C;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,YAAO;AAClB;AACA;AACA;AACA;AACA;AACO;AACP,gBAAgB,YAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;;ACzKA;AACA;AACA;AACA;AACA;AACiD;AACI;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,yBAAyB,eAAS;AAClC,IAAI,aAAM;AACV;AACA,KAAK;AACL,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,yBAAyB,eAAS;AAClC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,wBAAwB,eAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,YAAY,qBAAc;AAC1B,YAAY,qBAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qBAAc,wCAAwC,UAAU;AAChF;AACA;AACA,IAAI,qBAAc;AAClB;AACA;AACA;AACA;AACA;AACO;AACP;AACA,IAAI,aAAM;AACV;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAS;AACzB;AACA;AACA,YAAY,qBAAc;AAC1B;AACA;AACA,YAAY,qBAAc;AAC1B,YAAY,qBAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAS;AAChC;AACA;AACA,gBAAgB,qBAAc,mCAAmC,UAAU;AAC3E;AACA;AACA,IAAI,qBAAc;AAClB;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,eAAS;AACpB;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,eAAS;AAC/B,mEAAmE,OAAO;AAC1E;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACqC;AAC+B;AACQ;AACzB;AACnD;AACA,MAAM,gBAAI;AACV,MAAM,gBAAI;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAI,aAAa,gBAAI;AAC5C,QAAQ,aAAM;AACd;AACA,SAAS;AACT,kBAAkB,gBAAI;AACtB,kBAAkB,QAAQ,CAAC,IAAI;AAC/B;AACA;AACA,mBAAmB,QAAQ,CAAC,IAAI;AAChC;AACA;AACA;AACA,uBAAuB,gBAAI;AAC3B,QAAQ,aAAM;AACd;AACA,SAAS;AACT,2DAA2D,gBAAI;AAC/D;AACA;AACA;AACA;AACA;AACA,4BAA4B,MAAM;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,qBAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,qBAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,qBAAc;AAClB,IAAI,qBAAc;AAClB;AACA,aAAa;AACb;AACA,SAAS,oBAAQ;AACjB;AACA,cAAc,gBAAI;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,uBAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,aAAa;AACrB;AACA;AACA,uBAAuB,oBAAQ;AAC/B,QAAQ,gBAAgB,SAAS,6BAA6B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,QAAQ,qBAAc,qDAAqD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,mBAAmB,uBAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,aAAM,0BAA0B,gBAAI;AAC5C;AACA,SAAS;AACT;AACA;AACA;AACA,QAAQ,aAAM,YAAY,gBAAI;AAC9B;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,aAAM,gBAAgB,gBAAI;AAClC;AACA,SAAS;AACT;AACA;AACA,QAAQ,aAAM,0BAA0B,gBAAI;AAC5C;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAI;AAC5B,gCAAgC,gBAAI;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAI;AAC5B,gCAAgC,gBAAI;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAW;AAC9B;AACA;AACA;AACA;AACA,eAAe,sBAAsB,gBAAI;AACzC;AACA;AACA;AACA,mBAAmB,oBAAoB,gBAAI;AAC3C;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,eAAS;AAC5D;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;AACA,YAAY,aAAM,oBAAoB,gBAAI;AAC1C;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uBAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,qBAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,aAAM;AACd;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,mBAAmB,uBAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ,CAAC,QAAQ;AACrC;AACA;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA,mBAAmB,uBAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AC7gBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC6C;AACE;AACR;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,QAAQ,qBAAc;AACtB;AACA;AACA;AACA,mBAAmB,eAAS;AAC5B;AACA,WAAW,uBAAW,8BAA8B,sBAAsB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,sBAAsB;AACjE;AACA;AACA;AACA;AACO;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C6C,YAAY;YACf;QACF;QAEA,MAAM3B,eAAe,MAAME,kCAAkCA,CAACpB;QAE9D,IAAI,CAACkB,cAAc;YACjB;QACF;YAIQA;QAFR,MAAMpG,OAAyB;YAC7B,GAAGkF,QAAQlF,IAAI;YACfqG,MAAMD,CAAAA,qBAAAA,aAAaC,IAAI,cAAjBD,gCAAAA,qBAAqBT,KAAKC,QAAQ,CAACC,MAAM;QACjD;QAEAqB,+CAA+CA,CAAC,SAASlH;QAEzD2F,KAAKqC,YAAY,CAACC,gBAAgB,CAAC7B,aAAazC,KAAK,IAAI,IAAI;YAC3DuE,MAAMV;YACN5D,MAAMwC,aAAaxC,IAAI;YACvB5D;QACF;IACF;AACF;;;ACxEA,qFAAqF;AAErF,iCAAiC;AAE+C;AAEhFuH,mBAAmBA","sources":["webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/config.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/endpoint.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/index.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/chains.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/common.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/decoded-data.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/master-copies.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/notifications.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/relay.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-apps.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-info.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/safe-messages.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/types/transactions.js","webpack://_N_E/../../node_modules/@safe-global/safe-gateway-typescript-sdk/dist/utils.js","webpack://_N_E/../../node_modules/process/browser.js","webpack://_N_E/webpack/bootstrap","webpack://_N_E/webpack/runtime/global","webpack://_N_E/../../node_modules/@firebase/util/dist/index.esm2017.js","webpack://_N_E/../../node_modules/@firebase/component/dist/esm/index.esm2017.js","webpack://_N_E/../../node_modules/@firebase/logger/dist/esm/index.esm2017.js","webpack://_N_E/../../node_modules/idb/build/wrap-idb-value.js","webpack://_N_E/../../node_modules/idb/build/index.js","webpack://_N_E/../../node_modules/@firebase/app/dist/esm/index.esm2017.js","webpack://_N_E/../../node_modules/@firebase/installations/dist/esm/index.esm2017.js","webpack://_N_E/../../node_modules/@firebase/messaging/dist/esm/index.sw.esm2017.js","webpack://_N_E/../../node_modules/firebase/messaging/sw/dist/esm/index.esm.js","webpack://_N_E/../../node_modules/firebase/app/dist/esm/index.esm.js","webpack://_N_E/./src/services/push-notifications/firebase.ts","webpack://_N_E/../../node_modules/idb-keyval/dist/index.js","webpack://_N_E/./src/config/routes.ts","webpack://_N_E/./src/service-workers/firebase-messaging/webhook-types.ts","webpack://_N_E/./src/services/push-notifications/preferences.ts","webpack://_N_E/../../node_modules/ethers/lib.esm/_version.js","webpack://_N_E/../../node_modules/ethers/lib.esm/utils/properties.js","webpack://_N_E/../../node_modules/ethers/lib.esm/utils/errors.js","webpack://_N_E/../../node_modules/ethers/lib.esm/utils/data.js","webpack://_N_E/../../node_modules/ethers/lib.esm/utils/maths.js","webpack://_N_E/../../node_modules/ethers/lib.esm/utils/fixednumber.js","webpack://_N_E/../../node_modules/ethers/lib.esm/utils/units.js","webpack://_N_E/./src/service-workers/firebase-messaging/notification-mapper.ts","webpack://_N_E/./src/service-workers/firebase-messaging/notifications.ts","webpack://_N_E/./src/services/push-notifications/tracking.ts","webpack://_N_E/./src/service-workers/firebase-messaging/firebase-messaging-sw.ts","webpack://_N_E/./src/service-workers/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DEFAULT_BASE_URL = void 0;\nexports.DEFAULT_BASE_URL = 'https://safe-client.safe.global';\n//# sourceMappingURL=config.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getEndpoint = exports.deleteEndpoint = exports.putEndpoint = exports.postEndpoint = void 0;\nconst utils_1 = require(\"./utils\");\nfunction makeUrl(baseUrl, path, pathParams, query) {\n const pathname = (0, utils_1.insertParams)(path, pathParams);\n const search = (0, utils_1.stringifyQuery)(query);\n return `${baseUrl}${pathname}${search}`;\n}\nfunction postEndpoint(baseUrl, path, params) {\n const url = makeUrl(baseUrl, path, params === null || params === void 0 ? void 0 : params.path, params === null || params === void 0 ? void 0 : params.query);\n return (0, utils_1.fetchData)(url, 'POST', params === null || params === void 0 ? void 0 : params.body, params === null || params === void 0 ? void 0 : params.headers, params === null || params === void 0 ? void 0 : params.credentials);\n}\nexports.postEndpoint = postEndpoint;\nfunction putEndpoint(baseUrl, path, params) {\n const url = makeUrl(baseUrl, path, params === null || params === void 0 ? void 0 : params.path, params === null || params === void 0 ? void 0 : params.query);\n return (0, utils_1.fetchData)(url, 'PUT', params === null || params === void 0 ? void 0 : params.body, params === null || params === void 0 ? void 0 : params.headers, params === null || params === void 0 ? void 0 : params.credentials);\n}\nexports.putEndpoint = putEndpoint;\nfunction deleteEndpoint(baseUrl, path, params) {\n const url = makeUrl(baseUrl, path, params === null || params === void 0 ? void 0 : params.path, params === null || params === void 0 ? void 0 : params.query);\n return (0, utils_1.fetchData)(url, 'DELETE', params === null || params === void 0 ? void 0 : params.body, params === null || params === void 0 ? void 0 : params.headers, params === null || params === void 0 ? void 0 : params.credentials);\n}\nexports.deleteEndpoint = deleteEndpoint;\nfunction getEndpoint(baseUrl, path, params, rawUrl) {\n if (rawUrl) {\n return (0, utils_1.getData)(rawUrl, undefined, params === null || params === void 0 ? void 0 : params.credentials);\n }\n const url = makeUrl(baseUrl, path, params === null || params === void 0 ? void 0 : params.path, params === null || params === void 0 ? void 0 : params.query);\n return (0, utils_1.getData)(url, params === null || params === void 0 ? void 0 : params.headers, params === null || params === void 0 ? void 0 : params.credentials);\n}\nexports.getEndpoint = getEndpoint;\n//# sourceMappingURL=endpoint.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getAccount = exports.createAccount = exports.verifyAuth = exports.getAuthNonce = exports.getContract = exports.getSafeOverviews = exports.unsubscribeAll = exports.unsubscribeSingle = exports.registerRecoveryModule = exports.deleteRegisteredEmail = exports.getRegisteredEmail = exports.verifyEmail = exports.resendEmailVerificationCode = exports.changeEmail = exports.registerEmail = exports.unregisterDevice = exports.unregisterSafe = exports.registerDevice = exports.getDelegates = exports.confirmSafeMessage = exports.proposeSafeMessage = exports.getSafeMessage = exports.getSafeMessages = exports.getDecodedData = exports.getMasterCopies = exports.getSafeApps = exports.getChainConfig = exports.getChainsConfig = exports.getTxPreview = exports.getConfirmationView = exports.proposeTransaction = exports.getNonces = exports.postSafeGasEstimation = exports.deleteTransaction = exports.getTransactionDetails = exports.getTransactionQueue = exports.getTransactionHistory = exports.getCollectiblesPage = exports.getCollectibles = exports.getAllOwnedSafes = exports.getOwnedSafes = exports.getFiatCurrencies = exports.getBalances = exports.getMultisigTransactions = exports.getModuleTransactions = exports.getIncomingTransfers = exports.getSafeInfo = exports.getRelayCount = exports.relayTransaction = exports.setBaseUrl = void 0;\nexports.getIndexingStatus = exports.putAccountDataSettings = exports.getAccountDataSettings = exports.getAccountDataTypes = exports.deleteAccount = void 0;\nconst endpoint_1 = require(\"./endpoint\");\nconst config_1 = require(\"./config\");\n__exportStar(require(\"./types/safe-info\"), exports);\n__exportStar(require(\"./types/safe-apps\"), exports);\n__exportStar(require(\"./types/transactions\"), exports);\n__exportStar(require(\"./types/chains\"), exports);\n__exportStar(require(\"./types/common\"), exports);\n__exportStar(require(\"./types/master-copies\"), exports);\n__exportStar(require(\"./types/decoded-data\"), exports);\n__exportStar(require(\"./types/safe-messages\"), exports);\n__exportStar(require(\"./types/notifications\"), exports);\n__exportStar(require(\"./types/relay\"), exports);\n// Can be set externally to a different CGW host\nlet baseUrl = config_1.DEFAULT_BASE_URL;\n/**\n * Set the base CGW URL\n */\nconst setBaseUrl = (url) => {\n baseUrl = url;\n};\nexports.setBaseUrl = setBaseUrl;\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/**\n * Relay a transaction from a Safe\n */\nfunction relayTransaction(chainId, body) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/chains/{chainId}/relay', { path: { chainId }, body });\n}\nexports.relayTransaction = relayTransaction;\n/**\n * Get the relay limit and number of remaining relays remaining\n */\nfunction getRelayCount(chainId, address) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/relay/{address}', { path: { chainId, address } });\n}\nexports.getRelayCount = getRelayCount;\n/**\n * Get basic information about a Safe. E.g. owners, modules, version etc\n */\nfunction getSafeInfo(chainId, address) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{address}', { path: { chainId, address } });\n}\nexports.getSafeInfo = getSafeInfo;\n/**\n * Get filterable list of incoming transactions\n */\nfunction getIncomingTransfers(chainId, address, query, pageUrl) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{address}/incoming-transfers/', {\n path: { chainId, address },\n query,\n }, pageUrl);\n}\nexports.getIncomingTransfers = getIncomingTransfers;\n/**\n * Get filterable list of module transactions\n */\nfunction getModuleTransactions(chainId, address, query, pageUrl) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{address}/module-transactions/', {\n path: { chainId, address },\n query,\n }, pageUrl);\n}\nexports.getModuleTransactions = getModuleTransactions;\n/**\n * Get filterable list of multisig transactions\n */\nfunction getMultisigTransactions(chainId, address, query, pageUrl) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{address}/multisig-transactions/', {\n path: { chainId, address },\n query,\n }, pageUrl);\n}\nexports.getMultisigTransactions = getMultisigTransactions;\n/**\n * Get the total balance and all assets stored in a Safe\n */\nfunction getBalances(chainId, address, currency = 'usd', query = {}) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{address}/balances/{currency}', {\n path: { chainId, address, currency },\n query,\n });\n}\nexports.getBalances = getBalances;\n/**\n * Get a list of supported fiat currencies (e.g. USD, EUR etc)\n */\nfunction getFiatCurrencies() {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/balances/supported-fiat-codes');\n}\nexports.getFiatCurrencies = getFiatCurrencies;\n/**\n * Get the addresses of all Safes belonging to an owner\n */\nfunction getOwnedSafes(chainId, address) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/owners/{address}/safes', { path: { chainId, address } });\n}\nexports.getOwnedSafes = getOwnedSafes;\n/**\n * Get the addresses of all Safes belonging to an owner on all chains\n */\nfunction getAllOwnedSafes(address) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/owners/{address}/safes', { path: { address } });\n}\nexports.getAllOwnedSafes = getAllOwnedSafes;\n/**\n * Get NFTs stored in a Safe\n */\nfunction getCollectibles(chainId, address, query = {}) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{address}/collectibles', {\n path: { chainId, address },\n query,\n });\n}\nexports.getCollectibles = getCollectibles;\n/**\n * Get NFTs stored in a Safe\n */\nfunction getCollectiblesPage(chainId, address, query = {}, pageUrl) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v2/chains/{chainId}/safes/{address}/collectibles', { path: { chainId, address }, query }, pageUrl);\n}\nexports.getCollectiblesPage = getCollectiblesPage;\n/**\n * Get a list of past Safe transactions\n */\nfunction getTransactionHistory(chainId, address, query = {}, pageUrl) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/transactions/history', { path: { chainId, safe_address: address }, query }, pageUrl);\n}\nexports.getTransactionHistory = getTransactionHistory;\n/**\n * Get the list of pending transactions\n */\nfunction getTransactionQueue(chainId, address, query = {}, pageUrl) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/transactions/queued', { path: { chainId, safe_address: address }, query }, pageUrl);\n}\nexports.getTransactionQueue = getTransactionQueue;\n/**\n * Get the details of an individual transaction by its id\n */\nfunction getTransactionDetails(chainId, transactionId) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/transactions/{transactionId}', {\n path: { chainId, transactionId },\n });\n}\nexports.getTransactionDetails = getTransactionDetails;\n/**\n * Delete a transaction by its safeTxHash\n */\nfunction deleteTransaction(chainId, safeTxHash, signature) {\n return (0, endpoint_1.deleteEndpoint)(baseUrl, '/v1/chains/{chainId}/transactions/{safeTxHash}', {\n path: { chainId, safeTxHash },\n body: { signature },\n });\n}\nexports.deleteTransaction = deleteTransaction;\n/**\n * Request a gas estimate & recommmended tx nonce for a created transaction\n */\nfunction postSafeGasEstimation(chainId, address, body) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations', {\n path: { chainId, safe_address: address },\n body,\n });\n}\nexports.postSafeGasEstimation = postSafeGasEstimation;\nfunction getNonces(chainId, address) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/nonces', {\n path: { chainId, safe_address: address },\n });\n}\nexports.getNonces = getNonces;\n/**\n * Propose a new transaction for other owners to sign/execute\n */\nfunction proposeTransaction(chainId, address, body) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/chains/{chainId}/transactions/{safe_address}/propose', {\n path: { chainId, safe_address: address },\n body,\n });\n}\nexports.proposeTransaction = proposeTransaction;\n/**\n * Returns decoded data\n */\nfunction getConfirmationView(chainId, safeAddress, operation, data, to, value) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/views/transaction-confirmation', {\n path: { chainId, safe_address: safeAddress },\n body: { operation, data, to, value },\n });\n}\nexports.getConfirmationView = getConfirmationView;\n/**\n * Get a tx preview\n */\nfunction getTxPreview(chainId, safeAddress, operation, data, to, value) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/chains/{chainId}/transactions/{safe_address}/preview', {\n path: { chainId, safe_address: safeAddress },\n body: { operation, data, to, value },\n });\n}\nexports.getTxPreview = getTxPreview;\n/**\n * Returns all defined chain configs\n */\nfunction getChainsConfig(query) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains', {\n query,\n });\n}\nexports.getChainsConfig = getChainsConfig;\n/**\n * Returns a chain config\n */\nfunction getChainConfig(chainId) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}', {\n path: { chainId: chainId },\n });\n}\nexports.getChainConfig = getChainConfig;\n/**\n * Returns Safe Apps List\n */\nfunction getSafeApps(chainId, query = {}) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safe-apps', {\n path: { chainId: chainId },\n query,\n });\n}\nexports.getSafeApps = getSafeApps;\n/**\n * Returns list of Master Copies\n */\nfunction getMasterCopies(chainId) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/about/master-copies', {\n path: { chainId: chainId },\n });\n}\nexports.getMasterCopies = getMasterCopies;\n/**\n * Returns decoded data\n */\nfunction getDecodedData(chainId, operation, encodedData, to) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/chains/{chainId}/data-decoder', {\n path: { chainId: chainId },\n body: { operation, data: encodedData, to },\n });\n}\nexports.getDecodedData = getDecodedData;\n/**\n * Returns list of `SafeMessage`s\n */\nfunction getSafeMessages(chainId, address, pageUrl) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/messages', { path: { chainId, safe_address: address }, query: {} }, pageUrl);\n}\nexports.getSafeMessages = getSafeMessages;\n/**\n * Returns a `SafeMessage`\n */\nfunction getSafeMessage(chainId, messageHash) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/messages/{message_hash}', {\n path: { chainId, message_hash: messageHash },\n });\n}\nexports.getSafeMessage = getSafeMessage;\n/**\n * Propose a new `SafeMessage` for other owners to sign\n */\nfunction proposeSafeMessage(chainId, address, body) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/messages', {\n path: { chainId, safe_address: address },\n body,\n });\n}\nexports.proposeSafeMessage = proposeSafeMessage;\n/**\n * Add a confirmation to a `SafeMessage`\n */\nfunction confirmSafeMessage(chainId, messageHash, body) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/chains/{chainId}/messages/{message_hash}/signatures', {\n path: { chainId, message_hash: messageHash },\n body,\n });\n}\nexports.confirmSafeMessage = confirmSafeMessage;\n/**\n * Returns a list of delegates\n */\nfunction getDelegates(chainId, query = {}) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v2/chains/{chainId}/delegates', {\n path: { chainId },\n query,\n });\n}\nexports.getDelegates = getDelegates;\n/**\n * Registers a device/Safe for notifications\n */\nfunction registerDevice(body) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/register/notifications', {\n body,\n });\n}\nexports.registerDevice = registerDevice;\n/**\n * Unregisters a Safe from notifications\n */\nfunction unregisterSafe(chainId, address, uuid) {\n return (0, endpoint_1.deleteEndpoint)(baseUrl, '/v1/chains/{chainId}/notifications/devices/{uuid}/safes/{safe_address}', {\n path: { chainId, safe_address: address, uuid },\n });\n}\nexports.unregisterSafe = unregisterSafe;\n/**\n * Unregisters a device from notifications\n */\nfunction unregisterDevice(chainId, uuid) {\n return (0, endpoint_1.deleteEndpoint)(baseUrl, '/v1/chains/{chainId}/notifications/devices/{uuid}', {\n path: { chainId, uuid },\n });\n}\nexports.unregisterDevice = unregisterDevice;\n/**\n * Registers a email address for a safe signer.\n *\n * The signer wallet has to sign a message of format: `email-register-{chainId}-{safeAddress}-{emailAddress}-{signer}-{timestamp}`\n * The signature is valid for 5 minutes.\n *\n * @param chainId\n * @param safeAddress\n * @param body Signer address and email address\n * @param headers Signature and Signature timestamp\n * @returns 200 if signature matches the data\n */\nfunction registerEmail(chainId, safeAddress, body, headers) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/emails', {\n path: { chainId, safe_address: safeAddress },\n body,\n headers,\n });\n}\nexports.registerEmail = registerEmail;\n/**\n * Changes an already registered email address for a safe signer. The new email address still needs to be verified.\n *\n * The signer wallet has to sign a message of format: `email-edit-{chainId}-{safeAddress}-{emailAddress}-{signer}-{timestamp}`\n * The signature is valid for 5 minutes.\n *\n * @param chainId\n * @param safeAddress\n * @param signerAddress\n * @param body New email address\n * @param headers Signature and Signature timestamp\n * @returns 202 if signature matches the data\n */\nfunction changeEmail(chainId, safeAddress, signerAddress, body, headers) {\n return (0, endpoint_1.putEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}', {\n path: { chainId, safe_address: safeAddress, signer: signerAddress },\n body,\n headers,\n });\n}\nexports.changeEmail = changeEmail;\n/**\n * Resends an email verification code.\n */\nfunction resendEmailVerificationCode(chainId, safeAddress, signerAddress) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify-resend', {\n path: { chainId, safe_address: safeAddress, signer: signerAddress },\n body: '',\n });\n}\nexports.resendEmailVerificationCode = resendEmailVerificationCode;\n/**\n * Verifies a pending email address registration.\n *\n * @param chainId\n * @param safeAddress\n * @param signerAddress address who signed the email registration\n * @param body Verification code\n */\nfunction verifyEmail(chainId, safeAddress, signerAddress, body) {\n return (0, endpoint_1.putEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify', {\n path: { chainId, safe_address: safeAddress, signer: signerAddress },\n body,\n });\n}\nexports.verifyEmail = verifyEmail;\n/**\n * Gets the registered email address of the signer\n *\n * The signer wallet will have to sign a message of format: `email-retrieval-{chainId}-{safe}-{signer}-{timestamp}`\n * The signature is valid for 5 minutes.\n *\n * @param chainId\n * @param safeAddress\n * @param signerAddress address of the owner of the Safe\n *\n * @returns email address and verified flag\n */\nfunction getRegisteredEmail(chainId, safeAddress, signerAddress, headers) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}', {\n path: { chainId, safe_address: safeAddress, signer: signerAddress },\n headers,\n });\n}\nexports.getRegisteredEmail = getRegisteredEmail;\n/**\n * Delete a registered email address for the signer\n *\n * The signer wallet will have to sign a message of format: `email-delete-{chainId}-{safe}-{signer}-{timestamp}`\n * The signature is valid for 5 minutes.\n *\n * @param chainId\n * @param safeAddress\n * @param signerAddress\n * @param headers\n */\nfunction deleteRegisteredEmail(chainId, safeAddress, signerAddress, headers) {\n return (0, endpoint_1.deleteEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}', {\n path: { chainId, safe_address: safeAddress, signer: signerAddress },\n headers,\n });\n}\nexports.deleteRegisteredEmail = deleteRegisteredEmail;\n/**\n * Register a recovery module for receiving alerts\n * @param chainId\n * @param safeAddress\n * @param body - { moduleAddress: string }\n */\nfunction registerRecoveryModule(chainId, safeAddress, body) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/recovery', {\n path: { chainId, safe_address: safeAddress },\n body,\n });\n}\nexports.registerRecoveryModule = registerRecoveryModule;\n/**\n * Delete email subscription for a single category\n * @param query\n */\nfunction unsubscribeSingle(query) {\n return (0, endpoint_1.deleteEndpoint)(baseUrl, '/v1/subscriptions', { query });\n}\nexports.unsubscribeSingle = unsubscribeSingle;\n/**\n * Delete email subscription for all categories\n * @param query\n */\nfunction unsubscribeAll(query) {\n return (0, endpoint_1.deleteEndpoint)(baseUrl, '/v1/subscriptions/all', { query });\n}\nexports.unsubscribeAll = unsubscribeAll;\n/**\n * Get Safe overviews per address\n */\nfunction getSafeOverviews(safes, query) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/safes', {\n query: Object.assign(Object.assign({}, query), { safes: safes.join(',') }),\n });\n}\nexports.getSafeOverviews = getSafeOverviews;\nfunction getContract(chainId, contractAddress) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/contracts/{contractAddress}', {\n path: {\n chainId: chainId,\n contractAddress: contractAddress,\n },\n });\n}\nexports.getContract = getContract;\nfunction getAuthNonce() {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/auth/nonce', { credentials: 'include' });\n}\nexports.getAuthNonce = getAuthNonce;\nfunction verifyAuth(body) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/auth/verify', {\n body,\n credentials: 'include',\n });\n}\nexports.verifyAuth = verifyAuth;\nfunction createAccount(body) {\n return (0, endpoint_1.postEndpoint)(baseUrl, '/v1/accounts', {\n body,\n credentials: 'include',\n });\n}\nexports.createAccount = createAccount;\nfunction getAccount(address) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/accounts/{address}', {\n path: { address },\n credentials: 'include',\n });\n}\nexports.getAccount = getAccount;\nfunction deleteAccount(address) {\n return (0, endpoint_1.deleteEndpoint)(baseUrl, '/v1/accounts/{address}', {\n path: { address },\n credentials: 'include',\n });\n}\nexports.deleteAccount = deleteAccount;\nfunction getAccountDataTypes() {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/accounts/data-types');\n}\nexports.getAccountDataTypes = getAccountDataTypes;\nfunction getAccountDataSettings(address) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/accounts/{address}/data-settings', {\n path: { address },\n credentials: 'include',\n });\n}\nexports.getAccountDataSettings = getAccountDataSettings;\nfunction putAccountDataSettings(address, body) {\n return (0, endpoint_1.putEndpoint)(baseUrl, '/v1/accounts/{address}/data-settings', {\n path: { address },\n body,\n credentials: 'include',\n });\n}\nexports.putAccountDataSettings = putAccountDataSettings;\nfunction getIndexingStatus(chainId) {\n return (0, endpoint_1.getEndpoint)(baseUrl, '/v1/chains/{chainId}/about/indexing', {\n path: { chainId },\n });\n}\nexports.getIndexingStatus = getIndexingStatus;\n/* eslint-enable @typescript-eslint/explicit-module-boundary-types */\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FEATURES = exports.GAS_PRICE_TYPE = exports.RPC_AUTHENTICATION = void 0;\nvar RPC_AUTHENTICATION;\n(function (RPC_AUTHENTICATION) {\n RPC_AUTHENTICATION[\"API_KEY_PATH\"] = \"API_KEY_PATH\";\n RPC_AUTHENTICATION[\"NO_AUTHENTICATION\"] = \"NO_AUTHENTICATION\";\n RPC_AUTHENTICATION[\"UNKNOWN\"] = \"UNKNOWN\";\n})(RPC_AUTHENTICATION = exports.RPC_AUTHENTICATION || (exports.RPC_AUTHENTICATION = {}));\nvar GAS_PRICE_TYPE;\n(function (GAS_PRICE_TYPE) {\n GAS_PRICE_TYPE[\"ORACLE\"] = \"ORACLE\";\n GAS_PRICE_TYPE[\"FIXED\"] = \"FIXED\";\n GAS_PRICE_TYPE[\"FIXED_1559\"] = \"FIXED1559\";\n GAS_PRICE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n})(GAS_PRICE_TYPE = exports.GAS_PRICE_TYPE || (exports.GAS_PRICE_TYPE = {}));\nvar FEATURES;\n(function (FEATURES) {\n FEATURES[\"ERC721\"] = \"ERC721\";\n FEATURES[\"SAFE_APPS\"] = \"SAFE_APPS\";\n FEATURES[\"CONTRACT_INTERACTION\"] = \"CONTRACT_INTERACTION\";\n FEATURES[\"DOMAIN_LOOKUP\"] = \"DOMAIN_LOOKUP\";\n FEATURES[\"SPENDING_LIMIT\"] = \"SPENDING_LIMIT\";\n FEATURES[\"EIP1559\"] = \"EIP1559\";\n FEATURES[\"SAFE_TX_GAS_OPTIONAL\"] = \"SAFE_TX_GAS_OPTIONAL\";\n FEATURES[\"TX_SIMULATION\"] = \"TX_SIMULATION\";\n FEATURES[\"EIP1271\"] = \"EIP1271\";\n})(FEATURES = exports.FEATURES || (exports.FEATURES = {}));\n//# sourceMappingURL=chains.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TokenType = void 0;\nvar TokenType;\n(function (TokenType) {\n TokenType[\"ERC20\"] = \"ERC20\";\n TokenType[\"ERC721\"] = \"ERC721\";\n TokenType[\"NATIVE_TOKEN\"] = \"NATIVE_TOKEN\";\n})(TokenType = exports.TokenType || (exports.TokenType = {}));\n//# sourceMappingURL=common.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NativeStakingStatus = exports.ConfirmationViewTypes = void 0;\nvar ConfirmationViewTypes;\n(function (ConfirmationViewTypes) {\n ConfirmationViewTypes[\"GENERIC\"] = \"GENERIC\";\n ConfirmationViewTypes[\"COW_SWAP_ORDER\"] = \"COW_SWAP_ORDER\";\n ConfirmationViewTypes[\"COW_SWAP_TWAP_ORDER\"] = \"COW_SWAP_TWAP_ORDER\";\n ConfirmationViewTypes[\"KILN_NATIVE_STAKING_DEPOSIT\"] = \"KILN_NATIVE_STAKING_DEPOSIT\";\n ConfirmationViewTypes[\"KILN_NATIVE_STAKING_VALIDATORS_EXIT\"] = \"KILN_NATIVE_STAKING_VALIDATORS_EXIT\";\n ConfirmationViewTypes[\"KILN_NATIVE_STAKING_WITHDRAW\"] = \"KILN_NATIVE_STAKING_WITHDRAW\";\n})(ConfirmationViewTypes = exports.ConfirmationViewTypes || (exports.ConfirmationViewTypes = {}));\nvar NativeStakingStatus;\n(function (NativeStakingStatus) {\n NativeStakingStatus[\"NOT_STAKED\"] = \"NOT_STAKED\";\n NativeStakingStatus[\"ACTIVATING\"] = \"ACTIVATING\";\n NativeStakingStatus[\"DEPOSIT_IN_PROGRESS\"] = \"DEPOSIT_IN_PROGRESS\";\n NativeStakingStatus[\"ACTIVE\"] = \"ACTIVE\";\n NativeStakingStatus[\"EXIT_REQUESTED\"] = \"EXIT_REQUESTED\";\n NativeStakingStatus[\"EXITING\"] = \"EXITING\";\n NativeStakingStatus[\"EXITED\"] = \"EXITED\";\n NativeStakingStatus[\"SLASHED\"] = \"SLASHED\";\n})(NativeStakingStatus = exports.NativeStakingStatus || (exports.NativeStakingStatus = {}));\n//# sourceMappingURL=decoded-data.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=master-copies.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DeviceType = void 0;\nvar DeviceType;\n(function (DeviceType) {\n DeviceType[\"ANDROID\"] = \"ANDROID\";\n DeviceType[\"IOS\"] = \"IOS\";\n DeviceType[\"WEB\"] = \"WEB\";\n})(DeviceType = exports.DeviceType || (exports.DeviceType = {}));\n//# sourceMappingURL=notifications.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=relay.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SafeAppSocialPlatforms = exports.SafeAppFeatures = exports.SafeAppAccessPolicyTypes = void 0;\nvar SafeAppAccessPolicyTypes;\n(function (SafeAppAccessPolicyTypes) {\n SafeAppAccessPolicyTypes[\"NoRestrictions\"] = \"NO_RESTRICTIONS\";\n SafeAppAccessPolicyTypes[\"DomainAllowlist\"] = \"DOMAIN_ALLOWLIST\";\n})(SafeAppAccessPolicyTypes = exports.SafeAppAccessPolicyTypes || (exports.SafeAppAccessPolicyTypes = {}));\nvar SafeAppFeatures;\n(function (SafeAppFeatures) {\n SafeAppFeatures[\"BATCHED_TRANSACTIONS\"] = \"BATCHED_TRANSACTIONS\";\n})(SafeAppFeatures = exports.SafeAppFeatures || (exports.SafeAppFeatures = {}));\nvar SafeAppSocialPlatforms;\n(function (SafeAppSocialPlatforms) {\n SafeAppSocialPlatforms[\"TWITTER\"] = \"TWITTER\";\n SafeAppSocialPlatforms[\"GITHUB\"] = \"GITHUB\";\n SafeAppSocialPlatforms[\"DISCORD\"] = \"DISCORD\";\n SafeAppSocialPlatforms[\"TELEGRAM\"] = \"TELEGRAM\";\n})(SafeAppSocialPlatforms = exports.SafeAppSocialPlatforms || (exports.SafeAppSocialPlatforms = {}));\n//# sourceMappingURL=safe-apps.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ImplementationVersionState = void 0;\nvar ImplementationVersionState;\n(function (ImplementationVersionState) {\n ImplementationVersionState[\"UP_TO_DATE\"] = \"UP_TO_DATE\";\n ImplementationVersionState[\"OUTDATED\"] = \"OUTDATED\";\n ImplementationVersionState[\"UNKNOWN\"] = \"UNKNOWN\";\n})(ImplementationVersionState = exports.ImplementationVersionState || (exports.ImplementationVersionState = {}));\n//# sourceMappingURL=safe-info.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SafeMessageStatus = exports.SafeMessageListItemType = void 0;\nvar SafeMessageListItemType;\n(function (SafeMessageListItemType) {\n SafeMessageListItemType[\"DATE_LABEL\"] = \"DATE_LABEL\";\n SafeMessageListItemType[\"MESSAGE\"] = \"MESSAGE\";\n})(SafeMessageListItemType = exports.SafeMessageListItemType || (exports.SafeMessageListItemType = {}));\nvar SafeMessageStatus;\n(function (SafeMessageStatus) {\n SafeMessageStatus[\"NEEDS_CONFIRMATION\"] = \"NEEDS_CONFIRMATION\";\n SafeMessageStatus[\"CONFIRMED\"] = \"CONFIRMED\";\n})(SafeMessageStatus = exports.SafeMessageStatus || (exports.SafeMessageStatus = {}));\n//# sourceMappingURL=safe-messages.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LabelValue = exports.StartTimeValue = exports.DurationType = exports.DetailedExecutionInfoType = exports.TransactionListItemType = exports.ConflictType = exports.TransactionInfoType = exports.SettingsInfoType = exports.TransactionTokenType = exports.TransferDirection = exports.TransactionStatus = exports.Operation = void 0;\nvar Operation;\n(function (Operation) {\n Operation[Operation[\"CALL\"] = 0] = \"CALL\";\n Operation[Operation[\"DELEGATE\"] = 1] = \"DELEGATE\";\n})(Operation = exports.Operation || (exports.Operation = {}));\nvar TransactionStatus;\n(function (TransactionStatus) {\n TransactionStatus[\"AWAITING_CONFIRMATIONS\"] = \"AWAITING_CONFIRMATIONS\";\n TransactionStatus[\"AWAITING_EXECUTION\"] = \"AWAITING_EXECUTION\";\n TransactionStatus[\"CANCELLED\"] = \"CANCELLED\";\n TransactionStatus[\"FAILED\"] = \"FAILED\";\n TransactionStatus[\"SUCCESS\"] = \"SUCCESS\";\n})(TransactionStatus = exports.TransactionStatus || (exports.TransactionStatus = {}));\nvar TransferDirection;\n(function (TransferDirection) {\n TransferDirection[\"INCOMING\"] = \"INCOMING\";\n TransferDirection[\"OUTGOING\"] = \"OUTGOING\";\n TransferDirection[\"UNKNOWN\"] = \"UNKNOWN\";\n})(TransferDirection = exports.TransferDirection || (exports.TransferDirection = {}));\nvar TransactionTokenType;\n(function (TransactionTokenType) {\n TransactionTokenType[\"ERC20\"] = \"ERC20\";\n TransactionTokenType[\"ERC721\"] = \"ERC721\";\n TransactionTokenType[\"NATIVE_COIN\"] = \"NATIVE_COIN\";\n})(TransactionTokenType = exports.TransactionTokenType || (exports.TransactionTokenType = {}));\nvar SettingsInfoType;\n(function (SettingsInfoType) {\n SettingsInfoType[\"SET_FALLBACK_HANDLER\"] = \"SET_FALLBACK_HANDLER\";\n SettingsInfoType[\"ADD_OWNER\"] = \"ADD_OWNER\";\n SettingsInfoType[\"REMOVE_OWNER\"] = \"REMOVE_OWNER\";\n SettingsInfoType[\"SWAP_OWNER\"] = \"SWAP_OWNER\";\n SettingsInfoType[\"CHANGE_THRESHOLD\"] = \"CHANGE_THRESHOLD\";\n SettingsInfoType[\"CHANGE_IMPLEMENTATION\"] = \"CHANGE_IMPLEMENTATION\";\n SettingsInfoType[\"ENABLE_MODULE\"] = \"ENABLE_MODULE\";\n SettingsInfoType[\"DISABLE_MODULE\"] = \"DISABLE_MODULE\";\n SettingsInfoType[\"SET_GUARD\"] = \"SET_GUARD\";\n SettingsInfoType[\"DELETE_GUARD\"] = \"DELETE_GUARD\";\n})(SettingsInfoType = exports.SettingsInfoType || (exports.SettingsInfoType = {}));\nvar TransactionInfoType;\n(function (TransactionInfoType) {\n TransactionInfoType[\"TRANSFER\"] = \"Transfer\";\n TransactionInfoType[\"SETTINGS_CHANGE\"] = \"SettingsChange\";\n TransactionInfoType[\"CUSTOM\"] = \"Custom\";\n TransactionInfoType[\"CREATION\"] = \"Creation\";\n TransactionInfoType[\"SWAP_ORDER\"] = \"SwapOrder\";\n TransactionInfoType[\"TWAP_ORDER\"] = \"TwapOrder\";\n TransactionInfoType[\"SWAP_TRANSFER\"] = \"SwapTransfer\";\n TransactionInfoType[\"NATIVE_STAKING_DEPOSIT\"] = \"NativeStakingDeposit\";\n TransactionInfoType[\"NATIVE_STAKING_VALIDATORS_EXIT\"] = \"NativeStakingValidatorsExit\";\n TransactionInfoType[\"NATIVE_STAKING_WITHDRAW\"] = \"NativeStakingWithdraw\";\n})(TransactionInfoType = exports.TransactionInfoType || (exports.TransactionInfoType = {}));\nvar ConflictType;\n(function (ConflictType) {\n ConflictType[\"NONE\"] = \"None\";\n ConflictType[\"HAS_NEXT\"] = \"HasNext\";\n ConflictType[\"END\"] = \"End\";\n})(ConflictType = exports.ConflictType || (exports.ConflictType = {}));\nvar TransactionListItemType;\n(function (TransactionListItemType) {\n TransactionListItemType[\"TRANSACTION\"] = \"TRANSACTION\";\n TransactionListItemType[\"LABEL\"] = \"LABEL\";\n TransactionListItemType[\"CONFLICT_HEADER\"] = \"CONFLICT_HEADER\";\n TransactionListItemType[\"DATE_LABEL\"] = \"DATE_LABEL\";\n})(TransactionListItemType = exports.TransactionListItemType || (exports.TransactionListItemType = {}));\nvar DetailedExecutionInfoType;\n(function (DetailedExecutionInfoType) {\n DetailedExecutionInfoType[\"MULTISIG\"] = \"MULTISIG\";\n DetailedExecutionInfoType[\"MODULE\"] = \"MODULE\";\n})(DetailedExecutionInfoType = exports.DetailedExecutionInfoType || (exports.DetailedExecutionInfoType = {}));\nvar DurationType;\n(function (DurationType) {\n DurationType[\"AUTO\"] = \"AUTO\";\n DurationType[\"LIMIT_DURATION\"] = \"LIMIT_DURATION\";\n})(DurationType = exports.DurationType || (exports.DurationType = {}));\nvar StartTimeValue;\n(function (StartTimeValue) {\n StartTimeValue[\"AT_MINING_TIME\"] = \"AT_MINING_TIME\";\n StartTimeValue[\"AT_EPOCH\"] = \"AT_EPOCH\";\n})(StartTimeValue = exports.StartTimeValue || (exports.StartTimeValue = {}));\nvar LabelValue;\n(function (LabelValue) {\n LabelValue[\"Queued\"] = \"Queued\";\n LabelValue[\"Next\"] = \"Next\";\n})(LabelValue = exports.LabelValue || (exports.LabelValue = {}));\n//# sourceMappingURL=transactions.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getData = exports.fetchData = exports.stringifyQuery = exports.insertParams = void 0;\nconst isErrorResponse = (data) => {\n const isObject = typeof data === 'object' && data !== null;\n return isObject && 'code' in data && 'message' in data;\n};\nfunction replaceParam(str, key, value) {\n return str.replace(new RegExp(`\\\\{${key}\\\\}`, 'g'), value);\n}\nfunction insertParams(template, params) {\n return params\n ? Object.keys(params).reduce((result, key) => {\n return replaceParam(result, key, String(params[key]));\n }, template)\n : template;\n}\nexports.insertParams = insertParams;\nfunction stringifyQuery(query) {\n if (!query) {\n return '';\n }\n const searchParams = new URLSearchParams();\n Object.keys(query).forEach((key) => {\n if (query[key] != null) {\n searchParams.append(key, String(query[key]));\n }\n });\n const searchString = searchParams.toString();\n return searchString ? `?${searchString}` : '';\n}\nexports.stringifyQuery = stringifyQuery;\nfunction parseResponse(resp) {\n return __awaiter(this, void 0, void 0, function* () {\n let json;\n try {\n json = yield resp.json();\n }\n catch (_a) {\n json = {};\n }\n if (!resp.ok) {\n const errTxt = isErrorResponse(json)\n ? `CGW error - ${json.code}: ${json.message}`\n : `CGW error - status ${resp.statusText}`;\n throw new Error(errTxt);\n }\n return json;\n });\n}\nfunction fetchData(url, method, body, headers, credentials) {\n return __awaiter(this, void 0, void 0, function* () {\n const requestHeaders = Object.assign({ 'Content-Type': 'application/json' }, headers);\n const options = {\n method: method !== null && method !== void 0 ? method : 'POST',\n headers: requestHeaders,\n };\n if (credentials) {\n options['credentials'] = credentials;\n }\n if (body != null) {\n options.body = typeof body === 'string' ? body : JSON.stringify(body);\n }\n const resp = yield fetch(url, options);\n return parseResponse(resp);\n });\n}\nexports.fetchData = fetchData;\nfunction getData(url, headers, credentials) {\n return __awaiter(this, void 0, void 0, function* () {\n const options = {\n method: 'GET',\n };\n if (headers) {\n options['headers'] = Object.assign(Object.assign({}, headers), { 'Content-Type': 'application/json' });\n }\n if (credentials) {\n options['credentials'] = credentials;\n }\n const resp = yield fetch(url, options);\n return parseResponse(resp);\n });\n}\nexports.getData = getData;\n//# sourceMappingURL=utils.js.map","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// 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\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\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})();","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time.\n */\nconst CONSTANTS = {\n /**\n * @define {boolean} Whether this is the client Node.js SDK.\n */\n NODE_CLIENT: false,\n /**\n * @define {boolean} Whether this is the Admin Node.js SDK.\n */\n NODE_ADMIN: false,\n /**\n * Firebase SDK Version\n */\n SDK_VERSION: '${JSCORE_VERSION}'\n};\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Throws an error if the provided assertion is falsy\n */\nconst assert = function (assertion, message) {\n if (!assertion) {\n throw assertionError(message);\n }\n};\n/**\n * Returns an Error object suitable for throwing.\n */\nconst assertionError = function (message) {\n return new Error('Firebase Database (' +\n CONSTANTS.SDK_VERSION +\n ') INTERNAL ASSERT FAILED: ' +\n message);\n};\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst stringToByteArray$1 = function (str) {\n // TODO(user): Use native implementations if/when available\n const out = [];\n let p = 0;\n for (let i = 0; i < str.length; i++) {\n let c = str.charCodeAt(i);\n if (c < 128) {\n out[p++] = c;\n }\n else if (c < 2048) {\n out[p++] = (c >> 6) | 192;\n out[p++] = (c & 63) | 128;\n }\n else if ((c & 0xfc00) === 0xd800 &&\n i + 1 < str.length &&\n (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n // Surrogate Pair\n c = 0x10000 + ((c & 0x03ff) << 10) + (str.charCodeAt(++i) & 0x03ff);\n out[p++] = (c >> 18) | 240;\n out[p++] = ((c >> 12) & 63) | 128;\n out[p++] = ((c >> 6) & 63) | 128;\n out[p++] = (c & 63) | 128;\n }\n else {\n out[p++] = (c >> 12) | 224;\n out[p++] = ((c >> 6) & 63) | 128;\n out[p++] = (c & 63) | 128;\n }\n }\n return out;\n};\n/**\n * Turns an array of numbers into the string given by the concatenation of the\n * characters to which the numbers correspond.\n * @param bytes Array of numbers representing characters.\n * @return Stringification of the array.\n */\nconst byteArrayToString = function (bytes) {\n // TODO(user): Use native implementations if/when available\n const out = [];\n let pos = 0, c = 0;\n while (pos < bytes.length) {\n const c1 = bytes[pos++];\n if (c1 < 128) {\n out[c++] = String.fromCharCode(c1);\n }\n else if (c1 > 191 && c1 < 224) {\n const c2 = bytes[pos++];\n out[c++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));\n }\n else if (c1 > 239 && c1 < 365) {\n // Surrogate Pair\n const c2 = bytes[pos++];\n const c3 = bytes[pos++];\n const c4 = bytes[pos++];\n const u = (((c1 & 7) << 18) | ((c2 & 63) << 12) | ((c3 & 63) << 6) | (c4 & 63)) -\n 0x10000;\n out[c++] = String.fromCharCode(0xd800 + (u >> 10));\n out[c++] = String.fromCharCode(0xdc00 + (u & 1023));\n }\n else {\n const c2 = bytes[pos++];\n const c3 = bytes[pos++];\n out[c++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n }\n }\n return out.join('');\n};\n// We define it as an object literal instead of a class because a class compiled down to es5 can't\n// be treeshaked. https://github.com/rollup/rollup/issues/1691\n// Static lookup maps, lazily populated by init_()\n// TODO(dlarocque): Define this as a class, since we no longer target ES5.\nconst base64 = {\n /**\n * Maps bytes to characters.\n */\n byteToCharMap_: null,\n /**\n * Maps characters to bytes.\n */\n charToByteMap_: null,\n /**\n * Maps bytes to websafe characters.\n * @private\n */\n byteToCharMapWebSafe_: null,\n /**\n * Maps websafe characters to bytes.\n * @private\n */\n charToByteMapWebSafe_: null,\n /**\n * Our default alphabet, shared between\n * ENCODED_VALS and ENCODED_VALS_WEBSAFE\n */\n ENCODED_VALS_BASE: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789',\n /**\n * Our default alphabet. Value 64 (=) is special; it means \"nothing.\"\n */\n get ENCODED_VALS() {\n return this.ENCODED_VALS_BASE + '+/=';\n },\n /**\n * Our websafe alphabet.\n */\n get ENCODED_VALS_WEBSAFE() {\n return this.ENCODED_VALS_BASE + '-_.';\n },\n /**\n * Whether this browser supports the atob and btoa functions. This extension\n * started at Mozilla but is now implemented by many browsers. We use the\n * ASSUME_* variables to avoid pulling in the full useragent detection library\n * but still allowing the standard per-browser compilations.\n *\n */\n HAS_NATIVE_SUPPORT: typeof atob === 'function',\n /**\n * Base64-encode an array of bytes.\n *\n * @param input An array of bytes (numbers with\n * value in [0, 255]) to encode.\n * @param webSafe Boolean indicating we should use the\n * alternative alphabet.\n * @return The base64 encoded string.\n */\n encodeByteArray(input, webSafe) {\n if (!Array.isArray(input)) {\n throw Error('encodeByteArray takes an array as a parameter');\n }\n this.init_();\n const byteToCharMap = webSafe\n ? this.byteToCharMapWebSafe_\n : this.byteToCharMap_;\n const output = [];\n for (let i = 0; i < input.length; i += 3) {\n const byte1 = input[i];\n const haveByte2 = i + 1 < input.length;\n const byte2 = haveByte2 ? input[i + 1] : 0;\n const haveByte3 = i + 2 < input.length;\n const byte3 = haveByte3 ? input[i + 2] : 0;\n const outByte1 = byte1 >> 2;\n const outByte2 = ((byte1 & 0x03) << 4) | (byte2 >> 4);\n let outByte3 = ((byte2 & 0x0f) << 2) | (byte3 >> 6);\n let outByte4 = byte3 & 0x3f;\n if (!haveByte3) {\n outByte4 = 64;\n if (!haveByte2) {\n outByte3 = 64;\n }\n }\n output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);\n }\n return output.join('');\n },\n /**\n * Base64-encode a string.\n *\n * @param input A string to encode.\n * @param webSafe If true, we should use the\n * alternative alphabet.\n * @return The base64 encoded string.\n */\n encodeString(input, webSafe) {\n // Shortcut for Mozilla browsers that implement\n // a native base64 encoder in the form of \"btoa/atob\"\n if (this.HAS_NATIVE_SUPPORT && !webSafe) {\n return btoa(input);\n }\n return this.encodeByteArray(stringToByteArray$1(input), webSafe);\n },\n /**\n * Base64-decode a string.\n *\n * @param input to decode.\n * @param webSafe True if we should use the\n * alternative alphabet.\n * @return string representing the decoded value.\n */\n decodeString(input, webSafe) {\n // Shortcut for Mozilla browsers that implement\n // a native base64 encoder in the form of \"btoa/atob\"\n if (this.HAS_NATIVE_SUPPORT && !webSafe) {\n return atob(input);\n }\n return byteArrayToString(this.decodeStringToByteArray(input, webSafe));\n },\n /**\n * Base64-decode a string.\n *\n * In base-64 decoding, groups of four characters are converted into three\n * bytes. If the encoder did not apply padding, the input length may not\n * be a multiple of 4.\n *\n * In this case, the last group will have fewer than 4 characters, and\n * padding will be inferred. If the group has one or two characters, it decodes\n * to one byte. If the group has three characters, it decodes to two bytes.\n *\n * @param input Input to decode.\n * @param webSafe True if we should use the web-safe alphabet.\n * @return bytes representing the decoded value.\n */\n decodeStringToByteArray(input, webSafe) {\n this.init_();\n const charToByteMap = webSafe\n ? this.charToByteMapWebSafe_\n : this.charToByteMap_;\n const output = [];\n for (let i = 0; i < input.length;) {\n const byte1 = charToByteMap[input.charAt(i++)];\n const haveByte2 = i < input.length;\n const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;\n ++i;\n const haveByte3 = i < input.length;\n const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;\n ++i;\n const haveByte4 = i < input.length;\n const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;\n ++i;\n if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {\n throw new DecodeBase64StringError();\n }\n const outByte1 = (byte1 << 2) | (byte2 >> 4);\n output.push(outByte1);\n if (byte3 !== 64) {\n const outByte2 = ((byte2 << 4) & 0xf0) | (byte3 >> 2);\n output.push(outByte2);\n if (byte4 !== 64) {\n const outByte3 = ((byte3 << 6) & 0xc0) | byte4;\n output.push(outByte3);\n }\n }\n }\n return output;\n },\n /**\n * Lazy static initialization function. Called before\n * accessing any of the static map variables.\n * @private\n */\n init_() {\n if (!this.byteToCharMap_) {\n this.byteToCharMap_ = {};\n this.charToByteMap_ = {};\n this.byteToCharMapWebSafe_ = {};\n this.charToByteMapWebSafe_ = {};\n // We want quick mappings back and forth, so we precompute two maps.\n for (let i = 0; i < this.ENCODED_VALS.length; i++) {\n this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);\n this.charToByteMap_[this.byteToCharMap_[i]] = i;\n this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);\n this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;\n // Be forgiving when decoding and correctly decode both encodings.\n if (i >= this.ENCODED_VALS_BASE.length) {\n this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;\n this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;\n }\n }\n }\n }\n};\n/**\n * An error encountered while decoding base64 string.\n */\nclass DecodeBase64StringError extends Error {\n constructor() {\n super(...arguments);\n this.name = 'DecodeBase64StringError';\n }\n}\n/**\n * URL-safe base64 encoding\n */\nconst base64Encode = function (str) {\n const utf8Bytes = stringToByteArray$1(str);\n return base64.encodeByteArray(utf8Bytes, true);\n};\n/**\n * URL-safe base64 encoding (without \".\" padding in the end).\n * e.g. Used in JSON Web Token (JWT) parts.\n */\nconst base64urlEncodeWithoutPadding = function (str) {\n // Use base64url encoding and remove padding in the end (dot characters).\n return base64Encode(str).replace(/\\./g, '');\n};\n/**\n * URL-safe base64 decoding\n *\n * NOTE: DO NOT use the global atob() function - it does NOT support the\n * base64Url variant encoding.\n *\n * @param str To be decoded\n * @return Decoded result, if possible\n */\nconst base64Decode = function (str) {\n try {\n return base64.decodeString(str, true);\n }\n catch (e) {\n console.error('base64Decode failed: ', e);\n }\n return null;\n};\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Do a deep-copy of basic JavaScript Objects or Arrays.\n */\nfunction deepCopy(value) {\n return deepExtend(undefined, value);\n}\n/**\n * Copy properties from source to target (recursively allows extension\n * of Objects and Arrays). Scalar values in the target are over-written.\n * If target is undefined, an object of the appropriate type will be created\n * (and returned).\n *\n * We recursively copy all child properties of plain Objects in the source- so\n * that namespace- like dictionaries are merged.\n *\n * Note that the target can be a function, in which case the properties in\n * the source Object are copied onto it as static properties of the Function.\n *\n * Note: we don't merge __proto__ to prevent prototype pollution\n */\nfunction deepExtend(target, source) {\n if (!(source instanceof Object)) {\n return source;\n }\n switch (source.constructor) {\n case Date:\n // Treat Dates like scalars; if the target date object had any child\n // properties - they will be lost!\n const dateValue = source;\n return new Date(dateValue.getTime());\n case Object:\n if (target === undefined) {\n target = {};\n }\n break;\n case Array:\n // Always copy the array source and overwrite the target.\n target = [];\n break;\n default:\n // Not a plain Object - treat it as a scalar.\n return source;\n }\n for (const prop in source) {\n // use isValidKey to guard against prototype pollution. See https://snyk.io/vuln/SNYK-JS-LODASH-450202\n if (!source.hasOwnProperty(prop) || !isValidKey(prop)) {\n continue;\n }\n target[prop] = deepExtend(target[prop], source[prop]);\n }\n return target;\n}\nfunction isValidKey(key) {\n return key !== '__proto__';\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Polyfill for `globalThis` object.\n * @returns the `globalThis` object for the given environment.\n * @public\n */\nfunction getGlobal() {\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('Unable to locate global object.');\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst getDefaultsFromGlobal = () => getGlobal().__FIREBASE_DEFAULTS__;\n/**\n * Attempt to read defaults from a JSON string provided to\n * process(.)env(.)__FIREBASE_DEFAULTS__ or a JSON file whose path is in\n * process(.)env(.)__FIREBASE_DEFAULTS_PATH__\n * The dots are in parens because certain compilers (Vite?) cannot\n * handle seeing that variable in comments.\n * See https://github.com/firebase/firebase-js-sdk/issues/6838\n */\nconst getDefaultsFromEnvVariable = () => {\n if (typeof process === 'undefined' || typeof process.env === 'undefined') {\n return;\n }\n const defaultsJsonString = process.env.__FIREBASE_DEFAULTS__;\n if (defaultsJsonString) {\n return JSON.parse(defaultsJsonString);\n }\n};\nconst getDefaultsFromCookie = () => {\n if (typeof document === 'undefined') {\n return;\n }\n let match;\n try {\n match = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/);\n }\n catch (e) {\n // Some environments such as Angular Universal SSR have a\n // `document` object but error on accessing `document.cookie`.\n return;\n }\n const decoded = match && base64Decode(match[1]);\n return decoded && JSON.parse(decoded);\n};\n/**\n * Get the __FIREBASE_DEFAULTS__ object. It checks in order:\n * (1) if such an object exists as a property of `globalThis`\n * (2) if such an object was provided on a shell environment variable\n * (3) if such an object exists in a cookie\n * @public\n */\nconst getDefaults = () => {\n try {\n return (getDefaultsFromGlobal() ||\n getDefaultsFromEnvVariable() ||\n getDefaultsFromCookie());\n }\n catch (e) {\n /**\n * Catch-all for being unable to get __FIREBASE_DEFAULTS__ due\n * to any environment case we have not accounted for. Log to\n * info instead of swallowing so we can find these unknown cases\n * and add paths for them if needed.\n */\n console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);\n return;\n }\n};\n/**\n * Returns emulator host stored in the __FIREBASE_DEFAULTS__ object\n * for the given product.\n * @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available\n * @public\n */\nconst getDefaultEmulatorHost = (productName) => { var _a, _b; return (_b = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.emulatorHosts) === null || _b === void 0 ? void 0 : _b[productName]; };\n/**\n * Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object\n * for the given product.\n * @returns a pair of hostname and port like `[\"::1\", 4000]` if available\n * @public\n */\nconst getDefaultEmulatorHostnameAndPort = (productName) => {\n const host = getDefaultEmulatorHost(productName);\n if (!host) {\n return undefined;\n }\n const separatorIndex = host.lastIndexOf(':'); // Finding the last since IPv6 addr also has colons.\n if (separatorIndex <= 0 || separatorIndex + 1 === host.length) {\n throw new Error(`Invalid host ${host} with no separate hostname and port!`);\n }\n // eslint-disable-next-line no-restricted-globals\n const port = parseInt(host.substring(separatorIndex + 1), 10);\n if (host[0] === '[') {\n // Bracket-quoted `[ipv6addr]:port` => return \"ipv6addr\" (without brackets).\n return [host.substring(1, separatorIndex - 1), port];\n }\n else {\n return [host.substring(0, separatorIndex), port];\n }\n};\n/**\n * Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object.\n * @public\n */\nconst getDefaultAppConfig = () => { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.config; };\n/**\n * Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties\n * prefixed by \"_\")\n * @public\n */\nconst getExperimentalSetting = (name) => { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a[`_${name}`]; };\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass Deferred {\n constructor() {\n this.reject = () => { };\n this.resolve = () => { };\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n /**\n * Our API internals are not promisified and cannot because our callback APIs have subtle expectations around\n * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback\n * and returns a node-style callback which will resolve or reject the Deferred's promise.\n */\n wrapCallback(callback) {\n return (error, value) => {\n if (error) {\n this.reject(error);\n }\n else {\n this.resolve(value);\n }\n if (typeof callback === 'function') {\n // Attaching noop handler just in case developer wasn't expecting\n // promises\n this.promise.catch(() => { });\n // Some of our callbacks don't expect a value and our own tests\n // assert that the parameter length is 1\n if (callback.length === 1) {\n callback(error);\n }\n else {\n callback(error, value);\n }\n }\n };\n }\n}\n\n/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction createMockUserToken(token, projectId) {\n if (token.uid) {\n throw new Error('The \"uid\" field is no longer supported by mockUserToken. Please use \"sub\" instead for Firebase Auth User ID.');\n }\n // Unsecured JWTs use \"none\" as the algorithm.\n const header = {\n alg: 'none',\n type: 'JWT'\n };\n const project = projectId || 'demo-project';\n const iat = token.iat || 0;\n const sub = token.sub || token.user_id;\n if (!sub) {\n throw new Error(\"mockUserToken must contain 'sub' or 'user_id' field!\");\n }\n const payload = Object.assign({ \n // Set all required fields to decent defaults\n iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {\n sign_in_provider: 'custom',\n identities: {}\n } }, token);\n // Unsecured JWTs use the empty string as a signature.\n const signature = '';\n return [\n base64urlEncodeWithoutPadding(JSON.stringify(header)),\n base64urlEncodeWithoutPadding(JSON.stringify(payload)),\n signature\n ].join('.');\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns navigator.userAgent string or '' if it's not defined.\n * @return user agent string\n */\nfunction getUA() {\n if (typeof navigator !== 'undefined' &&\n typeof navigator['userAgent'] === 'string') {\n return navigator['userAgent'];\n }\n else {\n return '';\n }\n}\n/**\n * Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.\n *\n * Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap\n * in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally\n * wait for a callback.\n */\nfunction isMobileCordova() {\n return (typeof window !== 'undefined' &&\n // @ts-ignore Setting up an broadly applicable index signature for Window\n // just to deal with this case would probably be a bad idea.\n !!(window['cordova'] || window['phonegap'] || window['PhoneGap']) &&\n /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA()));\n}\n/**\n * Detect Node.js.\n *\n * @return true if Node.js environment is detected or specified.\n */\n// Node detection logic from: https://github.com/iliakan/detect-node/\nfunction isNode() {\n var _a;\n const forceEnvironment = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.forceEnvironment;\n if (forceEnvironment === 'node') {\n return true;\n }\n else if (forceEnvironment === 'browser') {\n return false;\n }\n try {\n return (Object.prototype.toString.call(global.process) === '[object process]');\n }\n catch (e) {\n return false;\n }\n}\n/**\n * Detect Browser Environment.\n * Note: This will return true for certain test frameworks that are incompletely\n * mimicking a browser, and should not lead to assuming all browser APIs are\n * available.\n */\nfunction isBrowser() {\n return typeof window !== 'undefined' || isWebWorker();\n}\n/**\n * Detect Web Worker context.\n */\nfunction isWebWorker() {\n return (typeof WorkerGlobalScope !== 'undefined' &&\n typeof self !== 'undefined' &&\n self instanceof WorkerGlobalScope);\n}\n/**\n * Detect Cloudflare Worker context.\n */\nfunction isCloudflareWorker() {\n return (typeof navigator !== 'undefined' &&\n navigator.userAgent === 'Cloudflare-Workers');\n}\nfunction isBrowserExtension() {\n const runtime = typeof chrome === 'object'\n ? chrome.runtime\n : typeof browser === 'object'\n ? browser.runtime\n : undefined;\n return typeof runtime === 'object' && runtime.id !== undefined;\n}\n/**\n * Detect React Native.\n *\n * @return true if ReactNative environment is detected.\n */\nfunction isReactNative() {\n return (typeof navigator === 'object' && navigator['product'] === 'ReactNative');\n}\n/** Detects Electron apps. */\nfunction isElectron() {\n return getUA().indexOf('Electron/') >= 0;\n}\n/** Detects Internet Explorer. */\nfunction isIE() {\n const ua = getUA();\n return ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;\n}\n/** Detects Universal Windows Platform apps. */\nfunction isUWP() {\n return getUA().indexOf('MSAppHost/') >= 0;\n}\n/**\n * Detect whether the current SDK build is the Node version.\n *\n * @return true if it's the Node SDK build.\n */\nfunction isNodeSdk() {\n return CONSTANTS.NODE_CLIENT === true || CONSTANTS.NODE_ADMIN === true;\n}\n/** Returns true if we are running in Safari. */\nfunction isSafari() {\n return (!isNode() &&\n !!navigator.userAgent &&\n navigator.userAgent.includes('Safari') &&\n !navigator.userAgent.includes('Chrome'));\n}\n/**\n * This method checks if indexedDB is supported by current browser/service worker context\n * @return true if indexedDB is supported by current browser/service worker context\n */\nfunction isIndexedDBAvailable() {\n try {\n return typeof indexedDB === 'object';\n }\n catch (e) {\n return false;\n }\n}\n/**\n * This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject\n * if errors occur during the database open operation.\n *\n * @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox\n * private browsing)\n */\nfunction validateIndexedDBOpenable() {\n return new Promise((resolve, reject) => {\n try {\n let preExist = true;\n const DB_CHECK_NAME = 'validate-browser-context-for-indexeddb-analytics-module';\n const request = self.indexedDB.open(DB_CHECK_NAME);\n request.onsuccess = () => {\n request.result.close();\n // delete database only when it doesn't pre-exist\n if (!preExist) {\n self.indexedDB.deleteDatabase(DB_CHECK_NAME);\n }\n resolve(true);\n };\n request.onupgradeneeded = () => {\n preExist = false;\n };\n request.onerror = () => {\n var _a;\n reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');\n };\n }\n catch (error) {\n reject(error);\n }\n });\n}\n/**\n *\n * This method checks whether cookie is enabled within current browser\n * @return true if cookie is enabled within current browser\n */\nfunction areCookiesEnabled() {\n if (typeof navigator === 'undefined' || !navigator.cookieEnabled) {\n return false;\n }\n return true;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @fileoverview Standardized Firebase Error.\n *\n * Usage:\n *\n * // TypeScript string literals for type-safe codes\n * type Err =\n * 'unknown' |\n * 'object-not-found'\n * ;\n *\n * // Closure enum for type-safe error codes\n * // at-enum {string}\n * var Err = {\n * UNKNOWN: 'unknown',\n * OBJECT_NOT_FOUND: 'object-not-found',\n * }\n *\n * let errors: Map = {\n * 'generic-error': \"Unknown error\",\n * 'file-not-found': \"Could not find file: {$file}\",\n * };\n *\n * // Type-safe function - must pass a valid error code as param.\n * let error = new ErrorFactory('service', 'Service', errors);\n *\n * ...\n * throw error.create(Err.GENERIC);\n * ...\n * throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});\n * ...\n * // Service: Could not file file: foo.txt (service/file-not-found).\n *\n * catch (e) {\n * assert(e.message === \"Could not find file: foo.txt.\");\n * if ((e as FirebaseError)?.code === 'service/file-not-found') {\n * console.log(\"Could not read file: \" + e['file']);\n * }\n * }\n */\nconst ERROR_NAME = 'FirebaseError';\n// Based on code from:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types\nclass FirebaseError extends Error {\n constructor(\n /** The error code for this error. */\n code, message, \n /** Custom data for this error. */\n customData) {\n super(message);\n this.code = code;\n this.customData = customData;\n /** The custom name for all FirebaseErrors. */\n this.name = ERROR_NAME;\n // Fix For ES5\n // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n // TODO(dlarocque): Replace this with `new.target`: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget\n // which we can now use since we no longer target ES5.\n Object.setPrototypeOf(this, FirebaseError.prototype);\n // Maintains proper stack trace for where our error was thrown.\n // Only available on V8.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ErrorFactory.prototype.create);\n }\n }\n}\nclass ErrorFactory {\n constructor(service, serviceName, errors) {\n this.service = service;\n this.serviceName = serviceName;\n this.errors = errors;\n }\n create(code, ...data) {\n const customData = data[0] || {};\n const fullCode = `${this.service}/${code}`;\n const template = this.errors[code];\n const message = template ? replaceTemplate(template, customData) : 'Error';\n // Service Name: Error message (service/code).\n const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;\n const error = new FirebaseError(fullCode, fullMessage, customData);\n return error;\n }\n}\nfunction replaceTemplate(template, data) {\n return template.replace(PATTERN, (_, key) => {\n const value = data[key];\n return value != null ? String(value) : `<${key}?>`;\n });\n}\nconst PATTERN = /\\{\\$([^}]+)}/g;\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Evaluates a JSON string into a javascript object.\n *\n * @param {string} str A string containing JSON.\n * @return {*} The javascript object representing the specified JSON.\n */\nfunction jsonEval(str) {\n return JSON.parse(str);\n}\n/**\n * Returns JSON representing a javascript object.\n * @param {*} data JavaScript object to be stringified.\n * @return {string} The JSON contents of the object.\n */\nfunction stringify(data) {\n return JSON.stringify(data);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Decodes a Firebase auth. token into constituent parts.\n *\n * Notes:\n * - May return with invalid / incomplete claims if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nconst decode = function (token) {\n let header = {}, claims = {}, data = {}, signature = '';\n try {\n const parts = token.split('.');\n header = jsonEval(base64Decode(parts[0]) || '');\n claims = jsonEval(base64Decode(parts[1]) || '');\n signature = parts[2];\n data = claims['d'] || {};\n delete claims['d'];\n }\n catch (e) { }\n return {\n header,\n claims,\n data,\n signature\n };\n};\n/**\n * Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the\n * token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.\n *\n * Notes:\n * - May return a false negative if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nconst isValidTimestamp = function (token) {\n const claims = decode(token).claims;\n const now = Math.floor(new Date().getTime() / 1000);\n let validSince = 0, validUntil = 0;\n if (typeof claims === 'object') {\n if (claims.hasOwnProperty('nbf')) {\n validSince = claims['nbf'];\n }\n else if (claims.hasOwnProperty('iat')) {\n validSince = claims['iat'];\n }\n if (claims.hasOwnProperty('exp')) {\n validUntil = claims['exp'];\n }\n else {\n // token will expire after 24h by default\n validUntil = validSince + 86400;\n }\n }\n return (!!now &&\n !!validSince &&\n !!validUntil &&\n now >= validSince &&\n now <= validUntil);\n};\n/**\n * Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.\n *\n * Notes:\n * - May return null if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nconst issuedAtTime = function (token) {\n const claims = decode(token).claims;\n if (typeof claims === 'object' && claims.hasOwnProperty('iat')) {\n return claims['iat'];\n }\n return null;\n};\n/**\n * Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.\n *\n * Notes:\n * - May return a false negative if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nconst isValidFormat = function (token) {\n const decoded = decode(token), claims = decoded.claims;\n return !!claims && typeof claims === 'object' && claims.hasOwnProperty('iat');\n};\n/**\n * Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.\n *\n * Notes:\n * - May return a false negative if there's no native base64 decoding support.\n * - Doesn't check if the token is actually valid.\n */\nconst isAdmin = function (token) {\n const claims = decode(token).claims;\n return typeof claims === 'object' && claims['admin'] === true;\n};\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction contains(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\nfunction safeGet(obj, key) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n return obj[key];\n }\n else {\n return undefined;\n }\n}\nfunction isEmpty(obj) {\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n return false;\n }\n }\n return true;\n}\nfunction map(obj, fn, contextObj) {\n const res = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n res[key] = fn.call(contextObj, obj[key], key, obj);\n }\n }\n return res;\n}\n/**\n * Deep equal two objects. Support Arrays and Objects.\n */\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n for (const k of aKeys) {\n if (!bKeys.includes(k)) {\n return false;\n }\n const aProp = a[k];\n const bProp = b[k];\n if (isObject(aProp) && isObject(bProp)) {\n if (!deepEqual(aProp, bProp)) {\n return false;\n }\n }\n else if (aProp !== bProp) {\n return false;\n }\n }\n for (const k of bKeys) {\n if (!aKeys.includes(k)) {\n return false;\n }\n }\n return true;\n}\nfunction isObject(thing) {\n return thing !== null && typeof thing === 'object';\n}\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Rejects if the given promise doesn't resolve in timeInMS milliseconds.\n * @internal\n */\nfunction promiseWithTimeout(promise, timeInMS = 2000) {\n const deferredPromise = new Deferred();\n setTimeout(() => deferredPromise.reject('timeout!'), timeInMS);\n promise.then(deferredPromise.resolve, deferredPromise.reject);\n return deferredPromise.promise;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a\n * params object (e.g. {arg: 'val', arg2: 'val2'})\n * Note: You must prepend it with ? when adding it to a URL.\n */\nfunction querystring(querystringParams) {\n const params = [];\n for (const [key, value] of Object.entries(querystringParams)) {\n if (Array.isArray(value)) {\n value.forEach(arrayVal => {\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(arrayVal));\n });\n }\n else {\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\n }\n }\n return params.length ? '&' + params.join('&') : '';\n}\n/**\n * Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object\n * (e.g. {arg: 'val', arg2: 'val2'})\n */\nfunction querystringDecode(querystring) {\n const obj = {};\n const tokens = querystring.replace(/^\\?/, '').split('&');\n tokens.forEach(token => {\n if (token) {\n const [key, value] = token.split('=');\n obj[decodeURIComponent(key)] = decodeURIComponent(value);\n }\n });\n return obj;\n}\n/**\n * Extract the query string part of a URL, including the leading question mark (if present).\n */\nfunction extractQuerystring(url) {\n const queryStart = url.indexOf('?');\n if (!queryStart) {\n return '';\n }\n const fragmentStart = url.indexOf('#', queryStart);\n return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : undefined);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @fileoverview SHA-1 cryptographic hash.\n * Variable names follow the notation in FIPS PUB 180-3:\n * http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.\n *\n * Usage:\n * var sha1 = new sha1();\n * sha1.update(bytes);\n * var hash = sha1.digest();\n *\n * Performance:\n * Chrome 23: ~400 Mbit/s\n * Firefox 16: ~250 Mbit/s\n *\n */\n/**\n * SHA-1 cryptographic hash constructor.\n *\n * The properties declared here are discussed in the above algorithm document.\n * @constructor\n * @final\n * @struct\n */\nclass Sha1 {\n constructor() {\n /**\n * Holds the previous values of accumulated variables a-e in the compress_\n * function.\n * @private\n */\n this.chain_ = [];\n /**\n * A buffer holding the partially computed hash result.\n * @private\n */\n this.buf_ = [];\n /**\n * An array of 80 bytes, each a part of the message to be hashed. Referred to\n * as the message schedule in the docs.\n * @private\n */\n this.W_ = [];\n /**\n * Contains data needed to pad messages less than 64 bytes.\n * @private\n */\n this.pad_ = [];\n /**\n * @private {number}\n */\n this.inbuf_ = 0;\n /**\n * @private {number}\n */\n this.total_ = 0;\n this.blockSize = 512 / 8;\n this.pad_[0] = 128;\n for (let i = 1; i < this.blockSize; ++i) {\n this.pad_[i] = 0;\n }\n this.reset();\n }\n reset() {\n this.chain_[0] = 0x67452301;\n this.chain_[1] = 0xefcdab89;\n this.chain_[2] = 0x98badcfe;\n this.chain_[3] = 0x10325476;\n this.chain_[4] = 0xc3d2e1f0;\n this.inbuf_ = 0;\n this.total_ = 0;\n }\n /**\n * Internal compress helper function.\n * @param buf Block to compress.\n * @param offset Offset of the block in the buffer.\n * @private\n */\n compress_(buf, offset) {\n if (!offset) {\n offset = 0;\n }\n const W = this.W_;\n // get 16 big endian words\n if (typeof buf === 'string') {\n for (let i = 0; i < 16; i++) {\n // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\n // have a bug that turns the post-increment ++ operator into pre-increment\n // during JIT compilation. We have code that depends heavily on SHA-1 for\n // correctness and which is affected by this bug, so I've removed all uses\n // of post-increment ++ in which the result value is used. We can revert\n // this change once the Safari bug\n // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\n // most clients have been updated.\n W[i] =\n (buf.charCodeAt(offset) << 24) |\n (buf.charCodeAt(offset + 1) << 16) |\n (buf.charCodeAt(offset + 2) << 8) |\n buf.charCodeAt(offset + 3);\n offset += 4;\n }\n }\n else {\n for (let i = 0; i < 16; i++) {\n W[i] =\n (buf[offset] << 24) |\n (buf[offset + 1] << 16) |\n (buf[offset + 2] << 8) |\n buf[offset + 3];\n offset += 4;\n }\n }\n // expand to 80 words\n for (let i = 16; i < 80; i++) {\n const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\n }\n let a = this.chain_[0];\n let b = this.chain_[1];\n let c = this.chain_[2];\n let d = this.chain_[3];\n let e = this.chain_[4];\n let f, k;\n // TODO(user): Try to unroll this loop to speed up the computation.\n for (let i = 0; i < 80; i++) {\n if (i < 40) {\n if (i < 20) {\n f = d ^ (b & (c ^ d));\n k = 0x5a827999;\n }\n else {\n f = b ^ c ^ d;\n k = 0x6ed9eba1;\n }\n }\n else {\n if (i < 60) {\n f = (b & c) | (d & (b | c));\n k = 0x8f1bbcdc;\n }\n else {\n f = b ^ c ^ d;\n k = 0xca62c1d6;\n }\n }\n const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\n e = d;\n d = c;\n c = ((b << 30) | (b >>> 2)) & 0xffffffff;\n b = a;\n a = t;\n }\n this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\n this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\n this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\n this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\n this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\n }\n update(bytes, length) {\n // TODO(johnlenz): tighten the function signature and remove this check\n if (bytes == null) {\n return;\n }\n if (length === undefined) {\n length = bytes.length;\n }\n const lengthMinusBlock = length - this.blockSize;\n let n = 0;\n // Using local instead of member variables gives ~5% speedup on Firefox 16.\n const buf = this.buf_;\n let inbuf = this.inbuf_;\n // The outer while loop should execute at most twice.\n while (n < length) {\n // When we have no data in the block to top up, we can directly process the\n // input buffer (assuming it contains sufficient data). This gives ~25%\n // speedup on Chrome 23 and ~15% speedup on Firefox 16, but requires that\n // the data is provided in large chunks (or in multiples of 64 bytes).\n if (inbuf === 0) {\n while (n <= lengthMinusBlock) {\n this.compress_(bytes, n);\n n += this.blockSize;\n }\n }\n if (typeof bytes === 'string') {\n while (n < length) {\n buf[inbuf] = bytes.charCodeAt(n);\n ++inbuf;\n ++n;\n if (inbuf === this.blockSize) {\n this.compress_(buf);\n inbuf = 0;\n // Jump to the outer loop so we use the full-block optimization.\n break;\n }\n }\n }\n else {\n while (n < length) {\n buf[inbuf] = bytes[n];\n ++inbuf;\n ++n;\n if (inbuf === this.blockSize) {\n this.compress_(buf);\n inbuf = 0;\n // Jump to the outer loop so we use the full-block optimization.\n break;\n }\n }\n }\n }\n this.inbuf_ = inbuf;\n this.total_ += length;\n }\n /** @override */\n digest() {\n const digest = [];\n let totalBits = this.total_ * 8;\n // Add pad 0x80 0x00*.\n if (this.inbuf_ < 56) {\n this.update(this.pad_, 56 - this.inbuf_);\n }\n else {\n this.update(this.pad_, this.blockSize - (this.inbuf_ - 56));\n }\n // Add # bits.\n for (let i = this.blockSize - 1; i >= 56; i--) {\n this.buf_[i] = totalBits & 255;\n totalBits /= 256; // Don't use bit-shifting here!\n }\n this.compress_(this.buf_);\n let n = 0;\n for (let i = 0; i < 5; i++) {\n for (let j = 24; j >= 0; j -= 8) {\n digest[n] = (this.chain_[i] >> j) & 255;\n ++n;\n }\n }\n return digest;\n }\n}\n\n/**\n * Helper to make a Subscribe function (just like Promise helps make a\n * Thenable).\n *\n * @param executor Function which can make calls to a single Observer\n * as a proxy.\n * @param onNoObservers Callback when count of Observers goes to zero.\n */\nfunction createSubscribe(executor, onNoObservers) {\n const proxy = new ObserverProxy(executor, onNoObservers);\n return proxy.subscribe.bind(proxy);\n}\n/**\n * Implement fan-out for any number of Observers attached via a subscribe\n * function.\n */\nclass ObserverProxy {\n /**\n * @param executor Function which can make calls to a single Observer\n * as a proxy.\n * @param onNoObservers Callback when count of Observers goes to zero.\n */\n constructor(executor, onNoObservers) {\n this.observers = [];\n this.unsubscribes = [];\n this.observerCount = 0;\n // Micro-task scheduling by calling task.then().\n this.task = Promise.resolve();\n this.finalized = false;\n this.onNoObservers = onNoObservers;\n // Call the executor asynchronously so subscribers that are called\n // synchronously after the creation of the subscribe function\n // can still receive the very first value generated in the executor.\n this.task\n .then(() => {\n executor(this);\n })\n .catch(e => {\n this.error(e);\n });\n }\n next(value) {\n this.forEachObserver((observer) => {\n observer.next(value);\n });\n }\n error(error) {\n this.forEachObserver((observer) => {\n observer.error(error);\n });\n this.close(error);\n }\n complete() {\n this.forEachObserver((observer) => {\n observer.complete();\n });\n this.close();\n }\n /**\n * Subscribe function that can be used to add an Observer to the fan-out list.\n *\n * - We require that no event is sent to a subscriber synchronously to their\n * call to subscribe().\n */\n subscribe(nextOrObserver, error, complete) {\n let observer;\n if (nextOrObserver === undefined &&\n error === undefined &&\n complete === undefined) {\n throw new Error('Missing Observer.');\n }\n // Assemble an Observer object when passed as callback functions.\n if (implementsAnyMethods(nextOrObserver, [\n 'next',\n 'error',\n 'complete'\n ])) {\n observer = nextOrObserver;\n }\n else {\n observer = {\n next: nextOrObserver,\n error,\n complete\n };\n }\n if (observer.next === undefined) {\n observer.next = noop;\n }\n if (observer.error === undefined) {\n observer.error = noop;\n }\n if (observer.complete === undefined) {\n observer.complete = noop;\n }\n const unsub = this.unsubscribeOne.bind(this, this.observers.length);\n // Attempt to subscribe to a terminated Observable - we\n // just respond to the Observer with the final error or complete\n // event.\n if (this.finalized) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.task.then(() => {\n try {\n if (this.finalError) {\n observer.error(this.finalError);\n }\n else {\n observer.complete();\n }\n }\n catch (e) {\n // nothing\n }\n return;\n });\n }\n this.observers.push(observer);\n return unsub;\n }\n // Unsubscribe is synchronous - we guarantee that no events are sent to\n // any unsubscribed Observer.\n unsubscribeOne(i) {\n if (this.observers === undefined || this.observers[i] === undefined) {\n return;\n }\n delete this.observers[i];\n this.observerCount -= 1;\n if (this.observerCount === 0 && this.onNoObservers !== undefined) {\n this.onNoObservers(this);\n }\n }\n forEachObserver(fn) {\n if (this.finalized) {\n // Already closed by previous event....just eat the additional values.\n return;\n }\n // Since sendOne calls asynchronously - there is no chance that\n // this.observers will become undefined.\n for (let i = 0; i < this.observers.length; i++) {\n this.sendOne(i, fn);\n }\n }\n // Call the Observer via one of it's callback function. We are careful to\n // confirm that the observe has not been unsubscribed since this asynchronous\n // function had been queued.\n sendOne(i, fn) {\n // Execute the callback asynchronously\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.task.then(() => {\n if (this.observers !== undefined && this.observers[i] !== undefined) {\n try {\n fn(this.observers[i]);\n }\n catch (e) {\n // Ignore exceptions raised in Observers or missing methods of an\n // Observer.\n // Log error to console. b/31404806\n if (typeof console !== 'undefined' && console.error) {\n console.error(e);\n }\n }\n }\n });\n }\n close(err) {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n if (err !== undefined) {\n this.finalError = err;\n }\n // Proxy is no longer needed - garbage collect references\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.task.then(() => {\n this.observers = undefined;\n this.onNoObservers = undefined;\n });\n }\n}\n/** Turn synchronous function into one called asynchronously. */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction async(fn, onError) {\n return (...args) => {\n Promise.resolve(true)\n .then(() => {\n fn(...args);\n })\n .catch((error) => {\n if (onError) {\n onError(error);\n }\n });\n };\n}\n/**\n * Return true if the object passed in implements any of the named methods.\n */\nfunction implementsAnyMethods(obj, methods) {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n for (const method of methods) {\n if (method in obj && typeof obj[method] === 'function') {\n return true;\n }\n }\n return false;\n}\nfunction noop() {\n // do nothing\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Check to make sure the appropriate number of arguments are provided for a public function.\n * Throws an error if it fails.\n *\n * @param fnName The function name\n * @param minCount The minimum number of arguments to allow for the function call\n * @param maxCount The maximum number of argument to allow for the function call\n * @param argCount The actual number of arguments provided.\n */\nconst validateArgCount = function (fnName, minCount, maxCount, argCount) {\n let argError;\n if (argCount < minCount) {\n argError = 'at least ' + minCount;\n }\n else if (argCount > maxCount) {\n argError = maxCount === 0 ? 'none' : 'no more than ' + maxCount;\n }\n if (argError) {\n const error = fnName +\n ' failed: Was called with ' +\n argCount +\n (argCount === 1 ? ' argument.' : ' arguments.') +\n ' Expects ' +\n argError +\n '.';\n throw new Error(error);\n }\n};\n/**\n * Generates a string to prefix an error message about failed argument validation\n *\n * @param fnName The function name\n * @param argName The name of the argument\n * @return The prefix to add to the error thrown for validation.\n */\nfunction errorPrefix(fnName, argName) {\n return `${fnName} failed: ${argName} argument `;\n}\n/**\n * @param fnName\n * @param argumentNumber\n * @param namespace\n * @param optional\n */\nfunction validateNamespace(fnName, namespace, optional) {\n if (optional && !namespace) {\n return;\n }\n if (typeof namespace !== 'string') {\n //TODO: I should do more validation here. We only allow certain chars in namespaces.\n throw new Error(errorPrefix(fnName, 'namespace') + 'must be a valid firebase namespace.');\n }\n}\nfunction validateCallback(fnName, argumentName, \n// eslint-disable-next-line @typescript-eslint/ban-types\ncallback, optional) {\n if (optional && !callback) {\n return;\n }\n if (typeof callback !== 'function') {\n throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid function.');\n }\n}\nfunction validateContextObject(fnName, argumentName, context, optional) {\n if (optional && !context) {\n return;\n }\n if (typeof context !== 'object' || context === null) {\n throw new Error(errorPrefix(fnName, argumentName) + 'must be a valid context object.');\n }\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Code originally came from goog.crypt.stringToUtf8ByteArray, but for some reason they\n// automatically replaced '\\r\\n' with '\\n', and they didn't handle surrogate pairs,\n// so it's been modified.\n// Note that not all Unicode characters appear as single characters in JavaScript strings.\n// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters\n// use 2 characters in JavaScript. All 4-byte UTF-8 characters begin with a first\n// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate\n// pair).\n// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3\n/**\n * @param {string} str\n * @return {Array}\n */\nconst stringToByteArray = function (str) {\n const out = [];\n let p = 0;\n for (let i = 0; i < str.length; i++) {\n let c = str.charCodeAt(i);\n // Is this the lead surrogate in a surrogate pair?\n if (c >= 0xd800 && c <= 0xdbff) {\n const high = c - 0xd800; // the high 10 bits.\n i++;\n assert(i < str.length, 'Surrogate pair missing trail surrogate.');\n const low = str.charCodeAt(i) - 0xdc00; // the low 10 bits.\n c = 0x10000 + (high << 10) + low;\n }\n if (c < 128) {\n out[p++] = c;\n }\n else if (c < 2048) {\n out[p++] = (c >> 6) | 192;\n out[p++] = (c & 63) | 128;\n }\n else if (c < 65536) {\n out[p++] = (c >> 12) | 224;\n out[p++] = ((c >> 6) & 63) | 128;\n out[p++] = (c & 63) | 128;\n }\n else {\n out[p++] = (c >> 18) | 240;\n out[p++] = ((c >> 12) & 63) | 128;\n out[p++] = ((c >> 6) & 63) | 128;\n out[p++] = (c & 63) | 128;\n }\n }\n return out;\n};\n/**\n * Calculate length without actually converting; useful for doing cheaper validation.\n * @param {string} str\n * @return {number}\n */\nconst stringLength = function (str) {\n let p = 0;\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 128) {\n p++;\n }\n else if (c < 2048) {\n p += 2;\n }\n else if (c >= 0xd800 && c <= 0xdbff) {\n // Lead surrogate of a surrogate pair. The pair together will take 4 bytes to represent.\n p += 4;\n i++; // skip trail surrogate.\n }\n else {\n p += 3;\n }\n }\n return p;\n};\n\n/**\n * @license\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Copied from https://stackoverflow.com/a/2117523\n * Generates a new uuid.\n * @public\n */\nconst uuidv4 = function () {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {\n const r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n};\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The amount of milliseconds to exponentially increase.\n */\nconst DEFAULT_INTERVAL_MILLIS = 1000;\n/**\n * The factor to backoff by.\n * Should be a number greater than 1.\n */\nconst DEFAULT_BACKOFF_FACTOR = 2;\n/**\n * The maximum milliseconds to increase to.\n *\n *

Visible for testing\n */\nconst MAX_VALUE_MILLIS = 4 * 60 * 60 * 1000; // Four hours, like iOS and Android.\n/**\n * The percentage of backoff time to randomize by.\n * See\n * http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic\n * for context.\n *\n *

Visible for testing\n */\nconst RANDOM_FACTOR = 0.5;\n/**\n * Based on the backoff method from\n * https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.\n * Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.\n */\nfunction calculateBackoffMillis(backoffCount, intervalMillis = DEFAULT_INTERVAL_MILLIS, backoffFactor = DEFAULT_BACKOFF_FACTOR) {\n // Calculates an exponentially increasing value.\n // Deviation: calculates value from count and a constant interval, so we only need to save value\n // and count to restore state.\n const currBaseValue = intervalMillis * Math.pow(backoffFactor, backoffCount);\n // A random \"fuzz\" to avoid waves of retries.\n // Deviation: randomFactor is required.\n const randomWait = Math.round(\n // A fraction of the backoff value to add/subtract.\n // Deviation: changes multiplication order to improve readability.\n RANDOM_FACTOR *\n currBaseValue *\n // A random float (rounded to int by Math.round above) in the range [-1, 1]. Determines\n // if we add or subtract.\n (Math.random() - 0.5) *\n 2);\n // Limits backoff to max to avoid effectively permanent backoff.\n return Math.min(MAX_VALUE_MILLIS, currBaseValue + randomWait);\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provide English ordinal letters after a number\n */\nfunction ordinal(i) {\n if (!Number.isFinite(i)) {\n return `${i}`;\n }\n return i + indicator(i);\n}\nfunction indicator(i) {\n i = Math.abs(i);\n const cent = i % 100;\n if (cent >= 10 && cent <= 20) {\n return 'th';\n }\n const dec = i % 10;\n if (dec === 1) {\n return 'st';\n }\n if (dec === 2) {\n return 'nd';\n }\n if (dec === 3) {\n return 'rd';\n }\n return 'th';\n}\n\n/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction getModularInstance(service) {\n if (service && service._delegate) {\n return service._delegate;\n }\n else {\n return service;\n }\n}\n\nexport { CONSTANTS, DecodeBase64StringError, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getDefaults, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isCloudflareWorker, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, isWebWorker, issuedAtTime, jsonEval, map, ordinal, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };\n//# sourceMappingURL=index.esm2017.js.map\n","import { Deferred } from '@firebase/util';\n\n/**\n * Component for service name T, e.g. `auth`, `auth-internal`\n */\nclass Component {\n /**\n *\n * @param name The public service name, e.g. app, auth, firestore, database\n * @param instanceFactory Service factory responsible for creating the public interface\n * @param type whether the service provided by the component is public or private\n */\n constructor(name, instanceFactory, type) {\n this.name = name;\n this.instanceFactory = instanceFactory;\n this.type = type;\n this.multipleInstances = false;\n /**\n * Properties to be added to the service namespace\n */\n this.serviceProps = {};\n this.instantiationMode = \"LAZY\" /* InstantiationMode.LAZY */;\n this.onInstanceCreated = null;\n }\n setInstantiationMode(mode) {\n this.instantiationMode = mode;\n return this;\n }\n setMultipleInstances(multipleInstances) {\n this.multipleInstances = multipleInstances;\n return this;\n }\n setServiceProps(props) {\n this.serviceProps = props;\n return this;\n }\n setInstanceCreatedCallback(callback) {\n this.onInstanceCreated = callback;\n return this;\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\n * NameServiceMapping[T] is an alias for the type of the instance\n */\nclass Provider {\n constructor(name, container) {\n this.name = name;\n this.container = container;\n this.component = null;\n this.instances = new Map();\n this.instancesDeferred = new Map();\n this.instancesOptions = new Map();\n this.onInitCallbacks = new Map();\n }\n /**\n * @param identifier A provider can provide multiple instances of a service\n * if this.component.multipleInstances is true.\n */\n get(identifier) {\n // if multipleInstances is not supported, use the default name\n const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\n if (!this.instancesDeferred.has(normalizedIdentifier)) {\n const deferred = new Deferred();\n this.instancesDeferred.set(normalizedIdentifier, deferred);\n if (this.isInitialized(normalizedIdentifier) ||\n this.shouldAutoInitialize()) {\n // initialize the service if it can be auto-initialized\n try {\n const instance = this.getOrInitializeService({\n instanceIdentifier: normalizedIdentifier\n });\n if (instance) {\n deferred.resolve(instance);\n }\n }\n catch (e) {\n // when the instance factory throws an exception during get(), it should not cause\n // a fatal error. We just return the unresolved promise in this case.\n }\n }\n }\n return this.instancesDeferred.get(normalizedIdentifier).promise;\n }\n getImmediate(options) {\n var _a;\n // if multipleInstances is not supported, use the default name\n const normalizedIdentifier = this.normalizeInstanceIdentifier(options === null || options === void 0 ? void 0 : options.identifier);\n const optional = (_a = options === null || options === void 0 ? void 0 : options.optional) !== null && _a !== void 0 ? _a : false;\n if (this.isInitialized(normalizedIdentifier) ||\n this.shouldAutoInitialize()) {\n try {\n return this.getOrInitializeService({\n instanceIdentifier: normalizedIdentifier\n });\n }\n catch (e) {\n if (optional) {\n return null;\n }\n else {\n throw e;\n }\n }\n }\n else {\n // In case a component is not initialized and should/cannot be auto-initialized at the moment, return null if the optional flag is set, or throw\n if (optional) {\n return null;\n }\n else {\n throw Error(`Service ${this.name} is not available`);\n }\n }\n }\n getComponent() {\n return this.component;\n }\n setComponent(component) {\n if (component.name !== this.name) {\n throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);\n }\n if (this.component) {\n throw Error(`Component for ${this.name} has already been provided`);\n }\n this.component = component;\n // return early without attempting to initialize the component if the component requires explicit initialization (calling `Provider.initialize()`)\n if (!this.shouldAutoInitialize()) {\n return;\n }\n // if the service is eager, initialize the default instance\n if (isComponentEager(component)) {\n try {\n this.getOrInitializeService({ instanceIdentifier: DEFAULT_ENTRY_NAME });\n }\n catch (e) {\n // when the instance factory for an eager Component throws an exception during the eager\n // initialization, it should not cause a fatal error.\n // TODO: Investigate if we need to make it configurable, because some component may want to cause\n // a fatal error in this case?\n }\n }\n // Create service instances for the pending promises and resolve them\n // NOTE: if this.multipleInstances is false, only the default instance will be created\n // and all promises with resolve with it regardless of the identifier.\n for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\n const normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\n try {\n // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\n const instance = this.getOrInitializeService({\n instanceIdentifier: normalizedIdentifier\n });\n instanceDeferred.resolve(instance);\n }\n catch (e) {\n // when the instance factory throws an exception, it should not cause\n // a fatal error. We just leave the promise unresolved.\n }\n }\n }\n clearInstance(identifier = DEFAULT_ENTRY_NAME) {\n this.instancesDeferred.delete(identifier);\n this.instancesOptions.delete(identifier);\n this.instances.delete(identifier);\n }\n // app.delete() will call this method on every provider to delete the services\n // TODO: should we mark the provider as deleted?\n async delete() {\n const services = Array.from(this.instances.values());\n await Promise.all([\n ...services\n .filter(service => 'INTERNAL' in service) // legacy services\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .map(service => service.INTERNAL.delete()),\n ...services\n .filter(service => '_delete' in service) // modularized services\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .map(service => service._delete())\n ]);\n }\n isComponentSet() {\n return this.component != null;\n }\n isInitialized(identifier = DEFAULT_ENTRY_NAME) {\n return this.instances.has(identifier);\n }\n getOptions(identifier = DEFAULT_ENTRY_NAME) {\n return this.instancesOptions.get(identifier) || {};\n }\n initialize(opts = {}) {\n const { options = {} } = opts;\n const normalizedIdentifier = this.normalizeInstanceIdentifier(opts.instanceIdentifier);\n if (this.isInitialized(normalizedIdentifier)) {\n throw Error(`${this.name}(${normalizedIdentifier}) has already been initialized`);\n }\n if (!this.isComponentSet()) {\n throw Error(`Component ${this.name} has not been registered yet`);\n }\n const instance = this.getOrInitializeService({\n instanceIdentifier: normalizedIdentifier,\n options\n });\n // resolve any pending promise waiting for the service instance\n for (const [instanceIdentifier, instanceDeferred] of this.instancesDeferred.entries()) {\n const normalizedDeferredIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\n if (normalizedIdentifier === normalizedDeferredIdentifier) {\n instanceDeferred.resolve(instance);\n }\n }\n return instance;\n }\n /**\n *\n * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize().\n * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.\n *\n * @param identifier An optional instance identifier\n * @returns a function to unregister the callback\n */\n onInit(callback, identifier) {\n var _a;\n const normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\n const existingCallbacks = (_a = this.onInitCallbacks.get(normalizedIdentifier)) !== null && _a !== void 0 ? _a : new Set();\n existingCallbacks.add(callback);\n this.onInitCallbacks.set(normalizedIdentifier, existingCallbacks);\n const existingInstance = this.instances.get(normalizedIdentifier);\n if (existingInstance) {\n callback(existingInstance, normalizedIdentifier);\n }\n return () => {\n existingCallbacks.delete(callback);\n };\n }\n /**\n * Invoke onInit callbacks synchronously\n * @param instance the service instance`\n */\n invokeOnInitCallbacks(instance, identifier) {\n const callbacks = this.onInitCallbacks.get(identifier);\n if (!callbacks) {\n return;\n }\n for (const callback of callbacks) {\n try {\n callback(instance, identifier);\n }\n catch (_a) {\n // ignore errors in the onInit callback\n }\n }\n }\n getOrInitializeService({ instanceIdentifier, options = {} }) {\n let instance = this.instances.get(instanceIdentifier);\n if (!instance && this.component) {\n instance = this.component.instanceFactory(this.container, {\n instanceIdentifier: normalizeIdentifierForFactory(instanceIdentifier),\n options\n });\n this.instances.set(instanceIdentifier, instance);\n this.instancesOptions.set(instanceIdentifier, options);\n /**\n * Invoke onInit listeners.\n * Note this.component.onInstanceCreated is different, which is used by the component creator,\n * while onInit listeners are registered by consumers of the provider.\n */\n this.invokeOnInitCallbacks(instance, instanceIdentifier);\n /**\n * Order is important\n * onInstanceCreated() should be called after this.instances.set(instanceIdentifier, instance); which\n * makes `isInitialized()` return true.\n */\n if (this.component.onInstanceCreated) {\n try {\n this.component.onInstanceCreated(this.container, instanceIdentifier, instance);\n }\n catch (_a) {\n // ignore errors in the onInstanceCreatedCallback\n }\n }\n }\n return instance || null;\n }\n normalizeInstanceIdentifier(identifier = DEFAULT_ENTRY_NAME) {\n if (this.component) {\n return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\n }\n else {\n return identifier; // assume multiple instances are supported before the component is provided.\n }\n }\n shouldAutoInitialize() {\n return (!!this.component &&\n this.component.instantiationMode !== \"EXPLICIT\" /* InstantiationMode.EXPLICIT */);\n }\n}\n// undefined should be passed to the service factory for the default instance\nfunction normalizeIdentifierForFactory(identifier) {\n return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\n}\nfunction isComponentEager(component) {\n return component.instantiationMode === \"EAGER\" /* InstantiationMode.EAGER */;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\n */\nclass ComponentContainer {\n constructor(name) {\n this.name = name;\n this.providers = new Map();\n }\n /**\n *\n * @param component Component being added\n * @param overwrite When a component with the same name has already been registered,\n * if overwrite is true: overwrite the existing component with the new component and create a new\n * provider with the new component. It can be useful in tests where you want to use different mocks\n * for different tests.\n * if overwrite is false: throw an exception\n */\n addComponent(component) {\n const provider = this.getProvider(component.name);\n if (provider.isComponentSet()) {\n throw new Error(`Component ${component.name} has already been registered with ${this.name}`);\n }\n provider.setComponent(component);\n }\n addOrOverwriteComponent(component) {\n const provider = this.getProvider(component.name);\n if (provider.isComponentSet()) {\n // delete the existing provider from the container, so we can register the new component\n this.providers.delete(component.name);\n }\n this.addComponent(component);\n }\n /**\n * getProvider provides a type safe interface where it can only be called with a field name\n * present in NameServiceMapping interface.\n *\n * Firebase SDKs providing services should extend NameServiceMapping interface to register\n * themselves.\n */\n getProvider(name) {\n if (this.providers.has(name)) {\n return this.providers.get(name);\n }\n // create a Provider for a service that hasn't registered with Firebase\n const provider = new Provider(name, this);\n this.providers.set(name, provider);\n return provider;\n }\n getProviders() {\n return Array.from(this.providers.values());\n }\n}\n\nexport { Component, ComponentContainer, Provider };\n//# sourceMappingURL=index.esm2017.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A container for all of the Logger instances\n */\nconst instances = [];\n/**\n * The JS SDK supports 5 log levels and also allows a user the ability to\n * silence the logs altogether.\n *\n * The order is a follows:\n * DEBUG < VERBOSE < INFO < WARN < ERROR\n *\n * All of the log types above the current log level will be captured (i.e. if\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\n * `VERBOSE` logs will not)\n */\nvar LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"DEBUG\"] = 0] = \"DEBUG\";\n LogLevel[LogLevel[\"VERBOSE\"] = 1] = \"VERBOSE\";\n LogLevel[LogLevel[\"INFO\"] = 2] = \"INFO\";\n LogLevel[LogLevel[\"WARN\"] = 3] = \"WARN\";\n LogLevel[LogLevel[\"ERROR\"] = 4] = \"ERROR\";\n LogLevel[LogLevel[\"SILENT\"] = 5] = \"SILENT\";\n})(LogLevel || (LogLevel = {}));\nconst levelStringToEnum = {\n 'debug': LogLevel.DEBUG,\n 'verbose': LogLevel.VERBOSE,\n 'info': LogLevel.INFO,\n 'warn': LogLevel.WARN,\n 'error': LogLevel.ERROR,\n 'silent': LogLevel.SILENT\n};\n/**\n * The default log level\n */\nconst defaultLogLevel = LogLevel.INFO;\n/**\n * By default, `console.debug` is not displayed in the developer console (in\n * chrome). To avoid forcing users to have to opt-in to these logs twice\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\n * logs to the `console.log` function.\n */\nconst ConsoleMethod = {\n [LogLevel.DEBUG]: 'log',\n [LogLevel.VERBOSE]: 'log',\n [LogLevel.INFO]: 'info',\n [LogLevel.WARN]: 'warn',\n [LogLevel.ERROR]: 'error'\n};\n/**\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\n * messages on to their corresponding console counterparts (if the log method\n * is supported by the current log level)\n */\nconst defaultLogHandler = (instance, logType, ...args) => {\n if (logType < instance.logLevel) {\n return;\n }\n const now = new Date().toISOString();\n const method = ConsoleMethod[logType];\n if (method) {\n console[method](`[${now}] ${instance.name}:`, ...args);\n }\n else {\n throw new Error(`Attempted to log a message with an invalid logType (value: ${logType})`);\n }\n};\nclass Logger {\n /**\n * Gives you an instance of a Logger to capture messages according to\n * Firebase's logging scheme.\n *\n * @param name The name that the logs will be associated with\n */\n constructor(name) {\n this.name = name;\n /**\n * The log level of the given Logger instance.\n */\n this._logLevel = defaultLogLevel;\n /**\n * The main (internal) log handler for the Logger instance.\n * Can be set to a new function in internal package code but not by user.\n */\n this._logHandler = defaultLogHandler;\n /**\n * The optional, additional, user-defined log handler for the Logger instance.\n */\n this._userLogHandler = null;\n /**\n * Capture the current instance for later use\n */\n instances.push(this);\n }\n get logLevel() {\n return this._logLevel;\n }\n set logLevel(val) {\n if (!(val in LogLevel)) {\n throw new TypeError(`Invalid value \"${val}\" assigned to \\`logLevel\\``);\n }\n this._logLevel = val;\n }\n // Workaround for setter/getter having to be the same type.\n setLogLevel(val) {\n this._logLevel = typeof val === 'string' ? levelStringToEnum[val] : val;\n }\n get logHandler() {\n return this._logHandler;\n }\n set logHandler(val) {\n if (typeof val !== 'function') {\n throw new TypeError('Value assigned to `logHandler` must be a function');\n }\n this._logHandler = val;\n }\n get userLogHandler() {\n return this._userLogHandler;\n }\n set userLogHandler(val) {\n this._userLogHandler = val;\n }\n /**\n * The functions below are all based on the `console` interface\n */\n debug(...args) {\n this._userLogHandler && this._userLogHandler(this, LogLevel.DEBUG, ...args);\n this._logHandler(this, LogLevel.DEBUG, ...args);\n }\n log(...args) {\n this._userLogHandler &&\n this._userLogHandler(this, LogLevel.VERBOSE, ...args);\n this._logHandler(this, LogLevel.VERBOSE, ...args);\n }\n info(...args) {\n this._userLogHandler && this._userLogHandler(this, LogLevel.INFO, ...args);\n this._logHandler(this, LogLevel.INFO, ...args);\n }\n warn(...args) {\n this._userLogHandler && this._userLogHandler(this, LogLevel.WARN, ...args);\n this._logHandler(this, LogLevel.WARN, ...args);\n }\n error(...args) {\n this._userLogHandler && this._userLogHandler(this, LogLevel.ERROR, ...args);\n this._logHandler(this, LogLevel.ERROR, ...args);\n }\n}\nfunction setLogLevel(level) {\n instances.forEach(inst => {\n inst.setLogLevel(level);\n });\n}\nfunction setUserLogHandler(logCallback, options) {\n for (const instance of instances) {\n let customLogLevel = null;\n if (options && options.level) {\n customLogLevel = levelStringToEnum[options.level];\n }\n if (logCallback === null) {\n instance.userLogHandler = null;\n }\n else {\n instance.userLogHandler = (instance, level, ...args) => {\n const message = args\n .map(arg => {\n if (arg == null) {\n return null;\n }\n else if (typeof arg === 'string') {\n return arg;\n }\n else if (typeof arg === 'number' || typeof arg === 'boolean') {\n return arg.toString();\n }\n else if (arg instanceof Error) {\n return arg.message;\n }\n else {\n try {\n return JSON.stringify(arg);\n }\n catch (ignored) {\n return null;\n }\n }\n })\n .filter(arg => arg)\n .join(' ');\n if (level >= (customLogLevel !== null && customLogLevel !== void 0 ? customLogLevel : instance.logLevel)) {\n logCallback({\n level: LogLevel[level].toLowerCase(),\n message,\n args,\n type: instance.name\n });\n }\n };\n }\n }\n}\n\nexport { LogLevel, Logger, setLogLevel, setUserLogHandler };\n//# sourceMappingURL=index.esm2017.js.map\n","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst cursorRequestMap = new WeakMap();\nconst transactionDoneMap = new WeakMap();\nconst transactionStoreNamesMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n promise\n .then((value) => {\n // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval\n // (see wrapFunction).\n if (value instanceof IDBCursor) {\n cursorRequestMap.set(value, request);\n }\n // Catching to avoid \"Uncaught Promise exceptions\"\n })\n .catch(() => { });\n // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Polyfill for objectStoreNames because of Edge.\n if (prop === 'objectStoreNames') {\n return target.objectStoreNames || transactionStoreNamesMap.get(target);\n }\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Edge doesn't support objectStoreNames (booo), so we polyfill it here.\n if (func === IDBDatabase.prototype.transaction &&\n !('objectStoreNames' in IDBTransaction.prototype)) {\n return function (storeNames, ...args) {\n const tx = func.call(unwrap(this), storeNames, ...args);\n transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);\n return wrap(tx);\n };\n }\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(cursorRequestMap.get(this));\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\nexport { reverseTransformCache as a, instanceOfAny as i, replaceTraps as r, unwrap as u, wrap as w };\n","import { w as wrap, r as replaceTraps } from './wrap-idb-value.js';\nexport { u as unwrap, w as wrap } from './wrap-idb-value.js';\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nexport { deleteDB, openDB };\n","import { Component, ComponentContainer } from '@firebase/component';\nimport { Logger, setUserLogHandler, setLogLevel as setLogLevel$1 } from '@firebase/logger';\nimport { ErrorFactory, getDefaultAppConfig, deepEqual, isBrowser, isWebWorker, FirebaseError, base64urlEncodeWithoutPadding, isIndexedDBAvailable, validateIndexedDBOpenable } from '@firebase/util';\nexport { FirebaseError } from '@firebase/util';\nimport { openDB } from 'idb';\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass PlatformLoggerServiceImpl {\n constructor(container) {\n this.container = container;\n }\n // In initial implementation, this will be called by installations on\n // auth token refresh, and installations will send this string.\n getPlatformInfoString() {\n const providers = this.container.getProviders();\n // Loop through providers and get library/version pairs from any that are\n // version components.\n return providers\n .map(provider => {\n if (isVersionServiceProvider(provider)) {\n const service = provider.getImmediate();\n return `${service.library}/${service.version}`;\n }\n else {\n return null;\n }\n })\n .filter(logString => logString)\n .join(' ');\n }\n}\n/**\n *\n * @param provider check if this provider provides a VersionService\n *\n * NOTE: Using Provider<'app-version'> is a hack to indicate that the provider\n * provides VersionService. The provider is not necessarily a 'app-version'\n * provider.\n */\nfunction isVersionServiceProvider(provider) {\n const component = provider.getComponent();\n return (component === null || component === void 0 ? void 0 : component.type) === \"VERSION\" /* ComponentType.VERSION */;\n}\n\nconst name$q = \"@firebase/app\";\nconst version$1 = \"0.10.17\";\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst logger = new Logger('@firebase/app');\n\nconst name$p = \"@firebase/app-compat\";\n\nconst name$o = \"@firebase/analytics-compat\";\n\nconst name$n = \"@firebase/analytics\";\n\nconst name$m = \"@firebase/app-check-compat\";\n\nconst name$l = \"@firebase/app-check\";\n\nconst name$k = \"@firebase/auth\";\n\nconst name$j = \"@firebase/auth-compat\";\n\nconst name$i = \"@firebase/database\";\n\nconst name$h = \"@firebase/data-connect\";\n\nconst name$g = \"@firebase/database-compat\";\n\nconst name$f = \"@firebase/functions\";\n\nconst name$e = \"@firebase/functions-compat\";\n\nconst name$d = \"@firebase/installations\";\n\nconst name$c = \"@firebase/installations-compat\";\n\nconst name$b = \"@firebase/messaging\";\n\nconst name$a = \"@firebase/messaging-compat\";\n\nconst name$9 = \"@firebase/performance\";\n\nconst name$8 = \"@firebase/performance-compat\";\n\nconst name$7 = \"@firebase/remote-config\";\n\nconst name$6 = \"@firebase/remote-config-compat\";\n\nconst name$5 = \"@firebase/storage\";\n\nconst name$4 = \"@firebase/storage-compat\";\n\nconst name$3 = \"@firebase/firestore\";\n\nconst name$2 = \"@firebase/vertexai\";\n\nconst name$1 = \"@firebase/firestore-compat\";\n\nconst name = \"firebase\";\nconst version = \"11.1.0\";\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The default app name\n *\n * @internal\n */\nconst DEFAULT_ENTRY_NAME = '[DEFAULT]';\nconst PLATFORM_LOG_STRING = {\n [name$q]: 'fire-core',\n [name$p]: 'fire-core-compat',\n [name$n]: 'fire-analytics',\n [name$o]: 'fire-analytics-compat',\n [name$l]: 'fire-app-check',\n [name$m]: 'fire-app-check-compat',\n [name$k]: 'fire-auth',\n [name$j]: 'fire-auth-compat',\n [name$i]: 'fire-rtdb',\n [name$h]: 'fire-data-connect',\n [name$g]: 'fire-rtdb-compat',\n [name$f]: 'fire-fn',\n [name$e]: 'fire-fn-compat',\n [name$d]: 'fire-iid',\n [name$c]: 'fire-iid-compat',\n [name$b]: 'fire-fcm',\n [name$a]: 'fire-fcm-compat',\n [name$9]: 'fire-perf',\n [name$8]: 'fire-perf-compat',\n [name$7]: 'fire-rc',\n [name$6]: 'fire-rc-compat',\n [name$5]: 'fire-gcs',\n [name$4]: 'fire-gcs-compat',\n [name$3]: 'fire-fst',\n [name$1]: 'fire-fst-compat',\n [name$2]: 'fire-vertex',\n 'fire-js': 'fire-js', // Platform identifier for JS SDK.\n [name]: 'fire-js-all'\n};\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @internal\n */\nconst _apps = new Map();\n/**\n * @internal\n */\nconst _serverApps = new Map();\n/**\n * Registered components.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst _components = new Map();\n/**\n * @param component - the component being added to this app's container\n *\n * @internal\n */\nfunction _addComponent(app, component) {\n try {\n app.container.addComponent(component);\n }\n catch (e) {\n logger.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);\n }\n}\n/**\n *\n * @internal\n */\nfunction _addOrOverwriteComponent(app, component) {\n app.container.addOrOverwriteComponent(component);\n}\n/**\n *\n * @param component - the component to register\n * @returns whether or not the component is registered successfully\n *\n * @internal\n */\nfunction _registerComponent(component) {\n const componentName = component.name;\n if (_components.has(componentName)) {\n logger.debug(`There were multiple attempts to register component ${componentName}.`);\n return false;\n }\n _components.set(componentName, component);\n // add the component to existing app instances\n for (const app of _apps.values()) {\n _addComponent(app, component);\n }\n for (const serverApp of _serverApps.values()) {\n _addComponent(serverApp, component);\n }\n return true;\n}\n/**\n *\n * @param app - FirebaseApp instance\n * @param name - service name\n *\n * @returns the provider for the service with the matching name\n *\n * @internal\n */\nfunction _getProvider(app, name) {\n const heartbeatController = app.container\n .getProvider('heartbeat')\n .getImmediate({ optional: true });\n if (heartbeatController) {\n void heartbeatController.triggerHeartbeat();\n }\n return app.container.getProvider(name);\n}\n/**\n *\n * @param app - FirebaseApp instance\n * @param name - service name\n * @param instanceIdentifier - service instance identifier in case the service supports multiple instances\n *\n * @internal\n */\nfunction _removeServiceInstance(app, name, instanceIdentifier = DEFAULT_ENTRY_NAME) {\n _getProvider(app, name).clearInstance(instanceIdentifier);\n}\n/**\n *\n * @param obj - an object of type FirebaseApp or FirebaseOptions.\n *\n * @returns true if the provide object is of type FirebaseApp.\n *\n * @internal\n */\nfunction _isFirebaseApp(obj) {\n return obj.options !== undefined;\n}\n/**\n *\n * @param obj - an object of type FirebaseApp.\n *\n * @returns true if the provided object is of type FirebaseServerAppImpl.\n *\n * @internal\n */\nfunction _isFirebaseServerApp(obj) {\n return obj.settings !== undefined;\n}\n/**\n * Test only\n *\n * @internal\n */\nfunction _clearComponents() {\n _components.clear();\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst ERRORS = {\n [\"no-app\" /* AppError.NO_APP */]: \"No Firebase App '{$appName}' has been created - \" +\n 'call initializeApp() first',\n [\"bad-app-name\" /* AppError.BAD_APP_NAME */]: \"Illegal App name: '{$appName}'\",\n [\"duplicate-app\" /* AppError.DUPLICATE_APP */]: \"Firebase App named '{$appName}' already exists with different options or config\",\n [\"app-deleted\" /* AppError.APP_DELETED */]: \"Firebase App named '{$appName}' already deleted\",\n [\"server-app-deleted\" /* AppError.SERVER_APP_DELETED */]: 'Firebase Server App has been deleted',\n [\"no-options\" /* AppError.NO_OPTIONS */]: 'Need to provide options, when not being deployed to hosting via source.',\n [\"invalid-app-argument\" /* AppError.INVALID_APP_ARGUMENT */]: 'firebase.{$appName}() takes either no argument or a ' +\n 'Firebase App instance.',\n [\"invalid-log-argument\" /* AppError.INVALID_LOG_ARGUMENT */]: 'First argument to `onLog` must be null or a function.',\n [\"idb-open\" /* AppError.IDB_OPEN */]: 'Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.',\n [\"idb-get\" /* AppError.IDB_GET */]: 'Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.',\n [\"idb-set\" /* AppError.IDB_WRITE */]: 'Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.',\n [\"idb-delete\" /* AppError.IDB_DELETE */]: 'Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.',\n [\"finalization-registry-not-supported\" /* AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED */]: 'FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.',\n [\"invalid-server-app-environment\" /* AppError.INVALID_SERVER_APP_ENVIRONMENT */]: 'FirebaseServerApp is not for use in browser environments.'\n};\nconst ERROR_FACTORY = new ErrorFactory('app', 'Firebase', ERRORS);\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass FirebaseAppImpl {\n constructor(options, config, container) {\n this._isDeleted = false;\n this._options = Object.assign({}, options);\n this._config = Object.assign({}, config);\n this._name = config.name;\n this._automaticDataCollectionEnabled =\n config.automaticDataCollectionEnabled;\n this._container = container;\n this.container.addComponent(new Component('app', () => this, \"PUBLIC\" /* ComponentType.PUBLIC */));\n }\n get automaticDataCollectionEnabled() {\n this.checkDestroyed();\n return this._automaticDataCollectionEnabled;\n }\n set automaticDataCollectionEnabled(val) {\n this.checkDestroyed();\n this._automaticDataCollectionEnabled = val;\n }\n get name() {\n this.checkDestroyed();\n return this._name;\n }\n get options() {\n this.checkDestroyed();\n return this._options;\n }\n get config() {\n this.checkDestroyed();\n return this._config;\n }\n get container() {\n return this._container;\n }\n get isDeleted() {\n return this._isDeleted;\n }\n set isDeleted(val) {\n this._isDeleted = val;\n }\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n checkDestroyed() {\n if (this.isDeleted) {\n throw ERROR_FACTORY.create(\"app-deleted\" /* AppError.APP_DELETED */, { appName: this._name });\n }\n }\n}\n\n/**\n * @license\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass FirebaseServerAppImpl extends FirebaseAppImpl {\n constructor(options, serverConfig, name, container) {\n // Build configuration parameters for the FirebaseAppImpl base class.\n const automaticDataCollectionEnabled = serverConfig.automaticDataCollectionEnabled !== undefined\n ? serverConfig.automaticDataCollectionEnabled\n : false;\n // Create the FirebaseAppSettings object for the FirebaseAppImp constructor.\n const config = {\n name,\n automaticDataCollectionEnabled\n };\n if (options.apiKey !== undefined) {\n // Construct the parent FirebaseAppImp object.\n super(options, config, container);\n }\n else {\n const appImpl = options;\n super(appImpl.options, config, container);\n }\n // Now construct the data for the FirebaseServerAppImpl.\n this._serverConfig = Object.assign({ automaticDataCollectionEnabled }, serverConfig);\n this._finalizationRegistry = null;\n if (typeof FinalizationRegistry !== 'undefined') {\n this._finalizationRegistry = new FinalizationRegistry(() => {\n this.automaticCleanup();\n });\n }\n this._refCount = 0;\n this.incRefCount(this._serverConfig.releaseOnDeref);\n // Do not retain a hard reference to the dref object, otherwise the FinalizationRegistry\n // will never trigger.\n this._serverConfig.releaseOnDeref = undefined;\n serverConfig.releaseOnDeref = undefined;\n registerVersion(name$q, version$1, 'serverapp');\n }\n toJSON() {\n return undefined;\n }\n get refCount() {\n return this._refCount;\n }\n // Increment the reference count of this server app. If an object is provided, register it\n // with the finalization registry.\n incRefCount(obj) {\n if (this.isDeleted) {\n return;\n }\n this._refCount++;\n if (obj !== undefined && this._finalizationRegistry !== null) {\n this._finalizationRegistry.register(obj, this);\n }\n }\n // Decrement the reference count.\n decRefCount() {\n if (this.isDeleted) {\n return 0;\n }\n return --this._refCount;\n }\n // Invoked by the FinalizationRegistry callback to note that this app should go through its\n // reference counts and delete itself if no reference count remain. The coordinating logic that\n // handles this is in deleteApp(...).\n automaticCleanup() {\n void deleteApp(this);\n }\n get settings() {\n this.checkDestroyed();\n return this._serverConfig;\n }\n /**\n * This function will throw an Error if the App has already been deleted -\n * use before performing API actions on the App.\n */\n checkDestroyed() {\n if (this.isDeleted) {\n throw ERROR_FACTORY.create(\"server-app-deleted\" /* AppError.SERVER_APP_DELETED */);\n }\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The current SDK version.\n *\n * @public\n */\nconst SDK_VERSION = version;\nfunction initializeApp(_options, rawConfig = {}) {\n let options = _options;\n if (typeof rawConfig !== 'object') {\n const name = rawConfig;\n rawConfig = { name };\n }\n const config = Object.assign({ name: DEFAULT_ENTRY_NAME, automaticDataCollectionEnabled: false }, rawConfig);\n const name = config.name;\n if (typeof name !== 'string' || !name) {\n throw ERROR_FACTORY.create(\"bad-app-name\" /* AppError.BAD_APP_NAME */, {\n appName: String(name)\n });\n }\n options || (options = getDefaultAppConfig());\n if (!options) {\n throw ERROR_FACTORY.create(\"no-options\" /* AppError.NO_OPTIONS */);\n }\n const existingApp = _apps.get(name);\n if (existingApp) {\n // return the existing app if options and config deep equal the ones in the existing app.\n if (deepEqual(options, existingApp.options) &&\n deepEqual(config, existingApp.config)) {\n return existingApp;\n }\n else {\n throw ERROR_FACTORY.create(\"duplicate-app\" /* AppError.DUPLICATE_APP */, { appName: name });\n }\n }\n const container = new ComponentContainer(name);\n for (const component of _components.values()) {\n container.addComponent(component);\n }\n const newApp = new FirebaseAppImpl(options, config, container);\n _apps.set(name, newApp);\n return newApp;\n}\nfunction initializeServerApp(_options, _serverAppConfig) {\n if (isBrowser() && !isWebWorker()) {\n // FirebaseServerApp isn't designed to be run in browsers.\n throw ERROR_FACTORY.create(\"invalid-server-app-environment\" /* AppError.INVALID_SERVER_APP_ENVIRONMENT */);\n }\n if (_serverAppConfig.automaticDataCollectionEnabled === undefined) {\n _serverAppConfig.automaticDataCollectionEnabled = false;\n }\n let appOptions;\n if (_isFirebaseApp(_options)) {\n appOptions = _options.options;\n }\n else {\n appOptions = _options;\n }\n // Build an app name based on a hash of the configuration options.\n const nameObj = Object.assign(Object.assign({}, _serverAppConfig), appOptions);\n // However, Do not mangle the name based on releaseOnDeref, since it will vary between the\n // construction of FirebaseServerApp instances. For example, if the object is the request headers.\n if (nameObj.releaseOnDeref !== undefined) {\n delete nameObj.releaseOnDeref;\n }\n const hashCode = (s) => {\n return [...s].reduce((hash, c) => (Math.imul(31, hash) + c.charCodeAt(0)) | 0, 0);\n };\n if (_serverAppConfig.releaseOnDeref !== undefined) {\n if (typeof FinalizationRegistry === 'undefined') {\n throw ERROR_FACTORY.create(\"finalization-registry-not-supported\" /* AppError.FINALIZATION_REGISTRY_NOT_SUPPORTED */, {});\n }\n }\n const nameString = '' + hashCode(JSON.stringify(nameObj));\n const existingApp = _serverApps.get(nameString);\n if (existingApp) {\n existingApp.incRefCount(_serverAppConfig.releaseOnDeref);\n return existingApp;\n }\n const container = new ComponentContainer(nameString);\n for (const component of _components.values()) {\n container.addComponent(component);\n }\n const newApp = new FirebaseServerAppImpl(appOptions, _serverAppConfig, nameString, container);\n _serverApps.set(nameString, newApp);\n return newApp;\n}\n/**\n * Retrieves a {@link @firebase/app#FirebaseApp} instance.\n *\n * When called with no arguments, the default app is returned. When an app name\n * is provided, the app corresponding to that name is returned.\n *\n * An exception is thrown if the app being retrieved has not yet been\n * initialized.\n *\n * @example\n * ```javascript\n * // Return the default app\n * const app = getApp();\n * ```\n *\n * @example\n * ```javascript\n * // Return a named app\n * const otherApp = getApp(\"otherApp\");\n * ```\n *\n * @param name - Optional name of the app to return. If no name is\n * provided, the default is `\"[DEFAULT]\"`.\n *\n * @returns The app corresponding to the provided app name.\n * If no app name is provided, the default app is returned.\n *\n * @public\n */\nfunction getApp(name = DEFAULT_ENTRY_NAME) {\n const app = _apps.get(name);\n if (!app && name === DEFAULT_ENTRY_NAME && getDefaultAppConfig()) {\n return initializeApp();\n }\n if (!app) {\n throw ERROR_FACTORY.create(\"no-app\" /* AppError.NO_APP */, { appName: name });\n }\n return app;\n}\n/**\n * A (read-only) array of all initialized apps.\n * @public\n */\nfunction getApps() {\n return Array.from(_apps.values());\n}\n/**\n * Renders this app unusable and frees the resources of all associated\n * services.\n *\n * @example\n * ```javascript\n * deleteApp(app)\n * .then(function() {\n * console.log(\"App deleted successfully\");\n * })\n * .catch(function(error) {\n * console.log(\"Error deleting app:\", error);\n * });\n * ```\n *\n * @public\n */\nasync function deleteApp(app) {\n let cleanupProviders = false;\n const name = app.name;\n if (_apps.has(name)) {\n cleanupProviders = true;\n _apps.delete(name);\n }\n else if (_serverApps.has(name)) {\n const firebaseServerApp = app;\n if (firebaseServerApp.decRefCount() <= 0) {\n _serverApps.delete(name);\n cleanupProviders = true;\n }\n }\n if (cleanupProviders) {\n await Promise.all(app.container\n .getProviders()\n .map(provider => provider.delete()));\n app.isDeleted = true;\n }\n}\n/**\n * Registers a library's name and version for platform logging purposes.\n * @param library - Name of 1p or 3p library (e.g. firestore, angularfire)\n * @param version - Current version of that library.\n * @param variant - Bundle variant, e.g., node, rn, etc.\n *\n * @public\n */\nfunction registerVersion(libraryKeyOrName, version, variant) {\n var _a;\n // TODO: We can use this check to whitelist strings when/if we set up\n // a good whitelist system.\n let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\n if (variant) {\n library += `-${variant}`;\n }\n const libraryMismatch = library.match(/\\s|\\//);\n const versionMismatch = version.match(/\\s|\\//);\n if (libraryMismatch || versionMismatch) {\n const warning = [\n `Unable to register library \"${library}\" with version \"${version}\":`\n ];\n if (libraryMismatch) {\n warning.push(`library name \"${library}\" contains illegal characters (whitespace or \"/\")`);\n }\n if (libraryMismatch && versionMismatch) {\n warning.push('and');\n }\n if (versionMismatch) {\n warning.push(`version name \"${version}\" contains illegal characters (whitespace or \"/\")`);\n }\n logger.warn(warning.join(' '));\n return;\n }\n _registerComponent(new Component(`${library}-version`, () => ({ library, version }), \"VERSION\" /* ComponentType.VERSION */));\n}\n/**\n * Sets log handler for all Firebase SDKs.\n * @param logCallback - An optional custom log handler that executes user code whenever\n * the Firebase SDK makes a logging call.\n *\n * @public\n */\nfunction onLog(logCallback, options) {\n if (logCallback !== null && typeof logCallback !== 'function') {\n throw ERROR_FACTORY.create(\"invalid-log-argument\" /* AppError.INVALID_LOG_ARGUMENT */);\n }\n setUserLogHandler(logCallback, options);\n}\n/**\n * Sets log level for all Firebase SDKs.\n *\n * All of the log types above the current log level are captured (i.e. if\n * you set the log level to `info`, errors are logged, but `debug` and\n * `verbose` logs are not).\n *\n * @public\n */\nfunction setLogLevel(logLevel) {\n setLogLevel$1(logLevel);\n}\n\n/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst DB_NAME = 'firebase-heartbeat-database';\nconst DB_VERSION = 1;\nconst STORE_NAME = 'firebase-heartbeat-store';\nlet dbPromise = null;\nfunction getDbPromise() {\n if (!dbPromise) {\n dbPromise = openDB(DB_NAME, DB_VERSION, {\n upgrade: (db, oldVersion) => {\n // We don't use 'break' in this switch statement, the fall-through\n // behavior is what we want, because if there are multiple versions between\n // the old version and the current version, we want ALL the migrations\n // that correspond to those versions to run, not only the last one.\n // eslint-disable-next-line default-case\n switch (oldVersion) {\n case 0:\n try {\n db.createObjectStore(STORE_NAME);\n }\n catch (e) {\n // Safari/iOS browsers throw occasional exceptions on\n // db.createObjectStore() that may be a bug. Avoid blocking\n // the rest of the app functionality.\n console.warn(e);\n }\n }\n }\n }).catch(e => {\n throw ERROR_FACTORY.create(\"idb-open\" /* AppError.IDB_OPEN */, {\n originalErrorMessage: e.message\n });\n });\n }\n return dbPromise;\n}\nasync function readHeartbeatsFromIndexedDB(app) {\n try {\n const db = await getDbPromise();\n const tx = db.transaction(STORE_NAME);\n const result = await tx.objectStore(STORE_NAME).get(computeKey(app));\n // We already have the value but tx.done can throw,\n // so we need to await it here to catch errors\n await tx.done;\n return result;\n }\n catch (e) {\n if (e instanceof FirebaseError) {\n logger.warn(e.message);\n }\n else {\n const idbGetError = ERROR_FACTORY.create(\"idb-get\" /* AppError.IDB_GET */, {\n originalErrorMessage: e === null || e === void 0 ? void 0 : e.message\n });\n logger.warn(idbGetError.message);\n }\n }\n}\nasync function writeHeartbeatsToIndexedDB(app, heartbeatObject) {\n try {\n const db = await getDbPromise();\n const tx = db.transaction(STORE_NAME, 'readwrite');\n const objectStore = tx.objectStore(STORE_NAME);\n await objectStore.put(heartbeatObject, computeKey(app));\n await tx.done;\n }\n catch (e) {\n if (e instanceof FirebaseError) {\n logger.warn(e.message);\n }\n else {\n const idbGetError = ERROR_FACTORY.create(\"idb-set\" /* AppError.IDB_WRITE */, {\n originalErrorMessage: e === null || e === void 0 ? void 0 : e.message\n });\n logger.warn(idbGetError.message);\n }\n }\n}\nfunction computeKey(app) {\n return `${app.name}!${app.options.appId}`;\n}\n\n/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst MAX_HEADER_BYTES = 1024;\n// 30 days\nconst STORED_HEARTBEAT_RETENTION_MAX_MILLIS = 30 * 24 * 60 * 60 * 1000;\nclass HeartbeatServiceImpl {\n constructor(container) {\n this.container = container;\n /**\n * In-memory cache for heartbeats, used by getHeartbeatsHeader() to generate\n * the header string.\n * Stores one record per date. This will be consolidated into the standard\n * format of one record per user agent string before being sent as a header.\n * Populated from indexedDB when the controller is instantiated and should\n * be kept in sync with indexedDB.\n * Leave public for easier testing.\n */\n this._heartbeatsCache = null;\n const app = this.container.getProvider('app').getImmediate();\n this._storage = new HeartbeatStorageImpl(app);\n this._heartbeatsCachePromise = this._storage.read().then(result => {\n this._heartbeatsCache = result;\n return result;\n });\n }\n /**\n * Called to report a heartbeat. The function will generate\n * a HeartbeatsByUserAgent object, update heartbeatsCache, and persist it\n * to IndexedDB.\n * Note that we only store one heartbeat per day. So if a heartbeat for today is\n * already logged, subsequent calls to this function in the same day will be ignored.\n */\n async triggerHeartbeat() {\n var _a, _b;\n try {\n const platformLogger = this.container\n .getProvider('platform-logger')\n .getImmediate();\n // This is the \"Firebase user agent\" string from the platform logger\n // service, not the browser user agent.\n const agent = platformLogger.getPlatformInfoString();\n const date = getUTCDateString();\n if (((_a = this._heartbeatsCache) === null || _a === void 0 ? void 0 : _a.heartbeats) == null) {\n this._heartbeatsCache = await this._heartbeatsCachePromise;\n // If we failed to construct a heartbeats cache, then return immediately.\n if (((_b = this._heartbeatsCache) === null || _b === void 0 ? void 0 : _b.heartbeats) == null) {\n return;\n }\n }\n // Do not store a heartbeat if one is already stored for this day\n // or if a header has already been sent today.\n if (this._heartbeatsCache.lastSentHeartbeatDate === date ||\n this._heartbeatsCache.heartbeats.some(singleDateHeartbeat => singleDateHeartbeat.date === date)) {\n return;\n }\n else {\n // There is no entry for this date. Create one.\n this._heartbeatsCache.heartbeats.push({ date, agent });\n }\n // Remove entries older than 30 days.\n this._heartbeatsCache.heartbeats =\n this._heartbeatsCache.heartbeats.filter(singleDateHeartbeat => {\n const hbTimestamp = new Date(singleDateHeartbeat.date).valueOf();\n const now = Date.now();\n return now - hbTimestamp <= STORED_HEARTBEAT_RETENTION_MAX_MILLIS;\n });\n return this._storage.overwrite(this._heartbeatsCache);\n }\n catch (e) {\n logger.warn(e);\n }\n }\n /**\n * Returns a base64 encoded string which can be attached to the heartbeat-specific header directly.\n * It also clears all heartbeats from memory as well as in IndexedDB.\n *\n * NOTE: Consuming product SDKs should not send the header if this method\n * returns an empty string.\n */\n async getHeartbeatsHeader() {\n var _a;\n try {\n if (this._heartbeatsCache === null) {\n await this._heartbeatsCachePromise;\n }\n // If it's still null or the array is empty, there is no data to send.\n if (((_a = this._heartbeatsCache) === null || _a === void 0 ? void 0 : _a.heartbeats) == null ||\n this._heartbeatsCache.heartbeats.length === 0) {\n return '';\n }\n const date = getUTCDateString();\n // Extract as many heartbeats from the cache as will fit under the size limit.\n const { heartbeatsToSend, unsentEntries } = extractHeartbeatsForHeader(this._heartbeatsCache.heartbeats);\n const headerString = base64urlEncodeWithoutPadding(JSON.stringify({ version: 2, heartbeats: heartbeatsToSend }));\n // Store last sent date to prevent another being logged/sent for the same day.\n this._heartbeatsCache.lastSentHeartbeatDate = date;\n if (unsentEntries.length > 0) {\n // Store any unsent entries if they exist.\n this._heartbeatsCache.heartbeats = unsentEntries;\n // This seems more likely than emptying the array (below) to lead to some odd state\n // since the cache isn't empty and this will be called again on the next request,\n // and is probably safest if we await it.\n await this._storage.overwrite(this._heartbeatsCache);\n }\n else {\n this._heartbeatsCache.heartbeats = [];\n // Do not wait for this, to reduce latency.\n void this._storage.overwrite(this._heartbeatsCache);\n }\n return headerString;\n }\n catch (e) {\n logger.warn(e);\n return '';\n }\n }\n}\nfunction getUTCDateString() {\n const today = new Date();\n // Returns date format 'YYYY-MM-DD'\n return today.toISOString().substring(0, 10);\n}\nfunction extractHeartbeatsForHeader(heartbeatsCache, maxSize = MAX_HEADER_BYTES) {\n // Heartbeats grouped by user agent in the standard format to be sent in\n // the header.\n const heartbeatsToSend = [];\n // Single date format heartbeats that are not sent.\n let unsentEntries = heartbeatsCache.slice();\n for (const singleDateHeartbeat of heartbeatsCache) {\n // Look for an existing entry with the same user agent.\n const heartbeatEntry = heartbeatsToSend.find(hb => hb.agent === singleDateHeartbeat.agent);\n if (!heartbeatEntry) {\n // If no entry for this user agent exists, create one.\n heartbeatsToSend.push({\n agent: singleDateHeartbeat.agent,\n dates: [singleDateHeartbeat.date]\n });\n if (countBytes(heartbeatsToSend) > maxSize) {\n // If the header would exceed max size, remove the added heartbeat\n // entry and stop adding to the header.\n heartbeatsToSend.pop();\n break;\n }\n }\n else {\n heartbeatEntry.dates.push(singleDateHeartbeat.date);\n // If the header would exceed max size, remove the added date\n // and stop adding to the header.\n if (countBytes(heartbeatsToSend) > maxSize) {\n heartbeatEntry.dates.pop();\n break;\n }\n }\n // Pop unsent entry from queue. (Skipped if adding the entry exceeded\n // quota and the loop breaks early.)\n unsentEntries = unsentEntries.slice(1);\n }\n return {\n heartbeatsToSend,\n unsentEntries\n };\n}\nclass HeartbeatStorageImpl {\n constructor(app) {\n this.app = app;\n this._canUseIndexedDBPromise = this.runIndexedDBEnvironmentCheck();\n }\n async runIndexedDBEnvironmentCheck() {\n if (!isIndexedDBAvailable()) {\n return false;\n }\n else {\n return validateIndexedDBOpenable()\n .then(() => true)\n .catch(() => false);\n }\n }\n /**\n * Read all heartbeats.\n */\n async read() {\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\n if (!canUseIndexedDB) {\n return { heartbeats: [] };\n }\n else {\n const idbHeartbeatObject = await readHeartbeatsFromIndexedDB(this.app);\n if (idbHeartbeatObject === null || idbHeartbeatObject === void 0 ? void 0 : idbHeartbeatObject.heartbeats) {\n return idbHeartbeatObject;\n }\n else {\n return { heartbeats: [] };\n }\n }\n }\n // overwrite the storage with the provided heartbeats\n async overwrite(heartbeatsObject) {\n var _a;\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\n if (!canUseIndexedDB) {\n return;\n }\n else {\n const existingHeartbeatsObject = await this.read();\n return writeHeartbeatsToIndexedDB(this.app, {\n lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\n heartbeats: heartbeatsObject.heartbeats\n });\n }\n }\n // add heartbeats\n async add(heartbeatsObject) {\n var _a;\n const canUseIndexedDB = await this._canUseIndexedDBPromise;\n if (!canUseIndexedDB) {\n return;\n }\n else {\n const existingHeartbeatsObject = await this.read();\n return writeHeartbeatsToIndexedDB(this.app, {\n lastSentHeartbeatDate: (_a = heartbeatsObject.lastSentHeartbeatDate) !== null && _a !== void 0 ? _a : existingHeartbeatsObject.lastSentHeartbeatDate,\n heartbeats: [\n ...existingHeartbeatsObject.heartbeats,\n ...heartbeatsObject.heartbeats\n ]\n });\n }\n }\n}\n/**\n * Calculate bytes of a HeartbeatsByUserAgent array after being wrapped\n * in a platform logging header JSON object, stringified, and converted\n * to base 64.\n */\nfunction countBytes(heartbeatsCache) {\n // base64 has a restricted set of characters, all of which should be 1 byte.\n return base64urlEncodeWithoutPadding(\n // heartbeatsCache wrapper properties\n JSON.stringify({ version: 2, heartbeats: heartbeatsCache })).length;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction registerCoreComponents(variant) {\n _registerComponent(new Component('platform-logger', container => new PlatformLoggerServiceImpl(container), \"PRIVATE\" /* ComponentType.PRIVATE */));\n _registerComponent(new Component('heartbeat', container => new HeartbeatServiceImpl(container), \"PRIVATE\" /* ComponentType.PRIVATE */));\n // Register `app` package.\n registerVersion(name$q, version$1, variant);\n // BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation\n registerVersion(name$q, version$1, 'esm2017');\n // Register platform SDK identifier (no version).\n registerVersion('fire-js', '');\n}\n\n/**\n * Firebase App\n *\n * @remarks This package coordinates the communication between the different Firebase components\n * @packageDocumentation\n */\nregisterCoreComponents('');\n\nexport { SDK_VERSION, DEFAULT_ENTRY_NAME as _DEFAULT_ENTRY_NAME, _addComponent, _addOrOverwriteComponent, _apps, _clearComponents, _components, _getProvider, _isFirebaseApp, _isFirebaseServerApp, _registerComponent, _removeServiceInstance, _serverApps, deleteApp, getApp, getApps, initializeApp, initializeServerApp, onLog, registerVersion, setLogLevel };\n//# sourceMappingURL=index.esm2017.js.map\n","import { _getProvider, getApp, _registerComponent, registerVersion } from '@firebase/app';\nimport { Component } from '@firebase/component';\nimport { ErrorFactory, FirebaseError } from '@firebase/util';\nimport { openDB } from 'idb';\n\nconst name = \"@firebase/installations\";\nconst version = \"0.6.11\";\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst PENDING_TIMEOUT_MS = 10000;\nconst PACKAGE_VERSION = `w:${version}`;\nconst INTERNAL_AUTH_VERSION = 'FIS_v2';\nconst INSTALLATIONS_API_URL = 'https://firebaseinstallations.googleapis.com/v1';\nconst TOKEN_EXPIRATION_BUFFER = 60 * 60 * 1000; // One hour\nconst SERVICE = 'installations';\nconst SERVICE_NAME = 'Installations';\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst ERROR_DESCRIPTION_MAP = {\n [\"missing-app-config-values\" /* ErrorCode.MISSING_APP_CONFIG_VALUES */]: 'Missing App configuration value: \"{$valueName}\"',\n [\"not-registered\" /* ErrorCode.NOT_REGISTERED */]: 'Firebase Installation is not registered.',\n [\"installation-not-found\" /* ErrorCode.INSTALLATION_NOT_FOUND */]: 'Firebase Installation not found.',\n [\"request-failed\" /* ErrorCode.REQUEST_FAILED */]: '{$requestName} request failed with error \"{$serverCode} {$serverStatus}: {$serverMessage}\"',\n [\"app-offline\" /* ErrorCode.APP_OFFLINE */]: 'Could not process request. Application offline.',\n [\"delete-pending-registration\" /* ErrorCode.DELETE_PENDING_REGISTRATION */]: \"Can't delete installation while there is a pending registration request.\"\n};\nconst ERROR_FACTORY = new ErrorFactory(SERVICE, SERVICE_NAME, ERROR_DESCRIPTION_MAP);\n/** Returns true if error is a FirebaseError that is based on an error from the server. */\nfunction isServerError(error) {\n return (error instanceof FirebaseError &&\n error.code.includes(\"request-failed\" /* ErrorCode.REQUEST_FAILED */));\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction getInstallationsEndpoint({ projectId }) {\n return `${INSTALLATIONS_API_URL}/projects/${projectId}/installations`;\n}\nfunction extractAuthTokenInfoFromResponse(response) {\n return {\n token: response.token,\n requestStatus: 2 /* RequestStatus.COMPLETED */,\n expiresIn: getExpiresInFromResponseExpiresIn(response.expiresIn),\n creationTime: Date.now()\n };\n}\nasync function getErrorFromResponse(requestName, response) {\n const responseJson = await response.json();\n const errorData = responseJson.error;\n return ERROR_FACTORY.create(\"request-failed\" /* ErrorCode.REQUEST_FAILED */, {\n requestName,\n serverCode: errorData.code,\n serverMessage: errorData.message,\n serverStatus: errorData.status\n });\n}\nfunction getHeaders({ apiKey }) {\n return new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'x-goog-api-key': apiKey\n });\n}\nfunction getHeadersWithAuth(appConfig, { refreshToken }) {\n const headers = getHeaders(appConfig);\n headers.append('Authorization', getAuthorizationHeader(refreshToken));\n return headers;\n}\n/**\n * Calls the passed in fetch wrapper and returns the response.\n * If the returned response has a status of 5xx, re-runs the function once and\n * returns the response.\n */\nasync function retryIfServerError(fn) {\n const result = await fn();\n if (result.status >= 500 && result.status < 600) {\n // Internal Server Error. Retry request.\n return fn();\n }\n return result;\n}\nfunction getExpiresInFromResponseExpiresIn(responseExpiresIn) {\n // This works because the server will never respond with fractions of a second.\n return Number(responseExpiresIn.replace('s', '000'));\n}\nfunction getAuthorizationHeader(refreshToken) {\n return `${INTERNAL_AUTH_VERSION} ${refreshToken}`;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nasync function createInstallationRequest({ appConfig, heartbeatServiceProvider }, { fid }) {\n const endpoint = getInstallationsEndpoint(appConfig);\n const headers = getHeaders(appConfig);\n // If heartbeat service exists, add the heartbeat string to the header.\n const heartbeatService = heartbeatServiceProvider.getImmediate({\n optional: true\n });\n if (heartbeatService) {\n const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader();\n if (heartbeatsHeader) {\n headers.append('x-firebase-client', heartbeatsHeader);\n }\n }\n const body = {\n fid,\n authVersion: INTERNAL_AUTH_VERSION,\n appId: appConfig.appId,\n sdkVersion: PACKAGE_VERSION\n };\n const request = {\n method: 'POST',\n headers,\n body: JSON.stringify(body)\n };\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (response.ok) {\n const responseValue = await response.json();\n const registeredInstallationEntry = {\n fid: responseValue.fid || fid,\n registrationStatus: 2 /* RequestStatus.COMPLETED */,\n refreshToken: responseValue.refreshToken,\n authToken: extractAuthTokenInfoFromResponse(responseValue.authToken)\n };\n return registeredInstallationEntry;\n }\n else {\n throw await getErrorFromResponse('Create Installation', response);\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Returns a promise that resolves after given time passes. */\nfunction sleep(ms) {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction bufferToBase64UrlSafe(array) {\n const b64 = btoa(String.fromCharCode(...array));\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_');\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst VALID_FID_PATTERN = /^[cdef][\\w-]{21}$/;\nconst INVALID_FID = '';\n/**\n * Generates a new FID using random values from Web Crypto API.\n * Returns an empty string if FID generation fails for any reason.\n */\nfunction generateFid() {\n try {\n // A valid FID has exactly 22 base64 characters, which is 132 bits, or 16.5\n // bytes. our implementation generates a 17 byte array instead.\n const fidByteArray = new Uint8Array(17);\n const crypto = self.crypto || self.msCrypto;\n crypto.getRandomValues(fidByteArray);\n // Replace the first 4 random bits with the constant FID header of 0b0111.\n fidByteArray[0] = 0b01110000 + (fidByteArray[0] % 0b00010000);\n const fid = encode(fidByteArray);\n return VALID_FID_PATTERN.test(fid) ? fid : INVALID_FID;\n }\n catch (_a) {\n // FID generation errored\n return INVALID_FID;\n }\n}\n/** Converts a FID Uint8Array to a base64 string representation. */\nfunction encode(fidByteArray) {\n const b64String = bufferToBase64UrlSafe(fidByteArray);\n // Remove the 23rd character that was added because of the extra 4 bits at the\n // end of our 17 byte array, and the '=' padding.\n return b64String.substr(0, 22);\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Returns a string key that can be used to identify the app. */\nfunction getKey(appConfig) {\n return `${appConfig.appName}!${appConfig.appId}`;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst fidChangeCallbacks = new Map();\n/**\n * Calls the onIdChange callbacks with the new FID value, and broadcasts the\n * change to other tabs.\n */\nfunction fidChanged(appConfig, fid) {\n const key = getKey(appConfig);\n callFidChangeCallbacks(key, fid);\n broadcastFidChange(key, fid);\n}\nfunction addCallback(appConfig, callback) {\n // Open the broadcast channel if it's not already open,\n // to be able to listen to change events from other tabs.\n getBroadcastChannel();\n const key = getKey(appConfig);\n let callbackSet = fidChangeCallbacks.get(key);\n if (!callbackSet) {\n callbackSet = new Set();\n fidChangeCallbacks.set(key, callbackSet);\n }\n callbackSet.add(callback);\n}\nfunction removeCallback(appConfig, callback) {\n const key = getKey(appConfig);\n const callbackSet = fidChangeCallbacks.get(key);\n if (!callbackSet) {\n return;\n }\n callbackSet.delete(callback);\n if (callbackSet.size === 0) {\n fidChangeCallbacks.delete(key);\n }\n // Close broadcast channel if there are no more callbacks.\n closeBroadcastChannel();\n}\nfunction callFidChangeCallbacks(key, fid) {\n const callbacks = fidChangeCallbacks.get(key);\n if (!callbacks) {\n return;\n }\n for (const callback of callbacks) {\n callback(fid);\n }\n}\nfunction broadcastFidChange(key, fid) {\n const channel = getBroadcastChannel();\n if (channel) {\n channel.postMessage({ key, fid });\n }\n closeBroadcastChannel();\n}\nlet broadcastChannel = null;\n/** Opens and returns a BroadcastChannel if it is supported by the browser. */\nfunction getBroadcastChannel() {\n if (!broadcastChannel && 'BroadcastChannel' in self) {\n broadcastChannel = new BroadcastChannel('[Firebase] FID Change');\n broadcastChannel.onmessage = e => {\n callFidChangeCallbacks(e.data.key, e.data.fid);\n };\n }\n return broadcastChannel;\n}\nfunction closeBroadcastChannel() {\n if (fidChangeCallbacks.size === 0 && broadcastChannel) {\n broadcastChannel.close();\n broadcastChannel = null;\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst DATABASE_NAME = 'firebase-installations-database';\nconst DATABASE_VERSION = 1;\nconst OBJECT_STORE_NAME = 'firebase-installations-store';\nlet dbPromise = null;\nfunction getDbPromise() {\n if (!dbPromise) {\n dbPromise = openDB(DATABASE_NAME, DATABASE_VERSION, {\n upgrade: (db, oldVersion) => {\n // We don't use 'break' in this switch statement, the fall-through\n // behavior is what we want, because if there are multiple versions between\n // the old version and the current version, we want ALL the migrations\n // that correspond to those versions to run, not only the last one.\n // eslint-disable-next-line default-case\n switch (oldVersion) {\n case 0:\n db.createObjectStore(OBJECT_STORE_NAME);\n }\n }\n });\n }\n return dbPromise;\n}\n/** Assigns or overwrites the record for the given key with the given value. */\nasync function set(appConfig, value) {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n const objectStore = tx.objectStore(OBJECT_STORE_NAME);\n const oldValue = (await objectStore.get(key));\n await objectStore.put(value, key);\n await tx.done;\n if (!oldValue || oldValue.fid !== value.fid) {\n fidChanged(appConfig, value.fid);\n }\n return value;\n}\n/** Removes record(s) from the objectStore that match the given key. */\nasync function remove(appConfig) {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).delete(key);\n await tx.done;\n}\n/**\n * Atomically updates a record with the result of updateFn, which gets\n * called with the current value. If newValue is undefined, the record is\n * deleted instead.\n * @return Updated value\n */\nasync function update(appConfig, updateFn) {\n const key = getKey(appConfig);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n const store = tx.objectStore(OBJECT_STORE_NAME);\n const oldValue = (await store.get(key));\n const newValue = updateFn(oldValue);\n if (newValue === undefined) {\n await store.delete(key);\n }\n else {\n await store.put(newValue, key);\n }\n await tx.done;\n if (newValue && (!oldValue || oldValue.fid !== newValue.fid)) {\n fidChanged(appConfig, newValue.fid);\n }\n return newValue;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Updates and returns the InstallationEntry from the database.\n * Also triggers a registration request if it is necessary and possible.\n */\nasync function getInstallationEntry(installations) {\n let registrationPromise;\n const installationEntry = await update(installations.appConfig, oldEntry => {\n const installationEntry = updateOrCreateInstallationEntry(oldEntry);\n const entryWithPromise = triggerRegistrationIfNecessary(installations, installationEntry);\n registrationPromise = entryWithPromise.registrationPromise;\n return entryWithPromise.installationEntry;\n });\n if (installationEntry.fid === INVALID_FID) {\n // FID generation failed. Waiting for the FID from the server.\n return { installationEntry: await registrationPromise };\n }\n return {\n installationEntry,\n registrationPromise\n };\n}\n/**\n * Creates a new Installation Entry if one does not exist.\n * Also clears timed out pending requests.\n */\nfunction updateOrCreateInstallationEntry(oldEntry) {\n const entry = oldEntry || {\n fid: generateFid(),\n registrationStatus: 0 /* RequestStatus.NOT_STARTED */\n };\n return clearTimedOutRequest(entry);\n}\n/**\n * If the Firebase Installation is not registered yet, this will trigger the\n * registration and return an InProgressInstallationEntry.\n *\n * If registrationPromise does not exist, the installationEntry is guaranteed\n * to be registered.\n */\nfunction triggerRegistrationIfNecessary(installations, installationEntry) {\n if (installationEntry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) {\n if (!navigator.onLine) {\n // Registration required but app is offline.\n const registrationPromiseWithError = Promise.reject(ERROR_FACTORY.create(\"app-offline\" /* ErrorCode.APP_OFFLINE */));\n return {\n installationEntry,\n registrationPromise: registrationPromiseWithError\n };\n }\n // Try registering. Change status to IN_PROGRESS.\n const inProgressEntry = {\n fid: installationEntry.fid,\n registrationStatus: 1 /* RequestStatus.IN_PROGRESS */,\n registrationTime: Date.now()\n };\n const registrationPromise = registerInstallation(installations, inProgressEntry);\n return { installationEntry: inProgressEntry, registrationPromise };\n }\n else if (installationEntry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) {\n return {\n installationEntry,\n registrationPromise: waitUntilFidRegistration(installations)\n };\n }\n else {\n return { installationEntry };\n }\n}\n/** This will be executed only once for each new Firebase Installation. */\nasync function registerInstallation(installations, installationEntry) {\n try {\n const registeredInstallationEntry = await createInstallationRequest(installations, installationEntry);\n return set(installations.appConfig, registeredInstallationEntry);\n }\n catch (e) {\n if (isServerError(e) && e.customData.serverCode === 409) {\n // Server returned a \"FID cannot be used\" error.\n // Generate a new ID next time.\n await remove(installations.appConfig);\n }\n else {\n // Registration failed. Set FID as not registered.\n await set(installations.appConfig, {\n fid: installationEntry.fid,\n registrationStatus: 0 /* RequestStatus.NOT_STARTED */\n });\n }\n throw e;\n }\n}\n/** Call if FID registration is pending in another request. */\nasync function waitUntilFidRegistration(installations) {\n // Unfortunately, there is no way of reliably observing when a value in\n // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers),\n // so we need to poll.\n let entry = await updateInstallationRequest(installations.appConfig);\n while (entry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) {\n // createInstallation request still in progress.\n await sleep(100);\n entry = await updateInstallationRequest(installations.appConfig);\n }\n if (entry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) {\n // The request timed out or failed in a different call. Try again.\n const { installationEntry, registrationPromise } = await getInstallationEntry(installations);\n if (registrationPromise) {\n return registrationPromise;\n }\n else {\n // if there is no registrationPromise, entry is registered.\n return installationEntry;\n }\n }\n return entry;\n}\n/**\n * Called only if there is a CreateInstallation request in progress.\n *\n * Updates the InstallationEntry in the DB based on the status of the\n * CreateInstallation request.\n *\n * Returns the updated InstallationEntry.\n */\nfunction updateInstallationRequest(appConfig) {\n return update(appConfig, oldEntry => {\n if (!oldEntry) {\n throw ERROR_FACTORY.create(\"installation-not-found\" /* ErrorCode.INSTALLATION_NOT_FOUND */);\n }\n return clearTimedOutRequest(oldEntry);\n });\n}\nfunction clearTimedOutRequest(entry) {\n if (hasInstallationRequestTimedOut(entry)) {\n return {\n fid: entry.fid,\n registrationStatus: 0 /* RequestStatus.NOT_STARTED */\n };\n }\n return entry;\n}\nfunction hasInstallationRequestTimedOut(installationEntry) {\n return (installationEntry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */ &&\n installationEntry.registrationTime + PENDING_TIMEOUT_MS < Date.now());\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nasync function generateAuthTokenRequest({ appConfig, heartbeatServiceProvider }, installationEntry) {\n const endpoint = getGenerateAuthTokenEndpoint(appConfig, installationEntry);\n const headers = getHeadersWithAuth(appConfig, installationEntry);\n // If heartbeat service exists, add the heartbeat string to the header.\n const heartbeatService = heartbeatServiceProvider.getImmediate({\n optional: true\n });\n if (heartbeatService) {\n const heartbeatsHeader = await heartbeatService.getHeartbeatsHeader();\n if (heartbeatsHeader) {\n headers.append('x-firebase-client', heartbeatsHeader);\n }\n }\n const body = {\n installation: {\n sdkVersion: PACKAGE_VERSION,\n appId: appConfig.appId\n }\n };\n const request = {\n method: 'POST',\n headers,\n body: JSON.stringify(body)\n };\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (response.ok) {\n const responseValue = await response.json();\n const completedAuthToken = extractAuthTokenInfoFromResponse(responseValue);\n return completedAuthToken;\n }\n else {\n throw await getErrorFromResponse('Generate Auth Token', response);\n }\n}\nfunction getGenerateAuthTokenEndpoint(appConfig, { fid }) {\n return `${getInstallationsEndpoint(appConfig)}/${fid}/authTokens:generate`;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns a valid authentication token for the installation. Generates a new\n * token if one doesn't exist, is expired or about to expire.\n *\n * Should only be called if the Firebase Installation is registered.\n */\nasync function refreshAuthToken(installations, forceRefresh = false) {\n let tokenPromise;\n const entry = await update(installations.appConfig, oldEntry => {\n if (!isEntryRegistered(oldEntry)) {\n throw ERROR_FACTORY.create(\"not-registered\" /* ErrorCode.NOT_REGISTERED */);\n }\n const oldAuthToken = oldEntry.authToken;\n if (!forceRefresh && isAuthTokenValid(oldAuthToken)) {\n // There is a valid token in the DB.\n return oldEntry;\n }\n else if (oldAuthToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */) {\n // There already is a token request in progress.\n tokenPromise = waitUntilAuthTokenRequest(installations, forceRefresh);\n return oldEntry;\n }\n else {\n // No token or token expired.\n if (!navigator.onLine) {\n throw ERROR_FACTORY.create(\"app-offline\" /* ErrorCode.APP_OFFLINE */);\n }\n const inProgressEntry = makeAuthTokenRequestInProgressEntry(oldEntry);\n tokenPromise = fetchAuthTokenFromServer(installations, inProgressEntry);\n return inProgressEntry;\n }\n });\n const authToken = tokenPromise\n ? await tokenPromise\n : entry.authToken;\n return authToken;\n}\n/**\n * Call only if FID is registered and Auth Token request is in progress.\n *\n * Waits until the current pending request finishes. If the request times out,\n * tries once in this thread as well.\n */\nasync function waitUntilAuthTokenRequest(installations, forceRefresh) {\n // Unfortunately, there is no way of reliably observing when a value in\n // IndexedDB changes (yet, see https://github.com/WICG/indexed-db-observers),\n // so we need to poll.\n let entry = await updateAuthTokenRequest(installations.appConfig);\n while (entry.authToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */) {\n // generateAuthToken still in progress.\n await sleep(100);\n entry = await updateAuthTokenRequest(installations.appConfig);\n }\n const authToken = entry.authToken;\n if (authToken.requestStatus === 0 /* RequestStatus.NOT_STARTED */) {\n // The request timed out or failed in a different call. Try again.\n return refreshAuthToken(installations, forceRefresh);\n }\n else {\n return authToken;\n }\n}\n/**\n * Called only if there is a GenerateAuthToken request in progress.\n *\n * Updates the InstallationEntry in the DB based on the status of the\n * GenerateAuthToken request.\n *\n * Returns the updated InstallationEntry.\n */\nfunction updateAuthTokenRequest(appConfig) {\n return update(appConfig, oldEntry => {\n if (!isEntryRegistered(oldEntry)) {\n throw ERROR_FACTORY.create(\"not-registered\" /* ErrorCode.NOT_REGISTERED */);\n }\n const oldAuthToken = oldEntry.authToken;\n if (hasAuthTokenRequestTimedOut(oldAuthToken)) {\n return Object.assign(Object.assign({}, oldEntry), { authToken: { requestStatus: 0 /* RequestStatus.NOT_STARTED */ } });\n }\n return oldEntry;\n });\n}\nasync function fetchAuthTokenFromServer(installations, installationEntry) {\n try {\n const authToken = await generateAuthTokenRequest(installations, installationEntry);\n const updatedInstallationEntry = Object.assign(Object.assign({}, installationEntry), { authToken });\n await set(installations.appConfig, updatedInstallationEntry);\n return authToken;\n }\n catch (e) {\n if (isServerError(e) &&\n (e.customData.serverCode === 401 || e.customData.serverCode === 404)) {\n // Server returned a \"FID not found\" or a \"Invalid authentication\" error.\n // Generate a new ID next time.\n await remove(installations.appConfig);\n }\n else {\n const updatedInstallationEntry = Object.assign(Object.assign({}, installationEntry), { authToken: { requestStatus: 0 /* RequestStatus.NOT_STARTED */ } });\n await set(installations.appConfig, updatedInstallationEntry);\n }\n throw e;\n }\n}\nfunction isEntryRegistered(installationEntry) {\n return (installationEntry !== undefined &&\n installationEntry.registrationStatus === 2 /* RequestStatus.COMPLETED */);\n}\nfunction isAuthTokenValid(authToken) {\n return (authToken.requestStatus === 2 /* RequestStatus.COMPLETED */ &&\n !isAuthTokenExpired(authToken));\n}\nfunction isAuthTokenExpired(authToken) {\n const now = Date.now();\n return (now < authToken.creationTime ||\n authToken.creationTime + authToken.expiresIn < now + TOKEN_EXPIRATION_BUFFER);\n}\n/** Returns an updated InstallationEntry with an InProgressAuthToken. */\nfunction makeAuthTokenRequestInProgressEntry(oldEntry) {\n const inProgressAuthToken = {\n requestStatus: 1 /* RequestStatus.IN_PROGRESS */,\n requestTime: Date.now()\n };\n return Object.assign(Object.assign({}, oldEntry), { authToken: inProgressAuthToken });\n}\nfunction hasAuthTokenRequestTimedOut(authToken) {\n return (authToken.requestStatus === 1 /* RequestStatus.IN_PROGRESS */ &&\n authToken.requestTime + PENDING_TIMEOUT_MS < Date.now());\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Creates a Firebase Installation if there isn't one for the app and\n * returns the Installation ID.\n * @param installations - The `Installations` instance.\n *\n * @public\n */\nasync function getId(installations) {\n const installationsImpl = installations;\n const { installationEntry, registrationPromise } = await getInstallationEntry(installationsImpl);\n if (registrationPromise) {\n registrationPromise.catch(console.error);\n }\n else {\n // If the installation is already registered, update the authentication\n // token if needed.\n refreshAuthToken(installationsImpl).catch(console.error);\n }\n return installationEntry.fid;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns a Firebase Installations auth token, identifying the current\n * Firebase Installation.\n * @param installations - The `Installations` instance.\n * @param forceRefresh - Force refresh regardless of token expiration.\n *\n * @public\n */\nasync function getToken(installations, forceRefresh = false) {\n const installationsImpl = installations;\n await completeInstallationRegistration(installationsImpl);\n // At this point we either have a Registered Installation in the DB, or we've\n // already thrown an error.\n const authToken = await refreshAuthToken(installationsImpl, forceRefresh);\n return authToken.token;\n}\nasync function completeInstallationRegistration(installations) {\n const { registrationPromise } = await getInstallationEntry(installations);\n if (registrationPromise) {\n // A createInstallation request is in progress. Wait until it finishes.\n await registrationPromise;\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nasync function deleteInstallationRequest(appConfig, installationEntry) {\n const endpoint = getDeleteEndpoint(appConfig, installationEntry);\n const headers = getHeadersWithAuth(appConfig, installationEntry);\n const request = {\n method: 'DELETE',\n headers\n };\n const response = await retryIfServerError(() => fetch(endpoint, request));\n if (!response.ok) {\n throw await getErrorFromResponse('Delete Installation', response);\n }\n}\nfunction getDeleteEndpoint(appConfig, { fid }) {\n return `${getInstallationsEndpoint(appConfig)}/${fid}`;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Deletes the Firebase Installation and all associated data.\n * @param installations - The `Installations` instance.\n *\n * @public\n */\nasync function deleteInstallations(installations) {\n const { appConfig } = installations;\n const entry = await update(appConfig, oldEntry => {\n if (oldEntry && oldEntry.registrationStatus === 0 /* RequestStatus.NOT_STARTED */) {\n // Delete the unregistered entry without sending a deleteInstallation request.\n return undefined;\n }\n return oldEntry;\n });\n if (entry) {\n if (entry.registrationStatus === 1 /* RequestStatus.IN_PROGRESS */) {\n // Can't delete while trying to register.\n throw ERROR_FACTORY.create(\"delete-pending-registration\" /* ErrorCode.DELETE_PENDING_REGISTRATION */);\n }\n else if (entry.registrationStatus === 2 /* RequestStatus.COMPLETED */) {\n if (!navigator.onLine) {\n throw ERROR_FACTORY.create(\"app-offline\" /* ErrorCode.APP_OFFLINE */);\n }\n else {\n await deleteInstallationRequest(appConfig, entry);\n await remove(appConfig);\n }\n }\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Sets a new callback that will get called when Installation ID changes.\n * Returns an unsubscribe function that will remove the callback when called.\n * @param installations - The `Installations` instance.\n * @param callback - The callback function that is invoked when FID changes.\n * @returns A function that can be called to unsubscribe.\n *\n * @public\n */\nfunction onIdChange(installations, callback) {\n const { appConfig } = installations;\n addCallback(appConfig, callback);\n return () => {\n removeCallback(appConfig, callback);\n };\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns an instance of {@link Installations} associated with the given\n * {@link @firebase/app#FirebaseApp} instance.\n * @param app - The {@link @firebase/app#FirebaseApp} instance.\n *\n * @public\n */\nfunction getInstallations(app = getApp()) {\n const installationsImpl = _getProvider(app, 'installations').getImmediate();\n return installationsImpl;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction extractAppConfig(app) {\n if (!app || !app.options) {\n throw getMissingValueError('App Configuration');\n }\n if (!app.name) {\n throw getMissingValueError('App Name');\n }\n // Required app config keys\n const configKeys = [\n 'projectId',\n 'apiKey',\n 'appId'\n ];\n for (const keyName of configKeys) {\n if (!app.options[keyName]) {\n throw getMissingValueError(keyName);\n }\n }\n return {\n appName: app.name,\n projectId: app.options.projectId,\n apiKey: app.options.apiKey,\n appId: app.options.appId\n };\n}\nfunction getMissingValueError(valueName) {\n return ERROR_FACTORY.create(\"missing-app-config-values\" /* ErrorCode.MISSING_APP_CONFIG_VALUES */, {\n valueName\n });\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst INSTALLATIONS_NAME = 'installations';\nconst INSTALLATIONS_NAME_INTERNAL = 'installations-internal';\nconst publicFactory = (container) => {\n const app = container.getProvider('app').getImmediate();\n // Throws if app isn't configured properly.\n const appConfig = extractAppConfig(app);\n const heartbeatServiceProvider = _getProvider(app, 'heartbeat');\n const installationsImpl = {\n app,\n appConfig,\n heartbeatServiceProvider,\n _delete: () => Promise.resolve()\n };\n return installationsImpl;\n};\nconst internalFactory = (container) => {\n const app = container.getProvider('app').getImmediate();\n // Internal FIS instance relies on public FIS instance.\n const installations = _getProvider(app, INSTALLATIONS_NAME).getImmediate();\n const installationsInternal = {\n getId: () => getId(installations),\n getToken: (forceRefresh) => getToken(installations, forceRefresh)\n };\n return installationsInternal;\n};\nfunction registerInstallations() {\n _registerComponent(new Component(INSTALLATIONS_NAME, publicFactory, \"PUBLIC\" /* ComponentType.PUBLIC */));\n _registerComponent(new Component(INSTALLATIONS_NAME_INTERNAL, internalFactory, \"PRIVATE\" /* ComponentType.PRIVATE */));\n}\n\n/**\n * The Firebase Installations Web SDK.\n * This SDK does not work in a Node.js environment.\n *\n * @packageDocumentation\n */\nregisterInstallations();\nregisterVersion(name, version);\n// BUILD_TARGET will be replaced by values like esm2017, cjs2017, etc during the compilation\nregisterVersion(name, version, 'esm2017');\n\nexport { deleteInstallations, getId, getInstallations, getToken, onIdChange };\n//# sourceMappingURL=index.esm2017.js.map\n","import '@firebase/installations';\nimport { Component } from '@firebase/component';\nimport { openDB, deleteDB } from 'idb';\nimport { ErrorFactory, isIndexedDBAvailable, validateIndexedDBOpenable, getModularInstance } from '@firebase/util';\nimport { _registerComponent, _getProvider, getApp } from '@firebase/app';\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst DEFAULT_VAPID_KEY = 'BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4';\nconst ENDPOINT = 'https://fcmregistrations.googleapis.com/v1';\n/** Key of FCM Payload in Notification's data field. */\nconst FCM_MSG = 'FCM_MSG';\nconst CONSOLE_CAMPAIGN_ID = 'google.c.a.c_id';\n// Defined as in proto/messaging_event.proto. Neglecting fields that are supported.\nconst SDK_PLATFORM_WEB = 3;\nconst EVENT_MESSAGE_DELIVERED = 1;\nvar MessageType$1;\n(function (MessageType) {\n MessageType[MessageType[\"DATA_MESSAGE\"] = 1] = \"DATA_MESSAGE\";\n MessageType[MessageType[\"DISPLAY_NOTIFICATION\"] = 3] = \"DISPLAY_NOTIFICATION\";\n})(MessageType$1 || (MessageType$1 = {}));\n\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\nvar MessageType;\n(function (MessageType) {\n MessageType[\"PUSH_RECEIVED\"] = \"push-received\";\n MessageType[\"NOTIFICATION_CLICKED\"] = \"notification-clicked\";\n})(MessageType || (MessageType = {}));\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction arrayToBase64(array) {\n const uint8Array = new Uint8Array(array);\n const base64String = btoa(String.fromCharCode(...uint8Array));\n return base64String.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n}\nfunction base64ToArray(base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n const rawData = atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst OLD_DB_NAME = 'fcm_token_details_db';\n/**\n * The last DB version of 'fcm_token_details_db' was 4. This is one higher, so that the upgrade\n * callback is called for all versions of the old DB.\n */\nconst OLD_DB_VERSION = 5;\nconst OLD_OBJECT_STORE_NAME = 'fcm_token_object_Store';\nasync function migrateOldDatabase(senderId) {\n if ('databases' in indexedDB) {\n // indexedDb.databases() is an IndexedDB v3 API and does not exist in all browsers. TODO: Remove\n // typecast when it lands in TS types.\n const databases = await indexedDB.databases();\n const dbNames = databases.map(db => db.name);\n if (!dbNames.includes(OLD_DB_NAME)) {\n // old DB didn't exist, no need to open.\n return null;\n }\n }\n let tokenDetails = null;\n const db = await openDB(OLD_DB_NAME, OLD_DB_VERSION, {\n upgrade: async (db, oldVersion, newVersion, upgradeTransaction) => {\n var _a;\n if (oldVersion < 2) {\n // Database too old, skip migration.\n return;\n }\n if (!db.objectStoreNames.contains(OLD_OBJECT_STORE_NAME)) {\n // Database did not exist. Nothing to do.\n return;\n }\n const objectStore = upgradeTransaction.objectStore(OLD_OBJECT_STORE_NAME);\n const value = await objectStore.index('fcmSenderId').get(senderId);\n await objectStore.clear();\n if (!value) {\n // No entry in the database, nothing to migrate.\n return;\n }\n if (oldVersion === 2) {\n const oldDetails = value;\n if (!oldDetails.auth || !oldDetails.p256dh || !oldDetails.endpoint) {\n return;\n }\n tokenDetails = {\n token: oldDetails.fcmToken,\n createTime: (_a = oldDetails.createTime) !== null && _a !== void 0 ? _a : Date.now(),\n subscriptionOptions: {\n auth: oldDetails.auth,\n p256dh: oldDetails.p256dh,\n endpoint: oldDetails.endpoint,\n swScope: oldDetails.swScope,\n vapidKey: typeof oldDetails.vapidKey === 'string'\n ? oldDetails.vapidKey\n : arrayToBase64(oldDetails.vapidKey)\n }\n };\n }\n else if (oldVersion === 3) {\n const oldDetails = value;\n tokenDetails = {\n token: oldDetails.fcmToken,\n createTime: oldDetails.createTime,\n subscriptionOptions: {\n auth: arrayToBase64(oldDetails.auth),\n p256dh: arrayToBase64(oldDetails.p256dh),\n endpoint: oldDetails.endpoint,\n swScope: oldDetails.swScope,\n vapidKey: arrayToBase64(oldDetails.vapidKey)\n }\n };\n }\n else if (oldVersion === 4) {\n const oldDetails = value;\n tokenDetails = {\n token: oldDetails.fcmToken,\n createTime: oldDetails.createTime,\n subscriptionOptions: {\n auth: arrayToBase64(oldDetails.auth),\n p256dh: arrayToBase64(oldDetails.p256dh),\n endpoint: oldDetails.endpoint,\n swScope: oldDetails.swScope,\n vapidKey: arrayToBase64(oldDetails.vapidKey)\n }\n };\n }\n }\n });\n db.close();\n // Delete all old databases.\n await deleteDB(OLD_DB_NAME);\n await deleteDB('fcm_vapid_details_db');\n await deleteDB('undefined');\n return checkTokenDetails(tokenDetails) ? tokenDetails : null;\n}\nfunction checkTokenDetails(tokenDetails) {\n if (!tokenDetails || !tokenDetails.subscriptionOptions) {\n return false;\n }\n const { subscriptionOptions } = tokenDetails;\n return (typeof tokenDetails.createTime === 'number' &&\n tokenDetails.createTime > 0 &&\n typeof tokenDetails.token === 'string' &&\n tokenDetails.token.length > 0 &&\n typeof subscriptionOptions.auth === 'string' &&\n subscriptionOptions.auth.length > 0 &&\n typeof subscriptionOptions.p256dh === 'string' &&\n subscriptionOptions.p256dh.length > 0 &&\n typeof subscriptionOptions.endpoint === 'string' &&\n subscriptionOptions.endpoint.length > 0 &&\n typeof subscriptionOptions.swScope === 'string' &&\n subscriptionOptions.swScope.length > 0 &&\n typeof subscriptionOptions.vapidKey === 'string' &&\n subscriptionOptions.vapidKey.length > 0);\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Exported for tests.\nconst DATABASE_NAME = 'firebase-messaging-database';\nconst DATABASE_VERSION = 1;\nconst OBJECT_STORE_NAME = 'firebase-messaging-store';\nlet dbPromise = null;\nfunction getDbPromise() {\n if (!dbPromise) {\n dbPromise = openDB(DATABASE_NAME, DATABASE_VERSION, {\n upgrade: (upgradeDb, oldVersion) => {\n // We don't use 'break' in this switch statement, the fall-through behavior is what we want,\n // because if there are multiple versions between the old version and the current version, we\n // want ALL the migrations that correspond to those versions to run, not only the last one.\n // eslint-disable-next-line default-case\n switch (oldVersion) {\n case 0:\n upgradeDb.createObjectStore(OBJECT_STORE_NAME);\n }\n }\n });\n }\n return dbPromise;\n}\n/** Gets record(s) from the objectStore that match the given key. */\nasync function dbGet(firebaseDependencies) {\n const key = getKey(firebaseDependencies);\n const db = await getDbPromise();\n const tokenDetails = (await db\n .transaction(OBJECT_STORE_NAME)\n .objectStore(OBJECT_STORE_NAME)\n .get(key));\n if (tokenDetails) {\n return tokenDetails;\n }\n else {\n // Check if there is a tokenDetails object in the old DB.\n const oldTokenDetails = await migrateOldDatabase(firebaseDependencies.appConfig.senderId);\n if (oldTokenDetails) {\n await dbSet(firebaseDependencies, oldTokenDetails);\n return oldTokenDetails;\n }\n }\n}\n/** Assigns or overwrites the record for the given key with the given value. */\nasync function dbSet(firebaseDependencies, tokenDetails) {\n const key = getKey(firebaseDependencies);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).put(tokenDetails, key);\n await tx.done;\n return tokenDetails;\n}\n/** Removes record(s) from the objectStore that match the given key. */\nasync function dbRemove(firebaseDependencies) {\n const key = getKey(firebaseDependencies);\n const db = await getDbPromise();\n const tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n await tx.objectStore(OBJECT_STORE_NAME).delete(key);\n await tx.done;\n}\nfunction getKey({ appConfig }) {\n return appConfig.appId;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst ERROR_MAP = {\n [\"missing-app-config-values\" /* ErrorCode.MISSING_APP_CONFIG_VALUES */]: 'Missing App configuration value: \"{$valueName}\"',\n [\"only-available-in-window\" /* ErrorCode.AVAILABLE_IN_WINDOW */]: 'This method is available in a Window context.',\n [\"only-available-in-sw\" /* ErrorCode.AVAILABLE_IN_SW */]: 'This method is available in a service worker context.',\n [\"permission-default\" /* ErrorCode.PERMISSION_DEFAULT */]: 'The notification permission was not granted and dismissed instead.',\n [\"permission-blocked\" /* ErrorCode.PERMISSION_BLOCKED */]: 'The notification permission was not granted and blocked instead.',\n [\"unsupported-browser\" /* ErrorCode.UNSUPPORTED_BROWSER */]: \"This browser doesn't support the API's required to use the Firebase SDK.\",\n [\"indexed-db-unsupported\" /* ErrorCode.INDEXED_DB_UNSUPPORTED */]: \"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)\",\n [\"failed-service-worker-registration\" /* ErrorCode.FAILED_DEFAULT_REGISTRATION */]: 'We are unable to register the default service worker. {$browserErrorMessage}',\n [\"token-subscribe-failed\" /* ErrorCode.TOKEN_SUBSCRIBE_FAILED */]: 'A problem occurred while subscribing the user to FCM: {$errorInfo}',\n [\"token-subscribe-no-token\" /* ErrorCode.TOKEN_SUBSCRIBE_NO_TOKEN */]: 'FCM returned no token when subscribing the user to push.',\n [\"token-unsubscribe-failed\" /* ErrorCode.TOKEN_UNSUBSCRIBE_FAILED */]: 'A problem occurred while unsubscribing the ' +\n 'user from FCM: {$errorInfo}',\n [\"token-update-failed\" /* ErrorCode.TOKEN_UPDATE_FAILED */]: 'A problem occurred while updating the user from FCM: {$errorInfo}',\n [\"token-update-no-token\" /* ErrorCode.TOKEN_UPDATE_NO_TOKEN */]: 'FCM returned no token when updating the user to push.',\n [\"use-sw-after-get-token\" /* ErrorCode.USE_SW_AFTER_GET_TOKEN */]: 'The useServiceWorker() method may only be called once and must be ' +\n 'called before calling getToken() to ensure your service worker is used.',\n [\"invalid-sw-registration\" /* ErrorCode.INVALID_SW_REGISTRATION */]: 'The input to useServiceWorker() must be a ServiceWorkerRegistration.',\n [\"invalid-bg-handler\" /* ErrorCode.INVALID_BG_HANDLER */]: 'The input to setBackgroundMessageHandler() must be a function.',\n [\"invalid-vapid-key\" /* ErrorCode.INVALID_VAPID_KEY */]: 'The public VAPID key must be a string.',\n [\"use-vapid-key-after-get-token\" /* ErrorCode.USE_VAPID_KEY_AFTER_GET_TOKEN */]: 'The usePublicVapidKey() method may only be called once and must be ' +\n 'called before calling getToken() to ensure your VAPID key is used.'\n};\nconst ERROR_FACTORY = new ErrorFactory('messaging', 'Messaging', ERROR_MAP);\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nasync function requestGetToken(firebaseDependencies, subscriptionOptions) {\n const headers = await getHeaders(firebaseDependencies);\n const body = getBody(subscriptionOptions);\n const subscribeOptions = {\n method: 'POST',\n headers,\n body: JSON.stringify(body)\n };\n let responseData;\n try {\n const response = await fetch(getEndpoint(firebaseDependencies.appConfig), subscribeOptions);\n responseData = await response.json();\n }\n catch (err) {\n throw ERROR_FACTORY.create(\"token-subscribe-failed\" /* ErrorCode.TOKEN_SUBSCRIBE_FAILED */, {\n errorInfo: err === null || err === void 0 ? void 0 : err.toString()\n });\n }\n if (responseData.error) {\n const message = responseData.error.message;\n throw ERROR_FACTORY.create(\"token-subscribe-failed\" /* ErrorCode.TOKEN_SUBSCRIBE_FAILED */, {\n errorInfo: message\n });\n }\n if (!responseData.token) {\n throw ERROR_FACTORY.create(\"token-subscribe-no-token\" /* ErrorCode.TOKEN_SUBSCRIBE_NO_TOKEN */);\n }\n return responseData.token;\n}\nasync function requestUpdateToken(firebaseDependencies, tokenDetails) {\n const headers = await getHeaders(firebaseDependencies);\n const body = getBody(tokenDetails.subscriptionOptions);\n const updateOptions = {\n method: 'PATCH',\n headers,\n body: JSON.stringify(body)\n };\n let responseData;\n try {\n const response = await fetch(`${getEndpoint(firebaseDependencies.appConfig)}/${tokenDetails.token}`, updateOptions);\n responseData = await response.json();\n }\n catch (err) {\n throw ERROR_FACTORY.create(\"token-update-failed\" /* ErrorCode.TOKEN_UPDATE_FAILED */, {\n errorInfo: err === null || err === void 0 ? void 0 : err.toString()\n });\n }\n if (responseData.error) {\n const message = responseData.error.message;\n throw ERROR_FACTORY.create(\"token-update-failed\" /* ErrorCode.TOKEN_UPDATE_FAILED */, {\n errorInfo: message\n });\n }\n if (!responseData.token) {\n throw ERROR_FACTORY.create(\"token-update-no-token\" /* ErrorCode.TOKEN_UPDATE_NO_TOKEN */);\n }\n return responseData.token;\n}\nasync function requestDeleteToken(firebaseDependencies, token) {\n const headers = await getHeaders(firebaseDependencies);\n const unsubscribeOptions = {\n method: 'DELETE',\n headers\n };\n try {\n const response = await fetch(`${getEndpoint(firebaseDependencies.appConfig)}/${token}`, unsubscribeOptions);\n const responseData = await response.json();\n if (responseData.error) {\n const message = responseData.error.message;\n throw ERROR_FACTORY.create(\"token-unsubscribe-failed\" /* ErrorCode.TOKEN_UNSUBSCRIBE_FAILED */, {\n errorInfo: message\n });\n }\n }\n catch (err) {\n throw ERROR_FACTORY.create(\"token-unsubscribe-failed\" /* ErrorCode.TOKEN_UNSUBSCRIBE_FAILED */, {\n errorInfo: err === null || err === void 0 ? void 0 : err.toString()\n });\n }\n}\nfunction getEndpoint({ projectId }) {\n return `${ENDPOINT}/projects/${projectId}/registrations`;\n}\nasync function getHeaders({ appConfig, installations }) {\n const authToken = await installations.getToken();\n return new Headers({\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n 'x-goog-api-key': appConfig.apiKey,\n 'x-goog-firebase-installations-auth': `FIS ${authToken}`\n });\n}\nfunction getBody({ p256dh, auth, endpoint, vapidKey }) {\n const body = {\n web: {\n endpoint,\n auth,\n p256dh\n }\n };\n if (vapidKey !== DEFAULT_VAPID_KEY) {\n body.web.applicationPubKey = vapidKey;\n }\n return body;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// UpdateRegistration will be called once every week.\nconst TOKEN_EXPIRATION_MS = 7 * 24 * 60 * 60 * 1000; // 7 days\nasync function getTokenInternal(messaging) {\n const pushSubscription = await getPushSubscription(messaging.swRegistration, messaging.vapidKey);\n const subscriptionOptions = {\n vapidKey: messaging.vapidKey,\n swScope: messaging.swRegistration.scope,\n endpoint: pushSubscription.endpoint,\n auth: arrayToBase64(pushSubscription.getKey('auth')),\n p256dh: arrayToBase64(pushSubscription.getKey('p256dh'))\n };\n const tokenDetails = await dbGet(messaging.firebaseDependencies);\n if (!tokenDetails) {\n // No token, get a new one.\n return getNewToken(messaging.firebaseDependencies, subscriptionOptions);\n }\n else if (!isTokenValid(tokenDetails.subscriptionOptions, subscriptionOptions)) {\n // Invalid token, get a new one.\n try {\n await requestDeleteToken(messaging.firebaseDependencies, tokenDetails.token);\n }\n catch (e) {\n // Suppress errors because of #2364\n console.warn(e);\n }\n return getNewToken(messaging.firebaseDependencies, subscriptionOptions);\n }\n else if (Date.now() >= tokenDetails.createTime + TOKEN_EXPIRATION_MS) {\n // Weekly token refresh\n return updateToken(messaging, {\n token: tokenDetails.token,\n createTime: Date.now(),\n subscriptionOptions\n });\n }\n else {\n // Valid token, nothing to do.\n return tokenDetails.token;\n }\n}\n/**\n * This method deletes the token from the database, unsubscribes the token from FCM, and unregisters\n * the push subscription if it exists.\n */\nasync function deleteTokenInternal(messaging) {\n const tokenDetails = await dbGet(messaging.firebaseDependencies);\n if (tokenDetails) {\n await requestDeleteToken(messaging.firebaseDependencies, tokenDetails.token);\n await dbRemove(messaging.firebaseDependencies);\n }\n // Unsubscribe from the push subscription.\n const pushSubscription = await messaging.swRegistration.pushManager.getSubscription();\n if (pushSubscription) {\n return pushSubscription.unsubscribe();\n }\n // If there's no SW, consider it a success.\n return true;\n}\nasync function updateToken(messaging, tokenDetails) {\n try {\n const updatedToken = await requestUpdateToken(messaging.firebaseDependencies, tokenDetails);\n const updatedTokenDetails = Object.assign(Object.assign({}, tokenDetails), { token: updatedToken, createTime: Date.now() });\n await dbSet(messaging.firebaseDependencies, updatedTokenDetails);\n return updatedToken;\n }\n catch (e) {\n throw e;\n }\n}\nasync function getNewToken(firebaseDependencies, subscriptionOptions) {\n const token = await requestGetToken(firebaseDependencies, subscriptionOptions);\n const tokenDetails = {\n token,\n createTime: Date.now(),\n subscriptionOptions\n };\n await dbSet(firebaseDependencies, tokenDetails);\n return tokenDetails.token;\n}\n/**\n * Gets a PushSubscription for the current user.\n */\nasync function getPushSubscription(swRegistration, vapidKey) {\n const subscription = await swRegistration.pushManager.getSubscription();\n if (subscription) {\n return subscription;\n }\n return swRegistration.pushManager.subscribe({\n userVisibleOnly: true,\n // Chrome <= 75 doesn't support base64-encoded VAPID key. For backward compatibility, VAPID key\n // submitted to pushManager#subscribe must be of type Uint8Array.\n applicationServerKey: base64ToArray(vapidKey)\n });\n}\n/**\n * Checks if the saved tokenDetails object matches the configuration provided.\n */\nfunction isTokenValid(dbOptions, currentOptions) {\n const isVapidKeyEqual = currentOptions.vapidKey === dbOptions.vapidKey;\n const isEndpointEqual = currentOptions.endpoint === dbOptions.endpoint;\n const isAuthEqual = currentOptions.auth === dbOptions.auth;\n const isP256dhEqual = currentOptions.p256dh === dbOptions.p256dh;\n return isVapidKeyEqual && isEndpointEqual && isAuthEqual && isP256dhEqual;\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction externalizePayload(internalPayload) {\n const payload = {\n from: internalPayload.from,\n // eslint-disable-next-line camelcase\n collapseKey: internalPayload.collapse_key,\n // eslint-disable-next-line camelcase\n messageId: internalPayload.fcmMessageId\n };\n propagateNotificationPayload(payload, internalPayload);\n propagateDataPayload(payload, internalPayload);\n propagateFcmOptions(payload, internalPayload);\n return payload;\n}\nfunction propagateNotificationPayload(payload, messagePayloadInternal) {\n if (!messagePayloadInternal.notification) {\n return;\n }\n payload.notification = {};\n const title = messagePayloadInternal.notification.title;\n if (!!title) {\n payload.notification.title = title;\n }\n const body = messagePayloadInternal.notification.body;\n if (!!body) {\n payload.notification.body = body;\n }\n const image = messagePayloadInternal.notification.image;\n if (!!image) {\n payload.notification.image = image;\n }\n const icon = messagePayloadInternal.notification.icon;\n if (!!icon) {\n payload.notification.icon = icon;\n }\n}\nfunction propagateDataPayload(payload, messagePayloadInternal) {\n if (!messagePayloadInternal.data) {\n return;\n }\n payload.data = messagePayloadInternal.data;\n}\nfunction propagateFcmOptions(payload, messagePayloadInternal) {\n var _a, _b, _c, _d, _e;\n // fcmOptions.link value is written into notification.click_action. see more in b/232072111\n if (!messagePayloadInternal.fcmOptions &&\n !((_a = messagePayloadInternal.notification) === null || _a === void 0 ? void 0 : _a.click_action)) {\n return;\n }\n payload.fcmOptions = {};\n const link = (_c = (_b = messagePayloadInternal.fcmOptions) === null || _b === void 0 ? void 0 : _b.link) !== null && _c !== void 0 ? _c : (_d = messagePayloadInternal.notification) === null || _d === void 0 ? void 0 : _d.click_action;\n if (!!link) {\n payload.fcmOptions.link = link;\n }\n // eslint-disable-next-line camelcase\n const analyticsLabel = (_e = messagePayloadInternal.fcmOptions) === null || _e === void 0 ? void 0 : _e.analytics_label;\n if (!!analyticsLabel) {\n payload.fcmOptions.analyticsLabel = analyticsLabel;\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction isConsoleMessage(data) {\n // This message has a campaign ID, meaning it was sent using the Firebase Console.\n return typeof data === 'object' && !!data && CONSOLE_CAMPAIGN_ID in data;\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Returns a promise that resolves after given time passes. */\nfunction sleep(ms) {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n_mergeStrings('AzSCbw63g1R0nCw85jG8', 'Iaya3yLKwmgvh7cF0q4');\nasync function stageLog(messaging, internalPayload) {\n const fcmEvent = createFcmEvent(internalPayload, await messaging.firebaseDependencies.installations.getId());\n createAndEnqueueLogEvent(messaging, fcmEvent, internalPayload.productId);\n}\nfunction createFcmEvent(internalPayload, fid) {\n var _a, _b;\n const fcmEvent = {};\n /* eslint-disable camelcase */\n // some fields should always be non-null. Still check to ensure.\n if (!!internalPayload.from) {\n fcmEvent.project_number = internalPayload.from;\n }\n if (!!internalPayload.fcmMessageId) {\n fcmEvent.message_id = internalPayload.fcmMessageId;\n }\n fcmEvent.instance_id = fid;\n if (!!internalPayload.notification) {\n fcmEvent.message_type = MessageType$1.DISPLAY_NOTIFICATION.toString();\n }\n else {\n fcmEvent.message_type = MessageType$1.DATA_MESSAGE.toString();\n }\n fcmEvent.sdk_platform = SDK_PLATFORM_WEB.toString();\n fcmEvent.package_name = self.origin.replace(/(^\\w+:|^)\\/\\//, '');\n if (!!internalPayload.collapse_key) {\n fcmEvent.collapse_key = internalPayload.collapse_key;\n }\n fcmEvent.event = EVENT_MESSAGE_DELIVERED.toString();\n if (!!((_a = internalPayload.fcmOptions) === null || _a === void 0 ? void 0 : _a.analytics_label)) {\n fcmEvent.analytics_label = (_b = internalPayload.fcmOptions) === null || _b === void 0 ? void 0 : _b.analytics_label;\n }\n /* eslint-enable camelcase */\n return fcmEvent;\n}\nfunction createAndEnqueueLogEvent(messaging, fcmEvent, productId) {\n const logEvent = {};\n /* eslint-disable camelcase */\n logEvent.event_time_ms = Math.floor(Date.now()).toString();\n logEvent.source_extension_json_proto3 = JSON.stringify({\n messaging_client_event: fcmEvent\n });\n if (!!productId) {\n logEvent.compliance_data = buildComplianceData(productId);\n }\n // eslint-disable-next-line camelcase\n messaging.logEvents.push(logEvent);\n}\nfunction buildComplianceData(productId) {\n const complianceData = {\n privacy_context: {\n prequest: {\n origin_associated_product_id: productId\n }\n }\n };\n return complianceData;\n}\nfunction _mergeStrings(s1, s2) {\n const resultArray = [];\n for (let i = 0; i < s1.length; i++) {\n resultArray.push(s1.charAt(i));\n if (i < s2.length) {\n resultArray.push(s2.charAt(i));\n }\n }\n return resultArray.join('');\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nasync function onSubChange(event, messaging) {\n var _a, _b;\n const { newSubscription } = event;\n if (!newSubscription) {\n // Subscription revoked, delete token\n await deleteTokenInternal(messaging);\n return;\n }\n const tokenDetails = await dbGet(messaging.firebaseDependencies);\n await deleteTokenInternal(messaging);\n messaging.vapidKey =\n (_b = (_a = tokenDetails === null || tokenDetails === void 0 ? void 0 : tokenDetails.subscriptionOptions) === null || _a === void 0 ? void 0 : _a.vapidKey) !== null && _b !== void 0 ? _b : DEFAULT_VAPID_KEY;\n await getTokenInternal(messaging);\n}\nasync function onPush(event, messaging) {\n const internalPayload = getMessagePayloadInternal(event);\n if (!internalPayload) {\n // Failed to get parsed MessagePayload from the PushEvent. Skip handling the push.\n return;\n }\n // log to Firelog with user consent\n if (messaging.deliveryMetricsExportedToBigQueryEnabled) {\n await stageLog(messaging, internalPayload);\n }\n // foreground handling: eventually passed to onMessage hook\n const clientList = await getClientList();\n if (hasVisibleClients(clientList)) {\n return sendMessagePayloadInternalToWindows(clientList, internalPayload);\n }\n // background handling: display if possible and pass to onBackgroundMessage hook\n if (!!internalPayload.notification) {\n await showNotification(wrapInternalPayload(internalPayload));\n }\n if (!messaging) {\n return;\n }\n if (!!messaging.onBackgroundMessageHandler) {\n const payload = externalizePayload(internalPayload);\n if (typeof messaging.onBackgroundMessageHandler === 'function') {\n await messaging.onBackgroundMessageHandler(payload);\n }\n else {\n messaging.onBackgroundMessageHandler.next(payload);\n }\n }\n}\nasync function onNotificationClick(event) {\n var _a, _b;\n const internalPayload = (_b = (_a = event.notification) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[FCM_MSG];\n if (!internalPayload) {\n return;\n }\n else if (event.action) {\n // User clicked on an action button. This will allow developers to act on action button clicks\n // by using a custom onNotificationClick listener that they define.\n return;\n }\n // Prevent other listeners from receiving the event\n event.stopImmediatePropagation();\n event.notification.close();\n // Note clicking on a notification with no link set will focus the Chrome's current tab.\n const link = getLink(internalPayload);\n if (!link) {\n return;\n }\n // FM should only open/focus links from app's origin.\n const url = new URL(link, self.location.href);\n const originUrl = new URL(self.location.origin);\n if (url.host !== originUrl.host) {\n return;\n }\n let client = await getWindowClient(url);\n if (!client) {\n client = await self.clients.openWindow(link);\n // Wait three seconds for the client to initialize and set up the message handler so that it\n // can receive the message.\n await sleep(3000);\n }\n else {\n client = await client.focus();\n }\n if (!client) {\n // Window Client will not be returned if it's for a third party origin.\n return;\n }\n internalPayload.messageType = MessageType.NOTIFICATION_CLICKED;\n internalPayload.isFirebaseMessaging = true;\n return client.postMessage(internalPayload);\n}\nfunction wrapInternalPayload(internalPayload) {\n const wrappedInternalPayload = Object.assign({}, internalPayload.notification);\n // Put the message payload under FCM_MSG name so we can identify the notification as being an FCM\n // notification vs a notification from somewhere else (i.e. normal web push or developer generated\n // notification).\n wrappedInternalPayload.data = {\n [FCM_MSG]: internalPayload\n };\n return wrappedInternalPayload;\n}\nfunction getMessagePayloadInternal({ data }) {\n if (!data) {\n return null;\n }\n try {\n return data.json();\n }\n catch (err) {\n // Not JSON so not an FCM message.\n return null;\n }\n}\n/**\n * @param url The URL to look for when focusing a client.\n * @return Returns an existing window client or a newly opened WindowClient.\n */\nasync function getWindowClient(url) {\n const clientList = await getClientList();\n for (const client of clientList) {\n const clientUrl = new URL(client.url, self.location.href);\n if (url.host === clientUrl.host) {\n return client;\n }\n }\n return null;\n}\n/**\n * @returns If there is currently a visible WindowClient, this method will resolve to true,\n * otherwise false.\n */\nfunction hasVisibleClients(clientList) {\n return clientList.some(client => client.visibilityState === 'visible' &&\n // Ignore chrome-extension clients as that matches the background pages of extensions, which\n // are always considered visible for some reason.\n !client.url.startsWith('chrome-extension://'));\n}\nfunction sendMessagePayloadInternalToWindows(clientList, internalPayload) {\n internalPayload.isFirebaseMessaging = true;\n internalPayload.messageType = MessageType.PUSH_RECEIVED;\n for (const client of clientList) {\n client.postMessage(internalPayload);\n }\n}\nfunction getClientList() {\n return self.clients.matchAll({\n type: 'window',\n includeUncontrolled: true\n // TS doesn't know that \"type: 'window'\" means it'll return WindowClient[]\n });\n}\nfunction showNotification(notificationPayloadInternal) {\n var _a;\n // Note: Firefox does not support the maxActions property.\n // https://developer.mozilla.org/en-US/docs/Web/API/notification/maxActions\n const { actions } = notificationPayloadInternal;\n const { maxActions } = Notification;\n if (actions && maxActions && actions.length > maxActions) {\n console.warn(`This browser only supports ${maxActions} actions. The remaining actions will not be displayed.`);\n }\n return self.registration.showNotification(\n /* title= */ (_a = notificationPayloadInternal.title) !== null && _a !== void 0 ? _a : '', notificationPayloadInternal);\n}\nfunction getLink(payload) {\n var _a, _b, _c;\n // eslint-disable-next-line camelcase\n const link = (_b = (_a = payload.fcmOptions) === null || _a === void 0 ? void 0 : _a.link) !== null && _b !== void 0 ? _b : (_c = payload.notification) === null || _c === void 0 ? void 0 : _c.click_action;\n if (link) {\n return link;\n }\n if (isConsoleMessage(payload.data)) {\n // Notification created in the Firebase Console. Redirect to origin.\n return self.location.origin;\n }\n else {\n return null;\n }\n}\n\n/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction extractAppConfig(app) {\n if (!app || !app.options) {\n throw getMissingValueError('App Configuration Object');\n }\n if (!app.name) {\n throw getMissingValueError('App Name');\n }\n // Required app config keys\n const configKeys = [\n 'projectId',\n 'apiKey',\n 'appId',\n 'messagingSenderId'\n ];\n const { options } = app;\n for (const keyName of configKeys) {\n if (!options[keyName]) {\n throw getMissingValueError(keyName);\n }\n }\n return {\n appName: app.name,\n projectId: options.projectId,\n apiKey: options.apiKey,\n appId: options.appId,\n senderId: options.messagingSenderId\n };\n}\nfunction getMissingValueError(valueName) {\n return ERROR_FACTORY.create(\"missing-app-config-values\" /* ErrorCode.MISSING_APP_CONFIG_VALUES */, {\n valueName\n });\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass MessagingService {\n constructor(app, installations, analyticsProvider) {\n // logging is only done with end user consent. Default to false.\n this.deliveryMetricsExportedToBigQueryEnabled = false;\n this.onBackgroundMessageHandler = null;\n this.onMessageHandler = null;\n this.logEvents = [];\n this.isLogServiceStarted = false;\n const appConfig = extractAppConfig(app);\n this.firebaseDependencies = {\n app,\n appConfig,\n installations,\n analyticsProvider\n };\n }\n _delete() {\n return Promise.resolve();\n }\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst SwMessagingFactory = (container) => {\n const messaging = new MessagingService(container.getProvider('app').getImmediate(), container.getProvider('installations-internal').getImmediate(), container.getProvider('analytics-internal'));\n self.addEventListener('push', e => {\n e.waitUntil(onPush(e, messaging));\n });\n self.addEventListener('pushsubscriptionchange', e => {\n e.waitUntil(onSubChange(e, messaging));\n });\n self.addEventListener('notificationclick', e => {\n e.waitUntil(onNotificationClick(e));\n });\n return messaging;\n};\n/**\n * The messaging instance registered in sw is named differently than that of in client. This is\n * because both `registerMessagingInWindow` and `registerMessagingInSw` would be called in\n * `messaging-compat` and component with the same name can only be registered once.\n */\nfunction registerMessagingInSw() {\n _registerComponent(new Component('messaging-sw', SwMessagingFactory, \"PUBLIC\" /* ComponentType.PUBLIC */));\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Checks whether all required APIs exist within SW Context\n * @returns a Promise that resolves to a boolean.\n *\n * @public\n */\nasync function isSwSupported() {\n // firebase-js-sdk/issues/2393 reveals that idb#open in Safari iframe and Firefox private browsing\n // might be prohibited to run. In these contexts, an error would be thrown during the messaging\n // instantiating phase, informing the developers to import/call isSupported for special handling.\n return (isIndexedDBAvailable() &&\n (await validateIndexedDBOpenable()) &&\n 'PushManager' in self &&\n 'Notification' in self &&\n ServiceWorkerRegistration.prototype.hasOwnProperty('showNotification') &&\n PushSubscription.prototype.hasOwnProperty('getKey'));\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction onBackgroundMessage$1(messaging, nextOrObserver) {\n if (self.document !== undefined) {\n throw ERROR_FACTORY.create(\"only-available-in-sw\" /* ErrorCode.AVAILABLE_IN_SW */);\n }\n messaging.onBackgroundMessageHandler = nextOrObserver;\n return () => {\n messaging.onBackgroundMessageHandler = null;\n };\n}\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction _setDeliveryMetricsExportedToBigQueryEnabled(messaging, enable) {\n messaging.deliveryMetricsExportedToBigQueryEnabled =\n enable;\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Retrieves a Firebase Cloud Messaging instance.\n *\n * @returns The Firebase Cloud Messaging instance associated with the provided firebase app.\n *\n * @public\n */\nfunction getMessagingInSw(app = getApp()) {\n // Conscious decision to make this async check non-blocking during the messaging instance\n // initialization phase for performance consideration. An error would be thrown latter for\n // developer's information. Developers can then choose to import and call `isSupported` for\n // special handling.\n isSwSupported().then(isSupported => {\n // If `isSwSupported()` resolved, but returned false.\n if (!isSupported) {\n throw ERROR_FACTORY.create(\"unsupported-browser\" /* ErrorCode.UNSUPPORTED_BROWSER */);\n }\n }, _ => {\n // If `isSwSupported()` rejected.\n throw ERROR_FACTORY.create(\"indexed-db-unsupported\" /* ErrorCode.INDEXED_DB_UNSUPPORTED */);\n });\n return _getProvider(getModularInstance(app), 'messaging-sw').getImmediate();\n}\n/**\n * Called when a message is received while the app is in the background. An app is considered to be\n * in the background if no active window is displayed.\n *\n * @param messaging - The {@link Messaging} instance.\n * @param nextOrObserver - This function, or observer object with `next` defined, is called when a\n * message is received and the app is currently in the background.\n *\n * @returns To stop listening for messages execute this returned function\n *\n * @public\n */\nfunction onBackgroundMessage(messaging, nextOrObserver) {\n messaging = getModularInstance(messaging);\n return onBackgroundMessage$1(messaging, nextOrObserver);\n}\n/**\n * Enables or disables Firebase Cloud Messaging message delivery metrics export to BigQuery. By\n * default, message delivery metrics are not exported to BigQuery. Use this method to enable or\n * disable the export at runtime.\n *\n * @param messaging - The `FirebaseMessaging` instance.\n * @param enable - Whether Firebase Cloud Messaging should export message delivery metrics to\n * BigQuery.\n *\n * @public\n */\nfunction experimentalSetDeliveryMetricsExportedToBigQueryEnabled(messaging, enable) {\n messaging = getModularInstance(messaging);\n return _setDeliveryMetricsExportedToBigQueryEnabled(messaging, enable);\n}\n\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nregisterMessagingInSw();\n\nexport { experimentalSetDeliveryMetricsExportedToBigQueryEnabled, getMessagingInSw as getMessaging, isSwSupported as isSupported, onBackgroundMessage };\n//# sourceMappingURL=index.sw.esm2017.js.map\n","export * from '@firebase/messaging/sw';\n//# sourceMappingURL=index.esm.js.map\n","import { registerVersion } from '@firebase/app';\nexport * from '@firebase/app';\n\nvar name = \"firebase\";\nvar version = \"11.1.0\";\n\n/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nregisterVersion(name, version, 'app');\n//# sourceMappingURL=index.esm.js.map\n","// Be careful what you import here as it will increase the service worker bundle size\n\nimport { initializeApp } from 'firebase/app'\nimport type { FirebaseApp, FirebaseOptions } from 'firebase/app'\n\nexport const FIREBASE_IS_PRODUCTION = process.env.NEXT_PUBLIC_IS_PRODUCTION === 'true'\n\nconst FIREBASE_VALID_KEY_PRODUCTION = process.env.NEXT_PUBLIC_FIREBASE_VAPID_KEY_PRODUCTION || ''\nconst FIREBASE_VALID_KEY_STAGING = process.env.NEXT_PUBLIC_FIREBASE_VAPID_KEY_STAGING\nexport const FIREBASE_VAPID_KEY = FIREBASE_IS_PRODUCTION ? FIREBASE_VALID_KEY_PRODUCTION : FIREBASE_VALID_KEY_STAGING\n\nexport const FIREBASE_OPTIONS = (() => {\n const FIREBASE_OPTIONS_PRODUCTION = process.env.NEXT_PUBLIC_FIREBASE_OPTIONS_PRODUCTION || ''\n const FIREBASE_OPTIONS_STAGING = process.env.NEXT_PUBLIC_FIREBASE_OPTIONS_STAGING || ''\n try {\n return JSON.parse(FIREBASE_IS_PRODUCTION ? FIREBASE_OPTIONS_PRODUCTION : FIREBASE_OPTIONS_STAGING)\n } catch {\n return {}\n }\n})()\n\nconst isFirebaseOptions = (options: object): options is FirebaseOptions => {\n // At least projectId is required\n return 'projectId' in options && Object.values(options).every(Boolean)\n}\n\nexport const initializeFirebaseApp = () => {\n if (!isFirebaseOptions(FIREBASE_OPTIONS)) {\n return\n }\n\n let app: FirebaseApp | undefined\n\n try {\n app = initializeApp(FIREBASE_OPTIONS)\n } catch (e) {\n console.error('[Firebase] Initialization failed', e)\n }\n\n return app\n}\n","function promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}\nfunction createStore(dbName, storeName) {\n const request = indexedDB.open(dbName);\n request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n const dbp = promisifyRequest(request);\n return (txMode, callback) => dbp.then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));\n}\nlet defaultGetStoreFunc;\nfunction defaultGetStore() {\n if (!defaultGetStoreFunc) {\n defaultGetStoreFunc = createStore('keyval-store', 'keyval');\n }\n return defaultGetStoreFunc;\n}\n/**\n * Get a value by its key.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction get(key, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => promisifyRequest(store.get(key)));\n}\n/**\n * Set a value with a key.\n *\n * @param key\n * @param value\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction set(key, value, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.put(value, key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Set multiple values at once. This is faster than calling set() multiple times.\n * It's also atomic – if one of the pairs can't be added, none will be added.\n *\n * @param entries Array of entries, where each entry is an array of `[key, value]`.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction setMany(entries, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n entries.forEach((entry) => store.put(entry[1], entry[0]));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Get multiple values by their keys\n *\n * @param keys\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction getMany(keys, customStore = defaultGetStore()) {\n return customStore('readonly', (store) => Promise.all(keys.map((key) => promisifyRequest(store.get(key)))));\n}\n/**\n * Update a value. This lets you see the old value and update it as an atomic operation.\n *\n * @param key\n * @param updater A callback that takes the old value and returns a new value.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction update(key, updater, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => \n // Need to create the promise manually.\n // If I try to chain promises, the transaction closes in browsers\n // that use a promise polyfill (IE10/11).\n new Promise((resolve, reject) => {\n store.get(key).onsuccess = function () {\n try {\n store.put(updater(this.result), key);\n resolve(promisifyRequest(store.transaction));\n }\n catch (err) {\n reject(err);\n }\n };\n }));\n}\n/**\n * Delete a particular key from the store.\n *\n * @param key\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction del(key, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.delete(key);\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Delete multiple keys at once.\n *\n * @param keys List of keys to delete.\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction delMany(keys, customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n keys.forEach((key) => store.delete(key));\n return promisifyRequest(store.transaction);\n });\n}\n/**\n * Clear all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction clear(customStore = defaultGetStore()) {\n return customStore('readwrite', (store) => {\n store.clear();\n return promisifyRequest(store.transaction);\n });\n}\nfunction eachCursor(store, callback) {\n store.openCursor().onsuccess = function () {\n if (!this.result)\n return;\n callback(this.result);\n this.result.continue();\n };\n return promisifyRequest(store.transaction);\n}\n/**\n * Get all keys in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction keys(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAllKeys) {\n return promisifyRequest(store.getAllKeys());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.key)).then(() => items);\n });\n}\n/**\n * Get all values in the store.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction values(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n if (store.getAll) {\n return promisifyRequest(store.getAll());\n }\n const items = [];\n return eachCursor(store, (cursor) => items.push(cursor.value)).then(() => items);\n });\n}\n/**\n * Get all entries in the store. Each entry is an array of `[key, value]`.\n *\n * @param customStore Method to get a custom store. Use with caution (see the docs).\n */\nfunction entries(customStore = defaultGetStore()) {\n return customStore('readonly', (store) => {\n // Fast path for modern browsers\n // (although, hopefully we'll get a simpler path some day)\n if (store.getAll && store.getAllKeys) {\n return Promise.all([\n promisifyRequest(store.getAllKeys()),\n promisifyRequest(store.getAll()),\n ]).then(([keys, values]) => keys.map((key, i) => [key, values[i]]));\n }\n const items = [];\n return customStore('readonly', (store) => eachCursor(store, (cursor) => items.push([cursor.key, cursor.value])).then(() => items));\n });\n}\n\nexport { clear, createStore, del, delMany, entries, get, getMany, keys, promisifyRequest, set, setMany, update, values };\n","export const AppRoutes = {\n '403': '/403',\n '404': '/404',\n wc: '/wc',\n terms: '/terms',\n swap: '/swap',\n stake: '/stake',\n privacy: '/privacy',\n licenses: '/licenses',\n index: '/',\n imprint: '/imprint',\n home: '/home',\n cookie: '/cookie',\n bridge: '/bridge',\n addressBook: '/address-book',\n addOwner: '/addOwner',\n _offline: '/_offline',\n apps: {\n open: '/apps/open',\n index: '/apps',\n custom: '/apps/custom',\n bookmarked: '/apps/bookmarked',\n },\n balances: {\n nfts: '/balances/nfts',\n index: '/balances',\n },\n newSafe: {\n load: '/new-safe/load',\n create: '/new-safe/create',\n advancedCreate: '/new-safe/advanced-create',\n },\n settings: {\n setup: '/settings/setup',\n security: '/settings/security',\n notifications: '/settings/notifications',\n modules: '/settings/modules',\n index: '/settings',\n environmentVariables: '/settings/environment-variables',\n data: '/settings/data',\n cookies: '/settings/cookies',\n appearance: '/settings/appearance',\n safeApps: {\n index: '/settings/safe-apps',\n },\n },\n share: {\n safeApp: '/share/safe-app',\n },\n transactions: {\n tx: '/transactions/tx',\n queue: '/transactions/queue',\n msg: '/transactions/msg',\n messages: '/transactions/messages',\n index: '/transactions',\n history: '/transactions/history',\n },\n welcome: {\n index: '/welcome',\n accounts: '/welcome/accounts',\n },\n}\n","// Be careful what you import here as it will increase the service worker bundle size\n\nimport type { MessagePayload } from 'firebase/messaging'\n\nexport const isWebhookEvent = (data: MessagePayload['data']): data is WebhookEvent => {\n return Object.values(WebhookType).some((type) => type === data?.type)\n}\n\nexport enum WebhookType {\n EXECUTED_MULTISIG_TRANSACTION = 'EXECUTED_MULTISIG_TRANSACTION',\n INCOMING_ETHER = 'INCOMING_ETHER',\n INCOMING_TOKEN = 'INCOMING_TOKEN',\n MODULE_TRANSACTION = 'MODULE_TRANSACTION',\n CONFIRMATION_REQUEST = 'CONFIRMATION_REQUEST', // Notification-specific webhook\n SAFE_CREATED = 'SAFE_CREATED',\n // Disabled on the Transaction Service\n _PENDING_MULTISIG_TRANSACTION = 'PENDING_MULTISIG_TRANSACTION',\n _NEW_CONFIRMATION = 'NEW_CONFIRMATION',\n _OUTGOING_ETHER = 'OUTGOING_ETHER',\n _OUTGOING_TOKEN = 'OUTGOING_TOKEN',\n}\n\nexport type PendingMultisigTransactionEvent = {\n type: WebhookType._PENDING_MULTISIG_TRANSACTION\n chainId: string\n address: string\n safeTxHash: string\n}\n\nexport type NewConfirmationEvent = {\n type: WebhookType._NEW_CONFIRMATION\n chainId: string\n address: string\n owner: string\n safeTxHash: string\n}\n\nexport type OutgoingEtherEvent = {\n type: WebhookType._OUTGOING_ETHER\n chainId: string\n address: string\n txHash: string\n value: string\n}\n\nexport type OutgoingTokenEvent = {\n type: WebhookType._OUTGOING_TOKEN\n chainId: string\n address: string\n tokenAddress: string\n txHash: string\n value?: string // If ERC-20 token\n}\n\nexport type ExecutedMultisigTransactionEvent = {\n type: WebhookType.EXECUTED_MULTISIG_TRANSACTION\n chainId: string\n address: string\n safeTxHash: string\n failed: 'true' | 'false'\n txHash: string\n}\n\nexport type IncomingEtherEvent = {\n type: WebhookType.INCOMING_ETHER\n chainId: string\n address: string\n txHash: string\n value: string\n}\n\nexport type IncomingTokenEvent = {\n type: WebhookType.INCOMING_TOKEN\n chainId: string\n address: string\n tokenAddress: string\n txHash: string\n value?: string // If ERC-20 token\n}\n\nexport type ModuleTransactionEvent = {\n type: WebhookType.MODULE_TRANSACTION\n chainId: string\n address: string\n module: string\n txHash: string\n}\n\nexport type ConfirmationRequestEvent = {\n type: WebhookType.CONFIRMATION_REQUEST\n chainId: string\n address: string\n safeTxHash: string\n}\n\nexport type SafeCreatedEvent = {\n type: WebhookType.SAFE_CREATED\n chainId: string\n address: string\n txHash: string\n blockNumber: string\n}\n\nexport type WebhookEvent =\n | NewConfirmationEvent\n | ExecutedMultisigTransactionEvent\n | PendingMultisigTransactionEvent\n | IncomingEtherEvent\n | OutgoingEtherEvent\n | IncomingTokenEvent\n | OutgoingTokenEvent\n | ModuleTransactionEvent\n | ConfirmationRequestEvent\n | SafeCreatedEvent\n","// Be careful what you import here as it will increase the service worker bundle size\n\nimport { createStore as createIndexedDb } from 'idb-keyval'\n\nimport type { WebhookType } from '@/service-workers/firebase-messaging/webhook-types'\n\nexport type PushNotificationPrefsKey = `${string}:${string}`\n\nexport enum NotificationsTokenVersion {\n // V1 is the initial version of the notifications token\n V1 = 1,\n // V2 is the version after the migration to the new notification service\n V2 = 2,\n}\n\nexport type PushNotificationPreferences = {\n [safeKey: PushNotificationPrefsKey]: {\n chainId: string\n safeAddress: string\n preferences: { [_key in WebhookType]: boolean }\n }\n}\n\nexport const getPushNotificationPrefsKey = (chainId: string, safeAddress: string): PushNotificationPrefsKey => {\n return `${chainId}:${safeAddress}`\n}\n\nexport const createPushNotificationUuidIndexedDb = () => {\n const DB_NAME = 'notifications-uuid-database'\n const STORE_NAME = 'notifications-uuid-store'\n\n return createIndexedDb(DB_NAME, STORE_NAME)\n}\n\nexport const createPushNotificationPrefsIndexedDb = () => {\n const DB_NAME = 'notifications-preferences-database'\n const STORE_NAME = 'notifications-preferences-store'\n\n return createIndexedDb(DB_NAME, STORE_NAME)\n}\n","/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */\n/**\n * The current version of Ethers.\n */\nexport const version = \"6.13.4\";\n//# sourceMappingURL=_version.js.map","/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map(t => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof (value) === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = (types ? types[key] : null);\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, { enumerable: true, value, writable: false });\n }\n}\n//# sourceMappingURL=properties.js.map","/**\n * All errors in ethers include properties to ensure they are both\n * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``).\n *\n * The [[isError]] function can be used to check the error ``code`` and\n * provide a type guard for the properties present on that error interface.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + (value.map(stringify)).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof (value) === \"object\" && typeof (value.toJSON) === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof (value)) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return (value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return \"{ \" + keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") + \" }\";\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by ethers\n * that matches the error %%code%%.\n *\n * In TypeScript environments, this can be used to check that %%error%%\n * matches an EthersError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return (error && error.code === code);\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format ethers emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties\n * for the corresponding EthersError.\n *\n * Each error in ethers includes the version of ethers, a\n * machine-readable [[ErrorCode]], and depending on %%code%%, additional\n * required properties. The error message will also include the %%message%%,\n * ethers version, %%code%% and all additional properties, serialized.\n */\nexport function makeError(message, code, info) {\n let shortMessage = message;\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n if (key === \"shortMessage\") {\n continue;\n }\n const value = (info[key]);\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n if (error.shortMessage == null) {\n defineProperties(error, { shortMessage });\n }\n return error;\n}\n/**\n * Throws an EthersError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n assert(count <= expectedCount, \"too many arguments\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n ;\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\", info: { form }\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { assert, assertArgument } from \"./errors.js\";\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof (value) === \"string\" && value.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof (value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof (length) === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && (value.length % 2) !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return (isHexString(value, true) || (value instanceof Uint8Array));\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(data) {\n const bytes = getBytes(data);\n let result = \"0x\";\n for (let i = 0; i < bytes.length; i++) {\n const v = bytes[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(datas) {\n return \"0x\" + datas.map((d) => hexlify(d).substring(2)).join(\"\");\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes, length: bytes.length, offset: end\n });\n }\n return hexlify(bytes.slice((start == null) ? 0 : start, (end == null) ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\n//# sourceMappingURL=data.js.map","/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert((value >> width) === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\", fault: \"overflow\", value: _value\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -(((~value) & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = (BN_1 << (width - BN_1));\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\", fault: \"overflow\", value: _value\n });\n const mask = (BN_1 << width) - BN_1;\n return ((~value) & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\", fault: \"overflow\", value: _value\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof (value)) {\n case \"bigint\": return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\n/**\n * Returns %%value%% as a bigint, validating it is valid as a bigint\n * value and that it is positive.\n */\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\", operation: \"getUint\", value\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof (value)) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n assert(width * 2 >= result.length, `value exceeds width (${width} bytes)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value\n });\n // Pad the value to the required width\n while (result.length < (width * 2)) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n return new Uint8Array([]);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map","/**\n * The **FixedNumber** class permits using values with decimal places,\n * using fixed-pont math.\n *\n * Fixed-point math is still based on integers under-the-hood, but uses an\n * internal offset to store fractional components below, and each operation\n * corrects for this after each operation.\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, getNumber, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = (BN_1 << width);\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = (((val % limit) + limit) % limit) & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof (value) === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof (value) === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = (match[1] !== \"u\");\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof (v[key]) === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument((width % 8) === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return (negative + str);\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return (negative + str);\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, an value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() { return this.#format.signed; }\n /**\n * The number of bits available to store the value.\n */\n get width() { return this.#format.width; }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() { return this.#format.decimals; }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() { return this.#val; }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n \n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n \n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n */\n val = checkValue(val, this.#format, safeOp);\n return new FixedNumber(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) { return this.#add(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) { return this.#add(other, \"add\"); }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) { return this.#sub(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) { return this.#sub(other, \"sub\"); }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) { return this.#mul(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) { return this.#mul(other, \"mul\"); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert((value % this.#tens) === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\", fault: \"underflow\", value: this\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\", fault: \"divide-by-zero\", value: this\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) { return this.#div(other); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) { return this.#div(other, \"div\"); }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\", fault: \"divide-by-zero\", value: this\n });\n this.#checkFormat(other);\n const value = (this.#val * this.#tens);\n assert((value % other.#val) === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\", fault: \"underflow\", value: this\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%this%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) { return this.cmp(other) === 0; }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) { return this.cmp(other) < 0; }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) { return this.cmp(other) <= 0; }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) { return this.cmp(other) > 0; }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) { return this.cmp(other) >= 0; }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new FixedNumber(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() { return (this.#val === BN_0); }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() { return (this.#val < BN_0); }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() { return this._value; }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() { return parseFloat(this.toString()); }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return FixedNumber.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, _decimals, _format) {\n const decimals = (_decimals == null) ? 0 : getNumber(_decimals);\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert((value % tens) === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\", fault: \"underflow\", value: _value\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new FixedNumber(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && (match[2].length + match[3].length) > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = (match[2] || \"0\"), decimal = (match[3] || \"\");\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\", fault: \"underflow\", value: _value\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new FixedNumber(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new FixedNumber(_guard, value, format);\n }\n}\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map","/**\n * Most interactions with Ethereum requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Ethereum, //ether// is divisible to 18 decimal places,\n * where each individual unit is called a //wei//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n \"wei\",\n \"kwei\",\n \"mwei\",\n \"gwei\",\n \"szabo\",\n \"finney\",\n \"ether\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit (e.g. ``\"gwei\"`` for 9 decimal places).\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof (unit) === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals, width: 512 }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit (e.g. ``\"gwei\"`` for 9 decimal places).\n */\nexport function parseUnits(value, unit) {\n assertArgument(typeof (value) === \"string\", \"value must be a string\", \"value\", value);\n let decimals = 18;\n if (typeof (unit) === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromString(value, { decimals, width: 512 }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatEther(wei) {\n return formatUnits(wei, 18);\n}\n/**\n * Converts the //decimal string// %%ether%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseEther(ether) {\n return parseUnits(ether, 18);\n}\n//# sourceMappingURL=units.js.map","// Be careful what you import here as it will increase the service worker bundle size\n\nimport { formatUnits } from 'ethers'\nimport { getBalances } from '@safe-global/safe-gateway-typescript-sdk'\nimport type { ChainInfo, TokenInfo } from '@safe-global/safe-gateway-typescript-sdk'\n\nimport { WebhookType } from './webhook-types'\nimport type { WebhookEvent } from './webhook-types'\n\ntype PushNotificationsMap = {\n [P in T['type']]: (\n data: Extract,\n chain?: ChainInfo,\n ) => Promise<{ title: string; body: string }> | { title: string; body: string } | null\n}\n\nconst getChainName = (chainId: string, chain?: ChainInfo): string => {\n return chain?.chainName ?? `chain ${chainId}`\n}\n\nconst getCurrencyName = (chain?: ChainInfo): string => {\n return chain?.nativeCurrency?.name ?? 'Ether'\n}\n\nconst getCurrencySymbol = (chain?: ChainInfo): string => {\n return chain?.nativeCurrency?.symbol ?? 'ETH'\n}\n\nconst getTokenInfo = async (\n chainId: string,\n safeAddress: string,\n tokenAddress: string,\n tokenValue?: string,\n): Promise<{ symbol: string; value: string; name: string }> => {\n const DEFAULT_CURRENCY = 'USD'\n\n const DEFAULT_INFO = {\n symbol: 'tokens',\n value: 'some',\n name: 'Token',\n }\n\n let tokenInfo: TokenInfo | undefined\n\n try {\n const balances = await getBalances(chainId, safeAddress, DEFAULT_CURRENCY)\n tokenInfo = balances.items.find((token) => token.tokenInfo.address === tokenAddress)?.tokenInfo\n } catch {\n // Swallow error\n }\n\n if (!tokenInfo) {\n return DEFAULT_INFO\n }\n\n const symbol = tokenInfo?.symbol ?? DEFAULT_INFO.symbol\n const value = tokenValue && tokenInfo ? formatUnits(tokenValue, tokenInfo.decimals).toString() : DEFAULT_INFO.value\n const name = tokenInfo?.name ?? DEFAULT_INFO.name\n\n return {\n symbol,\n value,\n name,\n }\n}\n\nconst shortenAddress = (address: string, length = 4): string => {\n if (!address) {\n return ''\n }\n\n return `${address.slice(0, length + 2)}...${address.slice(-length)}`\n}\n\nexport const Notifications: PushNotificationsMap = {\n [WebhookType.EXECUTED_MULTISIG_TRANSACTION]: ({ address, failed, txHash, chainId }, chain) => {\n const didFail = failed === 'true'\n return {\n title: `Transaction ${didFail ? 'failed' : 'executed'}`,\n body: `Safe ${shortenAddress(address)} on ${getChainName(chainId, chain)} ${\n didFail ? 'failed to execute' : 'executed'\n } transaction ${shortenAddress(txHash)}.`,\n }\n },\n [WebhookType.INCOMING_ETHER]: ({ address, txHash, value, chainId }, chain) => {\n return {\n title: `${getCurrencyName(chain)} received`,\n body: `Safe ${shortenAddress(address)} on ${getChainName(chainId, chain)} received ${formatUnits(\n value,\n chain?.nativeCurrency?.decimals,\n ).toString()} ${getCurrencySymbol(chain)} in transaction ${shortenAddress(txHash)}.`,\n }\n },\n [WebhookType.INCOMING_TOKEN]: async ({ address, txHash, tokenAddress, value, chainId }, chain) => {\n const token = await getTokenInfo(chainId, address, tokenAddress, value)\n return {\n title: `${token.name} received`,\n body: `Safe ${shortenAddress(address)} on ${getChainName(chainId, chain)} received ${token.value} ${\n token.symbol\n } in transaction ${shortenAddress(txHash)}.`,\n }\n },\n [WebhookType.MODULE_TRANSACTION]: ({ address, module, txHash, chainId }, chain) => {\n return {\n title: 'Module transaction',\n body: `Safe ${shortenAddress(address)} on ${getChainName(\n chainId,\n chain,\n )} executed a module transaction ${shortenAddress(txHash)} from module ${shortenAddress(module)}.`,\n }\n },\n [WebhookType.CONFIRMATION_REQUEST]: ({ address, safeTxHash, chainId }, chain) => {\n return {\n title: 'Confirmation request',\n body: `Safe ${shortenAddress(address)} on ${getChainName(\n chainId,\n chain,\n )} has a new confirmation request for transaction ${shortenAddress(safeTxHash)}.`,\n }\n },\n [WebhookType.SAFE_CREATED]: () => {\n // We do not preemptively subscribe to Safes before they are created\n return null\n },\n // Disabled on the Transaction Service\n [WebhookType._PENDING_MULTISIG_TRANSACTION]: () => {\n // We don't send notifications for pending transactions\n // @see https://github.com/safe-global/safe-transaction-service/blob/master/safe_transaction_service/notifications/tasks.py#L34\n return null\n },\n [WebhookType._NEW_CONFIRMATION]: () => {\n // Disabled for now\n // @see https://github.com/safe-global/safe-transaction-service/blob/master/safe_transaction_service/notifications/tasks.py#L43\n return null\n },\n [WebhookType._OUTGOING_TOKEN]: () => {\n // We don't sen as we have execution notifications\n // @see https://github.com/safe-global/safe-transaction-service/blob/master/safe_transaction_service/notifications/tasks.py#L48\n return null\n },\n [WebhookType._OUTGOING_ETHER]: () => {\n // We don't sen as we have execution notifications\n // @see https://github.com/safe-global/safe-transaction-service/blob/master/safe_transaction_service/notifications/tasks.py#L48\n return null\n },\n}\n","// Be careful what you import here as it will increase the service worker bundle size\n\nimport { get as getFromIndexedDb } from 'idb-keyval'\nimport { getChainsConfig, setBaseUrl } from '@safe-global/safe-gateway-typescript-sdk'\nimport type { MessagePayload } from 'firebase/messaging'\n\nimport { AppRoutes } from '@/config/routes' // Has no internal imports\nimport { isWebhookEvent } from './webhook-types'\nimport {\n getPushNotificationPrefsKey,\n createPushNotificationPrefsIndexedDb,\n} from '@/services/push-notifications/preferences'\nimport { FIREBASE_IS_PRODUCTION } from '@/services/push-notifications/firebase'\nimport { Notifications } from './notification-mapper'\nimport type { WebhookEvent } from './webhook-types'\nimport type { PushNotificationPreferences, PushNotificationPrefsKey } from '@/services/push-notifications/preferences'\n\nconst GATEWAY_URL_PRODUCTION = process.env.NEXT_PUBLIC_GATEWAY_URL_PRODUCTION || 'https://safe-client.safe.global'\nconst GATEWAY_URL_STAGING = process.env.NEXT_PUBLIC_GATEWAY_URL_STAGING || 'https://safe-client.staging.5afe.dev'\n\n// localStorage cannot be accessed in service workers so we reference the flag from the environment\nconst GATEWAY_URL = FIREBASE_IS_PRODUCTION ? GATEWAY_URL_PRODUCTION : GATEWAY_URL_STAGING\n\nsetBaseUrl(GATEWAY_URL)\n\nexport const shouldShowServiceWorkerPushNotification = async (payload: MessagePayload): Promise => {\n if (!isWebhookEvent(payload.data)) {\n return true\n }\n\n const { chainId, address, type } = payload.data\n\n const key = getPushNotificationPrefsKey(chainId, address)\n const store = createPushNotificationPrefsIndexedDb()\n\n const preferencesStore = await getFromIndexedDb(\n key,\n store,\n ).catch(() => null)\n\n if (!preferencesStore) {\n return false\n }\n\n return preferencesStore.preferences[type]\n}\n\nconst getLink = (data: WebhookEvent, shortName?: string) => {\n const URL = self.location.origin\n\n if (!shortName) {\n return URL\n }\n\n const withRoute = (route: string) => {\n return `${URL}${route}?safe=${shortName}:${data.address}`\n }\n\n if ('safeTxHash' in data) {\n return `${withRoute(AppRoutes.transactions.tx)}&id=${data.safeTxHash}`\n }\n\n return withRoute(AppRoutes.transactions.history)\n}\n\nexport const _parseServiceWorkerWebhookPushNotification = async (\n data: WebhookEvent,\n): Promise<{ title: string; body: string; link: string } | undefined> => {\n const chain = await getChainsConfig()\n .then(({ results }) => results.find((chain) => chain.chainId === data.chainId))\n .catch(() => undefined)\n\n // Can be safely casted as `data.type` is a mapped type of `NotificationsMap`\n const notification = await Notifications[data.type](data as any, chain)\n\n if (notification) {\n return {\n ...notification,\n link: getLink(data, chain?.shortName),\n }\n }\n}\n\nexport const parseServiceWorkerPushNotification = async (\n payload: MessagePayload,\n): Promise<({ title?: string; link?: string } & NotificationOptions) | undefined> => {\n // Manually dispatched notifications from the Firebase admin panel; displayed as is\n if (!isWebhookEvent(payload.data)) {\n return payload.notification\n }\n\n // Transaction Service-dispatched notification\n return _parseServiceWorkerWebhookPushNotification(payload.data)\n}\n","// Be careful what you import here as it will increase the service worker bundle size\n\nimport { createStore as createIndexedDb, update as updateIndexedDb } from 'idb-keyval'\nimport type { MessagePayload } from 'firebase/messaging/sw'\n\nimport { isWebhookEvent, WebhookType } from '@/service-workers/firebase-messaging/webhook-types'\n\nexport type NotificationTrackingKey = `${string}:${WebhookType}`\n\nexport type NotificationTracking = {\n [chainKey: NotificationTrackingKey]: {\n shown: number\n opened: number\n }\n}\n\nexport const getNotificationTrackingKey = (chainId: string, type: WebhookType): NotificationTrackingKey => {\n return `${chainId}:${type}`\n}\n\nexport const parseNotificationTrackingKey = (key: string): { chainId: string; type: WebhookType } => {\n const [chainId, type] = key.split(':') as [string, WebhookType]\n\n if (!Object.values(WebhookType).includes(type)) {\n throw new Error(`Invalid notification tracking key: ${key}`)\n }\n\n return {\n chainId,\n type: type as WebhookType,\n }\n}\n\nexport const createNotificationTrackingIndexedDb = () => {\n const DB_NAME = 'notifications-tracking-database'\n const STORE_NAME = 'notifications-tracking-store'\n\n return createIndexedDb(DB_NAME, STORE_NAME)\n}\n\nexport const DEFAULT_WEBHOOK_TRACKING: NotificationTracking[NotificationTrackingKey] = {\n shown: 0,\n opened: 0,\n}\n\nexport const cacheServiceWorkerPushNotificationTrackingEvent = (\n property: keyof NotificationTracking[NotificationTrackingKey],\n data: MessagePayload['data'],\n) => {\n if (!isWebhookEvent(data)) {\n return\n }\n\n const key = getNotificationTrackingKey(data.chainId, data.type)\n const store = createNotificationTrackingIndexedDb()\n\n updateIndexedDb(\n key,\n (notificationCount) => {\n if (notificationCount) {\n return {\n ...notificationCount,\n [property]: (notificationCount[property] ?? 0) + 1,\n }\n }\n\n return DEFAULT_WEBHOOK_TRACKING\n },\n store,\n ).catch(() => null)\n}\n","// Be careful what you import here as it will increase the service worker bundle size\n\n/// \n\nimport { getMessaging, onBackgroundMessage } from 'firebase/messaging/sw'\nimport type { MessagePayload } from 'firebase/messaging/sw'\n\nimport { initializeFirebaseApp } from '@/services/push-notifications/firebase'\nimport {\n shouldShowServiceWorkerPushNotification,\n parseServiceWorkerPushNotification,\n} from '@/service-workers/firebase-messaging/notifications'\nimport { cacheServiceWorkerPushNotificationTrackingEvent } from '@/services/push-notifications/tracking'\n\ndeclare const self: ServiceWorkerGlobalScope\n\ntype NotificationData = MessagePayload['data'] & {\n link: string\n}\n\nexport function firebaseMessagingSw() {\n const ICON_PATH = '/images/safe-logo-green.png'\n\n const app = initializeFirebaseApp()\n\n if (!app) {\n return\n }\n\n // Must be called before `onBackgroundMessage` as Firebase embeds a `notificationclick` listener\n self.addEventListener(\n 'notificationclick',\n (event) => {\n event.notification.close()\n\n const data: NotificationData = event.notification.data\n\n cacheServiceWorkerPushNotificationTrackingEvent('opened', data)\n\n self.clients.openWindow(data.link)\n },\n false,\n )\n\n const messaging = getMessaging(app)\n\n onBackgroundMessage(messaging, async (payload) => {\n const shouldShow = await shouldShowServiceWorkerPushNotification(payload)\n\n if (!shouldShow) {\n return\n }\n\n const notification = await parseServiceWorkerPushNotification(payload)\n\n if (!notification) {\n return\n }\n\n const data: NotificationData = {\n ...payload.data,\n link: notification.link ?? self.location.origin,\n }\n\n cacheServiceWorkerPushNotificationTrackingEvent('shown', data)\n\n self.registration.showNotification(notification.title || '', {\n icon: ICON_PATH,\n body: notification.body,\n data,\n })\n })\n}\n","// Be careful what you import here as it will increase the service worker bundle size\n\n/// \n\nimport { firebaseMessagingSw } from './firebase-messaging/firebase-messaging-sw'\n\nfirebaseMessagingSw()\n"],"names":["initializeApp","FIREBASE_IS_PRODUCTION","process","env","NEXT_PUBLIC_IS_PRODUCTION","FIREBASE_VALID_KEY_PRODUCTION","NEXT_PUBLIC_FIREBASE_VAPID_KEY_PRODUCTION","FIREBASE_VALID_KEY_STAGING","NEXT_PUBLIC_FIREBASE_VAPID_KEY_STAGING","FIREBASE_VAPID_KEY","FIREBASE_OPTIONS","FIREBASE_OPTIONS_PRODUCTION","NEXT_PUBLIC_FIREBASE_OPTIONS_PRODUCTION","FIREBASE_OPTIONS_STAGING","NEXT_PUBLIC_FIREBASE_OPTIONS_STAGING","JSON","parse","isFirebaseOptions","options","Object","values","every","Boolean","initializeFirebaseApp","app","e","console","error","AppRoutes","wc","terms","swap","stake","privacy","licenses","index","imprint","home","cookie","bridge","addressBook","addOwner","_offline","apps","open","custom","bookmarked","balances","nfts","newSafe","load","create","advancedCreate","settings","setup","security","notifications","modules","environmentVariables","data","cookies","appearance","safeApps","share","safeApp","transactions","tx","queue","msg","messages","history","welcome","accounts","isWebhookEvent","WebhookType","some","type","createStore","createIndexedDb","NotificationsTokenVersion","getPushNotificationPrefsKey","chainId","safeAddress","createPushNotificationUuidIndexedDb","DB_NAME","STORE_NAME","createPushNotificationPrefsIndexedDb","formatUnits","getBalances","getChainName","chain","chainName","getCurrencyName","nativeCurrency","name","getCurrencySymbol","symbol","getTokenInfo","tokenAddress","tokenValue","DEFAULT_CURRENCY","DEFAULT_INFO","value","tokenInfo","items","find","token","address","decimals","toString","shortenAddress","length","slice","Notifications","EXECUTED_MULTISIG_TRANSACTION","failed","txHash","didFail","title","body","INCOMING_ETHER","INCOMING_TOKEN","MODULE_TRANSACTION","module","CONFIRMATION_REQUEST","safeTxHash","SAFE_CREATED","_PENDING_MULTISIG_TRANSACTION","_NEW_CONFIRMATION","_OUTGOING_TOKEN","_OUTGOING_ETHER","get","getFromIndexedDb","getChainsConfig","setBaseUrl","GATEWAY_URL_PRODUCTION","NEXT_PUBLIC_GATEWAY_URL_PRODUCTION","GATEWAY_URL_STAGING","NEXT_PUBLIC_GATEWAY_URL_STAGING","GATEWAY_URL","shouldShowServiceWorkerPushNotification","payload","key","store","preferencesStore","catch","preferences","getLink","shortName","URL","self","location","origin","withRoute","route","_parseServiceWorkerWebhookPushNotification","then","results","undefined","notification","link","parseServiceWorkerPushNotification","update","updateIndexedDb","getNotificationTrackingKey","parseNotificationTrackingKey","split","includes","Error","createNotificationTrackingIndexedDb","DEFAULT_WEBHOOK_TRACKING","shown","opened","cacheServiceWorkerPushNotificationTrackingEvent","property","notificationCount","getMessaging","onBackgroundMessage","firebaseMessagingSw","ICON_PATH","addEventListener","event","close","clients","openWindow","messaging","shouldShow","registration","showNotification","icon"],"sourceRoot":"","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,22,23,24,25,26,28,32,33,34,35,36,37,38]} \ No newline at end of file diff --git a/apps/web/src/components/batch/BatchSidebar/BatchTxItem.tsx b/apps/web/src/components/batch/BatchSidebar/BatchTxItem.tsx index 2b6700feff..e1d3d08566 100644 --- a/apps/web/src/components/batch/BatchSidebar/BatchTxItem.tsx +++ b/apps/web/src/components/batch/BatchSidebar/BatchTxItem.tsx @@ -83,7 +83,13 @@ const BatchTxItem = ({ id, count, timestamp, txDetails, onDelete }: BatchTxItemP

- + {timestamp ? dateString(timestamp) : null} diff --git a/apps/web/src/components/transactions/TxDetails/TxData/DecodedData/index.test.tsx b/apps/web/src/components/transactions/TxDetails/TxData/DecodedData/index.test.tsx index 636f683af5..6005fefa78 100644 --- a/apps/web/src/components/transactions/TxDetails/TxData/DecodedData/index.test.tsx +++ b/apps/web/src/components/transactions/TxDetails/TxData/DecodedData/index.test.tsx @@ -11,7 +11,7 @@ describe('DecodedData', () => { it('shows an Interact with block if there is no txData but toInfo', () => { const { getByText } = render() - expect(getByText('Interact with')).toBeInTheDocument() + expect(getByText('Interact with:')).toBeInTheDocument() }) it('shows Hex encoded data if there are no parameters', () => { diff --git a/apps/web/src/components/transactions/TxDetails/TxData/DecodedData/index.tsx b/apps/web/src/components/transactions/TxDetails/TxData/DecodedData/index.tsx index 574a1eea1a..64103d5209 100644 --- a/apps/web/src/components/transactions/TxDetails/TxData/DecodedData/index.tsx +++ b/apps/web/src/components/transactions/TxDetails/TxData/DecodedData/index.tsx @@ -28,7 +28,7 @@ export const DecodedData = ({ txData, toInfo }: Props): ReactElement | null => { return ( { const readOnlyProvider = useWeb3ReadOnly() @@ -66,9 +66,8 @@ export const MigrationToL2TxData = ({ txDetails }: { txDetails: TransactionDetai } }, [txDetails.txHash, txDetails.detailedExecutionInfo, chain, sdk, readOnlyProvider, safe.version]) - const [decodedRealTx, decodedRealTxError] = useDecodeTx(realSafeTx) - const decodedDataUnavailable = !realSafeTx && !realSafeTxLoading + const [txPreview, txPreviewError] = useTxPreview(realSafeTx?.data) return ( @@ -76,12 +75,12 @@ export const MigrationToL2TxData = ({ txDetails }: { txDetails: TransactionDetai {realSafeTxError ? ( {realSafeTxError.message} - ) : decodedRealTxError ? ( - {decodedRealTxError.message} + ) : txPreviewError ? ( + {txPreviewError.message} ) : decodedDataUnavailable ? ( ) : ( - + txPreview && )} ) diff --git a/apps/web/src/components/transactions/TxDetails/TxData/NestedTransaction/ExecTransaction/index.tsx b/apps/web/src/components/transactions/TxDetails/TxData/NestedTransaction/ExecTransaction/index.tsx index 72f4a1c073..9b07845683 100644 --- a/apps/web/src/components/transactions/TxDetails/TxData/NestedTransaction/ExecTransaction/index.tsx +++ b/apps/web/src/components/transactions/TxDetails/TxData/NestedTransaction/ExecTransaction/index.tsx @@ -1,6 +1,6 @@ import { Safe__factory } from '@/types/contracts' import { Skeleton } from '@mui/material' -import { getConfirmationView, type TransactionData } from '@safe-global/safe-gateway-typescript-sdk' +import { type TransactionData } from '@safe-global/safe-gateway-typescript-sdk' import ErrorMessage from '@/components/tx/ErrorMessage' import DecodedTx from '@/components/tx/DecodedTx' @@ -9,9 +9,9 @@ import { useCurrentChain } from '@/hooks/useChains' import { AppRoutes } from '@/config/routes' import { useMemo } from 'react' import type { SafeTransaction } from '@safe-global/safe-core-sdk-types' -import useAsync from '@/hooks/useAsync' import ExternalLink from '@/components/common/ExternalLink' import { NestedTransaction } from '../NestedTransaction' +import useTxPreview from '@/components/tx/confirmation-views/useTxPreview' const safeInterface = Safe__factory.createInterface() @@ -55,20 +55,20 @@ export const ExecTransaction = ({ [data?.hexData], ) - const [decodedNestedTransaction, error] = useAsync(async () => { - if (chain?.chainId && data?.to.value && childSafeTx) { - return await getConfirmationView( - chain.chainId, - data.to.value, - childSafeTx.data.data, - childSafeTx.data.to, - childSafeTx.data.value.toString(), - ) - } - }, [chain?.chainId, data?.to.value, childSafeTx]) + const [txPreview, error] = useTxPreview( + childSafeTx + ? { + operation: childSafeTx.data.operation, + data: childSafeTx.data.data, + to: childSafeTx.data.to, + value: childSafeTx.data.value.toString(), + } + : undefined, + data?.to.value, + ) - const decodedNestedTxDataBlock = decodedNestedTransaction ? ( - + const decodedNestedTxDataBlock = txPreview ? ( + ) : null return ( diff --git a/apps/web/src/components/transactions/TxDetails/TxData/NestedTransaction/OnChainConfirmation/index.tsx b/apps/web/src/components/transactions/TxDetails/TxData/NestedTransaction/OnChainConfirmation/index.tsx index c27134f612..33e91b5289 100644 --- a/apps/web/src/components/transactions/TxDetails/TxData/NestedTransaction/OnChainConfirmation/index.tsx +++ b/apps/web/src/components/transactions/TxDetails/TxData/NestedTransaction/OnChainConfirmation/index.tsx @@ -52,7 +52,13 @@ export const OnChainConfirmation = ({ {nestedTxDetails ? ( <> - + {(isMultiSendTxInfo(nestedTxDetails.txInfo) || isOrderTxInfo(nestedTxDetails.txInfo)) && ( Error parsing data
}> diff --git a/apps/web/src/components/transactions/TxDetails/TxData/index.tsx b/apps/web/src/components/transactions/TxDetails/TxData/index.tsx index fc2bd276de..e9c224fbbc 100644 --- a/apps/web/src/components/transactions/TxDetails/TxData/index.tsx +++ b/apps/web/src/components/transactions/TxDetails/TxData/index.tsx @@ -20,7 +20,7 @@ import { isTransferTxInfo, } from '@/utils/transaction-guards' import { SpendingLimits } from '@/components/transactions/TxDetails/TxData/SpendingLimits' -import type { TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' +import { TransactionStatus, type TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' import { type ReactElement } from 'react' import RejectionTxInfo from '@/components/transactions/TxDetails/TxData/Rejection' import DecodedData from '@/components/transactions/TxDetails/TxData/DecodedData' @@ -36,68 +36,80 @@ import { ExecTransaction } from './NestedTransaction/ExecTransaction' import SafeUpdate from './SafeUpdate' const TxData = ({ + txInfo, + txData, txDetails, trusted, imitation, }: { - txDetails: TransactionDetails + txInfo: TransactionDetails['txInfo'] + txData: TransactionDetails['txData'] + txDetails?: TransactionDetails trusted: boolean imitation: boolean }): ReactElement => { const chainId = useChainId() - const txInfo = txDetails.txInfo - const toInfo = isCustomTxInfo(txDetails.txInfo) ? txDetails.txInfo.to : undefined - if (isOrderTxInfo(txDetails.txInfo)) { - return + if (isOrderTxInfo(txInfo)) { + return } - if (isStakingTxDepositInfo(txDetails.txInfo)) { - return + if (isStakingTxDepositInfo(txInfo)) { + return } - if (isStakingTxExitInfo(txDetails.txInfo)) { - return + if (isStakingTxExitInfo(txInfo)) { + return } - if (isStakingTxWithdrawInfo(txDetails.txInfo)) { - return + if (isStakingTxWithdrawInfo(txInfo)) { + return } if (isTransferTxInfo(txInfo)) { - return + return ( + + ) } if (isSettingsChangeTxInfo(txInfo)) { return } - if (isCancellationTxInfo(txInfo) && isMultisigDetailedExecutionInfo(txDetails.detailedExecutionInfo)) { + if (txDetails && isCancellationTxInfo(txInfo) && isMultisigDetailedExecutionInfo(txDetails.detailedExecutionInfo)) { return } - const method = txDetails.txData?.dataDecoded?.method as SpendingLimitMethods - if (isCustomTxInfo(txInfo) && isSupportedSpendingLimitAddress(txInfo, chainId) && isSpendingLimitMethod(method)) { - return + if ( + isCustomTxInfo(txInfo) && + isSupportedSpendingLimitAddress(txInfo, chainId) && + isSpendingLimitMethod(txData?.dataDecoded?.method) + ) { + return } - if (isMigrateToL2TxData(txDetails.txData, chainId)) { + if (txDetails && isMigrateToL2TxData(txData, chainId)) { return } - if (isOnChainConfirmationTxData(txDetails.txData)) { - return + if (isOnChainConfirmationTxData(txData)) { + return } - if (isExecTxData(txDetails.txData)) { - return + if (isExecTxData(txData)) { + return } - if (isSafeUpdateTxData(txDetails.txData)) { - return + if (isSafeUpdateTxData(txData)) { + return } - return + return } export default TxData diff --git a/apps/web/src/components/transactions/TxDetails/index.tsx b/apps/web/src/components/transactions/TxDetails/index.tsx index f02d6106ae..c368a66c52 100644 --- a/apps/web/src/components/transactions/TxDetails/index.tsx +++ b/apps/web/src/components/transactions/TxDetails/index.tsx @@ -93,7 +93,13 @@ const TxDetailsBlock = ({ txSummary, txDetails }: TxDetailsProps): ReactElement
Error parsing data
}> - + diff --git a/apps/web/src/components/tx-flow/SafeTxProvider.tsx b/apps/web/src/components/tx-flow/SafeTxProvider.tsx index 63dd9d9a9d..b51faaf6e2 100644 --- a/apps/web/src/components/tx-flow/SafeTxProvider.tsx +++ b/apps/web/src/components/tx-flow/SafeTxProvider.tsx @@ -89,6 +89,8 @@ const SafeTxProvider = ({ children }: { children: ReactNode }): ReactElement => if (isSigned || !safeTx?.data) return if (safeTx.data.nonce === finalNonce && safeTx.data.safeTxGas === finalSafeTxGas) return + setSafeTxError(undefined) + createTx({ ...safeTx.data, safeTxGas: String(finalSafeTxGas) }, finalNonce) .then((tx) => { setSafeTx(tx) diff --git a/apps/web/src/components/tx-flow/flows/RecoverAccount/RecoverAccountFlowReview.tsx b/apps/web/src/components/tx-flow/flows/RecoverAccount/RecoverAccountFlowReview.tsx index 71db742fce..45981e7224 100644 --- a/apps/web/src/components/tx-flow/flows/RecoverAccount/RecoverAccountFlowReview.tsx +++ b/apps/web/src/components/tx-flow/flows/RecoverAccount/RecoverAccountFlowReview.tsx @@ -10,7 +10,6 @@ import DecodedTx from '@/components/tx/DecodedTx' import ErrorMessage from '@/components/tx/ErrorMessage' import ConfirmationTitle, { ConfirmationTitleTypes } from '@/components/tx/SignOrExecuteForm/ConfirmationTitle' import TxChecks from '@/components/tx/SignOrExecuteForm/TxChecks' -import useDecodeTx from '@/hooks/useDecodeTx' import TxCard from '../../common/TxCard' import { SafeTxContext } from '../../SafeTxProvider' import CheckWallet from '@/components/common/CheckWallet' @@ -36,6 +35,7 @@ import { BlockaidBalanceChanges } from '@/components/tx/security/blockaid/Blocka import NetworkWarning from '@/components/new-safe/create/NetworkWarning' import { useGetTransactionDetailsQuery } from '@/store/api/gateway' import { skipToken } from '@reduxjs/toolkit/query' +import useTxPreview from '@/components/tx/confirmation-views/useTxPreview' export function RecoverAccountFlowReview({ params }: { params: RecoverAccountFlowProps }): ReactElement | null { // Form state @@ -46,7 +46,6 @@ export function RecoverAccountFlowReview({ params }: { params: RecoverAccountFlo // Hooks const { setTxFlow } = useContext(TxModalContext) const { safeTx, safeTxError, setSafeTx, setSafeTxError } = useContext(SafeTxContext) - const [decodedData] = useDecodeTx(safeTx) const { safe } = useSafeInfo() const wallet = useWallet() const onboard = useOnboard() @@ -55,6 +54,7 @@ export function RecoverAccountFlowReview({ params }: { params: RecoverAccountFlo const [, executionValidationError] = useIsValidRecoveryExecTransactionFromModule(recovery?.address, safeTx) const { data: txDetails } = useGetTransactionDetailsQuery(skipToken) + const [txPreview] = useTxPreview(safeTx?.data, undefined, txDetails?.txId) // Proposal const newThreshold = Number(params[RecoverAccountFlowFields.threshold]) @@ -131,7 +131,7 @@ export function RecoverAccountFlowReview({ params }: { params: RecoverAccountFlo - + diff --git a/apps/web/src/components/tx-flow/flows/SignMessageOnChain/ReviewSignMessageOnChain.test.tsx b/apps/web/src/components/tx-flow/flows/SignMessageOnChain/ReviewSignMessageOnChain.test.tsx index a48d0cb15b..59fbd945b0 100644 --- a/apps/web/src/components/tx-flow/flows/SignMessageOnChain/ReviewSignMessageOnChain.test.tsx +++ b/apps/web/src/components/tx-flow/flows/SignMessageOnChain/ReviewSignMessageOnChain.test.tsx @@ -3,7 +3,7 @@ import * as web3 from '@/hooks/wallets/web3' import * as useSafeInfo from '@/hooks/useSafeInfo' import { render, screen } from '@/tests/test-utils' import * as execThroughRoleHooks from '@/components/tx/SignOrExecuteForm/ExecuteThroughRoleForm/hooks' -import type { TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' +import type { TransactionPreview } from '@safe-global/safe-gateway-typescript-sdk' import { SafeAppAccessPolicyTypes } from '@safe-global/safe-gateway-typescript-sdk' import ReviewSignMessageOnChain from '@/components/tx-flow/flows/SignMessageOnChain/ReviewSignMessageOnChain' import { JsonRpcProvider } from 'ethers' @@ -13,15 +13,16 @@ import { extendedSafeInfoBuilder } from '@/tests/builders/safe' import type { SafeTxContextParams } from '../../SafeTxProvider' import { SafeTxContext } from '../../SafeTxProvider' import { createSafeTx } from '@/tests/builders/safeTx' -import * as hooks from '@/components/tx/SignOrExecuteForm/hooks' +import * as useTxPreviewHooks from '@/components/tx/confirmation-views/useTxPreview' jest.spyOn(execThroughRoleHooks, 'useRoles').mockReturnValue([]) describe('ReviewSignMessageOnChain', () => { test('can handle messages with EIP712Domain type in the JSON-RPC payload', async () => { - jest.spyOn(hooks, 'useProposeTx').mockReturnValue([ + jest.spyOn(useTxPreviewHooks, 'default').mockReturnValue([ { txInfo: {}, - } as TransactionDetails, + txData: {}, + } as TransactionPreview, undefined, false, ]) diff --git a/apps/web/src/components/tx/DecodedTx/index.test.tsx b/apps/web/src/components/tx/DecodedTx/index.test.tsx index 0cf81f15f1..40424e9a9b 100644 --- a/apps/web/src/components/tx/DecodedTx/index.test.tsx +++ b/apps/web/src/components/tx/DecodedTx/index.test.tsx @@ -7,8 +7,10 @@ import { DetailedExecutionInfoType, SettingsInfoType, TransactionInfoType, + TransactionTokenType, + TransferDirection, } from '@safe-global/safe-gateway-typescript-sdk' -import type { DecodedDataResponse } from '@safe-global/safe-gateway-typescript-sdk' +import type { DecodedDataResponse, TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' const txDetails = createMockTransactionDetails({ txInfo: { @@ -104,44 +106,54 @@ describe('DecodedTx', () => { it('should render a native transfer', async () => { const result = render( , ) - expect(result.queryByText('Value:')).toBeInTheDocument() + await waitFor(() => { + expect(result.queryByText('native transfer')).toBeInTheDocument() + }) fireEvent.click(result.getByText('Advanced details')) @@ -170,17 +182,23 @@ describe('DecodedTx', () => { }, } as SafeTransaction } - decodedData={ + txInfo={txDetails.txInfo} + txData={ { - method: '', - } as DecodedDataResponse + ...txDetails.txData, + dataDecoded: { + method: '', + } as DecodedDataResponse, + } as TransactionDetails['txData'] } showMethodCall />, ) - expect(result.queryByText('Value:')).toBeInTheDocument() - expect(result.queryByText('Data (hex-encoded)')).toBeInTheDocument() + await waitFor(() => { + expect(result.queryByText('Interacted with:')).toBeInTheDocument() + expect(result.queryByText('Data (hex-encoded)')).toBeInTheDocument() + }) fireEvent.click(result.getByText('Advanced details')) @@ -193,7 +211,6 @@ describe('DecodedTx', () => { it('should render an ERC20 transfer', async () => { const result = render( { }, } as SafeTransaction } - decodedData={{ - method: 'transfer', - parameters: [ - { - name: 'to', - type: 'address', - value: '0x474e5Ded6b5D078163BFB8F6dBa355C3aA5478C8', - }, - { - name: 'value', - type: 'uint256', - value: '16745726664999765048', + txInfo={txDetails.txInfo} + txData={ + { + ...txDetails.txData, + dataDecoded: { + method: 'transfer', + parameters: [ + { + name: 'to', + type: 'address', + value: '0x474e5Ded6b5D078163BFB8F6dBa355C3aA5478C8', + }, + { + name: 'value', + type: 'uint256', + value: '16745726664999765048', + }, + ], }, - ], - }} + } as TransactionDetails['txData'] + } />, ) @@ -263,70 +286,76 @@ describe('DecodedTx', () => { }, } as SafeTransaction } - decodedData={{ - method: 'multiSend', - parameters: [ - { - name: 'transactions', - type: 'bytes', - value: '0x0057f1887a8bf19b14fc0df', - valueDecoded: [ - { - operation: 0, - to: '0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85', - value: '0', - data: '0x42842e0e0000000000000000000', - dataDecoded: { - method: 'safeTransferFrom', - parameters: [ - { - name: 'from', - type: 'address', - value: '0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6', - }, - { - name: 'to', - type: 'address', - value: '0x474e5Ded6b5D078163BFB8F6dBa355C3aA5478C8', - }, - { - name: 'tokenId', - type: 'uint256', - value: '52964617156216674852059480948658573966398315289847646343083345905048987083870', - }, - ], - }, - }, + txInfo={txDetails.txInfo} + txData={ + { + ...txDetails.txData, + dataDecoded: { + method: 'multiSend', + parameters: [ { - operation: 0, - to: '0xD014e20A75437a4bd0FbB40498FF94e6F337c3e9', - value: '0', - data: '0x42842e0e000000000000000000000000a77de', - dataDecoded: { - method: 'safeTransferFrom', - parameters: [ - { - name: 'from', - type: 'address', - value: '0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6', - }, - { - name: 'to', - type: 'address', - value: '0x474e5Ded6b5D078163BFB8F6dBa355C3aA5478C8', + name: 'transactions', + type: 'bytes', + value: '0x0057f1887a8bf19b14fc0df', + valueDecoded: [ + { + operation: 0, + to: '0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85', + value: '0', + data: '0x42842e0e0000000000000000000', + dataDecoded: { + method: 'safeTransferFrom', + parameters: [ + { + name: 'from', + type: 'address', + value: '0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6', + }, + { + name: 'to', + type: 'address', + value: '0x474e5Ded6b5D078163BFB8F6dBa355C3aA5478C8', + }, + { + name: 'tokenId', + type: 'uint256', + value: '52964617156216674852059480948658573966398315289847646343083345905048987083870', + }, + ], }, - { - name: 'tokenId', - type: 'uint256', - value: '412', + }, + { + operation: 0, + to: '0xD014e20A75437a4bd0FbB40498FF94e6F337c3e9', + value: '0', + data: '0x42842e0e000000000000000000000000a77de', + dataDecoded: { + method: 'safeTransferFrom', + parameters: [ + { + name: 'from', + type: 'address', + value: '0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6', + }, + { + name: 'to', + type: 'address', + value: '0x474e5Ded6b5D078163BFB8F6dBa355C3aA5478C8', + }, + { + name: 'tokenId', + type: 'uint256', + value: '412', + }, + ], }, - ], - }, + }, + ], }, ], }, - ], - }} + } as TransactionDetails['txData'] + } showMethodCall showMultisend />, @@ -338,7 +367,6 @@ describe('DecodedTx', () => { it('should render a function call without parameters', async () => { const result = render( { } as SafeTransaction } showMultisend={false} - decodedData={{ - method: 'deposit', - parameters: [], - }} + txInfo={txDetails.txInfo} + txData={ + { + ...txDetails.txData, + dataDecoded: { + method: 'deposit', + parameters: [], + }, + } as TransactionDetails['txData'] + } showMethodCall />, ) diff --git a/apps/web/src/components/tx/DecodedTx/index.tsx b/apps/web/src/components/tx/DecodedTx/index.tsx index d4e68fbec5..7d7f628deb 100644 --- a/apps/web/src/components/tx/DecodedTx/index.tsx +++ b/apps/web/src/components/tx/DecodedTx/index.tsx @@ -1,15 +1,9 @@ import { type SyntheticEvent, type ReactElement, memo } from 'react' import { ErrorBoundary } from '@sentry/react' -import { - isCustomTxInfo, - isMultisigDetailedExecutionInfo, - isNativeTokenTransfer, - isTransferTxInfo, -} from '@/utils/transaction-guards' +import { isCustomTxInfo, isNativeTokenTransfer, isTransferTxInfo } from '@/utils/transaction-guards' import { Accordion, AccordionDetails, AccordionSummary, Box, Stack } from '@mui/material' -import { OperationType, type SafeTransaction } from '@safe-global/safe-core-sdk-types' -import type { DataDecoded, DecodedDataResponse, TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' -import { Operation } from '@safe-global/safe-gateway-typescript-sdk' +import { type SafeTransaction } from '@safe-global/safe-core-sdk-types' +import type { TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' import Summary, { PartialSummary } from '@/components/transactions/TxDetails/Summary' import { trackEvent, MODALS_EVENTS } from '@/services/analytics' import Multisend from '@/components/transactions/TxDetails/TxData/DecodedData/Multisend' @@ -22,8 +16,9 @@ type DecodedTxProps = { tx?: SafeTransaction txId?: string txDetails?: TransactionDetails + txInfo?: TransactionDetails['txInfo'] + txData?: TransactionDetails['txData'] showMultisend?: boolean - decodedData?: DecodedDataResponse | DataDecoded showMethodCall?: boolean showAdvancedDetails?: boolean } @@ -37,42 +32,28 @@ export const Divider = () => ( /> ) +const onChangeExpand = (_: SyntheticEvent, expanded: boolean) => { + trackEvent({ ...MODALS_EVENTS.TX_DETAILS, label: expanded ? 'Open' : 'Close' }) +} + const DecodedTx = ({ tx, txDetails, - decodedData, + txInfo, + txData, showMultisend = true, showMethodCall = false, showAdvancedDetails = true, }: DecodedTxProps): ReactElement => { + const decodedData = txData?.dataDecoded const isMultisend = decodedData?.parameters && !!decodedData?.parameters[0]?.valueDecoded const isMethodCallInAdvanced = showAdvancedDetails && (!showMethodCall || (isMultisend && showMultisend)) - const onChangeExpand = (_: SyntheticEvent, expanded: boolean) => { - trackEvent({ ...MODALS_EVENTS.TX_DETAILS, label: expanded ? 'Open' : 'Close' }) - } - const addressInfoIndex = txDetails?.txData?.addressInfoIndex - - const isCreation = - txDetails && - isMultisigDetailedExecutionInfo(txDetails.detailedExecutionInfo) && - txDetails.detailedExecutionInfo.confirmations.length === 0 - - const txData = { - dataDecoded: decodedData, - to: { value: tx?.data.to || '' }, - value: tx?.data.value, - hexData: tx?.data.data, - operation: tx?.data.operation === OperationType.DelegateCall ? Operation.DELEGATE : Operation.CALL, - trustedDelegateCallTarget: txDetails?.txData?.trustedDelegateCallTarget ?? true, - addressInfoIndex, - } - let toInfo = tx && { value: tx.data.to, } - if (txDetails && isCustomTxInfo(txDetails?.txInfo)) { - toInfo = txDetails?.txInfo.to + if (txInfo && isCustomTxInfo(txInfo)) { + toInfo = txInfo.to } const decodedDataBlock = @@ -81,17 +62,12 @@ const DecodedTx = ({ return ( {!isMethodCallInAdvanced && ( - + {decodedDataBlock} )} - {isMultisend && showMultisend && } + + {isMultisend && showMultisend && } {showAdvancedDetails && ( @@ -103,17 +79,13 @@ const DecodedTx = ({ > Advanced details - + {isMethodCallInAdvanced && decodedData?.method} - {txDetails && - isTransferTxInfo(txDetails.txInfo) && - isNativeTokenTransfer(txDetails.txInfo.transferInfo) && - 'native transfer'} + {txInfo && isTransferTxInfo(txInfo) && isNativeTokenTransfer(txInfo.transferInfo) && ( + native transfer + )} + {showDecodedData && ( <> @@ -122,7 +94,7 @@ const DecodedTx = ({ )} - {txDetails && !showDecodedData && !isCreation ? ( + {txDetails && !showDecodedData ? ( isCreation?: boolean txDetails?: TransactionDetails + txPreview?: TransactionPreview }): ReactElement => { const [customOrigin, setCustomOrigin] = useState(props.origin) const { transactionExecution } = useAppSelector(selectSettings) @@ -179,8 +180,10 @@ export const SignOrExecuteForm = ({ {props.children} - + diff --git a/apps/web/src/components/tx/SignOrExecuteForm/__tests__/SignOrExecute.test.tsx b/apps/web/src/components/tx/SignOrExecuteForm/__tests__/SignOrExecute.test.tsx index 44d7769f9d..455f7306d6 100644 --- a/apps/web/src/components/tx/SignOrExecuteForm/__tests__/SignOrExecute.test.tsx +++ b/apps/web/src/components/tx/SignOrExecuteForm/__tests__/SignOrExecute.test.tsx @@ -1,10 +1,10 @@ import SignOrExecute from '../index' import { render } from '@/tests/test-utils' -import * as hooks from '../hooks' -import type { TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' +import type { TransactionPreview } from '@safe-global/safe-gateway-typescript-sdk' import type { SafeTxContextParams } from '@/components/tx-flow/SafeTxProvider' import { SafeTxContext } from '@/components/tx-flow/SafeTxProvider' import { createSafeTx } from '@/tests/builders/safeTx' +import * as useTxPreviewHooks from '@/components/tx/confirmation-views/useTxPreview' let isSafeOwner = true // mock useIsSafeOwner @@ -32,10 +32,11 @@ describe('SignOrExecute', () => { }) it('should display a confirmation screen', async () => { - jest.spyOn(hooks, 'useProposeTx').mockReturnValue([ + jest.spyOn(useTxPreviewHooks, 'default').mockReturnValue([ { txInfo: {}, - } as TransactionDetails, + txData: {}, + } as TransactionPreview, undefined, false, ]) @@ -57,7 +58,9 @@ describe('SignOrExecute', () => { }) it('should display an error screen', async () => { - jest.spyOn(hooks, 'useProposeTx').mockReturnValue([undefined, new Error('This is a mock error message'), false]) + jest + .spyOn(useTxPreviewHooks, 'default') + .mockReturnValue([undefined, new Error('This is a mock error message'), false]) const { container } = render(
+ > +
+
+

+ safeTxGas: +

+
+
+
+ 0 +
+
+
+
+
+

+ Raw data: +

+
+
+
+
+ 0 + bytes +
+ + + +
+
+
+
@@ -304,7 +379,7 @@ exports[`SignOrExecute should display an error screen 1`] = ` />
Promise @@ -38,26 +35,6 @@ type TxActions = { proposeTx: (safeTx: SafeTransaction, txId?: string, origin?: string) => Promise } -type txDetails = AsyncResult - -export const useProposeTx = (safeTx?: SafeTransaction, txId?: string, origin?: string): txDetails => { - const { safe } = useSafeInfo() - const signer = useSigner() - const sender = signer?.address || safe.owners?.[0]?.value - - return useAsync( - async () => { - if (txId) return getTransactionDetails(safe.chainId, txId) - if (!safeTx || !sender) return - const safeSDK = getAndValidateSafeSDK() - const safeTxHash = await safeSDK.getTransactionHash(safeTx) - return directProposeTx(safe.chainId, safe.address.value, sender, safeTx, safeTxHash, origin) - }, - [safeTx, txId, origin, safe.chainId, safe.address.value, sender], - false, - ) -} - export const useTxActions = (): TxActions => { const { safe } = useSafeInfo() const onboard = useOnboard() diff --git a/apps/web/src/components/tx/SignOrExecuteForm/index.tsx b/apps/web/src/components/tx/SignOrExecuteForm/index.tsx index d7696aeb0b..5c56b773b1 100644 --- a/apps/web/src/components/tx/SignOrExecuteForm/index.tsx +++ b/apps/web/src/components/tx/SignOrExecuteForm/index.tsx @@ -1,12 +1,12 @@ +import { useContext } from 'react' import { SafeTxContext } from '@/components/tx-flow/SafeTxProvider' import SignOrExecuteForm from './SignOrExecuteForm' import type { SignOrExecuteProps, SubmitCallback } from './SignOrExecuteForm' import SignOrExecuteSkeleton from './SignOrExecuteSkeleton' -import { useProposeTx } from './hooks' -import { useContext } from 'react' -import useSafeInfo from '@/hooks/useSafeInfo' +import useTxDetails from '@/hooks/useTxDetails' +import useTxPreview from '../confirmation-views/useTxPreview' -type SignOrExecuteExtendedProps = Omit & { +type SignOrExecuteExtendedProps = SignOrExecuteProps & { onSubmit?: SubmitCallback txId?: string children?: React.ReactNode @@ -22,17 +22,22 @@ type SignOrExecuteExtendedProps = Omit & { } const SignOrExecute = (props: SignOrExecuteExtendedProps) => { - const { safeTx } = useContext(SafeTxContext) - const { safe } = useSafeInfo() - const [txDetails, error] = useProposeTx(safe.deployed ? safeTx : undefined, props.txId, props.origin) + const { safeTx, safeTxError } = useContext(SafeTxContext) + const [txDetails, , txDetailsLoading] = useTxDetails(props.txId) + const [txPreview, , txPreviewLoading] = useTxPreview(safeTx?.data, undefined, props.txId) - // Show the loader only the first time the tx is being loaded - if ((!txDetails && !error && safe.deployed) || !safeTx) { + if ((!safeTx && !safeTxError) || txDetailsLoading || txPreviewLoading) { return } return ( - + {props.children} ) diff --git a/apps/web/src/components/tx/confirmation-views/ChangeThreshold/index.tsx b/apps/web/src/components/tx/confirmation-views/ChangeThreshold/index.tsx index ba7faedd75..f81cd203f0 100644 --- a/apps/web/src/components/tx/confirmation-views/ChangeThreshold/index.tsx +++ b/apps/web/src/components/tx/confirmation-views/ChangeThreshold/index.tsx @@ -10,13 +10,13 @@ import { isChangeThresholdView } from '../utils' import { maybePlural } from '@/utils/formatters' interface ChangeThresholdProps { - txDetails?: TransactionDetails + txInfo?: TransactionDetails['txInfo'] } -function ChangeThreshold({ txDetails }: ChangeThresholdProps) { +function ChangeThreshold({ txInfo }: ChangeThresholdProps) { const { safe } = useSafeInfo() const { newThreshold } = useContext(ChangeThresholdReviewContext) - const threshold = txDetails && isChangeThresholdView(txDetails.txInfo) && txDetails.txInfo.settingsInfo?.threshold + const threshold = txInfo && isChangeThresholdView(txInfo) && txInfo.settingsInfo?.threshold return ( <> diff --git a/apps/web/src/components/tx/confirmation-views/SettingsChange/SettingsChange.stories.tsx b/apps/web/src/components/tx/confirmation-views/SettingsChange/SettingsChange.stories.tsx index cc35bf17cd..417a858a3a 100644 --- a/apps/web/src/components/tx/confirmation-views/SettingsChange/SettingsChange.stories.tsx +++ b/apps/web/src/components/tx/confirmation-views/SettingsChange/SettingsChange.stories.tsx @@ -32,7 +32,7 @@ type Story = StoryObj export const AddOwner: Story = { args: { txInfo, - txDetails: {} as TransactionDetails, + txData: {} as TransactionDetails['txData'], }, } @@ -54,6 +54,6 @@ export const SwapOwner: Story = { }, }, }, - txDetails: {} as TransactionDetails, + txData: {} as TransactionDetails['txData'], }, } diff --git a/apps/web/src/components/tx/confirmation-views/SettingsChange/SettingsChange.test.tsx b/apps/web/src/components/tx/confirmation-views/SettingsChange/SettingsChange.test.tsx index 1cc63a7808..6a50ab63ef 100644 --- a/apps/web/src/components/tx/confirmation-views/SettingsChange/SettingsChange.test.tsx +++ b/apps/web/src/components/tx/confirmation-views/SettingsChange/SettingsChange.test.tsx @@ -12,7 +12,7 @@ describe('SettingsChange', () => { it('should display the SettingsChange component with owner details', () => { const { container, getByText } = render( - + , ) @@ -32,7 +32,7 @@ describe('SettingsChange', () => { const { container, getByText } = render( ) } diff --git a/apps/web/src/components/tx/confirmation-views/__snapshots__/ConfirmationView.test.tsx.snap b/apps/web/src/components/tx/confirmation-views/__snapshots__/ConfirmationView.test.tsx.snap index 3cc1bdfc79..048cb1a08f 100644 --- a/apps/web/src/components/tx/confirmation-views/__snapshots__/ConfirmationView.test.tsx.snap +++ b/apps/web/src/components/tx/confirmation-views/__snapshots__/ConfirmationView.test.tsx.snap @@ -148,7 +148,7 @@ exports[`ConfirmationView should display a confirmation screen for a SETTINGS_CH />
addOwnerWithThreshold @@ -263,49 +263,6 @@ exports[`ConfirmationView should display a confirmation screen for a SETTINGS_CH
-
-
-

- Value: -

-
-
-
- ETH -

- ETH -

-

- 0 -

-
-
-
@@ -655,7 +612,7 @@ exports[`ConfirmationView should display a confirmation with method call when th />
addOwnerWithThreshold @@ -717,7 +674,7 @@ exports[`ConfirmationView should display a confirmation with method call when th >
- 0xDa5e...EE6b + 0xE20C...5f67
@@ -770,49 +727,6 @@ exports[`ConfirmationView should display a confirmation with method call when th
-
-
-

- Value: -

-
-
-
- ETH -

- ETH -

-

- 0 -

-
-
-
diff --git a/apps/web/src/components/tx/confirmation-views/index.tsx b/apps/web/src/components/tx/confirmation-views/index.tsx index 849ba5dab6..5c080564de 100644 --- a/apps/web/src/components/tx/confirmation-views/index.tsx +++ b/apps/web/src/components/tx/confirmation-views/index.tsx @@ -1,3 +1,4 @@ +import type { TransactionPreview } from '@safe-global/safe-gateway-typescript-sdk' import { type TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' import DecodedTx from '../DecodedTx' import type { SafeTransaction } from '@safe-global/safe-core-sdk-types' @@ -29,6 +30,7 @@ import { MigrateToL2Information } from './MigrateToL2Information' type ConfirmationViewProps = { txDetails?: TransactionDetails + txPreview?: TransactionPreview safeTx?: SafeTransaction txId?: string isBatch?: boolean @@ -38,51 +40,48 @@ type ConfirmationViewProps = { children?: ReactNode } -// TODO: Maybe unify this with the if block in TxData const getConfirmationViewComponent = ({ - txDetails, txInfo, + txData, txFlow, }: NarrowConfirmationViewProps & { txFlow?: ReactElement }) => { - if (isChangeThresholdView(txInfo)) return + if (isChangeThresholdView(txInfo)) return if (isConfirmBatchView(txFlow)) return - if (isSettingsChangeView(txInfo)) return + if (isSettingsChangeView(txInfo)) return - if (isOnChainConfirmationTxData(txDetails.txData)) - return + if (isOnChainConfirmationTxData(txData)) return - if (isExecTxData(txDetails.txData)) return + if (isExecTxData(txData)) return - if (isSwapOrderTxInfo(txInfo)) return + if (isSwapOrderTxInfo(txInfo)) return - if (isAnyStakingTxInfo(txInfo)) return + if (isAnyStakingTxInfo(txInfo)) return - if (isCustomTxInfo(txInfo) && isSafeUpdateTxData(txDetails.txData)) return + if (isCustomTxInfo(txInfo) && isSafeUpdateTxData(txData)) return - if (isCustomTxInfo(txInfo) && isSafeToL2MigrationTxData(txDetails.txData)) { - return + if (isCustomTxInfo(txInfo) && isSafeToL2MigrationTxData(txData)) { + return } return null } -const ConfirmationView = ({ txDetails, ...props }: ConfirmationViewProps) => { - const { txId } = txDetails || {} +const ConfirmationView = ({ safeTx, txPreview, txDetails, ...props }: ConfirmationViewProps) => { + const { txId } = props const { txFlow } = useContext(TxModalContext) - - const ConfirmationViewComponent = useMemo( - () => - txDetails - ? getConfirmationViewComponent({ - txDetails, - txInfo: txDetails.txInfo, - txFlow, - }) - : undefined, - [txDetails, txFlow], - ) + const details = txDetails ?? txPreview + + const ConfirmationViewComponent = useMemo(() => { + return details + ? getConfirmationViewComponent({ + txInfo: details.txInfo, + txData: details.txData, + txFlow, + }) + : undefined + }, [details, txFlow]) const showTxDetails = txId && @@ -95,14 +94,17 @@ const ConfirmationView = ({ txDetails, ...props }: ConfirmationViewProps) => { return ( <> {ConfirmationViewComponent || - (showTxDetails && txDetails && )} + (showTxDetails && details && ( + + ))} {props.children} diff --git a/apps/web/src/components/tx/confirmation-views/types.d.ts b/apps/web/src/components/tx/confirmation-views/types.d.ts index 6e60f8fb9c..72b610c6f3 100644 --- a/apps/web/src/components/tx/confirmation-views/types.d.ts +++ b/apps/web/src/components/tx/confirmation-views/types.d.ts @@ -1,6 +1,6 @@ import type { TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' export type NarrowConfirmationViewProps = { - txDetails: TransactionDetails txInfo: TransactionDetails['txInfo'] + txData?: TransactionDetails['txData'] } diff --git a/apps/web/src/components/tx/confirmation-views/useTxPreview.ts b/apps/web/src/components/tx/confirmation-views/useTxPreview.ts new file mode 100644 index 0000000000..081d2892c4 --- /dev/null +++ b/apps/web/src/components/tx/confirmation-views/useTxPreview.ts @@ -0,0 +1,29 @@ +import { Operation, getTxPreview } from '@safe-global/safe-gateway-typescript-sdk' +import type { SafeTransaction } from '@safe-global/safe-core-sdk-types' +import useAsync from '@/hooks/useAsync' +import useSafeInfo from '@/hooks/useSafeInfo' + +const useTxPreview = ( + safeTxData?: { + operation: SafeTransaction['data']['operation'] + data: SafeTransaction['data']['data'] + value: SafeTransaction['data']['value'] + to: SafeTransaction['data']['to'] + }, + customSafeAddress?: string, + txId?: string, +) => { + const { + safe: { chainId }, + safeAddress, + } = useSafeInfo() + const address = customSafeAddress ?? safeAddress + + return useAsync(() => { + if (txId || !safeTxData?.data) return + const { operation = Operation.CALL, data = '', to, value } = safeTxData || {} + return getTxPreview(chainId, address, operation, data, to, value) + }, [txId, chainId, address, safeTxData]) +} + +export default useTxPreview diff --git a/apps/web/src/features/tx-notes/TxNote.tsx b/apps/web/src/features/tx-notes/TxNote.tsx index 3d402e0b3e..d648770ca8 100644 --- a/apps/web/src/features/tx-notes/TxNote.tsx +++ b/apps/web/src/features/tx-notes/TxNote.tsx @@ -5,9 +5,7 @@ import { isMultisigDetailedExecutionInfo } from '@/utils/transaction-guards' import EthHashInfo from '@/components/common/EthHashInfo' export function TxNote({ txDetails }: { txDetails: TransactionDetails | undefined }) { - // @FIXME: update CGW types to include note - const note = (txDetails as TransactionDetails & { note: string | null })?.note - + const note = txDetails?.note if (!note) return null const creator = diff --git a/apps/web/src/features/tx-notes/TxNoteForm.tsx b/apps/web/src/features/tx-notes/TxNoteForm.tsx index 99d266ff54..22404b4d35 100644 --- a/apps/web/src/features/tx-notes/TxNoteForm.tsx +++ b/apps/web/src/features/tx-notes/TxNoteForm.tsx @@ -2,7 +2,6 @@ import type { TransactionDetails } from '@safe-global/safe-gateway-typescript-sd import TxCard from '@/components/tx-flow/common/TxCard' import { TxNote } from './TxNote' import { TxNoteInput } from './TxNoteInput' -import useSafeInfo from '@/hooks/useSafeInfo' export function TxNoteForm({ isCreation, @@ -13,13 +12,7 @@ export function TxNoteForm({ txDetails?: TransactionDetails onChange: (note: string) => void }) { - const { safe } = useSafeInfo() - if (safe.threshold === 1) return null // Notes don't work yet for 1/X Safes - - // @FIXME: update CGW types to include note - const note = (txDetails as TransactionDetails & { note: string | null })?.note - - if (!isCreation && !note) return null + if (!isCreation && !txDetails?.note) return null return {isCreation ? : } } diff --git a/apps/web/src/hooks/__tests__/useDecodeTx.test.ts b/apps/web/src/hooks/__tests__/useDecodeTx.test.ts deleted file mode 100644 index 4127c2ce0e..0000000000 --- a/apps/web/src/hooks/__tests__/useDecodeTx.test.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { renderHook } from '@/tests/test-utils' -import useDecodeTx from '../useDecodeTx' -import { waitFor } from '@testing-library/react' -import { createMockSafeTransaction } from '@/tests/transactions' -import { faker } from '@faker-js/faker' -import * as safeGatewayTypescriptSdk from '@safe-global/safe-gateway-typescript-sdk' -import { getConfirmationView } from '@safe-global/safe-gateway-typescript-sdk' -import { getNativeTransferData } from '@/services/tx/tokenTransferParams' - -jest.mock('@safe-global/safe-gateway-typescript-sdk', () => ({ - getConfirmationView: jest.fn(), -})) - -jest.mock('../useChainId', () => jest.fn().mockReturnValue('5')) -jest.mock('../useSafeAddress', () => jest.fn().mockReturnValue('0x789')) - -jest.mock('@/services/tx/tokenTransferParams', () => ({ - ...jest.requireActual('@/services/tx/tokenTransferParams'), - getNativeTransferData: jest.fn(), -})) - -jest.useFakeTimers() -describe('useDecodeTx', () => { - beforeEach(() => { - jest.clearAllMocks() - }) - - it('should return undefined when tx is undefined', async () => { - const { result } = renderHook(() => useDecodeTx()) - - await waitFor(async () => { - expect(result.current[0]).toBeUndefined() - }) - }) - - it('should return undefined if safeTX has empty data', async () => { - const safeTx = createMockSafeTransaction({ - data: '0x', - to: faker.finance.ethereumAddress(), - }) - const { result } = renderHook(() => useDecodeTx(safeTx)) - - await waitFor(async () => { - expect(result.current[0]).toBeUndefined() - }) - }) - - it('should do a getConfirmationView call if safeTx has data', async () => { - const safeTx = createMockSafeTransaction({ - data: '0x123', - to: faker.finance.ethereumAddress(), - }) - - const mockNativeTransferData = undefined - const { result } = renderHook(() => useDecodeTx(safeTx)) - - await waitFor(async () => { - expect(getConfirmationView).toHaveBeenCalledTimes(1) - expect(result.current[0]).toEqual(mockNativeTransferData) - }) - }) - - it('should return native transfer data when encodedData is empty and isRejection is false', async () => { - const safeTx = createMockSafeTransaction({ - data: '0x', - to: faker.finance.ethereumAddress(), - value: '1', - }) - const nativeTransfer = { - method: 'Native token transfer', - } - ;(getNativeTransferData as jest.Mock).mockReturnValue(nativeTransfer) - - const { result } = renderHook(() => useDecodeTx(safeTx)) - - await waitFor(async () => { - expect(getNativeTransferData).toHaveBeenCalled() - expect(result.current[0]).toEqual(nativeTransfer) - }) - }) - - it('should return decoded data when encodedData is not empty', async () => { - const safeTx = createMockSafeTransaction({ - data: '0x1234567890abcdef', // non-empty data - to: faker.finance.ethereumAddress(), - value: '1000000', - }) - - renderHook(() => useDecodeTx(safeTx)) - - await waitFor(async () => { - expect(getConfirmationView).toHaveBeenCalledTimes(1) - expect(getConfirmationView).toHaveBeenCalledWith('5', '0x789', '0x1234567890abcdef', safeTx.data.to, '1000000') - }) - }) - - it('should return error when getConfirmationView throws an error', async () => { - const safeTx = createMockSafeTransaction({ - data: '0x1234567890abcdef', // non-empty data - to: faker.finance.ethereumAddress(), - }) - - // Mock getConfirmationView to throw an error - jest.spyOn(safeGatewayTypescriptSdk, 'getConfirmationView').mockRejectedValue('Failed to fetch') - - const { result, rerender } = renderHook(() => useDecodeTx(safeTx)) - - rerender() - await waitFor(async () => { - expect(result.current[1] && result.current[1].message).toEqual('Failed to fetch') - }) - }) -}) diff --git a/apps/web/src/hooks/useDecodeTx.ts b/apps/web/src/hooks/useDecodeTx.ts deleted file mode 100644 index 25d7c5cc07..0000000000 --- a/apps/web/src/hooks/useDecodeTx.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { type SafeTransaction } from '@safe-global/safe-core-sdk-types' -import { getConfirmationView, type AnyConfirmationView } from '@safe-global/safe-gateway-typescript-sdk' -import { getNativeTransferData } from '@/services/tx/tokenTransferParams' -import { isEmptyHexData } from '@/utils/hex' -import type { AsyncResult } from './useAsync' -import useAsync from './useAsync' -import useChainId from './useChainId' -import useSafeAddress from '@/hooks/useSafeAddress' - -const useDecodeTx = (tx?: SafeTransaction): AsyncResult => { - const chainId = useChainId() - const safeAddress = useSafeAddress() - const { to, value, data } = tx?.data || {} - - return useAsync( - () => { - if (to === undefined || value === undefined) return - - const isEmptyData = !!data && isEmptyHexData(data) - if (!data || isEmptyData) { - const isRejection = isEmptyData && value === '0' - const nativeTransfer = isEmptyData && !isRejection ? getNativeTransferData({ to, value }) : undefined - return Promise.resolve(nativeTransfer) - } - - return getConfirmationView(chainId, safeAddress, data, to, value) - }, - [chainId, safeAddress, to, value, data], - false, - ) -} - -export default useDecodeTx diff --git a/yarn.lock b/yarn.lock index 0a67311e51..2e55d3dd0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7775,10 +7775,10 @@ __metadata: languageName: node linkType: hard -"@safe-global/safe-gateway-typescript-sdk@npm:3.22.6": - version: 3.22.6 - resolution: "@safe-global/safe-gateway-typescript-sdk@npm:3.22.6" - checksum: 10/021f605143d507b1fc9b9be34a1a0f96aecd268d5349428e92bf636b64c9123dd992e27ce95c6c47a092a80f95a3fb1756a651322eda497d1ef867a62a8710da +"@safe-global/safe-gateway-typescript-sdk@npm:3.22.7-beta.2": + version: 3.22.7-beta.2 + resolution: "@safe-global/safe-gateway-typescript-sdk@npm:3.22.7-beta.2" + checksum: 10/3b882860fd6abcc682f1ff7aa17760aeb352ab15309e108f74ca9e6464bc2cae8d99c6da5980b70ea94d0d45ea9b1092e92c26cef01ab5f9d56ed9fbefbcd811 languageName: node linkType: hard @@ -7877,7 +7877,7 @@ __metadata: "@safe-global/safe-apps-sdk": "npm:^9.1.0" "@safe-global/safe-client-gateway-sdk": "npm:v1.60.1" "@safe-global/safe-core-sdk-types": "npm:^5.0.1" - "@safe-global/safe-gateway-typescript-sdk": "npm:3.22.6" + "@safe-global/safe-gateway-typescript-sdk": "npm:3.22.7-beta.2" "@safe-global/safe-modules-deployments": "npm:^2.2.1" "@safe-global/store": "workspace:^" "@safe-global/test": "workspace:^"