generaltranslation 8.2.6 → 8.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/ApiError-4zIP-twr.cjs +24 -0
- package/dist/ApiError-4zIP-twr.cjs.map +1 -0
- package/dist/ApiError-Bv7vlzyQ.mjs +19 -0
- package/dist/ApiError-Bv7vlzyQ.mjs.map +1 -0
- package/dist/errors.cjs +3 -0
- package/dist/errors.d.cts +11 -0
- package/dist/errors.d.mts +11 -0
- package/dist/errors.mjs +2 -0
- package/dist/id-CPbVYREY.mjs +74 -0
- package/dist/id-CPbVYREY.mjs.map +1 -0
- package/dist/id-VXBgyXu2.cjs +89 -0
- package/dist/id-VXBgyXu2.cjs.map +1 -0
- package/dist/id.cjs +5 -0
- package/dist/{id/hashSource.d.ts → id.d.cts} +20 -5
- package/dist/id.d.mts +40 -0
- package/dist/id.mjs +2 -0
- package/dist/index.cjs +3491 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1219 -0
- package/dist/index.d.mts +1219 -0
- package/dist/index.mjs +3441 -0
- package/dist/index.mjs.map +1 -0
- package/dist/internal-B3QbyI_5.mjs +820 -0
- package/dist/internal-B3QbyI_5.mjs.map +1 -0
- package/dist/internal-DIHQF9gs.cjs +1070 -0
- package/dist/internal-DIHQF9gs.cjs.map +1 -0
- package/dist/internal.cjs +45 -0
- package/dist/{internal.d.ts → internal.d.cts} +82 -113
- package/dist/internal.d.mts +263 -0
- package/dist/internal.mjs +3 -0
- package/dist/sha2-DKowBr6H.cjs +747 -0
- package/dist/sha2-DKowBr6H.cjs.map +1 -0
- package/dist/stableStringify-DgDlE_pD.mjs +53 -0
- package/dist/stableStringify-DgDlE_pD.mjs.map +1 -0
- package/dist/types-BJdoI1d1.d.cts +741 -0
- package/dist/types-DazaDJbs.d.mts +741 -0
- package/dist/types.cjs +17 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +2 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +16 -0
- package/dist/types.mjs.map +1 -0
- package/package.json +52 -32
- package/dist/backwards-compatability/dataConversion.d.ts +0 -23
- package/dist/backwards-compatability/oldHashJsxChildren.d.ts +0 -23
- package/dist/backwards-compatability/oldTypes.d.ts +0 -21
- package/dist/backwards-compatability/typeChecking.d.ts +0 -21
- package/dist/cache/IntlCache.d.ts +0 -26
- package/dist/cache/types.d.ts +0 -32
- package/dist/derive/condenseVars.d.ts +0 -7
- package/dist/derive/declareVar.d.ts +0 -26
- package/dist/derive/decodeVars.d.ts +0 -9
- package/dist/derive/derive.d.ts +0 -38
- package/dist/derive/extractVars.d.ts +0 -9
- package/dist/derive/index.d.ts +0 -7
- package/dist/derive/indexVars.d.ts +0 -6
- package/dist/derive/utils/constants.d.ts +0 -2
- package/dist/derive/utils/regex.d.ts +0 -2
- package/dist/derive/utils/sanitizeVar.d.ts +0 -12
- package/dist/derive/utils/traverseHelpers.d.ts +0 -4
- package/dist/derive/utils/traverseIcu.d.ts +0 -20
- package/dist/derive/utils/types.d.ts +0 -23
- package/dist/errors/ApiError.d.ts +0 -7
- package/dist/errors/formattingErrors.d.ts +0 -1
- package/dist/errors.cjs.min.cjs +0 -2
- package/dist/errors.cjs.min.cjs.map +0 -1
- package/dist/errors.d.ts +0 -9
- package/dist/errors.esm.min.mjs +0 -2
- package/dist/errors.esm.min.mjs.map +0 -1
- package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.d.ts +0 -59
- package/dist/formatting/custom-formats/CutoffFormat/constants.d.ts +0 -4
- package/dist/formatting/custom-formats/CutoffFormat/types.d.ts +0 -48
- package/dist/formatting/format.d.ts +0 -1
- package/dist/id/hashTemplate.d.ts +0 -4
- package/dist/id/types.d.ts +0 -7
- package/dist/id.cjs.min.cjs +0 -2
- package/dist/id.cjs.min.cjs.map +0 -1
- package/dist/id.d.ts +0 -86
- package/dist/id.esm.min.mjs +0 -2
- package/dist/id.esm.min.mjs.map +0 -1
- package/dist/index.cjs.min.cjs +0 -2
- package/dist/index.cjs.min.cjs.map +0 -1
- package/dist/index.d.ts +0 -1627
- package/dist/index.esm.min.mjs +0 -2
- package/dist/index.esm.min.mjs.map +0 -1
- package/dist/internal.cjs.min.cjs +0 -2
- package/dist/internal.cjs.min.cjs.map +0 -1
- package/dist/internal.esm.min.mjs +0 -2
- package/dist/internal.esm.min.mjs.map +0 -1
- package/dist/locales/customLocaleMapping.d.ts +0 -11
- package/dist/locales/determineLocale.d.ts +0 -1
- package/dist/locales/getLocaleDirection.d.ts +0 -1
- package/dist/locales/getLocaleEmoji.d.ts +0 -2
- package/dist/locales/getLocaleName.d.ts +0 -1
- package/dist/locales/getLocaleProperties.d.ts +0 -32
- package/dist/locales/getPluralForm.d.ts +0 -9
- package/dist/locales/getRegionProperties.d.ts +0 -7
- package/dist/locales/isSameDialect.d.ts +0 -1
- package/dist/locales/isSameLanguage.d.ts +0 -1
- package/dist/locales/isSupersetLocale.d.ts +0 -1
- package/dist/locales/isValidLocale.d.ts +0 -1
- package/dist/locales/requiresTranslation.d.ts +0 -1
- package/dist/locales/resolveAliasLocale.d.ts +0 -8
- package/dist/locales/resolveCanonicalLocale.d.ts +0 -8
- package/dist/logging/errors.d.ts +0 -10
- package/dist/logging/logger.d.ts +0 -117
- package/dist/logging/warnings.d.ts +0 -2
- package/dist/projects/getProjectData.d.ts +0 -1
- package/dist/settings/plurals.d.ts +0 -3
- package/dist/settings/settings.d.ts +0 -2
- package/dist/settings/settingsUrls.d.ts +0 -3
- package/dist/translate/api.d.ts +0 -1
- package/dist/translate/awaitJobs.d.ts +0 -19
- package/dist/translate/checkJobStatus.d.ts +0 -8
- package/dist/translate/createBranch.d.ts +0 -10
- package/dist/translate/createTag.d.ts +0 -19
- package/dist/translate/downloadFileBatch.d.ts +0 -1
- package/dist/translate/enqueueFiles.d.ts +0 -8
- package/dist/translate/getOrphanedFiles.d.ts +0 -8
- package/dist/translate/processFileMoves.d.ts +0 -25
- package/dist/translate/publishFiles.d.ts +0 -17
- package/dist/translate/queryBranchData.d.ts +0 -3
- package/dist/translate/queryFileData.d.ts +0 -42
- package/dist/translate/querySourceFile.d.ts +0 -1
- package/dist/translate/setupProject.d.ts +0 -11
- package/dist/translate/submitUserEditDiffs.d.ts +0 -12
- package/dist/translate/translateMany.d.ts +0 -1
- package/dist/translate/uploadSourceFiles.d.ts +0 -1
- package/dist/translate/uploadTranslations.d.ts +0 -1
- package/dist/translate/utils/apiRequest.d.ts +0 -1
- package/dist/translate/utils/batch.d.ts +0 -52
- package/dist/translate/utils/fetchWithTimeout.d.ts +0 -1
- package/dist/translate/utils/generateRequestHeaders.d.ts +0 -2
- package/dist/translate/utils/handleFetchError.d.ts +0 -1
- package/dist/translate/utils/validateResponse.d.ts +0 -1
- package/dist/types-dir/api/branch.d.ts +0 -10
- package/dist/types-dir/api/checkFileTranslations.d.ts +0 -37
- package/dist/types-dir/api/downloadFile.d.ts +0 -3
- package/dist/types-dir/api/downloadFileBatch.d.ts +0 -34
- package/dist/types-dir/api/enqueueEntries.d.ts +0 -21
- package/dist/types-dir/api/enqueueFiles.d.ts +0 -56
- package/dist/types-dir/api/entry.d.ts +0 -36
- package/dist/types-dir/api/fetchTranslations.d.ts +0 -11
- package/dist/types-dir/api/file.d.ts +0 -54
- package/dist/types-dir/api/project.d.ts +0 -7
- package/dist/types-dir/api/translate.d.ts +0 -34
- package/dist/types-dir/api/translateMany.d.ts +0 -5
- package/dist/types-dir/api/translationStatus.d.ts +0 -9
- package/dist/types-dir/api/uploadFiles.d.ts +0 -43
- package/dist/types-dir/jsx/content.d.ts +0 -61
- package/dist/types-dir/jsx/variables.d.ts +0 -9
- package/dist/types-dir/transformations.d.ts +0 -8
- package/dist/types.cjs.min.cjs +0 -2
- package/dist/types.cjs.min.cjs.map +0 -1
- package/dist/types.d.ts +0 -652
- package/dist/types.esm.min.mjs +0 -2
- package/dist/types.esm.min.mjs.map +0 -1
- package/dist/utils/base64.d.ts +0 -2
- package/dist/utils/isVariable.d.ts +0 -2
- package/dist/utils/minify.d.ts +0 -2
- package/dist/utils/stableStringify.d.ts +0 -1
package/dist/id.esm.min.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"id.esm.min.mjs","sources":["../../../node_modules/.pnpm/@rollup+plugin-typescript@12.1.4_rollup@4.52.3_tslib@2.8.1_typescript@5.9.2/node_modules/tslib/tslib.es6.js","../src/utils/stableStringify.ts","../src/id/hashSource.ts","../src/utils/isVariable.ts","../src/id/hashTemplate.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/**\n * Deterministic JSON stringification with sorted object keys.\n * Drop-in replacement for `fast-json-stable-stringify` for plain\n * JSON-compatible data (no toJSON, no circular references).\n */\nfunction _stringify(node: unknown): string | undefined {\n if (node === undefined) return undefined;\n if (node === null) return 'null';\n if (typeof node === 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n if (Array.isArray(node)) {\n let out = '[';\n for (let i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += _stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n const keys = Object.keys(node as Record<string, unknown>).sort();\n let out = '';\n for (const key of keys) {\n const value = _stringify((node as Record<string, unknown>)[key]);\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n return '{' + out + '}';\n}\n\nexport function stableStringify(data: unknown): string {\n return _stringify(data) ?? '';\n}\n","// Functions provided to other GT libraries\n\nimport { JsxChild, JsxChildren, Variable } from '../types';\nimport { stableStringify as stringify } from '../utils/stableStringify';\nimport { sha256 } from '@noble/hashes/sha2.js';\nimport { bytesToHex, utf8ToBytes } from '@noble/hashes/utils.js';\nimport isVariable from '../utils/isVariable';\nimport { HashMetadata } from './types';\n\n// ----- FUNCTIONS ----- //\n/**\n * Calculates a unique hash for a given string using sha256.\n *\n * First 16 characters of hash, hex encoded.\n *\n * @param {string} string - The string to be hashed.\n * @returns {string} - The resulting hash as a hexadecimal string.\n */\nexport function hashString(string: string): string {\n return bytesToHex(sha256(utf8ToBytes(string))).slice(0, 16);\n}\n\n/**\n * Calculates a unique ID for the given children objects by hashing their sanitized JSON string representation.\n *\n * @param {any} childrenAsObjects - The children objects to be hashed.\n * @param {string} [context] - The context for the children\n * @param {string} [id] - The id for the JSX Children object\n * @param {number} [maxChars] - The maxChars for the JSX Children object\n * @param {string} [dataFormat] - The data format of the sources\n * @param {function} [hashFunction] custom hash function\n * @returns {string} - The unique has of the children.\n */\nexport function hashSource(\n {\n source,\n context,\n id,\n maxChars,\n dataFormat,\n }: {\n source: JsxChildren | string;\n } & HashMetadata,\n hashFunction: (string: string) => string = hashString\n): string {\n let sanitizedSource: SanitizedChildren | string;\n if (dataFormat === 'JSX') {\n sanitizedSource = sanitizeJsxChildren(source);\n } else {\n sanitizedSource = source as string;\n }\n const sanitizedData: {\n source?: SanitizedChildren;\n } & HashMetadata = {\n source: sanitizedSource,\n ...(id && { id }),\n ...(context && { context }),\n ...(maxChars != null && { maxChars: Math.abs(maxChars) }),\n ...(dataFormat && { dataFormat }),\n };\n const stringifiedData = stringify(sanitizedData);\n return hashFunction(stringifiedData);\n}\n\ntype SanitizedVariable = Omit<Variable, 'i'>;\n\ntype SanitizedElement = {\n b?: {\n [k: string]: SanitizedChildren; // Branches\n };\n c?: SanitizedChildren; // Children\n t?: string; // Branch Transformation\n};\ntype SanitizedChild = SanitizedElement | SanitizedVariable | string;\ntype SanitizedChildren = SanitizedChild | SanitizedChild[];\n\n/**\n * Sanitizes a child object by removing the data-_gt attribute and its branches.\n *\n * @param child - The child object to sanitize.\n * @returns The sanitized child object.\n *\n */\nconst sanitizeChild = (child: JsxChild): SanitizedChild => {\n if (child && typeof child === 'object') {\n const newChild: SanitizedChild = {};\n if ('c' in child && child.c) {\n newChild.c = sanitizeJsxChildren(child.c);\n }\n if ('d' in child) {\n const generaltranslation = child?.d;\n if (generaltranslation?.b) {\n // The only thing that prevents sanitizeJsx from being stable is\n // the order of the keys in the branches object.\n // We don't sort them because stable-stringify sorts them anyways\n newChild.b = Object.fromEntries(\n Object.entries(generaltranslation.b).map(([key, value]) => [\n key,\n sanitizeJsxChildren(value as JsxChildren),\n ])\n );\n }\n if (generaltranslation?.t) {\n newChild.t = generaltranslation.t;\n }\n }\n if (isVariable(child)) {\n return {\n k: child.k,\n ...(child.v && {\n v: child.v,\n }),\n };\n }\n return newChild;\n }\n return child;\n};\n\nfunction sanitizeJsxChildren(\n childrenAsObjects: JsxChildren\n): SanitizedChildren {\n return Array.isArray(childrenAsObjects)\n ? childrenAsObjects.map(sanitizeChild)\n : sanitizeChild(childrenAsObjects);\n}\n","import { Variable } from '../types';\n\nexport default function isVariable(obj: unknown): obj is Variable {\n const variableObj = obj as Variable;\n if (\n variableObj &&\n typeof variableObj === 'object' &&\n typeof (variableObj as Variable).k === 'string'\n ) {\n const k = Object.keys(variableObj);\n if (k.length === 1) return true;\n if (k.length === 2) {\n if (typeof variableObj.i === 'number') return true;\n if (typeof variableObj.v === 'string') return true;\n }\n if (k.length === 3) {\n if (\n typeof variableObj.v === 'string' &&\n typeof variableObj.i === 'number'\n )\n return true;\n }\n }\n return false;\n}\n","import { hashString } from './hashSource';\nimport { stableStringify as stringify } from '../utils/stableStringify';\n\nexport default function hashTemplate(\n template: {\n [key: string]: string;\n },\n hashFunction = hashString\n): string {\n return hashFunction(stringify(template));\n}\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","_stringify","node","undefined","isFinite","JSON","stringify","Array","isArray","out_1","out","_i","keys_1","keys","sort","key","value","stableStringify","data","_a","hashString","string","bytesToHex","sha256","utf8ToBytes","slice","hashSource","hashFunction","sanitizedSource","source","context","id","maxChars","dataFormat","sanitizeJsxChildren","Math","abs","SuppressedError","sanitizeChild","child","newChild","c","generaltranslation","d","b","fromEntries","entries","map","obj","variableObj","k","v","isVariable","childrenAsObjects","hashTemplate","template"],"mappings":"oHA+BO,IAAIA,EAAW,WAQlB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACX,EACOH,EAASa,MAAMC,KAAMP,UAChC,ECnCA,SAASQ,EAAWC,GAClB,QAAaC,IAATD,EAAJ,CACA,GAAa,OAATA,EAAe,MAAO,OAC1B,GAAoB,iBAATA,EAAmB,OAAOE,SAASF,GAAQ,GAAKA,EAAO,OAClE,GAAoB,iBAATA,EAAmB,OAAOG,KAAKC,UAAUJ,GAEpD,GAAIK,MAAMC,QAAQN,GAAO,CAEvB,IADA,IAAIO,EAAM,IACDlB,EAAI,EAAGA,EAAIW,EAAKR,OAAQH,IAC3BA,IAAGkB,GAAO,KACdA,GAAOR,EAAWC,EAAKX,KAAO,OAEhC,OAAOkB,EAAM,GACf,CAIA,IAFA,IACIC,EAAM,GACQC,EAAA,EAAAC,EAFLzB,OAAO0B,KAAKX,GAAiCY,OAExCH,WAAAA,IAAM,CAAnB,IAAMI,EAAGH,EAAAD,GACNK,EAAQf,EAAYC,EAAiCa,IACtDC,IACDN,IAAKA,GAAO,KAChBA,GAAOL,KAAKC,UAAUS,GAAO,IAAMC,EACrC,CACA,MAAO,IAAMN,EAAM,GAtBqB,CAuB1C,CAEM,SAAUO,EAAgBC,SAC9B,OAAuB,UAAhBjB,EAAWiB,UAAK,IAAAC,EAAAA,EAAI,EAC7B,CCfM,SAAUC,EAAWC,GACzB,OAAOC,EAAWC,EAAOC,EAAYH,KAAUI,MAAM,EAAG,GAC1D,CAaM,SAAUC,EACdP,EASAQ,GARE,IAUEC,EAVFC,EAAMV,EAAAU,OACNC,EAAOX,EAAAW,QACPC,EAAEZ,EAAAY,GACFC,EAAQb,EAAAa,SACRC,EAAUd,EAAAc,WAsBZ,YAlBA,IAAAN,IAAAA,EAAAP,GAIEQ,EADiB,QAAfK,EACgBC,EAAoBL,GAEpBA,EAYbF,EADiBrB,WANtBuB,OAAQD,GACJG,GAAM,CAAEA,OACRD,GAAW,CAAEA,QAAOA,IACR,MAAZE,GAAoB,CAAEA,SAAUG,KAAKC,IAAIJ,KACzCC,GAAc,CAAEA,WAAUA,KAIlC,CF0QkD,mBAApBI,iBAAiCA,gBErP/D,IAAMC,EAAgB,SAACC,GACrB,GAAIA,GAA0B,iBAAVA,EAAoB,CACtC,IAAMC,EAA2B,CAAA,EAIjC,GAHI,MAAOD,GAASA,EAAME,IACxBD,EAASC,EAAIP,EAAoBK,EAAME,IAErC,MAAOF,EAAO,CAChB,IAAMG,EAAqBH,aAAK,EAALA,EAAOI,GAC9BD,aAAkB,EAAlBA,EAAoBE,KAItBJ,EAASI,EAAIzD,OAAO0D,YAClB1D,OAAO2D,QAAQJ,EAAmBE,GAAGG,IAAI,SAAC5B,GAAiB,MAAA,CAAbA,EAAA,GAE5Ce,EAFmDf,EAAA,IAAM,MAM3DuB,aAAkB,EAAlBA,EAAoBrD,KACtBmD,EAASnD,EAAIqD,EAAmBrD,EAEpC,CACA,OCxGU,SAAqB2D,GACjC,IAAMC,EAAcD,EACpB,GACEC,GACuB,iBAAhBA,GACgC,iBAA/BA,EAAyBC,EACjC,CACA,IAAMA,EAAI/D,OAAO0B,KAAKoC,GACtB,GAAiB,IAAbC,EAAExD,OAAc,OAAO,EAC3B,GAAiB,IAAbwD,EAAExD,OAAc,CAClB,GAA6B,iBAAlBuD,EAAY1D,EAAgB,OAAO,EAC9C,GAA6B,iBAAlB0D,EAAYE,EAAgB,OAAO,CAChD,CACA,GAAiB,IAAbD,EAAExD,QAEuB,iBAAlBuD,EAAYE,GACM,iBAAlBF,EAAY1D,EAEnB,OAAO,CAEb,CACA,OAAO,CACT,CDkFQ6D,CAAWb,GACbrD,EAAA,CACEgE,EAAGX,EAAMW,GACLX,EAAMY,GAAK,CACbA,EAAGZ,EAAMY,IAIRX,CACT,CACA,OAAOD,CACT,EAEA,SAASL,EACPmB,GAEA,OAAO9C,MAAMC,QAAQ6C,GACjBA,EAAkBN,IAAIT,GACtBA,EAAce,EACpB,CE1Hc,SAAUC,EACtBC,EAGA5B,GAEA,YAFA,IAAAA,IAAAA,EAAAP,GAEOO,EAAarB,EAAUiD,GAChC","x_google_ignoreList":[0]}
|
package/dist/index.cjs.min.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function n(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function o(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function i(e,t){return function(r,n){t(r,n,e)}}function a(e,t,r,n,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=n.kind,u="getter"===c?"get":"setter"===c?"set":"value",l=!t&&e?n.static?e:e.prototype:null,h=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f=!1,p=r.length-1;p>=0;p--){var d={};for(var v in n)d[v]="access"===v?{}:n[v];for(var v in n.access)d.access[v]=n.access[v];d.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var m=(0,r[p])("accessor"===c?{get:h.get,set:h.set}:h[u],d);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=a(m.get))&&(h.get=s),(s=a(m.set))&&(h.set=s),(s=a(m.init))&&o.unshift(s)}else(s=a(m))&&("field"===c?o.unshift(s):h[u]=s)}l&&Object.defineProperty(l,n.name,h),f=!0}function s(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function c(e){return"symbol"==typeof e?e:"".concat(e)}function u(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function l(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}c((n=n.apply(e,t||[])).next())})}function f(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var p=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function d(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||p(t,e,r)}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function E(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}function y(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function _(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",function(e){return function(t){return Promise.resolve(t).then(e,u)}}),n[Symbol.asyncIterator]=function(){return this},n;function a(e,t){o[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||s(e,t)})},t&&(n[e]=t(n[e])))}function s(e,t){try{(r=o[e](t)).value instanceof b?Promise.resolve(r.value.v).then(c,u):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function c(e){s("next",e)}function u(e){s("throw",e)}function l(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function T(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:!1}:o?o(t):t}:o}}function L(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=v(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){(function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)})(n,o,(t=e[r](t)).done,t.value)})}}}function A(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var I=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},S=function(e){return S=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},S(e)};function N(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=S(e),n=0;n<r.length;n++)"default"!==r[n]&&p(t,e,r[n]);return I(t,e),t}function C(e){return e&&e.__esModule?e:{default:e}}function w(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function P(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function H(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function B(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var M="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function R(e){function t(t){e.error=e.hasError?new M(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function o(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(e){return t(e),o()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function O(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,o,i){return r?t?".jsx":".js":!n||o&&i?n+o+"."+i.toLowerCase()+"js":e}):e}var U,G,D,F,j,x,k={__extends:t,__assign:r,__rest:n,__decorate:o,__param:i,__esDecorate:a,__runInitializers:s,__propKey:c,__setFunctionName:u,__metadata:l,__awaiter:h,__generator:f,__createBinding:p,__exportStar:d,__values:v,__read:m,__spread:g,__spreadArrays:E,__spreadArray:y,__await:b,__asyncGenerator:_,__asyncDelegator:T,__asyncValues:L,__makeTemplateObject:A,__importStar:N,__importDefault:C,__classPrivateFieldGet:w,__classPrivateFieldSet:P,__classPrivateFieldIn:H,__addDisposableResource:B,__disposeResources:R,__rewriteRelativeImportExtension:O},V=Object.freeze({__proto__:null,__addDisposableResource:B,get __assign(){return r},__asyncDelegator:T,__asyncGenerator:_,__asyncValues:L,__await:b,__awaiter:h,__classPrivateFieldGet:w,__classPrivateFieldIn:H,__classPrivateFieldSet:P,__createBinding:p,__decorate:o,__disposeResources:R,__esDecorate:a,__exportStar:d,__extends:t,__generator:f,__importDefault:C,__importStar:N,__makeTemplateObject:A,__metadata:l,__param:i,__propKey:c,__read:m,__rest:n,__rewriteRelativeImportExtension:O,__runInitializers:s,__setFunctionName:u,__spread:g,__spreadArray:y,__spreadArrays:E,__values:v,default:k}),K="en",X=6e4,z="ellipsis",Y="DEFAULT_TERMINATOR_KEY",W={ellipsis:(U={fr:{terminator:"…",separator:" "},zh:{terminator:"……",separator:void 0},ja:{terminator:"……",separator:void 0}},U[Y]={terminator:"…",separator:void 0},U),none:(G={},G[Y]={terminator:void 0,separator:void 0},G)},Z=function(){function e(e,t){var r,n,o,i,a,s,c,u,l;void 0===t&&(t={});try{var h=e?Array.isArray(e)?e.map(function(e){return String(e)}):[String(e)]:[K],f=Intl.getCanonicalLocales(h);this.locale=f.length?f[0]:K}catch(e){this.locale=K}if(!W[null!==(r=t.style)&&void 0!==r?r:z])throw new Error(function(e){return"generaltranslation Formatting Error: Invalid cutoff style: ".concat(e,".")}(null!==(n=t.style)&&void 0!==n?n:z));if(void 0!==t.maxChars){u=null!==(o=t.style)&&void 0!==o?o:z;var p=new Intl.Locale(this.locale).language;l=W[u][p]||W[u][Y]}var d=null!==(i=t.terminator)&&void 0!==i?i:null==l?void 0:l.terminator,v=null!=d?null!==(a=t.separator)&&void 0!==a?a:null==l?void 0:l.separator:void 0;this.additionLength=(null!==(s=null==d?void 0:d.length)&&void 0!==s?s:0)+(null!==(c=null==v?void 0:v.length)&&void 0!==c?c:0),void 0!==t.maxChars&&Math.abs(t.maxChars)<this.additionLength&&(d=void 0,v=void 0),this.options={maxChars:t.maxChars,style:u,terminator:d,separator:v}}return e.prototype.format=function(e){return this.formatToParts(e).join("")},e.prototype.formatToParts=function(e){var t=this.options,r=t.maxChars,n=t.terminator,o=t.separator,i=void 0===r||Math.abs(r)>=e.length?r:r>=0?Math.max(0,r-this.additionLength):Math.min(0,r+this.additionLength),a=void 0!==i&&i>-1?e.slice(0,i):e.slice(i);return null==r||null==i||0===i||null==n||e.length<=Math.abs(r)?[a]:i>0?null!=o?[a,o,n]:[a,n]:null!=o?[n,o,a]:[n,a]},e.prototype.resolvedOptions=function(){return this.options},e}(),q={Collator:Intl.Collator,DateTimeFormat:Intl.DateTimeFormat,DisplayNames:Intl.DisplayNames,ListFormat:Intl.ListFormat,Locale:Intl.Locale,NumberFormat:Intl.NumberFormat,PluralRules:Intl.PluralRules,RelativeTimeFormat:Intl.RelativeTimeFormat,Segmenter:Intl.Segmenter,CutoffFormat:Z},J=function(){function e(){this.cache={}}return e.prototype._generateKey=function(e,t){void 0===t&&(t={});var r=e?Array.isArray(e)?e.map(function(e){return String(e)}).join(","):String(e):"undefined",n=t?JSON.stringify(t,Object.keys(t).sort()):"{}";return"".concat(r,":").concat(n)},e.prototype.get=function(e){for(var t,r,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var i=n[0],a=void 0===i?K:i,s=n[1],c=void 0===s?{}:s,u=this._generateKey(a,c),l=null===(r=this.cache[e])||void 0===r?void 0:r[u];return void 0===l&&(l=new((t=q[e]).bind.apply(t,y([void 0],n,!1))),this.cache[e]||(this.cache[e]={}),this.cache[e][u]=l),l},e}(),Q=new J,$="https://api2.gtx.dev";function ee(e){if("undefined"!=typeof Buffer)return Buffer.from(e,"utf8").toString("base64");for(var t=(new TextEncoder).encode(e),r="",n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return btoa(r)}function te(e){if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf8");for(var t=atob(e),r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return(new TextDecoder).decode(r)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(D||(D={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(F||(F={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(j||(j={}));try{"a"===(null===(x=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===x?void 0:x[0])}catch(e){0}function re(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var ne,oe={};function ie(){if(ne)return oe;var e,t;return ne=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.SKELETON_TYPE=oe.TYPE=void 0,oe.isLiteralElement=function(t){return t.type===e.literal},oe.isArgumentElement=function(t){return t.type===e.argument},oe.isNumberElement=function(t){return t.type===e.number},oe.isDateElement=function(t){return t.type===e.date},oe.isTimeElement=function(t){return t.type===e.time},oe.isSelectElement=function(t){return t.type===e.select},oe.isPluralElement=function(t){return t.type===e.plural},oe.isPoundElement=function(t){return t.type===e.pound},oe.isTagElement=function(t){return t.type===e.tag},oe.isNumberSkeleton=function(e){return!(!e||"object"!=typeof e||e.type!==t.number)},oe.isDateTimeSkeleton=function(e){return!(!e||"object"!=typeof e||e.type!==t.dateTime)},oe.createLiteralElement=function(t){return{type:e.literal,value:t}},oe.createNumberElement=function(t,r){return{type:e.number,value:t,style:r}},function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(e||(oe.TYPE=e={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(t||(oe.SKELETON_TYPE=t={})),oe}ie();var ae,se={},ce=re(V);function ue(e){if(void 0!==e){if(null===e)return"null";if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e)){for(var t="[",r=0;r<e.length;r++)r&&(t+=","),t+=ue(e[r])||"null";return t+"]"}for(var n="",o=0,i=Object.keys(e).sort();o<i.length;o++){var a=i[o],s=ue(e[a]);s&&(n&&(n+=","),n+=JSON.stringify(a)+":"+s)}return"{"+n+"}"}}function le(e){var t;return null!==(t=ue(e))&&void 0!==t?t:""}function he(e,t,r=""){const n=(o=e)instanceof Uint8Array||ArrayBuffer.isView(o)&&"Uint8Array"===o.constructor.name&&"BYTES_PER_ELEMENT"in o&&1===o.BYTES_PER_ELEMENT;var o;const i=e?.length;if(!n||void 0!==t){const t=(r&&`"${r}" `)+"expected Uint8Array"+""+", got "+(n?`length=${i}`:"type="+typeof e);if(!n)throw new TypeError(t);throw new RangeError(t)}return e}function fe(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 pe(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function de(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ve(e,t){return e<<32-t|e>>>t}!function(){if(ae)return se;ae=1,Object.defineProperty(se,"__esModule",{value:!0}),se.printAST=r,se.doPrintAST=n,se.printDateTimeSkeleton=a;var e=ce,t=ie();function r(e){return n(e,!1)}function n(s,c){var u=s.map(function(u,l){return(0,t.isLiteralElement)(u)?function(e,t,r,n){var i=e.value,a=i;r||"'"!==a[0]||(a="''".concat(a.slice(1)));n||"'"!==a[a.length-1]||(a="".concat(a.slice(0,a.length-1),"''"));return a=o(a),t?a.replace("#","'#'"):a}(u,c,0===l,l===s.length-1):(0,t.isArgumentElement)(u)?function(e){var t=e.value;return"{".concat(t,"}")}(u):(0,t.isDateElement)(u)||(0,t.isTimeElement)(u)||(0,t.isNumberElement)(u)?function(e){return"{".concat(e.value,", ").concat(t.TYPE[e.type]).concat(e.style?", ".concat((r=e.style,"string"==typeof r?o(r):r.type===t.SKELETON_TYPE.dateTime?"::".concat(a(r)):"::".concat(r.tokens.map(i).join(" ")))):"","}");var r}(u):(0,t.isPluralElement)(u)?function(t){var r="cardinal"===t.pluralType?"plural":"selectordinal",o=[t.value,r,e.__spreadArray([t.offset?"offset:".concat(t.offset):""],Object.keys(t.options).map(function(e){return"".concat(e,"{").concat(n(t.options[e].value,!0),"}")}),!0).filter(Boolean).join(" ")].join(",");return"{".concat(o,"}")}(u):(0,t.isSelectElement)(u)?function(e){var t=[e.value,"select",Object.keys(e.options).map(function(t){return"".concat(t,"{").concat(n(e.options[t].value,!1),"}")}).join(" ")].join(",");return"{".concat(t,"}")}(u):(0,t.isPoundElement)(u)?"#":(0,t.isTagElement)(u)?function(e){return"<".concat(e.value,">").concat(r(e.children),"</").concat(e.value,">")}(u):void 0});return u.join("")}function o(e){return e.replace(/([{}](?:[\s\S]*[{}])?)/,"'$1'")}function i(e){var t=e.stem,r=e.options;return 0===r.length?t:"".concat(t).concat(r.map(function(e){return"/".concat(e)}).join(""))}function a(e){return e.pattern}}();const me=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),ge=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ee(e,t={}){const r=(t,r)=>e(r).update(t).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.canXOF=n.canXOF,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}const ye=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function be(e,t,r){return e&t^~e&r}function _e(e,t,r){return e&t^e&r^t&r}class Te{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=de(this.buffer)}update(e){fe(this),he(e);const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let i=0;i<o;){const a=Math.min(n-this.pos,o-i);if(a===n){const t=de(e);for(;n<=o-i;i+=n)this.process(t,i);continue}r.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){fe(this),function(e,t){he(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:i}=this;t[i++]=128,pe(this.buffer.subarray(i)),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;r.setBigUint64(n-8,BigInt(8*this.length),o),this.process(r,0);const a=de(e),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const c=s/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)a.setUint32(4*e,u[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=a,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const Le=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ae=Uint32Array.from([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]),Ie=new Uint32Array(64);class Se extends Te{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:t,C:r,D:n,E:o,F:i,G:a,H:s}=this;return[e,t,r,n,o,i,a,s]}set(e,t,r,n,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)Ie[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Ie[e-15],r=Ie[e-2],n=ve(t,7)^ve(t,18)^t>>>3,o=ve(r,17)^ve(r,19)^r>>>10;Ie[e]=o+Ie[e-7]+n+Ie[e-16]|0}let{A:r,B:n,C:o,D:i,E:a,F:s,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(ve(a,6)^ve(a,11)^ve(a,25))+be(a,s,c)+Ae[e]+Ie[e]|0,l=(ve(r,2)^ve(r,13)^ve(r,22))+_e(r,n,o)|0;u=c,c=s,s=a,a=i+t|0,i=o,o=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,s=s+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,o,i,a,s,c,u)}roundClean(){pe(Ie)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),pe(this.buffer)}}class Ne extends Se{A=0|Le[0];B=0|Le[1];C=0|Le[2];D=0|Le[3];E=0|Le[4];F=0|Le[5];G=0|Le[6];H=0|Le[7];constructor(){super(32)}}const Ce=Ee(()=>new Ne,ye(1));var we=["Cham","Jamo","Kawi","Lisu","Toto","Thai"],Pe=function(e,t){(null==t?void 0:t[e])&&"object"==typeof t[e]&&"code"in t[e]&&t[e].code&&(e=t[e].code);try{var r=Q.get("Locale",e),n=r.language,o=r.region,i=r.script;if(e.split("-").length!==(a=1,o&&(a+=1),i&&(a+=1),a))return!1;if(Q.get("DisplayNames",[K],{type:"language"}).of(n)===n&&!function(e){return e>="qaa"&&e<="qtz"}(n))return!1;if(o)if(Q.get("DisplayNames",[K],{type:"region"}).of(o)===o)return!1;if(i)if(Q.get("DisplayNames",[K],{type:"script"}).of(i)===i&&!we.includes(i))return!1;return!0}catch(e){return!1}var a},He=function(e){try{return Intl.getCanonicalLocales(e)[0]}catch(t){return e}};function Be(e,t){var r=Q.get("Locale",e),n=r.language,o=r.region,i=r.script,a=Q.get("Locale",t),s=a.language,c=a.region,u=a.script;return n===s&&((!o||!c||o===c)&&(!i||!u||i===u))}function Me(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{for(var r=e.flat().map(He),n=0;n<r.length;n++)for(var o=n+1;o<r.length;o++)if(!Be(r[n],r[o]))return!1;return!0}catch(e){return console.error(e),!1}}function Re(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{var r=e.flat().map(function(e){return Q.get("Locale",e).language});return r.every(function(e){return e===r[0]})}catch(e){return console.error(e),!1}}function Oe(e,t,r,n){return!(!Pe(e,n)||!Pe(t,n)||r&&r.some(function(e){return!Pe(e,n)}))&&(!Me(e,t)&&!(r&&!r.some(function(e){return Re(t,e)})))}var Ue=function(e,t,r){if(null==e?void 0:e[t])return"string"==typeof e[t]?"name"===r?e[t]:void 0:e[t][r]},Ge=function(e,t){return!!((null==t?void 0:t[e])&&"object"==typeof t[e]&&"code"in t[e]&&t[e].code&&Pe(t[e].code))};function De(e,t){var r=e;t&&Ge(e,t)&&(e=t[e].code);try{var n=He(e),o=Q.get("Locale",n),i=o.language,a=o.region;if(t)for(var s=0,c=[r,e,n,i];s<c.length;s++){var u=Ue(t,c[s],"emoji");if(u)return u}if(a&&ke[a])return ke[a];var l=o.maximize(),h=l.region||"";return xe[l.language]||ke[h]||je}catch(e){return je}}var Fe="🌍",je=Fe,xe={ca:Fe,eu:Fe,ku:Fe,bo:"🌏",ug:"🌏",gd:"🏴",cy:"🏴",gv:"🇮🇲",grc:"🏺"},ke={AF:"🇦🇫",AX:"🇦🇽",AL:"🇦🇱",DZ:"🇩🇿",AS:"🇦🇸",AD:"🇦🇩",AO:"🇦🇴",AI:"🇦🇮",AQ:"🇦🇶",AG:"🇦🇬",AR:"🇦🇷",AM:"🇦🇲",AW:"🇦🇼",AU:"🇦🇺",AT:"🇦🇹",AZ:"🇦🇿",BS:"🇧🇸",BH:"🇧🇭",BD:"🇧🇩",BB:"🇧🇧",BY:"🇧🇾",BE:"🇧🇪",BZ:"🇧🇿",BJ:"🇧🇯",BM:"🇧🇲",BT:"🇧🇹",BO:"🇧🇴",BQ:"🇧🇶",BA:"🇧🇦",BW:"🇧🇼",BV:"🇧🇻",BR:"🇧🇷",IO:"🇮🇴",BN:"🇧🇳",BG:"🇧🇬",BF:"🇧🇫",BI:"🇧🇮",CV:"🇨🇻",KH:"🇰🇭",CM:"🇨🇲",CA:"🇨🇦",KY:"🇰🇾",CF:"🇨🇫",TD:"🇹🇩",CL:"🇨🇱",CN:"🇨🇳",CX:"🇨🇽",CC:"🇨🇨",CO:"🇨🇴",KM:"🇰🇲",CD:"🇨🇩",CG:"🇨🇬",CK:"🇨🇰",CR:"🇨🇷",CI:"🇨🇮",HR:"🇭🇷",CU:"🇨🇺",CW:"🇨🇼",CY:"🇨🇾",CZ:"🇨🇿",DK:"🇩🇰",DJ:"🇩🇯",DM:"🇩🇲",DO:"🇩🇴",EC:"🇪🇨",EG:"🇪🇬",SV:"🇸🇻",GQ:"🇬🇶",ER:"🇪🇷",EE:"🇪🇪",SZ:"🇸🇿",ET:"🇪🇹",FK:"🇫🇰",FO:"🇫🇴",FJ:"🇫🇯",FI:"🇫🇮",FR:"🇫🇷",GF:"🇬🇫",PF:"🇵🇫",TF:"🇹🇫",GA:"🇬🇦",GM:"🇬🇲",GE:"🇬🇪",DE:"🇩🇪",GH:"🇬🇭",GI:"🇬🇮",GR:"🇬🇷",GL:"🇬🇱",GD:"🇬🇩",GP:"🇬🇵",GU:"🇬🇺",GT:"🇬🇹",GG:"🇬🇬",GN:"🇬🇳",GW:"🇬🇼",GY:"🇬🇾",HT:"🇭🇹",HM:"🇭🇲",VA:"🇻🇦",HN:"🇭🇳",HK:"🇭🇰",HU:"🇭🇺",IS:"🇮🇸",IN:"🇮🇳",ID:"🇮🇩",IR:"🇮🇷",IQ:"🇮🇶",IE:"🇮🇪",IM:"🇮🇲",IL:"🇮🇱",IT:"🇮🇹",JM:"🇯🇲",JP:"🇯🇵",JE:"🇯🇪",JO:"🇯🇴",KZ:"🇰🇿",KE:"🇰🇪",KI:"🇰🇮",KP:"🇰🇵",KR:"🇰🇷",KW:"🇰🇼",KG:"🇰🇬",LA:"🇱🇦",LV:"🇱🇻",LB:"🇱🇧",LS:"🇱🇸",LR:"🇱🇷",LY:"🇱🇾",LI:"🇱🇮",LT:"🇱🇹",LU:"🇱🇺",MO:"🇲🇴",MG:"🇲🇬",MW:"🇲🇼",MY:"🇲🇾",MV:"🇲🇻",ML:"🇲🇱",MT:"🇲🇹",MH:"🇲🇭",MQ:"🇲🇶",MR:"🇲🇷",MU:"🇲🇺",YT:"🇾🇹",MX:"🇲🇽",FM:"🇫🇲",MD:"🇲🇩",MC:"🇲🇨",MN:"🇲🇳",ME:"🇲🇪",MS:"🇲🇸",MA:"🇲🇦",MZ:"🇲🇿",MM:"🇲🇲",NA:"🇳🇦",NR:"🇳🇷",NP:"🇳🇵",NL:"🇳🇱",NC:"🇳🇨",NZ:"🇳🇿",NI:"🇳🇮",NE:"🇳🇪",NG:"🇳🇬",NU:"🇳🇺",NF:"🇳🇫",MK:"🇲🇰",MP:"🇲🇵",NO:"🇳🇴",OM:"🇴🇲",PK:"🇵🇰",PW:"🇵🇼",PS:"🇵🇸",PA:"🇵🇦",PG:"🇵🇬",PY:"🇵🇾",PE:"🇵🇪",PH:"🇵🇭",PN:"🇵🇳",PL:"🇵🇱",PT:"🇵🇹",PR:"🇵🇷",QA:"🇶🇦",RE:"🇷🇪",RO:"🇷🇴",RU:"🇷🇺",RW:"🇷🇼",BL:"🇧🇱",SH:"🇸🇭",KN:"🇰🇳",LC:"🇱🇨",MF:"🇲🇫",PM:"🇵🇲",VC:"🇻🇨",WS:"🇼🇸",SM:"🇸🇲",ST:"🇸🇹",SA:"🇸🇦",SN:"🇸🇳",RS:"🇷🇸",SC:"🇸🇨",SL:"🇸🇱",SG:"🇸🇬",SX:"🇸🇽",SK:"🇸🇰",SI:"🇸🇮",SB:"🇸🇧",SO:"🇸🇴",ZA:"🇿🇦",GS:"🇬🇸",SS:"🇸🇸",ES:"🇪🇸",LK:"🇱🇰",SD:"🇸🇩",SR:"🇸🇷",SJ:"🇸🇯",SE:"🇸🇪",CH:"🇨🇭",SY:"🇸🇾",TW:"🇹🇼",TJ:"🇹🇯",TZ:"🇹🇿",TH:"🇹🇭",TL:"🇹🇱",TG:"🇹🇬",TK:"🇹🇰",TO:"🇹🇴",TT:"🇹🇹",TN:"🇹🇳",TR:"🇹🇷",TM:"🇹🇲",TC:"🇹🇨",TV:"🇹🇻",UG:"🇺🇬",UA:"🇺🇦",AE:"🇦🇪",GB:"🇬🇧",US:"🇺🇸",UM:"🇺🇲",UY:"🇺🇾",UZ:"🇺🇿",VU:"🇻🇺",VE:"🇻🇪",VN:"🇻🇳",VG:"🇻🇬",VI:"🇻🇮",WF:"🇼🇫",EH:"🇪🇭",YE:"🇾🇪",ZM:"🇿🇲",ZW:"🇿🇼",EU:"🇪🇺",419:"🌎"};function Ve(e,t){if(t){for(var n={},o=0,i=e;o<i.length;o++){var a=t[i[o]];a&&("string"==typeof a?n.name||(n.name=a):a&&(n=r(r({},a),n)))}return n}}function Ke(e,t,r){void 0===t&&(t=K);var n=e;r&&Ge(e,r)&&(e=r[e].code),t||(t=K);try{var o=He(e),i=Q.get("Locale",e),a=Ve([n,e,o,G=i.language],r),s=i.region,c=i.maximize(),u=c.toString(),l=i.region||(null==a?void 0:a.regionCode)||c.region||"",h=i.script||(null==a?void 0:a.scriptCode)||c.script||"",f=i.minimize().toString(),p=[t,e,K],d=[e,t,K],v=Q.get("DisplayNames",p,{type:"language"}),m=Q.get("DisplayNames",d,{type:"language"}),g=null==a?void 0:a.name,E=(null==a?void 0:a.nativeName)||(null==a?void 0:a.name),y=g||v.of(e)||e,b=E||m.of(e)||e,_=(null==a?void 0:a.maximizedName)||g||v.of(u)||e,T=(null==a?void 0:a.nativeMaximizedName)||E||m.of(u)||e,L=(null==a?void 0:a.minimizedName)||g||v.of(f)||e,A=(null==a?void 0:a.nativeMinimizedName)||E||m.of(f)||e,I=(null==a?void 0:a.languageName)||g||v.of(G)||e,S=(null==a?void 0:a.nativeLanguageName)||E||m.of(G)||e,N=(null==a?void 0:a.nameWithRegionCode)||s?"".concat(I," (").concat(s,")"):y,C=(null==a?void 0:a.nativeNameWithRegionCode)||(s?"".concat(S," (").concat(s,")"):b)||N,w=Q.get("DisplayNames",p,{type:"region"}),P=Q.get("DisplayNames",d,{type:"region"}),H=(null==a?void 0:a.regionName)||(l?w.of(l):"")||"",B=(null==a?void 0:a.nativeRegionName)||(l?P.of(l):"")||"",M=Q.get("DisplayNames",p,{type:"script"}),R=Q.get("DisplayNames",d,{type:"script"});return{code:o,name:y,nativeName:b,maximizedCode:u,maximizedName:_,nativeMaximizedName:T,minimizedCode:f,minimizedName:L,nativeMinimizedName:A,languageCode:G,languageName:I,nativeLanguageName:S,nameWithRegionCode:N,nativeNameWithRegionCode:C,regionCode:l,regionName:H,nativeRegionName:B,scriptCode:h,scriptName:D=(null==a?void 0:a.scriptName)||(h?M.of(h):"")||"",nativeScriptName:F=(null==a?void 0:a.nativeScriptName)||(h?R.of(h):"")||"",emoji:(null==a?void 0:a.emoji)||De(o,r)}}catch(t){var O=Pe(e)?He(e):e,U=null==O?void 0:O.split("-"),G=(null==U?void 0:U[0])||O||"";l=U.length>2?null==U?void 0:U[2]:(null==U?void 0:U[1])||"",h=(null==U?void 0:U[3])||"";O=(null==(a=Ve([O,G],r))?void 0:a.code)||O;y=(null==a?void 0:a.name)||O,b=(null==a?void 0:a.nativeName)||y,u=(null==a?void 0:a.maximizedCode)||O,_=(null==a?void 0:a.maximizedName)||y,T=(null==a?void 0:a.nativeMaximizedName)||b,f=(null==a?void 0:a.minimizedCode)||O,L=(null==a?void 0:a.minimizedName)||y,A=(null==a?void 0:a.nativeMinimizedName)||b;G=(null==a?void 0:a.languageCode)||G;I=(null==a?void 0:a.languageName)||y,S=(null==a?void 0:a.nativeLanguageName)||b;l=(null==a?void 0:a.regionCode)||l;H=(null==a?void 0:a.regionName)||"",B=(null==a?void 0:a.nativeRegionName)||"";h=(null==a?void 0:a.scriptCode)||h;var D=(null==a?void 0:a.scriptName)||"",F=(null==a?void 0:a.nativeScriptName)||"";return{code:O,name:y,nativeName:b,maximizedCode:u,maximizedName:_,nativeMaximizedName:T,minimizedCode:f,minimizedName:L,nativeMinimizedName:A,languageCode:G,languageName:I,nativeLanguageName:S,nameWithRegionCode:N=(null==a?void 0:a.nameWithRegionCode)||(H?"".concat(I," (").concat(H,")"):y),nativeNameWithRegionCode:C=(null==a?void 0:a.nativeNameWithRegionCode)||(B?"".concat(S," (").concat(B,")"):b),regionCode:l,regionName:H,nativeRegionName:B,scriptCode:h,scriptName:D,nativeScriptName:F,emoji:(null==a?void 0:a.emoji)||je}}}function Xe(e,t,o){"string"==typeof e&&(e=[e]),e=e.filter(function(e){return Pe(e,o)}).map(He),t=t.filter(function(e){return Pe(e,o)}).map(He);for(var i=function(e){var o=t.filter(function(t){return Re(e,t)}),i=function(e){for(var t=e.locale,r=e.languageCode,n=e.minimizedCode,i=e.regionCode,a=e.scriptCode,s=0,c=[t,"".concat(r,"-").concat(i),"".concat(r,"-").concat(a),n];s<c.length;s++){var u=c[s];if(o.includes(u))return u}return null},a=Ke(e),s=a.languageCode,c=n(a,["languageCode"]),u=i(r({locale:e,languageCode:s},c))||i(r({locale:s},Ke(s)));if(u)return{value:u}},a=0,s=e;a<s.length;a++){var c=i(s[a]);if("object"==typeof c)return c.value}}function ze(e,t){var r=t&&t.cache?t.cache:rt,n=t&&t.serializer?t.serializer:et;return(t&&t.strategy?t.strategy:qe)(e,{cache:r,serializer:n})}function Ye(e,t,r,n){var o,i=null==(o=n)||"number"==typeof o||"boolean"==typeof o?n:r(n),a=t.get(i);return void 0===a&&(a=e.call(this,n),t.set(i,a)),a}function We(e,t,r){var n=Array.prototype.slice.call(arguments,3),o=r(n),i=t.get(o);return void 0===i&&(i=e.apply(this,n),t.set(o,i)),i}function Ze(e,t,r,n,o){return r.bind(t,e,n,o)}function qe(e,t){return Ze(e,this,1===e.length?Ye:We,t.cache.create(),t.serializer)}var Je,Qe,$e,et=function(){return JSON.stringify(arguments)},tt=function(){function e(){this.cache=Object.create(null)}return e.prototype.get=function(e){return this.cache[e]},e.prototype.set=function(e,t){this.cache[e]=t},e}(),rt={create:function(){return new tt}},nt={variadic:function(e,t){return Ze(e,this,We,t.cache.create(),t.serializer)}};function ot(e){return e.type===Qe.literal}function it(e){return e.type===Qe.argument}function at(e){return e.type===Qe.number}function st(e){return e.type===Qe.date}function ct(e){return e.type===Qe.time}function ut(e){return e.type===Qe.select}function lt(e){return e.type===Qe.plural}function ht(e){return e.type===Qe.pound}function ft(e){return e.type===Qe.tag}function pt(e){return!(!e||"object"!=typeof e||e.type!==$e.number)}function dt(e){return!(!e||"object"!=typeof e||e.type!==$e.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(Je||(Je={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(Qe||(Qe={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}($e||($e={}));var vt=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,mt=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function gt(e){var t={};return e.replace(mt,function(e){var r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var Et=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function yt(e){return e.replace(/^(.*?)-/,"")}var bt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,_t=/^(@+)?(\+|#+)?[rs]?$/g,Tt=/(\*)(0+)|(#+)(0+)|(0+)/g,Lt=/^(0+)$/;function At(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(_t,function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),t}function It(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function St(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!Lt.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Nt(e){var t=It(e);return t||{}}function Ct(e){for(var t={},n=0,o=e;n<o.length;n++){var i=o[n];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=yt(i.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=r(r(r({},t),{notation:"scientific"}),i.options.reduce(function(e,t){return r(r({},e),Nt(t))},{}));continue;case"engineering":t=r(r(r({},t),{notation:"engineering"}),i.options.reduce(function(e,t){return r(r({},e),Nt(t))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Tt,function(e,r,n,o,i,a){if(r)t.minimumIntegerDigits=n.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Lt.test(i.stem))t.minimumIntegerDigits=i.stem.length;else if(bt.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(bt,function(e,r,n,o,i,a){return"*"===n?t.minimumFractionDigits=r.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});var a=i.options[0];"w"===a?t=r(r({},t),{trailingZeroDisplay:"stripIfInteger"}):a&&(t=r(r({},t),At(a)))}else if(_t.test(i.stem))t=r(r({},t),At(i.stem));else{var s=It(i.stem);s&&(t=r(r({},t),s));var c=St(i.stem);c&&(t=r(r({},t),c))}}return t}var wt,Pt={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function Ht(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=e.language;return"root"!==n&&(r=e.maximize().region),(Pt[r||""]||Pt[n||""]||Pt["".concat(n,"-001")]||Pt["001"])[0]}var Bt=new RegExp("^".concat(vt.source,"*")),Mt=new RegExp("".concat(vt.source,"*$"));function Rt(e,t){return{start:e,end:t}}var Ot=!!String.prototype.startsWith&&"_a".startsWith("a",1),Ut=!!String.fromCodePoint,Gt=!!Object.fromEntries,Dt=!!String.prototype.codePointAt,Ft=!!String.prototype.trimStart,jt=!!String.prototype.trimEnd,xt=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},kt=!0;try{kt="a"===(null===(wt=qt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===wt?void 0:wt[0])}catch(e){kt=!1}var Vt,Kt=Ot?function(e,t,r){return e.startsWith(t,r)}:function(e,t,r){return e.slice(r,r+t.length)===t},Xt=Ut?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r,n="",o=e.length,i=0;o>i;){if((r=e[i++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},zt=Gt?Object.fromEntries:function(e){for(var t={},r=0,n=e;r<n.length;r++){var o=n[r],i=o[0],a=o[1];t[i]=a}return t},Yt=Dt?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n,o=e.charCodeAt(t);return o<55296||o>56319||t+1===r||(n=e.charCodeAt(t+1))<56320||n>57343?o:n-56320+(o-55296<<10)+65536}},Wt=Ft?function(e){return e.trimStart()}:function(e){return e.replace(Bt,"")},Zt=jt?function(e){return e.trimEnd()}:function(e){return e.replace(Mt,"")};function qt(e,t){return new RegExp(e,t)}if(kt){var Jt=qt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Vt=function(e,t){var r;return Jt.lastIndex=t,null!==(r=Jt.exec(e)[1])&&void 0!==r?r:""}}else Vt=function(e,t){for(var r=[];;){var n=Yt(e,t);if(void 0===n||rr(n)||nr(n))break;r.push(n),t+=n>=65536?2:1}return Xt.apply(void 0,r)};var Qt,$t=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,r){for(var n=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(e,r)).err)return i;n.push(i.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(Je.UNMATCHED_CLOSING_TAG,Rt(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&er(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;n.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;n.push(i.val)}}else{var a=this.clonePosition();this.bump(),n.push({type:Qe.pound,location:Rt(a,this.clonePosition())})}}}return{val:n,err:null}},e.prototype.parseTag=function(e,t){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Qe.literal,value:"<".concat(n,"/>"),location:Rt(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!er(this.char()))return this.error(Je.INVALID_TAG,Rt(a,this.clonePosition()));var s=this.clonePosition();return n!==this.parseTagName()?this.error(Je.UNMATCHED_CLOSING_TAG,Rt(s,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Qe.tag,value:n,children:i,location:Rt(r,this.clonePosition())},err:null}:this.error(Je.INVALID_TAG,Rt(a,this.clonePosition())))}return this.error(Je.UNCLOSED_TAG,Rt(r,this.clonePosition()))}return this.error(Je.INVALID_TAG,Rt(r,this.clonePosition()))},e.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&tr(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var r=this.clonePosition(),n="";;){var o=this.tryParseQuote(t);if(o)n+=o;else{var i=this.tryParseUnquoted(e,t);if(i)n+=i;else{var a=this.tryParseLeftAngleBracket();if(!a)break;n+=a}}}var s=Rt(r,this.clonePosition());return{val:{type:Qe.literal,value:n,location:s},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(er(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(r);this.bump()}return Xt.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),Xt(r))},e.prototype.parseArgument=function(e,t){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Je.EXPECT_ARGUMENT_CLOSING_BRACE,Rt(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(Je.EMPTY_ARGUMENT,Rt(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(Je.MALFORMED_ARGUMENT,Rt(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Je.EXPECT_ARGUMENT_CLOSING_BRACE,Rt(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Qe.argument,value:n,location:Rt(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Je.EXPECT_ARGUMENT_CLOSING_BRACE,Rt(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(Je.MALFORMED_ARGUMENT,Rt(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),r=Vt(this.message,t),n=t+r.length;return this.bumpTo(n),{value:r,location:Rt(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,o){var i,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(s){case"":return this.error(Je.EXPECT_ARGUMENT_TYPE,Rt(a,c));case"number":case"date":case"time":this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((E=this.parseSimpleArgStyleIfPossible()).err)return E;if(0===(d=Zt(E.val)).length)return this.error(Je.EXPECT_ARGUMENT_STYLE,Rt(this.clonePosition(),this.clonePosition()));u={style:d,styleLocation:Rt(l,this.clonePosition())}}if((y=this.tryParseArgumentClose(o)).err)return y;var h=Rt(o,this.clonePosition());if(u&&Kt(null==u?void 0:u.style,"::",0)){var f=Wt(u.style.slice(2));if("number"===s)return(E=this.parseNumberSkeletonFromString(f,u.styleLocation)).err?E:{val:{type:Qe.number,value:n,location:h,style:E.val},err:null};if(0===f.length)return this.error(Je.EXPECT_DATE_TIME_SKELETON,h);var p=f;this.locale&&(p=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e.charAt(n);if("j"===o){for(var i=0;n+1<e.length&&e.charAt(n+1)===o;)i++,n++;var a=1+(1&i),s=i<2?1:3+(i>>1),c=Ht(t);for("H"!=c&&"k"!=c||(s=0);s-- >0;)r+="a";for(;a-- >0;)r=c+r}else r+="J"===o?"H":o}return r}(f,this.locale));var d={type:$e.dateTime,pattern:p,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?gt(p):{}};return{val:{type:"date"===s?Qe.date:Qe.time,value:n,location:h,style:d},err:null}}return{val:{type:"number"===s?Qe.number:"date"===s?Qe.date:Qe.time,value:n,location:h,style:null!==(i=null==u?void 0:u.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var v=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Je.EXPECT_SELECT_ARGUMENT_OPTIONS,Rt(v,r({},v)));this.bumpSpace();var m=this.parseIdentifierIfPossible(),g=0;if("select"!==s&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(Je.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Rt(this.clonePosition(),this.clonePosition()));var E;if(this.bumpSpace(),(E=this.tryParseDecimalInteger(Je.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Je.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return E;this.bumpSpace(),m=this.parseIdentifierIfPossible(),g=E.val}var y,b=this.tryParsePluralOrSelectOptions(e,s,t,m);if(b.err)return b;if((y=this.tryParseArgumentClose(o)).err)return y;var _=Rt(o,this.clonePosition());return"select"===s?{val:{type:Qe.select,value:n,options:zt(b.val),location:_},err:null}:{val:{type:Qe.plural,value:n,options:zt(b.val),offset:g,pluralType:"plural"===s?"cardinal":"ordinal",location:_},err:null};default:return this.error(Je.INVALID_ARGUMENT_TYPE,Rt(a,c))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(Je.EXPECT_ARGUMENT_CLOSING_BRACE,Rt(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Je.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Rt(r,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],r=0,n=e.split(Et).filter(function(e){return e.length>0});r<n.length;r++){var o=n[r].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],a=o.slice(1),s=0,c=a;s<c.length;s++)if(0===c[s].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:a})}return t}(e)}catch(e){return this.error(Je.INVALID_NUMBER_SKELETON,t)}return{val:{type:$e.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?Ct(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,r,n){for(var o,i=!1,a=[],s=new Set,c=n.value,u=n.location;;){if(0===c.length){var l=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var h=this.tryParseDecimalInteger(Je.EXPECT_PLURAL_ARGUMENT_SELECTOR,Je.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;u=Rt(l,this.clonePosition()),c=this.message.slice(l.offset,this.offset())}if(s.has(c))return this.error("select"===t?Je.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Je.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);"other"===c&&(i=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?Je.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Je.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Rt(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(e+1,t,r);if(p.err)return p;var d=this.tryParseArgumentClose(f);if(d.err)return d;a.push([c,{value:p.val,location:Rt(f,this.clonePosition())}]),s.add(c),this.bumpSpace(),c=(o=this.parseIdentifierIfPossible()).value,u=o.location}return 0===a.length?this.error("select"===t?Je.EXPECT_SELECT_ARGUMENT_SELECTOR:Je.EXPECT_PLURAL_ARGUMENT_SELECTOR,Rt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(Je.MISSING_OTHER_CLAUSE,Rt(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=!1,i=0;!this.isEOF();){var a=this.char();if(!(a>=48&&a<=57))break;o=!0,i=10*i+(a-48),this.bump()}var s=Rt(n,this.clonePosition());return o?xt(i*=r)?{val:i,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Yt(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Kt(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&rr(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),r=this.message.charCodeAt(t+(e>=65536?2:1));return null!=r?r:null},e}();function er(e){return e>=97&&e<=122||e>=65&&e<=90}function tr(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function rr(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function nr(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function or(e){e.forEach(function(e){if(delete e.location,ut(e)||lt(e))for(var t in e.options)delete e.options[t].location,or(e.options[t].value);else at(e)&&pt(e.style)||(st(e)||ct(e))&&dt(e.style)?delete e.style.location:ft(e)&&or(e.children)})}function ir(e,t){void 0===t&&(t={}),t=r({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new $t(e,t).parse();if(n.err){var o=SyntaxError(Je[n.err.kind]);throw o.location=n.err.location,o.originalMessage=n.err.message,o}return(null==t?void 0:t.captureLocation)||or(n.val),n.val}!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(Qt||(Qt={}));var ar,sr=function(e){function r(t,r,n){var o=e.call(this,t)||this;return o.code=r,o.originalMessage=n,o}return t(r,e),r.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},r}(Error),cr=function(e){function r(t,r,n,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Qt.INVALID_VALUE,o)||this}return t(r,e),r}(sr),ur=function(e){function r(t,r,n){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(r),Qt.INVALID_VALUE,n)||this}return t(r,e),r}(sr),lr=function(e){function r(t,r){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(r,'"'),Qt.MISSING_VALUE,r)||this}return t(r,e),r}(sr);function hr(e){return"function"==typeof e}function fr(e,t,r,n,o,i,a){if(1===e.length&&ot(e[0]))return[{type:ar.literal,value:e[0].value}];for(var s=[],c=0,u=e;c<u.length;c++){var l=u[c];if(ot(l))s.push({type:ar.literal,value:l.value});else if(ht(l))"number"==typeof i&&s.push({type:ar.literal,value:r.getNumberFormat(t).format(i)});else{var h=l.value;if(!o||!(h in o))throw new lr(h,a);var f=o[h];if(it(l))f&&"string"!=typeof f&&"number"!=typeof f||(f="string"==typeof f||"number"==typeof f?String(f):""),s.push({type:"string"==typeof f?ar.literal:ar.object,value:f});else if(st(l)){var p="string"==typeof l.style?n.date[l.style]:dt(l.style)?l.style.parsedOptions:void 0;s.push({type:ar.literal,value:r.getDateTimeFormat(t,p).format(f)})}else if(ct(l)){p="string"==typeof l.style?n.time[l.style]:dt(l.style)?l.style.parsedOptions:n.time.medium;s.push({type:ar.literal,value:r.getDateTimeFormat(t,p).format(f)})}else if(at(l)){(p="string"==typeof l.style?n.number[l.style]:pt(l.style)?l.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),s.push({type:ar.literal,value:r.getNumberFormat(t,p).format(f)})}else{if(ft(l)){var d=l.children,v=l.value,m=o[v];if(!hr(m))throw new ur(v,"function",a);var g=m(fr(d,t,r,n,o,i).map(function(e){return e.value}));Array.isArray(g)||(g=[g]),s.push.apply(s,g.map(function(e){return{type:"string"==typeof e?ar.literal:ar.object,value:e}}))}if(ut(l)){if(!(E=l.options[f]||l.options.other))throw new cr(l.value,f,Object.keys(l.options),a);s.push.apply(s,fr(E.value,t,r,n,o))}else if(lt(l)){var E;if(!(E=l.options["=".concat(f)])){if(!Intl.PluralRules)throw new sr('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Qt.MISSING_INTL_API,a);var y=r.getPluralRules(t,{type:l.pluralType}).select(f-(l.offset||0));E=l.options[y]||l.options.other}if(!E)throw new cr(l.value,f,Object.keys(l.options),a);s.push.apply(s,fr(E.value,t,r,n,o,f-(l.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce(function(e,t){var r=e[e.length-1];return r&&r.type===ar.literal&&t.type===ar.literal?r.value+=t.value:e.push(t),e},[])}(s)}function pr(e,t){return t?Object.keys(e).reduce(function(n,o){var i,a;return n[o]=(i=e[o],(a=t[o])?r(r(r({},i||{}),a||{}),Object.keys(i).reduce(function(e,t){return e[t]=r(r({},i[t]),a[t]||{}),e},{})):i),n},r({},e)):e}function dr(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(ar||(ar={}));var vr=function(){function e(t,o,i,a){void 0===o&&(o=e.defaultLocale);var s,c=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=c.formatToParts(e);if(1===t.length)return t[0].value;var r=t.reduce(function(e,t){return e.length&&t.type===ar.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e},[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(e){return fr(c.ast,c.locales,c.formatters,c.formats,e,void 0,c.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=c.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(c.locales)[0]}},this.getAst=function(){return c.ast},this.locales=o,this.resolvedLocale=e.resolveLocale(o),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var u=a||{};u.formatters;var l=n(u,["formatters"]);this.ast=e.__parse(t,r(r({},l),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=pr(e.formats,i),this.formatters=a&&a.formatters||(void 0===(s=this.formatterCache)&&(s={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:ze(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,y([void 0],t,!1)))},{cache:dr(s.number),strategy:nt.variadic}),getDateTimeFormat:ze(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,y([void 0],t,!1)))},{cache:dr(s.dateTime),strategy:nt.variadic}),getPluralRules:ze(function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,y([void 0],t,!1)))},{cache:dr(s.pluralRules),strategy:nt.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=ir,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}(),mr={debug:0,info:1,warn:2,error:3,off:4},gr={debug:"[36m",info:"[32m",warn:"[33m",error:"[31m",off:""};function Er(){var e;if("undefined"!=typeof process&&(null===(e=process.env)||void 0===e?void 0:e._GT_LOG_LEVEL)){var t=process.env._GT_LOG_LEVEL.toLowerCase();if(t in mr)return t}return"warn"}var yr=function(){function e(e){this.config=e}return e.prototype.handle=function(e){var t=[];this.config.includeTimestamp&&t.push("[".concat(e.timestamp.toISOString(),"]"));var r=gr[e.level],n="[".concat(e.level.toUpperCase(),"]");t.push("".concat(r).concat(n).concat("[0m")),this.config.prefix&&t.push("[".concat(this.config.prefix,"]")),this.config.includeContext&&e.context&&t.push("[".concat(e.context,"]")),t.push(e.message),e.metadata&&Object.keys(e.metadata).length>0&&t.push("\n Metadata: ".concat(JSON.stringify(e.metadata,null,2)));var o=t.join(" ");switch(e.level){case"debug":console.debug(o);break;case"info":console.info(o);break;case"warn":console.warn(o);break;case"error":console.error(o)}},e}(),br=function(){function e(e){void 0===e&&(e={}),this.config=r({level:Er(),includeTimestamp:!0,includeContext:!0,enableConsole:!0,handlers:[]},e),this.handlers=y([],this.config.handlers||[],!0),this.config.enableConsole&&this.handlers.push(new yr(this.config))}return e.prototype.addHandler=function(e){this.handlers.push(e)},e.prototype.removeHandler=function(e){var t=this.handlers.indexOf(e);t>-1&&this.handlers.splice(t,1)},e.prototype.configure=function(e){this.config=r(r({},this.config),e)},e.prototype.shouldLog=function(e){return mr[e]>=mr[this.config.level]},e.prototype.log=function(e,t,r,n){if(this.shouldLog(e)){var o={level:e,message:t,timestamp:new Date,context:r,metadata:n};this.handlers.forEach(function(e){try{e.handle(o)}catch(e){console.error("Error in log handler:",e)}})}},e.prototype.debug=function(e,t,r){this.log("debug",e,t,r)},e.prototype.info=function(e,t,r){this.log("info",e,t,r)},e.prototype.warn=function(e,t,r){this.log("warn",e,t,r)},e.prototype.error=function(e,t,r){this.log("error",e,t,r)},e.prototype.child=function(e){return new _r(this,e)},e.prototype.getConfig=function(){return r({},this.config)},e}(),_r=function(){function e(e,t){this.logger=e,this.context=t}return e.prototype.debug=function(e,t){this.logger.debug(e,this.context,t)},e.prototype.info=function(e,t){this.logger.info(e,this.context,t)},e.prototype.warn=function(e,t){this.logger.warn(e,this.context,t)},e.prototype.error=function(e,t){this.logger.error(e,this.context,t)},e.prototype.child=function(t){return new e(this.logger,"".concat(this.context,":").concat(t))},e}(),Tr=new br({level:Er(),includeTimestamp:!0,includeContext:!0,prefix:"GT"}),Lr=Tr.child("fetch");Tr.child("validation"),Tr.child("formatting"),Tr.child("locale");var Ar=Tr.child("GT instance");function Ir(e){var t=e.value,n=e.locales,o=void 0===n?[K]:n,i=e.options,a=void 0===i?{}:i;return Q.get("ListFormat",o,r({type:"conjunction",style:"long"},a)).format(t)}function Sr(e){var t=e.value,n=e.locales,o=void 0===n?[K]:n,i=e.options,a=void 0===i?{}:i,s=Q.get("ListFormat",o,r({type:"conjunction",style:"long"},a)).formatToParts(t.map(function(){return"1"})),c=0;return s.map(function(e){return"element"===e.type?t[c++]:e.value})}function Nr(e){var t=e.date,r=e.baseDate,n=e.locales,o=void 0===n?[K]:n,i=e.options,a=void 0===i?{}:i,s=function(e,t){var r=t.getTime(),n=e.getTime()-r,o=Math.abs(n),i=n<0?-1:1,a=Math.floor(o/1e3),s=Math.floor(o/6e4),c=Math.floor(o/36e5),u=Math.floor(o/864e5),l=Math.floor(o/6048e5),h=Math.floor(o/2592e6),f=Math.floor(o/31536e6);return a<60?{value:i*a,unit:"second"}:s<60?{value:i*s,unit:"minute"}:c<24?{value:i*c,unit:"hour"}:u<7?{value:i*u,unit:"day"}:u<28||h<1?{value:i*l,unit:"week"}:h<12||f<1?{value:i*h,unit:"month"}:{value:i*f,unit:"year"}}(t,r);return Cr({value:s.value,unit:s.unit,locales:o,options:a})}function Cr(e){var t=e.value,n=e.unit,o=e.locales,i=void 0===o?[K]:o,a=e.options,s=void 0===a?{}:a;return Q.get("RelativeTimeFormat",i,r({style:"long",numeric:"auto"},s)).format(t,n)}function wr(e,t,r){void 0===t&&(t=K);var n=e;r&&Ge(e,r)&&(e=r[e].code),t||(t=K);try{var o=He(e);if(r)for(var i=0,a=[n,e,o,Q.get("Locale",o).language];i<a.length;i++){var s=Ue(r,a[i],"name");if(s)return s}return Q.get("DisplayNames",[t,o,K],{type:"language"}).of(o)||""}catch(e){return""}}function Pr(e){try{var t=function(e){var t,r,n;if("textInfo"in e&&"object"==typeof e.textInfo&&null!==e.textInfo&&"direction"in e.textInfo&&("rtl"===(null===(t=e.textInfo)||void 0===t?void 0:t.direction)||"ltr"===(null===(r=e.textInfo)||void 0===r?void 0:r.direction)))return null===(n=e.textInfo)||void 0===n?void 0:n.direction;return}(Q.get("Locale",e));if(t)return t}catch(e){}var r,n,o=Ke(e),i=o.scriptCode,a=o.languageCode;return i?(r=i)&&Hr.has(r.toLowerCase())?"rtl":"ltr":a?(n=a)&&Br.has(n.toLowerCase())?"rtl":"ltr":"ltr"}var Hr=new Set(["arab","adlm","hebr","nkoo","rohg","samr","syrc","thaa","yezi"]),Br=new Set(["ar","arc","ckb","dv","fa","he","iw","ku","lrc","nqo","ps","pnb","sd","syr","ug","ur","yi"]);var Mr="GT Error:",Rr=function(e){return"".concat(Mr," Translation request timed out after ").concat(e,"ms.")},Or=function(e){return"".concat(Mr," Cannot call `").concat(e,"` without a specified locale. Either pass a locale to the `").concat(e,"` function or specify a targetLocale in the GT constructor.")},Ur=function(e){return"".concat(Mr," Cannot call `").concat(e,"` without a specified locale. Either pass a locale to the `").concat(e,"` function or specify a sourceLocale in the GT constructor.")},Gr=function(e){return"".concat(Mr," Invalid locale: ").concat(e,".")};function Dr(e,t,n){return h(this,void 0,void 0,function(){var o,i,a,s;return f(this,function(c){switch(c.label){case 0:o=new AbortController,i=o.signal,a=(n=n||X)?setTimeout(function(){return o.abort()},n):null,c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,fetch(e,r(r({},t),{signal:i}))];case 2:return[2,c.sent()];case 3:if((s=c.sent())instanceof Error&&"AbortError"===s.name)throw Rr(n);throw s;case 4:return a&&clearTimeout(a),[7];case 5:return[2]}})})}var Fr=function(e){function r(t,r,n){var o=e.call(this,t)||this;return o.name="ApiError",o.code=r,o.message=n,o}return t(r,e),r.prototype.getCode=function(){return this.code},r.prototype.getMessage=function(){return this.message},r}(Error);function jr(e){return h(this,void 0,void 0,function(){var t,r,n,o;return f(this,function(i){switch(i.label){case 0:if(e.ok)return[3,5];t="Unknown error",i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.text()];case 2:r=i.sent();try{n=JSON.parse(r),t=n.error}catch(e){t=r||"Unknown error"}return[3,4];case 3:return i.sent(),[3,4];case 4:throw o=function(e,t,r){return"".concat(Mr," API returned error status. Status: ").concat(e,", Status Text: ").concat(t,", Error: ").concat(r)}(e.status,e.statusText,t),new Fr(o,e.status,t);case 5:return[2]}})})}function xr(e,t){if(e instanceof Error&&"AbortError"===e.name){var r=Rr(t);throw Lr.error(r),new Error(r)}var n=function(e){return"".concat(Mr," Translation request failed. Error: ").concat(e)}(e instanceof Error?e.message:String(e));throw Lr.error(n),e}var kr="2026-03-06.v1";function Vr(e,t){void 0===t&&(t=!1);var n=r(r({},!t&&{"Content-Type":"application/json"}),{"x-gt-project-id":e.projectId});return e.apiKey&&(e.apiKey.startsWith("gtx-internal-")?n["x-gt-internal-api-key"]=e.apiKey:n["x-gt-api-key"]=e.apiKey),n["gt-api-version"]=kr,n}function Kr(e){return new Promise(function(t){return setTimeout(t,e)})}function Xr(e,t){switch(e){case"linear":return 500*(t+1);case"exponential":return 500*Math.pow(2,t);default:return 0}}function zr(e,t,r){return h(this,void 0,void 0,function(){var n,o,i,a,s,c,u,l,h,p,d,v;return f(this,function(f){switch(f.label){case 0:n=null!==(p=null==r?void 0:r.timeout)&&void 0!==p?p:X,o="".concat(e.baseUrl||$).concat(t),i=null!==(d=null==r?void 0:r.method)&&void 0!==d?d:"POST",a=null!==(v=null==r?void 0:r.retryPolicy)&&void 0!==v?v:"exponential",s="none"===a?0:3,c={method:i,headers:Vr(e)},void 0!==(null==r?void 0:r.body)&&(c.body=JSON.stringify(r.body)),u=0,f.label=1;case 1:if(!(u<=s))return[3,13];l=void 0,f.label=2;case 2:return f.trys.push([2,4,,7]),[4,Dr(o,c,n)];case 3:return l=f.sent(),[3,7];case 4:return h=f.sent(),u<s?[4,Kr(Xr(a,u))]:[3,6];case 5:return f.sent(),[3,12];case 6:return xr(h,n),[3,7];case 7:return l.status>=500&&u<s?[4,Kr(Xr(a,u))]:[3,9];case 8:return f.sent(),[3,12];case 9:return[4,jr(l)];case 10:return f.sent(),[4,l.json()];case 11:return[2,f.sent()];case 12:return u++,[3,1];case 13:throw new Error("Max retries exceeded")}})})}function Yr(e){return function(e){if(he(e),me)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=ge[e[r]];return t}(Ce(function(e){if("string"!=typeof e)throw new TypeError("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e))).slice(0,16)}function Wr(e,t){var n,o=e.source,i=e.context,a=e.id,s=e.maxChars,c=e.dataFormat;return void 0===t&&(t=Yr),n="JSX"===c?qr(o):o,t(le(r(r(r(r({source:n},a&&{id:a}),i&&{context:i}),null!=s&&{maxChars:Math.abs(s)}),c&&{dataFormat:c})))}var Zr=function(e){if(e&&"object"==typeof e){var t={};if("c"in e&&e.c&&(t.c=qr(e.c)),"d"in e){var n=null==e?void 0:e.d;(null==n?void 0:n.b)&&(t.b=Object.fromEntries(Object.entries(n.b).map(function(e){return[e[0],qr(e[1])]}))),(null==n?void 0:n.t)&&(t.t=n.t)}return function(e){var t=e;if(t&&"object"==typeof t&&"string"==typeof t.k){var r=Object.keys(t);if(1===r.length)return!0;if(2===r.length){if("number"==typeof t.i)return!0;if("string"==typeof t.v)return!0}if(3===r.length&&"string"==typeof t.v&&"number"==typeof t.i)return!0}return!1}(e)?r({k:e.k},e.v&&{v:e.v}):t}return e};function qr(e){return Array.isArray(e)?e.map(Zr):Zr(e)}function Jr(e,t,n,o){return h(this,void 0,void 0,function(){var i,a,s,c,u,l,h,p,d,v,m,g,E,y,b,_;return f(this,function(f){switch(f.label){case 0:for(i=Array.isArray(e),a=i?[]:void 0,s={},c=i?e.map(function(e){return[void 0,e]}):Object.entries(e),u=0,l=c;u<l.length;u++)h=l[u],p=h[0],d=h[1],m=(v="string"==typeof d?{source:d}:d).source,g=v.metadata,E=null!==(b=null!=p?p:null==g?void 0:g.hash)&&void 0!==b?b:Wr(r({source:m,dataFormat:null!==(_=null==g?void 0:g.dataFormat)&&void 0!==_?_:"STRING"},null!=g?g:{})),null==a||a.push(E),s[E]={source:m,metadata:g};return[4,zr(r(r({},n),{baseUrl:n.baseUrl||"https://runtime2.gtx.dev"}),"/v2/translate",{body:{requests:s,targetLocale:t.targetLocale,sourceLocale:t.sourceLocale,metadata:t},timeout:o,retryPolicy:"none"})];case 1:return y=f.sent(),a?[2,a.map(function(e){var t;return null!==(t=y[e])&&void 0!==t?t:{success:!1,error:"No translation returned",code:500}})]:[2,y]}})})}function Qr(e,t,r){return h(this,void 0,void 0,function(){return f(this,function(n){return[2,zr(t,"/v2/project/setup/generate",{body:{files:e.map(function(e){return{branchId:e.branchId,fileId:e.fileId,versionId:e.versionId}}),locales:null==r?void 0:r.locales,force:null==r?void 0:r.force},timeout:null==r?void 0:r.timeoutMs})]})})}function $r(e,t){for(var r=[],n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function en(e,t){return h(this,arguments,void 0,function(e,t,r){var n,o,i,a,s,c,u,l,h,p,d,v,m;return void 0===r&&(r={}),f(this,function(f){switch(f.label){case 0:return n=r.batchSize,o=void 0===n?100:n,i=r.parallel,a=void 0===i||i,0===e.length?[2,{data:[],count:0,batchCount:0}]:(s=$r(e,o),c=[],a?[4,Promise.all(s.map(function(e){return t(e)}))]:[3,2]);case 1:for(u=f.sent(),l=0,h=u;l<h.length;l++)(m=h[l])&&c.push.apply(c,m);return[3,6];case 2:p=0,d=s,f.label=3;case 3:return p<d.length?(v=d[p],[4,t(v)]):[3,6];case 4:(m=f.sent())&&c.push.apply(c,m),f.label=5;case 5:return p++,[3,3];case 6:return[2,{data:c,count:c.length,batchCount:s.length}]}})})}function tn(e,t,r){return h(this,void 0,void 0,function(){var n,o,i=this;return f(this,function(a){switch(a.label){case 0:return[4,en(e,function(e){return h(i,void 0,void 0,function(){var n,o;return f(this,function(i){switch(i.label){case 0:return n={files:e.map(function(e){return{branchId:e.branchId,fileId:e.fileId,versionId:e.versionId,fileName:e.fileName}}),targetLocales:t.targetLocales,sourceLocale:t.sourceLocale,requireApproval:t.requireApproval,modelProvider:t.modelProvider,force:t.force},[4,zr(r,"/v2/project/translations/enqueue",{body:n,timeout:t.timeout})];case 1:return o=i.sent(),[2,Array.from(Object.entries(o.jobData))]}})})},{batchSize:100})];case 1:return n=a.sent(),o=Object.fromEntries(n.data.map(function(e){return[e[0],e[1]]})),[2,{jobData:o,locales:t.targetLocales,message:"Successfully enqueued ".concat(n.count," file translation jobs in ").concat(n.batchCount," batch(es)")}]}})})}function rn(e,t){return h(this,void 0,void 0,function(){return f(this,function(n){switch(n.label){case 0:return[4,zr(t,"/v2/project/tags/create",{body:r({tagId:e.tagId,files:e.files},e.message&&{message:e.message})})];case 1:return[2,n.sent()]}})})}function nn(e,t,n){return h(this,void 0,void 0,function(){var o=this;return f(this,function(i){return[2,en(e,function(e){return h(o,void 0,void 0,function(){var o;return f(this,function(i){switch(i.label){case 0:return[4,zr(n,"/v2/project/files/download",{body:e,timeout:t.timeout})];case 1:return o=i.sent(),[2,o.files.map(function(e){return r(r({},e),{data:te(e.data)})})]}})})},{batchSize:100})]})})}function on(e,t){return h(this,arguments,void 0,function(e,t,r){var n=this;return void 0===r&&(r={}),f(this,function(o){switch(o.label){case 0:return[4,en(e.diffs,function(e){return h(n,void 0,void 0,function(){return f(this,function(n){switch(n.label){case 0:return[4,zr(t,"/v2/project/files/diffs",{body:{diffs:e},timeout:r.timeout})];case 1:return n.sent(),[2,[{success:!0}]]}})})},{batchSize:100})];case 1:return o.sent(),[2,{success:!0}]}})})}function an(e,t,n){void 0===t&&(t=K),t||(t=K);try{var o=Q.get("DisplayNames",[t,K],{type:"region"});return r({code:e,name:o.of(e)||e,emoji:ke[e]||je},null==n?void 0:n[e])}catch(t){return r({code:e,name:e,emoji:je},null==n?void 0:n[e])}}function sn(e,t){var r;return t&&(r=Object.fromEntries(Object.entries(t).filter(function(e){var t=e[1];return t&&"object"==typeof t&&"code"in t}).map(function(e){var t=e[0];return[e[1].code,t]}))),(null==r?void 0:r[e])||e}function cn(e,t){return t&&Ge(e,t)?t[e].code:e}function un(e,t,r){return h(this,void 0,void 0,function(){var n=this;return f(this,function(o){return[2,en(e,function(e){return h(n,void 0,void 0,function(){var n;return f(this,function(o){switch(o.label){case 0:return n={data:e.map(function(e){var t=e.source;return{source:{content:ee(t.content),fileName:t.fileName,fileFormat:t.fileFormat,locale:t.locale,dataFormat:t.dataFormat,formatMetadata:t.formatMetadata,fileId:t.fileId,versionId:t.versionId,branchId:t.branchId,incomingBranchId:t.incomingBranchId,checkedOutBranchId:t.checkedOutBranchId}}}),sourceLocale:t.sourceLocale},[4,zr(r,"/v2/project/files/upload-files",{body:n,timeout:t.timeout})];case 1:return[2,o.sent().uploadedFiles||[]]}})})},{batchSize:100})]})})}function ln(e,t,r){return h(this,void 0,void 0,function(){var n=this;return f(this,function(o){return[2,en(e,function(e){return h(n,void 0,void 0,function(){var n;return f(this,function(o){switch(o.label){case 0:return n={data:e.map(function(e){var t=e.source,r=e.translations;return{source:{content:ee(t.content),fileName:t.fileName,fileFormat:t.fileFormat,locale:t.locale,dataFormat:t.dataFormat,formatMetadata:t.formatMetadata,fileId:t.fileId,versionId:t.versionId,branchId:t.branchId},translations:r.map(function(e){return{content:ee(e.content),fileName:e.fileName,fileFormat:e.fileFormat,locale:e.locale,dataFormat:e.dataFormat,fileId:e.fileId,versionId:e.versionId,branchId:e.branchId}})}}),sourceLocale:t.sourceLocale},[4,zr(r,"/v2/project/files/upload-translations",{body:n,timeout:t.timeout})];case 1:return[2,o.sent().uploadedFiles||[]]}})})},{batchSize:100})]})})}function hn(e,t,r){return h(this,void 0,void 0,function(){var n,o,i,a,s;return f(this,function(c){return n=e.branchId,o=e.versionId,i=e.fileId,a=new URLSearchParams,n&&a.set("branchId",n),o&&a.set("versionId",o),s="/v2/project/translations/files/status/".concat(encodeURIComponent(i),"?").concat(a.toString()),[2,zr(r,s,{method:"GET",timeout:t.timeout})]})})}function fn(e,t,r){return h(this,void 0,void 0,function(){var n,o,i,a;return f(this,function(s){switch(s.label){case 0:n=r.baseUrl,o=t.timeout?t.timeout:X,i="".concat(n||$,"/v2/project/info/").concat(encodeURIComponent(e)),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,Dr(i,{method:"GET",headers:Vr(r)},o)];case 2:return a=s.sent(),[3,4];case 3:return xr(s.sent(),o),[3,4];case 4:return[4,jr(a)];case 5:return s.sent(),[4,a.json()];case 6:return[2,s.sent()]}})})}function pn(e,t,r){return h(this,void 0,void 0,function(){return f(this,function(n){return[2,zr(t,"/v2/project/jobs/info",{body:{jobIds:e},timeout:r})]})})}function dn(e,t,n){return h(this,void 0,void 0,function(){var o,i,a,s,c,u,l,h,p,d,v;return f(this,function(f){switch(f.label){case 0:if(o=1e3*(null!==(v=null==t?void 0:t.pollingIntervalSeconds)&&void 0!==v?v:5),i=void 0!==(null==t?void 0:t.timeoutSeconds)?1e3*t.timeoutSeconds:6e5,0===(a=Object.keys(e.jobData)).length)return[2,{complete:!0,jobs:[]}];s=Date.now(),c=new Map(a.map(function(e){return[e,{jobId:e,status:"unknown"}]})),u=new Set(a),f.label=1;case 1:return u.size>0?[4,pn(Array.from(u),n)]:[3,4];case 2:for(l=f.sent(),h=0,p=l;h<p.length;h++)"completed"===(d=p[h]).status||"failed"===d.status||"unknown"===d.status?(c.set(d.jobId,r({jobId:d.jobId,status:d.status},d.error?{error:d.error}:{})),u.delete(d.jobId)):c.set(d.jobId,{jobId:d.jobId,status:d.status});return 0===u.size||Date.now()-s>=i?[3,4]:[4,new Promise(function(e){return setTimeout(e,o)})];case 3:return f.sent(),[3,1];case 4:return[2,{complete:0===u.size,jobs:Array.from(c.values())}]}})})}function vn(e){return h(this,arguments,void 0,function(e,t,r){var n,o,i;return void 0===t&&(t={}),f(this,function(a){return n={sourceFiles:null===(o=e.sourceFiles)||void 0===o?void 0:o.map(function(e){return{fileId:e.fileId,versionId:e.versionId,branchId:e.branchId}}),translatedFiles:null===(i=e.translatedFiles)||void 0===i?void 0:i.map(function(e){return{fileId:e.fileId,versionId:e.versionId,branchId:e.branchId,locale:e.locale}})},[2,zr(r,"/v2/project/files/info",{body:n,timeout:t.timeout})]})})}function mn(e,t){return h(this,void 0,void 0,function(){return f(this,function(r){return[2,zr(t,"/v2/project/branches/info",{body:e})]})})}function gn(e,t){return h(this,void 0,void 0,function(){return f(this,function(r){return[2,zr(t,"/v2/project/branches/create",{body:e})]})})}function En(e,t,r){return h(this,void 0,void 0,function(){var n,o,i,a=this;return f(this,function(s){switch(s.label){case 0:return 0===e.length?[2,{results:[],summary:{total:0,succeeded:0,failed:0}}]:[4,en(e,function(e){return h(a,void 0,void 0,function(){return f(this,function(n){switch(n.label){case 0:return[4,zr(r,"/v2/project/files/moves",{body:{branchId:t.branchId,moves:e},timeout:t.timeout})];case 1:return[2,n.sent().results]}})})},{batchSize:100})];case 1:return n=s.sent(),o=n.data.filter(function(e){return e.success}).length,i=n.data.filter(function(e){return!e.success}).length,[2,{results:n.data,summary:{total:e.length,succeeded:o,failed:i}}]}})})}function yn(e,t){return h(this,arguments,void 0,function(e,t,r,n){var o,i,a,s,c,u,l,h,p;return void 0===r&&(r={}),f(this,function(f){switch(f.label){case 0:return o=function(t){return zr(n,"/v2/project/files/orphaned",{body:{branchId:e,fileIds:t},timeout:r.timeout})},0===t.length?[2,o([])]:(i=$r(t,100),[4,Promise.all(i.map(function(e){return o(e)}))]);case 1:if(1===(a=f.sent()).length)return[2,a[0]];for(s=new Map,c=0,u=a[0].orphanedFiles;c<u.length;c++)l=u[c],s.set(l.fileId,l);for(h=function(e){var t=new Set(a[e].orphanedFiles.map(function(e){return e.fileId}));Array.from(s.keys()).forEach(function(e){t.has(e)||s.delete(e)})},p=1;p<a.length;p++)h(p);return[2,{orphanedFiles:Array.from(s.values())}]}})})}function bn(e,t){return h(this,void 0,void 0,function(){return f(this,function(r){switch(r.label){case 0:return[4,zr(t,"/v2/project/files/publish",{body:{files:e}})];case 1:return[2,r.sent()]}})})}var _n=function(){function e(e){var t,r,n;void 0===e&&(e={}),this._renderingLocales=[],"undefined"!=typeof process&&(this.apiKey||(this.apiKey=null===(t=process.env)||void 0===t?void 0:t.GT_API_KEY),this.devApiKey||(this.devApiKey=null===(r=process.env)||void 0===r?void 0:r.GT_DEV_API_KEY),this.projectId||(this.projectId=null===(n=process.env)||void 0===n?void 0:n.GT_PROJECT_ID)),this.setConfig(e)}return e.prototype.setConfig=function(e){var t=e.apiKey,r=e.devApiKey,n=e.sourceLocale,o=e.targetLocale,i=e.locales,a=e.projectId,s=e.customMapping,c=e.baseUrl;if(t&&(this.apiKey=t),r&&(this.devApiKey=r),a&&(this.projectId=a),n&&(this.sourceLocale=He(n),!Pe(this.sourceLocale,s)))throw new Error(Gr(this.sourceLocale));if(o&&(this.targetLocale=He(o),!Pe(this.targetLocale,s)))throw new Error(Gr(this.targetLocale));if(this._renderingLocales=[],this.sourceLocale&&this._renderingLocales.push(this.sourceLocale),this.targetLocale&&this._renderingLocales.push(this.targetLocale),this._renderingLocales.push(K),i){var u=[],l=[];if(i.forEach(function(e){var t=He(e);Pe(t)?u.push(t):l.push(e)}),l.length>0)throw new Error(function(e){return"".concat(Mr," Invalid locales: ").concat(e.join(", "),".")}(l));this.locales=u}c&&(this.baseUrl=c),s&&(this.customMapping=s,this.reverseCustomMapping=Object.fromEntries(Object.entries(s).filter(function(e){var t=e[1];return t&&"object"==typeof t&&"code"in t}).map(function(e){var t=e[0];return[e[1].code,t]})))},e.prototype._getTranslationConfig=function(){return{baseUrl:this.baseUrl,apiKey:this.apiKey||this.devApiKey,projectId:this.projectId||""}},e.prototype._validateAuth=function(e){var t=[];if(!this.apiKey&&!this.devApiKey){var r=function(e){return"".concat(Mr," Cannot call `").concat(e,"` without a specified API key. Either pass an API key to the `").concat(e,"` function or specify an apiKey in the GT constructor.")}(e);t.push(r)}if(!this.projectId){r=function(e){return"".concat(Mr," Cannot call `").concat(e,"` without a specified project ID. Either pass a project ID to the `").concat(e,"` function or specify a projectId in the GT constructor.")}(e);t.push(r)}if(t.length)throw new Error(t.join("\n"))},e.prototype.queryBranchData=function(e){return h(this,void 0,void 0,function(){return f(this,function(t){switch(t.label){case 0:return this._validateAuth("queryBranchData"),[4,mn(e,this._getTranslationConfig())];case 1:return[2,t.sent()]}})})},e.prototype.createBranch=function(e){return h(this,void 0,void 0,function(){return f(this,function(t){switch(t.label){case 0:return this._validateAuth("createBranch"),[4,gn(e,this._getTranslationConfig())];case 1:return[2,t.sent()]}})})},e.prototype.processFileMoves=function(e){return h(this,arguments,void 0,function(e,t){return void 0===t&&(t={}),f(this,function(r){switch(r.label){case 0:return this._validateAuth("processFileMoves"),[4,En(e,t,this._getTranslationConfig())];case 1:return[2,r.sent()]}})})},e.prototype.getOrphanedFiles=function(e,t){return h(this,arguments,void 0,function(e,t,r){return void 0===r&&(r={}),f(this,function(n){switch(n.label){case 0:return this._validateAuth("getOrphanedFiles"),[4,yn(e,t,r,this._getTranslationConfig())];case 1:return[2,n.sent()]}})})},e.prototype.setupProject=function(e,t){return h(this,void 0,void 0,function(){var n,o=this;return f(this,function(i){switch(i.label){case 0:return this._validateAuth("setupProject"),t=r(r({},t),{locales:null===(n=null==t?void 0:t.locales)||void 0===n?void 0:n.map(function(e){return o.resolveCanonicalLocale(e)})}),[4,Qr(e,this._getTranslationConfig(),t)];case 1:return[2,i.sent()]}})})},e.prototype.checkJobStatus=function(e,t){return h(this,void 0,void 0,function(){return f(this,function(r){switch(r.label){case 0:return this._validateAuth("checkJobStatus"),[4,pn(e,this._getTranslationConfig(),t)];case 1:return[2,r.sent()]}})})},e.prototype.awaitJobs=function(e,t){return h(this,void 0,void 0,function(){return f(this,function(r){switch(r.label){case 0:return this._validateAuth("awaitJobs"),[4,dn(e,t,this._getTranslationConfig())];case 1:return[2,r.sent()]}})})},e.prototype.enqueueFiles=function(e,t){return h(this,void 0,void 0,function(){var n,o,i,a,s=this;return f(this,function(c){switch(c.label){case 0:if(this._validateAuth("enqueueFiles"),!(n=r(r({},t),{sourceLocale:null!==(i=t.sourceLocale)&&void 0!==i?i:this.sourceLocale,targetLocales:null!==(a=t.targetLocales)&&void 0!==a?a:[this.targetLocale]})).sourceLocale)throw o=Ur("enqueueFiles"),Ar.error(o),new Error(o);if(!n.targetLocales||0===n.targetLocales.length)throw o=Or("enqueueFiles"),Ar.error(o),new Error(o);return n=r(r({},n),{targetLocales:n.targetLocales.map(function(e){return s.resolveCanonicalLocale(e)})}),[4,tn(e,n,this._getTranslationConfig())];case 1:return[2,c.sent()]}})})},e.prototype.createTag=function(e){return h(this,void 0,void 0,function(){return f(this,function(t){switch(t.label){case 0:return this._validateAuth("createTag"),[4,rn(e,this._getTranslationConfig())];case 1:return[2,t.sent()]}})})},e.prototype.publishFiles=function(e){return h(this,void 0,void 0,function(){return f(this,function(t){switch(t.label){case 0:return this._validateAuth("publishFiles"),[4,bn(e,this._getTranslationConfig())];case 1:return[2,t.sent()]}})})},e.prototype.submitUserEditDiffs=function(e){return h(this,void 0,void 0,function(){var t=this;return f(this,function(n){switch(n.label){case 0:return this._validateAuth("submitUserEditDiffs"),[4,on(r(r({},e),{diffs:(e.diffs||[]).map(function(e){return r(r({},e),{locale:t.resolveCanonicalLocale(e.locale)})})}),this._getTranslationConfig())];case 1:return n.sent(),[2]}})})},e.prototype.queryFileData=function(e){return h(this,arguments,void 0,function(e,t){var n,o,i,a,s=this;return void 0===t&&(t={}),f(this,function(c){switch(c.label){case 0:return this._validateAuth("queryFileData"),e.translatedFiles=null===(o=e.translatedFiles)||void 0===o?void 0:o.map(function(e){return r(r({},e),{locale:s.resolveCanonicalLocale(e.locale)})}),[4,vn(e,t,this._getTranslationConfig())];case 1:return(n=c.sent()).translatedFiles=null===(i=n.translatedFiles)||void 0===i?void 0:i.map(function(e){return r(r({},e),e.locale&&{locale:s.resolveAliasLocale(e.locale)})}),n.sourceFiles=null===(a=n.sourceFiles)||void 0===a?void 0:a.map(function(e){return r(r(r({},e),e.sourceLocale&&{sourceLocale:s.resolveAliasLocale(e.sourceLocale)}),{locales:e.locales.map(function(e){return s.resolveAliasLocale(e)})})}),[2,n]}})})},e.prototype.querySourceFile=function(e){return h(this,arguments,void 0,function(e,t){var n,o=this;return void 0===t&&(t={}),f(this,function(i){switch(i.label){case 0:return this._validateAuth("querySourceFile"),[4,hn(e,t,this._getTranslationConfig())];case 1:return(n=i.sent()).translations=n.translations.map(function(e){return r(r({},e),e.locale&&{locale:o.resolveAliasLocale(e.locale)})}),n.sourceFile.locales=n.sourceFile.locales.map(function(e){return o.resolveAliasLocale(e)}),n.sourceFile.sourceLocale&&(n.sourceFile.sourceLocale=this.resolveAliasLocale(n.sourceFile.sourceLocale)),[2,n]}})})},e.prototype.getProjectData=function(e){return h(this,arguments,void 0,function(e,t){var r,n=this;return void 0===t&&(t={}),f(this,function(o){switch(o.label){case 0:return this._validateAuth("getProjectData"),[4,fn(e,t,this._getTranslationConfig())];case 1:return(r=o.sent()).currentLocales=r.currentLocales.map(function(e){return n.resolveAliasLocale(e)}),r.defaultLocale=this.resolveAliasLocale(r.defaultLocale),[2,r]}})})},e.prototype.downloadFile=function(e){return h(this,arguments,void 0,function(e,t){var r,n,o,i;return void 0===t&&(t={}),f(this,function(a){switch(a.label){case 0:return this._validateAuth("downloadTranslatedFile"),[4,nn([{fileId:e.fileId,branchId:e.branchId,locale:e.locale?this.resolveCanonicalLocale(e.locale):void 0,versionId:e.versionId,useLatestAvailableVersion:e.useLatestAvailableVersion}],t,this._getTranslationConfig())];case 1:return r=a.sent(),[2,null!==(i=null===(o=null===(n=r.data)||void 0===n?void 0:n[0])||void 0===o?void 0:o.data)&&void 0!==i?i:""]}})})},e.prototype.downloadFileBatch=function(e){return h(this,arguments,void 0,function(e,t){var n,o=this;return void 0===t&&(t={}),f(this,function(i){switch(i.label){case 0:return this._validateAuth("downloadFileBatch"),[4,nn(e=e.map(function(e){return r(r({},e),{locale:e.locale?o.resolveCanonicalLocale(e.locale):void 0})}),t,this._getTranslationConfig())];case 1:return[2,{files:(n=i.sent()).data.map(function(e){return r(r({},e),e.locale&&{locale:o.resolveAliasLocale(e.locale)})}),count:n.count}]}})})},e.prototype.translate=function(e,t,n){return h(this,void 0,void 0,function(){var o,i,a;return f(this,function(s){switch(s.label){case 0:if("string"==typeof t&&(t={targetLocale:t}),this._validateAuth("translate"),!(o=(null==t?void 0:t.targetLocale)||this.targetLocale))throw i=Or("translate"),Ar.error(i),new Error(i);return o=this.resolveCanonicalLocale(o),a=this.resolveCanonicalLocale((null==t?void 0:t.sourceLocale)||this.sourceLocale||K),[4,Jr([e],r(r({},t),{targetLocale:o,sourceLocale:a}),this._getTranslationConfig(),n)];case 1:return[2,s.sent()[0]]}})})},e.prototype.translateMany=function(e,t,n){return h(this,void 0,void 0,function(){var o,i,a;return f(this,function(s){switch(s.label){case 0:if("string"==typeof t&&(t={targetLocale:t}),this._validateAuth("translateMany"),!(o=(null==t?void 0:t.targetLocale)||this.targetLocale))throw i=Or("translateMany"),Ar.error(i),new Error(i);return o=this.resolveCanonicalLocale(o),a=this.resolveCanonicalLocale((null==t?void 0:t.sourceLocale)||this.sourceLocale||K),[4,Jr(e,r(r({},t),{targetLocale:o,sourceLocale:a}),this._getTranslationConfig(),n)];case 1:return[2,s.sent()]}})})},e.prototype.uploadSourceFiles=function(e,t){return h(this,void 0,void 0,function(){var n,o,i,a,s=this;return f(this,function(c){switch(c.label){case 0:return this._validateAuth("uploadSourceFiles"),n=r(r({},t),{sourceLocale:this.resolveCanonicalLocale(null!==(a=null!==(i=t.sourceLocale)&&void 0!==i?i:this.sourceLocale)&&void 0!==a?a:K)}),[4,un(e=e.map(function(e){return r(r({},e),{source:r(r({},e.source),{locale:s.resolveCanonicalLocale(e.source.locale)})})}),n,this._getTranslationConfig())];case 1:return[2,{uploadedFiles:(o=c.sent()).data,count:o.count,message:"Successfully uploaded ".concat(o.count," files in ").concat(o.batchCount," batch(es)")}]}})})},e.prototype.uploadTranslations=function(e,t){return h(this,void 0,void 0,function(){var n,o,i,a,s=this;return f(this,function(c){switch(c.label){case 0:if(this._validateAuth("uploadTranslations"),!(n=r(r({},t),{sourceLocale:null!==(a=t.sourceLocale)&&void 0!==a?a:this.sourceLocale})).sourceLocale)throw o=Ur("uploadTranslations"),Ar.error(o),new Error(o);return[4,ln(e.map(function(e){return r(r({},e),{translations:e.translations.map(function(e){return r(r({},e),{locale:s.resolveCanonicalLocale(e.locale)})})})}),n,this._getTranslationConfig())];case 1:return[2,{uploadedFiles:(i=c.sent()).data,count:i.count,message:"Successfully uploaded ".concat(i.count," files in ").concat(i.batchCount," batch(es)")}]}})})},e.prototype.formatCutoff=function(e,t){return Tn(e,r({locales:this._renderingLocales},t))},e.prototype.formatMessage=function(e,t){return Ln(e,r({locales:this._renderingLocales},t))},e.prototype.formatNum=function(e,t){return An(e,r({locales:this._renderingLocales},t))},e.prototype.formatDateTime=function(e,t){return In(e,r({locales:this._renderingLocales},t))},e.prototype.formatCurrency=function(e,t,n){return Sn(e,t,r({locales:this._renderingLocales},n))},e.prototype.formatList=function(e,t){return Ir({value:e,locales:(null==t?void 0:t.locales)||this._renderingLocales,options:t})},e.prototype.formatListToParts=function(e,t){return Sr({value:e,locales:(null==t?void 0:t.locales)||this._renderingLocales,options:t})},e.prototype.formatRelativeTime=function(e,t,n){return Nn(e,t,r({locales:this._renderingLocales},n))},e.prototype.formatRelativeTimeFromDate=function(e,t){return Cn(e,r({locales:this._renderingLocales},t))},e.prototype.getLocaleName=function(e){if(void 0===e&&(e=this.targetLocale),!e)throw new Error(Or("getLocaleName"));return wr(e,this.sourceLocale,this.customMapping)},e.prototype.getLocaleEmoji=function(e){if(void 0===e&&(e=this.targetLocale),!e)throw new Error(Or("getLocaleEmoji"));return wn(e,this.customMapping)},e.prototype.getLocaleProperties=function(e){if(void 0===e&&(e=this.targetLocale),!e)throw new Error(Or("getLocaleProperties"));return Pn(e,this.sourceLocale,this.customMapping)},e.prototype.getRegionProperties=function(e,t){if(void 0===e&&(e=this.getLocaleProperties().regionCode),!t){if(this.customMapping&&!this.customRegionMapping){for(var n={},o=0,i=Object.entries(this.customMapping);o<i.length;o++){var a=i[o],s=a[0],c=a[1];if(c&&"object"==typeof c&&c.regionCode&&!n[c.regionCode]){var u=c.regionName,l=c.emoji;n[c.regionCode]=r(r({locale:s},u&&{name:u}),l&&{emoji:l})}}this.customRegionMapping=n}t=this.customRegionMapping}return an(e,this.targetLocale,t)},e.prototype.requiresTranslation=function(e,t,r,n){if(void 0===e&&(e=this.sourceLocale),void 0===t&&(t=this.targetLocale),void 0===r&&(r=this.locales),void 0===n&&(n=this.customMapping),!e)throw new Error(Ur("requiresTranslation"));if(!t)throw new Error(Or("requiresTranslation"));return Oe(e,t,r,n)},e.prototype.determineLocale=function(e,t,r){return void 0===t&&(t=this.locales||[]),void 0===r&&(r=this.customMapping),Xe(e,t,r)},e.prototype.getLocaleDirection=function(e){if(void 0===e&&(e=this.targetLocale),!e)throw new Error(Or("getLocaleDirection"));return Hn(e)},e.prototype.isValidLocale=function(e,t){if(void 0===e&&(e=this.targetLocale),void 0===t&&(t=this.customMapping),!e)throw new Error(Or("isValidLocale"));return Bn(e,t)},e.prototype.resolveCanonicalLocale=function(e,t){if(void 0===e&&(e=this.targetLocale),void 0===t&&(t=this.customMapping),!e)throw new Error(Or("resolveCanonicalLocale"));return cn(e,t)},e.prototype.resolveAliasLocale=function(e,t){if(void 0===t&&(t=this.customMapping),!e)throw new Error(Or("resolveAliasLocale"));return sn(e,t)},e.prototype.standardizeLocale=function(e){if(void 0===e&&(e=this.targetLocale),!e)throw new Error(Or("standardizeLocale"));return He(e)},e.prototype.isSameDialect=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Mn.apply(void 0,e)},e.prototype.isSameLanguage=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Re.apply(void 0,e)},e.prototype.isSupersetLocale=function(e,t){return Rn(e,t)},e}();function Tn(e,t){return function(e){var t=e.value,r=e.locales,n=void 0===r?K:r,o=e.options,i=void 0===o?{}:o;return Q.get("CutoffFormat",n,i).format(t)}({value:e,locales:null==t?void 0:t.locales,options:t})}function Ln(e,t){return"STRING"===(null==t?void 0:t.dataFormat)?e:function(e,t,r){var n,o;return void 0===t&&(t=K),void 0===r&&(r={}),null!==(o=null===(n=new vr(e,t).format(r))||void 0===n?void 0:n.toString())&&void 0!==o?o:""}(e,null==t?void 0:t.locales,null==t?void 0:t.variables)}function An(e,t){return function(e){var t=e.value,n=e.locales,o=void 0===n?[K]:n,i=e.options,a=void 0===i?{}:i;return Q.get("NumberFormat",o,r({numberingSystem:"latn"},a)).format(t)}({value:e,locales:t.locales,options:t})}function In(e,t){return function(e){var t=e.value,n=e.locales,o=void 0===n?[K]:n,i=e.options,a=void 0===i?{}:i;return Q.get("DateTimeFormat",o,r({calendar:"gregory",numberingSystem:"latn"},a)).format(t)}({value:e,locales:null==t?void 0:t.locales,options:t})}function Sn(e,t,n){return function(e){var t=e.value,n=e.locales,o=void 0===n?[K]:n,i=e.currency,a=void 0===i?"USD":i,s=e.options,c=void 0===s?{}:s;return Q.get("NumberFormat",o,r({style:"currency",currency:a,numberingSystem:"latn"},c)).format(t)}({value:e,currency:t,locales:n.locales,options:n})}function Nn(e,t,r){return Cr({value:e,unit:t,locales:r.locales,options:r})}function Cn(e,t){var r=t.locales,o=t.baseDate,i=n(t,["locales","baseDate"]);return Nr({date:e,baseDate:null!=o?o:new Date,locales:r,options:i})}function wn(e,t){return De(e,t)}function Pn(e,t,r){return Ke(e,t,r)}function Hn(e){return Pr(e)}function Bn(e,t){return Pe(e,t)}function Mn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Me.apply(void 0,e)}function Rn(e,t){return function(e,t){try{var r=Q.get("Locale",He(e)),n=r.language,o=r.region,i=r.script,a=Q.get("Locale",He(t)),s=a.language,c=a.region,u=a.script;return!(n!==s||o&&o!==c||i&&i!==u)}catch(e){return console.error(e),!1}}(e,t)}var On=kr;exports.API_VERSION=On,exports.GT=_n,exports.determineLocale=function(e,t,r){return void 0===t&&(t=[]),void 0===r&&(r=void 0),Xe(e,t,r)},exports.formatCurrency=Sn,exports.formatCutoff=Tn,exports.formatDateTime=In,exports.formatList=function(e,t){return Ir({value:e,locales:t.locales,options:t})},exports.formatListToParts=function(e,t){return Sr({value:e,locales:null==t?void 0:t.locales,options:t})},exports.formatMessage=Ln,exports.formatNum=An,exports.formatRelativeTime=Nn,exports.formatRelativeTimeFromDate=Cn,exports.getLocaleDirection=Hn,exports.getLocaleEmoji=wn,exports.getLocaleName=function(e,t,r){return wr(e,t,r)},exports.getLocaleProperties=Pn,exports.getRegionProperties=function(e,t,r){return an(e,t,r)},exports.isSameDialect=Mn,exports.isSameLanguage=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Re.apply(void 0,e)},exports.isSupersetLocale=Rn,exports.isValidLocale=Bn,exports.requiresTranslation=function(e,t,r,n){return Oe(e,t,r,n)},exports.resolveAliasLocale=function(e,t){return sn(e,t)},exports.resolveCanonicalLocale=function(e,t){return cn(e,t)},exports.standardizeLocale=function(e){return He(e)};
|
|
2
|
-
//# sourceMappingURL=index.cjs.min.cjs.map
|