diff --git a/.cpanel.yml b/.cpanel.yml deleted file mode 100644 index 3abc8305..00000000 --- a/.cpanel.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -deployment: - tasks: - - export DEPLOYPATH=/home/iriscx/public_html/ - - /bin/cp -R src/* $DEPLOYPATH diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 00000000..334dc929 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,40 @@ +module.exports = { + env: { + browser: true, + es2021: true, + }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'prettier', + 'plugin:prettier/recommended', + ], + overrides: [], + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + plugins: ['simple-import-sort', '@typescript-eslint'], + rules: { + 'simple-import-sort/imports': [ + 'error', + { + groups: [ + // Packages `react` related packages come first. + ['^react', '^@?\\w'], + // Internal packages. + ['^(@|components)(/.*|$)'], + // Side effect imports. + ['^\\u0000'], + // Parent imports. Put `..` last. + ['^\\.\\.(?!/?$)', '^\\.\\./?$'], + // Other relative imports. Put same-folder imports and `.` last. + ['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'], + // Style imports. + ['^.+\\.?(css)$'], + ], + }, + ], + }, +}; diff --git a/.gitignore b/.gitignore index 88af6ce7..f46c749d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,25 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + node_modules -docs -build -size-plugin.json -translations.csv -.DS_Store +dist +dev-dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json .idea -.netlify -yarn-error.log +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.netlify/edge-functions-import-map.json b/.netlify/edge-functions-import-map.json new file mode 100644 index 00000000..2592951a --- /dev/null +++ b/.netlify/edge-functions-import-map.json @@ -0,0 +1 @@ +{"imports":{"netlify:edge":"https://edge.netlify.com/v1/index.ts"}} \ No newline at end of file diff --git a/.netlify/state.json b/.netlify/state.json new file mode 100644 index 00000000..18abd1ff --- /dev/null +++ b/.netlify/state.json @@ -0,0 +1,19 @@ +{ + "geolocation": { + "data": { + "city": "Espoo", + "country": { + "code": "FI", + "name": "Finland" + }, + "subdivision": { + "code": "18", + "name": "Uusimaa" + }, + "timezone": "Europe/Helsinki", + "latitude": 60.205, + "longitude": 24.6455 + }, + "timestamp": 1676549567324 + } +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 0b432bb5..00000000 --- a/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -# Build Stage -FROM node:19-buster-slim AS build-stage - -# Install tools -RUN apt-get update \ - && apt-get install -y git \ - && apt-get install -y jq \ - && apt-get install -y python3 \ - && apt-get install -y build-essential - -# Create build directory -WORKDIR /build - -# Copy package.json and yarn.lock -COPY package.json yarn.lock ./ - -# Install dependencies -ENV NODE_OPTIONS=--openssl-legacy-provider -RUN yarn - -# Copy project files and folders to the current working directory (i.e. '/app') -COPY . . - -# Build app -RUN cat package.json | jq '.scripts.serve="sirv build --host 0.0.0.0 --port 8080 --cors --single"' > package.json.new && mv -vf package.json.new package.json -RUN yarn build - -# Final image -FROM node:19-buster-slim - -# Change directory to '/app' -WORKDIR /app - -# Copy built code from build stage to '/app' directory -COPY --from=build-stage /build . - -EXPOSE 8080 - -CMD [ "yarn", "serve" ] diff --git a/Dockerfile.dev b/Dockerfile.dev deleted file mode 100644 index 3e58a6e7..00000000 --- a/Dockerfile.dev +++ /dev/null @@ -1,13 +0,0 @@ -FROM node:19-buster-slim -WORKDIR /iris-messenger/ -ENV NODE_OPTIONS=--openssl-legacy-provider -RUN apt-get update && apt-get install -y python3 build-essential - -COPY package.json . -COPY yarn.lock . - -RUN yarn - -COPY . . - -CMD [ "yarn", "dev-docker" ] diff --git a/LICENSE b/LICENSE deleted file mode 100644 index eb8e91fb..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2020 Martti Malmi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/dev-dist/registerSW.js b/dev-dist/registerSW.js new file mode 100644 index 00000000..1d5625f4 --- /dev/null +++ b/dev-dist/registerSW.js @@ -0,0 +1 @@ +if('serviceWorker' in navigator) navigator.serviceWorker.register('/dev-sw.js?dev-sw', { scope: '/', type: 'classic' }) \ No newline at end of file diff --git a/dev-dist/sw.js b/dev-dist/sw.js new file mode 100644 index 00000000..96bd29ed --- /dev/null +++ b/dev-dist/sw.js @@ -0,0 +1,92 @@ +/** + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// If the loader is already loaded, just stop. +if (!self.define) { + let registry = {}; + + // Used for `eval` and `importScripts` where we can't get script URL by other means. + // In both cases, it's safe to use a global var because those functions are synchronous. + let nextDefineUri; + + const singleRequire = (uri, parentUri) => { + uri = new URL(uri + ".js", parentUri).href; + return registry[uri] || ( + + new Promise(resolve => { + if ("document" in self) { + const script = document.createElement("script"); + script.src = uri; + script.onload = resolve; + document.head.appendChild(script); + } else { + nextDefineUri = uri; + importScripts(uri); + resolve(); + } + }) + + .then(() => { + let promise = registry[uri]; + if (!promise) { + throw new Error(`Module ${uri} didn’t register its module`); + } + return promise; + }) + ); + }; + + self.define = (depsNames, factory) => { + const uri = nextDefineUri || ("document" in self ? document.currentScript.src : "") || location.href; + if (registry[uri]) { + // Module is already loading or loaded. + return; + } + let exports = {}; + const require = depUri => singleRequire(depUri, uri); + const specialDeps = { + module: { uri }, + exports, + require + }; + registry[uri] = Promise.all(depsNames.map( + depName => specialDeps[depName] || require(depName) + )).then(deps => { + factory(...deps); + return exports; + }); + }; +} +define(['./workbox-5357ef54'], (function (workbox) { 'use strict'; + + self.skipWaiting(); + workbox.clientsClaim(); + + /** + * The precacheAndRoute() method efficiently caches and responds to + * requests for URLs in the manifest. + * See https://goo.gl/S9QRab + */ + workbox.precacheAndRoute([{ + "url": "registerSW.js", + "revision": "3ca0b8505b4bec776b69afdba2768812" + }, { + "url": "index.html", + "revision": "0.kjcf5pmcino" + }], {}); + workbox.cleanupOutdatedCaches(); + workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { + allowlist: [/^\/$/] + })); + +})); diff --git a/dev-dist/workbox-5357ef54.js b/dev-dist/workbox-5357ef54.js new file mode 100644 index 00000000..62f106ff --- /dev/null +++ b/dev-dist/workbox-5357ef54.js @@ -0,0 +1,3394 @@ +define(['exports'], (function (exports) { 'use strict'; + + // @ts-ignore + try { + self['workbox:core:7.0.0'] && _(); + } catch (e) {} + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Claim any currently available clients once the service worker + * becomes active. This is normally used in conjunction with `skipWaiting()`. + * + * @memberof workbox-core + */ + function clientsClaim() { + self.addEventListener('activate', () => self.clients.claim()); + } + + /* + Copyright 2019 Google LLC + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const logger = (() => { + // Don't overwrite this value if it's already set. + // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923 + if (!('__WB_DISABLE_DEV_LOGS' in globalThis)) { + self.__WB_DISABLE_DEV_LOGS = false; + } + let inGroup = false; + const methodToColorMap = { + debug: `#7f8c8d`, + log: `#2ecc71`, + warn: `#f39c12`, + error: `#c0392b`, + groupCollapsed: `#3498db`, + groupEnd: null // No colored prefix on groupEnd + }; + + const print = function (method, args) { + if (self.__WB_DISABLE_DEV_LOGS) { + return; + } + if (method === 'groupCollapsed') { + // Safari doesn't print all console.groupCollapsed() arguments: + // https://bugs.webkit.org/show_bug.cgi?id=182754 + if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { + console[method](...args); + return; + } + } + const styles = [`background: ${methodToColorMap[method]}`, `border-radius: 0.5em`, `color: white`, `font-weight: bold`, `padding: 2px 0.5em`]; + // When in a group, the workbox prefix is not displayed. + const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')]; + console[method](...logPrefix, ...args); + if (method === 'groupCollapsed') { + inGroup = true; + } + if (method === 'groupEnd') { + inGroup = false; + } + }; + // eslint-disable-next-line @typescript-eslint/ban-types + const api = {}; + const loggerMethods = Object.keys(methodToColorMap); + for (const key of loggerMethods) { + const method = key; + api[method] = (...args) => { + print(method, args); + }; + } + return api; + })(); + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const messages = { + 'invalid-value': ({ + paramName, + validValueDescription, + value + }) => { + if (!paramName || !validValueDescription) { + throw new Error(`Unexpected input to 'invalid-value' error.`); + } + return `The '${paramName}' parameter was given a value with an ` + `unexpected value. ${validValueDescription} Received a value of ` + `${JSON.stringify(value)}.`; + }, + 'not-an-array': ({ + moduleName, + className, + funcName, + paramName + }) => { + if (!moduleName || !className || !funcName || !paramName) { + throw new Error(`Unexpected input to 'not-an-array' error.`); + } + return `The parameter '${paramName}' passed into ` + `'${moduleName}.${className}.${funcName}()' must be an array.`; + }, + 'incorrect-type': ({ + expectedType, + paramName, + moduleName, + className, + funcName + }) => { + if (!expectedType || !paramName || !moduleName || !funcName) { + throw new Error(`Unexpected input to 'incorrect-type' error.`); + } + const classNameStr = className ? `${className}.` : ''; + return `The parameter '${paramName}' passed into ` + `'${moduleName}.${classNameStr}` + `${funcName}()' must be of type ${expectedType}.`; + }, + 'incorrect-class': ({ + expectedClassName, + paramName, + moduleName, + className, + funcName, + isReturnValueProblem + }) => { + if (!expectedClassName || !moduleName || !funcName) { + throw new Error(`Unexpected input to 'incorrect-class' error.`); + } + const classNameStr = className ? `${className}.` : ''; + if (isReturnValueProblem) { + return `The return value from ` + `'${moduleName}.${classNameStr}${funcName}()' ` + `must be an instance of class ${expectedClassName}.`; + } + return `The parameter '${paramName}' passed into ` + `'${moduleName}.${classNameStr}${funcName}()' ` + `must be an instance of class ${expectedClassName}.`; + }, + 'missing-a-method': ({ + expectedMethod, + paramName, + moduleName, + className, + funcName + }) => { + if (!expectedMethod || !paramName || !moduleName || !className || !funcName) { + throw new Error(`Unexpected input to 'missing-a-method' error.`); + } + return `${moduleName}.${className}.${funcName}() expected the ` + `'${paramName}' parameter to expose a '${expectedMethod}' method.`; + }, + 'add-to-cache-list-unexpected-type': ({ + entry + }) => { + return `An unexpected entry was passed to ` + `'workbox-precaching.PrecacheController.addToCacheList()' The entry ` + `'${JSON.stringify(entry)}' isn't supported. You must supply an array of ` + `strings with one or more characters, objects with a url property or ` + `Request objects.`; + }, + 'add-to-cache-list-conflicting-entries': ({ + firstEntry, + secondEntry + }) => { + if (!firstEntry || !secondEntry) { + throw new Error(`Unexpected input to ` + `'add-to-cache-list-duplicate-entries' error.`); + } + return `Two of the entries passed to ` + `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` + `${firstEntry} but different revision details. Workbox is ` + `unable to cache and version the asset correctly. Please remove one ` + `of the entries.`; + }, + 'plugin-error-request-will-fetch': ({ + thrownErrorMessage + }) => { + if (!thrownErrorMessage) { + throw new Error(`Unexpected input to ` + `'plugin-error-request-will-fetch', error.`); + } + return `An error was thrown by a plugins 'requestWillFetch()' method. ` + `The thrown error message was: '${thrownErrorMessage}'.`; + }, + 'invalid-cache-name': ({ + cacheNameId, + value + }) => { + if (!cacheNameId) { + throw new Error(`Expected a 'cacheNameId' for error 'invalid-cache-name'`); + } + return `You must provide a name containing at least one character for ` + `setCacheDetails({${cacheNameId}: '...'}). Received a value of ` + `'${JSON.stringify(value)}'`; + }, + 'unregister-route-but-not-found-with-method': ({ + method + }) => { + if (!method) { + throw new Error(`Unexpected input to ` + `'unregister-route-but-not-found-with-method' error.`); + } + return `The route you're trying to unregister was not previously ` + `registered for the method type '${method}'.`; + }, + 'unregister-route-route-not-registered': () => { + return `The route you're trying to unregister was not previously ` + `registered.`; + }, + 'queue-replay-failed': ({ + name + }) => { + return `Replaying the background sync queue '${name}' failed.`; + }, + 'duplicate-queue-name': ({ + name + }) => { + return `The Queue name '${name}' is already being used. ` + `All instances of backgroundSync.Queue must be given unique names.`; + }, + 'expired-test-without-max-age': ({ + methodName, + paramName + }) => { + return `The '${methodName}()' method can only be used when the ` + `'${paramName}' is used in the constructor.`; + }, + 'unsupported-route-type': ({ + moduleName, + className, + funcName, + paramName + }) => { + return `The supplied '${paramName}' parameter was an unsupported type. ` + `Please check the docs for ${moduleName}.${className}.${funcName} for ` + `valid input types.`; + }, + 'not-array-of-class': ({ + value, + expectedClass, + moduleName, + className, + funcName, + paramName + }) => { + return `The supplied '${paramName}' parameter must be an array of ` + `'${expectedClass}' objects. Received '${JSON.stringify(value)},'. ` + `Please check the call to ${moduleName}.${className}.${funcName}() ` + `to fix the issue.`; + }, + 'max-entries-or-age-required': ({ + moduleName, + className, + funcName + }) => { + return `You must define either config.maxEntries or config.maxAgeSeconds` + `in ${moduleName}.${className}.${funcName}`; + }, + 'statuses-or-headers-required': ({ + moduleName, + className, + funcName + }) => { + return `You must define either config.statuses or config.headers` + `in ${moduleName}.${className}.${funcName}`; + }, + 'invalid-string': ({ + moduleName, + funcName, + paramName + }) => { + if (!paramName || !moduleName || !funcName) { + throw new Error(`Unexpected input to 'invalid-string' error.`); + } + return `When using strings, the '${paramName}' parameter must start with ` + `'http' (for cross-origin matches) or '/' (for same-origin matches). ` + `Please see the docs for ${moduleName}.${funcName}() for ` + `more info.`; + }, + 'channel-name-required': () => { + return `You must provide a channelName to construct a ` + `BroadcastCacheUpdate instance.`; + }, + 'invalid-responses-are-same-args': () => { + return `The arguments passed into responsesAreSame() appear to be ` + `invalid. Please ensure valid Responses are used.`; + }, + 'expire-custom-caches-only': () => { + return `You must provide a 'cacheName' property when using the ` + `expiration plugin with a runtime caching strategy.`; + }, + 'unit-must-be-bytes': ({ + normalizedRangeHeader + }) => { + if (!normalizedRangeHeader) { + throw new Error(`Unexpected input to 'unit-must-be-bytes' error.`); + } + return `The 'unit' portion of the Range header must be set to 'bytes'. ` + `The Range header provided was "${normalizedRangeHeader}"`; + }, + 'single-range-only': ({ + normalizedRangeHeader + }) => { + if (!normalizedRangeHeader) { + throw new Error(`Unexpected input to 'single-range-only' error.`); + } + return `Multiple ranges are not supported. Please use a single start ` + `value, and optional end value. The Range header provided was ` + `"${normalizedRangeHeader}"`; + }, + 'invalid-range-values': ({ + normalizedRangeHeader + }) => { + if (!normalizedRangeHeader) { + throw new Error(`Unexpected input to 'invalid-range-values' error.`); + } + return `The Range header is missing both start and end values. At least ` + `one of those values is needed. The Range header provided was ` + `"${normalizedRangeHeader}"`; + }, + 'no-range-header': () => { + return `No Range header was found in the Request provided.`; + }, + 'range-not-satisfiable': ({ + size, + start, + end + }) => { + return `The start (${start}) and end (${end}) values in the Range are ` + `not satisfiable by the cached response, which is ${size} bytes.`; + }, + 'attempt-to-cache-non-get-request': ({ + url, + method + }) => { + return `Unable to cache '${url}' because it is a '${method}' request and ` + `only 'GET' requests can be cached.`; + }, + 'cache-put-with-no-response': ({ + url + }) => { + return `There was an attempt to cache '${url}' but the response was not ` + `defined.`; + }, + 'no-response': ({ + url, + error + }) => { + let message = `The strategy could not generate a response for '${url}'.`; + if (error) { + message += ` The underlying error is ${error}.`; + } + return message; + }, + 'bad-precaching-response': ({ + url, + status + }) => { + return `The precaching request for '${url}' failed` + (status ? ` with an HTTP status of ${status}.` : `.`); + }, + 'non-precached-url': ({ + url + }) => { + return `createHandlerBoundToURL('${url}') was called, but that URL is ` + `not precached. Please pass in a URL that is precached instead.`; + }, + 'add-to-cache-list-conflicting-integrities': ({ + url + }) => { + return `Two of the entries passed to ` + `'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` + `${url} with different integrity values. Please remove one of them.`; + }, + 'missing-precache-entry': ({ + cacheName, + url + }) => { + return `Unable to find a precached response in ${cacheName} for ${url}.`; + }, + 'cross-origin-copy-response': ({ + origin + }) => { + return `workbox-core.copyResponse() can only be used with same-origin ` + `responses. It was passed a response with origin ${origin}.`; + }, + 'opaque-streams-source': ({ + type + }) => { + const message = `One of the workbox-streams sources resulted in an ` + `'${type}' response.`; + if (type === 'opaqueredirect') { + return `${message} Please do not use a navigation request that results ` + `in a redirect as a source.`; + } + return `${message} Please ensure your sources are CORS-enabled.`; + } + }; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const generatorFunction = (code, details = {}) => { + const message = messages[code]; + if (!message) { + throw new Error(`Unable to find message for code '${code}'.`); + } + return message(details); + }; + const messageGenerator = generatorFunction; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Workbox errors should be thrown with this class. + * This allows use to ensure the type easily in tests, + * helps developers identify errors from workbox + * easily and allows use to optimise error + * messages correctly. + * + * @private + */ + class WorkboxError extends Error { + /** + * + * @param {string} errorCode The error code that + * identifies this particular error. + * @param {Object=} details Any relevant arguments + * that will help developers identify issues should + * be added as a key on the context object. + */ + constructor(errorCode, details) { + const message = messageGenerator(errorCode, details); + super(message); + this.name = errorCode; + this.details = details; + } + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /* + * This method throws if the supplied value is not an array. + * The destructed values are required to produce a meaningful error for users. + * The destructed and restructured object is so it's clear what is + * needed. + */ + const isArray = (value, details) => { + if (!Array.isArray(value)) { + throw new WorkboxError('not-an-array', details); + } + }; + const hasMethod = (object, expectedMethod, details) => { + const type = typeof object[expectedMethod]; + if (type !== 'function') { + details['expectedMethod'] = expectedMethod; + throw new WorkboxError('missing-a-method', details); + } + }; + const isType = (object, expectedType, details) => { + if (typeof object !== expectedType) { + details['expectedType'] = expectedType; + throw new WorkboxError('incorrect-type', details); + } + }; + const isInstance = (object, + // Need the general type to do the check later. + // eslint-disable-next-line @typescript-eslint/ban-types + expectedClass, details) => { + if (!(object instanceof expectedClass)) { + details['expectedClassName'] = expectedClass.name; + throw new WorkboxError('incorrect-class', details); + } + }; + const isOneOf = (value, validValues, details) => { + if (!validValues.includes(value)) { + details['validValueDescription'] = `Valid values are ${JSON.stringify(validValues)}.`; + throw new WorkboxError('invalid-value', details); + } + }; + const isArrayOfClass = (value, + // Need general type to do check later. + expectedClass, + // eslint-disable-line + details) => { + const error = new WorkboxError('not-array-of-class', details); + if (!Array.isArray(value)) { + throw error; + } + for (const item of value) { + if (!(item instanceof expectedClass)) { + throw error; + } + } + }; + const finalAssertExports = { + hasMethod, + isArray, + isInstance, + isOneOf, + isType, + isArrayOfClass + }; + + // @ts-ignore + try { + self['workbox:routing:7.0.0'] && _(); + } catch (e) {} + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * The default HTTP method, 'GET', used when there's no specific method + * configured for a route. + * + * @type {string} + * + * @private + */ + const defaultMethod = 'GET'; + /** + * The list of valid HTTP methods associated with requests that could be routed. + * + * @type {Array} + * + * @private + */ + const validMethods = ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT']; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * @param {function()|Object} handler Either a function, or an object with a + * 'handle' method. + * @return {Object} An object with a handle method. + * + * @private + */ + const normalizeHandler = handler => { + if (handler && typeof handler === 'object') { + { + finalAssertExports.hasMethod(handler, 'handle', { + moduleName: 'workbox-routing', + className: 'Route', + funcName: 'constructor', + paramName: 'handler' + }); + } + return handler; + } else { + { + finalAssertExports.isType(handler, 'function', { + moduleName: 'workbox-routing', + className: 'Route', + funcName: 'constructor', + paramName: 'handler' + }); + } + return { + handle: handler + }; + } + }; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * A `Route` consists of a pair of callback functions, "match" and "handler". + * The "match" callback determine if a route should be used to "handle" a + * request by returning a non-falsy value if it can. The "handler" callback + * is called when there is a match and should return a Promise that resolves + * to a `Response`. + * + * @memberof workbox-routing + */ + class Route { + /** + * Constructor for Route class. + * + * @param {workbox-routing~matchCallback} match + * A callback function that determines whether the route matches a given + * `fetch` event by returning a non-falsy value. + * @param {workbox-routing~handlerCallback} handler A callback + * function that returns a Promise resolving to a Response. + * @param {string} [method='GET'] The HTTP method to match the Route + * against. + */ + constructor(match, handler, method = defaultMethod) { + { + finalAssertExports.isType(match, 'function', { + moduleName: 'workbox-routing', + className: 'Route', + funcName: 'constructor', + paramName: 'match' + }); + if (method) { + finalAssertExports.isOneOf(method, validMethods, { + paramName: 'method' + }); + } + } + // These values are referenced directly by Router so cannot be + // altered by minificaton. + this.handler = normalizeHandler(handler); + this.match = match; + this.method = method; + } + /** + * + * @param {workbox-routing-handlerCallback} handler A callback + * function that returns a Promise resolving to a Response + */ + setCatchHandler(handler) { + this.catchHandler = normalizeHandler(handler); + } + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * RegExpRoute makes it easy to create a regular expression based + * {@link workbox-routing.Route}. + * + * For same-origin requests the RegExp only needs to match part of the URL. For + * requests against third-party servers, you must define a RegExp that matches + * the start of the URL. + * + * @memberof workbox-routing + * @extends workbox-routing.Route + */ + class RegExpRoute extends Route { + /** + * If the regular expression contains + * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references}, + * the captured values will be passed to the + * {@link workbox-routing~handlerCallback} `params` + * argument. + * + * @param {RegExp} regExp The regular expression to match against URLs. + * @param {workbox-routing~handlerCallback} handler A callback + * function that returns a Promise resulting in a Response. + * @param {string} [method='GET'] The HTTP method to match the Route + * against. + */ + constructor(regExp, handler, method) { + { + finalAssertExports.isInstance(regExp, RegExp, { + moduleName: 'workbox-routing', + className: 'RegExpRoute', + funcName: 'constructor', + paramName: 'pattern' + }); + } + const match = ({ + url + }) => { + const result = regExp.exec(url.href); + // Return immediately if there's no match. + if (!result) { + return; + } + // Require that the match start at the first character in the URL string + // if it's a cross-origin request. + // See https://github.com/GoogleChrome/workbox/issues/281 for the context + // behind this behavior. + if (url.origin !== location.origin && result.index !== 0) { + { + logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` + `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` + `handle cross-origin requests if they match the entire URL.`); + } + return; + } + // If the route matches, but there aren't any capture groups defined, then + // this will return [], which is truthy and therefore sufficient to + // indicate a match. + // If there are capture groups, then it will return their values. + return result.slice(1); + }; + super(match, handler, method); + } + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const getFriendlyURL = url => { + const urlObj = new URL(String(url), location.href); + // See https://github.com/GoogleChrome/workbox/issues/2323 + // We want to include everything, except for the origin if it's same-origin. + return urlObj.href.replace(new RegExp(`^${location.origin}`), ''); + }; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * The Router can be used to process a `FetchEvent` using one or more + * {@link workbox-routing.Route}, responding with a `Response` if + * a matching route exists. + * + * If no route matches a given a request, the Router will use a "default" + * handler if one is defined. + * + * Should the matching Route throw an error, the Router will use a "catch" + * handler if one is defined to gracefully deal with issues and respond with a + * Request. + * + * If a request matches multiple routes, the **earliest** registered route will + * be used to respond to the request. + * + * @memberof workbox-routing + */ + class Router { + /** + * Initializes a new Router. + */ + constructor() { + this._routes = new Map(); + this._defaultHandlerMap = new Map(); + } + /** + * @return {Map>} routes A `Map` of HTTP + * method name ('GET', etc.) to an array of all the corresponding `Route` + * instances that are registered. + */ + get routes() { + return this._routes; + } + /** + * Adds a fetch event listener to respond to events when a route matches + * the event's request. + */ + addFetchListener() { + // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705 + self.addEventListener('fetch', event => { + const { + request + } = event; + const responsePromise = this.handleRequest({ + request, + event + }); + if (responsePromise) { + event.respondWith(responsePromise); + } + }); + } + /** + * Adds a message event listener for URLs to cache from the window. + * This is useful to cache resources loaded on the page prior to when the + * service worker started controlling it. + * + * The format of the message data sent from the window should be as follows. + * Where the `urlsToCache` array may consist of URL strings or an array of + * URL string + `requestInit` object (the same as you'd pass to `fetch()`). + * + * ``` + * { + * type: 'CACHE_URLS', + * payload: { + * urlsToCache: [ + * './script1.js', + * './script2.js', + * ['./script3.js', {mode: 'no-cors'}], + * ], + * }, + * } + * ``` + */ + addCacheListener() { + // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705 + self.addEventListener('message', event => { + // event.data is type 'any' + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + if (event.data && event.data.type === 'CACHE_URLS') { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const { + payload + } = event.data; + { + logger.debug(`Caching URLs from the window`, payload.urlsToCache); + } + const requestPromises = Promise.all(payload.urlsToCache.map(entry => { + if (typeof entry === 'string') { + entry = [entry]; + } + const request = new Request(...entry); + return this.handleRequest({ + request, + event + }); + // TODO(philipwalton): TypeScript errors without this typecast for + // some reason (probably a bug). The real type here should work but + // doesn't: `Array | undefined>`. + })); // TypeScript + event.waitUntil(requestPromises); + // If a MessageChannel was used, reply to the message on success. + if (event.ports && event.ports[0]) { + void requestPromises.then(() => event.ports[0].postMessage(true)); + } + } + }); + } + /** + * Apply the routing rules to a FetchEvent object to get a Response from an + * appropriate Route's handler. + * + * @param {Object} options + * @param {Request} options.request The request to handle. + * @param {ExtendableEvent} options.event The event that triggered the + * request. + * @return {Promise|undefined} A promise is returned if a + * registered route can handle the request. If there is no matching + * route and there's no `defaultHandler`, `undefined` is returned. + */ + handleRequest({ + request, + event + }) { + { + finalAssertExports.isInstance(request, Request, { + moduleName: 'workbox-routing', + className: 'Router', + funcName: 'handleRequest', + paramName: 'options.request' + }); + } + const url = new URL(request.url, location.href); + if (!url.protocol.startsWith('http')) { + { + logger.debug(`Workbox Router only supports URLs that start with 'http'.`); + } + return; + } + const sameOrigin = url.origin === location.origin; + const { + params, + route + } = this.findMatchingRoute({ + event, + request, + sameOrigin, + url + }); + let handler = route && route.handler; + const debugMessages = []; + { + if (handler) { + debugMessages.push([`Found a route to handle this request:`, route]); + if (params) { + debugMessages.push([`Passing the following params to the route's handler:`, params]); + } + } + } + // If we don't have a handler because there was no matching route, then + // fall back to defaultHandler if that's defined. + const method = request.method; + if (!handler && this._defaultHandlerMap.has(method)) { + { + debugMessages.push(`Failed to find a matching route. Falling ` + `back to the default handler for ${method}.`); + } + handler = this._defaultHandlerMap.get(method); + } + if (!handler) { + { + // No handler so Workbox will do nothing. If logs is set of debug + // i.e. verbose, we should print out this information. + logger.debug(`No route found for: ${getFriendlyURL(url)}`); + } + return; + } + { + // We have a handler, meaning Workbox is going to handle the route. + // print the routing details to the console. + logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`); + debugMessages.forEach(msg => { + if (Array.isArray(msg)) { + logger.log(...msg); + } else { + logger.log(msg); + } + }); + logger.groupEnd(); + } + // Wrap in try and catch in case the handle method throws a synchronous + // error. It should still callback to the catch handler. + let responsePromise; + try { + responsePromise = handler.handle({ + url, + request, + event, + params + }); + } catch (err) { + responsePromise = Promise.reject(err); + } + // Get route's catch handler, if it exists + const catchHandler = route && route.catchHandler; + if (responsePromise instanceof Promise && (this._catchHandler || catchHandler)) { + responsePromise = responsePromise.catch(async err => { + // If there's a route catch handler, process that first + if (catchHandler) { + { + // Still include URL here as it will be async from the console group + // and may not make sense without the URL + logger.groupCollapsed(`Error thrown when responding to: ` + ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`); + logger.error(`Error thrown by:`, route); + logger.error(err); + logger.groupEnd(); + } + try { + return await catchHandler.handle({ + url, + request, + event, + params + }); + } catch (catchErr) { + if (catchErr instanceof Error) { + err = catchErr; + } + } + } + if (this._catchHandler) { + { + // Still include URL here as it will be async from the console group + // and may not make sense without the URL + logger.groupCollapsed(`Error thrown when responding to: ` + ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`); + logger.error(`Error thrown by:`, route); + logger.error(err); + logger.groupEnd(); + } + return this._catchHandler.handle({ + url, + request, + event + }); + } + throw err; + }); + } + return responsePromise; + } + /** + * Checks a request and URL (and optionally an event) against the list of + * registered routes, and if there's a match, returns the corresponding + * route along with any params generated by the match. + * + * @param {Object} options + * @param {URL} options.url + * @param {boolean} options.sameOrigin The result of comparing `url.origin` + * against the current origin. + * @param {Request} options.request The request to match. + * @param {Event} options.event The corresponding event. + * @return {Object} An object with `route` and `params` properties. + * They are populated if a matching route was found or `undefined` + * otherwise. + */ + findMatchingRoute({ + url, + sameOrigin, + request, + event + }) { + const routes = this._routes.get(request.method) || []; + for (const route of routes) { + let params; + // route.match returns type any, not possible to change right now. + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const matchResult = route.match({ + url, + sameOrigin, + request, + event + }); + if (matchResult) { + { + // Warn developers that using an async matchCallback is almost always + // not the right thing to do. + if (matchResult instanceof Promise) { + logger.warn(`While routing ${getFriendlyURL(url)}, an async ` + `matchCallback function was used. Please convert the ` + `following route to use a synchronous matchCallback function:`, route); + } + } + // See https://github.com/GoogleChrome/workbox/issues/2079 + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + params = matchResult; + if (Array.isArray(params) && params.length === 0) { + // Instead of passing an empty array in as params, use undefined. + params = undefined; + } else if (matchResult.constructor === Object && + // eslint-disable-line + Object.keys(matchResult).length === 0) { + // Instead of passing an empty object in as params, use undefined. + params = undefined; + } else if (typeof matchResult === 'boolean') { + // For the boolean value true (rather than just something truth-y), + // don't set params. + // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353 + params = undefined; + } + // Return early if have a match. + return { + route, + params + }; + } + } + // If no match was found above, return and empty object. + return {}; + } + /** + * Define a default `handler` that's called when no routes explicitly + * match the incoming request. + * + * Each HTTP method ('GET', 'POST', etc.) gets its own default handler. + * + * Without a default handler, unmatched requests will go against the + * network as if there were no service worker present. + * + * @param {workbox-routing~handlerCallback} handler A callback + * function that returns a Promise resulting in a Response. + * @param {string} [method='GET'] The HTTP method to associate with this + * default handler. Each method has its own default. + */ + setDefaultHandler(handler, method = defaultMethod) { + this._defaultHandlerMap.set(method, normalizeHandler(handler)); + } + /** + * If a Route throws an error while handling a request, this `handler` + * will be called and given a chance to provide a response. + * + * @param {workbox-routing~handlerCallback} handler A callback + * function that returns a Promise resulting in a Response. + */ + setCatchHandler(handler) { + this._catchHandler = normalizeHandler(handler); + } + /** + * Registers a route with the router. + * + * @param {workbox-routing.Route} route The route to register. + */ + registerRoute(route) { + { + finalAssertExports.isType(route, 'object', { + moduleName: 'workbox-routing', + className: 'Router', + funcName: 'registerRoute', + paramName: 'route' + }); + finalAssertExports.hasMethod(route, 'match', { + moduleName: 'workbox-routing', + className: 'Router', + funcName: 'registerRoute', + paramName: 'route' + }); + finalAssertExports.isType(route.handler, 'object', { + moduleName: 'workbox-routing', + className: 'Router', + funcName: 'registerRoute', + paramName: 'route' + }); + finalAssertExports.hasMethod(route.handler, 'handle', { + moduleName: 'workbox-routing', + className: 'Router', + funcName: 'registerRoute', + paramName: 'route.handler' + }); + finalAssertExports.isType(route.method, 'string', { + moduleName: 'workbox-routing', + className: 'Router', + funcName: 'registerRoute', + paramName: 'route.method' + }); + } + if (!this._routes.has(route.method)) { + this._routes.set(route.method, []); + } + // Give precedence to all of the earlier routes by adding this additional + // route to the end of the array. + this._routes.get(route.method).push(route); + } + /** + * Unregisters a route with the router. + * + * @param {workbox-routing.Route} route The route to unregister. + */ + unregisterRoute(route) { + if (!this._routes.has(route.method)) { + throw new WorkboxError('unregister-route-but-not-found-with-method', { + method: route.method + }); + } + const routeIndex = this._routes.get(route.method).indexOf(route); + if (routeIndex > -1) { + this._routes.get(route.method).splice(routeIndex, 1); + } else { + throw new WorkboxError('unregister-route-route-not-registered'); + } + } + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + let defaultRouter; + /** + * Creates a new, singleton Router instance if one does not exist. If one + * does already exist, that instance is returned. + * + * @private + * @return {Router} + */ + const getOrCreateDefaultRouter = () => { + if (!defaultRouter) { + defaultRouter = new Router(); + // The helpers that use the default Router assume these listeners exist. + defaultRouter.addFetchListener(); + defaultRouter.addCacheListener(); + } + return defaultRouter; + }; + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Easily register a RegExp, string, or function with a caching + * strategy to a singleton Router instance. + * + * This method will generate a Route for you if needed and + * call {@link workbox-routing.Router#registerRoute}. + * + * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture + * If the capture param is a `Route`, all other arguments will be ignored. + * @param {workbox-routing~handlerCallback} [handler] A callback + * function that returns a Promise resulting in a Response. This parameter + * is required if `capture` is not a `Route` object. + * @param {string} [method='GET'] The HTTP method to match the Route + * against. + * @return {workbox-routing.Route} The generated `Route`. + * + * @memberof workbox-routing + */ + function registerRoute(capture, handler, method) { + let route; + if (typeof capture === 'string') { + const captureUrl = new URL(capture, location.href); + { + if (!(capture.startsWith('/') || capture.startsWith('http'))) { + throw new WorkboxError('invalid-string', { + moduleName: 'workbox-routing', + funcName: 'registerRoute', + paramName: 'capture' + }); + } + // We want to check if Express-style wildcards are in the pathname only. + // TODO: Remove this log message in v4. + const valueToCheck = capture.startsWith('http') ? captureUrl.pathname : capture; + // See https://github.com/pillarjs/path-to-regexp#parameters + const wildcards = '[*:?+]'; + if (new RegExp(`${wildcards}`).exec(valueToCheck)) { + logger.debug(`The '$capture' parameter contains an Express-style wildcard ` + `character (${wildcards}). Strings are now always interpreted as ` + `exact matches; use a RegExp for partial or wildcard matches.`); + } + } + const matchCallback = ({ + url + }) => { + { + if (url.pathname === captureUrl.pathname && url.origin !== captureUrl.origin) { + logger.debug(`${capture} only partially matches the cross-origin URL ` + `${url.toString()}. This route will only handle cross-origin requests ` + `if they match the entire URL.`); + } + } + return url.href === captureUrl.href; + }; + // If `capture` is a string then `handler` and `method` must be present. + route = new Route(matchCallback, handler, method); + } else if (capture instanceof RegExp) { + // If `capture` is a `RegExp` then `handler` and `method` must be present. + route = new RegExpRoute(capture, handler, method); + } else if (typeof capture === 'function') { + // If `capture` is a function then `handler` and `method` must be present. + route = new Route(capture, handler, method); + } else if (capture instanceof Route) { + route = capture; + } else { + throw new WorkboxError('unsupported-route-type', { + moduleName: 'workbox-routing', + funcName: 'registerRoute', + paramName: 'capture' + }); + } + const defaultRouter = getOrCreateDefaultRouter(); + defaultRouter.registerRoute(route); + return route; + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const _cacheNameDetails = { + googleAnalytics: 'googleAnalytics', + precache: 'precache-v2', + prefix: 'workbox', + runtime: 'runtime', + suffix: typeof registration !== 'undefined' ? registration.scope : '' + }; + const _createCacheName = cacheName => { + return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix].filter(value => value && value.length > 0).join('-'); + }; + const eachCacheNameDetail = fn => { + for (const key of Object.keys(_cacheNameDetails)) { + fn(key); + } + }; + const cacheNames = { + updateDetails: details => { + eachCacheNameDetail(key => { + if (typeof details[key] === 'string') { + _cacheNameDetails[key] = details[key]; + } + }); + }, + getGoogleAnalyticsName: userCacheName => { + return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics); + }, + getPrecacheName: userCacheName => { + return userCacheName || _createCacheName(_cacheNameDetails.precache); + }, + getPrefix: () => { + return _cacheNameDetails.prefix; + }, + getRuntimeName: userCacheName => { + return userCacheName || _createCacheName(_cacheNameDetails.runtime); + }, + getSuffix: () => { + return _cacheNameDetails.suffix; + } + }; + + /* + Copyright 2020 Google LLC + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * A utility method that makes it easier to use `event.waitUntil` with + * async functions and return the result. + * + * @param {ExtendableEvent} event + * @param {Function} asyncFn + * @return {Function} + * @private + */ + function waitUntil(event, asyncFn) { + const returnPromise = asyncFn(); + event.waitUntil(returnPromise); + return returnPromise; + } + + // @ts-ignore + try { + self['workbox:precaching:7.0.0'] && _(); + } catch (e) {} + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + // Name of the search parameter used to store revision info. + const REVISION_SEARCH_PARAM = '__WB_REVISION__'; + /** + * Converts a manifest entry into a versioned URL suitable for precaching. + * + * @param {Object|string} entry + * @return {string} A URL with versioning info. + * + * @private + * @memberof workbox-precaching + */ + function createCacheKey(entry) { + if (!entry) { + throw new WorkboxError('add-to-cache-list-unexpected-type', { + entry + }); + } + // If a precache manifest entry is a string, it's assumed to be a versioned + // URL, like '/app.abcd1234.js'. Return as-is. + if (typeof entry === 'string') { + const urlObject = new URL(entry, location.href); + return { + cacheKey: urlObject.href, + url: urlObject.href + }; + } + const { + revision, + url + } = entry; + if (!url) { + throw new WorkboxError('add-to-cache-list-unexpected-type', { + entry + }); + } + // If there's just a URL and no revision, then it's also assumed to be a + // versioned URL. + if (!revision) { + const urlObject = new URL(url, location.href); + return { + cacheKey: urlObject.href, + url: urlObject.href + }; + } + // Otherwise, construct a properly versioned URL using the custom Workbox + // search parameter along with the revision info. + const cacheKeyURL = new URL(url, location.href); + const originalURL = new URL(url, location.href); + cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision); + return { + cacheKey: cacheKeyURL.href, + url: originalURL.href + }; + } + + /* + Copyright 2020 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * A plugin, designed to be used with PrecacheController, to determine the + * of assets that were updated (or not updated) during the install event. + * + * @private + */ + class PrecacheInstallReportPlugin { + constructor() { + this.updatedURLs = []; + this.notUpdatedURLs = []; + this.handlerWillStart = async ({ + request, + state + }) => { + // TODO: `state` should never be undefined... + if (state) { + state.originalRequest = request; + } + }; + this.cachedResponseWillBeUsed = async ({ + event, + state, + cachedResponse + }) => { + if (event.type === 'install') { + if (state && state.originalRequest && state.originalRequest instanceof Request) { + // TODO: `state` should never be undefined... + const url = state.originalRequest.url; + if (cachedResponse) { + this.notUpdatedURLs.push(url); + } else { + this.updatedURLs.push(url); + } + } + } + return cachedResponse; + }; + } + } + + /* + Copyright 2020 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * A plugin, designed to be used with PrecacheController, to translate URLs into + * the corresponding cache key, based on the current revision info. + * + * @private + */ + class PrecacheCacheKeyPlugin { + constructor({ + precacheController + }) { + this.cacheKeyWillBeUsed = async ({ + request, + params + }) => { + // Params is type any, can't change right now. + /* eslint-disable */ + const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) || this._precacheController.getCacheKeyForURL(request.url); + /* eslint-enable */ + return cacheKey ? new Request(cacheKey, { + headers: request.headers + }) : request; + }; + this._precacheController = precacheController; + } + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * @param {string} groupTitle + * @param {Array} deletedURLs + * + * @private + */ + const logGroup = (groupTitle, deletedURLs) => { + logger.groupCollapsed(groupTitle); + for (const url of deletedURLs) { + logger.log(url); + } + logger.groupEnd(); + }; + /** + * @param {Array} deletedURLs + * + * @private + * @memberof workbox-precaching + */ + function printCleanupDetails(deletedURLs) { + const deletionCount = deletedURLs.length; + if (deletionCount > 0) { + logger.groupCollapsed(`During precaching cleanup, ` + `${deletionCount} cached ` + `request${deletionCount === 1 ? ' was' : 's were'} deleted.`); + logGroup('Deleted Cache Requests', deletedURLs); + logger.groupEnd(); + } + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * @param {string} groupTitle + * @param {Array} urls + * + * @private + */ + function _nestedGroup(groupTitle, urls) { + if (urls.length === 0) { + return; + } + logger.groupCollapsed(groupTitle); + for (const url of urls) { + logger.log(url); + } + logger.groupEnd(); + } + /** + * @param {Array} urlsToPrecache + * @param {Array} urlsAlreadyPrecached + * + * @private + * @memberof workbox-precaching + */ + function printInstallDetails(urlsToPrecache, urlsAlreadyPrecached) { + const precachedCount = urlsToPrecache.length; + const alreadyPrecachedCount = urlsAlreadyPrecached.length; + if (precachedCount || alreadyPrecachedCount) { + let message = `Precaching ${precachedCount} file${precachedCount === 1 ? '' : 's'}.`; + if (alreadyPrecachedCount > 0) { + message += ` ${alreadyPrecachedCount} ` + `file${alreadyPrecachedCount === 1 ? ' is' : 's are'} already cached.`; + } + logger.groupCollapsed(message); + _nestedGroup(`View newly precached URLs.`, urlsToPrecache); + _nestedGroup(`View previously precached URLs.`, urlsAlreadyPrecached); + logger.groupEnd(); + } + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + let supportStatus; + /** + * A utility function that determines whether the current browser supports + * constructing a new `Response` from a `response.body` stream. + * + * @return {boolean} `true`, if the current browser can successfully + * construct a `Response` from a `response.body` stream, `false` otherwise. + * + * @private + */ + function canConstructResponseFromBodyStream() { + if (supportStatus === undefined) { + const testResponse = new Response(''); + if ('body' in testResponse) { + try { + new Response(testResponse.body); + supportStatus = true; + } catch (error) { + supportStatus = false; + } + } + supportStatus = false; + } + return supportStatus; + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Allows developers to copy a response and modify its `headers`, `status`, + * or `statusText` values (the values settable via a + * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax} + * object in the constructor). + * To modify these values, pass a function as the second argument. That + * function will be invoked with a single object with the response properties + * `{headers, status, statusText}`. The return value of this function will + * be used as the `ResponseInit` for the new `Response`. To change the values + * either modify the passed parameter(s) and return it, or return a totally + * new object. + * + * This method is intentionally limited to same-origin responses, regardless of + * whether CORS was used or not. + * + * @param {Response} response + * @param {Function} modifier + * @memberof workbox-core + */ + async function copyResponse(response, modifier) { + let origin = null; + // If response.url isn't set, assume it's cross-origin and keep origin null. + if (response.url) { + const responseURL = new URL(response.url); + origin = responseURL.origin; + } + if (origin !== self.location.origin) { + throw new WorkboxError('cross-origin-copy-response', { + origin + }); + } + const clonedResponse = response.clone(); + // Create a fresh `ResponseInit` object by cloning the headers. + const responseInit = { + headers: new Headers(clonedResponse.headers), + status: clonedResponse.status, + statusText: clonedResponse.statusText + }; + // Apply any user modifications. + const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit; + // Create the new response from the body stream and `ResponseInit` + // modifications. Note: not all browsers support the Response.body stream, + // so fall back to reading the entire body into memory as a blob. + const body = canConstructResponseFromBodyStream() ? clonedResponse.body : await clonedResponse.blob(); + return new Response(body, modifiedResponseInit); + } + + /* + Copyright 2020 Google LLC + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + function stripParams(fullURL, ignoreParams) { + const strippedURL = new URL(fullURL); + for (const param of ignoreParams) { + strippedURL.searchParams.delete(param); + } + return strippedURL.href; + } + /** + * Matches an item in the cache, ignoring specific URL params. This is similar + * to the `ignoreSearch` option, but it allows you to ignore just specific + * params (while continuing to match on the others). + * + * @private + * @param {Cache} cache + * @param {Request} request + * @param {Object} matchOptions + * @param {Array} ignoreParams + * @return {Promise} + */ + async function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) { + const strippedRequestURL = stripParams(request.url, ignoreParams); + // If the request doesn't include any ignored params, match as normal. + if (request.url === strippedRequestURL) { + return cache.match(request, matchOptions); + } + // Otherwise, match by comparing keys + const keysOptions = Object.assign(Object.assign({}, matchOptions), { + ignoreSearch: true + }); + const cacheKeys = await cache.keys(request, keysOptions); + for (const cacheKey of cacheKeys) { + const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams); + if (strippedRequestURL === strippedCacheKeyURL) { + return cache.match(cacheKey, matchOptions); + } + } + return; + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * The Deferred class composes Promises in a way that allows for them to be + * resolved or rejected from outside the constructor. In most cases promises + * should be used directly, but Deferreds can be necessary when the logic to + * resolve a promise must be separate. + * + * @private + */ + class Deferred { + /** + * Creates a promise and exposes its resolve and reject functions as methods. + */ + constructor() { + this.promise = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + } + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + // Callbacks to be executed whenever there's a quota error. + // Can't change Function type right now. + // eslint-disable-next-line @typescript-eslint/ban-types + const quotaErrorCallbacks = new Set(); + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Runs all of the callback functions, one at a time sequentially, in the order + * in which they were registered. + * + * @memberof workbox-core + * @private + */ + async function executeQuotaErrorCallbacks() { + { + logger.log(`About to run ${quotaErrorCallbacks.size} ` + `callbacks to clean up caches.`); + } + for (const callback of quotaErrorCallbacks) { + await callback(); + { + logger.log(callback, 'is complete.'); + } + } + { + logger.log('Finished running callbacks.'); + } + } + + /* + Copyright 2019 Google LLC + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Returns a promise that resolves and the passed number of milliseconds. + * This utility is an async/await-friendly version of `setTimeout`. + * + * @param {number} ms + * @return {Promise} + * @private + */ + function timeout(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + // @ts-ignore + try { + self['workbox:strategies:7.0.0'] && _(); + } catch (e) {} + + /* + Copyright 2020 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + function toRequest(input) { + return typeof input === 'string' ? new Request(input) : input; + } + /** + * A class created every time a Strategy instance instance calls + * {@link workbox-strategies.Strategy~handle} or + * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and + * cache actions around plugin callbacks and keeps track of when the strategy + * is "done" (i.e. all added `event.waitUntil()` promises have resolved). + * + * @memberof workbox-strategies + */ + class StrategyHandler { + /** + * Creates a new instance associated with the passed strategy and event + * that's handling the request. + * + * The constructor also initializes the state that will be passed to each of + * the plugins handling this request. + * + * @param {workbox-strategies.Strategy} strategy + * @param {Object} options + * @param {Request|string} options.request A request to run this strategy for. + * @param {ExtendableEvent} options.event The event associated with the + * request. + * @param {URL} [options.url] + * @param {*} [options.params] The return value from the + * {@link workbox-routing~matchCallback} (if applicable). + */ + constructor(strategy, options) { + this._cacheKeys = {}; + /** + * The request the strategy is performing (passed to the strategy's + * `handle()` or `handleAll()` method). + * @name request + * @instance + * @type {Request} + * @memberof workbox-strategies.StrategyHandler + */ + /** + * The event associated with this request. + * @name event + * @instance + * @type {ExtendableEvent} + * @memberof workbox-strategies.StrategyHandler + */ + /** + * A `URL` instance of `request.url` (if passed to the strategy's + * `handle()` or `handleAll()` method). + * Note: the `url` param will be present if the strategy was invoked + * from a workbox `Route` object. + * @name url + * @instance + * @type {URL|undefined} + * @memberof workbox-strategies.StrategyHandler + */ + /** + * A `param` value (if passed to the strategy's + * `handle()` or `handleAll()` method). + * Note: the `param` param will be present if the strategy was invoked + * from a workbox `Route` object and the + * {@link workbox-routing~matchCallback} returned + * a truthy value (it will be that value). + * @name params + * @instance + * @type {*|undefined} + * @memberof workbox-strategies.StrategyHandler + */ + { + finalAssertExports.isInstance(options.event, ExtendableEvent, { + moduleName: 'workbox-strategies', + className: 'StrategyHandler', + funcName: 'constructor', + paramName: 'options.event' + }); + } + Object.assign(this, options); + this.event = options.event; + this._strategy = strategy; + this._handlerDeferred = new Deferred(); + this._extendLifetimePromises = []; + // Copy the plugins list (since it's mutable on the strategy), + // so any mutations don't affect this handler instance. + this._plugins = [...strategy.plugins]; + this._pluginStateMap = new Map(); + for (const plugin of this._plugins) { + this._pluginStateMap.set(plugin, {}); + } + this.event.waitUntil(this._handlerDeferred.promise); + } + /** + * Fetches a given request (and invokes any applicable plugin callback + * methods) using the `fetchOptions` (for non-navigation requests) and + * `plugins` defined on the `Strategy` object. + * + * The following plugin lifecycle methods are invoked when using this method: + * - `requestWillFetch()` + * - `fetchDidSucceed()` + * - `fetchDidFail()` + * + * @param {Request|string} input The URL or request to fetch. + * @return {Promise} + */ + async fetch(input) { + const { + event + } = this; + let request = toRequest(input); + if (request.mode === 'navigate' && event instanceof FetchEvent && event.preloadResponse) { + const possiblePreloadResponse = await event.preloadResponse; + if (possiblePreloadResponse) { + { + logger.log(`Using a preloaded navigation response for ` + `'${getFriendlyURL(request.url)}'`); + } + return possiblePreloadResponse; + } + } + // If there is a fetchDidFail plugin, we need to save a clone of the + // original request before it's either modified by a requestWillFetch + // plugin or before the original request's body is consumed via fetch(). + const originalRequest = this.hasCallback('fetchDidFail') ? request.clone() : null; + try { + for (const cb of this.iterateCallbacks('requestWillFetch')) { + request = await cb({ + request: request.clone(), + event + }); + } + } catch (err) { + if (err instanceof Error) { + throw new WorkboxError('plugin-error-request-will-fetch', { + thrownErrorMessage: err.message + }); + } + } + // The request can be altered by plugins with `requestWillFetch` making + // the original request (most likely from a `fetch` event) different + // from the Request we make. Pass both to `fetchDidFail` to aid debugging. + const pluginFilteredRequest = request.clone(); + try { + let fetchResponse; + // See https://github.com/GoogleChrome/workbox/issues/1796 + fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions); + if ("development" !== 'production') { + logger.debug(`Network request for ` + `'${getFriendlyURL(request.url)}' returned a response with ` + `status '${fetchResponse.status}'.`); + } + for (const callback of this.iterateCallbacks('fetchDidSucceed')) { + fetchResponse = await callback({ + event, + request: pluginFilteredRequest, + response: fetchResponse + }); + } + return fetchResponse; + } catch (error) { + { + logger.log(`Network request for ` + `'${getFriendlyURL(request.url)}' threw an error.`, error); + } + // `originalRequest` will only exist if a `fetchDidFail` callback + // is being used (see above). + if (originalRequest) { + await this.runCallbacks('fetchDidFail', { + error: error, + event, + originalRequest: originalRequest.clone(), + request: pluginFilteredRequest.clone() + }); + } + throw error; + } + } + /** + * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on + * the response generated by `this.fetch()`. + * + * The call to `this.cachePut()` automatically invokes `this.waitUntil()`, + * so you do not have to manually call `waitUntil()` on the event. + * + * @param {Request|string} input The request or URL to fetch and cache. + * @return {Promise} + */ + async fetchAndCachePut(input) { + const response = await this.fetch(input); + const responseClone = response.clone(); + void this.waitUntil(this.cachePut(input, responseClone)); + return response; + } + /** + * Matches a request from the cache (and invokes any applicable plugin + * callback methods) using the `cacheName`, `matchOptions`, and `plugins` + * defined on the strategy object. + * + * The following plugin lifecycle methods are invoked when using this method: + * - cacheKeyWillByUsed() + * - cachedResponseWillByUsed() + * + * @param {Request|string} key The Request or URL to use as the cache key. + * @return {Promise} A matching response, if found. + */ + async cacheMatch(key) { + const request = toRequest(key); + let cachedResponse; + const { + cacheName, + matchOptions + } = this._strategy; + const effectiveRequest = await this.getCacheKey(request, 'read'); + const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { + cacheName + }); + cachedResponse = await caches.match(effectiveRequest, multiMatchOptions); + { + if (cachedResponse) { + logger.debug(`Found a cached response in '${cacheName}'.`); + } else { + logger.debug(`No cached response found in '${cacheName}'.`); + } + } + for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) { + cachedResponse = (await callback({ + cacheName, + matchOptions, + cachedResponse, + request: effectiveRequest, + event: this.event + })) || undefined; + } + return cachedResponse; + } + /** + * Puts a request/response pair in the cache (and invokes any applicable + * plugin callback methods) using the `cacheName` and `plugins` defined on + * the strategy object. + * + * The following plugin lifecycle methods are invoked when using this method: + * - cacheKeyWillByUsed() + * - cacheWillUpdate() + * - cacheDidUpdate() + * + * @param {Request|string} key The request or URL to use as the cache key. + * @param {Response} response The response to cache. + * @return {Promise} `false` if a cacheWillUpdate caused the response + * not be cached, and `true` otherwise. + */ + async cachePut(key, response) { + const request = toRequest(key); + // Run in the next task to avoid blocking other cache reads. + // https://github.com/w3c/ServiceWorker/issues/1397 + await timeout(0); + const effectiveRequest = await this.getCacheKey(request, 'write'); + { + if (effectiveRequest.method && effectiveRequest.method !== 'GET') { + throw new WorkboxError('attempt-to-cache-non-get-request', { + url: getFriendlyURL(effectiveRequest.url), + method: effectiveRequest.method + }); + } + // See https://github.com/GoogleChrome/workbox/issues/2818 + const vary = response.headers.get('Vary'); + if (vary) { + logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` + `has a 'Vary: ${vary}' header. ` + `Consider setting the {ignoreVary: true} option on your strategy ` + `to ensure cache matching and deletion works as expected.`); + } + } + if (!response) { + { + logger.error(`Cannot cache non-existent response for ` + `'${getFriendlyURL(effectiveRequest.url)}'.`); + } + throw new WorkboxError('cache-put-with-no-response', { + url: getFriendlyURL(effectiveRequest.url) + }); + } + const responseToCache = await this._ensureResponseSafeToCache(response); + if (!responseToCache) { + { + logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` + `will not be cached.`, responseToCache); + } + return false; + } + const { + cacheName, + matchOptions + } = this._strategy; + const cache = await self.caches.open(cacheName); + const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate'); + const oldResponse = hasCacheUpdateCallback ? await cacheMatchIgnoreParams( + // TODO(philipwalton): the `__WB_REVISION__` param is a precaching + // feature. Consider into ways to only add this behavior if using + // precaching. + cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions) : null; + { + logger.debug(`Updating the '${cacheName}' cache with a new Response ` + `for ${getFriendlyURL(effectiveRequest.url)}.`); + } + try { + await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache); + } catch (error) { + if (error instanceof Error) { + // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError + if (error.name === 'QuotaExceededError') { + await executeQuotaErrorCallbacks(); + } + throw error; + } + } + for (const callback of this.iterateCallbacks('cacheDidUpdate')) { + await callback({ + cacheName, + oldResponse, + newResponse: responseToCache.clone(), + request: effectiveRequest, + event: this.event + }); + } + return true; + } + /** + * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and + * executes any of those callbacks found in sequence. The final `Request` + * object returned by the last plugin is treated as the cache key for cache + * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have + * been registered, the passed request is returned unmodified + * + * @param {Request} request + * @param {string} mode + * @return {Promise} + */ + async getCacheKey(request, mode) { + const key = `${request.url} | ${mode}`; + if (!this._cacheKeys[key]) { + let effectiveRequest = request; + for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) { + effectiveRequest = toRequest(await callback({ + mode, + request: effectiveRequest, + event: this.event, + // params has a type any can't change right now. + params: this.params // eslint-disable-line + })); + } + + this._cacheKeys[key] = effectiveRequest; + } + return this._cacheKeys[key]; + } + /** + * Returns true if the strategy has at least one plugin with the given + * callback. + * + * @param {string} name The name of the callback to check for. + * @return {boolean} + */ + hasCallback(name) { + for (const plugin of this._strategy.plugins) { + if (name in plugin) { + return true; + } + } + return false; + } + /** + * Runs all plugin callbacks matching the given name, in order, passing the + * given param object (merged ith the current plugin state) as the only + * argument. + * + * Note: since this method runs all plugins, it's not suitable for cases + * where the return value of a callback needs to be applied prior to calling + * the next callback. See + * {@link workbox-strategies.StrategyHandler#iterateCallbacks} + * below for how to handle that case. + * + * @param {string} name The name of the callback to run within each plugin. + * @param {Object} param The object to pass as the first (and only) param + * when executing each callback. This object will be merged with the + * current plugin state prior to callback execution. + */ + async runCallbacks(name, param) { + for (const callback of this.iterateCallbacks(name)) { + // TODO(philipwalton): not sure why `any` is needed. It seems like + // this should work with `as WorkboxPluginCallbackParam[C]`. + await callback(param); + } + } + /** + * Accepts a callback and returns an iterable of matching plugin callbacks, + * where each callback is wrapped with the current handler state (i.e. when + * you call each callback, whatever object parameter you pass it will + * be merged with the plugin's current state). + * + * @param {string} name The name fo the callback to run + * @return {Array} + */ + *iterateCallbacks(name) { + for (const plugin of this._strategy.plugins) { + if (typeof plugin[name] === 'function') { + const state = this._pluginStateMap.get(plugin); + const statefulCallback = param => { + const statefulParam = Object.assign(Object.assign({}, param), { + state + }); + // TODO(philipwalton): not sure why `any` is needed. It seems like + // this should work with `as WorkboxPluginCallbackParam[C]`. + return plugin[name](statefulParam); + }; + yield statefulCallback; + } + } + } + /** + * Adds a promise to the + * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises} + * of the event event associated with the request being handled (usually a + * `FetchEvent`). + * + * Note: you can await + * {@link workbox-strategies.StrategyHandler~doneWaiting} + * to know when all added promises have settled. + * + * @param {Promise} promise A promise to add to the extend lifetime promises + * of the event that triggered the request. + */ + waitUntil(promise) { + this._extendLifetimePromises.push(promise); + return promise; + } + /** + * Returns a promise that resolves once all promises passed to + * {@link workbox-strategies.StrategyHandler~waitUntil} + * have settled. + * + * Note: any work done after `doneWaiting()` settles should be manually + * passed to an event's `waitUntil()` method (not this handler's + * `waitUntil()` method), otherwise the service worker thread my be killed + * prior to your work completing. + */ + async doneWaiting() { + let promise; + while (promise = this._extendLifetimePromises.shift()) { + await promise; + } + } + /** + * Stops running the strategy and immediately resolves any pending + * `waitUntil()` promises. + */ + destroy() { + this._handlerDeferred.resolve(null); + } + /** + * This method will call cacheWillUpdate on the available plugins (or use + * status === 200) to determine if the Response is safe and valid to cache. + * + * @param {Request} options.request + * @param {Response} options.response + * @return {Promise} + * + * @private + */ + async _ensureResponseSafeToCache(response) { + let responseToCache = response; + let pluginsUsed = false; + for (const callback of this.iterateCallbacks('cacheWillUpdate')) { + responseToCache = (await callback({ + request: this.request, + response: responseToCache, + event: this.event + })) || undefined; + pluginsUsed = true; + if (!responseToCache) { + break; + } + } + if (!pluginsUsed) { + if (responseToCache && responseToCache.status !== 200) { + responseToCache = undefined; + } + { + if (responseToCache) { + if (responseToCache.status !== 200) { + if (responseToCache.status === 0) { + logger.warn(`The response for '${this.request.url}' ` + `is an opaque response. The caching strategy that you're ` + `using will not cache opaque responses by default.`); + } else { + logger.debug(`The response for '${this.request.url}' ` + `returned a status code of '${response.status}' and won't ` + `be cached as a result.`); + } + } + } + } + } + return responseToCache; + } + } + + /* + Copyright 2020 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * An abstract base class that all other strategy classes must extend from: + * + * @memberof workbox-strategies + */ + class Strategy { + /** + * Creates a new instance of the strategy and sets all documented option + * properties as public instance properties. + * + * Note: if a custom strategy class extends the base Strategy class and does + * not need more than these properties, it does not need to define its own + * constructor. + * + * @param {Object} [options] + * @param {string} [options.cacheName] Cache name to store and retrieve + * requests. Defaults to the cache names provided by + * {@link workbox-core.cacheNames}. + * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins} + * to use in conjunction with this caching strategy. + * @param {Object} [options.fetchOptions] Values passed along to the + * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters) + * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796) + * `fetch()` requests made by this strategy. + * @param {Object} [options.matchOptions] The + * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions} + * for any `cache.match()` or `cache.put()` calls made by this strategy. + */ + constructor(options = {}) { + /** + * Cache name to store and retrieve + * requests. Defaults to the cache names provided by + * {@link workbox-core.cacheNames}. + * + * @type {string} + */ + this.cacheName = cacheNames.getRuntimeName(options.cacheName); + /** + * The list + * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins} + * used by this strategy. + * + * @type {Array} + */ + this.plugins = options.plugins || []; + /** + * Values passed along to the + * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters} + * of all fetch() requests made by this strategy. + * + * @type {Object} + */ + this.fetchOptions = options.fetchOptions; + /** + * The + * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions} + * for any `cache.match()` or `cache.put()` calls made by this strategy. + * + * @type {Object} + */ + this.matchOptions = options.matchOptions; + } + /** + * Perform a request strategy and returns a `Promise` that will resolve with + * a `Response`, invoking all relevant plugin callbacks. + * + * When a strategy instance is registered with a Workbox + * {@link workbox-routing.Route}, this method is automatically + * called when the route matches. + * + * Alternatively, this method can be used in a standalone `FetchEvent` + * listener by passing it to `event.respondWith()`. + * + * @param {FetchEvent|Object} options A `FetchEvent` or an object with the + * properties listed below. + * @param {Request|string} options.request A request to run this strategy for. + * @param {ExtendableEvent} options.event The event associated with the + * request. + * @param {URL} [options.url] + * @param {*} [options.params] + */ + handle(options) { + const [responseDone] = this.handleAll(options); + return responseDone; + } + /** + * Similar to {@link workbox-strategies.Strategy~handle}, but + * instead of just returning a `Promise` that resolves to a `Response` it + * it will return an tuple of `[response, done]` promises, where the former + * (`response`) is equivalent to what `handle()` returns, and the latter is a + * Promise that will resolve once any promises that were added to + * `event.waitUntil()` as part of performing the strategy have completed. + * + * You can await the `done` promise to ensure any extra work performed by + * the strategy (usually caching responses) completes successfully. + * + * @param {FetchEvent|Object} options A `FetchEvent` or an object with the + * properties listed below. + * @param {Request|string} options.request A request to run this strategy for. + * @param {ExtendableEvent} options.event The event associated with the + * request. + * @param {URL} [options.url] + * @param {*} [options.params] + * @return {Array} A tuple of [response, done] + * promises that can be used to determine when the response resolves as + * well as when the handler has completed all its work. + */ + handleAll(options) { + // Allow for flexible options to be passed. + if (options instanceof FetchEvent) { + options = { + event: options, + request: options.request + }; + } + const event = options.event; + const request = typeof options.request === 'string' ? new Request(options.request) : options.request; + const params = 'params' in options ? options.params : undefined; + const handler = new StrategyHandler(this, { + event, + request, + params + }); + const responseDone = this._getResponse(handler, request, event); + const handlerDone = this._awaitComplete(responseDone, handler, request, event); + // Return an array of promises, suitable for use with Promise.all(). + return [responseDone, handlerDone]; + } + async _getResponse(handler, request, event) { + await handler.runCallbacks('handlerWillStart', { + event, + request + }); + let response = undefined; + try { + response = await this._handle(request, handler); + // The "official" Strategy subclasses all throw this error automatically, + // but in case a third-party Strategy doesn't, ensure that we have a + // consistent failure when there's no response or an error response. + if (!response || response.type === 'error') { + throw new WorkboxError('no-response', { + url: request.url + }); + } + } catch (error) { + if (error instanceof Error) { + for (const callback of handler.iterateCallbacks('handlerDidError')) { + response = await callback({ + error, + event, + request + }); + if (response) { + break; + } + } + } + if (!response) { + throw error; + } else { + logger.log(`While responding to '${getFriendlyURL(request.url)}', ` + `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` + `a handlerDidError plugin.`); + } + } + for (const callback of handler.iterateCallbacks('handlerWillRespond')) { + response = await callback({ + event, + request, + response + }); + } + return response; + } + async _awaitComplete(responseDone, handler, request, event) { + let response; + let error; + try { + response = await responseDone; + } catch (error) { + // Ignore errors, as response errors should be caught via the `response` + // promise above. The `done` promise will only throw for errors in + // promises passed to `handler.waitUntil()`. + } + try { + await handler.runCallbacks('handlerDidRespond', { + event, + request, + response + }); + await handler.doneWaiting(); + } catch (waitUntilError) { + if (waitUntilError instanceof Error) { + error = waitUntilError; + } + } + await handler.runCallbacks('handlerDidComplete', { + event, + request, + response, + error: error + }); + handler.destroy(); + if (error) { + throw error; + } + } + } + /** + * Classes extending the `Strategy` based class should implement this method, + * and leverage the {@link workbox-strategies.StrategyHandler} + * arg to perform all fetching and cache logic, which will ensure all relevant + * cache, cache options, fetch options and plugins are used (per the current + * strategy instance). + * + * @name _handle + * @instance + * @abstract + * @function + * @param {Request} request + * @param {workbox-strategies.StrategyHandler} handler + * @return {Promise} + * + * @memberof workbox-strategies.Strategy + */ + + /* + Copyright 2020 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * A {@link workbox-strategies.Strategy} implementation + * specifically designed to work with + * {@link workbox-precaching.PrecacheController} + * to both cache and fetch precached assets. + * + * Note: an instance of this class is created automatically when creating a + * `PrecacheController`; it's generally not necessary to create this yourself. + * + * @extends workbox-strategies.Strategy + * @memberof workbox-precaching + */ + class PrecacheStrategy extends Strategy { + /** + * + * @param {Object} [options] + * @param {string} [options.cacheName] Cache name to store and retrieve + * requests. Defaults to the cache names provided by + * {@link workbox-core.cacheNames}. + * @param {Array} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins} + * to use in conjunction with this caching strategy. + * @param {Object} [options.fetchOptions] Values passed along to the + * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init} + * of all fetch() requests made by this strategy. + * @param {Object} [options.matchOptions] The + * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions} + * for any `cache.match()` or `cache.put()` calls made by this strategy. + * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to + * get the response from the network if there's a precache miss. + */ + constructor(options = {}) { + options.cacheName = cacheNames.getPrecacheName(options.cacheName); + super(options); + this._fallbackToNetwork = options.fallbackToNetwork === false ? false : true; + // Redirected responses cannot be used to satisfy a navigation request, so + // any redirected response must be "copied" rather than cloned, so the new + // response doesn't contain the `redirected` flag. See: + // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1 + this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin); + } + /** + * @private + * @param {Request|string} request A request to run this strategy for. + * @param {workbox-strategies.StrategyHandler} handler The event that + * triggered the request. + * @return {Promise} + */ + async _handle(request, handler) { + const response = await handler.cacheMatch(request); + if (response) { + return response; + } + // If this is an `install` event for an entry that isn't already cached, + // then populate the cache. + if (handler.event && handler.event.type === 'install') { + return await this._handleInstall(request, handler); + } + // Getting here means something went wrong. An entry that should have been + // precached wasn't found in the cache. + return await this._handleFetch(request, handler); + } + async _handleFetch(request, handler) { + let response; + const params = handler.params || {}; + // Fall back to the network if we're configured to do so. + if (this._fallbackToNetwork) { + { + logger.warn(`The precached response for ` + `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` + `found. Falling back to the network.`); + } + const integrityInManifest = params.integrity; + const integrityInRequest = request.integrity; + const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest; + // Do not add integrity if the original request is no-cors + // See https://github.com/GoogleChrome/workbox/issues/3096 + response = await handler.fetch(new Request(request, { + integrity: request.mode !== 'no-cors' ? integrityInRequest || integrityInManifest : undefined + })); + // It's only "safe" to repair the cache if we're using SRI to guarantee + // that the response matches the precache manifest's expectations, + // and there's either a) no integrity property in the incoming request + // or b) there is an integrity, and it matches the precache manifest. + // See https://github.com/GoogleChrome/workbox/issues/2858 + // Also if the original request users no-cors we don't use integrity. + // See https://github.com/GoogleChrome/workbox/issues/3096 + if (integrityInManifest && noIntegrityConflict && request.mode !== 'no-cors') { + this._useDefaultCacheabilityPluginIfNeeded(); + const wasCached = await handler.cachePut(request, response.clone()); + { + if (wasCached) { + logger.log(`A response for ${getFriendlyURL(request.url)} ` + `was used to "repair" the precache.`); + } + } + } + } else { + // This shouldn't normally happen, but there are edge cases: + // https://github.com/GoogleChrome/workbox/issues/1441 + throw new WorkboxError('missing-precache-entry', { + cacheName: this.cacheName, + url: request.url + }); + } + { + const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read')); + // Workbox is going to handle the route. + // print the routing details to the console. + logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url)); + logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`); + logger.groupCollapsed(`View request details here.`); + logger.log(request); + logger.groupEnd(); + logger.groupCollapsed(`View response details here.`); + logger.log(response); + logger.groupEnd(); + logger.groupEnd(); + } + return response; + } + async _handleInstall(request, handler) { + this._useDefaultCacheabilityPluginIfNeeded(); + const response = await handler.fetch(request); + // Make sure we defer cachePut() until after we know the response + // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737 + const wasCached = await handler.cachePut(request, response.clone()); + if (!wasCached) { + // Throwing here will lead to the `install` handler failing, which + // we want to do if *any* of the responses aren't safe to cache. + throw new WorkboxError('bad-precaching-response', { + url: request.url, + status: response.status + }); + } + return response; + } + /** + * This method is complex, as there a number of things to account for: + * + * The `plugins` array can be set at construction, and/or it might be added to + * to at any time before the strategy is used. + * + * At the time the strategy is used (i.e. during an `install` event), there + * needs to be at least one plugin that implements `cacheWillUpdate` in the + * array, other than `copyRedirectedCacheableResponsesPlugin`. + * + * - If this method is called and there are no suitable `cacheWillUpdate` + * plugins, we need to add `defaultPrecacheCacheabilityPlugin`. + * + * - If this method is called and there is exactly one `cacheWillUpdate`, then + * we don't have to do anything (this might be a previously added + * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin). + * + * - If this method is called and there is more than one `cacheWillUpdate`, + * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so, + * we need to remove it. (This situation is unlikely, but it could happen if + * the strategy is used multiple times, the first without a `cacheWillUpdate`, + * and then later on after manually adding a custom `cacheWillUpdate`.) + * + * See https://github.com/GoogleChrome/workbox/issues/2737 for more context. + * + * @private + */ + _useDefaultCacheabilityPluginIfNeeded() { + let defaultPluginIndex = null; + let cacheWillUpdatePluginCount = 0; + for (const [index, plugin] of this.plugins.entries()) { + // Ignore the copy redirected plugin when determining what to do. + if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) { + continue; + } + // Save the default plugin's index, in case it needs to be removed. + if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) { + defaultPluginIndex = index; + } + if (plugin.cacheWillUpdate) { + cacheWillUpdatePluginCount++; + } + } + if (cacheWillUpdatePluginCount === 0) { + this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin); + } else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) { + // Only remove the default plugin; multiple custom plugins are allowed. + this.plugins.splice(defaultPluginIndex, 1); + } + // Nothing needs to be done if cacheWillUpdatePluginCount is 1 + } + } + + PrecacheStrategy.defaultPrecacheCacheabilityPlugin = { + async cacheWillUpdate({ + response + }) { + if (!response || response.status >= 400) { + return null; + } + return response; + } + }; + PrecacheStrategy.copyRedirectedCacheableResponsesPlugin = { + async cacheWillUpdate({ + response + }) { + return response.redirected ? await copyResponse(response) : response; + } + }; + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Performs efficient precaching of assets. + * + * @memberof workbox-precaching + */ + class PrecacheController { + /** + * Create a new PrecacheController. + * + * @param {Object} [options] + * @param {string} [options.cacheName] The cache to use for precaching. + * @param {string} [options.plugins] Plugins to use when precaching as well + * as responding to fetch events for precached assets. + * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to + * get the response from the network if there's a precache miss. + */ + constructor({ + cacheName, + plugins = [], + fallbackToNetwork = true + } = {}) { + this._urlsToCacheKeys = new Map(); + this._urlsToCacheModes = new Map(); + this._cacheKeysToIntegrities = new Map(); + this._strategy = new PrecacheStrategy({ + cacheName: cacheNames.getPrecacheName(cacheName), + plugins: [...plugins, new PrecacheCacheKeyPlugin({ + precacheController: this + })], + fallbackToNetwork + }); + // Bind the install and activate methods to the instance. + this.install = this.install.bind(this); + this.activate = this.activate.bind(this); + } + /** + * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and + * used to cache assets and respond to fetch events. + */ + get strategy() { + return this._strategy; + } + /** + * Adds items to the precache list, removing any duplicates and + * stores the files in the + * {@link workbox-core.cacheNames|"precache cache"} when the service + * worker installs. + * + * This method can be called multiple times. + * + * @param {Array} [entries=[]] Array of entries to precache. + */ + precache(entries) { + this.addToCacheList(entries); + if (!this._installAndActiveListenersAdded) { + self.addEventListener('install', this.install); + self.addEventListener('activate', this.activate); + this._installAndActiveListenersAdded = true; + } + } + /** + * This method will add items to the precache list, removing duplicates + * and ensuring the information is valid. + * + * @param {Array} entries + * Array of entries to precache. + */ + addToCacheList(entries) { + { + finalAssertExports.isArray(entries, { + moduleName: 'workbox-precaching', + className: 'PrecacheController', + funcName: 'addToCacheList', + paramName: 'entries' + }); + } + const urlsToWarnAbout = []; + for (const entry of entries) { + // See https://github.com/GoogleChrome/workbox/issues/2259 + if (typeof entry === 'string') { + urlsToWarnAbout.push(entry); + } else if (entry && entry.revision === undefined) { + urlsToWarnAbout.push(entry.url); + } + const { + cacheKey, + url + } = createCacheKey(entry); + const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default'; + if (this._urlsToCacheKeys.has(url) && this._urlsToCacheKeys.get(url) !== cacheKey) { + throw new WorkboxError('add-to-cache-list-conflicting-entries', { + firstEntry: this._urlsToCacheKeys.get(url), + secondEntry: cacheKey + }); + } + if (typeof entry !== 'string' && entry.integrity) { + if (this._cacheKeysToIntegrities.has(cacheKey) && this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) { + throw new WorkboxError('add-to-cache-list-conflicting-integrities', { + url + }); + } + this._cacheKeysToIntegrities.set(cacheKey, entry.integrity); + } + this._urlsToCacheKeys.set(url, cacheKey); + this._urlsToCacheModes.set(url, cacheMode); + if (urlsToWarnAbout.length > 0) { + const warningMessage = `Workbox is precaching URLs without revision ` + `info: ${urlsToWarnAbout.join(', ')}\nThis is generally NOT safe. ` + `Learn more at https://bit.ly/wb-precache`; + { + logger.warn(warningMessage); + } + } + } + } + /** + * Precaches new and updated assets. Call this method from the service worker + * install event. + * + * Note: this method calls `event.waitUntil()` for you, so you do not need + * to call it yourself in your event handlers. + * + * @param {ExtendableEvent} event + * @return {Promise} + */ + install(event) { + // waitUntil returns Promise + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return waitUntil(event, async () => { + const installReportPlugin = new PrecacheInstallReportPlugin(); + this.strategy.plugins.push(installReportPlugin); + // Cache entries one at a time. + // See https://github.com/GoogleChrome/workbox/issues/2528 + for (const [url, cacheKey] of this._urlsToCacheKeys) { + const integrity = this._cacheKeysToIntegrities.get(cacheKey); + const cacheMode = this._urlsToCacheModes.get(url); + const request = new Request(url, { + integrity, + cache: cacheMode, + credentials: 'same-origin' + }); + await Promise.all(this.strategy.handleAll({ + params: { + cacheKey + }, + request, + event + })); + } + const { + updatedURLs, + notUpdatedURLs + } = installReportPlugin; + { + printInstallDetails(updatedURLs, notUpdatedURLs); + } + return { + updatedURLs, + notUpdatedURLs + }; + }); + } + /** + * Deletes assets that are no longer present in the current precache manifest. + * Call this method from the service worker activate event. + * + * Note: this method calls `event.waitUntil()` for you, so you do not need + * to call it yourself in your event handlers. + * + * @param {ExtendableEvent} event + * @return {Promise} + */ + activate(event) { + // waitUntil returns Promise + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return waitUntil(event, async () => { + const cache = await self.caches.open(this.strategy.cacheName); + const currentlyCachedRequests = await cache.keys(); + const expectedCacheKeys = new Set(this._urlsToCacheKeys.values()); + const deletedURLs = []; + for (const request of currentlyCachedRequests) { + if (!expectedCacheKeys.has(request.url)) { + await cache.delete(request); + deletedURLs.push(request.url); + } + } + { + printCleanupDetails(deletedURLs); + } + return { + deletedURLs + }; + }); + } + /** + * Returns a mapping of a precached URL to the corresponding cache key, taking + * into account the revision information for the URL. + * + * @return {Map} A URL to cache key mapping. + */ + getURLsToCacheKeys() { + return this._urlsToCacheKeys; + } + /** + * Returns a list of all the URLs that have been precached by the current + * service worker. + * + * @return {Array} The precached URLs. + */ + getCachedURLs() { + return [...this._urlsToCacheKeys.keys()]; + } + /** + * Returns the cache key used for storing a given URL. If that URL is + * unversioned, like `/index.html', then the cache key will be the original + * URL with a search parameter appended to it. + * + * @param {string} url A URL whose cache key you want to look up. + * @return {string} The versioned URL that corresponds to a cache key + * for the original URL, or undefined if that URL isn't precached. + */ + getCacheKeyForURL(url) { + const urlObject = new URL(url, location.href); + return this._urlsToCacheKeys.get(urlObject.href); + } + /** + * @param {string} url A cache key whose SRI you want to look up. + * @return {string} The subresource integrity associated with the cache key, + * or undefined if it's not set. + */ + getIntegrityForCacheKey(cacheKey) { + return this._cacheKeysToIntegrities.get(cacheKey); + } + /** + * This acts as a drop-in replacement for + * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match) + * with the following differences: + * + * - It knows what the name of the precache is, and only checks in that cache. + * - It allows you to pass in an "original" URL without versioning parameters, + * and it will automatically look up the correct cache key for the currently + * active revision of that URL. + * + * E.g., `matchPrecache('index.html')` will find the correct precached + * response for the currently active service worker, even if the actual cache + * key is `'/index.html?__WB_REVISION__=1234abcd'`. + * + * @param {string|Request} request The key (without revisioning parameters) + * to look up in the precache. + * @return {Promise} + */ + async matchPrecache(request) { + const url = request instanceof Request ? request.url : request; + const cacheKey = this.getCacheKeyForURL(url); + if (cacheKey) { + const cache = await self.caches.open(this.strategy.cacheName); + return cache.match(cacheKey); + } + return undefined; + } + /** + * Returns a function that looks up `url` in the precache (taking into + * account revision information), and returns the corresponding `Response`. + * + * @param {string} url The precached URL which will be used to lookup the + * `Response`. + * @return {workbox-routing~handlerCallback} + */ + createHandlerBoundToURL(url) { + const cacheKey = this.getCacheKeyForURL(url); + if (!cacheKey) { + throw new WorkboxError('non-precached-url', { + url + }); + } + return options => { + options.request = new Request(url); + options.params = Object.assign({ + cacheKey + }, options.params); + return this.strategy.handle(options); + }; + } + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + let precacheController; + /** + * @return {PrecacheController} + * @private + */ + const getOrCreatePrecacheController = () => { + if (!precacheController) { + precacheController = new PrecacheController(); + } + return precacheController; + }; + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Removes any URL search parameters that should be ignored. + * + * @param {URL} urlObject The original URL. + * @param {Array} ignoreURLParametersMatching RegExps to test against + * each search parameter name. Matches mean that the search parameter should be + * ignored. + * @return {URL} The URL with any ignored search parameters removed. + * + * @private + * @memberof workbox-precaching + */ + function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) { + // Convert the iterable into an array at the start of the loop to make sure + // deletion doesn't mess up iteration. + for (const paramName of [...urlObject.searchParams.keys()]) { + if (ignoreURLParametersMatching.some(regExp => regExp.test(paramName))) { + urlObject.searchParams.delete(paramName); + } + } + return urlObject; + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Generator function that yields possible variations on the original URL to + * check, one at a time. + * + * @param {string} url + * @param {Object} options + * + * @private + * @memberof workbox-precaching + */ + function* generateURLVariations(url, { + ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], + directoryIndex = 'index.html', + cleanURLs = true, + urlManipulation + } = {}) { + const urlObject = new URL(url, location.href); + urlObject.hash = ''; + yield urlObject.href; + const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching); + yield urlWithoutIgnoredParams.href; + if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) { + const directoryURL = new URL(urlWithoutIgnoredParams.href); + directoryURL.pathname += directoryIndex; + yield directoryURL.href; + } + if (cleanURLs) { + const cleanURL = new URL(urlWithoutIgnoredParams.href); + cleanURL.pathname += '.html'; + yield cleanURL.href; + } + if (urlManipulation) { + const additionalURLs = urlManipulation({ + url: urlObject + }); + for (const urlToAttempt of additionalURLs) { + yield urlToAttempt.href; + } + } + } + + /* + Copyright 2020 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * A subclass of {@link workbox-routing.Route} that takes a + * {@link workbox-precaching.PrecacheController} + * instance and uses it to match incoming requests and handle fetching + * responses from the precache. + * + * @memberof workbox-precaching + * @extends workbox-routing.Route + */ + class PrecacheRoute extends Route { + /** + * @param {PrecacheController} precacheController A `PrecacheController` + * instance used to both match requests and respond to fetch events. + * @param {Object} [options] Options to control how requests are matched + * against the list of precached URLs. + * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will + * check cache entries for a URLs ending with '/' to see if there is a hit when + * appending the `directoryIndex` value. + * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An + * array of regex's to remove search params when looking for a cache match. + * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will + * check the cache for the URL with a `.html` added to the end of the end. + * @param {workbox-precaching~urlManipulation} [options.urlManipulation] + * This is a function that should take a URL and return an array of + * alternative URLs that should be checked for precache matches. + */ + constructor(precacheController, options) { + const match = ({ + request + }) => { + const urlsToCacheKeys = precacheController.getURLsToCacheKeys(); + for (const possibleURL of generateURLVariations(request.url, options)) { + const cacheKey = urlsToCacheKeys.get(possibleURL); + if (cacheKey) { + const integrity = precacheController.getIntegrityForCacheKey(cacheKey); + return { + cacheKey, + integrity + }; + } + } + { + logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url)); + } + return; + }; + super(match, precacheController.strategy); + } + } + + /* + Copyright 2019 Google LLC + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Add a `fetch` listener to the service worker that will + * respond to + * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests} + * with precached assets. + * + * Requests for assets that aren't precached, the `FetchEvent` will not be + * responded to, allowing the event to fall through to other `fetch` event + * listeners. + * + * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute} + * options. + * + * @memberof workbox-precaching + */ + function addRoute(options) { + const precacheController = getOrCreatePrecacheController(); + const precacheRoute = new PrecacheRoute(precacheController, options); + registerRoute(precacheRoute); + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Adds items to the precache list, removing any duplicates and + * stores the files in the + * {@link workbox-core.cacheNames|"precache cache"} when the service + * worker installs. + * + * This method can be called multiple times. + * + * Please note: This method **will not** serve any of the cached files for you. + * It only precaches files. To respond to a network request you call + * {@link workbox-precaching.addRoute}. + * + * If you have a single array of files to precache, you can just call + * {@link workbox-precaching.precacheAndRoute}. + * + * @param {Array} [entries=[]] Array of entries to precache. + * + * @memberof workbox-precaching + */ + function precache(entries) { + const precacheController = getOrCreatePrecacheController(); + precacheController.precache(entries); + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * This method will add entries to the precache list and add a route to + * respond to fetch events. + * + * This is a convenience method that will call + * {@link workbox-precaching.precache} and + * {@link workbox-precaching.addRoute} in a single call. + * + * @param {Array} entries Array of entries to precache. + * @param {Object} [options] See the + * {@link workbox-precaching.PrecacheRoute} options. + * + * @memberof workbox-precaching + */ + function precacheAndRoute(entries, options) { + precache(entries); + addRoute(options); + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + const SUBSTRING_TO_FIND = '-precache-'; + /** + * Cleans up incompatible precaches that were created by older versions of + * Workbox, by a service worker registered under the current scope. + * + * This is meant to be called as part of the `activate` event. + * + * This should be safe to use as long as you don't include `substringToFind` + * (defaulting to `-precache-`) in your non-precache cache names. + * + * @param {string} currentPrecacheName The cache name currently in use for + * precaching. This cache won't be deleted. + * @param {string} [substringToFind='-precache-'] Cache names which include this + * substring will be deleted (excluding `currentPrecacheName`). + * @return {Array} A list of all the cache names that were deleted. + * + * @private + * @memberof workbox-precaching + */ + const deleteOutdatedCaches = async (currentPrecacheName, substringToFind = SUBSTRING_TO_FIND) => { + const cacheNames = await self.caches.keys(); + const cacheNamesToDelete = cacheNames.filter(cacheName => { + return cacheName.includes(substringToFind) && cacheName.includes(self.registration.scope) && cacheName !== currentPrecacheName; + }); + await Promise.all(cacheNamesToDelete.map(cacheName => self.caches.delete(cacheName))); + return cacheNamesToDelete; + }; + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Adds an `activate` event listener which will clean up incompatible + * precaches that were created by older versions of Workbox. + * + * @memberof workbox-precaching + */ + function cleanupOutdatedCaches() { + // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705 + self.addEventListener('activate', event => { + const cacheName = cacheNames.getPrecacheName(); + event.waitUntil(deleteOutdatedCaches(cacheName).then(cachesDeleted => { + { + if (cachesDeleted.length > 0) { + logger.log(`The following out-of-date precaches were cleaned up ` + `automatically:`, cachesDeleted); + } + } + })); + }); + } + + /* + Copyright 2018 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * NavigationRoute makes it easy to create a + * {@link workbox-routing.Route} that matches for browser + * [navigation requests]{@link https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests}. + * + * It will only match incoming Requests whose + * {@link https://fetch.spec.whatwg.org/#concept-request-mode|mode} + * is set to `navigate`. + * + * You can optionally only apply this route to a subset of navigation requests + * by using one or both of the `denylist` and `allowlist` parameters. + * + * @memberof workbox-routing + * @extends workbox-routing.Route + */ + class NavigationRoute extends Route { + /** + * If both `denylist` and `allowlist` are provided, the `denylist` will + * take precedence and the request will not match this route. + * + * The regular expressions in `allowlist` and `denylist` + * are matched against the concatenated + * [`pathname`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname} + * and [`search`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search} + * portions of the requested URL. + * + * *Note*: These RegExps may be evaluated against every destination URL during + * a navigation. Avoid using + * [complex RegExps](https://github.com/GoogleChrome/workbox/issues/3077), + * or else your users may see delays when navigating your site. + * + * @param {workbox-routing~handlerCallback} handler A callback + * function that returns a Promise resulting in a Response. + * @param {Object} options + * @param {Array} [options.denylist] If any of these patterns match, + * the route will not handle the request (even if a allowlist RegExp matches). + * @param {Array} [options.allowlist=[/./]] If any of these patterns + * match the URL's pathname and search parameter, the route will handle the + * request (assuming the denylist doesn't match). + */ + constructor(handler, { + allowlist = [/./], + denylist = [] + } = {}) { + { + finalAssertExports.isArrayOfClass(allowlist, RegExp, { + moduleName: 'workbox-routing', + className: 'NavigationRoute', + funcName: 'constructor', + paramName: 'options.allowlist' + }); + finalAssertExports.isArrayOfClass(denylist, RegExp, { + moduleName: 'workbox-routing', + className: 'NavigationRoute', + funcName: 'constructor', + paramName: 'options.denylist' + }); + } + super(options => this._match(options), handler); + this._allowlist = allowlist; + this._denylist = denylist; + } + /** + * Routes match handler. + * + * @param {Object} options + * @param {URL} options.url + * @param {Request} options.request + * @return {boolean} + * + * @private + */ + _match({ + url, + request + }) { + if (request && request.mode !== 'navigate') { + return false; + } + const pathnameAndSearch = url.pathname + url.search; + for (const regExp of this._denylist) { + if (regExp.test(pathnameAndSearch)) { + { + logger.log(`The navigation route ${pathnameAndSearch} is not ` + `being used, since the URL matches this denylist pattern: ` + `${regExp.toString()}`); + } + return false; + } + } + if (this._allowlist.some(regExp => regExp.test(pathnameAndSearch))) { + { + logger.debug(`The navigation route ${pathnameAndSearch} ` + `is being used.`); + } + return true; + } + { + logger.log(`The navigation route ${pathnameAndSearch} is not ` + `being used, since the URL being navigated to doesn't ` + `match the allowlist.`); + } + return false; + } + } + + /* + Copyright 2019 Google LLC + + Use of this source code is governed by an MIT-style + license that can be found in the LICENSE file or at + https://opensource.org/licenses/MIT. + */ + /** + * Helper function that calls + * {@link PrecacheController#createHandlerBoundToURL} on the default + * {@link PrecacheController} instance. + * + * If you are creating your own {@link PrecacheController}, then call the + * {@link PrecacheController#createHandlerBoundToURL} on that instance, + * instead of using this function. + * + * @param {string} url The precached URL which will be used to lookup the + * `Response`. + * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the + * response from the network if there's a precache miss. + * @return {workbox-routing~handlerCallback} + * + * @memberof workbox-precaching + */ + function createHandlerBoundToURL(url) { + const precacheController = getOrCreatePrecacheController(); + return precacheController.createHandlerBoundToURL(url); + } + + exports.NavigationRoute = NavigationRoute; + exports.cleanupOutdatedCaches = cleanupOutdatedCaches; + exports.clientsClaim = clientsClaim; + exports.createHandlerBoundToURL = createHandlerBoundToURL; + exports.precacheAndRoute = precacheAndRoute; + exports.registerRoute = registerRoute; + +})); diff --git a/src/static/.well-known/assetlinks.json b/dist/.well-known/assetlinks.json similarity index 100% rename from src/static/.well-known/assetlinks.json rename to dist/.well-known/assetlinks.json diff --git a/src/static/.well-known/nostr.json b/dist/.well-known/nostr.json similarity index 100% rename from src/static/.well-known/nostr.json rename to dist/.well-known/nostr.json diff --git a/dist/assets/android-chrome-192x192-f67a838c.png b/dist/assets/android-chrome-192x192-f67a838c.png new file mode 100644 index 00000000..056676f3 Binary files /dev/null and b/dist/assets/android-chrome-192x192-f67a838c.png differ diff --git a/dist/assets/icon128-e988831c.png b/dist/assets/icon128-e988831c.png new file mode 100644 index 00000000..9546ad50 Binary files /dev/null and b/dist/assets/icon128-e988831c.png differ diff --git a/dist/assets/index-21a91155.js b/dist/assets/index-21a91155.js new file mode 100644 index 00000000..c72872c9 --- /dev/null +++ b/dist/assets/index-21a91155.js @@ -0,0 +1,2904 @@ +var FC=Object.defineProperty;var UC=(e,t,n)=>t in e?FC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xe=(e,t,n)=>(UC(e,typeof t!="symbol"?t+"":t,n),n),Lp=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var bi=(e,t,n)=>(Lp(e,t,"read from private field"),n?n.call(e):t.get(e)),Nn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Xa=(e,t,n,r)=>(Lp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var qn=(e,t,n)=>(Lp(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var cu,vt,jw,ta,Xv,zw,_g,Hw,nh={},qw=[],jC=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,td=Array.isArray;function Ps(e,t){for(var n in t)e[n]=t[n];return e}function Kw(e){var t=e.parentNode;t&&t.removeChild(e)}function ft(e,t,n){var r,i,s,a={};for(s in t)s=="key"?r=t[s]:s=="ref"?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?cu.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)a[s]===void 0&&(a[s]=e.defaultProps[s]);return Oc(e,a,r,i,null)}function Oc(e,t,n,r,i){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++jw};return i==null&&vt.vnode!=null&&vt.vnode(s),s}function _a(){return{current:null}}function ut(e){return e.children}function Er(e,t){this.props=e,this.context=t}function zc(e,t){if(t==null)return e.__?zc(e.__,e.__.__k.indexOf(e)+1):null;for(var n;tt&&ta.sort(_g));rh.__r=0}function Vw(e,t,n,r,i,s,a,c,f,b){var m,w,_,A,I,C,R,$=r&&r.__k||qw,L=$.length;for(n.__k=[],m=0;m0?Oc(A.type,A.props,A.key,A.ref?A.ref:null,A.__v):A)!=null){if(A.__=n,A.__b=n.__b+1,(_=$[m])===null||_&&A.key==_.key&&A.type===_.type)$[m]=void 0;else for(w=0;w=0;t--)if((n=e.__k[t])&&(r=Zw(n)))return r}return null}function zC(e,t,n,r,i){var s;for(s in n)s==="children"||s==="key"||s in t||ih(e,s,null,n[s],r);for(s in t)i&&typeof t[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||n[s]===t[s]||ih(e,s,t[s],n[s],r)}function Qv(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||jC.test(t)?n:n+"px"}function ih(e,t,n,r,i){var s;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Qv(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Qv(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")s=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r||e.addEventListener(t,s?t1:e1,s):e.removeEventListener(t,s?t1:e1,s);else if(t!=="dangerouslySetInnerHTML"){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function e1(e){return this.l[e.type+!1](vt.event?vt.event(e):e)}function t1(e){return this.l[e.type+!0](vt.event?vt.event(e):e)}function Uy(e,t,n,r,i,s,a,c,f){var b,m,w,_,A,I,C,R,$,L,P,N,M,U,p,Z=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(f=n.__h,c=t.__e=n.__e,t.__h=null,s=[c]),(b=vt.__b)&&b(t);try{e:if(typeof Z=="function"){if(R=t.props,$=(b=Z.contextType)&&r[b.__c],L=b?$?$.props.value:b.__:r,n.__c?C=(m=t.__c=n.__c).__=m.__E:("prototype"in Z&&Z.prototype.render?t.__c=m=new Z(R,L):(t.__c=m=new Er(R,L),m.constructor=Z,m.render=qC),$&&$.sub(m),m.props=R,m.state||(m.state={}),m.context=L,m.__n=r,w=m.__d=!0,m.__h=[],m._sb=[]),m.__s==null&&(m.__s=m.state),Z.getDerivedStateFromProps!=null&&(m.__s==m.state&&(m.__s=Ps({},m.__s)),Ps(m.__s,Z.getDerivedStateFromProps(R,m.__s))),_=m.props,A=m.state,m.__v=t,w)Z.getDerivedStateFromProps==null&&m.componentWillMount!=null&&m.componentWillMount(),m.componentDidMount!=null&&m.__h.push(m.componentDidMount);else{if(Z.getDerivedStateFromProps==null&&R!==_&&m.componentWillReceiveProps!=null&&m.componentWillReceiveProps(R,L),!m.__e&&m.shouldComponentUpdate!=null&&m.shouldComponentUpdate(R,m.__s,L)===!1||t.__v===n.__v){for(t.__v!==n.__v&&(m.props=R,m.state=m.__s,m.__d=!1),m.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(J){J&&(J.__=t)}),P=0;P2&&(c.children=arguments.length>3?cu.call(arguments,2):n),Oc(e.type,c,r||e.key,i||e.ref,null)}function jy(e,t){var n={__c:t="__cC"+Hw++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,s;return this.getChildContext||(i=[],(s={})[t]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.some(function(c){c.__e=!0,xg(c)})},this.sub=function(a){i.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){i.splice(i.indexOf(a),1),c&&c.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}cu=qw.slice,vt={__e:function(e,t,n,r){for(var i,s,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(c){e=c}throw e}},jw=0,Er.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ps({},this.state),typeof e=="function"&&(e=e(Ps({},n),this.props)),e&&Ps(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),xg(this))},Er.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),xg(this))},Er.prototype.render=ut,ta=[],zw=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_g=function(e,t){return e.__v.__b-t.__v.__b},rh.__r=0,Hw=0;var Dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function So(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var s=Function.bind.apply(t,i);return new s}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var n_={exports:{}},KC="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",WC=KC,VC=WC;function r_(){}function i_(){}i_.resetWarningCache=r_;var GC=function(){function e(r,i,s,a,c,f){if(f!==VC){var b=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw b.name="Invariant Violation",b}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i_,resetWarningCache:r_};return n.PropTypes=n,n};n_.exports=GC();var YC=n_.exports;const wn=jr(YC);var Ls,pn,Fp,n1,ml=0,s_=[],Bf=[],r1=vt.__b,i1=vt.__r,s1=vt.diffed,o1=vt.__c,a1=vt.unmount;function xa(e,t){vt.__h&&vt.__h(pn,e,ml||t),ml=0;var n=pn.__H||(pn.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Bf}),n.__[e]}function It(e){return ml=1,zy(u_,e)}function zy(e,t,n){var r=xa(Ls++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):u_(void 0,t),function(c){var f=r.__N?r.__N[0]:r.__[0],b=r.t(f,c);f!==b&&(r.__N=[b,r.__[1]],r.__c.setState({}))}],r.__c=pn,!pn.u)){var i=function(c,f,b){if(!r.__c.__H)return!0;var m=r.__c.__H.__.filter(function(_){return _.__c});if(m.every(function(_){return!_.__N}))return!s||s.call(this,c,f,b);var w=!1;return m.forEach(function(_){if(_.__N){var A=_.__[0];_.__=_.__N,_.__N=void 0,A!==_.__[0]&&(w=!0)}}),!(!w&&r.__c.props===c)&&(!s||s.call(this,c,f,b))};pn.u=!0;var s=pn.shouldComponentUpdate,a=pn.componentWillUpdate;pn.componentWillUpdate=function(c,f,b){if(this.__e){var m=s;s=void 0,i(c,f,b),s=m}a&&a.call(this,c,f,b)},pn.shouldComponentUpdate=i}return r.__N||r.__}function on(e,t){var n=xa(Ls++,3);!vt.__s&&Hy(n.__H,t)&&(n.__=e,n.i=t,pn.__H.__h.push(n))}function uu(e,t){var n=xa(Ls++,4);!vt.__s&&Hy(n.__H,t)&&(n.__=e,n.i=t,pn.__h.push(n))}function sh(e){return ml=5,vl(function(){return{current:e}},[])}function o_(e,t,n){ml=6,uu(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function vl(e,t){var n=xa(Ls++,7);return Hy(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function a_(e,t){return ml=8,vl(function(){return e},t)}function Al(e){var t=pn.context[e.__c],n=xa(Ls++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(pn)),t.props.value):e.__}function l_(e,t){vt.useDebugValue&&vt.useDebugValue(t?t(e):e)}function ZC(e){var t=xa(Ls++,10),n=It();return t.__=e,pn.componentDidCatch||(pn.componentDidCatch=function(r,i){t.__&&t.__(r,i),n[1](r)}),[n[0],function(){n[1](void 0)}]}function c_(){var e=xa(Ls++,11);if(!e.__){for(var t=pn.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function JC(){for(var e;e=s_.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Lf),e.__H.__h.forEach(kg),e.__H.__h=[]}catch(t){e.__H.__h=[],vt.__e(t,e.__v)}}vt.__b=function(e){pn=null,r1&&r1(e)},vt.__r=function(e){i1&&i1(e),Ls=0;var t=(pn=e.__c).__H;t&&(Fp===pn?(t.__h=[],pn.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Bf,n.__N=n.i=void 0})):(t.__h.forEach(Lf),t.__h.forEach(kg),t.__h=[],Ls=0)),Fp=pn},vt.diffed=function(e){s1&&s1(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(s_.push(t)!==1&&n1===vt.requestAnimationFrame||((n1=vt.requestAnimationFrame)||XC)(JC)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Bf&&(n.__=n.__V),n.i=void 0,n.__V=Bf})),Fp=pn=null},vt.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Lf),n.__h=n.__h.filter(function(r){return!r.__||kg(r)})}catch(r){t.some(function(i){i.__h&&(i.__h=[])}),t=[],vt.__e(r,n.__v)}}),o1&&o1(e,t)},vt.unmount=function(e){a1&&a1(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Lf(r)}catch(i){t=i}}),n.__H=void 0,t&&vt.__e(t,n.__v))};var l1=typeof requestAnimationFrame=="function";function XC(e){var t,n=function(){clearTimeout(r),l1&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);l1&&(t=requestAnimationFrame(n))}function Lf(e){var t=pn,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),pn=t}function kg(e){var t=pn;e.__c=e.__(),pn=t}function Hy(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function u_(e,t){return typeof t=="function"?t(e):t}function f_(e,t){for(var n in t)e[n]=t[n];return e}function Sg(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Up(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function Hc(e){this.props=e}function fu(e,t){function n(i){var s=this.props.ref,a=s==i.ref;return!a&&s&&(s.call?s(null):s.current=null),t?!t(this.props,i)||!a:Sg(this.props,i)}function r(i){return this.shouldComponentUpdate=n,ft(e,i)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Hc.prototype=new Er).isPureReactComponent=!0,Hc.prototype.shouldComponentUpdate=function(e,t){return Sg(this.props,e)||Sg(this.state,t)};var c1=vt.__b;vt.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),c1&&c1(e)};var QC=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Qn(e){function t(n){var r=f_({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=QC,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var u1=function(e,t){return e==null?null:Li(Li(e).map(t))},h_={map:u1,forEach:u1,count:function(e){return e?Li(e).length:0},only:function(e){var t=Li(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Li},eT=vt.__e;vt.__e=function(e,t,n,r){if(e.then){for(var i,s=t;s=s.__;)if((i=s.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}eT(e,t,n,r)};var f1=vt.unmount;function d_(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=f_({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return d_(r,t,n)})),e}function p_(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return p_(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function Nc(){this.__u=0,this.t=null,this.__b=null}function g_(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function y_(e){var t,n,r;function i(s){if(t||(t=e()).then(function(a){n=a.default||a},function(a){r=a}),r)throw r;if(!n)throw t;return ft(n,s)}return i.displayName="Lazy",i.__f=!0,i}function ol(){this.u=null,this.o=null}vt.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),f1&&f1(e)},(Nc.prototype=new Er).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var i=g_(r.__v),s=!1,a=function(){s||(s=!0,n.__R=null,i?i(c):c())};n.__R=a;var c=function(){if(!--r.__u){if(r.state.__a){var b=r.state.__a;r.__v.__k[0]=p_(b,b.__c.__P,b.__c.__O)}var m;for(r.setState({__a:r.__b=null});m=r.t.pop();)m.forceUpdate()}},f=t.__h===!0;r.__u++||f||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},Nc.prototype.componentWillUnmount=function(){this.t=[]},Nc.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=d_(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&ft(ut,null,e.fallback);return i&&(i.__h=null),[ft(ut,null,t.__a?null:e.children),i]};var h1=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(r)}}),yl(ft(tT,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function m_(e,t){var n=ft(nT,{__v:e,i:t});return n.containerInfo=t,n}(ol.prototype=new Er).__a=function(e){var t=this,n=g_(t.__v),r=t.o.get(e);return r[0]++,function(i){var s=function(){t.props.revealOrder?(r.push(i),h1(t,e,r)):i()};n?n(s):s()}},ol.prototype.render=function(e){this.u=null,this.o=new Map;var t=Li(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ol.prototype.componentDidUpdate=ol.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){h1(e,n,t)})};var v_=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,rT=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,iT=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,sT=/[A-Z0-9]/g,oT=typeof document<"u",aT=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function b_(e,t,n){return t.__k==null&&(t.textContent=""),yl(e,t),typeof n=="function"&&n(),e?e.__c:null}function w_(e,t,n){return e_(e,t),typeof n=="function"&&n(),e?e.__c:null}Er.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Er.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var d1=vt.event;function lT(){}function cT(){return this.cancelBubble}function uT(){return this.defaultPrevented}vt.event=function(e){return d1&&(e=d1(e)),e.persist=lT,e.isPropagationStopped=cT,e.isDefaultPrevented=uT,e.nativeEvent=e};var qy,fT={enumerable:!1,configurable:!0,get:function(){return this.class}},p1=vt.vnode;vt.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,i={};for(var s in n){var a=n[s];if(!(s==="value"&&"defaultValue"in n&&a==null||oT&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&a===!0?a="":c==="ondoubleclick"?s="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||aT(n.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":iT.test(s)?s=c:r.indexOf("-")===-1&&rT.test(s)?s=s.replace(sT,"-$&").toLowerCase():a===null&&(a=void 0):c=s="oninput",c==="oninput"&&i[s=c]&&(s="oninputCapture"),i[s]=a}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Li(n.children).forEach(function(f){f.props.selected=i.value.indexOf(f.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=Li(n.children).forEach(function(f){f.props.selected=i.multiple?i.defaultValue.indexOf(f.props.value)!=-1:i.defaultValue==f.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",fT)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),t.props=i}(e),e.$$typeof=v_,p1&&p1(e)};var g1=vt.__r;vt.__r=function(e){g1&&g1(e),qy=e.__c};var y1=vt.diffed;vt.diffed=function(e){y1&&y1(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),qy=null};var __={ReactCurrentDispatcher:{current:{readContext:function(e){return qy.__n[e.__c].props.value}}}},hT="17.0.2";function x_(e){return ft.bind(null,e)}function Ky(e){return!!e&&e.$$typeof===v_}function k_(e){return Ky(e)?t_.apply(null,arguments):e}function S_(e){return!!e.__k&&(yl(null,e),!0)}function E_(e){return e&&(e.base||e.nodeType===1&&e)||null}var A_=function(e,t){return e(t)},C_=function(e,t){return e(t)},T_=ut;function Wy(e){e()}function I_(e){return e}function $_(){return[!1,Wy]}var P_=uu;function O_(e,t){var n=t(),r=It({h:{__:n,v:t}}),i=r[0].h,s=r[1];return uu(function(){i.__=n,i.v=t,Up(i.__,t())||s({h:i})},[e,n,t]),on(function(){return Up(i.__,i.v())||s({h:i}),e(function(){Up(i.__,i.v())||s({h:i})})},[e]),n}var ss={useState:It,useId:c_,useReducer:zy,useEffect:on,useLayoutEffect:uu,useInsertionEffect:P_,useTransition:$_,useDeferredValue:I_,useSyncExternalStore:O_,startTransition:Wy,useRef:sh,useImperativeHandle:o_,useMemo:vl,useCallback:a_,useContext:Al,useDebugValue:l_,version:"17.0.2",Children:h_,render:b_,hydrate:w_,unmountComponentAtNode:S_,createPortal:m_,createElement:ft,createContext:jy,createFactory:x_,cloneElement:k_,createRef:_a,Fragment:ut,isValidElement:Ky,findDOMNode:E_,Component:Er,PureComponent:Hc,memo:fu,forwardRef:Qn,flushSync:C_,unstable_batchedUpdates:A_,StrictMode:T_,Suspense:Nc,SuspenseList:ol,lazy:y_,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:__};const dT=Object.freeze(Object.defineProperty({__proto__:null,Children:h_,Component:Er,Fragment:ut,PureComponent:Hc,StrictMode:T_,Suspense:Nc,SuspenseList:ol,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:__,cloneElement:k_,createContext:jy,createElement:ft,createFactory:x_,createPortal:m_,createRef:_a,default:ss,findDOMNode:E_,flushSync:C_,forwardRef:Qn,hydrate:w_,isValidElement:Ky,lazy:y_,memo:fu,render:b_,startTransition:Wy,unmountComponentAtNode:S_,unstable_batchedUpdates:A_,useCallback:a_,useContext:Al,useDebugValue:l_,useDeferredValue:I_,useEffect:on,useErrorBoundary:ZC,useId:c_,useImperativeHandle:o_,useInsertionEffect:P_,useLayoutEffect:uu,useMemo:vl,useReducer:zy,useRef:sh,useState:It,useSyncExternalStore:O_,useTransition:$_,version:hT},Symbol.toStringTag,{value:"Module"})),pT=So(dT);function gT(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var N_=pT,yT=gT(N_);function m1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mT(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var vT=!!(typeof window<"u"&&window.document&&window.document.createElement);function bT(e,t,n){if(typeof e!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof t!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof n<"u"&&typeof n!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function r(i){return i.displayName||i.name||"Component"}return function(s){if(typeof s!="function")throw new Error("Expected WrappedComponent to be a React component.");var a=[],c;function f(){c=e(a.map(function(m){return m.props})),b.canUseDOM?t(c):n&&(c=n(c))}var b=function(m){mT(w,m);function w(){return m.apply(this,arguments)||this}w.peek=function(){return c},w.rewind=function(){if(w.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var I=c;return c=void 0,a=[],I};var _=w.prototype;return _.UNSAFE_componentWillMount=function(){a.push(this),f()},_.componentDidUpdate=function(){f()},_.componentWillUnmount=function(){var I=a.indexOf(this);a.splice(I,1),f()},_.render=function(){return yT.createElement(s,this.props)},w}(N_.PureComponent);return m1(b,"displayName","SideEffect("+r(s)+")"),m1(b,"canUseDOM",vT),b}}var wT=bT;const _T=jr(wT);var xT=typeof Element<"u",kT=typeof Map=="function",ST=typeof Set=="function",ET=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Ff(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Ff(e[r],t[r]))return!1;return!0}var s;if(kT&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(r=s.next()).done;)if(!t.has(r.value[0]))return!1;for(s=e.entries();!(r=s.next()).done;)if(!Ff(r.value[1],t.get(r.value[0])))return!1;return!0}if(ST&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(r=s.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(ET&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(xT&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!Ff(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var AT=function(t,n){try{return Ff(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const CT=jr(AT);/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var v1=Object.getOwnPropertySymbols,TT=Object.prototype.hasOwnProperty,IT=Object.prototype.propertyIsEnumerable;function $T(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function PT(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(r.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var OT=PT()?Object.assign:function(e,t){for(var n,r=$T(e),i,s=1;s=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},UT=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Eg=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n===!1?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},jT=function(t){var n=cl(t,Bt.TITLE),r=cl(t,qc.TITLE_TEMPLATE);if(r&&n)return r.replace(/%s/g,function(){return Array.isArray(n)?n.join(""):n});var i=cl(t,qc.DEFAULT_TITLE);return n||i||void 0},zT=function(t){return cl(t,qc.ON_CHANGE_CLIENT_STATE)||function(){}},jp=function(t,n){return n.filter(function(r){return typeof r[t]<"u"}).map(function(r){return r[t]}).reduce(function(r,i){return Br({},r,i)},{})},HT=function(t,n){return n.filter(function(r){return typeof r[Bt.BASE]<"u"}).map(function(r){return r[Bt.BASE]}).reverse().reduce(function(r,i){if(!r.length)for(var s=Object.keys(i),a=0;a=0;r--){var i=t[r];if(i.hasOwnProperty(n))return i[n]}return null},qT=function(t){return{baseTag:HT([_n.HREF,_n.TARGET],t),bodyAttributes:jp(ua.BODY,t),defer:cl(t,qc.DEFER),encode:cl(t,qc.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:jp(ua.HTML,t),linkTags:vc(Bt.LINK,[_n.REL,_n.HREF],t),metaTags:vc(Bt.META,[_n.NAME,_n.CHARSET,_n.HTTPEQUIV,_n.PROPERTY,_n.ITEM_PROP],t),noscriptTags:vc(Bt.NOSCRIPT,[_n.INNER_HTML],t),onChangeClientState:zT(t),scriptTags:vc(Bt.SCRIPT,[_n.SRC,_n.INNER_HTML],t),styleTags:vc(Bt.STYLE,[_n.CSS_TEXT],t),title:jT(t),titleAttributes:jp(ua.TITLE,t)}},Ag=function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){Ag(t)},0)}}(),w1=function(t){return clearTimeout(t)},KT=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Ag:global.requestAnimationFrame||Ag,WT=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||w1:global.cancelAnimationFrame||w1,VT=function(t){return console&&typeof console.warn=="function"&&console.warn(t)},bc=null,GT=function(t){bc&&WT(bc),t.defer?bc=KT(function(){_1(t,function(){bc=null})}):(_1(t),bc=null)},_1=function(t,n){var r=t.baseTag,i=t.bodyAttributes,s=t.htmlAttributes,a=t.linkTags,c=t.metaTags,f=t.noscriptTags,b=t.onChangeClientState,m=t.scriptTags,w=t.styleTags,_=t.title,A=t.titleAttributes;Cg(Bt.BODY,i),Cg(Bt.HTML,s),YT(_,A);var I={baseTag:Qa(Bt.BASE,r),linkTags:Qa(Bt.LINK,a),metaTags:Qa(Bt.META,c),noscriptTags:Qa(Bt.NOSCRIPT,f),scriptTags:Qa(Bt.SCRIPT,m),styleTags:Qa(Bt.STYLE,w)},C={},R={};Object.keys(I).forEach(function($){var L=I[$],P=L.newTags,N=L.oldTags;P.length&&(C[$]=P),N.length&&(R[$]=I[$].oldTags)}),n&&n(),b(t,C,R)},R_=function(t){return Array.isArray(t)?t.join(""):t},YT=function(t,n){typeof t<"u"&&document.title!==t&&(document.title=R_(t)),Cg(Bt.TITLE,n)},Cg=function(t,n){var r=document.getElementsByTagName(t)[0];if(r){for(var i=r.getAttribute(Bi),s=i?i.split(","):[],a=[].concat(s),c=Object.keys(n),f=0;f=0;_--)r.removeAttribute(a[_]);s.length===a.length?r.removeAttribute(Bi):r.getAttribute(Bi)!==c.join(",")&&r.setAttribute(Bi,c.join(","))}},Qa=function(t,n){var r=document.head||document.querySelector(Bt.HEAD),i=r.querySelectorAll(t+"["+Bi+"]"),s=Array.prototype.slice.call(i),a=[],c=void 0;return n&&n.length&&n.forEach(function(f){var b=document.createElement(t);for(var m in f)if(f.hasOwnProperty(m))if(m===_n.INNER_HTML)b.innerHTML=f.innerHTML;else if(m===_n.CSS_TEXT)b.styleSheet?b.styleSheet.cssText=f.cssText:b.appendChild(document.createTextNode(f.cssText));else{var w=typeof f[m]>"u"?"":f[m];b.setAttribute(m,w)}b.setAttribute(Bi,"true"),s.some(function(_,A){return c=A,b.isEqualNode(_)})?s.splice(c,1):a.push(b)}),s.forEach(function(f){return f.parentNode.removeChild(f)}),a.forEach(function(f){return r.appendChild(f)}),{oldTags:s,newTags:a}},M_=function(t){return Object.keys(t).reduce(function(n,r){var i=typeof t[r]<"u"?r+'="'+t[r]+'"':""+r;return n?n+" "+i:i},"")},ZT=function(t,n,r,i){var s=M_(r),a=R_(n);return s?"<"+t+" "+Bi+'="true" '+s+">"+Eg(a,i)+"":"<"+t+" "+Bi+'="true">'+Eg(a,i)+""},JT=function(t,n,r){return n.reduce(function(i,s){var a=Object.keys(s).filter(function(b){return!(b===_n.INNER_HTML||b===_n.CSS_TEXT)}).reduce(function(b,m){var w=typeof s[m]>"u"?m:m+'="'+Eg(s[m],r)+'"';return b?b+" "+w:w},""),c=s.innerHTML||s.cssText||"",f=MT.indexOf(t)===-1;return i+"<"+t+" "+Bi+'="true" '+a+(f?"/>":">"+c+"")},"")},D_=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,i){return r[oh[i]||i]=t[i],r},n)},XT=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(r,i){return r[RT[i]||i]=t[i],r},n)},QT=function(t,n,r){var i,s=(i={key:n},i[Bi]=!0,i),a=D_(r,s);return[ss.createElement(Bt.TITLE,a,n)]},eI=function(t,n){return n.map(function(r,i){var s,a=(s={key:i},s[Bi]=!0,s);return Object.keys(r).forEach(function(c){var f=oh[c]||c;if(f===_n.INNER_HTML||f===_n.CSS_TEXT){var b=r.innerHTML||r.cssText;a.dangerouslySetInnerHTML={__html:b}}else a[f]=r[c]}),ss.createElement(t,a)})},As=function(t,n,r){switch(t){case Bt.TITLE:return{toComponent:function(){return QT(t,n.title,n.titleAttributes)},toString:function(){return ZT(t,n.title,n.titleAttributes,r)}};case ua.BODY:case ua.HTML:return{toComponent:function(){return D_(n)},toString:function(){return M_(n)}};default:return{toComponent:function(){return eI(t,n)},toString:function(){return JT(t,n,r)}}}},B_=function(t){var n=t.baseTag,r=t.bodyAttributes,i=t.encode,s=t.htmlAttributes,a=t.linkTags,c=t.metaTags,f=t.noscriptTags,b=t.scriptTags,m=t.styleTags,w=t.title,_=w===void 0?"":w,A=t.titleAttributes;return{base:As(Bt.BASE,n,i),bodyAttributes:As(ua.BODY,r,i),htmlAttributes:As(ua.HTML,s,i),link:As(Bt.LINK,a,i),meta:As(Bt.META,c,i),noscript:As(Bt.NOSCRIPT,f,i),script:As(Bt.SCRIPT,b,i),style:As(Bt.STYLE,m,i),title:As(Bt.TITLE,{title:_,titleAttributes:A},i)}},tI=function(t){var n,r;return r=n=function(i){FT(s,i);function s(){return BT(this,s),UT(this,i.apply(this,arguments))}return s.prototype.shouldComponentUpdate=function(c){return!CT(this.props,c)},s.prototype.mapNestedChildrenToProps=function(c,f){if(!f)return null;switch(c.type){case Bt.SCRIPT:case Bt.NOSCRIPT:return{innerHTML:f};case Bt.STYLE:return{cssText:f}}throw new Error("<"+c.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},s.prototype.flattenArrayTypeChildren=function(c){var f,b=c.child,m=c.arrayTypeChildren,w=c.newChildProps,_=c.nestedChildren;return Br({},m,(f={},f[b.type]=[].concat(m[b.type]||[],[Br({},w,this.mapNestedChildrenToProps(b,_))]),f))},s.prototype.mapObjectTypeChildren=function(c){var f,b,m=c.child,w=c.newProps,_=c.newChildProps,A=c.nestedChildren;switch(m.type){case Bt.TITLE:return Br({},w,(f={},f[m.type]=A,f.titleAttributes=Br({},_),f));case Bt.BODY:return Br({},w,{bodyAttributes:Br({},_)});case Bt.HTML:return Br({},w,{htmlAttributes:Br({},_)})}return Br({},w,(b={},b[m.type]=Br({},_),b))},s.prototype.mapArrayTypeChildrenToProps=function(c,f){var b=Br({},f);return Object.keys(c).forEach(function(m){var w;b=Br({},b,(w={},w[m]=c[m],w))}),b},s.prototype.warnOnInvalidChildren=function(c,f){return!0},s.prototype.mapChildrenToProps=function(c,f){var b=this,m={};return ss.Children.forEach(c,function(w){if(!(!w||!w.props)){var _=w.props,A=_.children,I=b1(_,["children"]),C=XT(I);switch(b.warnOnInvalidChildren(w,A),w.type){case Bt.LINK:case Bt.META:case Bt.NOSCRIPT:case Bt.SCRIPT:case Bt.STYLE:m=b.flattenArrayTypeChildren({child:w,arrayTypeChildren:m,newChildProps:C,nestedChildren:A});break;default:f=b.mapObjectTypeChildren({child:w,newProps:f,newChildProps:C,nestedChildren:A});break}}}),f=this.mapArrayTypeChildrenToProps(m,f),f},s.prototype.render=function(){var c=this.props,f=c.children,b=b1(c,["children"]),m=Br({},b);return f&&(m=this.mapChildrenToProps(f,m)),ss.createElement(t,m)},LT(s,null,[{key:"canUseDOM",set:function(c){t.canUseDOM=c}}]),s}(ss.Component),n.propTypes={base:wn.object,bodyAttributes:wn.object,children:wn.oneOfType([wn.arrayOf(wn.node),wn.node]),defaultTitle:wn.string,defer:wn.bool,encodeSpecialCharacters:wn.bool,htmlAttributes:wn.object,link:wn.arrayOf(wn.object),meta:wn.arrayOf(wn.object),noscript:wn.arrayOf(wn.object),onChangeClientState:wn.func,script:wn.arrayOf(wn.object),style:wn.arrayOf(wn.object),title:wn.string,titleAttributes:wn.object,titleTemplate:wn.string},n.defaultProps={defer:!0,encodeSpecialCharacters:!0},n.peek=t.peek,n.rewind=function(){var i=t.rewind();return i||(i=B_({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),i},r},nI=function(){return null},rI=_T(qT,GT,B_)(nI),va=tI(rI);va.renderStatic=va.rewind;var iI={};function Ec(e,t){for(var n in t)e[n]=t[n];return e}function Tg(e,t,n){var r,i=/(?:\?([^#]*))?(#.*)?$/,s=e.match(i),a={};if(s&&s[1])for(var c=s[1].split("&"),f=0;ft.rank?-1:e.index-t.index}function oI(e,t){return e.index=t,e.rank=function(n){return n.props.default?0:Ig(n.props.path).map(aI).join("")}(e),e.props}function Ig(e){return e.replace(/(^\/+|\/+$)/g,"").split("/")}function aI(e){return e.charAt(0)==":"?1+"*+?".indexOf(e.charAt(e.length-1))||4:5}var lI={},fa=[],Rc=[],Jr=null,Vy={url:Gy()},L_=jy(Vy);function cI(){var e=Al(L_);if(e===Vy){var t=It()[1];on(function(){return Rc.push(t),function(){return Rc.splice(Rc.indexOf(t),1)}},[])}return[e,Lt]}function Gy(){var e;return""+((e=Jr&&Jr.location?Jr.location:Jr&&Jr.getCurrentLocation?Jr.getCurrentLocation():typeof location<"u"?location:lI).pathname||"")+(e.search||"")}function Lt(e,t){return t===void 0&&(t=!1),typeof e!="string"&&e.url&&(t=e.replace,e=e.url),function(n){for(var r=fa.length;r--;)if(fa[r].canRoute(n))return!0;return!1}(e)&&function(n,r){r===void 0&&(r="push"),Jr&&Jr[r]?Jr[r](n):typeof history<"u"&&history[r+"State"]&&history[r+"State"](null,null,n)}(e,t?"replace":"push"),F_(e)}function F_(e){for(var t=!1,n=0;n{if(this.unmounted){c==null||c();return}this.unsubscribes[r??a]=c,n(s,a,c,f)}}inject(n,r){return this.sub((i,s)=>{const a={};a[n??s]=i,this.setState(a)},r)}unsubscribe(){Object.keys(this.unsubscribes).forEach(n=>{const r=this.unsubscribes[n];r==null||r(),delete this.unsubscribes[n]})}componentWillUnmount(){this.unmounted=!0,this.unsubscribe()}}function Ac(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var G_={exports:{}};/*! + localForage -- Offline Storage, Improved + Version 1.10.0 + https://localforage.github.io/localForage + (c) 2013-2017 Mozilla, Apache License 2.0 +*/(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,i,s){function a(b,m){if(!i[b]){if(!r[b]){var w=typeof Ac=="function"&&Ac;if(!m&&w)return w(b,!0);if(c)return c(b,!0);var _=new Error("Cannot find module '"+b+"'");throw _.code="MODULE_NOT_FOUND",_}var A=i[b]={exports:{}};r[b][0].call(A.exports,function(I){var C=r[b][1][I];return a(C||I)},A,A.exports,n,r,i,s)}return i[b].exports}for(var c=typeof Ac=="function"&&Ac,f=0;f"u"&&n(3);var w=Promise;function _(q,ne){ne&&q.then(function(V){ne(null,V)},function(V){ne(V)})}function A(q,ne,V){typeof ne=="function"&&q.then(ne),typeof V=="function"&&q.catch(V)}function I(q){return typeof q!="string"&&(console.warn(q+" used as a key, but it is not a string."),q=String(q)),q}function C(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var R="local-forage-detect-blob-support",$=void 0,L={},P=Object.prototype.toString,N="readonly",M="readwrite";function U(q){for(var ne=q.length,V=new ArrayBuffer(ne),he=new Uint8Array(V),ve=0;ve=43)}}).catch(function(){return!1})}function Z(q){return typeof $=="boolean"?w.resolve($):p(q).then(function(ne){return $=ne,$})}function J(q){var ne=L[q.name],V={};V.promise=new w(function(he,ve){V.resolve=he,V.reject=ve}),ne.deferredOperations.push(V),ne.dbReady?ne.dbReady=ne.dbReady.then(function(){return V.promise}):ne.dbReady=V.promise}function ce(q){var ne=L[q.name],V=ne.deferredOperations.pop();if(V)return V.resolve(),V.promise}function me(q,ne){var V=L[q.name],he=V.deferredOperations.pop();if(he)return he.reject(ne),he.promise}function ke(q,ne){return new w(function(V,he){if(L[q.name]=L[q.name]||Fe(),q.db)if(ne)J(q),q.db.close();else return V(q.db);var ve=[q.name];ne&&ve.push(q.version);var ue=f.open.apply(f,ve);ne&&(ue.onupgradeneeded=function(Re){var We=ue.result;try{We.createObjectStore(q.storeName),Re.oldVersion<=1&&We.createObjectStore(R)}catch(Ye){if(Ye.name==="ConstraintError")console.warn('The database "'+q.name+'" has been upgraded from version '+Re.oldVersion+" to version "+Re.newVersion+', but the storage "'+q.storeName+'" already exists.');else throw Ye}}),ue.onerror=function(Re){Re.preventDefault(),he(ue.error)},ue.onsuccess=function(){var Re=ue.result;Re.onversionchange=function(We){We.target.close()},V(Re),ce(q)}})}function we(q){return ke(q,!1)}function Q(q){return ke(q,!0)}function G(q,ne){if(!q.db)return!0;var V=!q.db.objectStoreNames.contains(q.storeName),he=q.versionq.db.version;if(he&&(q.version!==ne&&console.warn('The database "'+q.name+`" can't be downgraded from version `+q.db.version+" to version "+q.version+"."),q.version=q.db.version),ve||V){if(V){var ue=q.db.version+1;ue>q.version&&(q.version=ue)}return!0}return!1}function Ae(q){return new w(function(ne,V){var he=new FileReader;he.onerror=V,he.onloadend=function(ve){var ue=btoa(ve.target.result||"");ne({__local_forage_encoded_blob:!0,data:ue,type:q.type})},he.readAsBinaryString(q)})}function Te(q){var ne=U(atob(q.data));return m([ne],{type:q.type})}function qe(q){return q&&q.__local_forage_encoded_blob}function ze(q){var ne=this,V=ne._initReady().then(function(){var he=L[ne._dbInfo.name];if(he&&he.dbReady)return he.dbReady});return A(V,q,q),V}function Qe(q){J(q);for(var ne=L[q.name],V=ne.forages,he=0;he0&&(!q.db||ue.name==="InvalidStateError"||ue.name==="NotFoundError"))return w.resolve().then(function(){if(!q.db||ue.name==="NotFoundError"&&!q.db.objectStoreNames.contains(q.storeName)&&q.version<=q.db.version)return q.db&&(q.version=q.db.version+1),Q(q)}).then(function(){return Qe(q).then(function(){nt(q,ne,V,he-1)})}).catch(V);V(ue)}}function Fe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function He(q){var ne=this,V={db:null};if(q)for(var he in q)V[he]=q[he];var ve=L[V.name];ve||(ve=Fe(),L[V.name]=ve),ve.forages.push(ne),ne._initReady||(ne._initReady=ne.ready,ne.ready=ze);var ue=[];function Re(){return w.resolve()}for(var We=0;We>4,Xe[ve++]=(Re&15)<<4|We>>2,Xe[ve++]=(We&3)<<6|Ye&63;return Ze}function yr(q){var ne=new Uint8Array(q),V="",he;for(he=0;he>2],V+=ie[(ne[he]&3)<<4|ne[he+1]>>4],V+=ie[(ne[he+1]&15)<<2|ne[he+2]>>6],V+=ie[ne[he+2]&63];return ne.length%3===2?V=V.substring(0,V.length-1)+"=":ne.length%3===1&&(V=V.substring(0,V.length-2)+"=="),V}function oi(q,ne){var V="";if(q&&(V=si.call(q)),q&&(V==="[object ArrayBuffer]"||q.buffer&&si.call(q.buffer)==="[object ArrayBuffer]")){var he,ve=je;q instanceof ArrayBuffer?(he=q,ve+=Je):(he=q.buffer,V==="[object Int8Array]"?ve+=yt:V==="[object Uint8Array]"?ve+=St:V==="[object Uint8ClampedArray]"?ve+=ot:V==="[object Int16Array]"?ve+=Ke:V==="[object Uint16Array]"?ve+=gn:V==="[object Int32Array]"?ve+=gt:V==="[object Uint32Array]"?ve+=mn:V==="[object Float32Array]"?ve+=gr:V==="[object Float64Array]"?ve+=Pn:ne(new Error("Failed to get type for BinaryArray"))),ne(ve+yr(he))}else if(V==="[object Blob]"){var ue=new FileReader;ue.onload=function(){var Re=pe+q.type+"~"+yr(this.result);ne(je+et+Re)},ue.readAsArrayBuffer(q)}else try{ne(JSON.stringify(q))}catch(Re){console.error("Couldn't convert value into a JSON string: ",q),ne(null,Re)}}function $o(q){if(q.substring(0,tt)!==je)return JSON.parse(q);var ne=q.substring(Ir),V=q.substring(tt,Ir),he;if(V===et&&_e.test(ne)){var ve=ne.match(_e);he=ve[1],ne=ne.substring(ve[0].length)}var ue=rr(ne);switch(V){case Je:return ue;case et:return m([ue],{type:he});case yt:return new Int8Array(ue);case St:return new Uint8Array(ue);case ot:return new Uint8ClampedArray(ue);case Ke:return new Int16Array(ue);case gn:return new Uint16Array(ue);case gt:return new Int32Array(ue);case mn:return new Uint32Array(ue);case gr:return new Float32Array(ue);case Pn:return new Float64Array(ue);default:throw new Error("Unkown type: "+V)}}var ai={serialize:oi,deserialize:$o,stringToBuffer:rr,bufferToString:yr};function Po(q,ne,V,he){q.executeSql("CREATE TABLE IF NOT EXISTS "+ne.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],V,he)}function Ea(q){var ne=this,V={db:null};if(q)for(var he in q)V[he]=typeof q[he]!="string"?q[he].toString():q[he];var ve=new w(function(ue,Re){try{V.db=openDatabase(V.name,String(V.version),V.description,V.size)}catch(We){return Re(We)}V.db.transaction(function(We){Po(We,V,function(){ne._dbInfo=V,ue()},function(Ye,Ze){Re(Ze)})},Re)});return V.serializer=ai,ve}function li(q,ne,V,he,ve,ue){q.executeSql(V,he,ve,function(Re,We){We.code===We.SYNTAX_ERR?Re.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[ne.storeName],function(Ye,Ze){Ze.rows.length?ue(Ye,We):Po(Ye,ne,function(){Ye.executeSql(V,he,ve,ue)},ue)},ue):ue(Re,We)},ue)}function Si(q,ne){var V=this;q=I(q);var he=new w(function(ve,ue){V.ready().then(function(){var Re=V._dbInfo;Re.db.transaction(function(We){li(We,Re,"SELECT * FROM "+Re.storeName+" WHERE key = ? LIMIT 1",[q],function(Ye,Ze){var Xe=Ze.rows.length?Ze.rows.item(0).value:null;Xe&&(Xe=Re.serializer.deserialize(Xe)),ve(Xe)},function(Ye,Ze){ue(Ze)})})}).catch(ue)});return _(he,ne),he}function Hi(q,ne){var V=this,he=new w(function(ve,ue){V.ready().then(function(){var Re=V._dbInfo;Re.db.transaction(function(We){li(We,Re,"SELECT * FROM "+Re.storeName,[],function(Ye,Ze){for(var Xe=Ze.rows,ht=Xe.length,xt=0;xt0){Re(Oo.apply(ve,[q,Ye,V,he-1]));return}We(xt)}})})}).catch(We)});return _(ue,V),ue}function Aa(q,ne,V){return Oo.apply(this,[q,ne,V,1])}function ir(q,ne){var V=this;q=I(q);var he=new w(function(ve,ue){V.ready().then(function(){var Re=V._dbInfo;Re.db.transaction(function(We){li(We,Re,"DELETE FROM "+Re.storeName+" WHERE key = ?",[q],function(){ve()},function(Ye,Ze){ue(Ze)})})}).catch(ue)});return _(he,ne),he}function Gn(q){var ne=this,V=new w(function(he,ve){ne.ready().then(function(){var ue=ne._dbInfo;ue.db.transaction(function(Re){li(Re,ue,"DELETE FROM "+ue.storeName,[],function(){he()},function(We,Ye){ve(Ye)})})}).catch(ve)});return _(V,q),V}function qs(q){var ne=this,V=new w(function(he,ve){ne.ready().then(function(){var ue=ne._dbInfo;ue.db.transaction(function(Re){li(Re,ue,"SELECT COUNT(key) as c FROM "+ue.storeName,[],function(We,Ye){var Ze=Ye.rows.item(0).c;he(Ze)},function(We,Ye){ve(Ye)})})}).catch(ve)});return _(V,q),V}function jl(q,ne){var V=this,he=new w(function(ve,ue){V.ready().then(function(){var Re=V._dbInfo;Re.db.transaction(function(We){li(We,Re,"SELECT key FROM "+Re.storeName+" WHERE id = ? LIMIT 1",[q+1],function(Ye,Ze){var Xe=Ze.rows.length?Ze.rows.item(0).key:null;ve(Xe)},function(Ye,Ze){ue(Ze)})})}).catch(ue)});return _(he,ne),he}function Ca(q){var ne=this,V=new w(function(he,ve){ne.ready().then(function(){var ue=ne._dbInfo;ue.db.transaction(function(Re){li(Re,ue,"SELECT key FROM "+ue.storeName,[],function(We,Ye){for(var Ze=[],Xe=0;Xe '__WebKitDatabaseInfoTable__'",[],function(ve,ue){for(var Re=[],We=0;We0}function ql(q){var ne=this,V={};if(q)for(var he in q)V[he]=q[he];return V.keyPrefix=hs(q,ne._defaultConfig),Hl()?(ne._dbInfo=V,V.serializer=ai,w.resolve()):w.reject()}function Ia(q){var ne=this,V=ne.ready().then(function(){for(var he=ne._dbInfo.keyPrefix,ve=localStorage.length-1;ve>=0;ve--){var ue=localStorage.key(ve);ue.indexOf(he)===0&&localStorage.removeItem(ue)}});return _(V,q),V}function Kl(q,ne){var V=this;q=I(q);var he=V.ready().then(function(){var ve=V._dbInfo,ue=localStorage.getItem(ve.keyPrefix+q);return ue&&(ue=ve.serializer.deserialize(ue)),ue});return _(he,ne),he}function Wl(q,ne){var V=this,he=V.ready().then(function(){for(var ve=V._dbInfo,ue=ve.keyPrefix,Re=ue.length,We=localStorage.length,Ye=1,Ze=0;Ze=0;Re--){var We=localStorage.key(Re);We.indexOf(ue)===0&&localStorage.removeItem(We)}}):ve=w.reject("Invalid arguments"),_(ve,ne),ve}var Ks={_driver:"localStorageWrapper",_initStorage:ql,_support:fs(),iterate:Wl,getItem:Kl,setItem:No,removeItem:Oa,clear:Ia,length:Ki,key:$a,keys:Pa,dropInstance:Ro},Na=function(ne,V){return ne===V||typeof ne=="number"&&typeof V=="number"&&isNaN(ne)&&isNaN(V)},Ws=function(ne,V){for(var he=ne.length,ve=0;ve"u"?"undefined":s(V))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var he in V){if(he==="storeName"&&(V[he]=V[he].replace(/\W/g,"_")),he==="version"&&typeof V[he]!="number")return new Error("Database version must be a number.");this._config[he]=V[he]}return"driver"in V&&V.driver?this.setDriver(this._config.driver):!0}else return typeof V=="string"?this._config[V]:this._config},q.prototype.defineDriver=function(V,he,ve){var ue=new w(function(Re,We){try{var Ye=V._driver,Ze=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!V._driver){We(Ze);return}for(var Xe=Vi.concat("_initStorage"),ht=0,xt=Xe.length;ht + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ah.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",b=500,m="__lodash_placeholder__",w=1,_=2,A=4,I=1,C=2,R=1,$=2,L=4,P=8,N=16,M=32,U=64,p=128,Z=256,J=512,ce=30,me="...",ke=800,we=16,Q=1,G=2,Ae=3,Te=1/0,qe=9007199254740991,ze=17976931348623157e292,Qe=0/0,nt=4294967295,Fe=nt-1,He=nt>>>1,$e=[["ary",p],["bind",R],["bindKey",$],["curry",P],["curryRight",N],["flip",J],["partial",M],["partialRight",U],["rearg",Z]],Me="[object Arguments]",fe="[object Array]",pt="[object AsyncFunction]",h="[object Boolean]",v="[object Date]",k="[object DOMException]",T="[object Error]",O="[object Function]",z="[object GeneratorFunction]",te="[object Map]",ie="[object Number]",pe="[object Null]",_e="[object Object]",je="[object Promise]",tt="[object Proxy]",Je="[object RegExp]",et="[object Set]",yt="[object String]",St="[object Symbol]",ot="[object Undefined]",Ke="[object WeakMap]",gt="[object WeakSet]",gn="[object ArrayBuffer]",mn="[object DataView]",gr="[object Float32Array]",Pn="[object Float64Array]",Ir="[object Int8Array]",si="[object Int16Array]",rr="[object Int32Array]",yr="[object Uint8Array]",oi="[object Uint8ClampedArray]",$o="[object Uint16Array]",ai="[object Uint32Array]",Po=/\b__p \+= '';/g,Ea=/\b(__p \+=) '' \+/g,li=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Si=/&(?:amp|lt|gt|quot|#39);/g,Hi=/[&<>"']/g,Oo=RegExp(Si.source),Aa=RegExp(Hi.source),ir=/<%-([\s\S]+?)%>/g,Gn=/<%([\s\S]+?)%>/g,qs=/<%=([\s\S]+?)%>/g,jl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ca=/^\w*$/,Ta=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ci=/[\\^$.*+?()[\]{}|]/g,qi=RegExp(ci.source),fs=/^\s+/,hs=/\s/,zl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Hl=/\{\n\/\* \[wrapped with (.+)\] \*/,ql=/,? & /,Ia=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Kl=/[()=,{}\[\]\/\s]/,Wl=/\\(\\)?/g,$a=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Pa=/\w*$/,Ki=/^[-+]0x[0-9a-f]+$/i,Oa=/^0b[01]+$/i,No=/^\[object .+?Constructor\]$/,Ro=/^0o[0-7]+$/i,Ks=/^(?:0|[1-9]\d*)$/,Na=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ws=/($^)/,Wi=/['\n\r\u2028\u2029\\]/g,zr="\\ud800-\\udfff",Mo="\\u0300-\\u036f",Ei="\\ufe20-\\ufe2f",Ra="\\u20d0-\\u20ff",ds=Mo+Ei+Ra,Vi="\\u2700-\\u27bf",Ma="a-z\\xdf-\\xf6\\xf8-\\xff",Vl="\\xac\\xb1\\xd7\\xf7",Vs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Da="\\u2000-\\u206f",Do=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",q="A-Z\\xc0-\\xd6\\xd8-\\xde",ne="\\ufe0e\\ufe0f",V=Vl+Vs+Da+Do,he="['’]",ve="["+zr+"]",ue="["+V+"]",Re="["+ds+"]",We="\\d+",Ye="["+Vi+"]",Ze="["+Ma+"]",Xe="[^"+zr+V+We+Vi+Ma+q+"]",ht="\\ud83c[\\udffb-\\udfff]",xt="(?:"+Re+"|"+ht+")",Jt="[^"+zr+"]",qt="(?:\\ud83c[\\udde6-\\uddff]){2}",yn="[\\ud800-\\udbff][\\udc00-\\udfff]",tn="["+q+"]",Sn="\\u200d",sr="(?:"+Ze+"|"+Xe+")",ps="(?:"+tn+"|"+Xe+")",Ba="(?:"+he+"(?:d|ll|m|re|s|t|ve))?",ui="(?:"+he+"(?:D|LL|M|RE|S|T|VE))?",La=xt+"?",Gs="["+ne+"]?",Fa="(?:"+Sn+"(?:"+[Jt,qt,yn].join("|")+")"+Gs+La+")*",Bo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Gl=Gs+La+Fa,Od="(?:"+[Ye,qt,yn].join("|")+")"+Gl,Nd="(?:"+[Jt+Re+"?",Re,qt,yn,ve].join("|")+")",Yl=RegExp(he,"g"),Rd=RegExp(Re,"g"),Zl=RegExp(ht+"(?="+ht+")|"+Nd+Gl,"g"),Md=RegExp([tn+"?"+Ze+"+"+Ba+"(?="+[ue,tn,"$"].join("|")+")",ps+"+"+ui+"(?="+[ue,tn+sr,"$"].join("|")+")",tn+"?"+sr+"+"+Ba,tn+"+"+ui,Pd,Bo,We,Od].join("|"),"g"),Dd=RegExp("["+Sn+zr+ds+ne+"]"),Bd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ld=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Fd=-1,ln={};ln[gr]=ln[Pn]=ln[Ir]=ln[si]=ln[rr]=ln[yr]=ln[oi]=ln[$o]=ln[ai]=!0,ln[Me]=ln[fe]=ln[gn]=ln[h]=ln[mn]=ln[v]=ln[T]=ln[O]=ln[te]=ln[ie]=ln[_e]=ln[Je]=ln[et]=ln[yt]=ln[Ke]=!1;var nn={};nn[Me]=nn[fe]=nn[gn]=nn[mn]=nn[h]=nn[v]=nn[gr]=nn[Pn]=nn[Ir]=nn[si]=nn[rr]=nn[te]=nn[ie]=nn[_e]=nn[Je]=nn[et]=nn[yt]=nn[St]=nn[yr]=nn[oi]=nn[$o]=nn[ai]=!0,nn[T]=nn[O]=nn[Ke]=!1;var Eu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Jl={"&":"&","<":"<",">":">",'"':""","'":"'"},Au={"&":"&","<":"<",">":">",""":'"',"'":"'"},Cu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xl=parseFloat,Ud=parseInt,Tu=typeof Dn=="object"&&Dn&&Dn.Object===Object&&Dn,jd=typeof self=="object"&&self&&self.Object===Object&&self,En=Tu||jd||Function("return this")(),Ua=t&&!t.nodeType&&t,Ai=Ua&&!0&&e&&!e.nodeType&&e,Iu=Ai&&Ai.exports===Ua,Ql=Iu&&Tu.process,$r=function(){try{var W=Ai&&Ai.require&&Ai.require("util").types;return W||Ql&&Ql.binding&&Ql.binding("util")}catch{}}(),u=$r&&$r.isArrayBuffer,y=$r&&$r.isDate,x=$r&&$r.isMap,E=$r&&$r.isRegExp,D=$r&&$r.isSet,B=$r&&$r.isTypedArray;function j(W,oe,se){switch(se.length){case 0:return W.call(oe);case 1:return W.call(oe,se[0]);case 2:return W.call(oe,se[0],se[1]);case 3:return W.call(oe,se[0],se[1],se[2])}return W.apply(oe,se)}function re(W,oe,se,Ne){for(var Be=-1,lt=W==null?0:W.length;++Be-1}function Ge(W,oe,se){for(var Ne=-1,Be=W==null?0:W.length;++Ne-1;);return se}function jo(W,oe){for(var se=W.length;se--&&sn(oe,W[se],0)>-1;);return se}function qr(W,oe){for(var se=W.length,Ne=0;se--;)W[se]===oe&&++Ne;return Ne}var Ys=Pr(Eu),zd=Pr(Jl);function Hd(W){return"\\"+Cu[W]}function $u(W,oe){return W==null?n:W[oe]}function Or(W){return Dd.test(W)}function tc(W){return Bd.test(W)}function Zi(W){for(var oe,se=[];!(oe=W.next()).done;)se.push(oe.value);return se}function za(W){var oe=-1,se=Array(W.size);return W.forEach(function(Ne,Be){se[++oe]=[Be,Ne]}),se}function zo(W,oe){return function(se){return W(oe(se))}}function Kr(W,oe){for(var se=-1,Ne=W.length,Be=0,lt=[];++se-1}function u3(o,l){var g=this.__data__,S=qu(g,o);return S<0?(++this.size,g.push([o,l])):g[S][1]=l,this}ms.prototype.clear=o3,ms.prototype.delete=a3,ms.prototype.get=l3,ms.prototype.has=c3,ms.prototype.set=u3;function vs(o){var l=-1,g=o==null?0:o.length;for(this.clear();++l=l?o:l)),o}function gi(o,l,g,S,F,K){var ee,ae=l&w,be=l&_,Le=l&A;if(g&&(ee=F?g(o,S,F,K):g(o)),ee!==n)return ee;if(!Cn(o))return o;var Ue=Dt(o);if(Ue){if(ee=pS(o),!ae)return Nr(o,ee)}else{var Ve=lr(o),it=Ve==O||Ve==z;if(to(o))return H0(o,ae);if(Ve==_e||Ve==Me||it&&!F){if(ee=be||it?{}:lv(o),!ae)return be?rS(o,A3(ee,o)):nS(o,b0(ee,o))}else{if(!nn[Ve])return F?o:{};ee=gS(o,Ve,ae)}}K||(K=new $i);var mt=K.get(o);if(mt)return mt;K.set(o,ee),Bv(o)?o.forEach(function(At){ee.add(gi(At,l,g,At,o,K))}):Mv(o)&&o.forEach(function(At,Yt){ee.set(Yt,gi(At,l,g,Yt,o,K))});var Et=Le?be?gp:pp:be?Mr:Zn,zt=Ue?n:Et(o);return X(zt||o,function(At,Yt){zt&&(Yt=At,At=o[Yt]),cc(ee,Yt,gi(At,l,g,Yt,o,K))}),ee}function C3(o){var l=Zn(o);return function(g){return w0(g,o,l)}}function w0(o,l,g){var S=g.length;if(o==null)return!S;for(o=st(o);S--;){var F=g[S],K=l[F],ee=o[F];if(ee===n&&!(F in o)||!K(ee))return!1}return!0}function _0(o,l,g){if(typeof o!="function")throw new Kt(a);return yc(function(){o.apply(n,g)},l)}function uc(o,l,g,S){var F=-1,K=Ee,ee=!0,ae=o.length,be=[],Le=l.length;if(!ae)return be;g&&(l=at(l,mr(g))),S?(K=Ge,ee=!1):l.length>=i&&(K=Uo,ee=!1,l=new Ko(l));e:for(;++FF?0:F+g),S=S===n||S>F?F:jt(S),S<0&&(S+=F),S=g>S?0:Fv(S);g0&&g(ae)?l>1?tr(ae,l-1,g,S,F):Mt(F,ae):S||(F[F.length]=ae)}return F}var Zd=Y0(),S0=Y0(!0);function Xi(o,l){return o&&Zd(o,l,Zn)}function Jd(o,l){return o&&S0(o,l,Zn)}function Wu(o,l){return Oe(l,function(g){return ks(o[g])})}function Vo(o,l){l=Qs(l,o);for(var g=0,S=l.length;o!=null&&gl}function $3(o,l){return o!=null&&Ot.call(o,l)}function P3(o,l){return o!=null&&l in st(o)}function O3(o,l,g){return o>=ar(l,g)&&o=120&&Ue.length>=120)?new Ko(ee&&Ue):n}Ue=o[0];var Ve=-1,it=ae[0];e:for(;++Ve-1;)ae!==o&&Bu.call(ae,be,1),Bu.call(o,be,1);return o}function M0(o,l){for(var g=o?l.length:0,S=g-1;g--;){var F=l[g];if(g==S||F!==K){var K=F;xs(F)?Bu.call(o,F,1):ap(o,F)}}return o}function ip(o,l){return o+Uu(g0()*(l-o+1))}function K3(o,l,g,S){for(var F=-1,K=Hn(Fu((l-o)/(g||1)),0),ee=se(K);K--;)ee[S?K:++F]=o,o+=g;return ee}function sp(o,l){var g="";if(!o||l<1||l>qe)return g;do l%2&&(g+=o),l=Uu(l/2),l&&(o+=o);while(l);return g}function Wt(o,l){return xp(fv(o,l,Dr),o+"")}function W3(o){return v0(Ja(o))}function V3(o,l){var g=Ja(o);return rf(g,Wo(l,0,g.length))}function dc(o,l,g,S){if(!Cn(o))return o;l=Qs(l,o);for(var F=-1,K=l.length,ee=K-1,ae=o;ae!=null&&++FF?0:F+l),g=g>F?F:g,g<0&&(g+=F),F=l>g?0:g-l>>>0,l>>>=0;for(var K=se(F);++S>>1,ee=o[K];ee!==null&&!Vr(ee)&&(g?ee<=l:ee=i){var Le=l?null:aS(o);if(Le)return ys(Le);ee=!1,F=Uo,be=new Ko}else be=l?[]:ae;e:for(;++S=S?o:yi(o,l,g)}var z0=Lk||function(o){return En.clearTimeout(o)};function H0(o,l){if(l)return o.slice();var g=o.length,S=u0?u0(g):new o.constructor(g);return o.copy(S),S}function fp(o){var l=new o.constructor(o.byteLength);return new Mu(l).set(new Mu(o)),l}function X3(o,l){var g=l?fp(o.buffer):o.buffer;return new o.constructor(g,o.byteOffset,o.byteLength)}function Q3(o){var l=new o.constructor(o.source,Pa.exec(o));return l.lastIndex=o.lastIndex,l}function eS(o){return lc?st(lc.call(o)):{}}function q0(o,l){var g=l?fp(o.buffer):o.buffer;return new o.constructor(g,o.byteOffset,o.length)}function K0(o,l){if(o!==l){var g=o!==n,S=o===null,F=o===o,K=Vr(o),ee=l!==n,ae=l===null,be=l===l,Le=Vr(l);if(!ae&&!Le&&!K&&o>l||K&&ee&&be&&!ae&&!Le||S&&ee&&be||!g&&be||!F)return 1;if(!S&&!K&&!Le&&o=ae)return be;var Le=g[S];return be*(Le=="desc"?-1:1)}}return o.index-l.index}function W0(o,l,g,S){for(var F=-1,K=o.length,ee=g.length,ae=-1,be=l.length,Le=Hn(K-ee,0),Ue=se(be+Le),Ve=!S;++ae1?g[F-1]:n,ee=F>2?g[2]:n;for(K=o.length>3&&typeof K=="function"?(F--,K):n,ee&&_r(g[0],g[1],ee)&&(K=F<3?n:K,F=1),l=st(l);++S-1?F[K?l[ee]:ee]:n}}function X0(o){return _s(function(l){var g=l.length,S=g,F=pi.prototype.thru;for(o&&l.reverse();S--;){var K=l[S];if(typeof K!="function")throw new Kt(a);if(F&&!ee&&tf(K)=="wrapper")var ee=new pi([],!0)}for(S=ee?S:g;++S1&&Qt.reverse(),Ue&&beae))return!1;var Le=K.get(o),Ue=K.get(l);if(Le&&Ue)return Le==l&&Ue==o;var Ve=-1,it=!0,mt=g&C?new Ko:n;for(K.set(o,l),K.set(l,o);++Ve1?"& ":"")+l[S],l=l.join(g>2?", ":" "),o.replace(zl,`{ +/* [wrapped with `+l+`] */ +`)}function mS(o){return Dt(o)||Zo(o)||!!(d0&&o&&o[d0])}function xs(o,l){var g=typeof o;return l=l??qe,!!l&&(g=="number"||g!="symbol"&&Ks.test(o))&&o>-1&&o%1==0&&o0){if(++l>=ke)return arguments[0]}else l=0;return o.apply(n,arguments)}}function rf(o,l){var g=-1,S=o.length,F=S-1;for(l=l===n?S:l;++g1?o[l-1]:n;return g=typeof g=="function"?(o.pop(),g):n,kv(o,g)});function Sv(o){var l=H(o);return l.__chain__=!0,l}function TE(o,l){return l(o),o}function sf(o,l){return l(o)}var IE=_s(function(o){var l=o.length,g=l?o[0]:0,S=this.__wrapped__,F=function(K){return Yd(K,o)};return l>1||this.__actions__.length||!(S instanceof Xt)||!xs(g)?this.thru(F):(S=S.slice(g,+g+(l?1:0)),S.__actions__.push({func:sf,args:[F],thisArg:n}),new pi(S,this.__chain__).thru(function(K){return l&&!K.length&&K.push(n),K}))});function $E(){return Sv(this)}function PE(){return new pi(this.value(),this.__chain__)}function OE(){this.__values__===n&&(this.__values__=Lv(this.value()));var o=this.__index__>=this.__values__.length,l=o?n:this.__values__[this.__index__++];return{done:o,value:l}}function NE(){return this}function RE(o){for(var l,g=this;g instanceof Hu;){var S=mv(g);S.__index__=0,S.__values__=n,l?F.__wrapped__=S:l=S;var F=S;g=g.__wrapped__}return F.__wrapped__=o,l}function ME(){var o=this.__wrapped__;if(o instanceof Xt){var l=o;return this.__actions__.length&&(l=new Xt(this)),l=l.reverse(),l.__actions__.push({func:sf,args:[kp],thisArg:n}),new pi(l,this.__chain__)}return this.thru(kp)}function DE(){return U0(this.__wrapped__,this.__actions__)}var BE=Zu(function(o,l,g){Ot.call(o,g)?++o[g]:bs(o,g,1)});function LE(o,l,g){var S=Dt(o)?Ie:T3;return g&&_r(o,l,g)&&(l=n),S(o,kt(l,3))}function FE(o,l){var g=Dt(o)?Oe:k0;return g(o,kt(l,3))}var UE=J0(vv),jE=J0(bv);function zE(o,l){return tr(of(o,l),1)}function HE(o,l){return tr(of(o,l),Te)}function qE(o,l,g){return g=g===n?1:jt(g),tr(of(o,l),g)}function Ev(o,l){var g=Dt(o)?X:Js;return g(o,kt(l,3))}function Av(o,l){var g=Dt(o)?ge:x0;return g(o,kt(l,3))}var KE=Zu(function(o,l,g){Ot.call(o,g)?o[g].push(l):bs(o,g,[l])});function WE(o,l,g,S){o=Rr(o)?o:Ja(o),g=g&&!S?jt(g):0;var F=o.length;return g<0&&(g=Hn(F+g,0)),ff(o)?g<=F&&o.indexOf(l,g)>-1:!!F&&sn(o,l,g)>-1}var VE=Wt(function(o,l,g){var S=-1,F=typeof l=="function",K=Rr(o)?se(o.length):[];return Js(o,function(ee){K[++S]=F?j(l,ee,g):fc(ee,l,g)}),K}),GE=Zu(function(o,l,g){bs(o,g,l)});function of(o,l){var g=Dt(o)?at:I0;return g(o,kt(l,3))}function YE(o,l,g,S){return o==null?[]:(Dt(l)||(l=l==null?[]:[l]),g=S?n:g,Dt(g)||(g=g==null?[]:[g]),N0(o,l,g))}var ZE=Zu(function(o,l,g){o[g?0:1].push(l)},function(){return[[],[]]});function JE(o,l,g){var S=Dt(o)?Rt:Ci,F=arguments.length<3;return S(o,kt(l,4),g,F,Js)}function XE(o,l,g){var S=Dt(o)?Un:Ci,F=arguments.length<3;return S(o,kt(l,4),g,F,x0)}function QE(o,l){var g=Dt(o)?Oe:k0;return g(o,cf(kt(l,3)))}function eA(o){var l=Dt(o)?v0:W3;return l(o)}function tA(o,l,g){(g?_r(o,l,g):l===n)?l=1:l=jt(l);var S=Dt(o)?k3:V3;return S(o,l)}function nA(o){var l=Dt(o)?S3:Y3;return l(o)}function rA(o){if(o==null)return 0;if(Rr(o))return ff(o)?Ji(o):o.length;var l=lr(o);return l==te||l==et?o.size:tp(o).length}function iA(o,l,g){var S=Dt(o)?An:Z3;return g&&_r(o,l,g)&&(l=n),S(o,kt(l,3))}var sA=Wt(function(o,l){if(o==null)return[];var g=l.length;return g>1&&_r(o,l[0],l[1])?l=[]:g>2&&_r(l[0],l[1],l[2])&&(l=[l[0]]),N0(o,tr(l,1),[])}),af=Fk||function(){return En.Date.now()};function oA(o,l){if(typeof l!="function")throw new Kt(a);return o=jt(o),function(){if(--o<1)return l.apply(this,arguments)}}function Cv(o,l,g){return l=g?n:l,l=o&&l==null?o.length:l,ws(o,p,n,n,n,n,l)}function Tv(o,l){var g;if(typeof l!="function")throw new Kt(a);return o=jt(o),function(){return--o>0&&(g=l.apply(this,arguments)),o<=1&&(l=n),g}}var Ep=Wt(function(o,l,g){var S=R;if(g.length){var F=Kr(g,Ya(Ep));S|=M}return ws(o,S,l,g,F)}),Iv=Wt(function(o,l,g){var S=R|$;if(g.length){var F=Kr(g,Ya(Iv));S|=M}return ws(l,S,o,g,F)});function $v(o,l,g){l=g?n:l;var S=ws(o,P,n,n,n,n,n,l);return S.placeholder=$v.placeholder,S}function Pv(o,l,g){l=g?n:l;var S=ws(o,N,n,n,n,n,n,l);return S.placeholder=Pv.placeholder,S}function Ov(o,l,g){var S,F,K,ee,ae,be,Le=0,Ue=!1,Ve=!1,it=!0;if(typeof o!="function")throw new Kt(a);l=vi(l)||0,Cn(g)&&(Ue=!!g.leading,Ve="maxWait"in g,K=Ve?Hn(vi(g.maxWait)||0,l):K,it="trailing"in g?!!g.trailing:it);function mt(Mn){var Oi=S,Es=F;return S=F=n,Le=Mn,ee=o.apply(Es,Oi),ee}function Et(Mn){return Le=Mn,ae=yc(Yt,l),Ue?mt(Mn):ee}function zt(Mn){var Oi=Mn-be,Es=Mn-Le,Jv=l-Oi;return Ve?ar(Jv,K-Es):Jv}function At(Mn){var Oi=Mn-be,Es=Mn-Le;return be===n||Oi>=l||Oi<0||Ve&&Es>=K}function Yt(){var Mn=af();if(At(Mn))return Qt(Mn);ae=yc(Yt,zt(Mn))}function Qt(Mn){return ae=n,it&&S?mt(Mn):(S=F=n,ee)}function Gr(){ae!==n&&z0(ae),Le=0,S=be=F=ae=n}function xr(){return ae===n?ee:Qt(af())}function Yr(){var Mn=af(),Oi=At(Mn);if(S=arguments,F=this,be=Mn,Oi){if(ae===n)return Et(be);if(Ve)return z0(ae),ae=yc(Yt,l),mt(be)}return ae===n&&(ae=yc(Yt,l)),ee}return Yr.cancel=Gr,Yr.flush=xr,Yr}var aA=Wt(function(o,l){return _0(o,1,l)}),lA=Wt(function(o,l,g){return _0(o,vi(l)||0,g)});function cA(o){return ws(o,J)}function lf(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new Kt(a);var g=function(){var S=arguments,F=l?l.apply(this,S):S[0],K=g.cache;if(K.has(F))return K.get(F);var ee=o.apply(this,S);return g.cache=K.set(F,ee)||K,ee};return g.cache=new(lf.Cache||vs),g}lf.Cache=vs;function cf(o){if(typeof o!="function")throw new Kt(a);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function uA(o){return Tv(2,o)}var fA=J3(function(o,l){l=l.length==1&&Dt(l[0])?at(l[0],mr(kt())):at(tr(l,1),mr(kt()));var g=l.length;return Wt(function(S){for(var F=-1,K=ar(S.length,g);++F=l}),Zo=A0(function(){return arguments}())?A0:function(o){return On(o)&&Ot.call(o,"callee")&&!h0.call(o,"callee")},Dt=se.isArray,AA=u?mr(u):R3;function Rr(o){return o!=null&&uf(o.length)&&!ks(o)}function Rn(o){return On(o)&&Rr(o)}function CA(o){return o===!0||o===!1||On(o)&&wr(o)==h}var to=jk||Bp,TA=y?mr(y):M3;function IA(o){return On(o)&&o.nodeType===1&&!mc(o)}function $A(o){if(o==null)return!0;if(Rr(o)&&(Dt(o)||typeof o=="string"||typeof o.splice=="function"||to(o)||Za(o)||Zo(o)))return!o.length;var l=lr(o);if(l==te||l==et)return!o.size;if(gc(o))return!tp(o).length;for(var g in o)if(Ot.call(o,g))return!1;return!0}function PA(o,l){return hc(o,l)}function OA(o,l,g){g=typeof g=="function"?g:n;var S=g?g(o,l):n;return S===n?hc(o,l,n,g):!!S}function Cp(o){if(!On(o))return!1;var l=wr(o);return l==T||l==k||typeof o.message=="string"&&typeof o.name=="string"&&!mc(o)}function NA(o){return typeof o=="number"&&p0(o)}function ks(o){if(!Cn(o))return!1;var l=wr(o);return l==O||l==z||l==pt||l==tt}function Rv(o){return typeof o=="number"&&o==jt(o)}function uf(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=qe}function Cn(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function On(o){return o!=null&&typeof o=="object"}var Mv=x?mr(x):B3;function RA(o,l){return o===l||ep(o,l,mp(l))}function MA(o,l,g){return g=typeof g=="function"?g:n,ep(o,l,mp(l),g)}function DA(o){return Dv(o)&&o!=+o}function BA(o){if(wS(o))throw new Be(s);return C0(o)}function LA(o){return o===null}function FA(o){return o==null}function Dv(o){return typeof o=="number"||On(o)&&wr(o)==ie}function mc(o){if(!On(o)||wr(o)!=_e)return!1;var l=Du(o);if(l===null)return!0;var g=Ot.call(l,"constructor")&&l.constructor;return typeof g=="function"&&g instanceof g&&Ii.call(g)==Mk}var Tp=E?mr(E):L3;function UA(o){return Rv(o)&&o>=-qe&&o<=qe}var Bv=D?mr(D):F3;function ff(o){return typeof o=="string"||!Dt(o)&&On(o)&&wr(o)==yt}function Vr(o){return typeof o=="symbol"||On(o)&&wr(o)==St}var Za=B?mr(B):U3;function jA(o){return o===n}function zA(o){return On(o)&&lr(o)==Ke}function HA(o){return On(o)&&wr(o)==gt}var qA=ef(np),KA=ef(function(o,l){return o<=l});function Lv(o){if(!o)return[];if(Rr(o))return ff(o)?vr(o):Nr(o);if(ic&&o[ic])return Zi(o[ic]());var l=lr(o),g=l==te?za:l==et?ys:Ja;return g(o)}function Ss(o){if(!o)return o===0?o:0;if(o=vi(o),o===Te||o===-Te){var l=o<0?-1:1;return l*ze}return o===o?o:0}function jt(o){var l=Ss(o),g=l%1;return l===l?g?l-g:l:0}function Fv(o){return o?Wo(jt(o),0,nt):0}function vi(o){if(typeof o=="number")return o;if(Vr(o))return Qe;if(Cn(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=Cn(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=di(o);var g=Oa.test(o);return g||Ro.test(o)?Ud(o.slice(2),g?2:8):Ki.test(o)?Qe:+o}function Uv(o){return Qi(o,Mr(o))}function WA(o){return o?Wo(jt(o),-qe,qe):o===0?o:0}function rn(o){return o==null?"":Wr(o)}var VA=Va(function(o,l){if(gc(l)||Rr(l)){Qi(l,Zn(l),o);return}for(var g in l)Ot.call(l,g)&&cc(o,g,l[g])}),jv=Va(function(o,l){Qi(l,Mr(l),o)}),hf=Va(function(o,l,g,S){Qi(l,Mr(l),o,S)}),GA=Va(function(o,l,g,S){Qi(l,Zn(l),o,S)}),YA=_s(Yd);function ZA(o,l){var g=Wa(o);return l==null?g:b0(g,l)}var JA=Wt(function(o,l){o=st(o);var g=-1,S=l.length,F=S>2?l[2]:n;for(F&&_r(l[0],l[1],F)&&(S=1);++g1),K}),Qi(o,gp(o),g),S&&(g=gi(g,w|_|A,lS));for(var F=l.length;F--;)ap(g,l[F]);return g});function g4(o,l){return Hv(o,cf(kt(l)))}var y4=_s(function(o,l){return o==null?{}:H3(o,l)});function Hv(o,l){if(o==null)return{};var g=at(gp(o),function(S){return[S]});return l=kt(l),R0(o,g,function(S,F){return l(S,F[0])})}function m4(o,l,g){l=Qs(l,o);var S=-1,F=l.length;for(F||(F=1,o=n);++Sl){var S=o;o=l,l=S}if(g||o%1||l%1){var F=g0();return ar(o+F*(l-o+Xl("1e-"+((F+"").length-1))),l)}return ip(o,l)}var T4=Ga(function(o,l,g){return l=l.toLowerCase(),o+(g?Wv(l):l)});function Wv(o){return Pp(rn(o).toLowerCase())}function Vv(o){return o=rn(o),o&&o.replace(Na,Ys).replace(Rd,"")}function I4(o,l,g){o=rn(o),l=Wr(l);var S=o.length;g=g===n?S:Wo(jt(g),0,S);var F=g;return g-=l.length,g>=0&&o.slice(g,F)==l}function $4(o){return o=rn(o),o&&Aa.test(o)?o.replace(Hi,zd):o}function P4(o){return o=rn(o),o&&qi.test(o)?o.replace(ci,"\\$&"):o}var O4=Ga(function(o,l,g){return o+(g?"-":"")+l.toLowerCase()}),N4=Ga(function(o,l,g){return o+(g?" ":"")+l.toLowerCase()}),R4=Z0("toLowerCase");function M4(o,l,g){o=rn(o),l=jt(l);var S=l?Ji(o):0;if(!l||S>=l)return o;var F=(l-S)/2;return Qu(Uu(F),g)+o+Qu(Fu(F),g)}function D4(o,l,g){o=rn(o),l=jt(l);var S=l?Ji(o):0;return l&&S>>0,g?(o=rn(o),o&&(typeof l=="string"||l!=null&&!Tp(l))&&(l=Wr(l),!l&&Or(o))?eo(vr(o),0,g):o.split(l,g)):[]}var H4=Ga(function(o,l,g){return o+(g?" ":"")+Pp(l)});function q4(o,l,g){return o=rn(o),g=g==null?0:Wo(jt(g),0,o.length),l=Wr(l),o.slice(g,g+l.length)==l}function K4(o,l,g){var S=H.templateSettings;g&&_r(o,l,g)&&(l=n),o=rn(o),l=hf({},l,S,rv);var F=hf({},l.imports,S.imports,rv),K=Zn(F),ee=ec(F,K),ae,be,Le=0,Ue=l.interpolate||Ws,Ve="__p += '",it=Ut((l.escape||Ws).source+"|"+Ue.source+"|"+(Ue===qs?$a:Ws).source+"|"+(l.evaluate||Ws).source+"|$","g"),mt="//# sourceURL="+(Ot.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fd+"]")+` +`;o.replace(it,function(At,Yt,Qt,Gr,xr,Yr){return Qt||(Qt=Gr),Ve+=o.slice(Le,Yr).replace(Wi,Hd),Yt&&(ae=!0,Ve+=`' + +__e(`+Yt+`) + +'`),xr&&(be=!0,Ve+=`'; +`+xr+`; +__p += '`),Qt&&(Ve+=`' + +((__t = (`+Qt+`)) == null ? '' : __t) + +'`),Le=Yr+At.length,At}),Ve+=`'; +`;var Et=Ot.call(l,"variable")&&l.variable;if(!Et)Ve=`with (obj) { +`+Ve+` +} +`;else if(Kl.test(Et))throw new Be(c);Ve=(be?Ve.replace(Po,""):Ve).replace(Ea,"$1").replace(li,"$1;"),Ve="function("+(Et||"obj")+`) { +`+(Et?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(ae?", __e = _.escape":"")+(be?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+Ve+`return __p +}`;var zt=Yv(function(){return lt(K,mt+"return "+Ve).apply(n,ee)});if(zt.source=Ve,Cp(zt))throw zt;return zt}function W4(o){return rn(o).toLowerCase()}function V4(o){return rn(o).toUpperCase()}function G4(o,l,g){if(o=rn(o),o&&(g||l===n))return di(o);if(!o||!(l=Wr(l)))return o;var S=vr(o),F=vr(l),K=en(S,F),ee=jo(S,F)+1;return eo(S,K,ee).join("")}function Y4(o,l,g){if(o=rn(o),o&&(g||l===n))return o.slice(0,Pu(o)+1);if(!o||!(l=Wr(l)))return o;var S=vr(o),F=jo(S,vr(l))+1;return eo(S,0,F).join("")}function Z4(o,l,g){if(o=rn(o),o&&(g||l===n))return o.replace(fs,"");if(!o||!(l=Wr(l)))return o;var S=vr(o),F=en(S,vr(l));return eo(S,F).join("")}function J4(o,l){var g=ce,S=me;if(Cn(l)){var F="separator"in l?l.separator:F;g="length"in l?jt(l.length):g,S="omission"in l?Wr(l.omission):S}o=rn(o);var K=o.length;if(Or(o)){var ee=vr(o);K=ee.length}if(g>=K)return o;var ae=g-Ji(S);if(ae<1)return S;var be=ee?eo(ee,0,ae).join(""):o.slice(0,ae);if(F===n)return be+S;if(ee&&(ae+=be.length-ae),Tp(F)){if(o.slice(ae).search(F)){var Le,Ue=be;for(F.global||(F=Ut(F.source,rn(Pa.exec(F))+"g")),F.lastIndex=0;Le=F.exec(Ue);)var Ve=Le.index;be=be.slice(0,Ve===n?ae:Ve)}}else if(o.indexOf(Wr(F),ae)!=ae){var it=be.lastIndexOf(F);it>-1&&(be=be.slice(0,it))}return be+S}function X4(o){return o=rn(o),o&&Oo.test(o)?o.replace(Si,rc):o}var Q4=Ga(function(o,l,g){return o+(g?" ":"")+l.toUpperCase()}),Pp=Z0("toUpperCase");function Gv(o,l,g){return o=rn(o),l=g?n:l,l===n?tc(o)?le(o):Vt(o):o.match(l)||[]}var Yv=Wt(function(o,l){try{return j(o,n,l)}catch(g){return Cp(g)?g:new Be(g)}}),eC=_s(function(o,l){return X(l,function(g){g=es(g),bs(o,g,Ep(o[g],o))}),o});function tC(o){var l=o==null?0:o.length,g=kt();return o=l?at(o,function(S){if(typeof S[1]!="function")throw new Kt(a);return[g(S[0]),S[1]]}):[],Wt(function(S){for(var F=-1;++Fqe)return[];var g=nt,S=ar(o,nt);l=kt(l),o-=nt;for(var F=Fo(S,l);++g0||l<0)?new Xt(g):(o<0?g=g.takeRight(-o):o&&(g=g.drop(o)),l!==n&&(l=jt(l),g=l<0?g.dropRight(-l):g.take(l-o)),g)},Xt.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Xt.prototype.toArray=function(){return this.take(nt)},Xi(Xt.prototype,function(o,l){var g=/^(?:filter|find|map|reject)|While$/.test(l),S=/^(?:head|last)$/.test(l),F=H[S?"take"+(l=="last"?"Right":""):l],K=S||/^find/.test(l);F&&(H.prototype[l]=function(){var ee=this.__wrapped__,ae=S?[1]:arguments,be=ee instanceof Xt,Le=ae[0],Ue=be||Dt(ee),Ve=function(Yt){var Qt=F.apply(H,Mt([Yt],ae));return S&&it?Qt[0]:Qt};Ue&&g&&typeof Le=="function"&&Le.length!=1&&(be=Ue=!1);var it=this.__chain__,mt=!!this.__actions__.length,Et=K&&!it,zt=be&&!mt;if(!K&&Ue){ee=zt?ee:new Xt(this);var At=o.apply(ee,ae);return At.__actions__.push({func:sf,args:[Ve],thisArg:n}),new pi(At,it)}return Et&&zt?o.apply(this,ae):(At=this.thru(Ve),Et?S?At.value()[0]:At.value():At)})}),X(["pop","push","shift","sort","splice","unshift"],function(o){var l=jn[o],g=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",S=/^(?:pop|shift)$/.test(o);H.prototype[o]=function(){var F=arguments;if(S&&!this.__chain__){var K=this.value();return l.apply(Dt(K)?K:[],F)}return this[g](function(ee){return l.apply(Dt(ee)?ee:[],F)})}}),Xi(Xt.prototype,function(o,l){var g=H[l];if(g){var S=g.name+"";Ot.call(Ka,S)||(Ka[S]=[]),Ka[S].push({name:l,func:g})}}),Ka[Ju(n,$).name]=[{name:"wrapper",func:n}],Xt.prototype.clone=Xk,Xt.prototype.reverse=Qk,Xt.prototype.value=e3,H.prototype.at=IE,H.prototype.chain=$E,H.prototype.commit=PE,H.prototype.next=OE,H.prototype.plant=RE,H.prototype.reverse=ME,H.prototype.toJSON=H.prototype.valueOf=H.prototype.value=DE,H.prototype.first=H.prototype.head,ic&&(H.prototype[ic]=NE),H},Ce=Se();Ai?((Ai.exports=Ce)._=Ce,Ua._=Ce):En._=Ce}).call(Dn)})(ah,ah.exports);var dr=ah.exports;const Cc=jr(dr),k1="c2fc1ad0-f76f-11ec-b939-0242ac120002",S1=new Set;In.config({driver:[In.LOCALSTORAGE,In.INDEXEDDB,In.WEBSQL]});let e6=class Y_{constructor(t="",n=null){xe(this,"id");xe(this,"parent");xe(this,"children",new Map);xe(this,"on_subscriptions",new Map);xe(this,"map_subscriptions",new Map);xe(this,"value");xe(this,"counter",0);xe(this,"loaded",!1);xe(this,"saveLocalForage",Cc.throttle(async()=>{if(this.loaded||await this.loadLocalForage(),this.children.size){const t=Array.from(this.children.keys());In.setItem(this.id,t)}else this.value===void 0?In.removeItem(this.id):In.setItem(this.id,this.value===null?k1:this.value)},500));xe(this,"loadLocalForage",Cc.throttle(async()=>{if(S1.has(this.id))return;let t=await In.getItem(this.id);if(t===null)t=void 0,S1.add(this.id);else if(t===k1)t=null;else if(Array.isArray(t)){const n={};await Promise.all(t.map(async r=>{n[r]=await this.get(r).once()})),t=n}else this.value=t;return this.loaded=!0,t},500));xe(this,"doCallbacks",Cc.throttle(()=>{for(const[t,n]of this.on_subscriptions){const r=()=>this.on_subscriptions.delete(t);this.once(n,r,!1)}if(this.parent){for(const[t,n]of this.parent.on_subscriptions){const r=()=>{var i;return(i=this.parent)==null?void 0:i.on_subscriptions.delete(t)};this.parent.once(n,r,!1)}for(const[t,n]of this.parent.map_subscriptions){const r=()=>{var i;return(i=this.parent)==null?void 0:i.map_subscriptions.delete(t)};this.once(n,r,!1)}}},40));this.id=t,this.parent=n}get(t){const n=this.children.get(t);if(n)return n;const r=new Y_(`${this.id}/${t}`,this);return this.children.set(t,r),this.saveLocalForage(),r}put(t){if(Array.isArray(t))throw new Error("Sorry, we don't deal with arrays");if(typeof t=="object"&&t!==null){this.value=void 0;for(const n in t)this.get(n).put(t[n]);Cc.defer(()=>this.doCallbacks(),100);return}this.children=new Map,this.value=t,this.doCallbacks(),this.saveLocalForage()}async once(t,n,r=!0){let i;if(this.children.size?(i={},await Promise.all(Array.from(this.children.keys()).map(async s=>{i[s]=await this.get(s).once(void 0,n)}))):this.value!==void 0?i=this.value:i=await this.loadLocalForage(),i!==void 0||r)return t&&t(i,this.id.slice(this.id.lastIndexOf("/")+1),n||(()=>{})),i}on(t){const n=this.counter++;this.on_subscriptions.set(n,t);const r=()=>this.on_subscriptions.delete(n);return this.once(t,r,!1),r}map(t){var s;const n=this.counter++;this.map_subscriptions.set(n,t);const r=()=>this.map_subscriptions.delete(n),i=()=>{for(const a of this.children.values())a.once(t,r,!1)};return this.loaded?i():(s=this.loadLocalForage())==null||s.then(i),r}};const Pe=new e6;var zs={},Cl={};Object.defineProperty(Cl,"__esModule",{value:!0});Cl.createBitArray=t6;Cl.fromBits=r6;Cl.toBits=n6;function t6(e){return new Uint8Array(e)}function Z_(e,t,n,r,i){var s=(1<=r;)c-=r,n[f]=a>>c&s,f+=1}),i)c>0&&(n[f]=a<=t)throw new Error("Excessive padding: ".concat(c," (max ").concat(t-1," allowed)"));if(a%(1<8||t<1)throw new RangeError("Invalid bits per element; 1 to 8 expected");return Z_(e,8,n,t,!0),n}function r6(e,t,n){if(t>8||t<1)throw new RangeError("Invalid bits per element; 1 to 8 expected");return Z_(e,t,n,8,!1),n}var ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.CHECKSUM_LENGTH=void 0;ji.createChecksum=a6;ji.decode=t2;ji.decodeWithPrefix=c6;ji.detectCase=u6;ji.encode=l6;ji.expandPrefix=e2;ji.verifyChecksum=o6;var J_=Cl,$g="qpzry9x8gf2tvdw0s3jn54khce6mua7l",X_=734539939,E1=33,A1=126,Pg=6;ji.CHECKSUM_LENGTH=Pg;var i6=function(){for(var e=new Map,t=0;t<$g.length;t+=1)e.set($g[t],t);return e}(),s6=[996825010,642813549,513874426,1027748829,705979059];function Q_(e){return e.reduce(function(t,n){var r=t>>25,i=(t&33554431)<<5^n;return s6.reduce(function(s,a,c){return r>>c&1?s^a:s},i)},1)}function e2(e,t){for(var n=0;n>5,t[n+e.length+1]=r&31}t[e.length]=0}function o6(e){switch(Q_(e)){case 1:return"bech32";case X_:return"bech32m";default:return}}function a6(e,t){var n;switch(t){case"bech32":n=1;break;case"bech32m":n=X_;break;default:throw Error("Invalid encoding value: ".concat(t,"; expected bech32 or bech32m"))}for(var r=Q_(e)^n,i=0;i>s&31}}function l6(e){return e.reduce(function(t,n){return t+$g[n]},"")}function t2(e,t){for(var n=t||(0,J_.createBitArray)(e.length),r=0;r1&&arguments[1]!==void 0?arguments[1]:"message",n=!1,r=!1,i=0;iA1)throw new TypeError("Invalid char in ".concat(t,": ").concat(s,"; ")+"should be in ASCII range ".concat(E1,"-").concat(A1));r=r||s>=65&&s<=90,n=n||s>=97&&s<=122}if(n&&r)throw new TypeError("Mixed-case ".concat(t));return r?"upper":n?"lower":null}Object.defineProperty(zs,"__esModule",{value:!0});zs.BitcoinAddress=void 0;var Og=zs.decode=p6;zs.decodeTo5BitArray=Qy;var C1=zs.encode=d6;zs.encode5BitArray=Xy;zs.from5BitArray=Jy;zs.to5BitArray=Zy;var Kc=Cl,_i=ji;function f6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T1(e,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:"bech32",i=2*e.length+1+t.length+_i.CHECKSUM_LENGTH;if(i-e.length>lh)throw new Error("Message to be produced is too long (max ".concat(lh," supported)"));var s=(n=(0,_i.detectCase)(e,"prefix"))!==null&&n!==void 0?n:"lower",a=(0,Kc.createBitArray)(i);(0,_i.expandPrefix)(e.toLowerCase(),a.subarray(0,2*e.length+1));var c=a.subarray(2*e.length+1,a.length-_i.CHECKSUM_LENGTH);c.set(t),(0,_i.createChecksum)(a,r);var f=(0,_i.encode)(a.subarray(2*e.length+1));return s==="upper"&&(f=f.toUpperCase()),"".concat(e,"1").concat(f)}function d6(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"bech32";return Xy(e,Zy(t),n)}function Qy(e){if(e.length>lh)throw new TypeError("Message too long; max ".concat(lh," expected"));(0,_i.detectCase)(e);var t=e.toLowerCase(),n=t.lastIndexOf("1");if(n<0)throw new Error('No separator char ("1") found');if(n>e.length-_i.CHECKSUM_LENGTH-1)throw new Error("Data part of the message too short (at least ".concat(_i.CHECKSUM_LENGTH," chars expected)"));var r=t.substring(0,n),i=(0,_i.decodeWithPrefix)(r,t.substring(n+1)),s=(0,_i.verifyChecksum)(i);if(s===void 0)throw new Error("Invalid checksum");return{prefix:r,encoding:s,data:i.subarray(2*r.length+1,i.length-_i.CHECKSUM_LENGTH)}}function p6(e){var t=Qy(e),n=t.prefix,r=t.encoding,i=t.data;return{prefix:n,encoding:r,data:Jy(i)}}var g6=function(){function e(t,n,r){if(f6(this,e),t!=="bc"&&t!=="tb")throw new Error('Invalid human-readable prefix, "bc" or "tb" expected');if(n<0||n>16)throw new RangeError("Invalid scriptVersion, value in range [0, 16] expected");if(r.length<2||r.length>40)throw new RangeError("Invalid script length: expected 2 to 40 bytes");if(n===0&&r.length!==20&&r.length!==32)throw new Error("Invalid v0 script length: expected 20 or 32 bytes");this.prefix=t,this.scriptVersion=n,this.data=r}return h6(e,[{key:"type",value:function(){if(this.scriptVersion===0)switch(this.data.length){case 20:return"p2wpkh";case 32:return"p2wsh";default:return}}},{key:"encode",value:function(){var n=Math.ceil(this.data.length*8/5),r=(0,Kc.createBitArray)(n+1);r[0]=this.scriptVersion,Zy(this.data,r.subarray(1));var i=this.scriptVersion===0?"bech32":"bech32m";return Xy(this.prefix,r,i)}}],[{key:"decode",value:function(n){var r=Qy(n),i=r.prefix,s=r.data,a=r.encoding;if(i!=="bc"&&i!=="tb")throw new Error('Invalid human-readable prefix, "bc" or "tb" expected');var c=s[0];if(c===0&&a!=="bech32")throw Error("Unexpected encoding ".concat(a," used for version 0 script"));if(c>0&&a!=="bech32m")throw Error("Unexpected encoding ".concat(a," used for version ").concat(c," script"));return new this(i,c,Jy(s.subarray(1)))}}]),e}();zs.BitcoinAddress=g6;function ch(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n2(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function co(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function r2(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ch(e.outputLen),ch(e.blockLen)}function i2(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function s2(e,t){co(e);const n=t.outputLen;if(e.lengthnew Uint8Array(e.buffer,e.byteOffset,e.byteLength),b6=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),ha=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Ri=(e,t)=>e<<32-t|e>>>t,o2=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!o2)throw new Error("Non little-endian hardware is not supported");const w6=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function cr(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let n=0;n{};async function _6(e,t,n){let r=Date.now();for(let i=0;i=0&&sr instanceof Uint8Array))throw new Error("Uint8Array list expected");if(e.length===1)return e[0];const t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t);for(let r=0,i=0;rObject.prototype.toString.call(e)==="[object Object]"&&e.constructor===Object;function k6(e,t){if(t!==void 0&&(typeof t!="object"||!x6(t)))throw new TypeError("Options should be object or undefined");return Object.assign(e,t)}function Eo(e){const t=r=>e().update(du(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function S6(e){const t=(r,i)=>e(i).update(du(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}function nd(e=32){if(Uf&&typeof Uf.getRandomValues=="function")return Uf.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const E6=Object.freeze(Object.defineProperty({__proto__:null,Hash:tm,asyncLoop:_6,bytesToHex:cr,checkOpts:k6,concatBytes:oa,createView:ha,hexToBytes:bo,isLE:o2,nextTick:a2,randomBytes:nd,rotr:Ri,toBytes:du,u32:b6,u8:v6,utf8ToBytes:em,wrapConstructor:Eo,wrapConstructorWithOpts:S6},Symbol.toStringTag,{value:"Module"}));function A6(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const i=BigInt(32),s=BigInt(4294967295),a=Number(n>>i&s),c=Number(n&s),f=r?4:0,b=r?0:4;e.setUint32(t+f,a,r),e.setUint32(t+b,c,r)}class nm extends tm{constructor(t,n,r,i){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=ha(this.buffer)}update(t){po.exists(this);const{view:n,buffer:r,blockLen:i}=this;t=du(t);const s=t.length;for(let a=0;ai-a&&(this.process(r,0),a=0);for(let w=a;wm.length)throw new Error("_sha2: outputLen bigger than state");for(let w=0;we&t^~e&n,T6=(e,t,n)=>e&t^e&n^t&n,I6=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),no=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ro=new Uint32Array(64);class l2 extends nm{constructor(){super(64,32,8,!1),this.A=no[0]|0,this.B=no[1]|0,this.C=no[2]|0,this.D=no[3]|0,this.E=no[4]|0,this.F=no[5]|0,this.G=no[6]|0,this.H=no[7]|0}get(){const{A:t,B:n,C:r,D:i,E:s,F:a,G:c,H:f}=this;return[t,n,r,i,s,a,c,f]}set(t,n,r,i,s,a,c,f){this.A=t|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=a|0,this.G=c|0,this.H=f|0}process(t,n){for(let w=0;w<16;w++,n+=4)ro[w]=t.getUint32(n,!1);for(let w=16;w<64;w++){const _=ro[w-15],A=ro[w-2],I=Ri(_,7)^Ri(_,18)^_>>>3,C=Ri(A,17)^Ri(A,19)^A>>>10;ro[w]=C+ro[w-7]+I+ro[w-16]|0}let{A:r,B:i,C:s,D:a,E:c,F:f,G:b,H:m}=this;for(let w=0;w<64;w++){const _=Ri(c,6)^Ri(c,11)^Ri(c,25),A=m+_+C6(c,f,b)+I6[w]+ro[w]|0,C=(Ri(r,2)^Ri(r,13)^Ri(r,22))+T6(r,i,s)|0;m=b,b=f,f=c,c=a+A|0,a=s,s=i,i=r,r=A+C|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,c=c+this.E|0,f=f+this.F|0,b=b+this.G|0,m=m+this.H|0,this.set(r,i,s,a,c,f,b,m)}roundClean(){ro.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class $6 extends l2{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const ni=Eo(()=>new l2),P6=Eo(()=>new $6),O6=Object.freeze(Object.defineProperty({__proto__:null,sha224:P6,sha256:ni},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const c2=BigInt(0),rd=BigInt(1),N6=BigInt(2),id=e=>e instanceof Uint8Array,R6=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function bl(e){if(!id(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nwl(e.toString(16).padStart(t*2,"0")),f2=(e,t)=>go(e,t).reverse(),M6=e=>wl(u2(e));function nr(e,t,n){let r;if(typeof t=="string")try{r=wl(t)}catch(s){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${s}`)}else if(id(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(`${e} expected ${n} bytes, got ${i}`);return r}function Xr(...e){const t=new Uint8Array(e.reduce((r,i)=>r+i.length,0));let n=0;return e.forEach(r=>{if(!id(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function D6(e,t){if(e.length!==t.length)return!1;for(let n=0;nc2;e>>=rd,t+=1);return t}const L6=(e,t)=>e>>BigInt(t)&rd,F6=(e,t,n)=>e|(n?rd:c2)<(N6<new Uint8Array(e),I1=e=>Uint8Array.from(e);function h2(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=zp(e),i=zp(e),s=0;const a=()=>{r.fill(1),i.fill(0),s=0},c=(...w)=>n(i,r,...w),f=(w=zp())=>{i=c(I1([0]),w),r=c(),w.length!==0&&(i=c(I1([1]),w),r=c())},b=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let w=0;const _=[];for(;w{a(),f(w);let A;for(;!(A=_(b()));)f();return a(),A}}const U6={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Tl(e,t,n={}){const r=(i,s,a)=>{const c=U6[s];if(typeof c!="function")throw new Error(`Invalid validator "${s}", expected function`);const f=e[i];if(!(a&&f===void 0)&&!c(f,e))throw new Error(`Invalid param ${String(i)}=${f} (${typeof f}), expected ${s}`)};for(const[i,s]of Object.entries(t))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return e}const j6=Object.freeze(Object.defineProperty({__proto__:null,bitGet:L6,bitLen:B6,bitMask:sm,bitSet:F6,bytesToHex:bl,bytesToNumberBE:Ar,bytesToNumberLE:im,concatBytes:Xr,createHmacDrbg:h2,ensureBytes:nr,equalBytes:D6,hexToBytes:wl,hexToNumber:rm,numberToBytesBE:go,numberToBytesLE:f2,numberToHexUnpadded:u2,numberToVarBytesBE:M6,utf8ToBytes:sd,validateObject:Tl},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Xn=BigInt(0),Bn=BigInt(1),na=BigInt(2),z6=BigInt(3),Ng=BigInt(4),$1=BigInt(5),P1=BigInt(8);BigInt(9);BigInt(16);function Wn(e,t){const n=e%t;return n>=Xn?n:t+n}function H6(e,t,n){if(n<=Xn||t 0");if(n===Bn)return Xn;let r=Bn;for(;t>Xn;)t&Bn&&(r=r*e%n),e=e*e%n,t>>=Bn;return r}function wi(e,t,n){let r=e;for(;t-- >Xn;)r*=r,r%=n;return r}function Rg(e,t){if(e===Xn||t<=Xn)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Wn(e,t),r=t,i=Xn,s=Bn;for(;n!==Xn;){const c=r/n,f=r%n,b=i-s*c;r=n,n=f,i=s,s=b}if(r!==Bn)throw new Error("invert: does not exist");return Wn(i,t)}function q6(e){const t=(e-Bn)/na;let n,r,i;for(n=e-Bn,r=0;n%na===Xn;n/=na,r++);for(i=na;i(r[i]="function",r),t);return Tl(e,n)}function V6(e,t,n){if(n 0");if(n===Xn)return e.ONE;if(n===Bn)return t;let r=e.ONE,i=t;for(;n>Xn;)n&Bn&&(r=e.mul(r,i)),i=e.sqr(i),n>>=Bn;return r}function G6(e,t){const n=new Array(t.length),r=t.reduce((s,a,c)=>e.is0(a)?s:(n[c]=s,e.mul(s,a)),e.ONE),i=e.inv(r);return t.reduceRight((s,a,c)=>e.is0(a)?s:(n[c]=e.mul(s,n[c]),e.mul(s,a)),i),n}function om(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Y6(e,t,n=!1,r={}){if(e<=Xn)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:s}=om(e,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=K6(e),c=Object.freeze({ORDER:e,BITS:i,BYTES:s,MASK:sm(i),ZERO:Xn,ONE:Bn,create:f=>Wn(f,e),isValid:f=>{if(typeof f!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof f}`);return Xn<=f&&ff===Xn,isOdd:f=>(f&Bn)===Bn,neg:f=>Wn(-f,e),eql:(f,b)=>f===b,sqr:f=>Wn(f*f,e),add:(f,b)=>Wn(f+b,e),sub:(f,b)=>Wn(f-b,e),mul:(f,b)=>Wn(f*b,e),pow:(f,b)=>V6(c,f,b),div:(f,b)=>Wn(f*Rg(b,e),e),sqrN:f=>f*f,addN:(f,b)=>f+b,subN:(f,b)=>f-b,mulN:(f,b)=>f*b,inv:f=>Rg(f,e),sqrt:r.sqrt||(f=>a(c,f)),invertBatch:f=>G6(c,f),cmov:(f,b,m)=>m?b:f,toBytes:f=>n?f2(f,s):go(f,s),fromBytes:f=>{if(f.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${f.length}`);return n?im(f):Ar(f)}});return Object.freeze(c)}function Z6(e,t,n=!1){e=nr("privateHash",e);const r=e.length,i=om(t).nByteLength+8;if(i<24||r1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${r}`);const s=n?im(e):Ar(e);return Wn(s,t-Bn)+Bn}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const J6=BigInt(0),Hp=BigInt(1);function X6(e,t){const n=(i,s)=>{const a=s.negate();return i?a:s},r=i=>{const s=Math.ceil(t/i)+1,a=2**(i-1);return{windows:s,windowSize:a}};return{constTimeNegate:n,unsafeLadder(i,s){let a=e.ZERO,c=i;for(;s>J6;)s&Hp&&(a=a.add(c)),c=c.double(),s>>=Hp;return a},precomputeWindow(i,s){const{windows:a,windowSize:c}=r(s),f=[];let b=i,m=b;for(let w=0;w>=A,R>f&&(R-=_,a+=Hp);const $=C,L=C+Math.abs(R)-1,P=I%2!==0,N=R<0;R===0?m=m.add(n(P,s[$])):b=b.add(n(N,s[L]))}return{p:b,f:m}},wNAFCached(i,s,a,c){const f=i._WINDOW_SIZE||1;let b=s.get(i);return b||(b=this.precomputeWindow(i,f),f!==1&&s.set(i,c(b))),this.wNAF(f,b,a)}}}function p2(e){return d2(e.Fp),Tl(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...om(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Q6(e){const t=p2(e);Tl(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:e8,hexToBytes:t8}=j6,aa={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=aa;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:e8(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=aa,n=typeof e=="string"?t8(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:i,l:s}=aa._parseInt(n.subarray(2)),{d:a,l:c}=aa._parseInt(s);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(e){const t=b=>Number.parseInt(b[0],16)&8?"00"+b:b,n=b=>{const m=b.toString(16);return m.length&1?`0${m}`:m},r=t(n(e.s)),i=t(n(e.r)),s=r.length/2,a=i.length/2,c=n(s),f=n(a);return`30${n(a+s+4)}02${f}${i}02${c}${r}`}},Mi=BigInt(0),Ln=BigInt(1),Cs=BigInt(2),uh=BigInt(3),O1=BigInt(4);function n8(e){const t=Q6(e),{Fp:n}=t,r=t.toBytes||((I,C,R)=>{const $=C.toAffine();return Xr(Uint8Array.from([4]),n.toBytes($.x),n.toBytes($.y))}),i=t.fromBytes||(I=>{const C=I.subarray(1),R=n.fromBytes(C.subarray(0,n.BYTES)),$=n.fromBytes(C.subarray(n.BYTES,2*n.BYTES));return{x:R,y:$}});function s(I){const{a:C,b:R}=t,$=n.sqr(I),L=n.mul($,I);return n.add(n.add(L,n.mul(I,C)),R)}if(!n.eql(n.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function a(I){return typeof I=="bigint"&&Min.eql(P,n.ZERO);return L(R)&&L($)?w.ZERO:new w(R,$,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){const R=n.invertBatch(C.map($=>$.pz));return C.map(($,L)=>$.toAffine(R[L])).map(w.fromAffine)}static fromHex(C){const R=w.fromAffine(i(nr("pointHex",C)));return R.assertValidity(),R}static fromPrivateKey(C){return w.BASE.multiply(f(C))}_setWindowSize(C){this._WINDOW_SIZE=C,b.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:C,y:R}=this.toAffine();if(!n.isValid(C)||!n.isValid(R))throw new Error("bad point: x or y not FE");const $=n.sqr(R),L=s(C);if(!n.eql($,L))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:C}=this.toAffine();if(n.isOdd)return!n.isOdd(C);throw new Error("Field doesn't support isOdd")}equals(C){m(C);const{px:R,py:$,pz:L}=this,{px:P,py:N,pz:M}=C,U=n.eql(n.mul(R,M),n.mul(P,L)),p=n.eql(n.mul($,M),n.mul(N,L));return U&&p}negate(){return new w(this.px,n.neg(this.py),this.pz)}double(){const{a:C,b:R}=t,$=n.mul(R,uh),{px:L,py:P,pz:N}=this;let M=n.ZERO,U=n.ZERO,p=n.ZERO,Z=n.mul(L,L),J=n.mul(P,P),ce=n.mul(N,N),me=n.mul(L,P);return me=n.add(me,me),p=n.mul(L,N),p=n.add(p,p),M=n.mul(C,p),U=n.mul($,ce),U=n.add(M,U),M=n.sub(J,U),U=n.add(J,U),U=n.mul(M,U),M=n.mul(me,M),p=n.mul($,p),ce=n.mul(C,ce),me=n.sub(Z,ce),me=n.mul(C,me),me=n.add(me,p),p=n.add(Z,Z),Z=n.add(p,Z),Z=n.add(Z,ce),Z=n.mul(Z,me),U=n.add(U,Z),ce=n.mul(P,N),ce=n.add(ce,ce),Z=n.mul(ce,me),M=n.sub(M,Z),p=n.mul(ce,J),p=n.add(p,p),p=n.add(p,p),new w(M,U,p)}add(C){m(C);const{px:R,py:$,pz:L}=this,{px:P,py:N,pz:M}=C;let U=n.ZERO,p=n.ZERO,Z=n.ZERO;const J=t.a,ce=n.mul(t.b,uh);let me=n.mul(R,P),ke=n.mul($,N),we=n.mul(L,M),Q=n.add(R,$),G=n.add(P,N);Q=n.mul(Q,G),G=n.add(me,ke),Q=n.sub(Q,G),G=n.add(R,L);let Ae=n.add(P,M);return G=n.mul(G,Ae),Ae=n.add(me,we),G=n.sub(G,Ae),Ae=n.add($,L),U=n.add(N,M),Ae=n.mul(Ae,U),U=n.add(ke,we),Ae=n.sub(Ae,U),Z=n.mul(J,G),U=n.mul(ce,we),Z=n.add(U,Z),U=n.sub(ke,Z),Z=n.add(ke,Z),p=n.mul(U,Z),ke=n.add(me,me),ke=n.add(ke,me),we=n.mul(J,we),G=n.mul(ce,G),ke=n.add(ke,we),we=n.sub(me,we),we=n.mul(J,we),G=n.add(G,we),me=n.mul(ke,G),p=n.add(p,me),me=n.mul(Ae,G),U=n.mul(Q,U),U=n.sub(U,me),me=n.mul(Q,ke),Z=n.mul(Ae,Z),Z=n.add(Z,me),new w(U,p,Z)}subtract(C){return this.add(C.negate())}is0(){return this.equals(w.ZERO)}wNAF(C){return A.wNAFCached(this,b,C,R=>{const $=n.invertBatch(R.map(L=>L.pz));return R.map((L,P)=>L.toAffine($[P])).map(w.fromAffine)})}multiplyUnsafe(C){const R=w.ZERO;if(C===Mi)return R;if(c(C),C===Ln)return this;const{endo:$}=t;if(!$)return A.unsafeLadder(this,C);let{k1neg:L,k1:P,k2neg:N,k2:M}=$.splitScalar(C),U=R,p=R,Z=this;for(;P>Mi||M>Mi;)P&Ln&&(U=U.add(Z)),M&Ln&&(p=p.add(Z)),Z=Z.double(),P>>=Ln,M>>=Ln;return L&&(U=U.negate()),N&&(p=p.negate()),p=new w(n.mul(p.px,$.beta),p.py,p.pz),U.add(p)}multiply(C){c(C);let R=C,$,L;const{endo:P}=t;if(P){const{k1neg:N,k1:M,k2neg:U,k2:p}=P.splitScalar(R);let{p:Z,f:J}=this.wNAF(M),{p:ce,f:me}=this.wNAF(p);Z=A.constTimeNegate(N,Z),ce=A.constTimeNegate(U,ce),ce=new w(n.mul(ce.px,P.beta),ce.py,ce.pz),$=Z.add(ce),L=J.add(me)}else{const{p:N,f:M}=this.wNAF(R);$=N,L=M}return w.normalizeZ([$,L])[0]}multiplyAndAddUnsafe(C,R,$){const L=w.BASE,P=(M,U)=>U===Mi||U===Ln||!M.equals(L)?M.multiplyUnsafe(U):M.multiply(U),N=P(this,R).add(P(C,$));return N.is0()?void 0:N}toAffine(C){const{px:R,py:$,pz:L}=this,P=this.is0();C==null&&(C=P?n.ONE:n.inv(L));const N=n.mul(R,C),M=n.mul($,C),U=n.mul(L,C);if(P)return{x:n.ZERO,y:n.ZERO};if(!n.eql(U,n.ONE))throw new Error("invZ was invalid");return{x:N,y:M}}isTorsionFree(){const{h:C,isTorsionFree:R}=t;if(C===Ln)return!0;if(R)return R(w,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:C,clearCofactor:R}=t;return C===Ln?this:R?R(w,this):this.multiplyUnsafe(t.h)}toRawBytes(C=!0){return this.assertValidity(),r(w,this,C)}toHex(C=!0){return bl(this.toRawBytes(C))}}w.BASE=new w(t.Gx,t.Gy,n.ONE),w.ZERO=new w(n.ZERO,n.ONE,n.ZERO);const _=t.nBitLength,A=X6(w,t.endo?Math.ceil(_/2):_);return{CURVE:t,ProjectivePoint:w,normPrivateKeyToScalar:f,weierstrassEquation:s,isWithinCurveOrder:a}}function r8(e){const t=p2(e);return Tl(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function i8(e){const t=r8(e),{Fp:n,n:r}=t,i=n.BYTES+1,s=2*n.BYTES+1;function a(G){return Mibl(go(G,t.nByteLength));function I(G){const Ae=r>>Ln;return G>Ae}function C(G){return I(G)?c(-G):G}const R=(G,Ae,Te)=>Ar(G.slice(Ae,Te));class ${constructor(Ae,Te,qe){this.r=Ae,this.s=Te,this.recovery=qe,this.assertValidity()}static fromCompact(Ae){const Te=t.nByteLength;return Ae=nr("compactSignature",Ae,Te*2),new $(R(Ae,0,Te),R(Ae,Te,2*Te))}static fromDER(Ae){const{r:Te,s:qe}=aa.toSig(nr("DER",Ae));return new $(Te,qe)}assertValidity(){if(!_(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!_(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Ae){return new $(this.r,this.s,Ae)}recoverPublicKey(Ae){const{r:Te,s:qe,recovery:ze}=this,Qe=p(nr("msgHash",Ae));if(ze==null||![0,1,2,3].includes(ze))throw new Error("recovery id invalid");const nt=ze===2||ze===3?Te+t.n:Te;if(nt>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Fe=ze&1?"03":"02",He=b.fromHex(Fe+A(nt)),$e=f(nt),Me=c(-Qe*$e),fe=c(qe*$e),pt=b.BASE.multiplyAndAddUnsafe(He,Me,fe);if(!pt)throw new Error("point at infinify");return pt.assertValidity(),pt}hasHighS(){return I(this.s)}normalizeS(){return this.hasHighS()?new $(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return wl(this.toDERHex())}toDERHex(){return aa.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return wl(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}const L={isValidPrivateKey(G){try{return m(G),!0}catch{return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const G=t.randomBytes(n.BYTES+8),Ae=Z6(G,r);return go(Ae,t.nByteLength)},precompute(G=8,Ae=b.BASE){return Ae._setWindowSize(G),Ae.multiply(BigInt(3)),Ae}};function P(G,Ae=!0){return b.fromPrivateKey(G).toRawBytes(Ae)}function N(G){const Ae=G instanceof Uint8Array,Te=typeof G=="string",qe=(Ae||Te)&&G.length;return Ae?qe===i||qe===s:Te?qe===2*i||qe===2*s:G instanceof b}function M(G,Ae,Te=!0){if(N(G))throw new Error("first arg must be private key");if(!N(Ae))throw new Error("second arg must be public key");return b.fromHex(Ae).multiply(m(G)).toRawBytes(Te)}const U=t.bits2int||function(G){const Ae=Ar(G),Te=G.length*8-t.nBitLength;return Te>0?Ae>>BigInt(Te):Ae},p=t.bits2int_modN||function(G){return c(U(G))},Z=sm(t.nBitLength);function J(G){if(typeof G!="bigint")throw new Error("bigint expected");if(!(Mi<=G&&Gv in Te))throw new Error("sign() legacy options not supported");const{hash:qe,randomBytes:ze}=t;let{lowS:Qe,prehash:nt,extraEntropy:Fe}=Te;Qe==null&&(Qe=!0),G=nr("msgHash",G),nt&&(G=nr("prehashed msgHash",qe(G)));const He=p(G),$e=m(Ae),Me=[J($e),J(He)];if(Fe!=null){const v=Fe===!0?ze(n.BYTES):Fe;Me.push(nr("extraEntropy",v,n.BYTES))}const fe=Xr(...Me),pt=He;function h(v){const k=U(v);if(!_(k))return;const T=f(k),O=b.BASE.multiply(k).toAffine(),z=c(O.x);if(z===Mi)return;const te=c(T*c(pt+z*$e));if(te===Mi)return;let ie=(O.x===z?0:2)|Number(O.y&Ln),pe=te;return Qe&&I(te)&&(pe=C(te),ie^=1),new $(z,pe,ie)}return{seed:fe,k2sig:h}}const me={lowS:t.lowS,prehash:!1},ke={lowS:t.lowS,prehash:!1};function we(G,Ae,Te=me){const{seed:qe,k2sig:ze}=ce(G,Ae,Te);return h2(t.hash.outputLen,t.nByteLength,t.hmac)(qe,ze)}b.BASE._setWindowSize(8);function Q(G,Ae,Te,qe=ke){var O;const ze=G;if(Ae=nr("msgHash",Ae),Te=nr("publicKey",Te),"strict"in qe)throw new Error("options.strict was renamed to lowS");const{lowS:Qe,prehash:nt}=qe;let Fe,He;try{if(typeof ze=="string"||ze instanceof Uint8Array)try{Fe=$.fromDER(ze)}catch(z){if(!(z instanceof aa.Err))throw z;Fe=$.fromCompact(ze)}else if(typeof ze=="object"&&typeof ze.r=="bigint"&&typeof ze.s=="bigint"){const{r:z,s:te}=ze;Fe=new $(z,te)}else throw new Error("PARSE");He=b.fromHex(Te)}catch(z){if(z.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Qe&&Fe.hasHighS())return!1;nt&&(Ae=t.hash(Ae));const{r:$e,s:Me}=Fe,fe=p(Ae),pt=f(Me),h=c(fe*pt),v=c($e*pt),k=(O=b.BASE.multiplyAndAddUnsafe(He,h,v))==null?void 0:O.toAffine();return k?c(k.x)===$e:!1}return{CURVE:t,getPublicKey:P,getSharedSecret:M,sign:we,verify:Q,ProjectivePoint:b,Signature:$,utils:L}}function s8(e,t){const n=e.ORDER;let r=Mi;for(let _=n-Ln;_%Cs===Mi;_/=Cs)r+=Ln;const i=r,s=(n-Ln)/Cs**i,a=(s-Ln)/Cs,c=Cs**i-Ln,f=Cs**(i-Ln),b=e.pow(t,s),m=e.pow(t,(s+Ln)/Cs);let w=(_,A)=>{let I=b,C=e.pow(A,c),R=e.sqr(C);R=e.mul(R,A);let $=e.mul(_,R);$=e.pow($,a),$=e.mul($,C),C=e.mul($,A),R=e.mul($,_);let L=e.mul(R,C);$=e.pow(L,f);let P=e.eql($,e.ONE);C=e.mul(R,m),$=e.mul(L,I),R=e.cmov(C,R,P),L=e.cmov($,L,P);for(let N=i;N>Ln;N--){let M=Cs**(N-Cs),U=e.pow(L,M);const p=e.eql(U,e.ONE);C=e.mul(R,I),I=e.mul(I,I),U=e.mul(L,I),R=e.cmov(C,R,p),L=e.cmov(U,L,p)}return{isValid:P,value:R}};if(e.ORDER%O1===uh){const _=(e.ORDER-uh)/O1,A=e.sqrt(e.neg(t));w=(I,C)=>{let R=e.sqr(C);const $=e.mul(I,C);R=e.mul(R,$);let L=e.pow(R,_);L=e.mul(L,$);const P=e.mul(L,A),N=e.mul(e.sqr(L),C),M=e.eql(N,I);let U=e.cmov(P,L,M);return{isValid:M,value:U}}}return w}function o8(e,t){if(d2(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const n=s8(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return r=>{let i,s,a,c,f,b,m,w;i=e.sqr(r),i=e.mul(i,t.Z),s=e.sqr(i),s=e.add(s,i),a=e.add(s,e.ONE),a=e.mul(a,t.B),c=e.cmov(t.Z,e.neg(s),!e.eql(s,e.ZERO)),c=e.mul(c,t.A),s=e.sqr(a),b=e.sqr(c),f=e.mul(b,t.A),s=e.add(s,f),s=e.mul(s,a),b=e.mul(b,c),f=e.mul(b,t.B),s=e.add(s,f),m=e.mul(i,a);const{isValid:_,value:A}=n(s,b);w=e.mul(i,r),w=e.mul(w,A),m=e.cmov(m,a,_),w=e.cmov(w,A,_);const I=e.isOdd(r)===e.isOdd(w);return w=e.cmov(e.neg(w),w,I),m=e.div(m,c),{x:m,y:w}}}function a8(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return sd(e);throw new Error("DST must be Uint8Array or string")}const l8=Ar;function ao(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=e&255,e>>>=8;return new Uint8Array(n)}function c8(e,t){const n=new Uint8Array(e.length);for(let r=0;r255&&(t=r(Xr(sd("H2C-OVERSIZE-DST-"),t)));const{outputLen:i,blockLen:s}=r,a=Math.ceil(n/i);if(a>255)throw new Error("Invalid xmd length");const c=Xr(t,ao(t.length,1)),f=ao(0,s),b=ao(n,2),m=new Array(a),w=r(Xr(f,e,b,ao(0,1),c));m[0]=r(Xr(w,ao(1,1),c));for(let A=1;A<=a;A++){const I=[c8(w,m[A-1]),ao(A+1,1),c];m[A]=r(Xr(...I))}return Xr(...m).slice(0,n)}function f8(e,t,n,r,i){if(Wc(e),Wc(t),am(n),t.length>255){const s=Math.ceil(2*r/8);t=i.create({dkLen:s}).update(sd("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:n}).update(e).update(ao(n,2)).update(t).update(ao(t.length,1)).digest()}function N1(e,t,n){Tl(n,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:r,k:i,m:s,hash:a,expand:c,DST:f}=n;Wc(e),am(t);const b=a8(f),m=r.toString(2).length,w=Math.ceil((m+i)/8),_=t*s*w;let A;if(c==="xmd")A=u8(e,b,_,a);else if(c==="xof")A=f8(e,b,_,i,a);else if(c==="_internal_pass")A=e;else throw new Error('expand must be "xmd" or "xof"');const I=new Array(t);for(let C=0;CArray.from(r).reverse());return(r,i)=>{const[s,a,c,f]=n.map(b=>b.reduce((m,w)=>e.add(e.mul(m,r),w)));return r=e.div(s,a),i=e.mul(i,e.div(c,f)),{x:r,y:i}}}function d8(e,t,n){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(r,i){const s=N1(r,2,{...n,DST:n.DST,...i}),a=e.fromAffine(t(s[0])),c=e.fromAffine(t(s[1])),f=a.add(c).clearCofactor();return f.assertValidity(),f},encodeToCurve(r,i){const s=N1(r,1,{...n,DST:n.encodeDST,...i}),a=e.fromAffine(t(s[0])).clearCofactor();return a.assertValidity(),a}}}class g2 extends tm{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,po.hash(t);const r=du(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?t.create().update(r).digest():r);for(let a=0;anew g2(e,t).update(n).digest();fh.create=(e,t)=>new g2(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function p8(e){return{hash:e,hmac:(t,...n)=>fh(e,t,oa(...n)),randomBytes:nd}}function g8(e,t){const n=r=>i8({...e,...p8(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const od=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),hh=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y2=BigInt(1),dh=BigInt(2),R1=(e,t)=>(e+t/dh)/t;function m2(e){const t=od,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),c=BigInt(44),f=BigInt(88),b=e*e*e%t,m=b*b*e%t,w=wi(m,n,t)*m%t,_=wi(w,n,t)*m%t,A=wi(_,dh,t)*b%t,I=wi(A,i,t)*A%t,C=wi(I,s,t)*I%t,R=wi(C,c,t)*C%t,$=wi(R,f,t)*R%t,L=wi($,c,t)*C%t,P=wi(L,n,t)*m%t,N=wi(P,a,t)*I%t,M=wi(N,r,t)*b%t,U=wi(M,dh,t);if(!wo.eql(wo.sqr(U),e))throw new Error("Cannot find square root");return U}const wo=Y6(od,void 0,void 0,{sqrt:m2}),kr=g8({a:BigInt(0),b:BigInt(7),Fp:wo,n:hh,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=hh,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-y2*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,a=BigInt("0x100000000000000000000000000000000"),c=R1(s*e,t),f=R1(-r*e,t);let b=Wn(e-c*n-f*i,t),m=Wn(-c*r-f*s,t);const w=b>a,_=m>a;if(w&&(b=t-b),_&&(m=t-m),b>a||m>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:w,k1:b,k2neg:_,k2:m}}}},ni),ad=BigInt(0),v2=e=>typeof e=="bigint"&&adtypeof e=="bigint"&&adi.charCodeAt(0)));n=Xr(r,r),M1[e]=n}return ni(Xr(n,...t))}const lm=e=>e.toRawBytes(!0).slice(1),Mg=e=>go(e,32),qp=e=>Wn(e,od),Vc=e=>Wn(e,hh),cm=kr.ProjectivePoint,m8=(e,t,n)=>cm.BASE.multiplyAndAddUnsafe(e,t,n);function Dg(e){let t=kr.utils.normPrivateKeyToScalar(e),n=cm.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:Vc(-t),bytes:lm(n)}}function b2(e){if(!v2(e))throw new Error("bad x: need 0 < x < p");const t=qp(e*e),n=qp(t*e+BigInt(7));let r=m2(n);r%dh!==ad&&(r=qp(-r));const i=new cm(e,r,y2);return i.assertValidity(),i}function w2(...e){return Vc(Ar(ph("BIP0340/challenge",...e)))}function v8(e){return Dg(e).bytes}function b8(e,t,n=nd(32)){const r=nr("message",e),{bytes:i,scalar:s}=Dg(t),a=nr("auxRand",n,32),c=Mg(s^Ar(ph("BIP0340/aux",a))),f=ph("BIP0340/nonce",c,i,r),b=Vc(Ar(f));if(b===ad)throw new Error("sign failed: k is zero");const{bytes:m,scalar:w}=Dg(b),_=w2(m,i,r),A=new Uint8Array(64);if(A.set(m,0),A.set(Mg(Vc(w+_*s)),32),!_2(A,r,i))throw new Error("sign: Invalid signature produced");return A}function _2(e,t,n){const r=nr("signature",e,64),i=nr("message",t),s=nr("publicKey",n,32);try{const a=b2(Ar(s)),c=Ar(r.subarray(0,32));if(!v2(c))return!1;const f=Ar(r.subarray(32,64));if(!y8(f))return!1;const b=w2(Mg(c),lm(a),i),m=m8(a,f,Vc(-b));return!(!m||!m.hasEvenY()||m.toAffine().x!==c)}catch{return!1}}const Il={getPublicKey:v8,sign:b8,verify:_2,utils:{randomPrivateKey:kr.utils.randomPrivateKey,lift_x:b2,pointToBytes:lm,numberToBytesBE:go,bytesToNumberBE:Ar,taggedHash:ph,mod:Wn}},w8=h8(wo,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(t=>BigInt(t)))),_8=o8(wo,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:wo.create(BigInt("-11"))});d8(kr.ProjectivePoint,e=>{const{x:t,y:n}=_8(wo.create(e[0]));return w8(t,n)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:wo.ORDER,m:1,k:128,expand:"xmd",hash:ni});/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ao(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function zi(...e){const t=(i,s)=>a=>i(s(a)),n=Array.from(e).reverse().reduce((i,s)=>i?t(i,s.encode):s.encode,void 0),r=e.reduce((i,s)=>i?t(i,s.decode):s.decode,void 0);return{encode:n,decode:r}}function as(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(Ao(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function ls(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function pu(e,t="="){if(Ao(e),typeof t!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of n)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let r=n.length;if(r*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function x2(e){if(typeof e!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function D1(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const i=[],s=Array.from(e);for(s.forEach(a=>{if(Ao(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let f=r;ft?k2(t,e%t):e,gh=(e,t)=>e+(t-k2(e,t));function Bg(e,t,n,r){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(gh(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${gh(t,n)}`);let i=0,s=0;const a=2**n-1,c=[];for(const f of e){if(Ao(f),f>=2**t)throw new Error(`convertRadix2: invalid data word=${f} from=${t}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=n;s-=n)c.push((i>>s-n&a)>>>0);i&=2**s-1}if(i=i<=t)throw new Error("Excess padding");if(!r&&i)throw new Error(`Non-zero padding: ${i}`);return r&&s>0&&c.push(i>>>0),c}function S2(e){return Ao(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return D1(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(D1(t,e,2**8))}}}function Hs(e,t=!1){if(Ao(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(gh(8,e)>32||gh(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Bg(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Bg(n,e,8,t))}}}function B1(e){if(typeof e!="function")throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}function E2(e,t){if(Ao(e),typeof t!="function")throw new Error("checksum fn should be function");return{encode(n){if(!(n instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const r=t(n).slice(0,e),i=new Uint8Array(n.length+e);return i.set(n),i.set(r,n.length),i},decode(n){if(!(n instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const r=n.slice(0,-e),i=t(r).slice(0,e),s=n.slice(-e);for(let a=0;ae.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),_l=zi(Hs(6),as("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),pu(6),ls("")),T2=zi(Hs(6),as("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),pu(6),ls("")),um=e=>zi(S2(58),as(e),ls("")),Gc=um("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),E8=um("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),A8=um("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),L1=[0,2,3,5,6,7,9,10,11],I2={encode(e){let t="";for(let n=0;nzi(E2(4,t=>e(e(t))),Gc),Lg=zi(as("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),ls("")),F1=[996825010,642813549,513874426,1027748829,705979059];function wc(e){const t=e>>25;let n=(e&33554431)<<5;for(let r=0;r>r&1)===1&&(n^=F1[r]);return n}function U1(e,t,n=1){const r=e.length;let i=1;for(let s=0;s126)throw new Error(`Invalid prefix (${e})`);i=wc(i)^a>>5}i=wc(i);for(let s=0;s_)throw new TypeError(`Length ${A} exceeds limit ${_}`);return m=m.toLowerCase(),`${m}1${Lg.encode(w)}${U1(m,w,t)}`}function c(m,w=90){if(typeof m!="string")throw new Error(`bech32.decode input should be string, not ${typeof m}`);if(m.length<8||w!==!1&&m.length>w)throw new TypeError(`Wrong string length: ${m.length} (${m}). Expected (8..${w})`);const _=m.toLowerCase();if(m!==_&&m!==m.toUpperCase())throw new Error("String must be lowercase or uppercase");m=_;const A=m.lastIndexOf("1");if(A===0||A===-1)throw new Error('Letter "1" must be present between prefix and data only');const I=m.slice(0,A),C=m.slice(A+1);if(C.length<6)throw new Error("Data must be at least 6 characters long");const R=Lg.decode(C).slice(0,-6),$=U1(I,R,t);if(!C.endsWith($))throw new Error(`Invalid checksum in ${m}: expected "${$}"`);return{prefix:I,words:R}}const f=B1(c);function b(m){const{prefix:w,words:_}=c(m,!1);return{prefix:w,words:_,bytes:r(_)}}return{encode:a,decode:c,decodeToBytes:b,decodeUnsafe:f,fromWords:r,fromWordsUnsafe:s,toWords:i}}const Cr=P2("bech32"),C8=P2("bech32m"),O2={encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)},N2=zi(Hs(4),as("0123456789abcdef"),ls(""),x2(e=>{if(typeof e!="string"||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})),Yc={utf8:O2,hex:N2,base16:A2,base32:C2,base64:_l,base64url:T2,base58:Gc,base58xmr:I2},R2=`Invalid encoding type. Available types: ${Object.keys(Yc).join(", ")}`,M2=(e,t)=>{if(typeof e!="string"||!Yc.hasOwnProperty(e))throw new TypeError(R2);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return Yc[e].encode(t)},T8=M2,D2=(e,t)=>{if(!Yc.hasOwnProperty(e))throw new TypeError(R2);if(typeof t!="string")throw new TypeError("stringToBytes() expects string");return Yc[e].decode(t)},I8=D2,$8=Object.freeze(Object.defineProperty({__proto__:null,assertNumber:Ao,base16:A2,base32:C2,base32crockford:S8,base32hex:k8,base58:Gc,base58check:$2,base58flickr:E8,base58xmr:I2,base58xrp:A8,base64:_l,base64url:T2,bech32:Cr,bech32m:C8,bytes:I8,bytesToString:M2,hex:N2,str:T8,stringToBytes:D2,utf8:O2,utils:x8},Symbol.toStringTag,{value:"Module"}));var fm={};Object.defineProperty(fm,"__esModule",{value:!0});var hm=fm.wordlist=void 0;hm=fm.wordlist=`abandon +ability +able +about +above +absent +absorb +abstract +absurd +abuse +access +accident +account +accuse +achieve +acid +acoustic +acquire +across +act +action +actor +actress +actual +adapt +add +addict +address +adjust +admit +adult +advance +advice +aerobic +affair +afford +afraid +again +age +agent +agree +ahead +aim +air +airport +aisle +alarm +album +alcohol +alert +alien +all +alley +allow +almost +alone +alpha +already +also +alter +always +amateur +amazing +among +amount +amused +analyst +anchor +ancient +anger +angle +angry +animal +ankle +announce +annual +another +answer +antenna +antique +anxiety +any +apart +apology +appear +apple +approve +april +arch +arctic +area +arena +argue +arm +armed +armor +army +around +arrange +arrest +arrive +arrow +art +artefact +artist +artwork +ask +aspect +assault +asset +assist +assume +asthma +athlete +atom +attack +attend +attitude +attract +auction +audit +august +aunt +author +auto +autumn +average +avocado +avoid +awake +aware +away +awesome +awful +awkward +axis +baby +bachelor +bacon +badge +bag +balance +balcony +ball +bamboo +banana +banner +bar +barely +bargain +barrel +base +basic +basket +battle +beach +bean +beauty +because +become +beef +before +begin +behave +behind +believe +below +belt +bench +benefit +best +betray +better +between +beyond +bicycle +bid +bike +bind +biology +bird +birth +bitter +black +blade +blame +blanket +blast +bleak +bless +blind +blood +blossom +blouse +blue +blur +blush +board +boat +body +boil +bomb +bone +bonus +book +boost +border +boring +borrow +boss +bottom +bounce +box +boy +bracket +brain +brand +brass +brave +bread +breeze +brick +bridge +brief +bright +bring +brisk +broccoli +broken +bronze +broom +brother +brown +brush +bubble +buddy +budget +buffalo +build +bulb +bulk +bullet +bundle +bunker +burden +burger +burst +bus +business +busy +butter +buyer +buzz +cabbage +cabin +cable +cactus +cage +cake +call +calm +camera +camp +can +canal +cancel +candy +cannon +canoe +canvas +canyon +capable +capital +captain +car +carbon +card +cargo +carpet +carry +cart +case +cash +casino +castle +casual +cat +catalog +catch +category +cattle +caught +cause +caution +cave +ceiling +celery +cement +census +century +cereal +certain +chair +chalk +champion +change +chaos +chapter +charge +chase +chat +cheap +check +cheese +chef +cherry +chest +chicken +chief +child +chimney +choice +choose +chronic +chuckle +chunk +churn +cigar +cinnamon +circle +citizen +city +civil +claim +clap +clarify +claw +clay +clean +clerk +clever +click +client +cliff +climb +clinic +clip +clock +clog +close +cloth +cloud +clown +club +clump +cluster +clutch +coach +coast +coconut +code +coffee +coil +coin +collect +color +column +combine +come +comfort +comic +common +company +concert +conduct +confirm +congress +connect +consider +control +convince +cook +cool +copper +copy +coral +core +corn +correct +cost +cotton +couch +country +couple +course +cousin +cover +coyote +crack +cradle +craft +cram +crane +crash +crater +crawl +crazy +cream +credit +creek +crew +cricket +crime +crisp +critic +crop +cross +crouch +crowd +crucial +cruel +cruise +crumble +crunch +crush +cry +crystal +cube +culture +cup +cupboard +curious +current +curtain +curve +cushion +custom +cute +cycle +dad +damage +damp +dance +danger +daring +dash +daughter +dawn +day +deal +debate +debris +decade +december +decide +decline +decorate +decrease +deer +defense +define +defy +degree +delay +deliver +demand +demise +denial +dentist +deny +depart +depend +deposit +depth +deputy +derive +describe +desert +design +desk +despair +destroy +detail +detect +develop +device +devote +diagram +dial +diamond +diary +dice +diesel +diet +differ +digital +dignity +dilemma +dinner +dinosaur +direct +dirt +disagree +discover +disease +dish +dismiss +disorder +display +distance +divert +divide +divorce +dizzy +doctor +document +dog +doll +dolphin +domain +donate +donkey +donor +door +dose +double +dove +draft +dragon +drama +drastic +draw +dream +dress +drift +drill +drink +drip +drive +drop +drum +dry +duck +dumb +dune +during +dust +dutch +duty +dwarf +dynamic +eager +eagle +early +earn +earth +easily +east +easy +echo +ecology +economy +edge +edit +educate +effort +egg +eight +either +elbow +elder +electric +elegant +element +elephant +elevator +elite +else +embark +embody +embrace +emerge +emotion +employ +empower +empty +enable +enact +end +endless +endorse +enemy +energy +enforce +engage +engine +enhance +enjoy +enlist +enough +enrich +enroll +ensure +enter +entire +entry +envelope +episode +equal +equip +era +erase +erode +erosion +error +erupt +escape +essay +essence +estate +eternal +ethics +evidence +evil +evoke +evolve +exact +example +excess +exchange +excite +exclude +excuse +execute +exercise +exhaust +exhibit +exile +exist +exit +exotic +expand +expect +expire +explain +expose +express +extend +extra +eye +eyebrow +fabric +face +faculty +fade +faint +faith +fall +false +fame +family +famous +fan +fancy +fantasy +farm +fashion +fat +fatal +father +fatigue +fault +favorite +feature +february +federal +fee +feed +feel +female +fence +festival +fetch +fever +few +fiber +fiction +field +figure +file +film +filter +final +find +fine +finger +finish +fire +firm +first +fiscal +fish +fit +fitness +fix +flag +flame +flash +flat +flavor +flee +flight +flip +float +flock +floor +flower +fluid +flush +fly +foam +focus +fog +foil +fold +follow +food +foot +force +forest +forget +fork +fortune +forum +forward +fossil +foster +found +fox +fragile +frame +frequent +fresh +friend +fringe +frog +front +frost +frown +frozen +fruit +fuel +fun +funny +furnace +fury +future +gadget +gain +galaxy +gallery +game +gap +garage +garbage +garden +garlic +garment +gas +gasp +gate +gather +gauge +gaze +general +genius +genre +gentle +genuine +gesture +ghost +giant +gift +giggle +ginger +giraffe +girl +give +glad +glance +glare +glass +glide +glimpse +globe +gloom +glory +glove +glow +glue +goat +goddess +gold +good +goose +gorilla +gospel +gossip +govern +gown +grab +grace +grain +grant +grape +grass +gravity +great +green +grid +grief +grit +grocery +group +grow +grunt +guard +guess +guide +guilt +guitar +gun +gym +habit +hair +half +hammer +hamster +hand +happy +harbor +hard +harsh +harvest +hat +have +hawk +hazard +head +health +heart +heavy +hedgehog +height +hello +helmet +help +hen +hero +hidden +high +hill +hint +hip +hire +history +hobby +hockey +hold +hole +holiday +hollow +home +honey +hood +hope +horn +horror +horse +hospital +host +hotel +hour +hover +hub +huge +human +humble +humor +hundred +hungry +hunt +hurdle +hurry +hurt +husband +hybrid +ice +icon +idea +identify +idle +ignore +ill +illegal +illness +image +imitate +immense +immune +impact +impose +improve +impulse +inch +include +income +increase +index +indicate +indoor +industry +infant +inflict +inform +inhale +inherit +initial +inject +injury +inmate +inner +innocent +input +inquiry +insane +insect +inside +inspire +install +intact +interest +into +invest +invite +involve +iron +island +isolate +issue +item +ivory +jacket +jaguar +jar +jazz +jealous +jeans +jelly +jewel +job +join +joke +journey +joy +judge +juice +jump +jungle +junior +junk +just +kangaroo +keen +keep +ketchup +key +kick +kid +kidney +kind +kingdom +kiss +kit +kitchen +kite +kitten +kiwi +knee +knife +knock +know +lab +label +labor +ladder +lady +lake +lamp +language +laptop +large +later +latin +laugh +laundry +lava +law +lawn +lawsuit +layer +lazy +leader +leaf +learn +leave +lecture +left +leg +legal +legend +leisure +lemon +lend +length +lens +leopard +lesson +letter +level +liar +liberty +library +license +life +lift +light +like +limb +limit +link +lion +liquid +list +little +live +lizard +load +loan +lobster +local +lock +logic +lonely +long +loop +lottery +loud +lounge +love +loyal +lucky +luggage +lumber +lunar +lunch +luxury +lyrics +machine +mad +magic +magnet +maid +mail +main +major +make +mammal +man +manage +mandate +mango +mansion +manual +maple +marble +march +margin +marine +market +marriage +mask +mass +master +match +material +math +matrix +matter +maximum +maze +meadow +mean +measure +meat +mechanic +medal +media +melody +melt +member +memory +mention +menu +mercy +merge +merit +merry +mesh +message +metal +method +middle +midnight +milk +million +mimic +mind +minimum +minor +minute +miracle +mirror +misery +miss +mistake +mix +mixed +mixture +mobile +model +modify +mom +moment +monitor +monkey +monster +month +moon +moral +more +morning +mosquito +mother +motion +motor +mountain +mouse +move +movie +much +muffin +mule +multiply +muscle +museum +mushroom +music +must +mutual +myself +mystery +myth +naive +name +napkin +narrow +nasty +nation +nature +near +neck +need +negative +neglect +neither +nephew +nerve +nest +net +network +neutral +never +news +next +nice +night +noble +noise +nominee +noodle +normal +north +nose +notable +note +nothing +notice +novel +now +nuclear +number +nurse +nut +oak +obey +object +oblige +obscure +observe +obtain +obvious +occur +ocean +october +odor +off +offer +office +often +oil +okay +old +olive +olympic +omit +once +one +onion +online +only +open +opera +opinion +oppose +option +orange +orbit +orchard +order +ordinary +organ +orient +original +orphan +ostrich +other +outdoor +outer +output +outside +oval +oven +over +own +owner +oxygen +oyster +ozone +pact +paddle +page +pair +palace +palm +panda +panel +panic +panther +paper +parade +parent +park +parrot +party +pass +patch +path +patient +patrol +pattern +pause +pave +payment +peace +peanut +pear +peasant +pelican +pen +penalty +pencil +people +pepper +perfect +permit +person +pet +phone +photo +phrase +physical +piano +picnic +picture +piece +pig +pigeon +pill +pilot +pink +pioneer +pipe +pistol +pitch +pizza +place +planet +plastic +plate +play +please +pledge +pluck +plug +plunge +poem +poet +point +polar +pole +police +pond +pony +pool +popular +portion +position +possible +post +potato +pottery +poverty +powder +power +practice +praise +predict +prefer +prepare +present +pretty +prevent +price +pride +primary +print +priority +prison +private +prize +problem +process +produce +profit +program +project +promote +proof +property +prosper +protect +proud +provide +public +pudding +pull +pulp +pulse +pumpkin +punch +pupil +puppy +purchase +purity +purpose +purse +push +put +puzzle +pyramid +quality +quantum +quarter +question +quick +quit +quiz +quote +rabbit +raccoon +race +rack +radar +radio +rail +rain +raise +rally +ramp +ranch +random +range +rapid +rare +rate +rather +raven +raw +razor +ready +real +reason +rebel +rebuild +recall +receive +recipe +record +recycle +reduce +reflect +reform +refuse +region +regret +regular +reject +relax +release +relief +rely +remain +remember +remind +remove +render +renew +rent +reopen +repair +repeat +replace +report +require +rescue +resemble +resist +resource +response +result +retire +retreat +return +reunion +reveal +review +reward +rhythm +rib +ribbon +rice +rich +ride +ridge +rifle +right +rigid +ring +riot +ripple +risk +ritual +rival +river +road +roast +robot +robust +rocket +romance +roof +rookie +room +rose +rotate +rough +round +route +royal +rubber +rude +rug +rule +run +runway +rural +sad +saddle +sadness +safe +sail +salad +salmon +salon +salt +salute +same +sample +sand +satisfy +satoshi +sauce +sausage +save +say +scale +scan +scare +scatter +scene +scheme +school +science +scissors +scorpion +scout +scrap +screen +script +scrub +sea +search +season +seat +second +secret +section +security +seed +seek +segment +select +sell +seminar +senior +sense +sentence +series +service +session +settle +setup +seven +shadow +shaft +shallow +share +shed +shell +sheriff +shield +shift +shine +ship +shiver +shock +shoe +shoot +shop +short +shoulder +shove +shrimp +shrug +shuffle +shy +sibling +sick +side +siege +sight +sign +silent +silk +silly +silver +similar +simple +since +sing +siren +sister +situate +six +size +skate +sketch +ski +skill +skin +skirt +skull +slab +slam +sleep +slender +slice +slide +slight +slim +slogan +slot +slow +slush +small +smart +smile +smoke +smooth +snack +snake +snap +sniff +snow +soap +soccer +social +sock +soda +soft +solar +soldier +solid +solution +solve +someone +song +soon +sorry +sort +soul +sound +soup +source +south +space +spare +spatial +spawn +speak +special +speed +spell +spend +sphere +spice +spider +spike +spin +spirit +split +spoil +sponsor +spoon +sport +spot +spray +spread +spring +spy +square +squeeze +squirrel +stable +stadium +staff +stage +stairs +stamp +stand +start +state +stay +steak +steel +stem +step +stereo +stick +still +sting +stock +stomach +stone +stool +story +stove +strategy +street +strike +strong +struggle +student +stuff +stumble +style +subject +submit +subway +success +such +sudden +suffer +sugar +suggest +suit +summer +sun +sunny +sunset +super +supply +supreme +sure +surface +surge +surprise +surround +survey +suspect +sustain +swallow +swamp +swap +swarm +swear +sweet +swift +swim +swing +switch +sword +symbol +symptom +syrup +system +table +tackle +tag +tail +talent +talk +tank +tape +target +task +taste +tattoo +taxi +teach +team +tell +ten +tenant +tennis +tent +term +test +text +thank +that +theme +then +theory +there +they +thing +this +thought +three +thrive +throw +thumb +thunder +ticket +tide +tiger +tilt +timber +time +tiny +tip +tired +tissue +title +toast +tobacco +today +toddler +toe +together +toilet +token +tomato +tomorrow +tone +tongue +tonight +tool +tooth +top +topic +topple +torch +tornado +tortoise +toss +total +tourist +toward +tower +town +toy +track +trade +traffic +tragic +train +transfer +trap +trash +travel +tray +treat +tree +trend +trial +tribe +trick +trigger +trim +trip +trophy +trouble +truck +true +truly +trumpet +trust +truth +try +tube +tuition +tumble +tuna +tunnel +turkey +turn +turtle +twelve +twenty +twice +twin +twist +two +type +typical +ugly +umbrella +unable +unaware +uncle +uncover +under +undo +unfair +unfold +unhappy +uniform +unique +unit +universe +unknown +unlock +until +unusual +unveil +update +upgrade +uphold +upon +upper +upset +urban +urge +usage +use +used +useful +useless +usual +utility +vacant +vacuum +vague +valid +valley +valve +van +vanish +vapor +various +vast +vault +vehicle +velvet +vendor +venture +venue +verb +verify +version +very +vessel +veteran +viable +vibrant +vicious +victory +video +view +village +vintage +violin +virtual +virus +visa +visit +visual +vital +vivid +vocal +voice +void +volcano +volume +vote +voyage +wage +wagon +wait +walk +wall +walnut +want +warfare +warm +warrior +wash +wasp +waste +water +wave +way +wealth +weapon +wear +weasel +weather +web +wedding +weekend +weird +welcome +west +wet +whale +what +wheat +wheel +when +where +whip +whisper +wide +width +wife +wild +will +win +window +wine +wing +wink +winner +winter +wire +wisdom +wise +wish +witness +wolf +woman +wonder +wood +wool +word +work +world +worry +worth +wrap +wreck +wrestle +wrist +write +wrong +yard +year +yellow +you +young +youth +zebra +zero +zone +zoo`.split(` +`);var Qr={};const P8=So(y6);var xl={},ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.output=ur.exists=ur.hash=ur.bytes=ur.bool=ur.number=void 0;function yh(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}ur.number=yh;function B2(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}ur.bool=B2;function dm(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}ur.bytes=dm;function L2(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");yh(e.outputLen),yh(e.blockLen)}ur.hash=L2;function F2(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}ur.exists=F2;function U2(e,t){dm(e);const n=t.outputLen;if(e.lengthnew Uint8Array(N.buffer,N.byteOffset,N.byteLength);e.u8=n;const r=N=>new Uint32Array(N.buffer,N.byteOffset,Math.floor(N.byteLength/4));e.u32=r;const i=N=>new DataView(N.buffer,N.byteOffset,N.byteLength);e.createView=i;const s=(N,M)=>N<<32-M|N>>>M;if(e.rotr=s,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");const a=Array.from({length:256},(N,M)=>M.toString(16).padStart(2,"0"));function c(N){if(!(N instanceof Uint8Array))throw new Error("Uint8Array expected");let M="";for(let U=0;U{};e.nextTick=b;async function m(N,M,U){let p=Date.now();for(let Z=0;Z=0&&Jp instanceof Uint8Array))throw new Error("Uint8Array list expected");if(N.length===1)return N[0];const M=N.reduce((p,Z)=>p+Z.length,0),U=new Uint8Array(M);for(let p=0,Z=0;pObject.prototype.toString.call(N)==="[object Object]"&&N.constructor===Object;function R(N,M){if(M!==void 0&&(typeof M!="object"||!C(M)))throw new TypeError("Options should be object or undefined");return Object.assign(N,M)}e.checkOpts=R;function $(N){const M=p=>N().update(_(p)).digest(),U=N();return M.outputLen=U.outputLen,M.blockLen=U.blockLen,M.create=()=>N(),M}e.wrapConstructor=$;function L(N){const M=(p,Z)=>N(Z).update(_(p)).digest(),U=N({});return M.outputLen=U.outputLen,M.blockLen=U.blockLen,M.create=p=>N(p),M}e.wrapConstructorWithOpts=L;function P(N=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(N));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=P})(pm);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=void 0;const t=ur,n=pm;class r extends n.Hash{constructor(a,c){super(),this.finished=!1,this.destroyed=!1,t.default.hash(a);const f=(0,n.toBytes)(c);if(this.iHash=a.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const b=this.blockLen,m=new Uint8Array(b);m.set(f.length>b?a.create().update(f).digest():f);for(let w=0;wnew r(s,a).update(c).digest();e.hmac=i,e.hmac.create=(s,a)=>new r(s,a)})(j2);Object.defineProperty(xl,"__esModule",{value:!0});xl.pbkdf2Async=xl.pbkdf2=void 0;const df=ur,R8=j2,ul=pm;function z2(e,t,n,r){df.default.hash(e);const i=(0,ul.checkOpts)({dkLen:32,asyncTick:10},r),{c:s,dkLen:a,asyncTick:c}=i;if(df.default.number(s),df.default.number(a),df.default.number(c),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const f=(0,ul.toBytes)(t),b=(0,ul.toBytes)(n),m=new Uint8Array(a),w=R8.hmac.create(e,f),_=w._cloneInto().update(b);return{c:s,dkLen:a,asyncTick:c,DK:m,PRF:w,PRFSalt:_}}function H2(e,t,n,r,i){return e.destroy(),t.destroy(),r&&r.destroy(),i.fill(0),n}function M8(e,t,n,r){const{c:i,dkLen:s,DK:a,PRF:c,PRFSalt:f}=z2(e,t,n,r);let b;const m=new Uint8Array(4),w=(0,ul.createView)(m),_=new Uint8Array(c.outputLen);for(let A=1,I=0;I{f._cloneInto(m).update(A).digestInto(A);for(let L=0;L>Fg&pf)}:{h:Number(e>>Fg&pf)|0,l:Number(e&pf)|0}}function L8(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0),U8=(e,t,n)=>e>>>n,j8=(e,t,n)=>e<<32-n|t>>>n,z8=(e,t,n)=>e>>>n|t<<32-n,H8=(e,t,n)=>e<<32-n|t>>>n,q8=(e,t,n)=>e<<64-n|t>>>n-32,K8=(e,t,n)=>e>>>n-32|t<<64-n,W8=(e,t)=>t,V8=(e,t)=>e,G8=(e,t,n)=>e<>>32-n,Y8=(e,t,n)=>t<>>32-n,Z8=(e,t,n)=>t<>>64-n,J8=(e,t,n)=>e<>>64-n;function X8(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}const Q8=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),e$=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,t$=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),n$=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,r$=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),i$=(e,t,n,r,i,s)=>t+n+r+i+s+(e/2**32|0)|0,Ht={fromBig:q2,split:L8,toBig:F8,shrSH:U8,shrSL:j8,rotrSH:z8,rotrSL:H8,rotrBH:q8,rotrBL:K8,rotr32H:W8,rotr32L:V8,rotlSH:G8,rotlSL:Y8,rotlBH:Z8,rotlBL:J8,add:X8,add3L:Q8,add3H:e$,add4L:t$,add4H:n$,add5H:i$,add5L:r$},[s$,o$]=Ht.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),io=new Uint32Array(80),so=new Uint32Array(80);class gu extends nm{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:r,Bl:i,Ch:s,Cl:a,Dh:c,Dl:f,Eh:b,El:m,Fh:w,Fl:_,Gh:A,Gl:I,Hh:C,Hl:R}=this;return[t,n,r,i,s,a,c,f,b,m,w,_,A,I,C,R]}set(t,n,r,i,s,a,c,f,b,m,w,_,A,I,C,R){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=f|0,this.Eh=b|0,this.El=m|0,this.Fh=w|0,this.Fl=_|0,this.Gh=A|0,this.Gl=I|0,this.Hh=C|0,this.Hl=R|0}process(t,n){for(let P=0;P<16;P++,n+=4)io[P]=t.getUint32(n),so[P]=t.getUint32(n+=4);for(let P=16;P<80;P++){const N=io[P-15]|0,M=so[P-15]|0,U=Ht.rotrSH(N,M,1)^Ht.rotrSH(N,M,8)^Ht.shrSH(N,M,7),p=Ht.rotrSL(N,M,1)^Ht.rotrSL(N,M,8)^Ht.shrSL(N,M,7),Z=io[P-2]|0,J=so[P-2]|0,ce=Ht.rotrSH(Z,J,19)^Ht.rotrBH(Z,J,61)^Ht.shrSH(Z,J,6),me=Ht.rotrSL(Z,J,19)^Ht.rotrBL(Z,J,61)^Ht.shrSL(Z,J,6),ke=Ht.add4L(p,me,so[P-7],so[P-16]),we=Ht.add4H(ke,U,ce,io[P-7],io[P-16]);io[P]=we|0,so[P]=ke|0}let{Ah:r,Al:i,Bh:s,Bl:a,Ch:c,Cl:f,Dh:b,Dl:m,Eh:w,El:_,Fh:A,Fl:I,Gh:C,Gl:R,Hh:$,Hl:L}=this;for(let P=0;P<80;P++){const N=Ht.rotrSH(w,_,14)^Ht.rotrSH(w,_,18)^Ht.rotrBH(w,_,41),M=Ht.rotrSL(w,_,14)^Ht.rotrSL(w,_,18)^Ht.rotrBL(w,_,41),U=w&A^~w&C,p=_&I^~_&R,Z=Ht.add5L(L,M,p,o$[P],so[P]),J=Ht.add5H(Z,$,N,U,s$[P],io[P]),ce=Z|0,me=Ht.rotrSH(r,i,28)^Ht.rotrBH(r,i,34)^Ht.rotrBH(r,i,39),ke=Ht.rotrSL(r,i,28)^Ht.rotrBL(r,i,34)^Ht.rotrBL(r,i,39),we=r&s^r&c^s&c,Q=i&a^i&f^a&f;$=C|0,L=R|0,C=A|0,R=I|0,A=w|0,I=_|0,{h:w,l:_}=Ht.add(b|0,m|0,J|0,ce|0),b=c|0,m=f|0,c=s|0,f=a|0,s=r|0,a=i|0;const G=Ht.add3L(ce,ke,Q);r=Ht.add3H(G,J,me,we),i=G|0}({h:r,l:i}=Ht.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:s,l:a}=Ht.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:f}=Ht.add(this.Ch|0,this.Cl|0,c|0,f|0),{h:b,l:m}=Ht.add(this.Dh|0,this.Dl|0,b|0,m|0),{h:w,l:_}=Ht.add(this.Eh|0,this.El|0,w|0,_|0),{h:A,l:I}=Ht.add(this.Fh|0,this.Fl|0,A|0,I|0),{h:C,l:R}=Ht.add(this.Gh|0,this.Gl|0,C|0,R|0),{h:$,l:L}=Ht.add(this.Hh|0,this.Hl|0,$|0,L|0),this.set(r,i,s,a,c,f,b,m,w,_,A,I,C,R,$,L)}roundClean(){io.fill(0),so.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class a$ extends gu{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class l$ extends gu{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class c$ extends gu{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const Ug=Eo(()=>new gu),u$=Eo(()=>new a$),f$=Eo(()=>new l$),h$=Eo(()=>new c$),d$=Object.freeze(Object.defineProperty({__proto__:null,SHA512:gu,sha384:h$,sha512:Ug,sha512_224:u$,sha512_256:f$},Symbol.toStringTag,{value:"Module"})),p$=So(d$),g$=So(E6),K2=So($8);Object.defineProperty(Qr,"__esModule",{value:!0});var W2=Qr.mnemonicToSeedSync=Qr.mnemonicToSeed=nx=Qr.validateMnemonic=Qr.entropyToMnemonic=Qr.mnemonicToEntropy=X2=Qr.generateMnemonic=void 0;/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */const V2=P8,G2=xl,y$=B8,Y2=p$,m$=g$,gf=K2,v$=e=>e[0]==="あいこくしん";function Z2(e){if(typeof e!="string")throw new TypeError(`Invalid mnemonic type: ${typeof e}`);return e.normalize("NFKD")}function gm(e){const t=Z2(e),n=t.split(" ");if(![12,15,18,21,24].includes(n.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:n}}function J2(e){V2.default.bytes(e,16,20,24,28,32)}function b$(e,t=128){if(V2.default.number(t),t%32!==0||t>256)throw new TypeError("Invalid entropy");return tx((0,m$.randomBytes)(t/8),e)}var X2=Qr.generateMnemonic=b$;const w$=e=>{const t=8-e.length/4;return new Uint8Array([(0,y$.sha256)(e)[0]>>t<{if(typeof t!="string")throw new Error(`Wordlist: non-string element: ${t}`)}),gf.utils.chain(gf.utils.checksum(1,w$),gf.utils.radix2(11,!0),gf.utils.alphabet(e))}function ex(e,t){const{words:n}=gm(e),r=Q2(t).decode(n);return J2(r),r}Qr.mnemonicToEntropy=ex;function tx(e,t){return J2(e),Q2(t).encode(e).join(v$(t)?" ":" ")}Qr.entropyToMnemonic=tx;function _$(e,t){try{ex(e,t)}catch{return!1}return!0}var nx=Qr.validateMnemonic=_$;const rx=e=>Z2(`mnemonic${e}`);function x$(e,t=""){return(0,G2.pbkdf2Async)(Y2.sha512,gm(e).nfkd,rx(t),{c:2048,dkLen:64})}Qr.mnemonicToSeed=x$;function k$(e,t=""){return(0,G2.pbkdf2)(Y2.sha512,gm(e).nfkd,rx(t),{c:2048,dkLen:64})}W2=Qr.mnemonicToSeedSync=k$;const S$=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),ix=Uint8Array.from({length:16},(e,t)=>t),E$=ix.map(e=>(9*e+5)%16);let ym=[ix],mm=[E$];for(let e=0;e<4;e++)for(let t of[ym,mm])t.push(t[e].map(n=>S$[n]));const sx=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),A$=ym.map((e,t)=>e.map(n=>sx[t][n])),C$=mm.map((e,t)=>e.map(n=>sx[t][n])),T$=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),I$=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),yf=(e,t)=>e<>>32-t;function j1(e,t,n,r){return e===0?t^n^r:e===1?t&n|~t&r:e===2?(t|~n)^r:e===3?t&r|n&~r:t^(n|~r)}const mf=new Uint32Array(16);class $$ extends nm{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:n,h2:r,h3:i,h4:s}=this;return[t,n,r,i,s]}set(t,n,r,i,s){this.h0=t|0,this.h1=n|0,this.h2=r|0,this.h3=i|0,this.h4=s|0}process(t,n){for(let A=0;A<16;A++,n+=4)mf[A]=t.getUint32(n,!0);let r=this.h0|0,i=r,s=this.h1|0,a=s,c=this.h2|0,f=c,b=this.h3|0,m=b,w=this.h4|0,_=w;for(let A=0;A<5;A++){const I=4-A,C=T$[A],R=I$[A],$=ym[A],L=mm[A],P=A$[A],N=C$[A];for(let M=0;M<16;M++){const U=yf(r+j1(A,s,c,b)+mf[$[M]]+C,P[M])+w|0;r=w,w=b,b=yf(c,10)|0,c=s,s=U}for(let M=0;M<16;M++){const U=yf(i+j1(I,a,f,m)+mf[L[M]]+R,N[M])+_|0;i=_,_=m,m=yf(f,10)|0,f=a,a=U}}this.set(this.h1+c+m|0,this.h2+b+_|0,this.h3+w+i|0,this.h4+r+a|0,this.h0+s+f|0)}roundClean(){mf.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const P$=Eo(()=>new $$),vf=kr.ProjectivePoint,Kp=$2(ni);function z1(e){return BigInt(`0x${cr(e)}`)}function O$(e){return bo(e.toString(16).padStart(64,"0"))}const N$=em("Bitcoin seed"),Wp={private:76066276,public:76067358},Vp=2147483648,R$=e=>P$(ni(e)),M$=e=>ha(e).getUint32(0,!1),bf=e=>{if(!Number.isSafeInteger(e)||e<0||e>2**32-1)throw new Error(`Invalid number=${e}. Should be from 0 to 2 ** 32 - 1`);const t=new Uint8Array(4);return ha(t).setUint32(0,e,!1),t};class ra{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return M$(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){const t=this.privateKey;if(!t)throw new Error("No private key");return Kp.encode(this.serialize(this.versions.private,oa(new Uint8Array([0]),t)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return Kp.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(t,n=Wp){if(co(t),8*t.length<128||8*t.length>512)throw new Error(`HDKey: wrong seed length=${t.length}. Should be between 128 and 512 bits; 256 bits is advised)`);const r=fh(Ug,N$,t);return new ra({versions:n,chainCode:r.slice(32),privateKey:r.slice(0,32)})}static fromExtendedKey(t,n=Wp){const r=Kp.decode(t),i=ha(r),s=i.getUint32(0,!1),a={versions:n,depth:r[4],parentFingerprint:i.getUint32(5,!1),index:i.getUint32(9,!1),chainCode:r.slice(13,45)},c=r.slice(45),f=c[0]===0;if(s!==n[f?"private":"public"])throw new Error("Version mismatch");return f?new ra({...a,privateKey:c.slice(1)}):new ra({...a,publicKey:c})}static fromJSON(t){return ra.fromExtendedKey(t.xpriv)}constructor(t){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!t||typeof t!="object")throw new Error("HDKey.constructor must not be called directly");if(this.versions=t.versions||Wp,this.depth=t.depth||0,this.chainCode=t.chainCode,this.index=t.index||0,this.parentFingerprint=t.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(t.publicKey&&t.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(t.privateKey){if(!kr.utils.isValidPrivateKey(t.privateKey))throw new Error("Invalid private key");this.privKey=typeof t.privateKey=="bigint"?t.privateKey:z1(t.privateKey),this.privKeyBytes=O$(this.privKey),this.pubKey=kr.getPublicKey(t.privateKey,!0)}else if(t.publicKey)this.pubKey=vf.fromHex(t.publicKey).toRawBytes(!0);else throw new Error("HDKey: no public or private key provided");this.pubHash=R$(this.pubKey)}derive(t){if(!/^[mM]'?/.test(t))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(t))return this;const n=t.replace(/^[mM]'?\//,"").split("/");let r=this;for(const i of n){const s=/^(\d+)('?)$/.exec(i);if(!s||s.length!==3)throw new Error(`Invalid child index: ${i}`);let a=+s[1];if(!Number.isSafeInteger(a)||a>=Vp)throw new Error("Invalid index");s[2]==="'"&&(a+=Vp),r=r.deriveChild(a)}return r}deriveChild(t){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let n=bf(t);if(t>=Vp){const c=this.privateKey;if(!c)throw new Error("Could not derive hardened child key");n=oa(new Uint8Array([0]),c,n)}else n=oa(this.pubKey,n);const r=fh(Ug,this.chainCode,n),i=z1(r.slice(0,32)),s=r.slice(32);if(!kr.utils.isValidPrivateKey(i))throw new Error("Tweak bigger than curve order");const a={versions:this.versions,chainCode:s,depth:this.depth+1,parentFingerprint:this.fingerprint,index:t};try{if(this.privateKey){const c=Wn(this.privKey+i,kr.CURVE.n);if(!kr.utils.isValidPrivateKey(c))throw new Error("The tweak was out of range or the resulted private key is invalid");a.privateKey=c}else{const c=vf.fromHex(this.pubKey).add(vf.fromPrivateKey(i));if(c.equals(vf.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");a.publicKey=c.toRawBytes(!0)}return new ra(a)}catch{return this.deriveChild(t+1)}}sign(t){if(!this.privateKey)throw new Error("No privateKey set!");return co(t,32),kr.sign(t,this.privKey).toCompactRawBytes()}verify(t,n){if(co(t,32),co(n,64),!this.publicKey)throw new Error("No publicKey set!");let r;try{r=kr.Signature.fromCompact(n)}catch{return!1}return kr.verify(r,t,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(t,n){if(!this.chainCode)throw new Error("No chainCode set");return co(n,33),oa(bf(t),new Uint8Array([this.depth]),bf(this.parentFingerprint),bf(this.index),this.chainCode,n)}}var D$=Object.defineProperty,pr=(e,t)=>{for(var n in t)D$(e,n,{get:t[n],enumerable:!0})};function B$(){return cr(Il.utils.randomPrivateKey())}function mh(e){return cr(Il.getPublicKey(e))}var L$={};pr(L$,{insertEventIntoAscendingList:()=>j$,insertEventIntoDescendingList:()=>U$,normalizeURL:()=>F$,utf8Decoder:()=>uo,utf8Encoder:()=>os});var uo=new TextDecoder("utf-8"),os=new TextEncoder;function F$(e){let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),(t.port==="80"&&t.protocol==="ws:"||t.port==="443"&&t.protocol==="wss:")&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}function U$(e,t){var a;let n=0,r=e.length-1,i,s=n;if(r<0)s=0;else if(t.created_at=e[n].created_at)s=n;else for(;;){if(r<=n+1){s=r;break}if(i=Math.floor(n+(r-n)/2),e[i].created_at>t.created_at)n=i;else if(e[i].created_ate[r].created_at)s=r+1;else if(t.created_at<=e[n].created_at)s=n;else for(;;){if(r<=n+1){s=r;break}if(i=Math.floor(n+(r-n)/2),e[i].created_att.created_at)r=i;else{s=i;break}}return((a=e[s])==null?void 0:a.id)!==t.id?[...e.slice(0,s),t,...e.slice(s)]:e}var Kn=(e=>(e[e.Metadata=0]="Metadata",e[e.Text=1]="Text",e[e.RecommendRelay=2]="RecommendRelay",e[e.Contacts=3]="Contacts",e[e.EncryptedDirectMessage=4]="EncryptedDirectMessage",e[e.EventDeletion=5]="EventDeletion",e[e.Repost=6]="Repost",e[e.Reaction=7]="Reaction",e[e.BadgeAward=8]="BadgeAward",e[e.ChannelCreation=40]="ChannelCreation",e[e.ChannelMetadata=41]="ChannelMetadata",e[e.ChannelMessage=42]="ChannelMessage",e[e.ChannelHideMessage=43]="ChannelHideMessage",e[e.ChannelMuteUser=44]="ChannelMuteUser",e[e.Blank=255]="Blank",e[e.Report=1984]="Report",e[e.ZapRequest=9734]="ZapRequest",e[e.Zap=9735]="Zap",e[e.RelayList=10002]="RelayList",e[e.ClientAuth=22242]="ClientAuth",e[e.BadgeDefinition=30008]="BadgeDefinition",e[e.ProfileBadge=30009]="ProfileBadge",e[e.Article=30023]="Article",e))(Kn||{});function ox(e,t){let n=e;return n.pubkey=mh(t),n.id=Zc(n),n.sig=ax(n,t),n}function z$(e){if(!vm(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}function Zc(e){let t=ni(os.encode(z$(e)));return cr(t)}var H$=e=>e instanceof Object;function vm(e){if(!H$(e)||typeof e.kind!="number"||typeof e.content!="string"||typeof e.created_at!="number"||typeof e.pubkey!="string"||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;tt.id.startsWith(n))||e.kinds&&e.kinds.indexOf(t.kind)===-1||e.authors&&e.authors.indexOf(t.pubkey)===-1&&!e.authors.some(n=>t.pubkey.startsWith(n)))return!1;for(let n in e)if(n[0]==="#"){let r=n.slice(1),i=e[`#${r}`];if(i&&!t.tags.find(([s,a])=>s===n.slice(1)&&i.indexOf(a)!==-1))return!1}return!(e.since&&t.created_at=e.until)}function K$(e,t){for(let n=0;nwm,getInt:()=>lx,getSubscriptionId:()=>V$,matchEventId:()=>G$,matchEventKind:()=>Z$,matchEventPubkey:()=>Y$});function wm(e,t){let n=t.length+3,r=e.indexOf(`"${t}":`)+n,i=e.slice(r).indexOf('"')+r+1;return e.slice(i,i+64)}function lx(e,t){let n=t.length,r=e.indexOf(`"${t}":`)+n+3,i=e.slice(r),s=Math.min(i.indexOf(","),i.indexOf("}"));return parseInt(i.slice(0,s),10)}function V$(e){let t=e.slice(0,22).indexOf('"EVENT"');if(t===-1)return null;let n=e.slice(t+7+1).indexOf('"');if(n===-1)return null;let r=t+7+1+n,i=e.slice(r+1,80).indexOf('"');if(i===-1)return null;let s=r+1+i;return e.slice(r+1,s)}function G$(e,t){return t===wm(e,"id")}function Y$(e,t){return t===wm(e,"pubkey")}function Z$(e,t){return t===lx(e,"kind")}var vh={};pr(vh,{BECH32_REGEX:()=>cx,decode:()=>ld,naddrEncode:()=>nP,neventEncode:()=>tP,noteEncode:()=>Q$,nprofileEncode:()=>eP,npubEncode:()=>X$,nrelayEncode:()=>rP,nsecEncode:()=>J$});var $l=5e3,cx=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function ld(e){var i,s,a,c,f,b,m;let{prefix:t,words:n}=Cr.decode(e,$l),r=new Uint8Array(Cr.fromWords(n));switch(t){case"nprofile":{let w=wf(r);if(!((i=w[0])!=null&&i[0]))throw new Error("missing TLV 0 for nprofile");if(w[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:cr(w[0][0]),relays:w[1]?w[1].map(_=>uo.decode(_)):[]}}}case"nevent":{let w=wf(r);if(!((s=w[0])!=null&&s[0]))throw new Error("missing TLV 0 for nevent");if(w[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");if(w[2]&&w[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");return{type:"nevent",data:{id:cr(w[0][0]),relays:w[1]?w[1].map(_=>uo.decode(_)):[],author:(a=w[2])!=null&&a[0]?cr(w[2][0]):void 0}}}case"naddr":{let w=wf(r);if(!((c=w[0])!=null&&c[0]))throw new Error("missing TLV 0 for naddr");if(!((f=w[2])!=null&&f[0]))throw new Error("missing TLV 2 for naddr");if(w[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(!((b=w[3])!=null&&b[0]))throw new Error("missing TLV 3 for naddr");if(w[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:uo.decode(w[0][0]),pubkey:cr(w[2][0]),kind:parseInt(cr(w[3][0]),16),relays:w[1]?w[1].map(_=>uo.decode(_)):[]}}}case"nrelay":{let w=wf(r);if(!((m=w[0])!=null&&m[0]))throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:uo.decode(w[0][0])}}case"nsec":case"npub":case"note":return{type:t,data:cr(r)};default:throw new Error(`unknown prefix ${t}`)}}function wf(e){let t={},n=e;for(;n.length>0;){let r=n[0],i=n[1],s=n.slice(2,2+i);n=n.slice(2+i),!(s.lengthos.encode(r))}),n=Cr.toWords(t);return Cr.encode("nprofile",n,$l)}function tP(e){let t=cd({0:[bo(e.id)],1:(e.relays||[]).map(r=>os.encode(r)),2:e.author?[bo(e.author)]:[]}),n=Cr.toWords(t);return Cr.encode("nevent",n,$l)}function nP(e){let t=new ArrayBuffer(4);new DataView(t).setUint32(0,e.kind,!1);let n=cd({0:[os.encode(e.identifier)],1:(e.relays||[]).map(i=>os.encode(i)),2:[bo(e.pubkey)],3:[new Uint8Array(t)]}),r=Cr.toWords(n);return Cr.encode("naddr",r,$l)}function rP(e){let t=cd({0:[os.encode(e)]}),n=Cr.toWords(t);return Cr.encode("nrelay",n,$l)}function cd(e){let t=[];return Object.entries(e).forEach(([n,r])=>{r.forEach(i=>{let s=new Uint8Array(i.length+2);s.set([parseInt(n)],0),s.set([i.length],1),s.set(i,2),t.push(s)})}),oa(...t)}var jg={};pr(jg,{decrypt:()=>sP,encrypt:()=>iP});typeof crypto<"u"&&!crypto.subtle&&crypto.webcrypto&&(crypto.subtle=crypto.webcrypto.subtle);async function iP(e,t,n){const r=kr.getSharedSecret(e,"02"+t),i=ux(r);let s=Uint8Array.from(nd(16)),a=os.encode(n),c=await crypto.subtle.importKey("raw",i,{name:"AES-CBC"},!1,["encrypt"]),f=await crypto.subtle.encrypt({name:"AES-CBC",iv:s},c,a),b=_l.encode(new Uint8Array(f)),m=_l.encode(new Uint8Array(s.buffer));return`${b}?iv=${m}`}async function sP(e,t,n){let[r,i]=n.split("?iv="),s=kr.getSharedSecret(e,"02"+t),a=ux(s),c=await crypto.subtle.importKey("raw",a,{name:"AES-CBC"},!1,["decrypt"]),f=_l.decode(r),b=_l.decode(i),m=await crypto.subtle.decrypt({name:"AES-CBC",iv:b},c,f);return uo.decode(m)}function ux(e){return e.slice(1,33)}var oP={};pr(oP,{NIP05_REGEX:()=>fx,queryProfile:()=>cP,searchDomain:()=>lP,useFetchImplementation:()=>aP});var fx=/^(?:([\w.+-]+)@)?([\w.-]+)$/,ud;try{ud=fetch}catch{}function aP(e){ud=e}async function lP(e,t=""){try{return(await(await ud(`https://${e}/.well-known/nostr.json?name=${t}`)).json()).names}catch{return{}}}async function cP(e){const t=e.match(fx);if(!t)return null;const[n,r="_",i]=t;try{const s=await ud(`https://${i}/.well-known/nostr.json?name=${r}`),{names:a,relays:c}=uP(await s.json()),f=a[r];return f?{pubkey:f,relays:c==null?void 0:c[f]}:null}catch{return null}}function uP(e){const t={names:{}};for(const[n,r]of Object.entries(e.names))typeof n=="string"&&typeof r=="string"&&(t.names[n]=r);if(e.relays){t.relays={};for(const[n,r]of Object.entries(e.relays))typeof n=="string"&&Array.isArray(r)&&(t.relays[n]=r.filter(i=>typeof i=="string"))}return t}var fP={};pr(fP,{generateSeedWords:()=>dP,privateKeyFromSeedWords:()=>hP,validateWords:()=>pP});function hP(e,t){let r=ra.fromMasterSeed(W2(e,t)).derive("m/44'/1237'/0'/0/0").privateKey;if(!r)throw new Error("could not derive private key");return cr(r)}function dP(){return X2(hm)}function pP(e){return nx(e,hm)}var gP={};pr(gP,{parse:()=>yP});function yP(e){const t={reply:void 0,root:void 0,mentions:[],profiles:[]},n=[];for(const r of e.tags)r[0]==="e"&&r[1]&&n.push(r),r[0]==="p"&&r[1]&&t.profiles.push({pubkey:r[1],relays:r[2]?[r[2]]:[]});for(let r=0;rvP});function vP(e){return bP(bo(e))}function bP(e){let t,n,r;for(n=0,t=0;n>=1;)t++;return 7-t}var _P={};pr(_P,{finishRepostEvent:()=>xP,getRepostedEvent:()=>kP,getRepostedEventPointer:()=>hx});function xP(e,t,n,r){return ox({kind:6,tags:[...e.tags??[],["e",t.id,n],["p",t.pubkey]],content:e.content===""?"":JSON.stringify(t),created_at:e.created_at},r)}function hx(e){if(e.kind!==6)return;let t,n;for(let r=e.tags.length-1;r>=0&&(t===void 0||n===void 0);r--){const i=e.tags[r];i.length>=2&&(i[0]==="e"&&t===void 0?t=i:i[0]==="p"&&n===void 0&&(n=i))}if(t!==void 0)return{id:t[1],relays:[t[2],n==null?void 0:n[2]].filter(r=>typeof r=="string"),author:n==null?void 0:n[1]}}function kP(e,{skipVerification:t}={}){const n=hx(e);if(n===void 0||e.content==="")return;let r;try{r=JSON.parse(e.content)}catch{return}if(r.id===n.id&&!(!t&&!bm(r)))return r}var SP={};pr(SP,{NOSTR_URI_REGEX:()=>fd,parse:()=>AP,test:()=>EP});var fd=new RegExp(`nostr:(${cx.source})`);function EP(e){return typeof e=="string"&&new RegExp(`^${fd.source}$`).test(e)}function AP(e){const t=e.match(new RegExp(`^${fd.source}$`));if(!t)throw new Error(`Invalid Nostr URI: ${e}`);return{uri:t[0],value:t[1],decoded:ld(t[1])}}var CP={};pr(CP,{finishReactionEvent:()=>TP,getReactedEventPointer:()=>IP});function TP(e,t,n){const r=t.tags.filter(i=>i.length>=2&&(i[0]==="e"||i[0]==="p"));return ox({...e,kind:7,tags:[...e.tags??[],...r,["e",t.id],["p",t.pubkey]],content:e.content??"+"},n)}function IP(e){if(e.kind!==7)return;let t,n;for(let r=e.tags.length-1;r>=0&&(t===void 0||n===void 0);r--){const i=e.tags[r];i.length>=2&&(i[0]==="e"&&t===void 0?t=i:i[0]==="p"&&n===void 0&&(n=i))}if(!(t===void 0||n===void 0))return{id:t[1],relays:[t[2],n[2]].filter(r=>r!==void 0),author:n[1]}}var $P={};pr($P,{createDelegation:()=>PP,getDelegator:()=>OP});function PP(e,t){let n=[];(t.kind||-1)>=0&&n.push(`kind=${t.kind}`),t.until&&n.push(`created_at<${t.until}`),t.since&&n.push(`created_at>${t.since}`);let r=n.join("&");if(r==="")throw new Error("refusing to create a delegation without any conditions");let i=ni(os.encode(`nostr:delegation:${t.pubkey}:${r}`)),s=cr(Il.sign(i,e));return{from:mh(e),to:t.pubkey,cond:r,sig:s}}function OP(e){let t=e.tags.find(c=>c[0]==="delegation"&&c.length>=4);if(!t)return null;let n=t[1],r=t[2],i=t[3],s=r.split("&");for(let c=0;c"&&e.created_at>parseInt(m))continue;return null}}let a=ni(os.encode(`nostr:delegation:${e.pubkey}:${r}`));return Il.verify(i,a,n)?n:null}var NP={};pr(NP,{matchAll:()=>RP,regex:()=>xm,replaceAll:()=>MP});var xm=()=>new RegExp(`\\b${fd.source}\\b`,"g");function*RP(e){const t=e.matchAll(xm());for(const n of t){const[r,i]=n;yield{uri:r,value:i,decoded:ld(i),start:n.index,end:n.index+r.length}}}function MP(e,t){return e.replaceAll(xm(),(n,r)=>t({uri:n,value:r,decoded:ld(r)}))}var DP={};pr(DP,{useFetchImplementation:()=>BP,validateGithub:()=>LP});var km;try{km=fetch}catch{}function BP(e){km=e}async function LP(e,t,n){try{return await(await km(`https://gist.github.com/${t}/${n}/raw`)).text()===`Verifying that I control the following Nostr public key: ${e}`}catch{return!1}}var dx={};pr(dx,{authenticate:()=>FP});var FP=async({challenge:e,relay:t,sign:n})=>{const r={kind:22242,created_at:Math.floor(Date.now()/1e3),tags:[["relay",t.url],["challenge",e]],content:""},i=t.auth(await n(r));return new Promise((s,a)=>{i.on("ok",function c(){i.off("ok",c),s()}),i.on("failed",function c(f){i.off("failed",c),a(f)})})},UP={};pr(UP,{getZapEndpoint:()=>zP,makeZapReceipt:()=>KP,makeZapRequest:()=>HP,useFetchImplementation:()=>jP,validateZapRequest:()=>qP});var Sm;try{Sm=fetch}catch{}function jP(e){Sm=e}async function zP(e){try{let t="",{lud06:n,lud16:r}=JSON.parse(e.content);if(n){let{words:a}=Cr.decode(n,1e3),c=Cr.fromWords(a);t=uo.decode(c)}else if(r){let[a,c]=r.split("@");t=`https://${c}/.well-known/lnurlp/${a}`}else return null;let s=await(await Sm(t)).json();if(s.allowsNostr&&s.nostrPubkey)return s.callback}catch{}return null}function HP({profile:e,event:t,amount:n,relays:r,comment:i=""}){if(!n)throw new Error("amount not given");if(!e)throw new Error("profile not given");let s={kind:9734,created_at:Math.round(Date.now()/1e3),content:i,tags:[["p",e],["amount",n.toString()],["relays",...r]]};return t&&s.tags.push(["e",t]),s}function qP(e){let t;try{t=JSON.parse(e)}catch{return"Invalid zap request JSON."}if(!vm(t))return"Zap request is not a valid Nostr event.";if(!bm(t))return"Invalid signature on zap request.";let n=t.tags.find(([s,a])=>s==="p"&&a);if(!n)return"Zap request doesn't have a 'p' tag.";if(!n[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let r=t.tags.find(([s,a])=>s==="e"&&a);return r&&!r[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":t.tags.find(([s,a])=>s==="relays"&&a)?null:"Zap request doesn't have a 'relays' tag."}function KP({zapRequest:e,preimage:t,bolt11:n,paidAt:r}){let s=JSON.parse(e).tags.filter(([c])=>c==="e"||c==="p"||c==="a"),a={kind:9735,created_at:Math.round(r.getTime()/1e3),content:"",tags:[...s,["bolt11",n],["description",e]]};return t&&a.tags.push(["preimage",t]),a}var WP=function(e){return e instanceof RegExp},VP=function(t){var n=/[\\^$.*+?()[\]{}|]/g,r=RegExp(n.source);return t&&r.test(t)?t.replace(n,"\\$&"):t},px=function(e){return typeof e=="string"},GP=function(e){var t=[];return e.forEach(function(n){Array.isArray(n)?t=t.concat(n):t.push(n)}),t};function YP(e,t,n){var r=0,i=0;if(e==="")return e;if(!e||!px(e))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var s=t;WP(s)||(s=new RegExp("("+VP(s)+")","gi"));for(var a=e.split(s),c=1,f=a.length;c>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function H1(e){let t=1;for(let n=0;n126)return"Invalid prefix ("+e+")";t=fl(t)^r>>5}t=fl(t);for(let n=0;n=n;)s-=n,c.push(i>>s&a);if(r)s>0&&c.push(i<=t)return"Excess padding";if(i<f)throw new TypeError("Exceeds length limit");a=a.toLowerCase();let b=H1(a);if(typeof b=="string")throw new Error(b);let m=a+"1";for(let w=0;w>5)throw new Error("Non 5-bit word");b=fl(b)^_,m+=bh.charAt(_)}for(let w=0;w<6;++w)b=fl(b);b^=t;for(let w=0;w<6;++w){const _=b>>(5-w)*5&31;m+=bh.charAt(_)}return m}function r(a,c){if(c=c||90,a.length<8)return a+" too short";if(a.length>c)return"Exceeds length limit";const f=a.toLowerCase(),b=a.toUpperCase();if(a!==f&&a!==b)return"Mixed-case string "+a;a=f;const m=a.lastIndexOf("1");if(m===-1)return"No separator character for "+a;if(m===0)return"Missing prefix for "+a;const w=a.slice(0,m),_=a.slice(m+1);if(_.length<6)return"Data too short";let A=H1(w);if(typeof A=="string")return A;const I=[];for(let C=0;C<_.length;++C){const R=_.charAt(C),$=gx[R];if($===void 0)return"Unknown character "+R;A=fl(A)^$,!(C+6>=_.length)&&I.push($)}return A!==t?"Invalid checksum for "+a:{prefix:w,words:I}}function i(a,c){const f=r(a,c);if(typeof f=="object")return f}function s(a,c){const f=r(a,c);if(typeof f=="object")return f;throw new Error(f)}return{decodeUnsafe:i,decode:s,encode:n,toWords:JP,fromWordsUnsafe:XP,fromWords:QP}}var zg=Jc.bech32=yx("bech32");Jc.bech32m=yx("bech32m");var mx={exports:{}};/*! + * jQuery JavaScript Library v3.7.0 + * https://jquery.com/ + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2023-05-11T18:29Z + */(function(e){(function(t,n){e.exports=t.document?n(t,!0):function(r){if(!r.document)throw new Error("jQuery requires a window with a document");return n(r)}})(typeof window<"u"?window:Dn,function(t,n){var r=[],i=Object.getPrototypeOf,s=r.slice,a=r.flat?function(u){return r.flat.call(u)}:function(u){return r.concat.apply([],u)},c=r.push,f=r.indexOf,b={},m=b.toString,w=b.hasOwnProperty,_=w.toString,A=_.call(Object),I={},C=function(y){return typeof y=="function"&&typeof y.nodeType!="number"&&typeof y.item!="function"},R=function(y){return y!=null&&y===y.window},$=t.document,L={type:!0,src:!0,nonce:!0,noModule:!0};function P(u,y,x){x=x||$;var E,D,B=x.createElement("script");if(B.text=u,y)for(E in L)D=y[E]||y.getAttribute&&y.getAttribute(E),D&&B.setAttribute(E,D);x.head.appendChild(B).parentNode.removeChild(B)}function N(u){return u==null?u+"":typeof u=="object"||typeof u=="function"?b[m.call(u)]||"object":typeof u}var M="3.7.0",U=/HTML$/i,p=function(u,y){return new p.fn.init(u,y)};p.fn=p.prototype={jquery:M,constructor:p,length:0,toArray:function(){return s.call(this)},get:function(u){return u==null?s.call(this):u<0?this[u+this.length]:this[u]},pushStack:function(u){var y=p.merge(this.constructor(),u);return y.prevObject=this,y},each:function(u){return p.each(this,u)},map:function(u){return this.pushStack(p.map(this,function(y,x){return u.call(y,x,y)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(p.grep(this,function(u,y){return(y+1)%2}))},odd:function(){return this.pushStack(p.grep(this,function(u,y){return y%2}))},eq:function(u){var y=this.length,x=+u+(u<0?y:0);return this.pushStack(x>=0&&x0&&y-1 in u}function J(u,y){return u.nodeName&&u.nodeName.toLowerCase()===y.toLowerCase()}var ce=r.pop,me=r.sort,ke=r.splice,we="[\\x20\\t\\r\\n\\f]",Q=new RegExp("^"+we+"+|((?:^|[^\\\\])(?:\\\\.)*)"+we+"+$","g");p.contains=function(u,y){var x=y&&y.parentNode;return u===x||!!(x&&x.nodeType===1&&(u.contains?u.contains(x):u.compareDocumentPosition&&u.compareDocumentPosition(x)&16))};var G=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function Ae(u,y){return y?u==="\0"?"�":u.slice(0,-1)+"\\"+u.charCodeAt(u.length-1).toString(16)+" ":"\\"+u}p.escapeSelector=function(u){return(u+"").replace(G,Ae)};var Te=$,qe=c;(function(){var u,y,x,E,D,B=qe,j,re,X,ge,Ie,Oe=p.expando,Ee=0,Ge=0,at=jo(),Mt=jo(),Rt=jo(),Un=jo(),An=function(Y,le){return Y===le&&(D=!0),0},fi="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",hi="(?:\\\\[\\da-fA-F]{1,6}"+we+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",Vt="\\["+we+"*("+hi+")(?:"+we+"*([*^$|!~]?=)"+we+`*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(`+hi+"))|)"+we+"*\\]",Gi=":("+hi+`)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|`+Vt+")*)|.*)\\)|)",Gt=new RegExp(we+"+","g"),sn=new RegExp("^"+we+"*,"+we+"*"),Lo=new RegExp("^"+we+"*([>+~]|"+we+")"+we+"*"),ja=new RegExp(we+"|>"),Hr=new RegExp(Gi),gs=new RegExp("^"+hi+"$"),Pr={ID:new RegExp("^#("+hi+")"),CLASS:new RegExp("^\\.("+hi+")"),TAG:new RegExp("^("+hi+"|[*])"),ATTR:new RegExp("^"+Vt),PSEUDO:new RegExp("^"+Gi),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+we+"*(even|odd|(([+-]|)(\\d*)n|)"+we+"*(?:([+-]|)"+we+"*(\\d+)|))"+we+"*\\)|)","i"),bool:new RegExp("^(?:"+fi+")$","i"),needsContext:new RegExp("^"+we+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+we+"*((?:-\\d)?\\d*)"+we+"*\\)|)(?=[^-]|$)","i")},Ci=/^(?:input|select|textarea|button)$/i,Yi=/^h\d$/i,or=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Fo=/[+~]/,Ti=new RegExp("\\\\[\\da-fA-F]{1,6}"+we+"?|\\\\([^\\r\\n\\f])","g"),di=function(Y,le){var Se="0x"+Y.slice(1)-65536;return le||(Se<0?String.fromCharCode(Se+65536):String.fromCharCode(Se>>10|55296,Se&1023|56320))},mr=function(){Zi()},ec=ys(function(Y){return Y.disabled===!0&&J(Y,"fieldset")},{dir:"parentNode",next:"legend"});function Uo(){try{return j.activeElement}catch{}}try{B.apply(r=s.call(Te.childNodes),Te.childNodes),r[Te.childNodes.length].nodeType}catch{B={apply:function(le,Se){qe.apply(le,s.call(Se))},call:function(le){qe.apply(le,s.call(arguments,1))}}}function en(Y,le,Se,Ce){var W,oe,se,Ne,Be,lt,ct,st=le&&le.ownerDocument,Ut=le?le.nodeType:9;if(Se=Se||[],typeof Y!="string"||!Y||Ut!==1&&Ut!==9&&Ut!==11)return Se;if(!Ce&&(Zi(le),le=le||j,X)){if(Ut!==11&&(Be=or.exec(Y)))if(W=Be[1]){if(Ut===9)if(se=le.getElementById(W)){if(se.id===W)return B.call(Se,se),Se}else return Se;else if(st&&(se=st.getElementById(W))&&en.contains(le,se)&&se.id===W)return B.call(Se,se),Se}else{if(Be[2])return B.apply(Se,le.getElementsByTagName(Y)),Se;if((W=Be[3])&&le.getElementsByClassName)return B.apply(Se,le.getElementsByClassName(W)),Se}if(!Un[Y+" "]&&(!ge||!ge.test(Y))){if(ct=Y,st=le,Ut===1&&(ja.test(Y)||Lo.test(Y))){for(st=Fo.test(Y)&&tc(le.parentNode)||le,(st!=le||!I.scope)&&((Ne=le.getAttribute("id"))?Ne=p.escapeSelector(Ne):le.setAttribute("id",Ne=Oe)),lt=zo(Y),oe=lt.length;oe--;)lt[oe]=(Ne?"#"+Ne:":scope")+" "+Kr(lt[oe]);ct=lt.join(",")}try{return B.apply(Se,st.querySelectorAll(ct)),Se}catch{Un(Y,!0)}finally{Ne===Oe&&le.removeAttribute("id")}}}return Ou(Y.replace(Q,"$1"),le,Se,Ce)}function jo(){var Y=[];function le(Se,Ce){return Y.push(Se+" ")>y.cacheLength&&delete le[Y.shift()],le[Se+" "]=Ce}return le}function qr(Y){return Y[Oe]=!0,Y}function Ys(Y){var le=j.createElement("fieldset");try{return!!Y(le)}catch{return!1}finally{le.parentNode&&le.parentNode.removeChild(le),le=null}}function zd(Y){return function(le){return J(le,"input")&&le.type===Y}}function Hd(Y){return function(le){return(J(le,"input")||J(le,"button"))&&le.type===Y}}function $u(Y){return function(le){return"form"in le?le.parentNode&&le.disabled===!1?"label"in le?"label"in le.parentNode?le.parentNode.disabled===Y:le.disabled===Y:le.isDisabled===Y||le.isDisabled!==!Y&&ec(le)===Y:le.disabled===Y:"label"in le?le.disabled===Y:!1}}function Or(Y){return qr(function(le){return le=+le,qr(function(Se,Ce){for(var W,oe=Y([],Se.length,le),se=oe.length;se--;)Se[W=oe[se]]&&(Se[W]=!(Ce[W]=Se[W]))})})}function tc(Y){return Y&&typeof Y.getElementsByTagName<"u"&&Y}function Zi(Y){var le,Se=Y?Y.ownerDocument||Y:Te;return Se==j||Se.nodeType!==9||!Se.documentElement||(j=Se,re=j.documentElement,X=!p.isXMLDoc(j),Ie=re.matches||re.webkitMatchesSelector||re.msMatchesSelector,Te!=j&&(le=j.defaultView)&&le.top!==le&&le.addEventListener("unload",mr),I.getById=Ys(function(Ce){return re.appendChild(Ce).id=p.expando,!j.getElementsByName||!j.getElementsByName(p.expando).length}),I.disconnectedMatch=Ys(function(Ce){return Ie.call(Ce,"*")}),I.scope=Ys(function(){return j.querySelectorAll(":scope")}),I.cssHas=Ys(function(){try{return j.querySelector(":has(*,:jqfake)"),!1}catch{return!0}}),I.getById?(y.filter.ID=function(Ce){var W=Ce.replace(Ti,di);return function(oe){return oe.getAttribute("id")===W}},y.find.ID=function(Ce,W){if(typeof W.getElementById<"u"&&X){var oe=W.getElementById(Ce);return oe?[oe]:[]}}):(y.filter.ID=function(Ce){var W=Ce.replace(Ti,di);return function(oe){var se=typeof oe.getAttributeNode<"u"&&oe.getAttributeNode("id");return se&&se.value===W}},y.find.ID=function(Ce,W){if(typeof W.getElementById<"u"&&X){var oe,se,Ne,Be=W.getElementById(Ce);if(Be){if(oe=Be.getAttributeNode("id"),oe&&oe.value===Ce)return[Be];for(Ne=W.getElementsByName(Ce),se=0;Be=Ne[se++];)if(oe=Be.getAttributeNode("id"),oe&&oe.value===Ce)return[Be]}return[]}}),y.find.TAG=function(Ce,W){return typeof W.getElementsByTagName<"u"?W.getElementsByTagName(Ce):W.querySelectorAll(Ce)},y.find.CLASS=function(Ce,W){if(typeof W.getElementsByClassName<"u"&&X)return W.getElementsByClassName(Ce)},ge=[],Ys(function(Ce){var W;re.appendChild(Ce).innerHTML="",Ce.querySelectorAll("[selected]").length||ge.push("\\["+we+"*(?:value|"+fi+")"),Ce.querySelectorAll("[id~="+Oe+"-]").length||ge.push("~="),Ce.querySelectorAll("a#"+Oe+"+*").length||ge.push(".#.+[+~]"),Ce.querySelectorAll(":checked").length||ge.push(":checked"),W=j.createElement("input"),W.setAttribute("type","hidden"),Ce.appendChild(W).setAttribute("name","D"),re.appendChild(Ce).disabled=!0,Ce.querySelectorAll(":disabled").length!==2&&ge.push(":enabled",":disabled"),W=j.createElement("input"),W.setAttribute("name",""),Ce.appendChild(W),Ce.querySelectorAll("[name='']").length||ge.push("\\["+we+"*name"+we+"*="+we+`*(?:''|"")`)}),I.cssHas||ge.push(":has"),ge=ge.length&&new RegExp(ge.join("|")),An=function(Ce,W){if(Ce===W)return D=!0,0;var oe=!Ce.compareDocumentPosition-!W.compareDocumentPosition;return oe||(oe=(Ce.ownerDocument||Ce)==(W.ownerDocument||W)?Ce.compareDocumentPosition(W):1,oe&1||!I.sortDetached&&W.compareDocumentPosition(Ce)===oe?Ce===j||Ce.ownerDocument==Te&&en.contains(Te,Ce)?-1:W===j||W.ownerDocument==Te&&en.contains(Te,W)?1:E?f.call(E,Ce)-f.call(E,W):0:oe&4?-1:1)}),j}en.matches=function(Y,le){return en(Y,null,null,le)},en.matchesSelector=function(Y,le){if(Zi(Y),X&&!Un[le+" "]&&(!ge||!ge.test(le)))try{var Se=Ie.call(Y,le);if(Se||I.disconnectedMatch||Y.document&&Y.document.nodeType!==11)return Se}catch{Un(le,!0)}return en(le,j,null,[Y]).length>0},en.contains=function(Y,le){return(Y.ownerDocument||Y)!=j&&Zi(Y),p.contains(Y,le)},en.attr=function(Y,le){(Y.ownerDocument||Y)!=j&&Zi(Y);var Se=y.attrHandle[le.toLowerCase()],Ce=Se&&w.call(y.attrHandle,le.toLowerCase())?Se(Y,le,!X):void 0;return Ce!==void 0?Ce:Y.getAttribute(le)},en.error=function(Y){throw new Error("Syntax error, unrecognized expression: "+Y)},p.uniqueSort=function(Y){var le,Se=[],Ce=0,W=0;if(D=!I.sortStable,E=!I.sortStable&&s.call(Y,0),me.call(Y,An),D){for(;le=Y[W++];)le===Y[W]&&(Ce=Se.push(W));for(;Ce--;)ke.call(Y,Se[Ce],1)}return E=null,Y},p.fn.uniqueSort=function(){return this.pushStack(p.uniqueSort(s.apply(this)))},y=p.expr={cacheLength:50,createPseudo:qr,match:Pr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(Y){return Y[1]=Y[1].replace(Ti,di),Y[3]=(Y[3]||Y[4]||Y[5]||"").replace(Ti,di),Y[2]==="~="&&(Y[3]=" "+Y[3]+" "),Y.slice(0,4)},CHILD:function(Y){return Y[1]=Y[1].toLowerCase(),Y[1].slice(0,3)==="nth"?(Y[3]||en.error(Y[0]),Y[4]=+(Y[4]?Y[5]+(Y[6]||1):2*(Y[3]==="even"||Y[3]==="odd")),Y[5]=+(Y[7]+Y[8]||Y[3]==="odd")):Y[3]&&en.error(Y[0]),Y},PSEUDO:function(Y){var le,Se=!Y[6]&&Y[2];return Pr.CHILD.test(Y[0])?null:(Y[3]?Y[2]=Y[4]||Y[5]||"":Se&&Hr.test(Se)&&(le=zo(Se,!0))&&(le=Se.indexOf(")",Se.length-le)-Se.length)&&(Y[0]=Y[0].slice(0,le),Y[2]=Se.slice(0,le)),Y.slice(0,3))}},filter:{TAG:function(Y){var le=Y.replace(Ti,di).toLowerCase();return Y==="*"?function(){return!0}:function(Se){return J(Se,le)}},CLASS:function(Y){var le=at[Y+" "];return le||(le=new RegExp("(^|"+we+")"+Y+"("+we+"|$)"))&&at(Y,function(Se){return le.test(typeof Se.className=="string"&&Se.className||typeof Se.getAttribute<"u"&&Se.getAttribute("class")||"")})},ATTR:function(Y,le,Se){return function(Ce){var W=en.attr(Ce,Y);return W==null?le==="!=":le?(W+="",le==="="?W===Se:le==="!="?W!==Se:le==="^="?Se&&W.indexOf(Se)===0:le==="*="?Se&&W.indexOf(Se)>-1:le==="$="?Se&&W.slice(-Se.length)===Se:le==="~="?(" "+W.replace(Gt," ")+" ").indexOf(Se)>-1:le==="|="?W===Se||W.slice(0,Se.length+1)===Se+"-":!1):!0}},CHILD:function(Y,le,Se,Ce,W){var oe=Y.slice(0,3)!=="nth",se=Y.slice(-4)!=="last",Ne=le==="of-type";return Ce===1&&W===0?function(Be){return!!Be.parentNode}:function(Be,lt,ct){var st,Ut,wt,Kt,jn,Yn=oe!==se?"nextSibling":"previousSibling",zn=Be.parentNode,br=Ne&&Be.nodeName.toLowerCase(),Ii=!ct&&!Ne,Ot=!1;if(zn){if(oe){for(;Yn;){for(wt=Be;wt=wt[Yn];)if(Ne?J(wt,br):wt.nodeType===1)return!1;jn=Yn=Y==="only"&&!jn&&"nextSibling"}return!0}if(jn=[se?zn.firstChild:zn.lastChild],se&&Ii){for(Ut=zn[Oe]||(zn[Oe]={}),st=Ut[Y]||[],Kt=st[0]===Ee&&st[1],Ot=Kt&&st[2],wt=Kt&&zn.childNodes[Kt];wt=++Kt&&wt&&wt[Yn]||(Ot=Kt=0)||jn.pop();)if(wt.nodeType===1&&++Ot&&wt===Be){Ut[Y]=[Ee,Kt,Ot];break}}else if(Ii&&(Ut=Be[Oe]||(Be[Oe]={}),st=Ut[Y]||[],Kt=st[0]===Ee&&st[1],Ot=Kt),Ot===!1)for(;(wt=++Kt&&wt&&wt[Yn]||(Ot=Kt=0)||jn.pop())&&!((Ne?J(wt,br):wt.nodeType===1)&&++Ot&&(Ii&&(Ut=wt[Oe]||(wt[Oe]={}),Ut[Y]=[Ee,Ot]),wt===Be)););return Ot-=W,Ot===Ce||Ot%Ce===0&&Ot/Ce>=0}}},PSEUDO:function(Y,le){var Se,Ce=y.pseudos[Y]||y.setFilters[Y.toLowerCase()]||en.error("unsupported pseudo: "+Y);return Ce[Oe]?Ce(le):Ce.length>1?(Se=[Y,Y,"",le],y.setFilters.hasOwnProperty(Y.toLowerCase())?qr(function(W,oe){for(var se,Ne=Ce(W,le),Be=Ne.length;Be--;)se=f.call(W,Ne[Be]),W[se]=!(oe[se]=Ne[Be])}):function(W){return Ce(W,0,Se)}):Ce}},pseudos:{not:qr(function(Y){var le=[],Se=[],Ce=rc(Y.replace(Q,"$1"));return Ce[Oe]?qr(function(W,oe,se,Ne){for(var Be,lt=Ce(W,null,Ne,[]),ct=W.length;ct--;)(Be=lt[ct])&&(W[ct]=!(oe[ct]=Be))}):function(W,oe,se){return le[0]=W,Ce(le,null,se,Se),le[0]=null,!Se.pop()}}),has:qr(function(Y){return function(le){return en(Y,le).length>0}}),contains:qr(function(Y){return Y=Y.replace(Ti,di),function(le){return(le.textContent||p.text(le)).indexOf(Y)>-1}}),lang:qr(function(Y){return gs.test(Y||"")||en.error("unsupported lang: "+Y),Y=Y.replace(Ti,di).toLowerCase(),function(le){var Se;do if(Se=X?le.lang:le.getAttribute("xml:lang")||le.getAttribute("lang"))return Se=Se.toLowerCase(),Se===Y||Se.indexOf(Y+"-")===0;while((le=le.parentNode)&&le.nodeType===1);return!1}}),target:function(Y){var le=t.location&&t.location.hash;return le&&le.slice(1)===Y.id},root:function(Y){return Y===re},focus:function(Y){return Y===Uo()&&j.hasFocus()&&!!(Y.type||Y.href||~Y.tabIndex)},enabled:$u(!1),disabled:$u(!0),checked:function(Y){return J(Y,"input")&&!!Y.checked||J(Y,"option")&&!!Y.selected},selected:function(Y){return Y.parentNode&&Y.parentNode.selectedIndex,Y.selected===!0},empty:function(Y){for(Y=Y.firstChild;Y;Y=Y.nextSibling)if(Y.nodeType<6)return!1;return!0},parent:function(Y){return!y.pseudos.empty(Y)},header:function(Y){return Yi.test(Y.nodeName)},input:function(Y){return Ci.test(Y.nodeName)},button:function(Y){return J(Y,"input")&&Y.type==="button"||J(Y,"button")},text:function(Y){var le;return J(Y,"input")&&Y.type==="text"&&((le=Y.getAttribute("type"))==null||le.toLowerCase()==="text")},first:Or(function(){return[0]}),last:Or(function(Y,le){return[le-1]}),eq:Or(function(Y,le,Se){return[Se<0?Se+le:Se]}),even:Or(function(Y,le){for(var Se=0;Sele?Ce=le:Ce=Se;--Ce>=0;)Y.push(Ce);return Y}),gt:Or(function(Y,le,Se){for(var Ce=Se<0?Se+le:Se;++Ce1?function(le,Se,Ce){for(var W=Y.length;W--;)if(!Y[W](le,Se,Ce))return!1;return!0}:Y[0]}function qd(Y,le,Se){for(var Ce=0,W=le.length;Ce-1&&(se[ct]=!(Ne[ct]=Ut))}}else wt=Ha(wt===Ne?wt.splice(Yn,wt.length):wt),W?W(null,Ne,wt,lt):B.apply(Ne,wt)})}function vr(Y){for(var le,Se,Ce,W=Y.length,oe=y.relative[Y[0].type],se=oe||y.relative[" "],Ne=oe?1:0,Be=ys(function(st){return st===le},se,!0),lt=ys(function(st){return f.call(le,st)>-1},se,!0),ct=[function(st,Ut,wt){var Kt=!oe&&(wt||Ut!=x)||((le=Ut).nodeType?Be(st,Ut,wt):lt(st,Ut,wt));return le=null,Kt}];Ne1&&nc(ct),Ne>1&&Kr(Y.slice(0,Ne-1).concat({value:Y[Ne-2].type===" "?"*":""})).replace(Q,"$1"),Se,Ne0,Ce=Y.length>0,W=function(oe,se,Ne,Be,lt){var ct,st,Ut,wt=0,Kt="0",jn=oe&&[],Yn=[],zn=x,br=oe||Ce&&y.find.TAG("*",lt),Ii=Ee+=zn==null?1:Math.random()||.1,Ot=br.length;for(lt&&(x=se==j||se||lt);Kt!==Ot&&(ct=br[Kt])!=null;Kt++){if(Ce&&ct){for(st=0,!se&&ct.ownerDocument!=j&&(Zi(ct),Ne=!X);Ut=Y[st++];)if(Ut(ct,se||j,Ne)){B.call(Be,ct);break}lt&&(Ee=Ii)}Se&&((ct=!Ut&&ct)&&wt--,oe&&jn.push(ct))}if(wt+=Kt,Se&&Kt!==wt){for(st=0;Ut=le[st++];)Ut(jn,Yn,se,Ne);if(oe){if(wt>0)for(;Kt--;)jn[Kt]||Yn[Kt]||(Yn[Kt]=ce.call(Be));Yn=Ha(Yn)}B.apply(Be,Yn),lt&&!oe&&Yn.length>0&&wt+le.length>1&&p.uniqueSort(Be)}return lt&&(Ee=Ii,x=zn),jn};return Se?qr(W):W}function rc(Y,le){var Se,Ce=[],W=[],oe=Rt[Y+" "];if(!oe){for(le||(le=zo(Y)),Se=le.length;Se--;)oe=vr(le[Se]),oe[Oe]?Ce.push(oe):W.push(oe);oe=Rt(Y,Pu(W,Ce)),oe.selector=Y}return oe}function Ou(Y,le,Se,Ce){var W,oe,se,Ne,Be,lt=typeof Y=="function"&&Y,ct=!Ce&&zo(Y=lt.selector||Y);if(Se=Se||[],ct.length===1){if(oe=ct[0]=ct[0].slice(0),oe.length>2&&(se=oe[0]).type==="ID"&&le.nodeType===9&&X&&y.relative[oe[1].type]){if(le=(y.find.ID(se.matches[0].replace(Ti,di),le)||[])[0],le)lt&&(le=le.parentNode);else return Se;Y=Y.slice(oe.shift().value.length)}for(W=Pr.needsContext.test(Y)?0:oe.length;W--&&(se=oe[W],!y.relative[Ne=se.type]);)if((Be=y.find[Ne])&&(Ce=Be(se.matches[0].replace(Ti,di),Fo.test(oe[0].type)&&tc(le.parentNode)||le))){if(oe.splice(W,1),Y=Ce.length&&Kr(oe),!Y)return B.apply(Se,Ce),Se;break}}return(lt||rc(Y,ct))(Ce,le,!X,Se,!le||Fo.test(Y)&&tc(le.parentNode)||le),Se}I.sortStable=Oe.split("").sort(An).join("")===Oe,Zi(),I.sortDetached=Ys(function(Y){return Y.compareDocumentPosition(j.createElement("fieldset"))&1}),p.find=en,p.expr[":"]=p.expr.pseudos,p.unique=p.uniqueSort,en.compile=rc,en.select=Ou,en.setDocument=Zi,en.escape=p.escapeSelector,en.getText=p.text,en.isXML=p.isXMLDoc,en.selectors=p.expr,en.support=p.support,en.uniqueSort=p.uniqueSort})();var ze=function(u,y,x){for(var E=[],D=x!==void 0;(u=u[y])&&u.nodeType!==9;)if(u.nodeType===1){if(D&&p(u).is(x))break;E.push(u)}return E},Qe=function(u,y){for(var x=[];u;u=u.nextSibling)u.nodeType===1&&u!==y&&x.push(u);return x},nt=p.expr.match.needsContext,Fe=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function He(u,y,x){return C(y)?p.grep(u,function(E,D){return!!y.call(E,D,E)!==x}):y.nodeType?p.grep(u,function(E){return E===y!==x}):typeof y!="string"?p.grep(u,function(E){return f.call(y,E)>-1!==x}):p.filter(y,u,x)}p.filter=function(u,y,x){var E=y[0];return x&&(u=":not("+u+")"),y.length===1&&E.nodeType===1?p.find.matchesSelector(E,u)?[E]:[]:p.find.matches(u,p.grep(y,function(D){return D.nodeType===1}))},p.fn.extend({find:function(u){var y,x,E=this.length,D=this;if(typeof u!="string")return this.pushStack(p(u).filter(function(){for(y=0;y1?p.uniqueSort(x):x},filter:function(u){return this.pushStack(He(this,u||[],!1))},not:function(u){return this.pushStack(He(this,u||[],!0))},is:function(u){return!!He(this,typeof u=="string"&&nt.test(u)?p(u):u||[],!1).length}});var $e,Me=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,fe=p.fn.init=function(u,y,x){var E,D;if(!u)return this;if(x=x||$e,typeof u=="string")if(u[0]==="<"&&u[u.length-1]===">"&&u.length>=3?E=[null,u,null]:E=Me.exec(u),E&&(E[1]||!y))if(E[1]){if(y=y instanceof p?y[0]:y,p.merge(this,p.parseHTML(E[1],y&&y.nodeType?y.ownerDocument||y:$,!0)),Fe.test(E[1])&&p.isPlainObject(y))for(E in y)C(this[E])?this[E](y[E]):this.attr(E,y[E]);return this}else return D=$.getElementById(E[2]),D&&(this[0]=D,this.length=1),this;else return!y||y.jquery?(y||x).find(u):this.constructor(y).find(u);else{if(u.nodeType)return this[0]=u,this.length=1,this;if(C(u))return x.ready!==void 0?x.ready(u):u(p)}return p.makeArray(u,this)};fe.prototype=p.fn,$e=p($);var pt=/^(?:parents|prev(?:Until|All))/,h={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({has:function(u){var y=p(u,this),x=y.length;return this.filter(function(){for(var E=0;E-1:x.nodeType===1&&p.find.matchesSelector(x,u))){B.push(x);break}}return this.pushStack(B.length>1?p.uniqueSort(B):B)},index:function(u){return u?typeof u=="string"?f.call(p(u),this[0]):f.call(this,u.jquery?u[0]:u):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(u,y){return this.pushStack(p.uniqueSort(p.merge(this.get(),p(u,y))))},addBack:function(u){return this.add(u==null?this.prevObject:this.prevObject.filter(u))}});function v(u,y){for(;(u=u[y])&&u.nodeType!==1;);return u}p.each({parent:function(u){var y=u.parentNode;return y&&y.nodeType!==11?y:null},parents:function(u){return ze(u,"parentNode")},parentsUntil:function(u,y,x){return ze(u,"parentNode",x)},next:function(u){return v(u,"nextSibling")},prev:function(u){return v(u,"previousSibling")},nextAll:function(u){return ze(u,"nextSibling")},prevAll:function(u){return ze(u,"previousSibling")},nextUntil:function(u,y,x){return ze(u,"nextSibling",x)},prevUntil:function(u,y,x){return ze(u,"previousSibling",x)},siblings:function(u){return Qe((u.parentNode||{}).firstChild,u)},children:function(u){return Qe(u.firstChild)},contents:function(u){return u.contentDocument!=null&&i(u.contentDocument)?u.contentDocument:(J(u,"template")&&(u=u.content||u),p.merge([],u.childNodes))}},function(u,y){p.fn[u]=function(x,E){var D=p.map(this,y,x);return u.slice(-5)!=="Until"&&(E=x),E&&typeof E=="string"&&(D=p.filter(E,D)),this.length>1&&(h[u]||p.uniqueSort(D),pt.test(u)&&D.reverse()),this.pushStack(D)}});var k=/[^\x20\t\r\n\f]+/g;function T(u){var y={};return p.each(u.match(k)||[],function(x,E){y[E]=!0}),y}p.Callbacks=function(u){u=typeof u=="string"?T(u):p.extend({},u);var y,x,E,D,B=[],j=[],re=-1,X=function(){for(D=D||u.once,E=y=!0;j.length;re=-1)for(x=j.shift();++re-1;)B.splice(Ee,1),Ee<=re&&re--}),this},has:function(Ie){return Ie?p.inArray(Ie,B)>-1:B.length>0},empty:function(){return B&&(B=[]),this},disable:function(){return D=j=[],B=x="",this},disabled:function(){return!B},lock:function(){return D=j=[],!x&&!y&&(B=x=""),this},locked:function(){return!!D},fireWith:function(Ie,Oe){return D||(Oe=Oe||[],Oe=[Ie,Oe.slice?Oe.slice():Oe],j.push(Oe),y||X()),this},fire:function(){return ge.fireWith(this,arguments),this},fired:function(){return!!E}};return ge};function O(u){return u}function z(u){throw u}function te(u,y,x,E){var D;try{u&&C(D=u.promise)?D.call(u).done(y).fail(x):u&&C(D=u.then)?D.call(u,y,x):y.apply(void 0,[u].slice(E))}catch(B){x.apply(void 0,[B])}}p.extend({Deferred:function(u){var y=[["notify","progress",p.Callbacks("memory"),p.Callbacks("memory"),2],["resolve","done",p.Callbacks("once memory"),p.Callbacks("once memory"),0,"resolved"],["reject","fail",p.Callbacks("once memory"),p.Callbacks("once memory"),1,"rejected"]],x="pending",E={state:function(){return x},always:function(){return D.done(arguments).fail(arguments),this},catch:function(B){return E.then(null,B)},pipe:function(){var B=arguments;return p.Deferred(function(j){p.each(y,function(re,X){var ge=C(B[X[4]])&&B[X[4]];D[X[1]](function(){var Ie=ge&&ge.apply(this,arguments);Ie&&C(Ie.promise)?Ie.promise().progress(j.notify).done(j.resolve).fail(j.reject):j[X[0]+"With"](this,ge?[Ie]:arguments)})}),B=null}).promise()},then:function(B,j,re){var X=0;function ge(Ie,Oe,Ee,Ge){return function(){var at=this,Mt=arguments,Rt=function(){var An,fi;if(!(Ie=X&&(Ee!==z&&(at=void 0,Mt=[An]),Oe.rejectWith(at,Mt))}};Ie?Un():(p.Deferred.getErrorHook?Un.error=p.Deferred.getErrorHook():p.Deferred.getStackHook&&(Un.error=p.Deferred.getStackHook()),t.setTimeout(Un))}}return p.Deferred(function(Ie){y[0][3].add(ge(0,Ie,C(re)?re:O,Ie.notifyWith)),y[1][3].add(ge(0,Ie,C(B)?B:O)),y[2][3].add(ge(0,Ie,C(j)?j:z))}).promise()},promise:function(B){return B!=null?p.extend(B,E):E}},D={};return p.each(y,function(B,j){var re=j[2],X=j[5];E[j[1]]=re.add,X&&re.add(function(){x=X},y[3-B][2].disable,y[3-B][3].disable,y[0][2].lock,y[0][3].lock),re.add(j[3].fire),D[j[0]]=function(){return D[j[0]+"With"](this===D?void 0:this,arguments),this},D[j[0]+"With"]=re.fireWith}),E.promise(D),u&&u.call(D,D),D},when:function(u){var y=arguments.length,x=y,E=Array(x),D=s.call(arguments),B=p.Deferred(),j=function(re){return function(X){E[re]=this,D[re]=arguments.length>1?s.call(arguments):X,--y||B.resolveWith(E,D)}};if(y<=1&&(te(u,B.done(j(x)).resolve,B.reject,!y),B.state()==="pending"||C(D[x]&&D[x].then)))return B.then();for(;x--;)te(D[x],j(x),B.reject);return B.promise()}});var ie=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;p.Deferred.exceptionHook=function(u,y){t.console&&t.console.warn&&u&&ie.test(u.name)&&t.console.warn("jQuery.Deferred exception: "+u.message,u.stack,y)},p.readyException=function(u){t.setTimeout(function(){throw u})};var pe=p.Deferred();p.fn.ready=function(u){return pe.then(u).catch(function(y){p.readyException(y)}),this},p.extend({isReady:!1,readyWait:1,ready:function(u){(u===!0?--p.readyWait:p.isReady)||(p.isReady=!0,!(u!==!0&&--p.readyWait>0)&&pe.resolveWith($,[p]))}}),p.ready.then=pe.then;function _e(){$.removeEventListener("DOMContentLoaded",_e),t.removeEventListener("load",_e),p.ready()}$.readyState==="complete"||$.readyState!=="loading"&&!$.documentElement.doScroll?t.setTimeout(p.ready):($.addEventListener("DOMContentLoaded",_e),t.addEventListener("load",_e));var je=function(u,y,x,E,D,B,j){var re=0,X=u.length,ge=x==null;if(N(x)==="object"){D=!0;for(re in x)je(u,y,re,x[re],!0,B,j)}else if(E!==void 0&&(D=!0,C(E)||(j=!0),ge&&(j?(y.call(u,E),y=null):(ge=y,y=function(Ie,Oe,Ee){return ge.call(p(Ie),Ee)})),y))for(;re1,null,!0)},removeData:function(u){return this.each(function(){gt.remove(this,u)})}}),p.extend({queue:function(u,y,x){var E;if(u)return y=(y||"fx")+"queue",E=Ke.get(u,y),x&&(!E||Array.isArray(x)?E=Ke.access(u,y,p.makeArray(x)):E.push(x)),E||[]},dequeue:function(u,y){y=y||"fx";var x=p.queue(u,y),E=x.length,D=x.shift(),B=p._queueHooks(u,y),j=function(){p.dequeue(u,y)};D==="inprogress"&&(D=x.shift(),E--),D&&(y==="fx"&&x.unshift("inprogress"),delete B.stop,D.call(u,j,B)),!E&&B&&B.empty.fire()},_queueHooks:function(u,y){var x=y+"queueHooks";return Ke.get(u,x)||Ke.access(u,x,{empty:p.Callbacks("once memory").add(function(){Ke.remove(u,[y+"queue",x])})})}}),p.fn.extend({queue:function(u,y){var x=2;return typeof u!="string"&&(y=u,u="fx",x--),arguments.length\x20\t\r\n\f]*)/i,Aa=/^$|^module$|\/(?:java|ecma)script/i;(function(){var u=$.createDocumentFragment(),y=u.appendChild($.createElement("div")),x=$.createElement("input");x.setAttribute("type","radio"),x.setAttribute("checked","checked"),x.setAttribute("name","t"),y.appendChild(x),I.checkClone=y.cloneNode(!0).cloneNode(!0).lastChild.checked,y.innerHTML="",I.noCloneChecked=!!y.cloneNode(!0).lastChild.defaultValue,y.innerHTML="",I.option=!!y.lastChild})();var ir={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ir.tbody=ir.tfoot=ir.colgroup=ir.caption=ir.thead,ir.th=ir.td,I.option||(ir.optgroup=ir.option=[1,""]);function Gn(u,y){var x;return typeof u.getElementsByTagName<"u"?x=u.getElementsByTagName(y||"*"):typeof u.querySelectorAll<"u"?x=u.querySelectorAll(y||"*"):x=[],y===void 0||y&&J(u,y)?p.merge([u],x):x}function qs(u,y){for(var x=0,E=u.length;x-1){D&&D.push(B);continue}if(ge=oi(B),j=Gn(Oe.appendChild(B),"script"),ge&&qs(j),x)for(Ie=0;B=j[Ie++];)Aa.test(B.type||"")&&x.push(B)}return Oe}var Ta=/^([^.]*)(?:\.(.+)|)/;function ci(){return!0}function qi(){return!1}function fs(u,y,x,E,D,B){var j,re;if(typeof y=="object"){typeof x!="string"&&(E=E||x,x=void 0);for(re in y)fs(u,re,x,E,y[re],B);return u}if(E==null&&D==null?(D=x,E=x=void 0):D==null&&(typeof x=="string"?(D=E,E=void 0):(D=E,E=x,x=void 0)),D===!1)D=qi;else if(!D)return u;return B===1&&(j=D,D=function(X){return p().off(X),j.apply(this,arguments)},D.guid=j.guid||(j.guid=p.guid++)),u.each(function(){p.event.add(this,y,D,E,x)})}p.event={global:{},add:function(u,y,x,E,D){var B,j,re,X,ge,Ie,Oe,Ee,Ge,at,Mt,Rt=Ke.get(u);if(St(u))for(x.handler&&(B=x,x=B.handler,D=B.selector),D&&p.find.matchesSelector(yr,D),x.guid||(x.guid=p.guid++),(X=Rt.events)||(X=Rt.events=Object.create(null)),(j=Rt.handle)||(j=Rt.handle=function(Un){return typeof p<"u"&&p.event.triggered!==Un.type?p.event.dispatch.apply(u,arguments):void 0}),y=(y||"").match(k)||[""],ge=y.length;ge--;)re=Ta.exec(y[ge])||[],Ge=Mt=re[1],at=(re[2]||"").split(".").sort(),Ge&&(Oe=p.event.special[Ge]||{},Ge=(D?Oe.delegateType:Oe.bindType)||Ge,Oe=p.event.special[Ge]||{},Ie=p.extend({type:Ge,origType:Mt,data:E,handler:x,guid:x.guid,selector:D,needsContext:D&&p.expr.match.needsContext.test(D),namespace:at.join(".")},B),(Ee=X[Ge])||(Ee=X[Ge]=[],Ee.delegateCount=0,(!Oe.setup||Oe.setup.call(u,E,at,j)===!1)&&u.addEventListener&&u.addEventListener(Ge,j)),Oe.add&&(Oe.add.call(u,Ie),Ie.handler.guid||(Ie.handler.guid=x.guid)),D?Ee.splice(Ee.delegateCount++,0,Ie):Ee.push(Ie),p.event.global[Ge]=!0)},remove:function(u,y,x,E,D){var B,j,re,X,ge,Ie,Oe,Ee,Ge,at,Mt,Rt=Ke.hasData(u)&&Ke.get(u);if(!(!Rt||!(X=Rt.events))){for(y=(y||"").match(k)||[""],ge=y.length;ge--;){if(re=Ta.exec(y[ge])||[],Ge=Mt=re[1],at=(re[2]||"").split(".").sort(),!Ge){for(Ge in X)p.event.remove(u,Ge+y[ge],x,E,!0);continue}for(Oe=p.event.special[Ge]||{},Ge=(E?Oe.delegateType:Oe.bindType)||Ge,Ee=X[Ge]||[],re=re[2]&&new RegExp("(^|\\.)"+at.join("\\.(?:.*\\.|)")+"(\\.|$)"),j=B=Ee.length;B--;)Ie=Ee[B],(D||Mt===Ie.origType)&&(!x||x.guid===Ie.guid)&&(!re||re.test(Ie.namespace))&&(!E||E===Ie.selector||E==="**"&&Ie.selector)&&(Ee.splice(B,1),Ie.selector&&Ee.delegateCount--,Oe.remove&&Oe.remove.call(u,Ie));j&&!Ee.length&&((!Oe.teardown||Oe.teardown.call(u,at,Rt.handle)===!1)&&p.removeEvent(u,Ge,Rt.handle),delete X[Ge])}p.isEmptyObject(X)&&Ke.remove(u,"handle events")}},dispatch:function(u){var y,x,E,D,B,j,re=new Array(arguments.length),X=p.event.fix(u),ge=(Ke.get(this,"events")||Object.create(null))[X.type]||[],Ie=p.event.special[X.type]||{};for(re[0]=X,y=1;y=1)){for(;ge!==this;ge=ge.parentNode||this)if(ge.nodeType===1&&!(u.type==="click"&&ge.disabled===!0)){for(B=[],j={},x=0;x-1:p.find(D,this,null,[ge]).length),j[D]&&B.push(E);B.length&&re.push({elem:ge,handlers:B})}}return ge=this,X\s*$/g;function Ia(u,y){return J(u,"table")&&J(y.nodeType!==11?y:y.firstChild,"tr")&&p(u).children("tbody")[0]||u}function Kl(u){return u.type=(u.getAttribute("type")!==null)+"/"+u.type,u}function Wl(u){return(u.type||"").slice(0,5)==="true/"?u.type=u.type.slice(5):u.removeAttribute("type"),u}function $a(u,y){var x,E,D,B,j,re,X;if(y.nodeType===1){if(Ke.hasData(u)&&(B=Ke.get(u),X=B.events,X)){Ke.remove(y,"handle events");for(D in X)for(x=0,E=X[D].length;x1&&typeof Ge=="string"&&!I.checkClone&&Hl.test(Ge))return u.each(function(Mt){var Rt=u.eq(Mt);at&&(y[0]=Ge.call(this,Mt,Rt.html())),Ki(Rt,y,x,E)});if(Oe&&(D=Ca(y,u[0].ownerDocument,!1,u,E),B=D.firstChild,D.childNodes.length===1&&(D=B),B||E)){for(j=p.map(Gn(D,"script"),Kl),re=j.length;Ie0&&qs(j,!X&&Gn(u,"script")),re},cleanData:function(u){for(var y,x,E,D=p.event.special,B=0;(x=u[B])!==void 0;B++)if(St(x)){if(y=x[Ke.expando]){if(y.events)for(E in y.events)D[E]?p.event.remove(x,E):p.removeEvent(x,E,y.handle);x[Ke.expando]=void 0}x[gt.expando]&&(x[gt.expando]=void 0)}}}),p.fn.extend({detach:function(u){return Oa(this,u,!0)},remove:function(u){return Oa(this,u)},text:function(u){return je(this,function(y){return y===void 0?p.text(this):this.empty().each(function(){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&(this.textContent=y)})},null,u,arguments.length)},append:function(){return Ki(this,arguments,function(u){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var y=Ia(this,u);y.appendChild(u)}})},prepend:function(){return Ki(this,arguments,function(u){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var y=Ia(this,u);y.insertBefore(u,y.firstChild)}})},before:function(){return Ki(this,arguments,function(u){this.parentNode&&this.parentNode.insertBefore(u,this)})},after:function(){return Ki(this,arguments,function(u){this.parentNode&&this.parentNode.insertBefore(u,this.nextSibling)})},empty:function(){for(var u,y=0;(u=this[y])!=null;y++)u.nodeType===1&&(p.cleanData(Gn(u,!1)),u.textContent="");return this},clone:function(u,y){return u=u??!1,y=y??u,this.map(function(){return p.clone(this,u,y)})},html:function(u){return je(this,function(y){var x=this[0]||{},E=0,D=this.length;if(y===void 0&&x.nodeType===1)return x.innerHTML;if(typeof y=="string"&&!zl.test(y)&&!ir[(Oo.exec(y)||["",""])[1].toLowerCase()]){y=p.htmlPrefilter(y);try{for(;E=0&&(X+=Math.max(0,Math.ceil(u["offset"+y[0].toUpperCase()+y.slice(1)]-B-X-re-.5))||0),X+ge}function q(u,y,x){var E=Ks(u),D=!I.boxSizingReliable()||x,B=D&&p.css(u,"boxSizing",!1,E)==="border-box",j=B,re=Wi(u,y,E),X="offset"+y[0].toUpperCase()+y.slice(1);if(No.test(re)){if(!x)return re;re="auto"}return(!I.boxSizingReliable()&&B||!I.reliableTrDimensions()&&J(u,"tr")||re==="auto"||!parseFloat(re)&&p.css(u,"display",!1,E)==="inline")&&u.getClientRects().length&&(B=p.css(u,"boxSizing",!1,E)==="border-box",j=X in u,j&&(re=u[X])),re=parseFloat(re)||0,re+Do(u,y,x||(B?"border":"content"),j,E,re)+"px"}p.extend({cssHooks:{opacity:{get:function(u,y){if(y){var x=Wi(u,"opacity");return x===""?"1":x}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(u,y,x,E){if(!(!u||u.nodeType===3||u.nodeType===8||!u.style)){var D,B,j,re=yt(y),X=Ro.test(y),ge=u.style;if(X||(y=Vi(re)),j=p.cssHooks[y]||p.cssHooks[re],x!==void 0){if(B=typeof x,B==="string"&&(D=si.exec(x))&&D[1]&&(x=Po(u,y,D),B="number"),x==null||x!==x)return;B==="number"&&!X&&(x+=D&&D[3]||(p.cssNumber[re]?"":"px")),!I.clearCloneStyle&&x===""&&y.indexOf("background")===0&&(ge[y]="inherit"),(!j||!("set"in j)||(x=j.set(u,x,E))!==void 0)&&(X?ge.setProperty(y,x):ge[y]=x)}else return j&&"get"in j&&(D=j.get(u,!1,E))!==void 0?D:ge[y]}},css:function(u,y,x,E){var D,B,j,re=yt(y),X=Ro.test(y);return X||(y=Vi(re)),j=p.cssHooks[y]||p.cssHooks[re],j&&"get"in j&&(D=j.get(u,!0,x)),D===void 0&&(D=Wi(u,y,E)),D==="normal"&&y in Vs&&(D=Vs[y]),x===""||x?(B=parseFloat(D),x===!0||isFinite(B)?B||0:D):D}}),p.each(["height","width"],function(u,y){p.cssHooks[y]={get:function(x,E,D){if(E)return Ma.test(p.css(x,"display"))&&(!x.getClientRects().length||!x.getBoundingClientRect().width)?Na(x,Vl,function(){return q(x,y,D)}):q(x,y,D)},set:function(x,E,D){var B,j=Ks(x),re=!I.scrollboxSize()&&j.position==="absolute",X=re||D,ge=X&&p.css(x,"boxSizing",!1,j)==="border-box",Ie=D?Do(x,y,D,ge,j):0;return ge&&re&&(Ie-=Math.ceil(x["offset"+y[0].toUpperCase()+y.slice(1)]-parseFloat(j[y])-Do(x,y,"border",!1,j)-.5)),Ie&&(B=si.exec(E))&&(B[3]||"px")!=="px"&&(x.style[y]=E,E=p.css(x,y)),Da(x,E,Ie)}}}),p.cssHooks.marginLeft=zr(I.reliableMarginLeft,function(u,y){if(y)return(parseFloat(Wi(u,"marginLeft"))||u.getBoundingClientRect().left-Na(u,{marginLeft:0},function(){return u.getBoundingClientRect().left}))+"px"}),p.each({margin:"",padding:"",border:"Width"},function(u,y){p.cssHooks[u+y]={expand:function(x){for(var E=0,D={},B=typeof x=="string"?x.split(" "):[x];E<4;E++)D[u+rr[E]+y]=B[E]||B[E-2]||B[0];return D}},u!=="margin"&&(p.cssHooks[u+y].set=Da)}),p.fn.extend({css:function(u,y){return je(this,function(x,E,D){var B,j,re={},X=0;if(Array.isArray(E)){for(B=Ks(x),j=E.length;X1)}});function ne(u,y,x,E,D){return new ne.prototype.init(u,y,x,E,D)}p.Tween=ne,ne.prototype={constructor:ne,init:function(u,y,x,E,D,B){this.elem=u,this.prop=x,this.easing=D||p.easing._default,this.options=y,this.start=this.now=this.cur(),this.end=E,this.unit=B||(p.cssNumber[x]?"":"px")},cur:function(){var u=ne.propHooks[this.prop];return u&&u.get?u.get(this):ne.propHooks._default.get(this)},run:function(u){var y,x=ne.propHooks[this.prop];return this.options.duration?this.pos=y=p.easing[this.easing](u,this.options.duration*u,0,1,this.options.duration):this.pos=y=u,this.now=(this.end-this.start)*y+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),x&&x.set?x.set(this):ne.propHooks._default.set(this),this}},ne.prototype.init.prototype=ne.prototype,ne.propHooks={_default:{get:function(u){var y;return u.elem.nodeType!==1||u.elem[u.prop]!=null&&u.elem.style[u.prop]==null?u.elem[u.prop]:(y=p.css(u.elem,u.prop,""),!y||y==="auto"?0:y)},set:function(u){p.fx.step[u.prop]?p.fx.step[u.prop](u):u.elem.nodeType===1&&(p.cssHooks[u.prop]||u.elem.style[Vi(u.prop)]!=null)?p.style(u.elem,u.prop,u.now+u.unit):u.elem[u.prop]=u.now}}},ne.propHooks.scrollTop=ne.propHooks.scrollLeft={set:function(u){u.elem.nodeType&&u.elem.parentNode&&(u.elem[u.prop]=u.now)}},p.easing={linear:function(u){return u},swing:function(u){return .5-Math.cos(u*Math.PI)/2},_default:"swing"},p.fx=ne.prototype.init,p.fx.step={};var V,he,ve=/^(?:toggle|show|hide)$/,ue=/queueHooks$/;function Re(){he&&($.hidden===!1&&t.requestAnimationFrame?t.requestAnimationFrame(Re):t.setTimeout(Re,p.fx.interval),p.fx.tick())}function We(){return t.setTimeout(function(){V=void 0}),V=Date.now()}function Ye(u,y){var x,E=0,D={height:u};for(y=y?1:0;E<4;E+=2-y)x=rr[E],D["margin"+x]=D["padding"+x]=u;return y&&(D.opacity=D.width=u),D}function Ze(u,y,x){for(var E,D=(xt.tweeners[y]||[]).concat(xt.tweeners["*"]),B=0,j=D.length;B1)},removeAttr:function(u){return this.each(function(){p.removeAttr(this,u)})}}),p.extend({attr:function(u,y,x){var E,D,B=u.nodeType;if(!(B===3||B===8||B===2)){if(typeof u.getAttribute>"u")return p.prop(u,y,x);if((B!==1||!p.isXMLDoc(u))&&(D=p.attrHooks[y.toLowerCase()]||(p.expr.match.bool.test(y)?Jt:void 0)),x!==void 0){if(x===null){p.removeAttr(u,y);return}return D&&"set"in D&&(E=D.set(u,x,y))!==void 0?E:(u.setAttribute(y,x+""),x)}return D&&"get"in D&&(E=D.get(u,y))!==null?E:(E=p.find.attr(u,y),E??void 0)}},attrHooks:{type:{set:function(u,y){if(!I.radioValue&&y==="radio"&&J(u,"input")){var x=u.value;return u.setAttribute("type",y),x&&(u.value=x),y}}}},removeAttr:function(u,y){var x,E=0,D=y&&y.match(k);if(D&&u.nodeType===1)for(;x=D[E++];)u.removeAttribute(x)}}),Jt={set:function(u,y,x){return y===!1?p.removeAttr(u,x):u.setAttribute(x,x),x}},p.each(p.expr.match.bool.source.match(/\w+/g),function(u,y){var x=qt[y]||p.find.attr;qt[y]=function(E,D,B){var j,re,X=D.toLowerCase();return B||(re=qt[X],qt[X]=j,j=x(E,D,B)!=null?X:null,qt[X]=re),j}});var yn=/^(?:input|select|textarea|button)$/i,tn=/^(?:a|area)$/i;p.fn.extend({prop:function(u,y){return je(this,p.prop,u,y,arguments.length>1)},removeProp:function(u){return this.each(function(){delete this[p.propFix[u]||u]})}}),p.extend({prop:function(u,y,x){var E,D,B=u.nodeType;if(!(B===3||B===8||B===2))return(B!==1||!p.isXMLDoc(u))&&(y=p.propFix[y]||y,D=p.propHooks[y]),x!==void 0?D&&"set"in D&&(E=D.set(u,x,y))!==void 0?E:u[y]=x:D&&"get"in D&&(E=D.get(u,y))!==null?E:u[y]},propHooks:{tabIndex:{get:function(u){var y=p.find.attr(u,"tabindex");return y?parseInt(y,10):yn.test(u.nodeName)||tn.test(u.nodeName)&&u.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),I.optSelected||(p.propHooks.selected={get:function(u){var y=u.parentNode;return y&&y.parentNode&&y.parentNode.selectedIndex,null},set:function(u){var y=u.parentNode;y&&(y.selectedIndex,y.parentNode&&y.parentNode.selectedIndex)}}),p.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){p.propFix[this.toLowerCase()]=this});function Sn(u){var y=u.match(k)||[];return y.join(" ")}function sr(u){return u.getAttribute&&u.getAttribute("class")||""}function ps(u){return Array.isArray(u)?u:typeof u=="string"?u.match(k)||[]:[]}p.fn.extend({addClass:function(u){var y,x,E,D,B,j;return C(u)?this.each(function(re){p(this).addClass(u.call(this,re,sr(this)))}):(y=ps(u),y.length?this.each(function(){if(E=sr(this),x=this.nodeType===1&&" "+Sn(E)+" ",x){for(B=0;B-1;)x=x.replace(" "+D+" "," ");j=Sn(x),E!==j&&this.setAttribute("class",j)}}):this):this.attr("class","")},toggleClass:function(u,y){var x,E,D,B,j=typeof u,re=j==="string"||Array.isArray(u);return C(u)?this.each(function(X){p(this).toggleClass(u.call(this,X,sr(this),y),y)}):typeof y=="boolean"&&re?y?this.addClass(u):this.removeClass(u):(x=ps(u),this.each(function(){if(re)for(B=p(this),D=0;D-1)return!0;return!1}});var Ba=/\r/g;p.fn.extend({val:function(u){var y,x,E,D=this[0];return arguments.length?(E=C(u),this.each(function(B){var j;this.nodeType===1&&(E?j=u.call(this,B,p(this).val()):j=u,j==null?j="":typeof j=="number"?j+="":Array.isArray(j)&&(j=p.map(j,function(re){return re==null?"":re+""})),y=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()],(!y||!("set"in y)||y.set(this,j,"value")===void 0)&&(this.value=j))})):D?(y=p.valHooks[D.type]||p.valHooks[D.nodeName.toLowerCase()],y&&"get"in y&&(x=y.get(D,"value"))!==void 0?x:(x=D.value,typeof x=="string"?x.replace(Ba,""):x??"")):void 0}}),p.extend({valHooks:{option:{get:function(u){var y=p.find.attr(u,"value");return y??Sn(p.text(u))}},select:{get:function(u){var y,x,E,D=u.options,B=u.selectedIndex,j=u.type==="select-one",re=j?null:[],X=j?B+1:D.length;for(B<0?E=X:E=j?B:0;E-1)&&(x=!0);return x||(u.selectedIndex=-1),B}}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]={set:function(u,y){if(Array.isArray(y))return u.checked=p.inArray(p(u).val(),y)>-1}},I.checkOn||(p.valHooks[this].get=function(u){return u.getAttribute("value")===null?"on":u.value})});var ui=t.location,La={guid:Date.now()},Gs=/\?/;p.parseXML=function(u){var y,x;if(!u||typeof u!="string")return null;try{y=new t.DOMParser().parseFromString(u,"text/xml")}catch{}return x=y&&y.getElementsByTagName("parsererror")[0],(!y||x)&&p.error("Invalid XML: "+(x?p.map(x.childNodes,function(E){return E.textContent}).join(` +`):u)),y};var Fa=/^(?:focusinfocus|focusoutblur)$/,Bo=function(u){u.stopPropagation()};p.extend(p.event,{trigger:function(u,y,x,E){var D,B,j,re,X,ge,Ie,Oe,Ee=[x||$],Ge=w.call(u,"type")?u.type:u,at=w.call(u,"namespace")?u.namespace.split("."):[];if(B=Oe=j=x=x||$,!(x.nodeType===3||x.nodeType===8)&&!Fa.test(Ge+p.event.triggered)&&(Ge.indexOf(".")>-1&&(at=Ge.split("."),Ge=at.shift(),at.sort()),X=Ge.indexOf(":")<0&&"on"+Ge,u=u[p.expando]?u:new p.Event(Ge,typeof u=="object"&&u),u.isTrigger=E?2:3,u.namespace=at.join("."),u.rnamespace=u.namespace?new RegExp("(^|\\.)"+at.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,u.result=void 0,u.target||(u.target=x),y=y==null?[u]:p.makeArray(y,[u]),Ie=p.event.special[Ge]||{},!(!E&&Ie.trigger&&Ie.trigger.apply(x,y)===!1))){if(!E&&!Ie.noBubble&&!R(x)){for(re=Ie.delegateType||Ge,Fa.test(re+Ge)||(B=B.parentNode);B;B=B.parentNode)Ee.push(B),j=B;j===(x.ownerDocument||$)&&Ee.push(j.defaultView||j.parentWindow||t)}for(D=0;(B=Ee[D++])&&!u.isPropagationStopped();)Oe=B,u.type=D>1?re:Ie.bindType||Ge,ge=(Ke.get(B,"events")||Object.create(null))[u.type]&&Ke.get(B,"handle"),ge&&ge.apply(B,y),ge=X&&B[X],ge&&ge.apply&&St(B)&&(u.result=ge.apply(B,y),u.result===!1&&u.preventDefault());return u.type=Ge,!E&&!u.isDefaultPrevented()&&(!Ie._default||Ie._default.apply(Ee.pop(),y)===!1)&&St(x)&&X&&C(x[Ge])&&!R(x)&&(j=x[X],j&&(x[X]=null),p.event.triggered=Ge,u.isPropagationStopped()&&Oe.addEventListener(Ge,Bo),x[Ge](),u.isPropagationStopped()&&Oe.removeEventListener(Ge,Bo),p.event.triggered=void 0,j&&(x[X]=j)),u.result}},simulate:function(u,y,x){var E=p.extend(new p.Event,x,{type:u,isSimulated:!0});p.event.trigger(E,null,y)}}),p.fn.extend({trigger:function(u,y){return this.each(function(){p.event.trigger(u,y,this)})},triggerHandler:function(u,y){var x=this[0];if(x)return p.event.trigger(u,y,x,!0)}});var Pd=/\[\]$/,Gl=/\r?\n/g,Od=/^(?:submit|button|image|reset|file)$/i,Nd=/^(?:input|select|textarea|keygen)/i;function Yl(u,y,x,E){var D;if(Array.isArray(y))p.each(y,function(B,j){x||Pd.test(u)?E(u,j):Yl(u+"["+(typeof j=="object"&&j!=null?B:"")+"]",j,x,E)});else if(!x&&N(y)==="object")for(D in y)Yl(u+"["+D+"]",y[D],x,E);else E(u,y)}p.param=function(u,y){var x,E=[],D=function(B,j){var re=C(j)?j():j;E[E.length]=encodeURIComponent(B)+"="+encodeURIComponent(re??"")};if(u==null)return"";if(Array.isArray(u)||u.jquery&&!p.isPlainObject(u))p.each(u,function(){D(this.name,this.value)});else for(x in u)Yl(x,u[x],y,D);return E.join("&")},p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var u=p.prop(this,"elements");return u?p.makeArray(u):this}).filter(function(){var u=this.type;return this.name&&!p(this).is(":disabled")&&Nd.test(this.nodeName)&&!Od.test(u)&&(this.checked||!Hi.test(u))}).map(function(u,y){var x=p(this).val();return x==null?null:Array.isArray(x)?p.map(x,function(E){return{name:y.name,value:E.replace(Gl,`\r +`)}}):{name:y.name,value:x.replace(Gl,`\r +`)}}).get()}});var Rd=/%20/g,Zl=/#.*$/,Md=/([?&])_=[^&]*/,Dd=/^(.*?):[ \t]*([^\r\n]*)$/mg,Bd=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ld=/^(?:GET|HEAD)$/,Fd=/^\/\//,ln={},nn={},Eu="*/".concat("*"),Jl=$.createElement("a");Jl.href=ui.href;function Au(u){return function(y,x){typeof y!="string"&&(x=y,y="*");var E,D=0,B=y.toLowerCase().match(k)||[];if(C(x))for(;E=B[D++];)E[0]==="+"?(E=E.slice(1)||"*",(u[E]=u[E]||[]).unshift(x)):(u[E]=u[E]||[]).push(x)}}function Cu(u,y,x,E){var D={},B=u===nn;function j(re){var X;return D[re]=!0,p.each(u[re]||[],function(ge,Ie){var Oe=Ie(y,x,E);if(typeof Oe=="string"&&!B&&!D[Oe])return y.dataTypes.unshift(Oe),j(Oe),!1;if(B)return!(X=Oe)}),X}return j(y.dataTypes[0])||!D["*"]&&j("*")}function Xl(u,y){var x,E,D=p.ajaxSettings.flatOptions||{};for(x in y)y[x]!==void 0&&((D[x]?u:E||(E={}))[x]=y[x]);return E&&p.extend(!0,u,E),u}function Ud(u,y,x){for(var E,D,B,j,re=u.contents,X=u.dataTypes;X[0]==="*";)X.shift(),E===void 0&&(E=u.mimeType||y.getResponseHeader("Content-Type"));if(E){for(D in re)if(re[D]&&re[D].test(E)){X.unshift(D);break}}if(X[0]in x)B=X[0];else{for(D in x){if(!X[0]||u.converters[D+" "+X[0]]){B=D;break}j||(j=D)}B=B||j}if(B)return B!==X[0]&&X.unshift(B),x[B]}function Tu(u,y,x,E){var D,B,j,re,X,ge={},Ie=u.dataTypes.slice();if(Ie[1])for(j in u.converters)ge[j.toLowerCase()]=u.converters[j];for(B=Ie.shift();B;)if(u.responseFields[B]&&(x[u.responseFields[B]]=y),!X&&E&&u.dataFilter&&(y=u.dataFilter(y,u.dataType)),X=B,B=Ie.shift(),B){if(B==="*")B=X;else if(X!=="*"&&X!==B){if(j=ge[X+" "+B]||ge["* "+B],!j){for(D in ge)if(re=D.split(" "),re[1]===B&&(j=ge[X+" "+re[0]]||ge["* "+re[0]],j)){j===!0?j=ge[D]:ge[D]!==!0&&(B=re[0],Ie.unshift(re[1]));break}}if(j!==!0)if(j&&u.throws)y=j(y);else try{y=j(y)}catch(Oe){return{state:"parsererror",error:j?Oe:"No conversion from "+X+" to "+B}}}}return{state:"success",data:y}}p.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ui.href,type:"GET",isLocal:Bd.test(ui.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Eu,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":p.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(u,y){return y?Xl(Xl(u,p.ajaxSettings),y):Xl(p.ajaxSettings,u)},ajaxPrefilter:Au(ln),ajaxTransport:Au(nn),ajax:function(u,y){typeof u=="object"&&(y=u,u=void 0),y=y||{};var x,E,D,B,j,re,X,ge,Ie,Oe,Ee=p.ajaxSetup({},y),Ge=Ee.context||Ee,at=Ee.context&&(Ge.nodeType||Ge.jquery)?p(Ge):p.event,Mt=p.Deferred(),Rt=p.Callbacks("once memory"),Un=Ee.statusCode||{},An={},fi={},hi="canceled",Vt={readyState:0,getResponseHeader:function(Gt){var sn;if(X){if(!B)for(B={};sn=Dd.exec(D);)B[sn[1].toLowerCase()+" "]=(B[sn[1].toLowerCase()+" "]||[]).concat(sn[2]);sn=B[Gt.toLowerCase()+" "]}return sn==null?null:sn.join(", ")},getAllResponseHeaders:function(){return X?D:null},setRequestHeader:function(Gt,sn){return X==null&&(Gt=fi[Gt.toLowerCase()]=fi[Gt.toLowerCase()]||Gt,An[Gt]=sn),this},overrideMimeType:function(Gt){return X==null&&(Ee.mimeType=Gt),this},statusCode:function(Gt){var sn;if(Gt)if(X)Vt.always(Gt[Vt.status]);else for(sn in Gt)Un[sn]=[Un[sn],Gt[sn]];return this},abort:function(Gt){var sn=Gt||hi;return x&&x.abort(sn),Gi(0,sn),this}};if(Mt.promise(Vt),Ee.url=((u||Ee.url||ui.href)+"").replace(Fd,ui.protocol+"//"),Ee.type=y.method||y.type||Ee.method||Ee.type,Ee.dataTypes=(Ee.dataType||"*").toLowerCase().match(k)||[""],Ee.crossDomain==null){re=$.createElement("a");try{re.href=Ee.url,re.href=re.href,Ee.crossDomain=Jl.protocol+"//"+Jl.host!=re.protocol+"//"+re.host}catch{Ee.crossDomain=!0}}if(Ee.data&&Ee.processData&&typeof Ee.data!="string"&&(Ee.data=p.param(Ee.data,Ee.traditional)),Cu(ln,Ee,y,Vt),X)return Vt;ge=p.event&&Ee.global,ge&&p.active++===0&&p.event.trigger("ajaxStart"),Ee.type=Ee.type.toUpperCase(),Ee.hasContent=!Ld.test(Ee.type),E=Ee.url.replace(Zl,""),Ee.hasContent?Ee.data&&Ee.processData&&(Ee.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&(Ee.data=Ee.data.replace(Rd,"+")):(Oe=Ee.url.slice(E.length),Ee.data&&(Ee.processData||typeof Ee.data=="string")&&(E+=(Gs.test(E)?"&":"?")+Ee.data,delete Ee.data),Ee.cache===!1&&(E=E.replace(Md,"$1"),Oe=(Gs.test(E)?"&":"?")+"_="+La.guid+++Oe),Ee.url=E+Oe),Ee.ifModified&&(p.lastModified[E]&&Vt.setRequestHeader("If-Modified-Since",p.lastModified[E]),p.etag[E]&&Vt.setRequestHeader("If-None-Match",p.etag[E])),(Ee.data&&Ee.hasContent&&Ee.contentType!==!1||y.contentType)&&Vt.setRequestHeader("Content-Type",Ee.contentType),Vt.setRequestHeader("Accept",Ee.dataTypes[0]&&Ee.accepts[Ee.dataTypes[0]]?Ee.accepts[Ee.dataTypes[0]]+(Ee.dataTypes[0]!=="*"?", "+Eu+"; q=0.01":""):Ee.accepts["*"]);for(Ie in Ee.headers)Vt.setRequestHeader(Ie,Ee.headers[Ie]);if(Ee.beforeSend&&(Ee.beforeSend.call(Ge,Vt,Ee)===!1||X))return Vt.abort();if(hi="abort",Rt.add(Ee.complete),Vt.done(Ee.success),Vt.fail(Ee.error),x=Cu(nn,Ee,y,Vt),!x)Gi(-1,"No Transport");else{if(Vt.readyState=1,ge&&at.trigger("ajaxSend",[Vt,Ee]),X)return Vt;Ee.async&&Ee.timeout>0&&(j=t.setTimeout(function(){Vt.abort("timeout")},Ee.timeout));try{X=!1,x.send(An,Gi)}catch(Gt){if(X)throw Gt;Gi(-1,Gt)}}function Gi(Gt,sn,Lo,ja){var Hr,gs,Pr,Ci,Yi,or=sn;X||(X=!0,j&&t.clearTimeout(j),x=void 0,D=ja||"",Vt.readyState=Gt>0?4:0,Hr=Gt>=200&&Gt<300||Gt===304,Lo&&(Ci=Ud(Ee,Vt,Lo)),!Hr&&p.inArray("script",Ee.dataTypes)>-1&&p.inArray("json",Ee.dataTypes)<0&&(Ee.converters["text script"]=function(){}),Ci=Tu(Ee,Ci,Vt,Hr),Hr?(Ee.ifModified&&(Yi=Vt.getResponseHeader("Last-Modified"),Yi&&(p.lastModified[E]=Yi),Yi=Vt.getResponseHeader("etag"),Yi&&(p.etag[E]=Yi)),Gt===204||Ee.type==="HEAD"?or="nocontent":Gt===304?or="notmodified":(or=Ci.state,gs=Ci.data,Pr=Ci.error,Hr=!Pr)):(Pr=or,(Gt||!or)&&(or="error",Gt<0&&(Gt=0))),Vt.status=Gt,Vt.statusText=(sn||or)+"",Hr?Mt.resolveWith(Ge,[gs,or,Vt]):Mt.rejectWith(Ge,[Vt,or,Pr]),Vt.statusCode(Un),Un=void 0,ge&&at.trigger(Hr?"ajaxSuccess":"ajaxError",[Vt,Ee,Hr?gs:Pr]),Rt.fireWith(Ge,[Vt,or]),ge&&(at.trigger("ajaxComplete",[Vt,Ee]),--p.active||p.event.trigger("ajaxStop")))}return Vt},getJSON:function(u,y,x){return p.get(u,y,x,"json")},getScript:function(u,y){return p.get(u,void 0,y,"script")}}),p.each(["get","post"],function(u,y){p[y]=function(x,E,D,B){return C(E)&&(B=B||D,D=E,E=void 0),p.ajax(p.extend({url:x,type:y,dataType:B,data:E,success:D},p.isPlainObject(x)&&x))}}),p.ajaxPrefilter(function(u){var y;for(y in u.headers)y.toLowerCase()==="content-type"&&(u.contentType=u.headers[y]||"")}),p._evalUrl=function(u,y,x){return p.ajax({url:u,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(E){p.globalEval(E,y,x)}})},p.fn.extend({wrapAll:function(u){var y;return this[0]&&(C(u)&&(u=u.call(this[0])),y=p(u,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&y.insertBefore(this[0]),y.map(function(){for(var x=this;x.firstElementChild;)x=x.firstElementChild;return x}).append(this)),this},wrapInner:function(u){return C(u)?this.each(function(y){p(this).wrapInner(u.call(this,y))}):this.each(function(){var y=p(this),x=y.contents();x.length?x.wrapAll(u):y.append(u)})},wrap:function(u){var y=C(u);return this.each(function(x){p(this).wrapAll(y?u.call(this,x):u)})},unwrap:function(u){return this.parent(u).not("body").each(function(){p(this).replaceWith(this.childNodes)}),this}}),p.expr.pseudos.hidden=function(u){return!p.expr.pseudos.visible(u)},p.expr.pseudos.visible=function(u){return!!(u.offsetWidth||u.offsetHeight||u.getClientRects().length)},p.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch{}};var jd={0:200,1223:204},En=p.ajaxSettings.xhr();I.cors=!!En&&"withCredentials"in En,I.ajax=En=!!En,p.ajaxTransport(function(u){var y,x;if(I.cors||En&&!u.crossDomain)return{send:function(E,D){var B,j=u.xhr();if(j.open(u.type,u.url,u.async,u.username,u.password),u.xhrFields)for(B in u.xhrFields)j[B]=u.xhrFields[B];u.mimeType&&j.overrideMimeType&&j.overrideMimeType(u.mimeType),!u.crossDomain&&!E["X-Requested-With"]&&(E["X-Requested-With"]="XMLHttpRequest");for(B in E)j.setRequestHeader(B,E[B]);y=function(re){return function(){y&&(y=x=j.onload=j.onerror=j.onabort=j.ontimeout=j.onreadystatechange=null,re==="abort"?j.abort():re==="error"?typeof j.status!="number"?D(0,"error"):D(j.status,j.statusText):D(jd[j.status]||j.status,j.statusText,(j.responseType||"text")!=="text"||typeof j.responseText!="string"?{binary:j.response}:{text:j.responseText},j.getAllResponseHeaders()))}},j.onload=y(),x=j.onerror=j.ontimeout=y("error"),j.onabort!==void 0?j.onabort=x:j.onreadystatechange=function(){j.readyState===4&&t.setTimeout(function(){y&&x()})},y=y("abort");try{j.send(u.hasContent&&u.data||null)}catch(re){if(y)throw re}},abort:function(){y&&y()}}}),p.ajaxPrefilter(function(u){u.crossDomain&&(u.contents.script=!1)}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(u){return p.globalEval(u),u}}}),p.ajaxPrefilter("script",function(u){u.cache===void 0&&(u.cache=!1),u.crossDomain&&(u.type="GET")}),p.ajaxTransport("script",function(u){if(u.crossDomain||u.scriptAttrs){var y,x;return{send:function(E,D){y=p(" + + + +
+ + + diff --git a/dist/manifest.webmanifest b/dist/manifest.webmanifest new file mode 100644 index 00000000..74baafdb --- /dev/null +++ b/dist/manifest.webmanifest @@ -0,0 +1 @@ +{"name":"iris-vite-preact","short_name":"iris-vite-preact","start_url":"/","display":"standalone","background_color":"#ffffff","lang":"en","scope":"/"} diff --git a/src/static/privacy.txt b/dist/privacy.txt similarity index 100% rename from src/static/privacy.txt rename to dist/privacy.txt diff --git a/dist/registerSW.js b/dist/registerSW.js new file mode 100644 index 00000000..d42ac9ed --- /dev/null +++ b/dist/registerSW.js @@ -0,0 +1 @@ +if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('/sw.js', { scope: '/' })})} \ No newline at end of file diff --git a/src/static/robots.txt b/dist/robots.txt similarity index 100% rename from src/static/robots.txt rename to dist/robots.txt diff --git a/dist/sw.js b/dist/sw.js new file mode 100644 index 00000000..1f5229ee --- /dev/null +++ b/dist/sw.js @@ -0,0 +1 @@ +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),d={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map((e=>d[e]||l(e)))).then((e=>(r(...e),o)))}}define(["./workbox-fa446783"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-21a91155.js",revision:null},{url:"assets/index-305001f9.js",revision:null},{url:"assets/index-5b940218.css",revision:null},{url:"google7b3cf94231e5de15.html",revision:"9780f149ace4cba81af0b077230eadf6"},{url:"index.html",revision:"27ad6c2eba6fd3bdd7cbc2ba351d248b"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"manifest.webmanifest",revision:"0a80f59ffad67c7508b861c6f74f169e"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); diff --git a/dist/workbox-fa446783.js b/dist/workbox-fa446783.js new file mode 100644 index 00000000..476f7c14 --- /dev/null +++ b/dist/workbox-fa446783.js @@ -0,0 +1 @@ +define(["exports"],(function(t){"use strict";try{self["workbox:core:7.0.0"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:7.0.0"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=r&&r.handler;const c=t.method;if(!o&&this.i.has(c)&&(o=this.i.get(c)),!o)return;let a;try{a=o.handle({url:s,request:t,event:e,params:i})}catch(t){a=Promise.reject(t)}const h=r&&r.catchHandler;return a instanceof Promise&&(this.o||h)&&(a=a.catch((async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n}))),a}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const o=r.match({url:t,sameOrigin:e,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&0===i.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let c;const a=()=>(c||(c=new o,c.addFetchListener(),c.addCacheListener()),c);function h(t,e,n){let o;if("string"==typeof t){const s=new URL(t,location.href);o=new i((({url:t})=>t.href===s.href),e,n)}else if(t instanceof RegExp)o=new r(t,e,n);else if("function"==typeof t)o=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});o=t}return a().registerRoute(o),o}const u={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},l=t=>[u.prefix,t,u.suffix].filter((t=>t&&t.length>0)).join("-"),f=t=>t||l(u.precache),w=t=>t||l(u.runtime);function d(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:7.0.0"]&&_()}catch(t){}function p(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class y{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class g{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.h.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.h=t}}let R;async function m(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=e?e(r):r,c=function(){if(void 0===R){const t=new Response("");if("body"in t)try{new Response(t.body),R=!0}catch(t){R=!1}R=!1}return R}()?i.body:await i.blob();return new Response(c,o)}function v(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class q{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const U=new Set;try{self["workbox:strategies:7.0.0"]&&_()}catch(t){}function L(t){return"string"==typeof t?new Request(t):t}class b{constructor(t,e){this.u={},Object.assign(this,e),this.event=e.event,this.l=t,this.p=new q,this.g=[],this.R=[...t.plugins],this.m=new Map;for(const t of this.R)this.m.set(t,{});this.event.waitUntil(this.p.promise)}async fetch(t){const{event:e}=this;let n=L(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.l.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=L(t);let s;const{cacheName:n,matchOptions:i}=this.l,r=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=L(t);var i;await(i=0,new Promise((t=>setTimeout(t,i))));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=r.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const c=await this.v(e);if(!c)return!1;const{cacheName:a,matchOptions:h}=this.l,u=await self.caches.open(a),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=v(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,r);for(const e of o)if(i===v(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?c.clone():c)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of U)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:a,oldResponse:f,newResponse:c.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.u[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=L(await t({mode:e,request:n,event:this.event,params:this.params}));this.u[s]=n}return this.u[s]}hasCallback(t){for(const e of this.l.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.l.plugins)if("function"==typeof e[t]){const s=this.m.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.g.push(t),t}async doneWaiting(){let t;for(;t=this.g.shift();)await t}destroy(){this.p.resolve(null)}async v(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class C{constructor(t={}){this.cacheName=w(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new b(this,{event:e,request:s,params:n}),r=this.q(i,s,e);return[r,this.U(r,i,s,e)]}async q(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this.L(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async U(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}class E extends C{constructor(t={}){t.cacheName=f(t.cacheName),super(t),this._=!1!==t.fallbackToNetwork,this.plugins.push(E.copyRedirectedCacheableResponsesPlugin)}async L(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.C(t,e):await this.O(t,e))}async O(t,e){let n;const i=e.params||{};if(!this._)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,o=!r||r===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||s:void 0})),s&&o&&"no-cors"!==t.mode&&(this.N(),await e.cachePut(t,n.clone()))}return n}async C(t,e){this.N();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}N(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==E.copyRedirectedCacheableResponsesPlugin&&(n===E.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(E.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}E.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},E.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await m(t):t};class O{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.k=new Map,this.K=new Map,this.P=new Map,this.l=new E({cacheName:f(t),plugins:[...e,new g({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.l}precache(t){this.addToCacheList(t),this.T||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.T=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=p(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.k.has(i)&&this.k.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.k.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.P.has(t)&&this.P.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.P.set(t,n.integrity)}if(this.k.set(i,t),this.K.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return d(t,(async()=>{const e=new y;this.strategy.plugins.push(e);for(const[e,s]of this.k){const n=this.P.get(s),i=this.K.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return d(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.k.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.k}getCachedURLs(){return[...this.k.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.k.get(e.href)}getIntegrityForCacheKey(t){return this.P.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let x;const N=()=>(x||(x=new O),x);class k extends i{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(r,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}t.NavigationRoute=class extends i{constructor(t,{allowlist:e=[/./],denylist:s=[]}={}){super((t=>this.W(t)),t),this.j=e,this.M=s}W({url:t,request:e}){if(e&&"navigate"!==e.mode)return!1;const s=t.pathname+t.search;for(const t of this.M)if(t.test(s))return!1;return!!this.j.some((t=>t.test(s)))}},t.cleanupOutdatedCaches=function(){self.addEventListener("activate",(t=>{const e=f();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter((s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t));return await Promise.all(s.map((t=>self.caches.delete(t)))),s})(e).then((t=>{})))}))},t.clientsClaim=function(){self.addEventListener("activate",(()=>self.clients.claim()))},t.createHandlerBoundToURL=function(t){return N().createHandlerBoundToURL(t)},t.precacheAndRoute=function(t,e){!function(t){N().precache(t)}(t),function(t){const e=N();h(new k(e,t))}(e)},t.registerRoute=h})); diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 6990b413..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '3.8' - -services: - iris-messenger: - build: - context: . - dockerfile: Dockerfile.dev - volumes: - - .:/iris-messenger - - /iris-messenger/node_modules - ports: - - 8080:8080 diff --git a/src/template.html b/index.html similarity index 85% rename from src/template.html rename to index.html index 842f100d..d27f2317 100644 --- a/src/template.html +++ b/index.html @@ -1,12 +1,9 @@ - - + + Iris – The nostr client for better social networks - - - - - - - - <% preact.headEnd %> - <% preact.bodyEnd %> +
+ diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index 4ffca123..00000000 --- a/netlify.toml +++ /dev/null @@ -1,20 +0,0 @@ -[build] - environment = { NETLIFY_USE_YARN = "true" } - -[dev] - publish = "build" - command = "yarn build" - environment = { NETLIFY_USE_YARN = "true" } - -[[headers]] - for = "/.well-known/nostr.json" - [headers.values] - Content-Type = "application/json" - Access-Control-Allow-Origin = "*" - Access-Control-Allow-Methods = "GET" - Access-Control-Allow-Headers = "Content-Type,x-prerender" - -[[redirects]] - from = "/*" - to = "/index.html" - status = 200 \ No newline at end of file diff --git a/package.json b/package.json index 77f9dad1..39378b41 100644 --- a/package.json +++ b/package.json @@ -1,108 +1,60 @@ { - "name": "iris-messenger", - "version": "2.3.3", - "license": "MIT", + "name": "iris-vite-preact", + "private": true, + "version": "0.0.0", + "type": "module", "scripts": { - "build": "preact build --no-prerender", - "serve": "sirv build --cors --single", - "dev": "preact watch --host localhost --sw", - "dev-docker": "preact watch --host 0.0.0.0 --sw", + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview", "lint": "eslint 'src/**/*.{js,ts,tsx}'", - "lint:fix": "eslint --fix --quiet 'src/**/*.{js,ts,tsx}'", - "format": "prettier --plugin-search-dir . --write .", - "test": "echo 'jest disabled for now'" - }, - "eslintConfig": { - "extends": "preact", - "ignorePatterns": [ - "build/", - "src/js/lib/", - "src/assets", - "src/static" - ], - "overrides": [ - { - "files": [ - "*" - ], - "rules": { - "react/no-did-mount-set-state": "off", - "react/no-did-update-set-state": "off", - "no-useless-escape": "off", - "radix": "off" - } - } - ] - }, - "devDependencies": { - "@tauri-apps/cli": "^1.2.3", - "@types/jquery": "3.5.16", - "@types/lodash": "4.14.191", - "@types/react-helmet": "6.1.6", - "@types/webtorrent": "0.109.3", - "@typescript-eslint/eslint-plugin": "^5.54.1", - "@typescript-eslint/parser": "^5.54.1", - "csv-parse": "^5.3.6", - "enzyme": "^3.11.0", - "enzyme-adapter-preact-pure": "^4.1.0", - "eslint": "^8.35.0", - "eslint-config-preact": "^1.3.0", - "eslint-config-prettier": "^8.7.0", - "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-simple-import-sort": "^10.0.0", - "glob": "^10.1.0", - "jest": "^29.5.0", - "jest-preset-preact": "^4.0.5", - "preact-cli": "^3.4.5", - "prettier": "^2.8.4", - "sirv-cli": "2.0.2", - "webpack-build-notifier": "^2.3.0", - "websocket-polyfill": "^0.0.3" + "lint:fix": "eslint --fix --quiet 'src/**/*.{js,ts,tsx}'" }, "dependencies": { - "@fontsource/lato": "^4.5.10", - "@heroicons/react": "^2.0.17", - "@noble/hashes": "^1.2.0", - "@noble/secp256k1": "^1.7.1", - "@scure/bip32": "^1.1.5", - "@scure/bip39": "^1.1.1", + "@fontsource/lato": "^5.0.2", + "@heroicons/react": "^2.0.18", + "@noble/hashes": "^1.3.0", + "@noble/secp256k1": "^2.0.0", + "@scure/bip32": "^1.3.0", + "@scure/bip39": "^1.2.0", + "@types/lodash": "^4.14.195", "aether-torrent": "^0.3.0", "bech32": "^2.0.0", "bech32-buffer": "^0.2.1", "browserify-cipher": ">=1", "buffer": "^6.0.3", - "dexie": "^3.2.3", + "dexie": "^3.2.4", "fuse.js": "^6.6.2", "history": "5.3.0", "htm": "^3.1.1", "identicon.js": "^2.3.3", - "jquery": "^3.6.4", - "light-bolt11-decoder": "^2.1.0", + "jquery": "^3.7.0", + "light-bolt11-decoder": "^3.0.0", "localforage": "^1.10.0", "lodash": "^4.17.21", "lokijs": "^1.5.12", - "nostr-relaypool": "^0.6.27", - "preact": "^10.13.0", - "preact-router": "^4.1.0", + "nostr-relaypool": "^0.6.28", + "nostr-tools": "^1.11.1", + "preact": "^10.15.1", + "preact-router": "^4.1.1", "preact-scroll-viewport": "^0.2.0", "react-helmet": "^6.1.0", "react-string-replace": "^1.1.0", - "react-virtualized": "^9.22.3", - "styled-components": "^5.3.8", - "workbox-background-sync": "^6.5.4", - "workbox-cacheable-response": "^6.5.4", - "workbox-expiration": "^6.5.4", - "workbox-routing": "^6.5.4", - "workbox-strategies": "^6.5.4" + "react-virtualized": "^9.22.5", + "styled-components": "^5.3.11" }, - "jest": { - "preset": "jest-preset-preact", - "setupFiles": [ - "/tests/__mocks__/browserMocks.js", - "/tests/__mocks__/setupTests.js" - ] - }, - "resolutions": { - "styled-components": "^5" + "devDependencies": { + "@preact/preset-vite": "^2.5.0", + "@typescript-eslint/eslint-plugin": "^5.59.8", + "@typescript-eslint/parser": "^5.59.8", + "eslint": "^8.41.0", + "eslint-config-preact": "^1.3.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-simple-import-sort": "^10.0.0", + "prettier": "^2.8.8", + "typescript": "^5.1.3", + "vite": "^4.3.9", + "vite-plugin-pwa": "^0.16.3" } } diff --git a/preact.config.js b/preact.config.js deleted file mode 100644 index f0b35328..00000000 --- a/preact.config.js +++ /dev/null @@ -1,20 +0,0 @@ -const WebpackBuildNotifierPlugin = require('webpack-build-notifier'); -const path = require('path'); - -export default { - webpack(config, env, helpers, options) { - config.node = { fs: 'empty' }; - config.output = config.output || {}; - config.output.publicPath = '/'; - config.plugins = config.plugins || []; - config.plugins.push( - new WebpackBuildNotifierPlugin({ - title: 'Iris Webpack Build', - logo: path.resolve('./src/assets/img/icon128.png'), - suppressSuccess: true, // don't spam success notifications - warningSound: false, - suppressWarning: true, - }), - ); - }, -}; diff --git a/public/.well-known/assetlinks.json b/public/.well-known/assetlinks.json new file mode 100644 index 00000000..c9a9afa6 --- /dev/null +++ b/public/.well-known/assetlinks.json @@ -0,0 +1,11 @@ +[ + { + "relation": ["delegate_permission/common.handle_all_urls"], + "target": { + "namespace": "android_app", + "package_name": "to.iris.twa", + "sha256_cert_fingerprints": + ["63:B5:70:E8:F1:75:7E:D6:EF:81:11:66:F4:9D:47:AB:49:3C:2E:00:B9:67:92:40:89:A5:03:0B:96:B9:40:09"] + } + } +] \ No newline at end of file diff --git a/public/.well-known/nostr.json b/public/.well-known/nostr.json new file mode 100644 index 00000000..d53ce1b2 --- /dev/null +++ b/public/.well-known/nostr.json @@ -0,0 +1,9 @@ +{ + "names": { + "_": "74dcec31fd3b8cfd960bc5a35ecbeeb8b9cee8eb81f6e8da4c8067553709248d", + "iris": "74dcec31fd3b8cfd960bc5a35ecbeeb8b9cee8eb81f6e8da4c8067553709248d", + "sirius": "4523be58d395b1b196a9b8c82b038b6895cb02b683d0c253a955068dba1facd0", + "petri":"e417ee3d910253993ae0ce6b41d4a24609970f132958d75b2d9b634d60a3cc08", + "rockstar":"91c9a5e1a9744114c6fe2d61ae4de82629eaaa0fb52f48288093c7e7e036f832" + } +} \ No newline at end of file diff --git a/public/browserconfig.xml b/public/browserconfig.xml new file mode 100644 index 00000000..0997b8ed --- /dev/null +++ b/public/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #000000 + + + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 00000000..a71cea29 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/google7b3cf94231e5de15.html b/public/google7b3cf94231e5de15.html new file mode 100644 index 00000000..91ec82de --- /dev/null +++ b/public/google7b3cf94231e5de15.html @@ -0,0 +1 @@ +google-site-verification: google7b3cf94231e5de15.html diff --git a/public/privacy.txt b/public/privacy.txt new file mode 100644 index 00000000..07630718 --- /dev/null +++ b/public/privacy.txt @@ -0,0 +1,14 @@ +Iris Privacy policy + +By default, the application connects to a number of relays in the Nostr network to send and receive messages. The relays are not operated by Iris developers. You can change the default relays at will. + +On Nostr, private messages are encrypted, but anyone can see who you're chatting with and when. + +The application wraps the web application at https://iris.to. The hosting provider logs user IP addresses and page-view counts, which are used to follow unique user count and usage by country. + +Iris users can register an optional convenience username that redirects to their Nostr public profile https://iris.to/username. In this process, user IP address and country code are saved. + +Otherwise, Iris developers do not collect any information about you or your usage of the application. + +We reserve the right to modify this Privacy Policy at any time and without prior notice. Your continued use of the app after the posting of any modified Privacy Policy indicates your acceptance of the terms of the modified Privacy Policy. +If you have any questions about this Privacy Policy, please contact us at sirius@iris.to. diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 00000000..7f07fd60 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: *?*s=*k=* diff --git a/screenshot.png b/screenshot.png deleted file mode 100644 index c135be19..00000000 Binary files a/screenshot.png and /dev/null differ diff --git a/scripts/CsvToTranslations.mjs b/scripts/CsvToTranslations.mjs deleted file mode 100644 index 7ce88d43..00000000 --- a/scripts/CsvToTranslations.mjs +++ /dev/null @@ -1,42 +0,0 @@ -import fs from 'fs'; -import { parse } from 'csv-parse/sync'; - -// Read the csv file with translations -let csv = fs.readFileSync('translations.csv', 'utf8'); - -// Parse the csv into an array of arrays -let lines = parse(csv, { - trim: true, - quote: '"', - relax_column_count: true, -}); - -// Get the list of available languages -let languages = lines[0]; -languages.shift(); - -// Create an object to store the translations -let translations = {}; - -// Iterate through the csv lines and add the translations to the `translations` object -for (let i = 1; i < lines.length; i++) { - let line = lines[i]; - let key = line[0].replace(/,/g, ''); - line.shift(); - for (let j = 0; j < languages.length; j++) { - if (!translations[languages[j]]) { - translations[languages[j]] = {}; - } - if (line[j]) { - translations[languages[j]][key] = line[j].trim() || null; - } - } -} - -// Write the translations back to the language files -for (let lang in translations) { - let fileContent = `export default ${JSON.stringify(translations[lang], null, 2)};`; - fs.writeFileSync(`../src/js/translations/${lang}.mjs`, fileContent); -} - -console.log('Translations added successfully.'); diff --git a/scripts/TranslationsToCsv.mjs b/scripts/TranslationsToCsv.mjs deleted file mode 100644 index c546b9ce..00000000 --- a/scripts/TranslationsToCsv.mjs +++ /dev/null @@ -1,92 +0,0 @@ -import fs from 'fs'; -import { glob } from 'glob'; -import { AVAILABLE_LANGUAGE_KEYS } from '../src/js/translations/Translation.mjs'; - -const EXTRA_KEYS = [ - 'monday', - 'tuesday', - 'wednesday', - 'thursday', - 'friday', - 'saturday', - 'sunday', - 'today', - 'yesterday', - 'global_feed', - 'messages', - 'feeds', - 'social_network', - 'content', - 'images', - 'audio', - 'videos', - 'autoplay_videos', - 'playback', - 'embeds', - 'everyone', -]; - -async function translationsToCsv() { - let csv = ''; - let languages = []; - let translationKeys = new Set(); - let translations = {}; - - for (let lang of AVAILABLE_LANGUAGE_KEYS) { - const translation = (await import(`../src/js/translations/${lang}.mjs`)).default; - translations[lang] = translation; - languages.push(lang); - } - - // Collect used translation keys from code - const files = glob.sync('../src/js/**/*.{js,jsx,ts,tsx}', { ignore: '../src/js/lib/**/*' }); - files.forEach((file) => { - const content = fs.readFileSync(file, 'utf8'); - const matches = content.match(/(^|[^a-zA-Z])t\(['"`]([^'"`]+)['"`]\)/g); - if (matches) { - matches.forEach((match) => { - const key = match.match(/(^|[^a-zA-Z])t\(['"`]([^'"`]+)['"`]\)/)[2]; - translationKeys.add(key); - }); - } - }); - console.log('found', translationKeys.size, 'translation keys from', files.length, 'files'); - - // Translation keys from variables are not found by the regex above - EXTRA_KEYS.forEach((key) => { - translationKeys.add(key); - }); - translationKeys = Array.from(translationKeys); - translationKeys.sort(); - - // add language names to csv - csv += '"","'; - for (let i = 0; i < languages.length; i++) { - csv += languages[i]; - if (i < languages.length - 1) { - csv += '","'; - } else { - csv += '"\n'; - } - } - - csv += '"'; - for (let key of translationKeys) { - let row = key; - for (let lang of languages) { - row += '","' + (translations[lang][key] || '') - .replace(/"/g, '""') - .replace(/\\/g, '') - } - csv += row + '"\n'; - if (key !== translationKeys[translationKeys.length - 1]) { - csv += '"'; - } - } - - // output csv to file - fs.writeFileSync('translations.csv', csv); - console.log('wrote translations.csv'); -} - -translationsToCsv(); diff --git a/src/assets/preact.svg b/src/assets/preact.svg new file mode 100644 index 00000000..908f17de --- /dev/null +++ b/src/assets/preact.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/css/style.css b/src/css/style.css index f4884eda..e88cd365 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -17,9 +17,6 @@ --day-separator-bg: rgba(30, 32, 37, 0.85); --day-separator-color: rgba(255, 255, 255, 0.88); --dropdown-bg: rgba(0, 0, 0, 0.9); - --emoji-picker-bg: #35383f; - --emoji-picker-border-color: #1f2125; - --emoji-picker-color: #fff; --gallery-background: rgba(0, 0, 0, 0.8); --green: #34ba7c; --header-color: #000000; @@ -68,9 +65,6 @@ --day-separator-bg: rgba(255, 255, 255, 0.85); --day-separator-color: rgba(0, 0, 0, 0.88); --dropdown-bg: rgba(255, 255, 255, 0.8); - --emoji-picker-bg: #f5f5f5; - --emoji-picker-border-color: #e5e5e5; - --emoji-picker-color: #000000; --gallery-background: rgba(255, 255, 255, 0.8); --green: #53B781; --header-color: #ffffff; @@ -693,7 +687,7 @@ header.footer .header-content { max-height: 55px; justify-content: center; background-color: var(--main-color); - border-top: 1px solid var(--emoji-picker-border-color); + border-top: 1px solid var(--border-color); } .media-player .info p { @@ -1761,25 +1755,6 @@ a.msgSenderName:hover .user-name { text-align: center; } -.emoji-picker-btn { - outline: 1px; - margin-right: 5px; -} - -.emoji-picker { - background: var(--emoji-picker-bg) !important; - border-color: var(--emoji-picker-border-color) !important; -} - -.emoji-picker * { - color: var(--emoji-picker-color) !important; - border-color: var(--emoji-picker-border-color) !important; -} - -.emoji-picker__tab { - font-size: 35px !important; -} - .attachment-preview { display: flex; flex-direction: column; diff --git a/src/index.css b/src/index.css new file mode 100644 index 00000000..e7df46b1 --- /dev/null +++ b/src/index.css @@ -0,0 +1,7 @@ +:root { + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index c6f2993f..00000000 --- a/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Main from './js/Main'; - -export default Main; diff --git a/src/js/AnimalName.ts b/src/js/AnimalName.ts index a6827688..67b901a2 100644 --- a/src/js/AnimalName.ts +++ b/src/js/AnimalName.ts @@ -1,1824 +1,1824 @@ -import { sha256 } from '@noble/hashes/sha256'; +import { sha256 } from "@noble/hashes/sha256"; const animals = [ - 'canidae', - 'felidae', - 'cat', - 'cattle', - 'dog', - 'donkey', - 'goat', - 'horse', - 'pig', - 'rabbit', - 'aardvark', - 'aardwolf', - 'albatross', - 'alligator', - 'alpaca', - 'amphibian', - 'anaconda', - 'angelfish', - 'anglerfish', - 'ant', - 'anteater', - 'antelope', - 'antlion', - 'ape', - 'aphid', - 'armadillo', - 'asp', - 'baboon', - 'badger', - 'bandicoot', - 'barnacle', - 'barracuda', - 'basilisk', - 'bass', - 'bat', - 'bear', - 'beaver', - 'bedbug', - 'bee', - 'beetle', - 'bird', - 'bison', - 'blackbird', - 'boa', - 'boar', - 'bobcat', - 'bobolink', - 'bonobo', - 'booby', - 'bovid', - 'bug', - 'butterfly', - 'buzzard', - 'camel', - 'canid', - 'capybara', - 'cardinal', - 'caribou', - 'carp', - 'cat', - 'catshark', - 'caterpillar', - 'catfish', - 'cattle', - 'centipede', - 'cephalopod', - 'chameleon', - 'cheetah', - 'chickadee', - 'chicken', - 'chimpanzee', - 'chinchilla', - 'chipmunk', - 'clam', - 'clownfish', - 'cobra', - 'cockroach', - 'cod', - 'condor', - 'constrictor', - 'coral', - 'cougar', - 'cow', - 'coyote', - 'crab', - 'crane', - 'crawdad', - 'crayfish', - 'cricket', - 'crocodile', - 'crow', - 'cuckoo', - 'cicada', - 'damselfly', - 'deer', - 'dingo', - 'dinosaur', - 'dog', - 'dolphin', - 'donkey', - 'dormouse', - 'dove', - 'dragonfly', - 'dragon', - 'duck', - 'eagle', - 'earthworm', - 'earwig', - 'echidna', - 'eel', - 'egret', - 'elephant', - 'elk', - 'emu', - 'ermine', - 'falcon', - 'ferret', - 'finch', - 'firefly', - 'fish', - 'flamingo', - 'flea', - 'fly', - 'flyingfish', - 'fowl', - 'fox', - 'frog', - 'gamefowl', - 'galliform', - 'gazelle', - 'gecko', - 'gerbil', - 'gibbon', - 'giraffe', - 'goat', - 'goldfish', - 'goose', - 'gopher', - 'gorilla', - 'grasshopper', - 'grouse', - 'guan', - 'guanaco', - 'guineafowl', - 'gull', - 'guppy', - 'haddock', - 'halibut', - 'hamster', - 'hare', - 'harrier', - 'hawk', - 'hedgehog', - 'heron', - 'herring', - 'hippopotamus', - 'hookworm', - 'hornet', - 'horse', - 'hoverfly', - 'hummingbird', - 'hyena', - 'iguana', - 'impala', - 'jackal', - 'jaguar', - 'jay', - 'jellyfish', - 'junglefowl', - 'kangaroo', - 'kingfisher', - 'kite', - 'kiwi', - 'koala', - 'koi', - 'krill', - 'ladybug', - 'lamprey', - 'landfowl', - 'lark', - 'leech', - 'lemming', - 'lemur', - 'leopard', - 'leopon', - 'limpet', - 'lion', - 'lizard', - 'llama', - 'lobster', - 'locust', - 'loon', - 'louse', - 'lungfish', - 'lynx', - 'macaw', - 'mackerel', - 'magpie', - 'mammal', - 'manatee', - 'mandrill', - 'marlin', - 'marmoset', - 'marmot', - 'marsupial', - 'marten', - 'mastodon', - 'meadowlark', - 'meerkat', - 'mink', - 'minnow', - 'mite', - 'mockingbird', - 'mole', - 'mollusk', - 'mongoose', - 'monkey', - 'moose', - 'mosquito', - 'moth', - 'mouse', - 'mule', - 'muskox', - 'narwhal', - 'newt', - 'nightingale', - 'ocelot', - 'octopus', - 'opossum', - 'orangutan', - 'orca', - 'ostrich', - 'otter', - 'owl', - 'ox', - 'panda', - 'panther', - 'parakeet', - 'parrot', - 'parrotfish', - 'partridge', - 'peacock', - 'peafowl', - 'pelican', - 'penguin', - 'perch', - 'pheasant', - 'pig', - 'pigeon', - 'pike', - 'pinniped', - 'piranha', - 'planarian', - 'platypus', - 'pony', - 'porcupine', - 'porpoise', - 'possum', - 'prawn', - 'primate', - 'ptarmigan', - 'puffin', - 'puma', - 'python', - 'quail', - 'quelea', - 'quokka', - 'rabbit', - 'raccoon', - 'rat', - 'rattlesnake', - 'raven', - 'reindeer', - 'reptile', - 'rhinoceros', - 'roadrunner', - 'rodent', - 'rook', - 'rooster', - 'roundworm', - 'sailfish', - 'salamander', - 'salmon', - 'sawfish', - 'scallop', - 'scorpion', - 'seahorse', - 'shark', - 'sheep', - 'shrew', - 'shrimp', - 'silkworm', - 'silverfish', - 'skink', - 'skunk', - 'sloth', - 'slug', - 'smelt', - 'snail', - 'snake', - 'snipe', - 'sole', - 'sparrow', - 'spider', - 'spoonbill', - 'squid', - 'squirrel', - 'starfish', - 'stingray', - 'stoat', - 'stork', - 'sturgeon', - 'swallow', - 'swan', - 'swift', - 'swordfish', - 'swordtail', - 'tahr', - 'takin', - 'tapir', - 'tarantula', - 'tarsier', - 'termite', - 'tern', - 'thrush', - 'tick', - 'tiger', - 'tiglon', - 'toad', - 'tortoise', - 'toucan', - 'trout', - 'tuna', - 'turkey', - 'turtle', - 'tyrannosaurus', - 'urial', - 'vicuna', - 'viper', - 'vole', - 'vulture', - 'wallaby', - 'walrus', - 'wasp', - 'warbler', - 'weasel', - 'whale', - 'whippet', - 'whitefish', - 'wildcat', - 'wildebeest', - 'wildfowl', - 'wolf', - 'wolverine', - 'wombat', - 'woodpecker', - 'worm', - 'wren', - 'xerinae', - 'yak', - 'zebra', - 'alpaca', - 'cat', - 'cattle', - 'chicken', - 'dog', - 'donkey', - 'ferret', - 'gayal', - 'goldfish', - 'guppy', - 'horse', - 'koi', - 'llama', - 'sheep', - 'yak', - 'unicorn', + "canidae", + "felidae", + "cat", + "cattle", + "dog", + "donkey", + "goat", + "horse", + "pig", + "rabbit", + "aardvark", + "aardwolf", + "albatross", + "alligator", + "alpaca", + "amphibian", + "anaconda", + "angelfish", + "anglerfish", + "ant", + "anteater", + "antelope", + "antlion", + "ape", + "aphid", + "armadillo", + "asp", + "baboon", + "badger", + "bandicoot", + "barnacle", + "barracuda", + "basilisk", + "bass", + "bat", + "bear", + "beaver", + "bedbug", + "bee", + "beetle", + "bird", + "bison", + "blackbird", + "boa", + "boar", + "bobcat", + "bobolink", + "bonobo", + "booby", + "bovid", + "bug", + "butterfly", + "buzzard", + "camel", + "canid", + "capybara", + "cardinal", + "caribou", + "carp", + "cat", + "catshark", + "caterpillar", + "catfish", + "cattle", + "centipede", + "cephalopod", + "chameleon", + "cheetah", + "chickadee", + "chicken", + "chimpanzee", + "chinchilla", + "chipmunk", + "clam", + "clownfish", + "cobra", + "cockroach", + "cod", + "condor", + "constrictor", + "coral", + "cougar", + "cow", + "coyote", + "crab", + "crane", + "crawdad", + "crayfish", + "cricket", + "crocodile", + "crow", + "cuckoo", + "cicada", + "damselfly", + "deer", + "dingo", + "dinosaur", + "dog", + "dolphin", + "donkey", + "dormouse", + "dove", + "dragonfly", + "dragon", + "duck", + "eagle", + "earthworm", + "earwig", + "echidna", + "eel", + "egret", + "elephant", + "elk", + "emu", + "ermine", + "falcon", + "ferret", + "finch", + "firefly", + "fish", + "flamingo", + "flea", + "fly", + "flyingfish", + "fowl", + "fox", + "frog", + "gamefowl", + "galliform", + "gazelle", + "gecko", + "gerbil", + "gibbon", + "giraffe", + "goat", + "goldfish", + "goose", + "gopher", + "gorilla", + "grasshopper", + "grouse", + "guan", + "guanaco", + "guineafowl", + "gull", + "guppy", + "haddock", + "halibut", + "hamster", + "hare", + "harrier", + "hawk", + "hedgehog", + "heron", + "herring", + "hippopotamus", + "hookworm", + "hornet", + "horse", + "hoverfly", + "hummingbird", + "hyena", + "iguana", + "impala", + "jackal", + "jaguar", + "jay", + "jellyfish", + "junglefowl", + "kangaroo", + "kingfisher", + "kite", + "kiwi", + "koala", + "koi", + "krill", + "ladybug", + "lamprey", + "landfowl", + "lark", + "leech", + "lemming", + "lemur", + "leopard", + "leopon", + "limpet", + "lion", + "lizard", + "llama", + "lobster", + "locust", + "loon", + "louse", + "lungfish", + "lynx", + "macaw", + "mackerel", + "magpie", + "mammal", + "manatee", + "mandrill", + "marlin", + "marmoset", + "marmot", + "marsupial", + "marten", + "mastodon", + "meadowlark", + "meerkat", + "mink", + "minnow", + "mite", + "mockingbird", + "mole", + "mollusk", + "mongoose", + "monkey", + "moose", + "mosquito", + "moth", + "mouse", + "mule", + "muskox", + "narwhal", + "newt", + "nightingale", + "ocelot", + "octopus", + "opossum", + "orangutan", + "orca", + "ostrich", + "otter", + "owl", + "ox", + "panda", + "panther", + "parakeet", + "parrot", + "parrotfish", + "partridge", + "peacock", + "peafowl", + "pelican", + "penguin", + "perch", + "pheasant", + "pig", + "pigeon", + "pike", + "pinniped", + "piranha", + "planarian", + "platypus", + "pony", + "porcupine", + "porpoise", + "possum", + "prawn", + "primate", + "ptarmigan", + "puffin", + "puma", + "python", + "quail", + "quelea", + "quokka", + "rabbit", + "raccoon", + "rat", + "rattlesnake", + "raven", + "reindeer", + "reptile", + "rhinoceros", + "roadrunner", + "rodent", + "rook", + "rooster", + "roundworm", + "sailfish", + "salamander", + "salmon", + "sawfish", + "scallop", + "scorpion", + "seahorse", + "shark", + "sheep", + "shrew", + "shrimp", + "silkworm", + "silverfish", + "skink", + "skunk", + "sloth", + "slug", + "smelt", + "snail", + "snake", + "snipe", + "sole", + "sparrow", + "spider", + "spoonbill", + "squid", + "squirrel", + "starfish", + "stingray", + "stoat", + "stork", + "sturgeon", + "swallow", + "swan", + "swift", + "swordfish", + "swordtail", + "tahr", + "takin", + "tapir", + "tarantula", + "tarsier", + "termite", + "tern", + "thrush", + "tick", + "tiger", + "tiglon", + "toad", + "tortoise", + "toucan", + "trout", + "tuna", + "turkey", + "turtle", + "tyrannosaurus", + "urial", + "vicuna", + "viper", + "vole", + "vulture", + "wallaby", + "walrus", + "wasp", + "warbler", + "weasel", + "whale", + "whippet", + "whitefish", + "wildcat", + "wildebeest", + "wildfowl", + "wolf", + "wolverine", + "wombat", + "woodpecker", + "worm", + "wren", + "xerinae", + "yak", + "zebra", + "alpaca", + "cat", + "cattle", + "chicken", + "dog", + "donkey", + "ferret", + "gayal", + "goldfish", + "guppy", + "horse", + "koi", + "llama", + "sheep", + "yak", + "unicorn", ]; const adjectives = [ - 'average', - 'big', - 'colossal', - 'fat', - 'giant', - 'gigantic', - 'great', - 'huge', - 'immense', - 'large', - 'little', - 'long', - 'mammoth', - 'massive', - 'miniature', - 'petite', - 'puny', - 'short', - 'small', - 'tall', - 'tiny', - 'boiling', - 'breezy', - 'broken', - 'bumpy', - 'chilly', - 'cold', - 'cool', - 'creepy', - 'crooked', - 'cuddly', - 'curly', - 'damaged', - 'damp', - 'dirty', - 'dry', - 'dusty', - 'filthy', - 'flaky', - 'fluffy', - 'wet', - 'broad', - 'chubby', - 'crooked', - 'curved', - 'deep', - 'flat', - 'high', - 'hollow', - 'low', - 'narrow', - 'round', - 'shallow', - 'skinny', - 'square', - 'steep', - 'straight', - 'wide', - 'ancient', - 'brief', - 'early', - 'fast', - 'late', - 'long', - 'modern', - 'old', - 'quick', - 'rapid', - 'short', - 'slow', - 'swift', - 'young', - 'abundant', - 'empty', - 'few', - 'heavy', - 'light', - 'many', - 'numerous', - 'Sound', - 'cooing', - 'deafening', - 'faint', - 'harsh', - 'hissing', - 'hushed', - 'husky', - 'loud', - 'melodic', - 'moaning', - 'mute', - 'noisy', - 'purring', - 'quiet', - 'raspy', - 'resonant', - 'screeching', - 'shrill', - 'silent', - 'soft', - 'squealing', - 'thundering', - 'voiceless', - 'whispering', - 'bitter', - 'delicious', - 'fresh', - 'juicy', - 'ripe', - 'rotten', - 'salty', - 'sour', - 'spicy', - 'stale', - 'sticky', - 'strong', - 'sweet', - 'tasteless', - 'tasty', - 'thirsty', - 'fluttering', - 'fuzzy', - 'greasy', - 'grubby', - 'hard', - 'hot', - 'icy', - 'loose', - 'melted', - 'plastic', - 'prickly', - 'rainy', - 'rough', - 'scattered', - 'shaggy', - 'shaky', - 'sharp', - 'shivering', - 'silky', - 'slimy', - 'slippery', - 'smooth', - 'soft', - 'solid', - 'steady', - 'sticky', - 'tender', - 'tight', - 'uneven', - 'weak', - 'wet', - 'wooden', - 'afraid', - 'angry', - 'annoyed', - 'anxious', - 'arrogant', - 'ashamed', - 'awful', - 'bad', - 'bewildered', - 'bored', - 'combative', - 'condemned', - 'confused', - 'creepy', - 'cruel', - 'dangerous', - 'defeated', - 'defiant', - 'depressed', - 'disgusted', - 'disturbed', - 'eerie', - 'embarrassed', - 'envious', - 'evil', - 'fierce', - 'foolish', - 'frantic', - 'frightened', - 'grieving', - 'helpless', - 'homeless', - 'hungry', - 'hurt', - 'ill', - 'jealous', - 'lonely', - 'mysterious', - 'naughty', - 'nervous', - 'obnoxious', - 'outrageous', - 'panicky', - 'repulsive', - 'scary', - 'scornful', - 'selfish', - 'sore', - 'tense', - 'terrible', - 'thoughtless', - 'tired', - 'troubled', - 'upset', - 'uptight', - 'weary', - 'wicked', - 'worried', - 'agreeable', - 'amused', - 'brave', - 'calm', - 'charming', - 'cheerful', - 'comfortable', - 'cooperative', - 'courageous', - 'delightful', - 'determined', - 'eager', - 'elated', - 'enchanting', - 'encouraging', - 'energetic', - 'enthusiastic', - 'excited', - 'exuberant', - 'fair', - 'faithful', - 'fantastic', - 'fine', - 'friendly', - 'funny', - 'gentle', - 'glorious', - 'good', - 'happy', - 'healthy', - 'helpful', - 'hilarious', - 'jolly', - 'joyous', - 'kind', - 'lively', - 'lovely', - 'lucky', - 'obedient', - 'perfect', - 'pleasant', - 'proud', - 'relieved', - 'silly', - 'smiling', - 'splendid', - 'successful', - 'thoughtful', - 'victorious', - 'vivacious', - 'witty', - 'wonderful', - 'zealous', - 'zany', - 'other', - 'good', - 'new', - 'old', - 'great', - 'high', - 'small', - 'different', - 'large', - 'local', - 'social', - 'important', - 'long', - 'young', - 'national', - 'british', - 'right', - 'early', - 'possible', - 'big', - 'little', - 'political', - 'able', - 'late', - 'general', - 'full', - 'far', - 'low', - 'public', - 'available', - 'bad', - 'main', - 'sure', - 'clear', - 'major', - 'economic', - 'only', - 'likely', - 'real', - 'black', - 'particular', - 'international', - 'special', - 'difficult', - 'certain', - 'open', - 'whole', - 'white', - 'free', - 'short', - 'easy', - 'strong', - 'european', - 'central', - 'similar', - 'human', - 'common', - 'necessary', - 'single', - 'personal', - 'hard', - 'private', - 'poor', - 'financial', - 'wide', - 'foreign', - 'simple', - 'recent', - 'concerned', - 'american', - 'various', - 'close', - 'fine', - 'english', - 'wrong', - 'present', - 'royal', - 'natural', - 'individual', - 'nice', - 'french', - 'nihilist', - 'solipsist', - 'materialist', - 'surrealist', - 'heroic', - 'awesome', - 'hedonist', - 'absurd', - 'current', - 'modern', - 'labour', - 'legal', - 'happy', - 'final', - 'red', - 'normal', - 'serious', - 'previous', - 'total', - 'prime', - 'significant', - 'industrial', - 'sorry', - 'dead', - 'specific', - 'appropriate', - 'top', - 'soviet', - 'basic', - 'military', - 'original', - 'successful', - 'aware', - 'hon', - 'popular', - 'heavy', - 'professional', - 'direct', - 'dark', - 'cold', - 'ready', - 'green', - 'useful', - 'effective', - 'western', - 'traditional', - 'scottish', - 'german', - 'independent', - 'deep', - 'interesting', - 'considerable', - 'involved', - 'physical', - 'hot', - 'existing', - 'responsible', - 'complete', - 'medical', - 'blue', - 'extra', - 'past', - 'male', - 'interested', - 'fair', - 'essential', - 'beautiful', - 'civil', - 'primary', - 'obvious', - 'future', - 'environmental', - 'positive', - 'senior', - 'nuclear', - 'annual', - 'relevant', - 'huge', - 'rich', - 'commercial', - 'safe', - 'regional', - 'practical', - 'official', - 'separate', - 'key', - 'chief', - 'regular', - 'due', - 'additional', - 'active', - 'powerful', - 'complex', - 'standard', - 'impossible', - 'light', - 'warm', - 'middle', - 'fresh', - 'sexual', - 'front', - 'domestic', - 'actual', - 'united', - 'technical', - 'ordinary', - 'cheap', - 'strange', - 'internal', - 'excellent', - 'quiet', - 'soft', - 'potential', - 'northern', - 'religious', - 'quick', - 'very', - 'famous', - 'cultural', - 'proper', - 'broad', - 'joint', - 'formal', - 'limited', - 'conservative', - 'lovely', - 'usual', - 'ltd', - 'unable', - 'rural', - 'initial', - 'substantial', - 'bright', - 'average', - 'leading', - 'reasonable', - 'immediate', - 'suitable', - 'equal', - 'detailed', - 'working', - 'overall', - 'female', - 'afraid', - 'democratic', - 'growing', - 'sufficient', - 'scientific', - 'eastern', - 'correct', - 'inc', - 'irish', - 'expensive', - 'educational', - 'mental', - 'dangerous', - 'critical', - 'increased', - 'familiar', - 'unlikely', - 'double', - 'perfect', - 'slow', - 'tiny', - 'dry', - 'historical', - 'thin', - 'daily', - 'southern', - 'increasing', - 'wild', - 'alone', - 'urban', - 'empty', - 'married', - 'narrow', - 'liberal', - 'supposed', - 'upper', - 'apparent', - 'tall', - 'busy', - 'bloody', - 'prepared', - 'russian', - 'moral', - 'careful', - 'clean', - 'attractive', - 'japanese', - 'vital', - 'thick', - 'alternative', - 'fast', - 'ancient', - 'elderly', - 'rare', - 'external', - 'capable', - 'brief', - 'wonderful', - 'grand', - 'typical', - 'entire', - 'grey', - 'constant', - 'vast', - 'surprised', - 'ideal', - 'terrible', - 'academic', - 'funny', - 'minor', - 'pleased', - 'severe', - 'ill', - 'corporate', - 'negative', - 'permanent', - 'weak', - 'brown', - 'fundamental', - 'odd', - 'crucial', - 'inner', - 'used', - 'criminal', - 'contemporary', - 'sharp', - 'sick', - 'near', - 'roman', - 'massive', - 'unique', - 'secondary', - 'parliamentary', - 'african', - 'unknown', - 'subsequent', - 'angry', - 'alive', - 'guilty', - 'lucky', - 'enormous', - 'well', - 'yellow', - 'unusual', - 'net', - 'tough', - 'dear', - 'extensive', - 'glad', - 'remaining', - 'agricultural', - 'alright', - 'healthy', - 'italian', - 'principal', - 'tired', - 'efficient', - 'comfortable', - 'chinese', - 'relative', - 'friendly', - 'conventional', - 'willing', - 'sudden', - 'proposed', - 'voluntary', - 'slight', - 'valuable', - 'dramatic', - 'golden', - 'temporary', - 'federal', - 'keen', - 'flat', - 'silent', - 'indian', - 'worried', - 'pale', - 'statutory', - 'welsh', - 'dependent', - 'firm', - 'wet', - 'competitive', - 'armed', - 'radical', - 'outside', - 'acceptable', - 'sensitive', - 'living', - 'pure', - 'global', - 'emotional', - 'sad', - 'secret', - 'rapid', - 'adequate', - 'fixed', - 'sweet', - 'administrative', - 'wooden', - 'remarkable', - 'comprehensive', - 'surprising', - 'solid', - 'rough', - 'mere', - 'mass', - 'brilliant', - 'maximum', - 'absolute', - 'electronic', - 'visual', - 'electric', - 'cool', - 'spanish', - 'literary', - 'continuing', - 'supreme', - 'chemical', - 'genuine', - 'exciting', - 'written', - 'advanced', - 'extreme', - 'classical', - 'fit', - 'favourite', - 'widespread', - 'confident', - 'straight', - 'proud', - 'numerous', - 'opposite', - 'distinct', - 'mad', - 'helpful', - 'given', - 'disabled', - 'consistent', - 'anxious', - 'nervous', - 'awful', - 'stable', - 'constitutional', - 'satisfied', - 'conscious', - 'developing', - 'strategic', - 'holy', - 'smooth', - 'dominant', - 'remote', - 'theoretical', - 'outstanding', - 'pink', - 'pretty', - 'clinical', - 'minimum', - 'honest', - 'impressive', - 'related', - 'residential', - 'extraordinary', - 'plain', - 'visible', - 'accurate', - 'distant', - 'still', - 'greek', - 'complicated', - 'musical', - 'precise', - 'gentle', - 'broken', - 'live', - 'silly', - 'fat', - 'tight', - 'monetary', - 'round', - 'psychological', - 'violent', - 'unemployed', - 'inevitable', - 'junior', - 'sensible', - 'grateful', - 'pleasant', - 'dirty', - 'structural', - 'welcome', - 'deaf', - 'above', - 'continuous', - 'blind', - 'overseas', - 'mean', - 'entitled', - 'delighted', - 'loose', - 'occasional', - 'evident', - 'desperate', - 'fellow', - 'universal', - 'square', - 'steady', - 'classic', - 'equivalent', - 'intellectual', - 'victorian', - 'level', - 'ultimate', - 'creative', - 'lost', - 'medieval', - 'clever', - 'linguistic', - 'convinced', - 'judicial', - 'raw', - 'sophisticated', - 'asleep', - 'vulnerable', - 'illegal', - 'outer', - 'revolutionary', - 'bitter', - 'changing', - 'australian', - 'native', - 'imperial', - 'strict', - 'wise', - 'informal', - 'flexible', - 'collective', - 'frequent', - 'experimental', - 'spiritual', - 'intense', - 'rational', - 'generous', - 'inadequate', - 'prominent', - 'logical', - 'bare', - 'historic', - 'modest', - 'dutch', - 'acute', - 'electrical', - 'valid', - 'weekly', - 'gross', - 'automatic', - 'loud', - 'reliable', - 'mutual', - 'liable', - 'multiple', - 'ruling', - 'curious', - 'sole', - 'managing', - 'pregnant', - 'latin', - 'nearby', - 'exact', - 'underlying', - 'identical', - 'satisfactory', - 'marginal', - 'distinctive', - 'electoral', - 'urgent', - 'presidential', - 'controversial', - 'everyday', - 'encouraging', - 'organic', - 'continued', - 'expected', - 'statistical', - 'desirable', - 'innocent', - 'improved', - 'exclusive', - 'marked', - 'experienced', - 'unexpected', - 'superb', - 'sheer', - 'disappointed', - 'frightened', - 'gastric', - 'romantic', - 'naked', - 'reluctant', - 'magnificent', - 'convenient', - 'established', - 'closed', - 'uncertain', - 'artificial', - 'diplomatic', - 'tremendous', - 'marine', - 'mechanical', - 'retail', - 'institutional', - 'mixed', - 'required', - 'biological', - 'known', - 'functional', - 'straightforward', - 'superior', - 'digital', - 'spectacular', - 'unhappy', - 'confused', - 'unfair', - 'aggressive', - 'spare', - 'painful', - 'abstract', - 'asian', - 'associated', - 'legislative', - 'monthly', - 'intelligent', - 'hungry', - 'explicit', - 'nasty', - 'just', - 'faint', - 'coloured', - 'ridiculous', - 'amazing', - 'comparable', - 'successive', - 'realistic', - 'back', - 'decent', - 'decentralized', - 'bitcoin', - 'cypherpunk', - 'unnecessary', - 'flying', - 'random', - 'influential', - 'dull', - 'genetic', - 'neat', - 'marvellous', - 'crazy', - 'damp', - 'giant', - 'secure', - 'bottom', - 'skilled', - 'subtle', - 'elegant', - 'brave', - 'lesser', - 'parallel', - 'steep', - 'intensive', - 'casual', - 'tropical', - 'lonely', - 'partial', - 'preliminary', - 'concrete', - 'alleged', - 'assistant', - 'vertical', - 'upset', - 'delicate', - 'mild', - 'occupational', - 'excessive', - 'progressive', - 'exceptional', - 'integrated', - 'striking', - 'continental', - 'okay', - 'harsh', - 'combined', - 'fierce', - 'handsome', - 'characteristic', - 'chronic', - 'compulsory', - 'interim', - 'objective', - 'splendid', - 'magic', - 'systematic', - 'obliged', - 'payable', - 'fun', - 'horrible', - 'primitive', - 'fascinating', - 'ideological', - 'metropolitan', - 'surrounding', - 'estimated', - 'peaceful', - 'premier', - 'operational', - 'technological', - 'kind', - 'advisory', - 'hostile', - 'precious', - 'accessible', - 'determined', - 'excited', - 'impressed', - 'provincial', - 'smart', - 'endless', - 'isolated', - 'drunk', - 'geographical', - 'like', - 'dynamic', - 'boring', - 'forthcoming', - 'unfortunate', - 'definite', - 'super', - 'notable', - 'indirect', - 'stiff', - 'wealthy', - 'awkward', - 'lively', - 'neutral', - 'artistic', - 'content', - 'mature', - 'colonial', - 'ambitious', - 'evil', - 'magnetic', - 'verbal', - 'legitimate', - 'sympathetic', - 'empirical', - 'head', - 'shallow', - 'vague', - 'naval', - 'depressed', - 'shared', - 'added', - 'shocked', - 'mid', - 'worthwhile', - 'qualified', - 'missing', - 'blank', - 'absent', - 'favourable', - 'polish', - 'israeli', - 'developed', - 'profound', - 'representative', - 'enthusiastic', - 'dreadful', - 'rigid', - 'reduced', - 'cruel', - 'coastal', - 'peculiar', - 'swiss', - 'crude', - 'extended', - 'selected', - 'eager', - 'canadian', - 'bold', - 'relaxed', - 'corresponding', - 'running', - 'planned', - 'applicable', - 'immense', - 'allied', - 'comparative', - 'uncomfortable', - 'conservation', - 'productive', - 'beneficial', - 'bored', - 'charming', - 'minimal', - 'mobile', - 'turkish', - 'orange', - 'rear', - 'passive', - 'suspicious', - 'overwhelming', - 'fatal', - 'resulting', - 'symbolic', - 'registered', - 'neighbouring', - 'calm', - 'irrelevant', - 'patient', - 'compact', - 'profitable', - 'rival', - 'loyal', - 'moderate', - 'distinguished', - 'interior', - 'noble', - 'insufficient', - 'eligible', - 'mysterious', - 'varying', - 'managerial', - 'molecular', - 'olympic', - 'linear', - 'prospective', - 'printed', - 'parental', - 'diverse', - 'elaborate', - 'furious', - 'fiscal', - 'burning', - 'useless', - 'semantic', - 'embarrassed', - 'inherent', - 'philosophical', - 'deliberate', - 'awake', - 'variable', - 'promising', - 'unpleasant', - 'varied', - 'sacred', - 'selective', - 'inclined', - 'tender', - 'hidden', - 'worthy', - 'intermediate', - 'sound', - 'protective', - 'fortunate', - 'slim', - 'defensive', - 'divine', - 'stuck', - 'driving', - 'invisible', - 'misleading', - 'circular', - 'mathematical', - 'inappropriate', - 'liquid', - 'persistent', - 'solar', - 'doubtful', - 'manual', - 'architectural', - 'intact', - 'incredible', - 'devoted', - 'prior', - 'tragic', - 'respectable', - 'optimistic', - 'convincing', - 'unacceptable', - 'decisive', - 'competent', - 'spatial', - 'respective', - 'binding', - 'relieved', - 'nursing', - 'toxic', - 'select', - 'redundant', - 'integral', - 'then', - 'probable', - 'amateur', - 'fond', - 'passing', - 'specified', - 'territorial', - 'horizontal', - 'inland', - 'cognitive', - 'regulatory', - 'miserable', - 'resident', - 'polite', - 'scared', - 'gothic', - 'civilian', - 'instant', - 'lengthy', - 'adverse', - 'korean', - 'unconscious', - 'anonymous', - 'aesthetic', - 'orthodox', - 'static', - 'unaware', - 'costly', - 'fantastic', - 'foolish', - 'fashionable', - 'causal', - 'compatible', - 'wee', - 'implicit', - 'dual', - 'ok', - 'cheerful', - 'subjective', - 'forward', - 'surviving', - 'exotic', - 'purple', - 'cautious', - 'visiting', - 'aggregate', - 'ethical', - 'teenage', - 'dying', - 'disastrous', - 'delicious', - 'confidential', - 'underground', - 'thorough', - 'grim', - 'autonomous', - 'atomic', - 'frozen', - 'colourful', - 'injured', - 'uniform', - 'ashamed', - 'glorious', - 'wicked', - 'coherent', - 'rising', - 'shy', - 'novel', - 'balanced', - 'delightful', - 'arbitrary', - 'adjacent', - 'worrying', - 'weird', - 'unchanged', - 'rolling', - 'evolutionary', - 'intimate', - 'sporting', - 'disciplinary', - 'formidable', - 'lexical', - 'noisy', - 'gradual', - 'accused', - 'homeless', - 'supporting', - 'coming', - 'renewed', - 'excess', - 'retired', - 'rubber', - 'chosen', - 'outdoor', - 'embarrassing', - 'preferred', - 'bizarre', - 'appalling', - 'agreed', - 'imaginative', - 'governing', - 'accepted', - 'vocational', - 'mighty', - 'puzzled', - 'worldwide', - 'organisational', - 'sunny', - 'eldest', - 'eventual', - 'spontaneous', - 'vivid', - 'rude', - 'faithful', - 'ministerial', - 'innovative', - 'controlled', - 'conceptual', - 'unwilling', - 'civic', - 'meaningful', - 'alive', - 'brainy', - 'breakable', - 'busy', - 'careful', - 'cautious', - 'clever', - 'concerned', - 'crazy', - 'curious', - 'dead', - 'different', - 'difficult', - 'doubtful', - 'easy', - 'famous', - 'fragile', - 'helpful', - 'helpless', - 'important', - 'impossible', - 'innocent', - 'inquisitive', - 'modern', - 'open', - 'outstanding', - 'poor', - 'powerful', - 'puzzled', - 'real', - 'rich', - 'shy', - 'sleepy', - 'super', - 'tame', - 'uninterested', - 'wandering', - 'wild', - 'wrong', - 'adorable', - 'alert', - 'average', - 'beautiful', - 'blonde', - 'bloody', - 'blushing', - 'bright', - 'clean', - 'clear', - 'cloudy', - 'colorful', - 'crowded', - 'cute', - 'dark', - 'drab', - 'distinct', - 'dull', - 'elegant', - 'fancy', - 'filthy', - 'glamorous', - 'gleaming', - 'graceful', - 'grotesque', - 'homely', - 'light', - 'misty', - 'motionless', - 'muddy', - 'plain', - 'poised', - 'quaint', - 'shiny', - 'smoggy', - 'sparkling', - 'spotless', - 'stormy', - 'strange', - 'ugly', - 'unsightly', - 'unusual', - 'bad', - 'better', - 'beautiful', - 'big', - 'black', - 'blue', - 'bright', - 'clumsy', - 'crazy', - 'dizzy', - 'dull', - 'fat', - 'frail', - 'friendly', - 'funny', - 'great', - 'green', - 'gigantic', - 'gorgeous', - 'grumpy', - 'handsome', - 'happy', - 'horrible', - 'itchy', - 'jittery', - 'jolly', - 'kind', - 'long', - 'lazy', - 'magnificent', - 'magenta', - 'many', - 'mighty', - 'mushy', - 'nasty', - 'new', - 'nice', - 'nosy', - 'nutty', - 'nutritious', - 'odd', - 'orange', - 'ordinary', - 'pretty', - 'precious', - 'prickly', - 'purple', - 'quaint', - 'quiet', - 'quick', - 'quickest', - 'rainy', - 'rare', - 'ratty', - 'red', - 'roasted', - 'robust', - 'round', - 'sad', - 'scary', - 'scrawny', - 'short', - 'silly', - 'stingy', - 'strange', - 'striped', - 'spotty', - 'tart', - 'tall', - 'tame', - 'tan', - 'tender', - 'testy', - 'tricky', - 'tough', - 'ugly', - 'ugliest', - 'vast', - 'watery', - 'wasteful', - 'wonderful', - 'yellow', - 'yummy', - 'zany', + "average", + "big", + "colossal", + "fat", + "giant", + "gigantic", + "great", + "huge", + "immense", + "large", + "little", + "long", + "mammoth", + "massive", + "miniature", + "petite", + "puny", + "short", + "small", + "tall", + "tiny", + "boiling", + "breezy", + "broken", + "bumpy", + "chilly", + "cold", + "cool", + "creepy", + "crooked", + "cuddly", + "curly", + "damaged", + "damp", + "dirty", + "dry", + "dusty", + "filthy", + "flaky", + "fluffy", + "wet", + "broad", + "chubby", + "crooked", + "curved", + "deep", + "flat", + "high", + "hollow", + "low", + "narrow", + "round", + "shallow", + "skinny", + "square", + "steep", + "straight", + "wide", + "ancient", + "brief", + "early", + "fast", + "late", + "long", + "modern", + "old", + "quick", + "rapid", + "short", + "slow", + "swift", + "young", + "abundant", + "empty", + "few", + "heavy", + "light", + "many", + "numerous", + "Sound", + "cooing", + "deafening", + "faint", + "harsh", + "hissing", + "hushed", + "husky", + "loud", + "melodic", + "moaning", + "mute", + "noisy", + "purring", + "quiet", + "raspy", + "resonant", + "screeching", + "shrill", + "silent", + "soft", + "squealing", + "thundering", + "voiceless", + "whispering", + "bitter", + "delicious", + "fresh", + "juicy", + "ripe", + "rotten", + "salty", + "sour", + "spicy", + "stale", + "sticky", + "strong", + "sweet", + "tasteless", + "tasty", + "thirsty", + "fluttering", + "fuzzy", + "greasy", + "grubby", + "hard", + "hot", + "icy", + "loose", + "melted", + "plastic", + "prickly", + "rainy", + "rough", + "scattered", + "shaggy", + "shaky", + "sharp", + "shivering", + "silky", + "slimy", + "slippery", + "smooth", + "soft", + "solid", + "steady", + "sticky", + "tender", + "tight", + "uneven", + "weak", + "wet", + "wooden", + "afraid", + "angry", + "annoyed", + "anxious", + "arrogant", + "ashamed", + "awful", + "bad", + "bewildered", + "bored", + "combative", + "condemned", + "confused", + "creepy", + "cruel", + "dangerous", + "defeated", + "defiant", + "depressed", + "disgusted", + "disturbed", + "eerie", + "embarrassed", + "envious", + "evil", + "fierce", + "foolish", + "frantic", + "frightened", + "grieving", + "helpless", + "homeless", + "hungry", + "hurt", + "ill", + "jealous", + "lonely", + "mysterious", + "naughty", + "nervous", + "obnoxious", + "outrageous", + "panicky", + "repulsive", + "scary", + "scornful", + "selfish", + "sore", + "tense", + "terrible", + "thoughtless", + "tired", + "troubled", + "upset", + "uptight", + "weary", + "wicked", + "worried", + "agreeable", + "amused", + "brave", + "calm", + "charming", + "cheerful", + "comfortable", + "cooperative", + "courageous", + "delightful", + "determined", + "eager", + "elated", + "enchanting", + "encouraging", + "energetic", + "enthusiastic", + "excited", + "exuberant", + "fair", + "faithful", + "fantastic", + "fine", + "friendly", + "funny", + "gentle", + "glorious", + "good", + "happy", + "healthy", + "helpful", + "hilarious", + "jolly", + "joyous", + "kind", + "lively", + "lovely", + "lucky", + "obedient", + "perfect", + "pleasant", + "proud", + "relieved", + "silly", + "smiling", + "splendid", + "successful", + "thoughtful", + "victorious", + "vivacious", + "witty", + "wonderful", + "zealous", + "zany", + "other", + "good", + "new", + "old", + "great", + "high", + "small", + "different", + "large", + "local", + "social", + "important", + "long", + "young", + "national", + "british", + "right", + "early", + "possible", + "big", + "little", + "political", + "able", + "late", + "general", + "full", + "far", + "low", + "public", + "available", + "bad", + "main", + "sure", + "clear", + "major", + "economic", + "only", + "likely", + "real", + "black", + "particular", + "international", + "special", + "difficult", + "certain", + "open", + "whole", + "white", + "free", + "short", + "easy", + "strong", + "european", + "central", + "similar", + "human", + "common", + "necessary", + "single", + "personal", + "hard", + "private", + "poor", + "financial", + "wide", + "foreign", + "simple", + "recent", + "concerned", + "american", + "various", + "close", + "fine", + "english", + "wrong", + "present", + "royal", + "natural", + "individual", + "nice", + "french", + "nihilist", + "solipsist", + "materialist", + "surrealist", + "heroic", + "awesome", + "hedonist", + "absurd", + "current", + "modern", + "labour", + "legal", + "happy", + "final", + "red", + "normal", + "serious", + "previous", + "total", + "prime", + "significant", + "industrial", + "sorry", + "dead", + "specific", + "appropriate", + "top", + "soviet", + "basic", + "military", + "original", + "successful", + "aware", + "hon", + "popular", + "heavy", + "professional", + "direct", + "dark", + "cold", + "ready", + "green", + "useful", + "effective", + "western", + "traditional", + "scottish", + "german", + "independent", + "deep", + "interesting", + "considerable", + "involved", + "physical", + "hot", + "existing", + "responsible", + "complete", + "medical", + "blue", + "extra", + "past", + "male", + "interested", + "fair", + "essential", + "beautiful", + "civil", + "primary", + "obvious", + "future", + "environmental", + "positive", + "senior", + "nuclear", + "annual", + "relevant", + "huge", + "rich", + "commercial", + "safe", + "regional", + "practical", + "official", + "separate", + "key", + "chief", + "regular", + "due", + "additional", + "active", + "powerful", + "complex", + "standard", + "impossible", + "light", + "warm", + "middle", + "fresh", + "sexual", + "front", + "domestic", + "actual", + "united", + "technical", + "ordinary", + "cheap", + "strange", + "internal", + "excellent", + "quiet", + "soft", + "potential", + "northern", + "religious", + "quick", + "very", + "famous", + "cultural", + "proper", + "broad", + "joint", + "formal", + "limited", + "conservative", + "lovely", + "usual", + "ltd", + "unable", + "rural", + "initial", + "substantial", + "bright", + "average", + "leading", + "reasonable", + "immediate", + "suitable", + "equal", + "detailed", + "working", + "overall", + "female", + "afraid", + "democratic", + "growing", + "sufficient", + "scientific", + "eastern", + "correct", + "inc", + "irish", + "expensive", + "educational", + "mental", + "dangerous", + "critical", + "increased", + "familiar", + "unlikely", + "double", + "perfect", + "slow", + "tiny", + "dry", + "historical", + "thin", + "daily", + "southern", + "increasing", + "wild", + "alone", + "urban", + "empty", + "married", + "narrow", + "liberal", + "supposed", + "upper", + "apparent", + "tall", + "busy", + "bloody", + "prepared", + "russian", + "moral", + "careful", + "clean", + "attractive", + "japanese", + "vital", + "thick", + "alternative", + "fast", + "ancient", + "elderly", + "rare", + "external", + "capable", + "brief", + "wonderful", + "grand", + "typical", + "entire", + "grey", + "constant", + "vast", + "surprised", + "ideal", + "terrible", + "academic", + "funny", + "minor", + "pleased", + "severe", + "ill", + "corporate", + "negative", + "permanent", + "weak", + "brown", + "fundamental", + "odd", + "crucial", + "inner", + "used", + "criminal", + "contemporary", + "sharp", + "sick", + "near", + "roman", + "massive", + "unique", + "secondary", + "parliamentary", + "african", + "unknown", + "subsequent", + "angry", + "alive", + "guilty", + "lucky", + "enormous", + "well", + "yellow", + "unusual", + "net", + "tough", + "dear", + "extensive", + "glad", + "remaining", + "agricultural", + "alright", + "healthy", + "italian", + "principal", + "tired", + "efficient", + "comfortable", + "chinese", + "relative", + "friendly", + "conventional", + "willing", + "sudden", + "proposed", + "voluntary", + "slight", + "valuable", + "dramatic", + "golden", + "temporary", + "federal", + "keen", + "flat", + "silent", + "indian", + "worried", + "pale", + "statutory", + "welsh", + "dependent", + "firm", + "wet", + "competitive", + "armed", + "radical", + "outside", + "acceptable", + "sensitive", + "living", + "pure", + "global", + "emotional", + "sad", + "secret", + "rapid", + "adequate", + "fixed", + "sweet", + "administrative", + "wooden", + "remarkable", + "comprehensive", + "surprising", + "solid", + "rough", + "mere", + "mass", + "brilliant", + "maximum", + "absolute", + "electronic", + "visual", + "electric", + "cool", + "spanish", + "literary", + "continuing", + "supreme", + "chemical", + "genuine", + "exciting", + "written", + "advanced", + "extreme", + "classical", + "fit", + "favourite", + "widespread", + "confident", + "straight", + "proud", + "numerous", + "opposite", + "distinct", + "mad", + "helpful", + "given", + "disabled", + "consistent", + "anxious", + "nervous", + "awful", + "stable", + "constitutional", + "satisfied", + "conscious", + "developing", + "strategic", + "holy", + "smooth", + "dominant", + "remote", + "theoretical", + "outstanding", + "pink", + "pretty", + "clinical", + "minimum", + "honest", + "impressive", + "related", + "residential", + "extraordinary", + "plain", + "visible", + "accurate", + "distant", + "still", + "greek", + "complicated", + "musical", + "precise", + "gentle", + "broken", + "live", + "silly", + "fat", + "tight", + "monetary", + "round", + "psychological", + "violent", + "unemployed", + "inevitable", + "junior", + "sensible", + "grateful", + "pleasant", + "dirty", + "structural", + "welcome", + "deaf", + "above", + "continuous", + "blind", + "overseas", + "mean", + "entitled", + "delighted", + "loose", + "occasional", + "evident", + "desperate", + "fellow", + "universal", + "square", + "steady", + "classic", + "equivalent", + "intellectual", + "victorian", + "level", + "ultimate", + "creative", + "lost", + "medieval", + "clever", + "linguistic", + "convinced", + "judicial", + "raw", + "sophisticated", + "asleep", + "vulnerable", + "illegal", + "outer", + "revolutionary", + "bitter", + "changing", + "australian", + "native", + "imperial", + "strict", + "wise", + "informal", + "flexible", + "collective", + "frequent", + "experimental", + "spiritual", + "intense", + "rational", + "generous", + "inadequate", + "prominent", + "logical", + "bare", + "historic", + "modest", + "dutch", + "acute", + "electrical", + "valid", + "weekly", + "gross", + "automatic", + "loud", + "reliable", + "mutual", + "liable", + "multiple", + "ruling", + "curious", + "sole", + "managing", + "pregnant", + "latin", + "nearby", + "exact", + "underlying", + "identical", + "satisfactory", + "marginal", + "distinctive", + "electoral", + "urgent", + "presidential", + "controversial", + "everyday", + "encouraging", + "organic", + "continued", + "expected", + "statistical", + "desirable", + "innocent", + "improved", + "exclusive", + "marked", + "experienced", + "unexpected", + "superb", + "sheer", + "disappointed", + "frightened", + "gastric", + "romantic", + "naked", + "reluctant", + "magnificent", + "convenient", + "established", + "closed", + "uncertain", + "artificial", + "diplomatic", + "tremendous", + "marine", + "mechanical", + "retail", + "institutional", + "mixed", + "required", + "biological", + "known", + "functional", + "straightforward", + "superior", + "digital", + "spectacular", + "unhappy", + "confused", + "unfair", + "aggressive", + "spare", + "painful", + "abstract", + "asian", + "associated", + "legislative", + "monthly", + "intelligent", + "hungry", + "explicit", + "nasty", + "just", + "faint", + "coloured", + "ridiculous", + "amazing", + "comparable", + "successive", + "realistic", + "back", + "decent", + "decentralized", + "bitcoin", + "cypherpunk", + "unnecessary", + "flying", + "random", + "influential", + "dull", + "genetic", + "neat", + "marvellous", + "crazy", + "damp", + "giant", + "secure", + "bottom", + "skilled", + "subtle", + "elegant", + "brave", + "lesser", + "parallel", + "steep", + "intensive", + "casual", + "tropical", + "lonely", + "partial", + "preliminary", + "concrete", + "alleged", + "assistant", + "vertical", + "upset", + "delicate", + "mild", + "occupational", + "excessive", + "progressive", + "exceptional", + "integrated", + "striking", + "continental", + "okay", + "harsh", + "combined", + "fierce", + "handsome", + "characteristic", + "chronic", + "compulsory", + "interim", + "objective", + "splendid", + "magic", + "systematic", + "obliged", + "payable", + "fun", + "horrible", + "primitive", + "fascinating", + "ideological", + "metropolitan", + "surrounding", + "estimated", + "peaceful", + "premier", + "operational", + "technological", + "kind", + "advisory", + "hostile", + "precious", + "accessible", + "determined", + "excited", + "impressed", + "provincial", + "smart", + "endless", + "isolated", + "drunk", + "geographical", + "like", + "dynamic", + "boring", + "forthcoming", + "unfortunate", + "definite", + "super", + "notable", + "indirect", + "stiff", + "wealthy", + "awkward", + "lively", + "neutral", + "artistic", + "content", + "mature", + "colonial", + "ambitious", + "evil", + "magnetic", + "verbal", + "legitimate", + "sympathetic", + "empirical", + "head", + "shallow", + "vague", + "naval", + "depressed", + "shared", + "added", + "shocked", + "mid", + "worthwhile", + "qualified", + "missing", + "blank", + "absent", + "favourable", + "polish", + "israeli", + "developed", + "profound", + "representative", + "enthusiastic", + "dreadful", + "rigid", + "reduced", + "cruel", + "coastal", + "peculiar", + "swiss", + "crude", + "extended", + "selected", + "eager", + "canadian", + "bold", + "relaxed", + "corresponding", + "running", + "planned", + "applicable", + "immense", + "allied", + "comparative", + "uncomfortable", + "conservation", + "productive", + "beneficial", + "bored", + "charming", + "minimal", + "mobile", + "turkish", + "orange", + "rear", + "passive", + "suspicious", + "overwhelming", + "fatal", + "resulting", + "symbolic", + "registered", + "neighbouring", + "calm", + "irrelevant", + "patient", + "compact", + "profitable", + "rival", + "loyal", + "moderate", + "distinguished", + "interior", + "noble", + "insufficient", + "eligible", + "mysterious", + "varying", + "managerial", + "molecular", + "olympic", + "linear", + "prospective", + "printed", + "parental", + "diverse", + "elaborate", + "furious", + "fiscal", + "burning", + "useless", + "semantic", + "embarrassed", + "inherent", + "philosophical", + "deliberate", + "awake", + "variable", + "promising", + "unpleasant", + "varied", + "sacred", + "selective", + "inclined", + "tender", + "hidden", + "worthy", + "intermediate", + "sound", + "protective", + "fortunate", + "slim", + "defensive", + "divine", + "stuck", + "driving", + "invisible", + "misleading", + "circular", + "mathematical", + "inappropriate", + "liquid", + "persistent", + "solar", + "doubtful", + "manual", + "architectural", + "intact", + "incredible", + "devoted", + "prior", + "tragic", + "respectable", + "optimistic", + "convincing", + "unacceptable", + "decisive", + "competent", + "spatial", + "respective", + "binding", + "relieved", + "nursing", + "toxic", + "select", + "redundant", + "integral", + "then", + "probable", + "amateur", + "fond", + "passing", + "specified", + "territorial", + "horizontal", + "inland", + "cognitive", + "regulatory", + "miserable", + "resident", + "polite", + "scared", + "gothic", + "civilian", + "instant", + "lengthy", + "adverse", + "korean", + "unconscious", + "anonymous", + "aesthetic", + "orthodox", + "static", + "unaware", + "costly", + "fantastic", + "foolish", + "fashionable", + "causal", + "compatible", + "wee", + "implicit", + "dual", + "ok", + "cheerful", + "subjective", + "forward", + "surviving", + "exotic", + "purple", + "cautious", + "visiting", + "aggregate", + "ethical", + "teenage", + "dying", + "disastrous", + "delicious", + "confidential", + "underground", + "thorough", + "grim", + "autonomous", + "atomic", + "frozen", + "colourful", + "injured", + "uniform", + "ashamed", + "glorious", + "wicked", + "coherent", + "rising", + "shy", + "novel", + "balanced", + "delightful", + "arbitrary", + "adjacent", + "worrying", + "weird", + "unchanged", + "rolling", + "evolutionary", + "intimate", + "sporting", + "disciplinary", + "formidable", + "lexical", + "noisy", + "gradual", + "accused", + "homeless", + "supporting", + "coming", + "renewed", + "excess", + "retired", + "rubber", + "chosen", + "outdoor", + "embarrassing", + "preferred", + "bizarre", + "appalling", + "agreed", + "imaginative", + "governing", + "accepted", + "vocational", + "mighty", + "puzzled", + "worldwide", + "organisational", + "sunny", + "eldest", + "eventual", + "spontaneous", + "vivid", + "rude", + "faithful", + "ministerial", + "innovative", + "controlled", + "conceptual", + "unwilling", + "civic", + "meaningful", + "alive", + "brainy", + "breakable", + "busy", + "careful", + "cautious", + "clever", + "concerned", + "crazy", + "curious", + "dead", + "different", + "difficult", + "doubtful", + "easy", + "famous", + "fragile", + "helpful", + "helpless", + "important", + "impossible", + "innocent", + "inquisitive", + "modern", + "open", + "outstanding", + "poor", + "powerful", + "puzzled", + "real", + "rich", + "shy", + "sleepy", + "super", + "tame", + "uninterested", + "wandering", + "wild", + "wrong", + "adorable", + "alert", + "average", + "beautiful", + "blonde", + "bloody", + "blushing", + "bright", + "clean", + "clear", + "cloudy", + "colorful", + "crowded", + "cute", + "dark", + "drab", + "distinct", + "dull", + "elegant", + "fancy", + "filthy", + "glamorous", + "gleaming", + "graceful", + "grotesque", + "homely", + "light", + "misty", + "motionless", + "muddy", + "plain", + "poised", + "quaint", + "shiny", + "smoggy", + "sparkling", + "spotless", + "stormy", + "strange", + "ugly", + "unsightly", + "unusual", + "bad", + "better", + "beautiful", + "big", + "black", + "blue", + "bright", + "clumsy", + "crazy", + "dizzy", + "dull", + "fat", + "frail", + "friendly", + "funny", + "great", + "green", + "gigantic", + "gorgeous", + "grumpy", + "handsome", + "happy", + "horrible", + "itchy", + "jittery", + "jolly", + "kind", + "long", + "lazy", + "magnificent", + "magenta", + "many", + "mighty", + "mushy", + "nasty", + "new", + "nice", + "nosy", + "nutty", + "nutritious", + "odd", + "orange", + "ordinary", + "pretty", + "precious", + "prickly", + "purple", + "quaint", + "quiet", + "quick", + "quickest", + "rainy", + "rare", + "ratty", + "red", + "roasted", + "robust", + "round", + "sad", + "scary", + "scrawny", + "short", + "silly", + "stingy", + "strange", + "striped", + "spotty", + "tart", + "tall", + "tame", + "tan", + "tender", + "testy", + "tricky", + "tough", + "ugly", + "ugliest", + "vast", + "watery", + "wasteful", + "wonderful", + "yellow", + "yummy", + "zany", ]; function capitalize(s) { - if (typeof s !== 'string') return ''; + if (typeof s !== "string") return ""; return s.charAt(0).toUpperCase() + s.slice(1); } @@ -1827,7 +1827,7 @@ function capitalize(s) { */ export default function (seed: string) { if (!seed) { - throw new Error('No seed provided'); + throw new Error("No seed provided"); } const hash = sha256(seed); // Uint8Array const adjective = adjectives[hash[0] % adjectives.length]; diff --git a/src/js/BaseComponent.ts b/src/js/BaseComponent.ts index e7a2486a..15ead53b 100644 --- a/src/js/BaseComponent.ts +++ b/src/js/BaseComponent.ts @@ -1,29 +1,29 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { PureComponent } from 'react'; +import { PureComponent } from "preact/compat"; -import { Callback, EventListener } from './LocalState'; +import { Callback, Unsubscribe } from "./LocalState"; type OwnState = { ogImageUrl?: any; }; -export default abstract class BaseComponent extends PureComponent< - Props, - State & OwnState -> { +export default abstract class BaseComponent< + Props = any, + State = any +> extends PureComponent { unmounted?: boolean; // TODO: make this use Subscriptions instead of LocalState eventlisteners? or both? - eventListeners: Record = {}; + unsubscribes: Record = {}; sub(callback: CallableFunction, path?: string): Callback { - const cb = (data, key, message, eventListener, f): void => { + const cb = (data, key, unsubscribe, f): void => { if (this.unmounted) { - eventListener && eventListener.off(); + unsubscribe?.(); return; } - this.eventListeners[path ?? key] = eventListener; - callback(data, key, message, eventListener, f); + this.unsubscribes[path ?? key] = unsubscribe; + callback(data, key, unsubscribe, f); }; return cb as any; @@ -38,10 +38,10 @@ export default abstract class BaseComponent extends Pu } unsubscribe() { - Object.keys(this.eventListeners).forEach((k) => { - const l = this.eventListeners[k]; - l && l.off(); - delete this.eventListeners[k]; + Object.keys(this.unsubscribes).forEach((k) => { + const unsub = this.unsubscribes[k]; + unsub?.(); + delete this.unsubscribes[k]; }); } diff --git a/src/js/FuzzySearch.ts b/src/js/FuzzySearch.ts index e7e694dc..29504395 100644 --- a/src/js/FuzzySearch.ts +++ b/src/js/FuzzySearch.ts @@ -1,21 +1,21 @@ -import Fuse from 'fuse.js'; -import _ from 'lodash'; +import Fuse from "fuse.js"; +import _ from "lodash"; -import localState from './LocalState'; +import localState from "./LocalState"; const options = { - keys: ['name', 'display_name'], + keys: ["name", "display_name"], includeScore: true, includeMatches: true, threshold: 0.3, }; const notifyUpdate = _.throttle(() => { - localState.get('searchIndexUpdated').put(true); + localState.get("searchIndexUpdated").put(true); }, 2000); const FuzzySearch = { - index: new Fuse([], options), + index: new Fuse([] as any[], options), keys: new Set(), add(doc: any) { if (this.keys.has(doc.key)) { diff --git a/src/js/Helpers.tsx b/src/js/Helpers.tsx index 497b8f7d..b2fb616b 100644 --- a/src/js/Helpers.tsx +++ b/src/js/Helpers.tsx @@ -1,19 +1,19 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import reactStringReplace from 'react-string-replace'; +import reactStringReplace from "react-string-replace"; // eslint-disable-next-line @typescript-eslint/no-var-requires -import { bech32 } from 'bech32'; -import $ from 'jquery'; -import throttle from 'lodash/throttle'; -import { nip19 } from 'nostr-tools'; -import { route } from 'preact-router'; +import { bech32 } from "bech32"; +import $ from "jquery"; +import throttle from "lodash/throttle"; +import { nip19 } from "nostr-tools"; +import { route } from "preact-router"; -import EventComponent from './components/events/EventComponent'; -import Name from './components/Name'; -import SafeImg, { isSafeOrigin } from './components/SafeImg'; -import Torrent from './components/Torrent'; -import Key from './nostr/Key'; -import { language, translate as t } from './translations/Translation'; -import localState from './LocalState'; +import EventComponent from "./components/events/EventComponent"; +import Name from "./components/Name"; +import SafeImg from "./components/SafeImg"; +import Torrent from "./components/Torrent"; +import Key from "./nostr/Key"; +import { language, translate as t } from "./translations/Translation.mjs"; +import localState from "./LocalState"; const emojiRegex = /([\u{1f300}-\u{1f5ff}\u{1f900}-\u{1f9ff}\u{1f600}-\u{1f64f}\u{1f680}-\u{1f6ff}\u{2600}-\u{26ff}\u{2700}-\u{27bf}\u{1f1e6}-\u{1f1ff}\u{1f191}-\u{1f251}\u{1f004}\u{1f0cf}\u{1f170}-\u{1f171}\u{1f17e}-\u{1f17f}\u{1f18e}\u{3030}\u{2b50}\u{2b55}\u{2934}-\u{2935}\u{2b05}-\u{2b07}\u{2b1b}-\u{2b1c}\u{3297}\u{3299}\u{303d}\u{00a9}\u{00ae}\u{2122}\u{23f3}\u{24c2}\u{23e9}-\u{23ef}\u{25b6}\u{23f8}-\u{23fa}]+)/gu; @@ -26,25 +26,13 @@ const nip19Regex = /\bnostr:(n(?:event|profile)1\w+)\b/g; const hashtagRegex = /(#\w+)/g; let settings: any = {}; -localState.get('settings').on((s) => (settings = s)); +localState.get("settings").on((s) => (settings = s)); let existingIrisToAddress: any = {}; -localState.get('settings').put({}); // ? -localState.get('existingIrisToAddress').on((a) => (existingIrisToAddress = a)); - -function setImgSrc(el: JQuery, src: string): JQuery { - if (src) { - // parse src as url safely - src = new URL(src).href; - if (!isSafeOrigin(src)) { - src = `https://imgproxy.iris.to/insecure/plain/${src}`; - } - el.attr('src', src); - } - return el; -} +localState.get("settings").put({}); // ? +localState.get("existingIrisToAddress").on((a) => (existingIrisToAddress = a)); const userAgent = navigator.userAgent.toLowerCase(); -const isElectron = userAgent.indexOf(' electron/') > -1; +const isElectron = userAgent.indexOf(" electron/") > -1; declare global { interface Navigator { @@ -56,32 +44,32 @@ export default { wtClient: undefined as any, formatAmount(amount: number, decimals = 2): string { - if (typeof amount !== 'number') { - return ''; + if (typeof amount !== "number") { + return ""; } if (amount < 1000) { return amount.toFixed(decimals); } if (amount < 1000000) { - return (amount / 1000).toFixed(decimals) + 'K'; + return (amount / 1000).toFixed(decimals) + "K"; } if (amount < 1000000000) { - return (amount / 1000000).toFixed(decimals) + 'M'; + return (amount / 1000000).toFixed(decimals) + "M"; } - return (amount / 1000000000).toFixed(decimals) + 'B'; + return (amount / 1000000000).toFixed(decimals) + "B"; }, isStandalone() { return ( navigator.standalone || - window.matchMedia('(display-mode: standalone)').matches || - document.referrer.includes('android-app://iris.to') + window.matchMedia("(display-mode: standalone)").matches || + document.referrer.includes("android-app://iris.to") ); }, capitalize(s?: string): string { if (s === undefined) { - return ''; + return ""; } return s.charAt(0).toUpperCase() + s.slice(1); }, @@ -91,15 +79,15 @@ export default { }, async translateText(text: string): Promise { - const res = await fetch('https://translate.iris.to/translate', { - method: 'POST', + const res = await fetch("https://translate.iris.to/translate", { + method: "POST", body: JSON.stringify({ q: text, - source: 'auto', - target: language.split('-')[0], - format: 'text', + source: "auto", + target: language.split("-")[0], + format: "text", }), - headers: { 'Content-Type': 'application/json' }, + headers: { "Content-Type": "application/json" }, }); const json = await res.json(); @@ -109,9 +97,10 @@ export default { handleLightningLinkClick(e: Event): void { e.preventDefault(); - const link = ((e.target as HTMLElement).closest('A') as HTMLLinkElement).href; + const link = ((e.target as HTMLElement).closest("A") as HTMLLinkElement) + .href; - if (!link.startsWith('lightning:')) { + if (!link.startsWith("lightning:")) { return; } @@ -132,10 +121,14 @@ export default { }, 3000); */ - window.open(link, '_self'); + window.open(link, "_self"); }, - highlightEverything(s: string, event?: any, opts: any = { showMentionedMessages: true }): any[] { + highlightEverything( + s: string, + event?: any, + opts: any = { showMentionedMessages: true } + ): any[] { let replacedText = reactStringReplace(s, emojiRegex, (match, i) => { return ( @@ -147,78 +140,104 @@ export default { if (opts.showMentionedMessages) { replacedText = reactStringReplace(replacedText, noteRegex, (match, i) => { return ( - + ); }); } if (settings.enableTwitter !== false) { - const twitterRegex = /(?:^|\s)(?:@)?(https?:\/\/twitter.com\/\w+\/status\/\d+\S*)(?![\w/])/g; - replacedText = reactStringReplace(replacedText, twitterRegex, (match, i) => { - return ( -