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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.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","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../src/settings/settings.ts","../src/formatting/custom-formats/CutoffFormat/constants.ts","../src/formatting/custom-formats/CutoffFormat/CutoffFormat.ts","../src/errors/formattingErrors.ts","../src/cache/IntlCache.ts","../src/settings/settingsUrls.ts","../src/utils/base64.ts","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/types.js","../src/utils/stableStringify.ts","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.4/node_modules/@formatjs/icu-messageformat-parser/printer.js","../src/locales/isValidLocale.ts","../src/locales/isSameDialect.ts","../src/locales/isSameLanguage.ts","../src/locales/requiresTranslation.ts","../src/locales/customLocaleMapping.ts","../src/locales/getLocaleEmoji.ts","../src/locales/getLocaleProperties.ts","../src/locales/determineLocale.ts","../../../node_modules/.pnpm/@formatjs+fast-memoize@2.2.7/node_modules/@formatjs/fast-memoize/lib/index.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.2/node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.2/node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.2/node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.14/node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.14/node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../../../node_modules/.pnpm/@formatjs+icu-skeleton-parser@1.8.14/node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.2/node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.2/node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.2/node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../../../node_modules/.pnpm/intl-messageformat@10.7.16/node_modules/intl-messageformat/lib/src/error.js","../../../node_modules/.pnpm/@formatjs+icu-messageformat-parser@2.11.2/node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../../../node_modules/.pnpm/intl-messageformat@10.7.16/node_modules/intl-messageformat/lib/src/formatters.js","../../../node_modules/.pnpm/intl-messageformat@10.7.16/node_modules/intl-messageformat/lib/src/core.js","../src/logging/logger.ts","../src/formatting/format.ts","../src/locales/getLocaleName.ts","../src/locales/getLocaleDirection.ts","../src/logging/errors.ts","../src/translate/utils/fetchWithTimeout.ts","../src/errors/ApiError.ts","../src/translate/utils/validateResponse.ts","../src/translate/utils/handleFetchError.ts","../src/translate/api.ts","../src/translate/utils/generateRequestHeaders.ts","../src/translate/utils/apiRequest.ts","../src/id/hashSource.ts","../src/utils/isVariable.ts","../src/translate/translateMany.ts","../src/translate/setupProject.ts","../src/translate/utils/batch.ts","../src/translate/enqueueFiles.ts","../src/translate/createTag.ts","../src/translate/downloadFileBatch.ts","../src/translate/submitUserEditDiffs.ts","../src/locales/getRegionProperties.ts","../src/locales/resolveAliasLocale.ts","../src/locales/resolveCanonicalLocale.ts","../src/translate/uploadSourceFiles.ts","../src/translate/uploadTranslations.ts","../src/translate/querySourceFile.ts","../src/projects/getProjectData.ts","../src/translate/checkJobStatus.ts","../src/translate/awaitJobs.ts","../src/translate/queryFileData.ts","../src/translate/queryBranchData.ts","../src/translate/createBranch.ts","../src/translate/processFileMoves.ts","../src/translate/getOrphanedFiles.ts","../src/translate/publishFiles.ts","../src/index.ts","../src/locales/isSupersetLocale.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","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `<bold!>foo</bold!>) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo</123>`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith && '_a'.startsWith('a', 1);\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"</\" tagName (whitespace)* \">\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('</')) {\n if (this.isEOF() || !_isAlpha(this.char())) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n var closingTagNameStartPosition = this.clonePosition();\n var closingTagName = this.parseTagName();\n if (tagName !== closingTagName) {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (!this.bumpIf('>')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","export const libraryDefaultLocale = 'en' as const;\nexport const defaultTimeout = 60000;\n","import { CutoffFormatStyle, ResolvedTerminatorOptions } from './types';\n\nexport const DEFAULT_CUTOFF_FORMAT_STYLE: CutoffFormatStyle = 'ellipsis';\n\nexport const DEFAULT_TERMINATOR_KEY = 'DEFAULT_TERMINATOR_KEY';\n\nexport const TERMINATOR_MAP: Record<\n CutoffFormatStyle,\n Record<string | typeof DEFAULT_TERMINATOR_KEY, ResolvedTerminatorOptions>\n> = {\n ellipsis: {\n fr: {\n terminator: '…',\n separator: '\\u202F',\n },\n zh: {\n terminator: '……',\n separator: undefined,\n },\n ja: {\n terminator: '……',\n separator: undefined,\n },\n [DEFAULT_TERMINATOR_KEY]: {\n terminator: '…',\n separator: undefined,\n },\n },\n none: {\n [DEFAULT_TERMINATOR_KEY]: {\n terminator: undefined,\n separator: undefined,\n },\n },\n};\n","import { createInvalidCutoffStyleError } from '../../../errors/formattingErrors';\nimport { libraryDefaultLocale } from '../../../settings/settings';\nimport {\n DEFAULT_CUTOFF_FORMAT_STYLE,\n DEFAULT_TERMINATOR_KEY,\n TERMINATOR_MAP,\n} from './constants';\nimport {\n CutoffFormat,\n CutoffFormatOptions,\n CutoffFormatStyle,\n PostpendedCutoffParts,\n PrependedCutoffParts,\n ResolvedCutoffFormatOptions,\n ResolvedTerminatorOptions,\n} from './types';\n\nexport class CutoffFormatConstructor implements CutoffFormat {\n private locale: string;\n private options: ResolvedCutoffFormatOptions;\n private additionLength: number;\n /**\n * Constructor\n * @param {string | string[]} locales - The locales to use for formatting.\n * @param {CutoffFormatOptions} options - The options for formatting.\n * @param {number} [option.maxChars] - The maximum number of characters to display.\n * - Undefined values are treated as no cutoff.\n * - Negative values follow .slice() behavior and terminator will be added before the value.\n * - 0 will result in an empty string.\n * - If cutoff results in an empty string, no terminator is added.\n * @param {CutoffFormatStyle} [option.style='ellipsis'] - The style of the terminator.\n * @param {string} [option.terminator] - Optional override the terminator to use.\n * @param {string} [option.separator] - Optional override the separator to use between the terminator and the value.\n * - If no terminator is provided, then separator is ignored.\n *\n * @example\n * const format = new CutoffFormat('en', { maxChars: 5 });\n * format.format('Hello, world!'); // 'Hello...'\n *\n * const format = new CutoffFormat('en', { maxChars: -3 });\n * format.format('Hello, world!'); // '...ld!'\n */\n constructor(\n locales: Intl.LocalesArgument,\n options: CutoffFormatOptions = {}\n ) {\n // Determine locale (this replicates Intl.NumberFormat behavior including silent failure)\n try {\n // Normalize locales to string\n const localesList = !locales\n ? [libraryDefaultLocale]\n : Array.isArray(locales)\n ? locales.map((l) => String(l))\n : [String(locales)];\n const canonicalLocales = Intl.getCanonicalLocales(localesList);\n this.locale = canonicalLocales.length\n ? canonicalLocales[0]\n : libraryDefaultLocale;\n } catch {\n this.locale = libraryDefaultLocale;\n }\n\n // Follows Intl.NumberFormat behavior of throwing an error when currency is invalid\n if (!TERMINATOR_MAP[options.style ?? DEFAULT_CUTOFF_FORMAT_STYLE]) {\n throw new Error(\n createInvalidCutoffStyleError(\n options.style ?? DEFAULT_CUTOFF_FORMAT_STYLE\n )\n );\n }\n\n // Resolve terminator options\n let style: CutoffFormatStyle | undefined;\n let presetTerminatorOptions: ResolvedTerminatorOptions | undefined;\n if (options.maxChars !== undefined) {\n style = options.style ?? DEFAULT_CUTOFF_FORMAT_STYLE;\n // TODO: need more sophisticated locale negotiation if we want to add support for region/script/etc.-specific terminators in the future\n const languageCode = new Intl.Locale(this.locale).language;\n presetTerminatorOptions =\n TERMINATOR_MAP[style][languageCode] ||\n TERMINATOR_MAP[style][DEFAULT_TERMINATOR_KEY];\n }\n let terminator: ResolvedTerminatorOptions['terminator'] =\n options.terminator ?? presetTerminatorOptions?.terminator;\n let separator: ResolvedTerminatorOptions['separator'] =\n terminator != null\n ? (options.separator ?? presetTerminatorOptions?.separator)\n : undefined;\n // // Remove terminator and separator if maxChars does have enough space\n this.additionLength = (terminator?.length ?? 0) + (separator?.length ?? 0);\n if (\n options.maxChars !== undefined &&\n Math.abs(options.maxChars) < this.additionLength\n ) {\n terminator = undefined;\n separator = undefined;\n }\n\n this.options = {\n maxChars: options.maxChars,\n style,\n terminator,\n separator,\n };\n }\n\n /**\n * Format a value according to the cutoff options, returning a formatted string.\n *\n * @param {string} value - The string value to format with cutoff behavior.\n * @returns {string} The formatted string with terminator applied if cutoff occurs.\n *\n * @example\n * const formatter = new CutoffFormatConstructor('en', { maxChars: 8, style: 'ellipsis' });\n * formatter.format('Hello, world!'); // Returns 'Hello, w...'\n */\n format(value: string): string {\n return this.formatToParts(value).join('');\n }\n\n /**\n * Format a value to parts according to the cutoff options, returning an array of string parts.\n * This method breaks down the formatted result into individual components for more granular control.\n *\n * @param {string} value - The string value to format with cutoff behavior.\n * @returns {PrependedCutoffParts | PostpendedCutoffParts} An array of string parts representing the formatted result.\n * - For positive maxChars: [cutoffValue, separator?, terminator?]\n * - For negative maxChars: [terminator?, separator?, cutoffValue]\n * - For no cutoff: [originalValue]\n *\n * @example\n * const formatter = new CutoffFormatConstructor('en', { maxChars: 5, style: 'ellipsis' });\n * formatter.formatToParts('Hello, world!'); // Returns ['Hello', '...']\n */\n formatToParts(value: string): PrependedCutoffParts | PostpendedCutoffParts {\n const { maxChars, terminator, separator } = this.options;\n\n // Slice our value\n // const additionLength = (terminator?.length ?? 0) + (separator?.length ?? 0);\n const adjustedChars =\n maxChars === undefined || Math.abs(maxChars) >= value.length\n ? maxChars\n : maxChars >= 0\n ? Math.max(0, maxChars - this.additionLength)\n : Math.min(0, maxChars + this.additionLength);\n const slicedValue =\n adjustedChars !== undefined && adjustedChars > -1\n ? value.slice(0, adjustedChars)\n : value.slice(adjustedChars);\n\n // No cutoff, no terminator -> value only\n if (\n maxChars == null ||\n adjustedChars == null ||\n adjustedChars === 0 ||\n terminator == null ||\n value.length <= Math.abs(maxChars)\n ) {\n return [slicedValue];\n }\n\n // Postpended cutoff\n if (adjustedChars > 0) {\n return separator != null\n ? [slicedValue, separator, terminator]\n : [slicedValue, terminator];\n }\n // Prepended cutoff\n else {\n return separator != null\n ? [terminator, separator, slicedValue]\n : [terminator, slicedValue];\n }\n }\n\n /**\n * Get the resolved options\n * @returns {ResolvedCutoffFormatOptions} The resolved options.\n */\n resolvedOptions(): ResolvedCutoffFormatOptions {\n return this.options;\n }\n}\n","export const createInvalidCutoffStyleError = (style: string) =>\n `generaltranslation Formatting Error: Invalid cutoff style: ${style}.`;\n","import { libraryDefaultLocale } from '../settings/settings';\nimport { CutoffFormatConstructor } from '../formatting/custom-formats/CutoffFormat/CutoffFormat';\nimport {\n ConstructorType,\n CustomIntlConstructors,\n CustomIntlType,\n IntlCacheObject,\n} from './types';\n\n/**\n * Object mapping constructor names to their respective constructor functions\n * Includes all native Intl constructors plus custom ones like CutoffFormat\n */\nconst CustomIntl: CustomIntlType = {\n Collator: Intl.Collator,\n DateTimeFormat: Intl.DateTimeFormat,\n DisplayNames: Intl.DisplayNames,\n ListFormat: Intl.ListFormat,\n Locale: Intl.Locale,\n NumberFormat: Intl.NumberFormat,\n PluralRules: Intl.PluralRules,\n RelativeTimeFormat: Intl.RelativeTimeFormat,\n Segmenter: Intl.Segmenter,\n CutoffFormat: CutoffFormatConstructor,\n};\n\n/**\n * Cache for Intl and custom format instances to avoid repeated instantiation\n * Uses a two-level structure: constructor name -> cache key -> instance\n */\nclass IntlCache {\n private cache: IntlCacheObject;\n\n constructor() {\n this.cache = {};\n }\n\n /**\n * Generates a consistent cache key from locales and options\n * Handles all LocalesArgument types (string, Locale, array, undefined)\n */\n private _generateKey(locales: Intl.LocalesArgument, options = {}) {\n // Normalize locales to string representation\n const localeKey = !locales\n ? 'undefined'\n : Array.isArray(locales)\n ? locales.map((l) => String(l)).join(',')\n : String(locales);\n\n // Sort option keys to ensure consistent key generation regardless of property order\n const sortedOptions = options\n ? JSON.stringify(options, Object.keys(options).sort())\n : '{}';\n return `${localeKey}:${sortedOptions}`;\n }\n\n /**\n * Gets a cached Intl instance or creates a new one if not found\n * @param constructor The name of the Intl constructor to use\n * @param args Constructor arguments (locales, options)\n * @returns Cached or newly created Intl instance\n */\n get<K extends keyof CustomIntlConstructors>(\n constructor: K,\n ...args: ConstructorParameters<CustomIntlConstructors[K]>\n ): InstanceType<ConstructorType<K>> {\n const [locales = libraryDefaultLocale, options = {}] = args;\n const key = this._generateKey(locales, options);\n let intlObject = this.cache[constructor]?.[key];\n\n if (intlObject === undefined) {\n // Create new instance and cache it\n intlObject = new CustomIntl[constructor](...args);\n if (!this.cache[constructor]) this.cache[constructor] = {};\n this.cache[constructor][key] = intlObject;\n }\n\n return intlObject;\n }\n}\n\n/**\n * Global instance of the Intl cache for use throughout the application\n */\nexport const intlCache = new IntlCache();\n","export const defaultCacheUrl = 'https://cdn.gtx.dev' as const;\nexport const defaultBaseUrl = 'https://api2.gtx.dev' as const;\nexport const defaultRuntimeApiUrl = 'https://runtime2.gtx.dev' as const;\n","// Encode a string to base64\nexport function encode(data: string): string {\n if (typeof Buffer !== 'undefined') {\n // Node.js path\n return Buffer.from(data, 'utf8').toString('base64');\n }\n // Browser path\n const bytes = new TextEncoder().encode(data);\n let binary = '';\n for (let i = 0; i < bytes.length; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n\n// Decode a base64 string to a string\nexport function decode(base64: string): string {\n if (typeof Buffer !== 'undefined') {\n // Node.js path\n return Buffer.from(base64, 'base64').toString('utf8');\n }\n // Browser path\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return new TextDecoder().decode(bytes);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SKELETON_TYPE = exports.TYPE = void 0;\nexports.isLiteralElement = isLiteralElement;\nexports.isArgumentElement = isArgumentElement;\nexports.isNumberElement = isNumberElement;\nexports.isDateElement = isDateElement;\nexports.isTimeElement = isTimeElement;\nexports.isSelectElement = isSelectElement;\nexports.isPluralElement = isPluralElement;\nexports.isPoundElement = isPoundElement;\nexports.isTagElement = isTagElement;\nexports.isNumberSkeleton = isNumberSkeleton;\nexports.isDateTimeSkeleton = isDateTimeSkeleton;\nexports.createLiteralElement = createLiteralElement;\nexports.createNumberElement = createNumberElement;\nvar TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (exports.TYPE = TYPE = {}));\nvar SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (exports.SKELETON_TYPE = SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nfunction isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nfunction isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nfunction isNumberElement(el) {\n return el.type === TYPE.number;\n}\nfunction isDateElement(el) {\n return el.type === TYPE.date;\n}\nfunction isTimeElement(el) {\n return el.type === TYPE.time;\n}\nfunction isSelectElement(el) {\n return el.type === TYPE.select;\n}\nfunction isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nfunction isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nfunction isTagElement(el) {\n return el.type === TYPE.tag;\n}\nfunction isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nfunction isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nfunction createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nfunction createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\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","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.printAST = printAST;\nexports.doPrintAST = doPrintAST;\nexports.printDateTimeSkeleton = printDateTimeSkeleton;\nvar tslib_1 = require(\"tslib\");\nvar types_1 = require(\"./types\");\nfunction printAST(ast) {\n return doPrintAST(ast, false);\n}\nfunction doPrintAST(ast, isInPlural) {\n var printedNodes = ast.map(function (el, i) {\n if ((0, types_1.isLiteralElement)(el)) {\n return printLiteralElement(el, isInPlural, i === 0, i === ast.length - 1);\n }\n if ((0, types_1.isArgumentElement)(el)) {\n return printArgumentElement(el);\n }\n if ((0, types_1.isDateElement)(el) || (0, types_1.isTimeElement)(el) || (0, types_1.isNumberElement)(el)) {\n return printSimpleFormatElement(el);\n }\n if ((0, types_1.isPluralElement)(el)) {\n return printPluralElement(el);\n }\n if ((0, types_1.isSelectElement)(el)) {\n return printSelectElement(el);\n }\n if ((0, types_1.isPoundElement)(el)) {\n return '#';\n }\n if ((0, types_1.isTagElement)(el)) {\n return printTagElement(el);\n }\n });\n return printedNodes.join('');\n}\nfunction printTagElement(el) {\n return \"<\".concat(el.value, \">\").concat(printAST(el.children), \"</\").concat(el.value, \">\");\n}\nfunction printEscapedMessage(message) {\n return message.replace(/([{}](?:[\\s\\S]*[{}])?)/, \"'$1'\");\n}\nfunction printLiteralElement(_a, isInPlural, isFirstEl, isLastEl) {\n var value = _a.value;\n var escaped = value;\n // If this literal starts with a ' and its not the 1st node, this means the node before it is non-literal\n // and the `'` needs to be unescaped\n if (!isFirstEl && escaped[0] === \"'\") {\n escaped = \"''\".concat(escaped.slice(1));\n }\n // Same logic but for last el\n if (!isLastEl && escaped[escaped.length - 1] === \"'\") {\n escaped = \"\".concat(escaped.slice(0, escaped.length - 1), \"''\");\n }\n escaped = printEscapedMessage(escaped);\n return isInPlural ? escaped.replace('#', \"'#'\") : escaped;\n}\nfunction printArgumentElement(_a) {\n var value = _a.value;\n return \"{\".concat(value, \"}\");\n}\nfunction printSimpleFormatElement(el) {\n return \"{\".concat(el.value, \", \").concat(types_1.TYPE[el.type]).concat(el.style ? \", \".concat(printArgumentStyle(el.style)) : '', \"}\");\n}\nfunction printNumberSkeletonToken(token) {\n var stem = token.stem, options = token.options;\n return options.length === 0\n ? stem\n : \"\".concat(stem).concat(options.map(function (o) { return \"/\".concat(o); }).join(''));\n}\nfunction printArgumentStyle(style) {\n if (typeof style === 'string') {\n return printEscapedMessage(style);\n }\n else if (style.type === types_1.SKELETON_TYPE.dateTime) {\n return \"::\".concat(printDateTimeSkeleton(style));\n }\n else {\n return \"::\".concat(style.tokens.map(printNumberSkeletonToken).join(' '));\n }\n}\nfunction printDateTimeSkeleton(style) {\n return style.pattern;\n}\nfunction printSelectElement(el) {\n var msg = [\n el.value,\n 'select',\n Object.keys(el.options)\n .map(function (id) { return \"\".concat(id, \"{\").concat(doPrintAST(el.options[id].value, false), \"}\"); })\n .join(' '),\n ].join(',');\n return \"{\".concat(msg, \"}\");\n}\nfunction printPluralElement(el) {\n var type = el.pluralType === 'cardinal' ? 'plural' : 'selectordinal';\n var msg = [\n el.value,\n type,\n tslib_1.__spreadArray([\n el.offset ? \"offset:\".concat(el.offset) : ''\n ], Object.keys(el.options).map(function (id) { return \"\".concat(id, \"{\").concat(doPrintAST(el.options[id].value, true), \"}\"); }), true).filter(Boolean)\n .join(' '),\n ].join(',');\n return \"{\".concat(msg, \"}\");\n}\n","import { intlCache } from '../cache/IntlCache';\nimport { libraryDefaultLocale } from '../internal';\nimport { CustomMapping } from './customLocaleMapping';\n\nconst scriptExceptions = ['Cham', 'Jamo', 'Kawi', 'Lisu', 'Toto', 'Thai'];\n\n//// According to BCP 47, the range qaa–qtz is reserved for private-use language codes\nconst isCustomLanguage = (language: string) => {\n return language >= 'qaa' && language <= 'qtz';\n};\n\n/**\n * Checks if a given BCP 47 language code is valid.\n * @param {string} code - The BCP 47 language code to validate.\n * @param {CustomMapping} [customMapping] - The custom mapping to use for validation.\n * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n * @internal\n */\nexport const _isValidLocale = (\n locale: string,\n customMapping?: CustomMapping\n): boolean => {\n // If in custom mapping, return true\n if (\n customMapping?.[locale] &&\n typeof customMapping[locale] === 'object' &&\n 'code' in (customMapping[locale] as Object) &&\n (customMapping[locale] as { code: string }).code\n ) {\n locale = (customMapping[locale] as { code: string }).code;\n }\n\n try {\n const { language, region, script } = intlCache.get('Locale', locale);\n if (\n locale.split('-').length !==\n (() => {\n let partCount = 1;\n if (region) partCount += 1;\n if (script) partCount += 1;\n return partCount;\n })()\n )\n return false;\n const displayLanguageNames = intlCache.get(\n 'DisplayNames',\n [libraryDefaultLocale],\n {\n type: 'language',\n }\n );\n if (\n displayLanguageNames.of(language) === language &&\n !isCustomLanguage(language)\n )\n return false;\n if (region) {\n const displayRegionNames = intlCache.get(\n 'DisplayNames',\n [libraryDefaultLocale],\n {\n type: 'region',\n }\n );\n if (displayRegionNames.of(region) === region) return false;\n }\n if (script) {\n const displayScriptNames = intlCache.get(\n 'DisplayNames',\n [libraryDefaultLocale],\n {\n type: 'script',\n }\n );\n if (\n displayScriptNames.of(script) === script &&\n !scriptExceptions.includes(script)\n )\n return false;\n }\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Standardizes a BCP 47 locale to ensure correct formatting.\n * @param {string} locale - The BCP 47 locale to standardize.\n * @returns {string} The standardized BCP 47 locale, or an empty string if invalid.\n * @internal\n */\nexport const _standardizeLocale = (locale: string): string => {\n try {\n return Intl.getCanonicalLocales(locale)[0];\n } catch {\n return locale;\n }\n};\n","import { intlCache } from '../cache/IntlCache';\nimport { _standardizeLocale } from './isValidLocale';\n\nfunction checkTwoLocalesAreSameDialect(codeA: string, codeB: string) {\n const {\n language: languageA,\n region: regionA,\n script: scriptA,\n } = intlCache.get('Locale', codeA);\n const {\n language: languageB,\n region: regionB,\n script: scriptB,\n } = intlCache.get('Locale', codeB);\n if (languageA !== languageB) return false;\n if (regionA && regionB && regionA !== regionB) return false;\n if (scriptA && scriptB && scriptA !== scriptB) return false;\n return true;\n}\n\n/**\n * Test two or more language codes to determine if they are exactly the same\n * e.g. \"en-US\" and \"en\" would be exactly the same.\n * \"en-GB\" and \"en\" would be exactly the same.\n * \"en-GB\" and \"en-US\" would be different.\n * @internal\n */\nexport default function _isSameDialect(\n ...locales: (string | string[])[]\n): boolean {\n try {\n // standardize codes\n const flattenedCodes = locales.flat().map(_standardizeLocale);\n\n for (let i = 0; i < flattenedCodes.length; i++) {\n for (let j = i + 1; j < flattenedCodes.length; j++) {\n if (\n !checkTwoLocalesAreSameDialect(flattenedCodes[i], flattenedCodes[j])\n )\n return false;\n }\n }\n\n return true;\n } catch (error) {\n console.error(error);\n return false;\n }\n}\n","import { intlCache } from '../cache/IntlCache';\n\n/**\n * @internal\n */\nexport default function _isSameLanguage(\n ...locales: (string | string[])[]\n): boolean {\n try {\n const flattenedCodes = locales.flat();\n // Get the language for each code\n const languages = flattenedCodes.map(\n (locale) => intlCache.get('Locale', locale).language\n );\n return languages.every((language) => language === languages[0]);\n } catch (error) {\n console.error(error);\n return false;\n }\n}\n","import { CustomMapping } from './customLocaleMapping';\nimport _isSameDialect from './isSameDialect';\nimport _isSameLanguage from './isSameLanguage';\nimport { _isValidLocale } from './isValidLocale';\n\n/**\n * Given a target locale and a source locale, determines whether a translation is required\n * If the target locale and the source locale are the same, returns false, otherwise returns true\n * If a translation is not possible due to the target locale being outside of the optional approvedLanguages scope, also returns false\n * @internal\n */\nexport default function _requiresTranslation(\n sourceLocale: string,\n targetLocale: string,\n approvedLocales?: string[],\n customMapping?: CustomMapping\n): boolean {\n // If codes are invalid\n if (\n !_isValidLocale(sourceLocale, customMapping) ||\n !_isValidLocale(targetLocale, customMapping) ||\n (approvedLocales &&\n approvedLocales.some(\n (approvedLocale) => !_isValidLocale(approvedLocale, customMapping)\n ))\n ) {\n return false;\n }\n\n // Check if the languages are identical, if so, a translation is not required\n if (_isSameDialect(sourceLocale, targetLocale)) {\n return false;\n }\n\n // Check that the target locale is within the approvedLocales scope, if not, a translation is not required\n // isSameLanguage rather than checkTwoLocalesAreSameDialect so we can show different dialects as a fallback\n if (\n approvedLocales &&\n !approvedLocales.some((approvedLocale) =>\n _isSameLanguage(targetLocale, approvedLocale)\n )\n ) {\n return false;\n }\n // Otherwise, a translation is required!\n return true;\n}\n","import { LocaleProperties } from './getLocaleProperties';\nimport { _isValidLocale } from './isValidLocale';\n\nexport type FullCustomMapping = Record<string, LocaleProperties>;\nexport type CustomMapping = Record<string, string | Partial<LocaleProperties>>;\n\nexport const getCustomProperty = (\n customMapping: CustomMapping,\n locale: string,\n property: keyof LocaleProperties\n): string | undefined => {\n if (customMapping?.[locale]) {\n if (typeof customMapping[locale] === 'string') {\n return property === 'name' ? customMapping[locale] : undefined;\n }\n return customMapping[locale][property];\n }\n return undefined;\n};\n\n/**\n * Checks if a given locale should use the canonical locale.\n * @param locale - The locale to check if it should use the canonical locale\n * @param customMapping - The custom mapping to use for checking if the locale should use the canonical locale\n * @returns True if the locale should use the canonical locale, false otherwise\n */\nexport const shouldUseCanonicalLocale = (\n locale: string,\n customMapping: CustomMapping\n): boolean => {\n return !!(\n customMapping?.[locale] &&\n typeof customMapping[locale] === 'object' &&\n 'code' in (customMapping[locale] as Object) &&\n (customMapping[locale] as { code: string }).code &&\n _isValidLocale((customMapping[locale] as { code: string }).code)\n );\n};\n","import { intlCache } from '../cache/IntlCache';\nimport {\n CustomMapping,\n getCustomProperty,\n shouldUseCanonicalLocale,\n} from './customLocaleMapping';\nimport { _standardizeLocale } from './isValidLocale';\n\n/**\n * @internal\n */\nexport default function _getLocaleEmoji(\n locale: string,\n customMapping?: CustomMapping\n): string {\n // Check for canonical locale\n const aliasedLocale = locale;\n if (customMapping && shouldUseCanonicalLocale(locale, customMapping)) {\n // Override locale with canonical locale\n locale = (customMapping[locale] as { code: string }).code;\n }\n\n try {\n const standardizedLocale = _standardizeLocale(locale);\n const localeObject = intlCache.get('Locale', standardizedLocale);\n const { language, region } = localeObject;\n\n // if a custom mapping is specified, use it\n if (customMapping) {\n for (const l of [aliasedLocale, locale, standardizedLocale, language]) {\n const customEmoji = getCustomProperty(customMapping, l, 'emoji');\n if (customEmoji) return customEmoji;\n }\n }\n\n // if a region is specified, use it!\n if (region && emojis[region]) return emojis[region];\n\n // if not, attempt to extrapolate\n const extrapolated = localeObject.maximize();\n const extrapolatedRegion = extrapolated.region || '';\n\n return (\n exceptions[extrapolated.language] ||\n emojis[extrapolatedRegion] ||\n defaultEmoji\n );\n } catch {\n return defaultEmoji;\n }\n}\n\n// Default language emoji for when none else can be found\nconst europeAfricaGlobe = '🌍';\nconst asiaAustraliaGlobe = '🌏';\nexport const defaultEmoji = europeAfricaGlobe;\n\n// Exceptions to better reflect linguistic and cultural identities\nconst exceptions = {\n ca: europeAfricaGlobe,\n eu: europeAfricaGlobe,\n ku: europeAfricaGlobe,\n bo: asiaAustraliaGlobe,\n ug: asiaAustraliaGlobe,\n gd: '🏴',\n cy: '🏴',\n gv: '🇮🇲',\n grc: '🏺',\n} as Record<string, string>;\n\nexport const emojis = {\n AF: '🇦🇫', // Afghanistan\n AX: '🇦🇽', // Åland Islands\n AL: '🇦🇱', // Albania\n DZ: '🇩🇿', // Algeria\n AS: '🇦🇸', // American Samoa\n AD: '🇦🇩', // Andorra\n AO: '🇦🇴', // Angola\n AI: '🇦🇮', // Anguilla\n AQ: '🇦🇶', // Antarctica\n AG: '🇦🇬', // Antigua and Barbuda\n AR: '🇦🇷', // Argentina\n AM: '🇦🇲', // Armenia\n AW: '🇦🇼', // Aruba\n AU: '🇦🇺', // Australia\n AT: '🇦🇹', // Austria\n AZ: '🇦🇿', // Azerbaijan\n BS: '🇧🇸', // Bahamas\n BH: '🇧🇭', // Bahrain\n BD: '🇧🇩', // Bangladesh\n BB: '🇧🇧', // Barbados\n BY: '🇧🇾', // Belarus\n BE: '🇧🇪', // Belgium\n BZ: '🇧🇿', // Belize\n BJ: '🇧🇯', // Benin\n BM: '🇧🇲', // Bermuda\n BT: '🇧🇹', // Bhutan\n BO: '🇧🇴', // Bolivia\n BQ: '🇧🇶', // Bonaire, Sint Eustatius and Saba\n BA: '🇧🇦', // Bosnia and Herzegovina\n BW: '🇧🇼', // Botswana\n BV: '🇧🇻', // Bouvet Island\n BR: '🇧🇷', // Brazil\n IO: '🇮🇴', // British Indian Ocean Territory\n BN: '🇧🇳', // Brunei Darussalam\n BG: '🇧🇬', // Bulgaria\n BF: '🇧🇫', // Burkina Faso\n BI: '🇧🇮', // Burundi\n CV: '🇨🇻', // Cabo Verde\n KH: '🇰🇭', // Cambodia\n CM: '🇨🇲', // Cameroon\n CA: '🇨🇦', // Canada\n KY: '🇰🇾', // Cayman Islands\n CF: '🇨🇫', // Central African Republic\n TD: '🇹🇩', // Chad\n CL: '🇨🇱', // Chile\n CN: '🇨🇳', // China\n CX: '🇨🇽', // Christmas Island\n CC: '🇨🇨', // Cocos (Keeling) Islands\n CO: '🇨🇴', // Colombia\n KM: '🇰🇲', // Comoros\n CD: '🇨🇩', // Congo (Democratic Republic)\n CG: '🇨🇬', // Congo (Republic)\n CK: '🇨🇰', // Cook Islands\n CR: '🇨🇷', // Costa Rica\n CI: '🇨🇮', // Côte d'Ivoire\n HR: '🇭🇷', // Croatia\n CU: '🇨🇺', // Cuba\n CW: '🇨🇼', // Curaçao\n CY: '🇨🇾', // Cyprus\n CZ: '🇨🇿', // Czechia\n DK: '🇩🇰', // Denmark\n DJ: '🇩🇯', // Djibouti\n DM: '🇩🇲', // Dominica\n DO: '🇩🇴', // Dominican Republic\n EC: '🇪🇨', // Ecuador\n EG: '🇪🇬', // Egypt\n SV: '🇸🇻', // El Salvador\n GQ: '🇬🇶', // Equatorial Guinea\n ER: '🇪🇷', // Eritrea\n EE: '🇪🇪', // Estonia\n SZ: '🇸🇿', // Eswatini\n ET: '🇪🇹', // Ethiopia\n FK: '🇫🇰', // Falkland Islands\n FO: '🇫🇴', // Faroe Islands\n FJ: '🇫🇯', // Fiji\n FI: '🇫🇮', // Finland\n FR: '🇫🇷', // France\n GF: '🇬🇫', // French Guiana\n PF: '🇵🇫', // French Polynesia\n TF: '🇹🇫', // French Southern Territories\n GA: '🇬🇦', // Gabon\n GM: '🇬🇲', // Gambia\n GE: '🇬🇪', // Georgia\n DE: '🇩🇪', // Germany\n GH: '🇬🇭', // Ghana\n GI: '🇬🇮', // Gibraltar\n GR: '🇬🇷', // Greece\n GL: '🇬🇱', // Greenland\n GD: '🇬🇩', // Grenada\n GP: '🇬🇵', // Guadeloupe\n GU: '🇬🇺', // Guam\n GT: '🇬🇹', // Guatemala\n GG: '🇬🇬', // Guernsey\n GN: '🇬🇳', // Guinea\n GW: '🇬🇼', // Guinea-Bissau\n GY: '🇬🇾', // Guyana\n HT: '🇭🇹', // Haiti\n HM: '🇭🇲', // Heard Island and McDonald Islands\n VA: '🇻🇦', // Holy See\n HN: '🇭🇳', // Honduras\n HK: '🇭🇰', // Hong Kong\n HU: '🇭🇺', // Hungary\n IS: '🇮🇸', // Iceland\n IN: '🇮🇳', // India\n ID: '🇮🇩', // Indonesia\n IR: '🇮🇷', // Iran\n IQ: '🇮🇶', // Iraq\n IE: '🇮🇪', // Ireland\n IM: '🇮🇲', // Isle of Man\n IL: '🇮🇱', // Israel\n IT: '🇮🇹', // Italy\n JM: '🇯🇲', // Jamaica\n JP: '🇯🇵', // Japan\n JE: '🇯🇪', // Jersey\n JO: '🇯🇴', // Jordan\n KZ: '🇰🇿', // Kazakhstan\n KE: '🇰🇪', // Kenya\n KI: '🇰🇮', // Kiribati\n KP: '🇰🇵', // Korea (North)\n KR: '🇰🇷', // Korea (South)\n KW: '🇰🇼', // Kuwait\n KG: '🇰🇬', // Kyrgyzstan\n LA: '🇱🇦', // Laos\n LV: '🇱🇻', // Latvia\n LB: '🇱🇧', // Lebanon\n LS: '🇱🇸', // Lesotho\n LR: '🇱🇷', // Liberia\n LY: '🇱🇾', // Libya\n LI: '🇱🇮', // Liechtenstein\n LT: '🇱🇹', // Lithuania\n LU: '🇱🇺', // Luxembourg\n MO: '🇲🇴', // Macao\n MG: '🇲🇬', // Madagascar\n MW: '🇲🇼', // Malawi\n MY: '🇲🇾', // Malaysia\n MV: '🇲🇻', // Maldives\n ML: '🇲🇱', // Mali\n MT: '🇲🇹', // Malta\n MH: '🇲🇭', // Marshall Islands\n MQ: '🇲🇶', // Martinique\n MR: '🇲🇷', // Mauritania\n MU: '🇲🇺', // Mauritius\n YT: '🇾🇹', // Mayotte\n MX: '🇲🇽', // Mexico\n FM: '🇫🇲', // Micronesia\n MD: '🇲🇩', // Moldova\n MC: '🇲🇨', // Monaco\n MN: '🇲🇳', // Mongolia\n ME: '🇲🇪', // Montenegro\n MS: '🇲🇸', // Montserrat\n MA: '🇲🇦', // Morocco\n MZ: '🇲🇿', // Mozambique\n MM: '🇲🇲', // Myanmar\n NA: '🇳🇦', // Namibia\n NR: '🇳🇷', // Nauru\n NP: '🇳🇵', // Nepal\n NL: '🇳🇱', // Netherlands\n NC: '🇳🇨', // New Caledonia\n NZ: '🇳🇿', // New Zealand\n NI: '🇳🇮', // Nicaragua\n NE: '🇳🇪', // Niger\n NG: '🇳🇬', // Nigeria\n NU: '🇳🇺', // Niue\n NF: '🇳🇫', // Norfolk Island\n MK: '🇲🇰', // North Macedonia\n MP: '🇲🇵', // Northern Mariana Islands\n NO: '🇳🇴', // Norway\n OM: '🇴🇲', // Oman\n PK: '🇵🇰', // Pakistan\n PW: '🇵🇼', // Palau\n PS: '🇵🇸', // Palestine, State of\n PA: '🇵🇦', // Panama\n PG: '🇵🇬', // Papua New Guinea\n PY: '🇵🇾', // Paraguay\n PE: '🇵🇪', // Peru\n PH: '🇵🇭', // Philippines\n PN: '🇵🇳', // Pitcairn\n PL: '🇵🇱', // Poland\n PT: '🇵🇹', // Portugal\n PR: '🇵🇷', // Puerto Rico\n QA: '🇶🇦', // Qatar\n RE: '🇷🇪', // Réunion\n RO: '🇷🇴', // Romania\n RU: '🇷🇺', // Russian Federation\n RW: '🇷🇼', // Rwanda\n BL: '🇧🇱', // Saint Barthélemy\n SH: '🇸🇭', // Saint Helena, Ascension and Tristan da Cunha\n KN: '🇰🇳', // Saint Kitts and Nevis\n LC: '🇱🇨', // Saint Lucia\n MF: '🇲🇫', // Saint Martin (French part)\n PM: '🇵🇲', // Saint Pierre and Miquelon\n VC: '🇻🇨', // Saint Vincent and the Grenadines\n WS: '🇼🇸', // Samoa\n SM: '🇸🇲', // San Marino\n ST: '🇸🇹', // São Tomé and Príncipe\n SA: '🇸🇦', // Saudi Arabia\n SN: '🇸🇳', // Senegal\n RS: '🇷🇸', // Serbia\n SC: '🇸🇨', // Seychelles\n SL: '🇸🇱', // Sierra Leone\n SG: '🇸🇬', // Singapore\n SX: '🇸🇽', // Sint Maarten (Dutch part)\n SK: '🇸🇰', // Slovakia\n SI: '🇸🇮', // Slovenia\n SB: '🇸🇧', // Solomon Islands\n SO: '🇸🇴', // Somalia\n ZA: '🇿🇦', // South Africa\n GS: '🇬🇸', // South Georgia and the South Sandwich Islands\n SS: '🇸🇸', // South Sudan\n ES: '🇪🇸', // Spain\n LK: '🇱🇰', // Sri Lanka\n SD: '🇸🇩', // Sudan\n SR: '🇸🇷', // Suriname\n SJ: '🇸🇯', // Svalbard and Jan Mayen\n SE: '🇸🇪', // Sweden\n CH: '🇨🇭', // Switzerland\n SY: '🇸🇾', // Syrian Arab Republic\n TW: '🇹🇼', // Taiwan\n TJ: '🇹🇯', // Tajikistan\n TZ: '🇹🇿', // Tanzania\n TH: '🇹🇭', // Thailand\n TL: '🇹🇱', // Timor-Leste\n TG: '🇹🇬', // Togo\n TK: '🇹🇰', // Tokelau\n TO: '🇹🇴', // Tonga\n TT: '🇹🇹', // Trinidad and Tobago\n TN: '🇹🇳', // Tunisia\n TR: '🇹🇷', // Türkiye\n TM: '🇹🇲', // Turkmenistan\n TC: '🇹🇨', // Turks and Caicos Islands\n TV: '🇹🇻', // Tuvalu\n UG: '🇺🇬', // Uganda\n UA: '🇺🇦', // Ukraine\n AE: '🇦🇪', // United Arab Emirates\n GB: '🇬🇧', // United Kingdom\n US: '🇺🇸', // United States of America\n UM: '🇺🇲', // United States Minor Outlying Islands\n UY: '🇺🇾', // Uruguay\n UZ: '🇺🇿', // Uzbekistan\n VU: '🇻🇺', // Vanuatu\n VE: '🇻🇪', // Venezuela\n VN: '🇻🇳', // Viet Nam\n VG: '🇻🇬', // Virgin Islands (British)\n VI: '🇻🇮', // Virgin Islands (U.S.)\n WF: '🇼🇫', // Wallis and Futuna\n EH: '🇪🇭', // Western Sahara\n YE: '🇾🇪', // Yemen\n ZM: '🇿🇲', // Zambia\n ZW: '🇿🇼', // Zimbabwe,\n EU: '🇪🇺', // European Union (EU)\n '419': '🌎', // Latin America\n} as Record<string, string>;\n","import { libraryDefaultLocale } from '../internal';\nimport { defaultEmoji } from './getLocaleEmoji';\nimport { _isValidLocale, _standardizeLocale } from './isValidLocale';\nimport _getLocaleEmoji from './getLocaleEmoji';\nimport { intlCache } from '../cache/IntlCache';\nimport { CustomMapping, shouldUseCanonicalLocale } from './customLocaleMapping';\n\nexport type LocaleProperties = {\n // assume code = \"de-AT\", defaultLocale = \"en-US\"\n\n code: string; // \"de-AT\"\n name: string; // \"Austrian German\"\n nativeName: string; // \"Österreichisches Deutsch\"\n\n languageCode: string; // \"de\"\n languageName: string; // \"German\"\n nativeLanguageName: string; // \"Deutsch\"\n\n // note that maximize() is NOT called here!\n\n nameWithRegionCode: string; // \"German (AT)\"\n nativeNameWithRegionCode: string; // \"Deutsch (AT)\"\n\n // for most likely script and region, maximize() is called\n\n regionCode: string; // \"AT\"\n regionName: string; // \"Austria\"\n nativeRegionName: string; // Österreich\n\n scriptCode: string; // \"Latn\"\n scriptName: string; // \"Latin\"\n nativeScriptName: string; // \"Lateinisch\"\n\n maximizedCode: string; // \"de-Latn-AT\"\n maximizedName: string; // \"Austrian German (Latin)\"\n nativeMaximizedName: string; // Österreichisches Deutsch (Lateinisch)\n\n minimizedCode: string; // \"de-AT\", but for \"de-DE\" it would just be \"de\"\n minimizedName: string; // \"\"Austrian German\";\n nativeMinimizedName: string; // \"Österreichisches Deutsch\"\n\n // Emoji depending on region code\n // In order not to accidentally spark international conflict, some emojis are hard-coded\n emoji: string;\n};\n\n/**\n * Creates a set of custom locale properties from a custom mapping.\n *\n * @param lArray - An array of locale codes to search for in the custom mapping.\n * @param customMapping - Optional custom mapping of locale codes to names.\n * @returns A partial set of locale properties, or undefined if no custom mapping is provided.\n */\nexport function createCustomLocaleProperties(\n lArray: string[],\n customMapping?: CustomMapping\n): Partial<LocaleProperties> | undefined {\n if (customMapping) {\n let merged: Partial<LocaleProperties> = {};\n for (const l of lArray) {\n const value = customMapping[l];\n if (value) {\n if (typeof value === 'string') {\n merged.name ||= value;\n } else if (value) {\n merged = { ...value, ...merged };\n }\n }\n }\n return merged;\n }\n return undefined;\n}\n\n/**\n * @internal\n */\nexport default function _getLocaleProperties(\n locale: string,\n defaultLocale: string = libraryDefaultLocale,\n customMapping?: CustomMapping\n): LocaleProperties {\n // Check for canonical locale\n const aliasedLocale = locale;\n if (customMapping && shouldUseCanonicalLocale(locale, customMapping)) {\n // Override locale with canonical locale\n locale = (customMapping[locale] as { code: string }).code;\n }\n\n defaultLocale ||= libraryDefaultLocale;\n\n try {\n const standardizedLocale = _standardizeLocale(locale); // \"de-AT\"\n\n const localeObject = intlCache.get('Locale', locale);\n const languageCode = localeObject.language; // \"de\"\n\n const customLocaleProperties = createCustomLocaleProperties(\n [aliasedLocale, locale, standardizedLocale, languageCode],\n customMapping\n );\n\n const baseRegion = localeObject.region; // \"AT\"\n\n const maximizedLocale = localeObject.maximize();\n const maximizedCode = maximizedLocale.toString(); // \"de-Latn-AT\"\n const regionCode =\n localeObject.region ||\n customLocaleProperties?.regionCode ||\n maximizedLocale.region ||\n ''; // \"AT\"\n const scriptCode =\n localeObject.script ||\n customLocaleProperties?.scriptCode ||\n maximizedLocale.script ||\n ''; // \"Latn\"\n\n const minimizedLocale = localeObject.minimize();\n const minimizedCode = minimizedLocale.toString(); // \"de-AT\"\n\n // Language names (default and native)\n\n const defaultLanguageOrder = [defaultLocale, locale, libraryDefaultLocale];\n const nativeLanguageOrder = [locale, defaultLocale, libraryDefaultLocale];\n\n const languageNames = intlCache.get('DisplayNames', defaultLanguageOrder, {\n type: 'language',\n });\n const nativeLanguageNames = intlCache.get(\n 'DisplayNames',\n nativeLanguageOrder,\n { type: 'language' }\n );\n\n const customName = customLocaleProperties?.name;\n const customNativeName =\n customLocaleProperties?.nativeName || customLocaleProperties?.name;\n\n const name = customName || languageNames.of(locale) || locale; // \"Austrian German\"\n const nativeName =\n customNativeName || nativeLanguageNames.of(locale) || locale; // \"Österreichisches Deutsch\"\n\n const maximizedName =\n customLocaleProperties?.maximizedName ||\n customName ||\n languageNames.of(maximizedCode) ||\n locale; // \"Austrian German (Latin)\"\n const nativeMaximizedName =\n customLocaleProperties?.nativeMaximizedName ||\n customNativeName ||\n nativeLanguageNames.of(maximizedCode) ||\n locale; // \"Österreichisches Deutsch (Lateinisch)\"\n\n const minimizedName =\n customLocaleProperties?.minimizedName ||\n customName ||\n languageNames.of(minimizedCode) ||\n locale; // \"Austrian German\", but for \"de-DE\" would just be \"German\"\n const nativeMinimizedName =\n customLocaleProperties?.nativeMinimizedName ||\n customNativeName ||\n nativeLanguageNames.of(minimizedCode) ||\n locale; // \"Österreichisches Deutsch\", but for \"de-DE\" would just be \"Deutsch\"\n\n const languageName =\n customLocaleProperties?.languageName ||\n customName ||\n languageNames.of(languageCode) ||\n locale; // \"German\"\n const nativeLanguageName =\n customLocaleProperties?.nativeLanguageName ||\n customNativeName ||\n nativeLanguageNames.of(languageCode) ||\n locale; // \"Deutsch\"\n\n const nameWithRegionCode =\n customLocaleProperties?.nameWithRegionCode || baseRegion\n ? `${languageName} (${baseRegion})`\n : name; // German (AT)\n const nativeNameWithRegionCode =\n customLocaleProperties?.nativeNameWithRegionCode ||\n (baseRegion ? `${nativeLanguageName} (${baseRegion})` : nativeName) ||\n nameWithRegionCode; // \"Deutsch (AT)\"\n\n // Region names (default and native)\n\n const regionNames = intlCache.get('DisplayNames', defaultLanguageOrder, {\n type: 'region',\n });\n const nativeRegionNames = intlCache.get(\n 'DisplayNames',\n nativeLanguageOrder,\n { type: 'region' }\n );\n\n const regionName =\n customLocaleProperties?.regionName ||\n (regionCode ? regionNames.of(regionCode) : '') ||\n ''; // \"Austria\"\n const nativeRegionName =\n customLocaleProperties?.nativeRegionName ||\n (regionCode ? nativeRegionNames.of(regionCode) : '') ||\n ''; // \"Österreich\"\n\n // Script names (default and native)\n\n const scriptNames = intlCache.get('DisplayNames', defaultLanguageOrder, {\n type: 'script',\n });\n const nativeScriptNames = intlCache.get(\n 'DisplayNames',\n nativeLanguageOrder,\n { type: 'script' }\n );\n\n const scriptName =\n customLocaleProperties?.scriptName ||\n (scriptCode ? scriptNames.of(scriptCode) : '') ||\n ''; // \"Latin\"\n const nativeScriptName =\n customLocaleProperties?.nativeScriptName ||\n (scriptCode ? nativeScriptNames.of(scriptCode) : '') ||\n ''; // \"Lateinisch\"\n\n // Emoji\n\n const emoji =\n customLocaleProperties?.emoji ||\n _getLocaleEmoji(standardizedLocale, customMapping);\n\n return {\n code: standardizedLocale,\n name,\n nativeName,\n maximizedCode,\n maximizedName,\n nativeMaximizedName,\n minimizedCode,\n minimizedName,\n nativeMinimizedName,\n languageCode,\n languageName,\n nativeLanguageName,\n nameWithRegionCode,\n nativeNameWithRegionCode,\n regionCode,\n regionName,\n nativeRegionName,\n scriptCode,\n scriptName,\n nativeScriptName,\n emoji,\n };\n } catch {\n let code = _isValidLocale(locale) ? _standardizeLocale(locale) : locale;\n const codeParts = code?.split('-');\n let languageCode = codeParts?.[0] || code || '';\n let regionCode =\n codeParts.length > 2 ? codeParts?.[2] : codeParts?.[1] || '';\n let scriptCode = codeParts?.[3] || '';\n\n const customLocaleProperties = createCustomLocaleProperties(\n [code, languageCode],\n customMapping\n );\n\n code = customLocaleProperties?.code || code;\n const name = customLocaleProperties?.name || code;\n const nativeName = customLocaleProperties?.nativeName || name;\n\n const maximizedCode = customLocaleProperties?.maximizedCode || code;\n const maximizedName = customLocaleProperties?.maximizedName || name;\n const nativeMaximizedName =\n customLocaleProperties?.nativeMaximizedName || nativeName;\n\n const minimizedCode = customLocaleProperties?.minimizedCode || code;\n const minimizedName = customLocaleProperties?.minimizedName || name;\n const nativeMinimizedName =\n customLocaleProperties?.nativeMinimizedName || nativeName;\n\n languageCode = customLocaleProperties?.languageCode || languageCode;\n const languageName = customLocaleProperties?.languageName || name;\n const nativeLanguageName =\n customLocaleProperties?.nativeLanguageName || nativeName;\n\n regionCode = customLocaleProperties?.regionCode || regionCode;\n const regionName = customLocaleProperties?.regionName || '';\n const nativeRegionName = customLocaleProperties?.nativeRegionName || '';\n\n scriptCode = customLocaleProperties?.scriptCode || scriptCode;\n const scriptName = customLocaleProperties?.scriptName || '';\n const nativeScriptName = customLocaleProperties?.nativeScriptName || '';\n\n const nameWithRegionCode =\n customLocaleProperties?.nameWithRegionCode ||\n (regionName ? `${languageName} (${regionName})` : name);\n const nativeNameWithRegionCode =\n customLocaleProperties?.nativeNameWithRegionCode ||\n (nativeRegionName\n ? `${nativeLanguageName} (${nativeRegionName})`\n : nativeName);\n\n const emoji = customLocaleProperties?.emoji || defaultEmoji;\n\n return {\n code,\n name,\n nativeName,\n maximizedCode,\n maximizedName,\n nativeMaximizedName,\n minimizedCode,\n minimizedName,\n nativeMinimizedName,\n languageCode,\n languageName,\n nativeLanguageName,\n nameWithRegionCode,\n nativeNameWithRegionCode,\n regionCode,\n regionName,\n nativeRegionName,\n scriptCode,\n scriptName,\n nativeScriptName,\n emoji,\n };\n }\n}\n","import { _isValidLocale, _standardizeLocale } from './isValidLocale';\nimport _isSameLanguage from './isSameLanguage';\nimport _isSameDialect from './isSameDialect';\nimport _getLocaleProperties from './getLocaleProperties';\nimport { CustomMapping } from './customLocaleMapping';\n\n/**\n * Given a list of locales and a list of approved locales, sorted in preference order\n * Determines which locale is the best match among the approved locales, prioritizing exact matches and falling back to dialects of the same language\n * @internal\n */\nexport default function _determineLocale(\n locales: string | string[],\n approvedLocales: string[],\n customMapping?: CustomMapping\n): string | undefined {\n if (typeof locales === 'string') locales = [locales];\n locales = locales\n .filter((locale) => _isValidLocale(locale, customMapping))\n .map(_standardizeLocale);\n approvedLocales = approvedLocales\n .filter((locale) => _isValidLocale(locale, customMapping))\n .map(_standardizeLocale);\n for (const locale of locales) {\n const candidates = approvedLocales.filter((approvedLocale) =>\n _isSameLanguage(locale, approvedLocale)\n );\n const getMatchingCode = ({\n locale,\n languageCode,\n minimizedCode,\n regionCode,\n scriptCode,\n }: {\n locale: string;\n languageCode: string;\n minimizedCode: string;\n regionCode: string;\n scriptCode: string;\n }) => {\n const locales = [\n locale, // If the full locale is supported under this language category\n `${languageCode}-${regionCode}`, // Attempt to match parts\n `${languageCode}-${scriptCode}`,\n minimizedCode, // If a minimized variant of this locale is supported\n ];\n for (const l of locales) {\n if (candidates.includes(l)) return l;\n }\n return null;\n };\n const { languageCode, ...codes } = _getLocaleProperties(locale);\n const matchingCode =\n getMatchingCode({ locale, languageCode, ...codes }) ||\n getMatchingCode({\n locale: languageCode,\n ..._getLocaleProperties(languageCode),\n });\n if (matchingCode) return matchingCode;\n }\n return undefined;\n}\n","//\n// Main\n//\nexport function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nvar ObjectWithoutPrototypeCache = /** @class */ (function () {\n function ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n }\n ObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n };\n ObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n };\n return ObjectWithoutPrototypeCache;\n}());\nvar cacheDefault = {\n create: function create() {\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `<bold!>foo</bold!>) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo</123>`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[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;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: milliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n case 'rounding-mode-floor':\n result.roundingMode = 'floor';\n continue;\n case 'rounding-mode-ceiling':\n result.roundingMode = 'ceil';\n continue;\n case 'rounding-mode-down':\n result.roundingMode = 'trunc';\n continue;\n case 'rounding-mode-up':\n result.roundingMode = 'expand';\n continue;\n case 'rounding-mode-half-even':\n result.roundingMode = 'halfEven';\n continue;\n case 'rounding-mode-half-down':\n result.roundingMode = 'halfTrunc';\n continue;\n case 'rounding-mode-half-up':\n result.roundingMode = 'halfExpand';\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"419\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"AX\": [\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BI\": [\n \"H\",\n \"h\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"BO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BY\": [\n \"H\",\n \"h\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CL\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"CW\": [\n \"H\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EC\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FO\": [\n \"H\",\n \"h\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GL\": [\n \"H\",\n \"h\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GT\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HN\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"HU\": [\n \"H\",\n \"h\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JP\": [\n \"H\",\n \"K\",\n \"h\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MG\": [\n \"H\",\n \"h\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MT\": [\n \"H\",\n \"h\"\n ],\n \"MU\": [\n \"H\",\n \"h\"\n ],\n \"MV\": [\n \"H\",\n \"h\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MX\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NI\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"NO\": [\n \"H\",\n \"h\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PL\": [\n \"H\",\n \"h\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"PY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"RW\": [\n \"H\",\n \"h\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"SV\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TH\": [\n \"H\",\n \"h\"\n ],\n \"TJ\": [\n \"H\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TM\": [\n \"H\",\n \"h\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VN\": [\n \"H\",\n \"h\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZW\": [\n \"H\",\n \"h\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-HK\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-IL\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"en-MY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ]\n};\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith && '_a'.startsWith('a', 1);\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"</\" tagName (whitespace)* \">\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('</')) {\n if (this.isEOF() || !_isAlpha(this.char())) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n var closingTagNameStartPosition = this.clonePosition();\n var closingTagName = this.parseTagName();\n if (tagName !== closingTagName) {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (!this.bumpIf('>')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","import { __extends } from \"tslib\";\nexport var ErrorCode;\n(function (ErrorCode) {\n // When we have a placeholder but no value to format\n ErrorCode[\"MISSING_VALUE\"] = \"MISSING_VALUE\";\n // When value supplied is invalid\n ErrorCode[\"INVALID_VALUE\"] = \"INVALID_VALUE\";\n // When we need specific Intl API but it's not available\n ErrorCode[\"MISSING_INTL_API\"] = \"MISSING_INTL_API\";\n})(ErrorCode || (ErrorCode = {}));\nvar FormatError = /** @class */ (function (_super) {\n __extends(FormatError, _super);\n function FormatError(msg, code, originalMessage) {\n var _this = _super.call(this, msg) || this;\n _this.code = code;\n _this.originalMessage = originalMessage;\n return _this;\n }\n FormatError.prototype.toString = function () {\n return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n };\n return FormatError;\n}(Error));\nexport { FormatError };\nvar InvalidValueError = /** @class */ (function (_super) {\n __extends(InvalidValueError, _super);\n function InvalidValueError(variableId, value, options, originalMessage) {\n return _super.call(this, \"Invalid values for \\\"\".concat(variableId, \"\\\": \\\"\").concat(value, \"\\\". Options are \\\"\").concat(Object.keys(options).join('\", \"'), \"\\\"\"), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueError;\n}(FormatError));\nexport { InvalidValueError };\nvar InvalidValueTypeError = /** @class */ (function (_super) {\n __extends(InvalidValueTypeError, _super);\n function InvalidValueTypeError(value, type, originalMessage) {\n return _super.call(this, \"Value for \\\"\".concat(value, \"\\\" must be of type \").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueTypeError;\n}(FormatError));\nexport { InvalidValueTypeError };\nvar MissingValueError = /** @class */ (function (_super) {\n __extends(MissingValueError, _super);\n function MissingValueError(variableId, originalMessage) {\n return _super.call(this, \"The intl string context variable \\\"\".concat(variableId, \"\\\" was not provided to the string \\\"\").concat(originalMessage, \"\\\"\"), ErrorCode.MISSING_VALUE, originalMessage) || this;\n }\n return MissingValueError;\n}(FormatError));\nexport { MissingValueError };\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n// only for testing\nexport var _Parser = Parser;\nexport { isStructurallySame } from './manipulator';\n","import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTagElement, isTimeElement, } from '@formatjs/icu-messageformat-parser';\nimport { ErrorCode, FormatError, InvalidValueError, InvalidValueTypeError, MissingValueError, } from './error';\nexport var PART_TYPE;\n(function (PART_TYPE) {\n PART_TYPE[PART_TYPE[\"literal\"] = 0] = \"literal\";\n PART_TYPE[PART_TYPE[\"object\"] = 1] = \"object\";\n})(PART_TYPE || (PART_TYPE = {}));\nfunction mergeLiteral(parts) {\n if (parts.length < 2) {\n return parts;\n }\n return parts.reduce(function (all, part) {\n var lastPart = all[all.length - 1];\n if (!lastPart ||\n lastPart.type !== PART_TYPE.literal ||\n part.type !== PART_TYPE.literal) {\n all.push(part);\n }\n else {\n lastPart.value += part.value;\n }\n return all;\n }, []);\n}\nexport function isFormatXMLElementFn(el) {\n return typeof el === 'function';\n}\n// TODO(skeleton): add skeleton support\nexport function formatToParts(els, locales, formatters, formats, values, currentPluralValue, \n// For debugging\noriginalMessage) {\n // Hot path for straight simple msg translations\n if (els.length === 1 && isLiteralElement(els[0])) {\n return [\n {\n type: PART_TYPE.literal,\n value: els[0].value,\n },\n ];\n }\n var result = [];\n for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {\n var el = els_1[_i];\n // Exit early for string parts.\n if (isLiteralElement(el)) {\n result.push({\n type: PART_TYPE.literal,\n value: el.value,\n });\n continue;\n }\n // TODO: should this part be literal type?\n // Replace `#` in plural rules with the actual numeric value.\n if (isPoundElement(el)) {\n if (typeof currentPluralValue === 'number') {\n result.push({\n type: PART_TYPE.literal,\n value: formatters.getNumberFormat(locales).format(currentPluralValue),\n });\n }\n continue;\n }\n var varName = el.value;\n // Enforce that all required values are provided by the caller.\n if (!(values && varName in values)) {\n throw new MissingValueError(varName, originalMessage);\n }\n var value = values[varName];\n if (isArgumentElement(el)) {\n if (!value || typeof value === 'string' || typeof value === 'number') {\n value =\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '';\n }\n result.push({\n type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: value,\n });\n continue;\n }\n // Recursively format plural and select parts' option — which can be a\n // nested pattern structure. The choosing of the option to use is\n // abstracted-by and delegated-to the part helper object.\n if (isDateElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.date[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTimeElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.time[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : formats.time.medium;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isNumberElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.number[el.style]\n : isNumberSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n if (style && style.scale) {\n value =\n value *\n (style.scale || 1);\n }\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getNumberFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTagElement(el)) {\n var children = el.children, value_1 = el.value;\n var formatFn = values[value_1];\n if (!isFormatXMLElementFn(formatFn)) {\n throw new InvalidValueTypeError(value_1, 'function', originalMessage);\n }\n var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);\n var chunks = formatFn(parts.map(function (p) { return p.value; }));\n if (!Array.isArray(chunks)) {\n chunks = [chunks];\n }\n result.push.apply(result, chunks.map(function (c) {\n return {\n type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: c,\n };\n }));\n }\n if (isSelectElement(el)) {\n var opt = el.options[value] || el.options.other;\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));\n continue;\n }\n if (isPluralElement(el)) {\n var opt = el.options[\"=\".concat(value)];\n if (!opt) {\n if (!Intl.PluralRules) {\n throw new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API, originalMessage);\n }\n var rule = formatters\n .getPluralRules(locales, { type: el.pluralType })\n .select(value - (el.offset || 0));\n opt = el.options[rule] || el.options.other;\n }\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));\n continue;\n }\n }\n return mergeLiteral(result);\n}\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\nimport { __assign, __rest, __spreadArray } from \"tslib\";\nimport { memoize, strategies } from '@formatjs/fast-memoize';\nimport { parse, } from '@formatjs/icu-messageformat-parser';\nimport { formatToParts, PART_TYPE, } from './formatters';\n// -- MessageFormat --------------------------------------------------------\nfunction mergeConfig(c1, c2) {\n if (!c2) {\n return c1;\n }\n return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {\n all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));\n return all;\n }, {}));\n}\nfunction mergeConfigs(defaultConfig, configs) {\n if (!configs) {\n return defaultConfig;\n }\n return Object.keys(defaultConfig).reduce(function (all, k) {\n all[k] = mergeConfig(defaultConfig[k], configs[k]);\n return all;\n }, __assign({}, defaultConfig));\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\nfunction createDefaultFormatters(cache) {\n if (cache === void 0) { cache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }; }\n return {\n getNumberFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n }),\n getDateTimeFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n }),\n };\n}\nvar IntlMessageFormat = /** @class */ (function () {\n function IntlMessageFormat(message, locales, overrideFormats, opts) {\n if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }\n var _this = this;\n this.formatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n };\n this.format = function (values) {\n var parts = _this.formatToParts(values);\n // Hot path for straight simple msg translations\n if (parts.length === 1) {\n return parts[0].value;\n }\n var result = parts.reduce(function (all, part) {\n if (!all.length ||\n part.type !== PART_TYPE.literal ||\n typeof all[all.length - 1] !== 'string') {\n all.push(part.value);\n }\n else {\n all[all.length - 1] += part.value;\n }\n return all;\n }, []);\n if (result.length <= 1) {\n return result[0] || '';\n }\n return result;\n };\n this.formatToParts = function (values) {\n return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);\n };\n this.resolvedOptions = function () {\n var _a;\n return ({\n locale: ((_a = _this.resolvedLocale) === null || _a === void 0 ? void 0 : _a.toString()) ||\n Intl.NumberFormat.supportedLocalesOf(_this.locales)[0],\n });\n };\n this.getAst = function () { return _this.ast; };\n // Defined first because it's used to build the format pattern.\n this.locales = locales;\n this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);\n if (typeof message === 'string') {\n this.message = message;\n if (!IntlMessageFormat.__parse) {\n throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');\n }\n var _a = opts || {}, formatters = _a.formatters, parseOpts = __rest(_a, [\"formatters\"]);\n // Parse string messages into an AST.\n this.ast = IntlMessageFormat.__parse(message, __assign(__assign({}, parseOpts), { locale: this.resolvedLocale }));\n }\n else {\n this.ast = message;\n }\n if (!Array.isArray(this.ast)) {\n throw new TypeError('A message must be provided as a String or AST.');\n }\n // Creates a new object with the specified `formats` merged with the default\n // formats.\n this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);\n this.formatters =\n (opts && opts.formatters) || createDefaultFormatters(this.formatterCache);\n }\n Object.defineProperty(IntlMessageFormat, \"defaultLocale\", {\n get: function () {\n if (!IntlMessageFormat.memoizedDefaultLocale) {\n IntlMessageFormat.memoizedDefaultLocale =\n new Intl.NumberFormat().resolvedOptions().locale;\n }\n return IntlMessageFormat.memoizedDefaultLocale;\n },\n enumerable: false,\n configurable: true\n });\n IntlMessageFormat.memoizedDefaultLocale = null;\n IntlMessageFormat.resolveLocale = function (locales) {\n if (typeof Intl.Locale === 'undefined') {\n return;\n }\n var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);\n if (supportedLocales.length > 0) {\n return new Intl.Locale(supportedLocales[0]);\n }\n return new Intl.Locale(typeof locales === 'string' ? locales : locales[0]);\n };\n IntlMessageFormat.__parse = parse;\n // Default format options used as the prototype of the `formats` provided to the\n // constructor. These are used when constructing the internal Intl.NumberFormat\n // and Intl.DateTimeFormat instances.\n IntlMessageFormat.formats = {\n number: {\n integer: {\n maximumFractionDigits: 0,\n },\n currency: {\n style: 'currency',\n },\n percent: {\n style: 'percent',\n },\n },\n date: {\n short: {\n month: 'numeric',\n day: 'numeric',\n year: '2-digit',\n },\n medium: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n long: {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n full: {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n },\n time: {\n short: {\n hour: 'numeric',\n minute: 'numeric',\n },\n medium: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n long: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n full: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n },\n };\n return IntlMessageFormat;\n}());\nexport { IntlMessageFormat };\n","/**\n * Comprehensive logging system for the General Translation library\n * Provides structured logging with multiple levels and configurable output\n */\n\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off';\n\nexport interface LogEntry {\n level: LogLevel;\n message: string;\n timestamp: Date;\n context?: string;\n metadata?: Record<string, any>;\n}\n\nexport interface LoggerConfig {\n /** Minimum log level to output */\n level: LogLevel;\n /** Whether to include timestamps in log output */\n includeTimestamp: boolean;\n /** Whether to include context information */\n includeContext: boolean;\n /** Custom prefix for all log messages */\n prefix?: string;\n /** Whether to output to console (default: true) */\n enableConsole: boolean;\n /** Custom log handlers */\n handlers?: LogHandler[];\n}\n\nexport interface LogHandler {\n handle(entry: LogEntry): void;\n}\n\nconst LOG_LEVELS: Record<LogLevel, number> = {\n debug: 0,\n info: 1,\n warn: 2,\n error: 3,\n off: 4,\n};\n\nconst LOG_COLORS: Record<LogLevel, string> = {\n debug: '\\x1b[36m', // Cyan\n info: '\\x1b[32m', // Green\n warn: '\\x1b[33m', // Yellow\n error: '\\x1b[31m', // Red\n off: '', // No color needed since 'off' level logs are never displayed\n};\n\nconst RESET_COLOR = '\\x1b[0m';\n\n/**\n * Get the configured log level from environment variable or default to 'warn'\n */\nfunction getConfiguredLogLevel(): LogLevel {\n if (typeof process !== 'undefined' && process.env?._GT_LOG_LEVEL) {\n const envLevel = process.env._GT_LOG_LEVEL.toLowerCase();\n if (envLevel in LOG_LEVELS) {\n return envLevel as LogLevel;\n }\n }\n return 'warn';\n}\n\n/**\n * Console log handler that outputs formatted messages to console\n */\nexport class ConsoleLogHandler implements LogHandler {\n private config: LoggerConfig;\n\n constructor(config: LoggerConfig) {\n this.config = config;\n }\n\n handle(entry: LogEntry): void {\n const parts: string[] = [];\n\n // Add timestamp if enabled\n if (this.config.includeTimestamp) {\n parts.push(`[${entry.timestamp.toISOString()}]`);\n }\n\n // Add level with color\n const colorCode = LOG_COLORS[entry.level];\n const levelText = `[${entry.level.toUpperCase()}]`;\n parts.push(`${colorCode}${levelText}${RESET_COLOR}`);\n\n // Add prefix if configured\n if (this.config.prefix) {\n parts.push(`[${this.config.prefix}]`);\n }\n\n // Add context if available and enabled\n if (this.config.includeContext && entry.context) {\n parts.push(`[${entry.context}]`);\n }\n\n // Add the main message\n parts.push(entry.message);\n\n // Format metadata if available\n if (entry.metadata && Object.keys(entry.metadata).length > 0) {\n parts.push(`\\n Metadata: ${JSON.stringify(entry.metadata, null, 2)}`);\n }\n\n const formattedMessage = parts.join(' ');\n\n // Output to appropriate console method based on level\n switch (entry.level) {\n case 'debug':\n console.debug(formattedMessage);\n break;\n case 'info':\n console.info(formattedMessage);\n break;\n case 'warn':\n console.warn(formattedMessage);\n break;\n case 'error':\n console.error(formattedMessage);\n break;\n }\n }\n}\n\n/**\n * Main Logger class providing structured logging capabilities\n */\nexport class Logger {\n private config: LoggerConfig;\n private handlers: LogHandler[];\n\n constructor(config: Partial<LoggerConfig> = {}) {\n this.config = {\n level: getConfiguredLogLevel(),\n includeTimestamp: true,\n includeContext: true,\n enableConsole: true,\n handlers: [],\n ...config,\n };\n\n this.handlers = [...(this.config.handlers || [])];\n\n // Add console handler if enabled\n if (this.config.enableConsole) {\n this.handlers.push(new ConsoleLogHandler(this.config));\n }\n }\n\n /**\n * Add a custom log handler\n */\n addHandler(handler: LogHandler): void {\n this.handlers.push(handler);\n }\n\n /**\n * Remove a log handler\n */\n removeHandler(handler: LogHandler): void {\n const index = this.handlers.indexOf(handler);\n if (index > -1) {\n this.handlers.splice(index, 1);\n }\n }\n\n /**\n * Update logger configuration\n */\n configure(config: Partial<LoggerConfig>): void {\n this.config = { ...this.config, ...config };\n }\n\n /**\n * Check if a log level should be output based on current configuration\n */\n private shouldLog(level: LogLevel): boolean {\n return LOG_LEVELS[level] >= LOG_LEVELS[this.config.level];\n }\n\n /**\n * Internal logging method that creates log entries and passes them to handlers\n */\n private log(\n level: LogLevel,\n message: string,\n context?: string,\n metadata?: Record<string, any>\n ): void {\n if (!this.shouldLog(level)) {\n return;\n }\n\n const entry: LogEntry = {\n level,\n message,\n timestamp: new Date(),\n context,\n metadata,\n };\n\n // Pass to all handlers\n this.handlers.forEach((handler) => {\n try {\n handler.handle(entry);\n } catch (error) {\n // Prevent logging errors from breaking the application\n console.error('Error in log handler:', error);\n }\n });\n }\n\n /**\n * Log a debug message\n * Used for detailed diagnostic information, typically of interest only when diagnosing problems\n */\n debug(\n message: string,\n context?: string,\n metadata?: Record<string, any>\n ): void {\n this.log('debug', message, context, metadata);\n }\n\n /**\n * Log an info message\n * Used for general information about application operation\n */\n info(\n message: string,\n context?: string,\n metadata?: Record<string, any>\n ): void {\n this.log('info', message, context, metadata);\n }\n\n /**\n * Log a warning message\n * Used for potentially problematic situations that don't prevent operation\n */\n warn(\n message: string,\n context?: string,\n metadata?: Record<string, any>\n ): void {\n this.log('warn', message, context, metadata);\n }\n\n /**\n * Log an error message\n * Used for error events that might still allow the application to continue\n */\n error(\n message: string,\n context?: string,\n metadata?: Record<string, any>\n ): void {\n this.log('error', message, context, metadata);\n }\n\n /**\n * Create a child logger with a specific context\n */\n child(context: string): ContextLogger {\n return new ContextLogger(this, context);\n }\n\n /**\n * Get current logger configuration\n */\n getConfig(): LoggerConfig {\n return { ...this.config };\n }\n}\n\n/**\n * Context logger that automatically includes context information\n */\nexport class ContextLogger {\n private logger: Logger;\n private context: string;\n\n constructor(logger: Logger, context: string) {\n this.logger = logger;\n this.context = context;\n }\n\n debug(message: string, metadata?: Record<string, any>): void {\n this.logger.debug(message, this.context, metadata);\n }\n\n info(message: string, metadata?: Record<string, any>): void {\n this.logger.info(message, this.context, metadata);\n }\n\n warn(message: string, metadata?: Record<string, any>): void {\n this.logger.warn(message, this.context, metadata);\n }\n\n error(message: string, metadata?: Record<string, any>): void {\n this.logger.error(message, this.context, metadata);\n }\n\n child(childContext: string): ContextLogger {\n return new ContextLogger(this.logger, `${this.context}:${childContext}`);\n }\n}\n\n// Default logger instance\nexport const defaultLogger = new Logger({\n level: getConfiguredLogLevel(),\n includeTimestamp: true,\n includeContext: true,\n prefix: 'GT',\n});\n\n// Convenience functions using the default logger\nexport const debug = (\n message: string,\n context?: string,\n metadata?: Record<string, any>\n) => defaultLogger.debug(message, context, metadata);\n\nexport const info = (\n message: string,\n context?: string,\n metadata?: Record<string, any>\n) => defaultLogger.info(message, context, metadata);\n\nexport const warn = (\n message: string,\n context?: string,\n metadata?: Record<string, any>\n) => defaultLogger.warn(message, context, metadata);\n\nexport const error = (\n message: string,\n context?: string,\n metadata?: Record<string, any>\n) => defaultLogger.error(message, context, metadata);\n\n// Create context-specific loggers for different parts of the system\nexport const fetchLogger = defaultLogger.child('fetch');\nexport const validationLogger = defaultLogger.child('validation');\nexport const formattingLogger = defaultLogger.child('formatting');\nexport const localeLogger = defaultLogger.child('locale');\nexport const gtInstanceLogger = defaultLogger.child('GT instance');\n\n// Export types and classes\nexport { Logger as GTLogger };\n","import { FormatVariables, I18nextMessage } from '../types';\nimport { intlCache } from '../cache/IntlCache';\nimport { libraryDefaultLocale } from '../internal';\nimport IntlMessageFormat from 'intl-messageformat';\nimport { formatI18nextWarning, formatJsxWarning } from '../logging/warnings';\nimport { formattingLogger } from '../logging/logger';\nimport { JsxChildren } from '../types';\nimport {\n CutoffFormatOptions,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n CutoffFormatStyle,\n} from './custom-formats/CutoffFormat/types';\n\n/**\n * Formats a string value with cutoff behavior according to the specified locales and options.\n *\n * @param {Object} params - The parameters for the cutoff formatting.\n * @param {string} params.value - The string value to format with cutoff behavior.\n * @param {string | string[]} [params.locales='en'] - The locales to use for formatting.\n * @param {CutoffFormatOptions} [params.options={}] - Additional options for cutoff formatting.\n * @param {number} [params.options.maxChars] - The maximum number of characters to display.\n * @param {CutoffFormatStyle} [params.options.style='ellipsis'] - The style of the terminator.\n * @param {string} [params.options.terminator] - Optional override for the terminator to use.\n * @param {string} [params.options.separator] - Optional override for the separator between terminator and value.\n *\n * @returns {string} The formatted string with terminator applied if cutoff occurs.\n * @internal\n *\n * @example\n * _formatCutoff({ value: 'Hello, world!', options: { maxChars: 8 } }); // Returns 'Hello, w...'\n *\n * Will fallback to an empty string if formatting fails.\n */\nexport function _formatCutoff({\n value,\n locales = libraryDefaultLocale,\n options = {},\n}: {\n value: string;\n locales?: string | string[];\n options?: CutoffFormatOptions;\n}): string {\n return intlCache.get('CutoffFormat', locales, options).format(value);\n}\n\n/**\n * Formats a message according to the specified locales and options.\n *\n * @param {string} message - The message to format.\n * @param {string | string[]} [locales='en'] - The locales to use for formatting.\n * @param {Record<string, any>} [variables={}] - The variables to use for formatting.\n * @returns {string} The formatted message.\n * @internal\n *\n * Will fallback to an empty string\n * TODO: add this to custom formats\n */\nexport function _formatMessageICU(\n message: string,\n locales: string | string[] = libraryDefaultLocale,\n variables: FormatVariables = {}\n): string {\n const messageFormat = new IntlMessageFormat(message, locales);\n return messageFormat.format(variables)?.toString() ?? '';\n}\n\n/**\n * Returns the message as-is without any formatting.\n *\n * @param {string} message - The message to return.\n * @returns {string} The original message, unchanged.\n * @internal\n *\n * TODO: add this to custom formats\n */\nexport function _formatMessageString(message: string): string {\n return message;\n}\n\n/**\n * Formats a number according to the specified locales and options.\n *\n * @param {Object} params - The parameters for the number formatting.\n * @param {number} params.value - The number to format.\n * @param {string | string[]} [params.locales=['en']] - The locales to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for number formatting.\n *\n * @returns {string} The formatted number.\n * @internal\n */\nexport function _formatNum({\n value,\n locales = [libraryDefaultLocale],\n options = {},\n}: {\n value: number;\n locales?: string | string[];\n options?: Intl.NumberFormatOptions;\n}): string {\n const res = intlCache\n .get('NumberFormat', locales, {\n numberingSystem: 'latn',\n ...options,\n })\n .format(value);\n return res;\n}\n\n/**\n * Formats a date according to the specified locales and options.\n *\n * @param {Object} params - The parameters for the date formatting.\n * @param {Date} params.value - The date to format.\n * @param {string | string[]} [params.locales='en'] - The locales to use for formatting.\n * @param {Intl.DateTimeFormatOptions} [params.options={}] - Additional options for date formatting.\n *\n * @returns {string} The formatted date.\n * @internal\n */\nexport function _formatDateTime({\n value,\n locales = [libraryDefaultLocale],\n options = {},\n}: {\n value: Date;\n locales?: string | string[];\n options?: Intl.DateTimeFormatOptions;\n}): string {\n return intlCache\n .get('DateTimeFormat', locales, {\n calendar: 'gregory',\n numberingSystem: 'latn',\n ...options,\n })\n .format(value);\n}\n\n/**\n * Formats a currency value according to the specified locales, currency, and options.\n *\n * @param {Object} params - The parameters for the currency formatting.\n * @param {number} params.value - The currency value to format.\n * @param {string} params.currency - The currency code (e.g., 'USD').\n * @param {string | string[]} [params.locales=['en']] - The locales to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.\n *\n * @returns {string} The formatted currency value.\n * @internal\n */\n\nexport function _formatCurrency({\n value,\n locales = [libraryDefaultLocale],\n currency = 'USD',\n options = {},\n}: {\n value: number;\n currency?: string;\n locales?: string | string[];\n options?: Intl.NumberFormatOptions;\n}): string {\n return intlCache\n .get('NumberFormat', locales, {\n style: 'currency',\n currency,\n numberingSystem: 'latn',\n ...options,\n })\n .format(value);\n}\n\n/**\n * Formats a list of items according to the specified locales and options.\n *\n * @param {Object} params - The parameters for the list formatting.\n * @param {Array<string | number>} params.value - The list of items to format.\n * @param {string | string[]} [params.locales=['en']] - The locales to use for formatting.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n *\n * @returns {string} The formatted list.\n * @internal\n */\nexport function _formatList({\n value,\n locales = [libraryDefaultLocale],\n options = {},\n}: {\n value: Array<any>;\n locales?: string | string[];\n options?: Intl.ListFormatOptions;\n}): string {\n return intlCache\n .get('ListFormat', locales, {\n type: 'conjunction', // Default type, can be overridden via options\n style: 'long', // Default style, can be overridden via options\n ...options,\n })\n .format(value);\n}\n\n/**\n * Formats a list of items according to the specified locales and options.\n * @param {Object} params - The parameters for the list formatting.\n * @param {Array<T>} params.value - The list of items to format.\n * @param {string | string[]} [params.locales=['en']] - The locales to use for formatting.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n * @returns {Array<T | string>} The formatted list parts.\n * @internal\n */\nexport function _formatListToParts<T>({\n value,\n locales = [libraryDefaultLocale],\n options = {},\n}: {\n value: Array<T>;\n locales?: string | string[];\n options?: Intl.ListFormatOptions;\n}) {\n const formatListParts = intlCache\n .get('ListFormat', locales, {\n type: 'conjunction', // Default type, can be overridden via options\n style: 'long', // Default style, can be overridden via options\n ...options,\n })\n .formatToParts(value.map(() => '1'));\n let partIndex = 0;\n return formatListParts.map((part) => {\n if (part.type === 'element') return value[partIndex++];\n return part.value;\n });\n}\n\n/**\n * Selects the best unit and computes the value for relative time formatting\n * based on the difference between a date and a base date.\n * @param {Date} date - The target date.\n * @param {Date} baseDate - The base date to compute relative time from. Must be provided by the caller for hydration safety.\n * @returns {{ value: number, unit: Intl.RelativeTimeFormatUnit }} The computed value and unit.\n * @internal\n */\nexport function _selectRelativeTimeUnit(\n date: Date,\n baseDate: Date\n): {\n value: number;\n unit: Intl.RelativeTimeFormatUnit;\n} {\n const now = baseDate.getTime();\n const diffMs = date.getTime() - now;\n const absDiffMs = Math.abs(diffMs);\n const sign = diffMs < 0 ? -1 : 1;\n\n // Use Math.floor to avoid confusing jumps near boundaries\n // (e.g. 3.5 days rounding to \"1 week ago\" instead of \"3 days ago\")\n const seconds = Math.floor(absDiffMs / 1000);\n const minutes = Math.floor(absDiffMs / (1000 * 60));\n const hours = Math.floor(absDiffMs / (1000 * 60 * 60));\n const days = Math.floor(absDiffMs / (1000 * 60 * 60 * 24));\n const weeks = Math.floor(absDiffMs / (1000 * 60 * 60 * 24 * 7));\n const months = Math.floor(absDiffMs / (1000 * 60 * 60 * 24 * 30));\n const years = Math.floor(absDiffMs / (1000 * 60 * 60 * 24 * 365));\n\n if (seconds < 60) return { value: sign * seconds, unit: 'second' };\n if (minutes < 60) return { value: sign * minutes, unit: 'minute' };\n if (hours < 24) return { value: sign * hours, unit: 'hour' };\n if (days < 7) return { value: sign * days, unit: 'day' };\n if (days < 28) return { value: sign * weeks, unit: 'week' };\n if (months < 1) return { value: sign * weeks, unit: 'week' };\n if (months < 12) return { value: sign * months, unit: 'month' };\n if (years < 1) return { value: sign * months, unit: 'month' };\n return { value: sign * years, unit: 'year' };\n}\n\n/**\n * Formats a relative time from a Date, automatically selecting the best unit.\n * @internal\n */\nexport function _formatRelativeTimeFromDate({\n date,\n baseDate,\n locales = [libraryDefaultLocale],\n options = {},\n}: {\n date: Date;\n baseDate: Date;\n locales?: string | string[];\n options?: Intl.RelativeTimeFormatOptions;\n}): string {\n const { value, unit } = _selectRelativeTimeUnit(date, baseDate);\n return _formatRelativeTime({ value, unit, locales, options });\n}\n\n/**\n * Formats a relative time value according to the specified locales and options.\n *\n * @param {Object} params - The parameters for the relative time formatting.\n * @param {number} params.value - The relative time value to format.\n * @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').\n * @param {string | string[]} [params.locales=['en']] - The locales to use for formatting.\n * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.\n *\n * @returns {string} The formatted relative time string.\n * @internal\n */\nexport function _formatRelativeTime({\n value,\n unit,\n locales = [libraryDefaultLocale],\n options = {},\n}: {\n value: number;\n unit: Intl.RelativeTimeFormatUnit;\n locales?: string | string[];\n options?: Intl.RelativeTimeFormatOptions;\n}): string {\n return intlCache\n .get('RelativeTimeFormat', locales, {\n style: 'long',\n numeric: 'auto',\n ...options,\n })\n .format(value, unit);\n}\n\n/**\n * @experimental This function is not currently supported but will be implemented in a future version.\n * Use {@link _formatMessageICU} for current ICU message format support.\n * Formats an I18next message according to the specified locales and options.\n *\n * @param message - The I18next message to format.\n * @param variables - The variables to use for formatting.\n * @returns The formatted I18next message.\n * @internal\n */\nexport function _formatI18next(\n message: I18nextMessage,\n // eslint-disable-next-line no-unused-vars\n _variables: FormatVariables = {}\n): string {\n formattingLogger.warn(formatI18nextWarning);\n return message;\n}\n\n/**\n * @experimental This function is not currently supported but will be implemented in a future version.\n * Use {@link _formatMessageICU} for current ICU message format support.\n * Formats a JSX message according to the specified locales and options.\n *\n * @param message - The JSX message to format.\n * @param variables - The variables to use for formatting.\n * @returns The formatted JSX message.\n * @internal\n */\nexport function _formatJsx(\n message: JsxChildren,\n // eslint-disable-next-line no-unused-vars\n _variables: FormatVariables = {}\n): JsxChildren {\n formattingLogger.warn(formatJsxWarning);\n return message;\n}\n","import { intlCache } from '../cache/IntlCache';\nimport { libraryDefaultLocale } from '../internal';\nimport {\n CustomMapping,\n getCustomProperty,\n shouldUseCanonicalLocale,\n} from './customLocaleMapping';\nimport { _standardizeLocale } from './isValidLocale';\n\n/**\n * Retrieves the display name(s) of locale code(s) using Intl.DisplayNames.\n *\n * @param {string} locale - A BCP-47 locale code.\n * @param {string} [defaultLocale=libraryDefaultLocale] - The locale for display names.\n * @returns {string} The display name(s) corresponding to the code(s), or empty string(s) if invalid.\n * @internal\n */\nexport function _getLocaleName(\n locale: string,\n defaultLocale: string = libraryDefaultLocale,\n customMapping?: CustomMapping\n): string {\n // Check for canonical locale\n const aliasedLocale = locale;\n if (customMapping && shouldUseCanonicalLocale(locale, customMapping)) {\n // Override locale with canonical locale\n locale = (customMapping[locale] as { code: string }).code;\n }\n\n defaultLocale ||= libraryDefaultLocale;\n try {\n const standardizedLocale = _standardizeLocale(locale);\n if (customMapping) {\n for (const l of [\n aliasedLocale,\n locale,\n standardizedLocale,\n intlCache.get('Locale', standardizedLocale).language,\n ]) {\n const customName = getCustomProperty(customMapping, l, 'name');\n if (customName) return customName;\n }\n }\n const displayNames = intlCache.get(\n 'DisplayNames',\n [defaultLocale, standardizedLocale, libraryDefaultLocale], // default locale order\n { type: 'language' }\n );\n return displayNames.of(standardizedLocale) || '';\n } catch {\n // In case Intl.DisplayNames construction fails, return empty string(s)\n return '';\n }\n}\n","import { intlCache } from '../cache/IntlCache';\nimport _getLocaleProperties from './getLocaleProperties';\n\n/**\n * Get the text direction for a given locale code using the Intl.Locale API.\n *\n * @param {string} code - The locale code to check.\n * @returns {string} - 'rtl' if the language is right-to-left, otherwise 'ltr'.\n * @internal\n */\nexport function _getLocaleDirection(code: string): 'ltr' | 'rtl' {\n // Extract via textInfo property\n try {\n const locale = intlCache.get('Locale', code);\n const textInfoDirection = extractDirectionWithTextInfo(locale);\n if (textInfoDirection) {\n return textInfoDirection;\n }\n } catch {\n // silent\n }\n\n // Fallback to simple heuristics\n const { scriptCode, languageCode } = _getLocaleProperties(code);\n\n // Handle RTL script or language\n if (scriptCode) return isRtlScript(scriptCode) ? 'rtl' : 'ltr';\n if (languageCode) return isRtlLanguage(languageCode) ? 'rtl' : 'ltr';\n\n return 'ltr';\n}\n\n// ===== HELPER CONSTANTS ===== //\n\nconst RTL_SCRIPTS = new Set([\n 'arab',\n 'adlm',\n 'hebr',\n 'nkoo',\n 'rohg',\n 'samr',\n 'syrc',\n 'thaa',\n 'yezi',\n]);\n\nconst RTL_LANGUAGES = new Set([\n 'ar',\n 'arc',\n 'ckb',\n 'dv',\n 'fa',\n 'he',\n 'iw',\n 'ku',\n 'lrc',\n 'nqo',\n 'ps',\n 'pnb',\n 'sd',\n 'syr',\n 'ug',\n 'ur',\n 'yi',\n]);\n\n// ===== HELPER FUNCTIONS ===== //\n\n/**\n * Handles extracting direction via textInfo property\n * @param Locale - Intl.Locale object\n * @returns {'ltr' | 'rtl'} - The direction of the locale\n *\n * Intl.Locale.prototype.getTextInfo() / textInfo property incorporated in ES2024 Specification.\n * This is not supported by all browsers yet.\n * See: {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo#browser_compatibility}\n */\nfunction extractDirectionWithTextInfo(\n locale: Intl.Locale\n): 'ltr' | 'rtl' | undefined {\n if (\n 'textInfo' in locale &&\n typeof locale.textInfo === 'object' &&\n locale.textInfo !== null &&\n 'direction' in locale.textInfo &&\n (locale.textInfo?.direction === 'rtl' ||\n locale.textInfo?.direction === 'ltr')\n ) {\n return locale.textInfo?.direction;\n }\n\n return undefined;\n}\n\nfunction isRtlScript(script: string | undefined): boolean {\n return script ? RTL_SCRIPTS.has(script.toLowerCase()) : false;\n}\n\nfunction isRtlLanguage(language: string | undefined): boolean {\n return language ? RTL_LANGUAGES.has(language.toLowerCase()) : false;\n}\n","const GT_ERROR_PREFIX = 'GT Error:';\n\nexport const translationTimeoutError = (timeout: number) =>\n `${GT_ERROR_PREFIX} Translation request timed out after ${timeout}ms.`;\n\nexport const translationRequestFailedError = (error: string) =>\n `${GT_ERROR_PREFIX} Translation request failed. Error: ${error}`;\n\nexport const apiError = (status: number, statusText: string, error: string) =>\n `${GT_ERROR_PREFIX} API returned error status. Status: ${status}, Status Text: ${statusText}, Error: ${error}`;\n\nexport const invalidAuthError = `${GT_ERROR_PREFIX} Invalid authentication.`;\n\nexport const noTargetLocaleProvidedError = (functionName: string) =>\n `${GT_ERROR_PREFIX} Cannot call \\`${functionName}\\` without a specified locale. Either pass a locale to the \\`${functionName}\\` function or specify a targetLocale in the GT constructor.`;\n\nexport const noSourceLocaleProvidedError = (functionName: string) =>\n `${GT_ERROR_PREFIX} Cannot call \\`${functionName}\\` without a specified locale. Either pass a locale to the \\`${functionName}\\` function or specify a sourceLocale in the GT constructor.`;\n\nexport const noProjectIdProvidedError = (functionName: string) =>\n `${GT_ERROR_PREFIX} Cannot call \\`${functionName}\\` without a specified project ID. Either pass a project ID to the \\`${functionName}\\` function or specify a projectId in the GT constructor.`;\n\nexport const noApiKeyProvidedError = (functionName: string) =>\n `${GT_ERROR_PREFIX} Cannot call \\`${functionName}\\` without a specified API key. Either pass an API key to the \\`${functionName}\\` function or specify an apiKey in the GT constructor.`;\n\nexport const invalidLocaleError = (locale: string) =>\n `${GT_ERROR_PREFIX} Invalid locale: ${locale}.`;\n\nexport const invalidLocalesError = (locales: string[]) =>\n `${GT_ERROR_PREFIX} Invalid locales: ${locales.join(', ')}.`;\n","import { translationTimeoutError } from '../../logging/errors';\nimport { defaultTimeout } from '../../settings/settings';\n\n/**\n * @internal\n *\n * Wraps the fetch function with a timeout.\n *\n * @param url - The URL to fetch.\n * @param options - The options to pass to the fetch function.\n * @param timeout - The timeout in milliseconds.\n * @returns The response from the fetch function.\n */\nexport default async function fetchWithTimeout(\n url: string | URL | globalThis.Request,\n options: RequestInit,\n timeout?: number\n) {\n const controller = new AbortController();\n const signal = controller.signal;\n\n timeout = timeout ? timeout : defaultTimeout;\n const timeoutId = timeout\n ? setTimeout(() => controller.abort(), timeout)\n : null;\n\n try {\n const response = await fetch(url, { ...options, signal });\n return response;\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n throw translationTimeoutError(timeout);\n }\n throw error;\n } finally {\n if (timeoutId) clearTimeout(timeoutId);\n }\n}\n","export class ApiError extends Error {\n public code: number;\n public message: string;\n\n constructor(error: string, code: number, message: string) {\n super(error);\n this.name = 'ApiError';\n this.code = code;\n this.message = message;\n }\n\n getCode() {\n return this.code;\n }\n\n getMessage() {\n return this.message;\n }\n}\n","import { apiError } from '../../logging/errors';\nimport { ApiError } from '../../errors/ApiError';\n\nexport default async function validateResponse(response: Response) {\n if (!response.ok) {\n let errorMsg = 'Unknown error';\n try {\n const text = await response.text();\n try {\n const errorJson = JSON.parse(text) as { error: string };\n errorMsg = errorJson.error;\n } catch {\n errorMsg = text || 'Unknown error';\n }\n } catch {\n // response.text() failed, keep 'Unknown error'\n }\n const errorMessage = apiError(\n response.status,\n response.statusText,\n errorMsg\n );\n const error = new ApiError(errorMessage, response.status, errorMsg);\n throw error;\n }\n}\n","import { fetchLogger } from '../../logging/logger';\nimport {\n translationRequestFailedError,\n translationTimeoutError,\n} from '../../logging/errors';\n\nexport default function handleFetchError(\n error: unknown,\n timeout: number\n): never {\n if (error instanceof Error && error.name === 'AbortError') {\n const errorMessage = translationTimeoutError(timeout);\n fetchLogger.error(errorMessage);\n throw new Error(errorMessage);\n }\n const errorMessage = translationRequestFailedError(\n error instanceof Error ? error.message : String(error)\n );\n fetchLogger.error(errorMessage);\n throw error;\n}\n","export const API_VERSION = '2026-03-06.v1';\n","import { TranslationRequestConfig } from '../../types';\nimport { API_VERSION } from '../api';\n\nexport default function generateRequestHeaders(\n config: TranslationRequestConfig,\n excludeContentType = false\n) {\n const authHeaders: Record<string, string> = {\n ...(!excludeContentType && { 'Content-Type': 'application/json' }),\n 'x-gt-project-id': config.projectId,\n };\n\n if (config.apiKey) {\n if (config.apiKey.startsWith('gtx-internal-')) {\n authHeaders['x-gt-internal-api-key'] = config.apiKey;\n } else {\n authHeaders['x-gt-api-key'] = config.apiKey;\n }\n }\n\n authHeaders['gt-api-version'] = API_VERSION;\n\n return authHeaders;\n}\n","import { TranslationRequestConfig } from '../../types';\nimport { defaultBaseUrl } from '../../settings/settingsUrls';\nimport { defaultTimeout } from '../../settings/settings';\nimport fetchWithTimeout from './fetchWithTimeout';\nimport validateResponse from './validateResponse';\nimport handleFetchError from './handleFetchError';\nimport generateRequestHeaders from './generateRequestHeaders';\n\nconst MAX_RETRIES = 3;\nconst INITIAL_DELAY_MS = 500;\n\ntype RetryPolicy = 'exponential' | 'linear' | 'none';\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction getRetryDelay(policy: RetryPolicy, attempt: number): number {\n switch (policy) {\n case 'linear':\n return INITIAL_DELAY_MS * (attempt + 1);\n case 'exponential':\n return INITIAL_DELAY_MS * 2 ** attempt;\n default:\n return 0;\n }\n}\n\n/**\n * @internal\n *\n * Makes an API request with automatic retry for 5XX errors.\n *\n * Encapsulates URL construction, fetch with timeout, error handling,\n * response validation, and JSON parsing.\n *\n * @param config - The configuration for the API call\n * @param endpoint - The API endpoint path (e.g. '/v2/project/jobs/info')\n * @param options - Optional request options\n * @returns The parsed JSON response\n */\nexport default async function apiRequest<T>(\n config: TranslationRequestConfig,\n endpoint: string,\n options?: {\n body?: unknown;\n timeout?: number;\n method?: 'GET' | 'POST';\n retryPolicy?: RetryPolicy;\n }\n): Promise<T> {\n const timeout = options?.timeout ?? defaultTimeout;\n const url = `${config.baseUrl || defaultBaseUrl}${endpoint}`;\n const method = options?.method ?? 'POST';\n const retryPolicy = options?.retryPolicy ?? 'exponential';\n const maxRetries = retryPolicy === 'none' ? 0 : MAX_RETRIES;\n\n const requestInit: RequestInit = {\n method,\n headers: generateRequestHeaders(config),\n };\n if (options?.body !== undefined) {\n requestInit.body = JSON.stringify(options.body);\n }\n\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n let response: Response;\n try {\n response = await fetchWithTimeout(url, requestInit, timeout);\n } catch (error) {\n if (attempt < maxRetries) {\n await sleep(getRetryDelay(retryPolicy, attempt));\n continue;\n }\n handleFetchError(error, timeout);\n }\n\n // Retry on 5XX server errors\n if (response!.status >= 500 && attempt < maxRetries) {\n await sleep(getRetryDelay(retryPolicy, attempt));\n continue;\n }\n\n await validateResponse(response!);\n return (await response!.json()) as T;\n }\n\n throw new Error('Max retries exceeded');\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 {\n TranslationRequestConfig,\n TranslateManyResult,\n TranslationResult,\n} from '../types';\nimport { defaultRuntimeApiUrl } from '../settings/settingsUrls';\nimport {\n TranslateManyEntry,\n TranslateOptions,\n EntryMetadata,\n} from '../types-dir/api/entry';\nimport apiRequest from './utils/apiRequest';\nimport { Content } from '../types-dir/jsx/content';\nimport { hashSource } from '../id';\n\n/**\n * @internal\n *\n * Translates multiple entries in a single API request for better performance.\n * This function batches multiple translation requests together and sends them\n * to the GT translation API in one call.\n *\n * @param requests - The entries to translate. Can be an array (entries are hashed and results returned in order) or a record keyed by hash (skips hash calculation, returns a record).\n * @param globalMetadata - The metadata for the translation.\n * @param config - The configuration for the translation.\n * @returns The results of the translation. An array if requests was an array, a record if requests was a record.\n */\nexport default async function _translateMany<\n T extends TranslateManyEntry[] | Record<string, TranslateManyEntry>,\n>(\n requests: T,\n globalMetadata: {\n targetLocale: string;\n sourceLocale: string;\n } & TranslateOptions,\n config: TranslationRequestConfig,\n timeout?: number\n): Promise<\n T extends TranslateManyEntry[]\n ? TranslateManyResult\n : Record<string, TranslationResult>\n>;\nexport default async function _translateMany(\n requests: TranslateManyEntry[] | Record<string, TranslateManyEntry>,\n globalMetadata: {\n targetLocale: string;\n sourceLocale: string;\n } & TranslateOptions,\n config: TranslationRequestConfig,\n timeout?: number\n): Promise<TranslateManyResult | Record<string, TranslationResult>> {\n const isArray = Array.isArray(requests);\n\n // normalize and map from requests to requests record\n const hashOrder: string[] | undefined = isArray ? [] : undefined;\n const requestsObject: Record<\n string,\n { source: Content; metadata?: EntryMetadata }\n > = {};\n\n const entries: [string | undefined, TranslateManyEntry][] = isArray\n ? requests.map((r) => [undefined, r])\n : Object.entries(requests);\n\n for (const [key, request] of entries) {\n const normalized =\n typeof request === 'string' ? { source: request } : request;\n const { source, metadata } = normalized;\n const hash =\n key ??\n metadata?.hash ??\n hashSource({\n source,\n dataFormat: metadata?.dataFormat ?? 'STRING',\n ...(metadata ?? {}),\n });\n hashOrder?.push(hash);\n requestsObject[hash] = {\n source,\n metadata: metadata,\n };\n }\n\n const response = await apiRequest<Record<string, TranslationResult>>(\n { ...config, baseUrl: config.baseUrl || defaultRuntimeApiUrl },\n `/v2/translate`,\n {\n body: {\n requests: requestsObject,\n targetLocale: globalMetadata.targetLocale,\n sourceLocale: globalMetadata.sourceLocale,\n metadata: globalMetadata,\n },\n timeout: timeout,\n retryPolicy: 'none',\n }\n );\n\n // If input was an array, map the record response back to an array in input order\n if (hashOrder) {\n return hashOrder.map(\n (hash) =>\n response[hash] ?? {\n success: false,\n error: 'No translation returned',\n code: 500,\n }\n );\n }\n\n // If input was a record, return the record response directly\n return response;\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\nimport type { FileReference } from '../types-dir/api/file';\n\nexport type SetupProjectResult =\n | { setupJobId: string; status: 'queued' }\n | { status: 'completed' };\n\nexport type SetupProjectOptions = {\n force?: boolean;\n locales?: string[];\n timeoutMs?: number;\n};\n\n/**\n * @internal\n * Enqueues files for project setup the General Translation API.\n * @param files - References of files to translate (file content already uploaded)\n * @param config - The configuration for the API call\n * @param timeoutMS - The timeout in milliseconds\n * @returns The result of the API call\n */\nexport default async function _setupProject(\n files: FileReference[],\n config: TranslationRequestConfig,\n options?: SetupProjectOptions\n): Promise<SetupProjectResult> {\n return apiRequest<SetupProjectResult>(config, '/v2/project/setup/generate', {\n body: {\n files: files.map((f) => ({\n branchId: f.branchId,\n fileId: f.fileId,\n versionId: f.versionId,\n })),\n locales: options?.locales,\n force: options?.force,\n },\n timeout: options?.timeoutMs,\n });\n}\n","/**\n * Splits an array into batches of a specified size.\n * @param items - The array to split into batches\n * @param batchSize - The maximum size of each batch\n * @returns An array of batches\n */\nexport function createBatches<T>(items: T[], batchSize: number): T[][] {\n const batches: T[][] = [];\n for (let i = 0; i < items.length; i += batchSize) {\n batches.push(items.slice(i, i + batchSize));\n }\n return batches;\n}\n\n/**\n * Result of processing batches\n */\nexport interface BatchList<T> {\n /** The items successfully processed across all batches */\n data: T[];\n /** The total number of items processed */\n count: number;\n /** The number of batches processed */\n batchCount: number;\n}\n\n/**\n * Options for batch processing\n */\nexport interface BatchProcessOptions {\n /** Maximum number of items per batch (default: 100) */\n batchSize?: number;\n /** Whether to process batches in parallel (default: true) */\n parallel?: boolean;\n}\n\n/**\n * Processes items in batches using a provided processor function.\n *\n * @param items - The items to process\n * @param processor - Async function that processes a single batch and returns items\n * @param options - Optional configuration for batch processing\n * @returns Promise that resolves to a BatchList containing all processed items\n *\n * @example\n * ```typescript\n * const result = await processBatches(\n * files,\n * async (batch) => {\n * const response = await uploadFiles(batch);\n * return response.uploadedFiles;\n * },\n * { batchSize: 100 }\n * );\n *\n * console.log(result.data); // All items\n * console.log(result.count); // Total count\n * console.log(result.batchCount); // Number of batches processed\n * ```\n */\nexport async function processBatches<TInput, TOutput>(\n items: TInput[],\n processor: (batch: TInput[]) => Promise<TOutput[]>,\n options: BatchProcessOptions = {}\n): Promise<BatchList<TOutput>> {\n const { batchSize = 100, parallel = true } = options;\n\n if (items.length === 0) {\n return {\n data: [],\n count: 0,\n batchCount: 0,\n };\n }\n\n const batches = createBatches(items, batchSize);\n const allItems: TOutput[] = [];\n\n if (parallel) {\n // Process all batches in parallel\n const results = await Promise.all(batches.map((batch) => processor(batch)));\n for (const result of results) {\n if (result) {\n allItems.push(...result);\n }\n }\n } else {\n // Process batches sequentially\n for (const batch of batches) {\n const result = await processor(batch);\n if (result) {\n allItems.push(...result);\n }\n }\n }\n\n return {\n data: allItems,\n count: allItems.length,\n batchCount: batches.length,\n };\n}\n","import { TranslationRequestConfig, EnqueueFilesResult } from '../types';\nimport apiRequest from './utils/apiRequest';\nimport type { FileReferenceIds } from '../types-dir/api/file';\nimport { processBatches } from './utils/batch';\n\nexport type EnqueueOptions = {\n sourceLocale?: string;\n targetLocales: string[];\n requireApproval?: boolean;\n modelProvider?: string;\n force?: boolean;\n timeout?: number;\n};\n\n/**\n * @internal\n * Enqueues files for translation in the General Translation API.\n * @param files - References of files to translate (file content already uploaded)\n * @param options - The options for the API call\n * @param config - The configuration for the API call\n * @returns The result of the API call\n */\nexport default async function _enqueueFiles(\n files: FileReferenceIds[],\n options: EnqueueOptions,\n config: TranslationRequestConfig\n): Promise<EnqueueFilesResult> {\n const result = await processBatches(\n files,\n async (batch) => {\n const body = {\n files: batch.map((f) => ({\n branchId: f.branchId,\n fileId: f.fileId,\n versionId: f.versionId,\n fileName: f.fileName,\n })),\n targetLocales: options.targetLocales,\n sourceLocale: options.sourceLocale,\n requireApproval: options.requireApproval,\n modelProvider: options.modelProvider,\n force: options.force,\n };\n\n const apiResult = await apiRequest<EnqueueFilesResult>(\n config,\n '/v2/project/translations/enqueue',\n { body, timeout: options.timeout }\n );\n return Array.from(Object.entries(apiResult.jobData));\n },\n { batchSize: 100 }\n );\n // flatten the result\n const jobs = Object.fromEntries(\n result.data.map(([jobId, jobData]) => [jobId, jobData])\n );\n return {\n jobData: jobs,\n locales: options.targetLocales,\n message: `Successfully enqueued ${result.count} file translation jobs in ${result.batchCount} batch(es)`,\n };\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\n\nexport type CreateTagFileReference = {\n fileId: string;\n versionId: string;\n branchId: string;\n};\n\nexport type CreateTagOptions = {\n tagId: string;\n files: CreateTagFileReference[];\n message?: string;\n};\n\nexport type CreateTagResult = {\n tag: {\n id: string;\n tagId: string;\n message: string | null;\n createdAt: string;\n updatedAt: string;\n };\n};\n\n/**\n * @internal\n * Creates or upserts a file tag in the General Translation API.\n * @param options - The tag creation options\n * @param config - The configuration for the API call\n * @returns The created or updated tag\n */\nexport default async function _createTag(\n options: CreateTagOptions,\n config: TranslationRequestConfig\n): Promise<CreateTagResult> {\n return await apiRequest<CreateTagResult>(config, '/v2/project/tags/create', {\n body: {\n tagId: options.tagId,\n files: options.files,\n ...(options.message && { message: options.message }),\n },\n });\n}\n","import { TranslationRequestConfig } from '../types';\nimport {\n DownloadFileBatchOptions,\n DownloadFileBatchRequest,\n DownloadFileBatchResult,\n} from '../types-dir/api/downloadFileBatch';\nimport apiRequest from './utils/apiRequest';\nimport { decode } from '../utils/base64';\nimport { processBatches } from './utils/batch';\n\n/**\n * @internal\n * Downloads multiple translation files in batches.\n * @param files - Array of files to download\n * @param options - The options for the API call\n * @param config - The configuration for the request\n * @returns Promise resolving to a BatchList with all downloaded files\n */\nexport default async function _downloadFileBatch(\n requests: DownloadFileBatchRequest,\n options: DownloadFileBatchOptions,\n config: TranslationRequestConfig\n) {\n return processBatches(\n requests,\n async (batch) => {\n const result = await apiRequest<DownloadFileBatchResult>(\n config,\n '/v2/project/files/download',\n { body: batch, timeout: options.timeout }\n );\n\n // convert from base64 to string\n const files = result.files.map((file) => ({\n ...file,\n data: decode(file.data),\n }));\n\n return files;\n },\n { batchSize: 100 }\n );\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\nimport { processBatches } from './utils/batch';\n\nexport type SubmitUserEditDiff = {\n fileName: string;\n locale: string;\n diff: string;\n branchId: string;\n versionId: string;\n fileId: string;\n localContent: string;\n};\n\nexport type SubmitUserEditDiffsPayload = {\n diffs: SubmitUserEditDiff[];\n};\n\n/**\n * @internal\n * Submits user edit diffs so the service can learn/persist user-intended rules.\n */\nexport default async function _submitUserEditDiffs(\n payload: SubmitUserEditDiffsPayload,\n config: TranslationRequestConfig,\n options: { timeout?: number } = {}\n): Promise<{ success: boolean }> {\n await processBatches(\n payload.diffs,\n async (batch) => {\n await apiRequest(config, '/v2/project/files/diffs', {\n body: { diffs: batch } satisfies SubmitUserEditDiffsPayload,\n timeout: options.timeout,\n });\n return [{ success: true }];\n },\n { batchSize: 100 }\n );\n\n return { success: true };\n}\n","import { intlCache } from '../cache/IntlCache';\nimport { libraryDefaultLocale } from '../internal';\nimport { defaultEmoji, emojis } from './getLocaleEmoji';\nimport { _standardizeLocale } from './isValidLocale';\n\nexport type CustomRegionMapping = {\n [region: string]: { name?: string; emoji?: string; locale?: string };\n};\n\n/**\n * Retrieves multiple properties for a given region code, including:\n * - `code`: the original region code\n * - `name`: the localized display name\n * - `emoji`: the associated flag or symbol\n *\n * Behavior:\n * - Accepts ISO 3166-1 alpha-2 or UN M.49 region codes (e.g., `\"US\"`, `\"FR\"`, `\"419\"`).\n * - If `customMapping` contains a `name` or `emoji` for the region, those override the default values.\n * - Otherwise, uses `Intl.DisplayNames` to get the localized region name in the given `defaultLocale`,\n * falling back to `libraryDefaultLocale`.\n * - Falls back to the region code as `name` if display name resolution fails.\n * - Falls back to `defaultEmoji` if no emoji mapping is found in `emojis` or `customMapping`.\n *\n * @param {string} region - The region code to look up (e.g., `\"US\"`, `\"GB\"`, `\"DE\"`).\n * @param {string} [defaultLocale=libraryDefaultLocale] - The locale to use when localizing the region name.\n * @param {CustomRegionMapping} [customMapping] - Optional mapping of region codes to custom names and/or emojis.\n * @returns {{ code: string, name: string, emoji: string }} An object containing:\n * - `code`: the input region code\n * - `name`: the localized or custom region name\n * - `emoji`: the matching emoji flag or symbol\n * @internal\n *\n * @example\n * _getRegionProperties('US', 'en');\n * // => { code: 'US', name: 'United States', emoji: '🇺🇸' }\n *\n * @example\n * _getRegionProperties('US', 'fr');\n * // => { code: 'US', name: 'États-Unis', emoji: '🇺🇸' }\n *\n * @example\n * _getRegionProperties('US', 'en', { US: { name: 'USA', emoji: '🗽' } });\n * // => { code: 'US', name: 'USA', emoji: '🗽' }\n */\nexport function _getRegionProperties(\n region: string,\n defaultLocale: string = libraryDefaultLocale,\n customMapping?: CustomRegionMapping\n): {\n code: string;\n name: string;\n emoji: string;\n locale?: string; // locale is a hidden return field, because we don't want to guarantee it, but we also need customMapping to work with it\n} {\n defaultLocale ||= libraryDefaultLocale;\n try {\n const displayNames = intlCache.get(\n 'DisplayNames',\n [defaultLocale, libraryDefaultLocale], // default language order\n { type: 'region' }\n );\n return {\n code: region,\n name: displayNames.of(region) || region,\n emoji: emojis[region] || defaultEmoji,\n ...customMapping?.[region],\n };\n } catch {\n return {\n code: region,\n name: region,\n emoji: defaultEmoji,\n ...customMapping?.[region],\n };\n }\n}\n","import { CustomMapping } from './customLocaleMapping';\n\n/**\n * Resolves the alias locale for a given locale.\n * @param locale - The locale to resolve the alias locale for\n * @param customMapping - The custom mapping to use for resolving the alias locale\n * @returns The alias locale\n */\nexport function _resolveAliasLocale(\n locale: string,\n customMapping?: CustomMapping\n): string {\n let reverseCustomMapping: Record<string, string> | undefined;\n if (customMapping) {\n reverseCustomMapping = Object.fromEntries(\n Object.entries(customMapping)\n .filter(\n ([, value]) => value && typeof value === 'object' && 'code' in value\n )\n .map(([key, value]) => [(value as { code: string }).code, key])\n );\n }\n\n return reverseCustomMapping?.[locale] || locale;\n}\n","import { shouldUseCanonicalLocale } from './customLocaleMapping';\nimport { CustomMapping } from './customLocaleMapping';\n\n/**\n * Resolves the canonical locale for a given locale.\n * @param locale - The locale to resolve the canonical locale for\n * @param customMapping - The custom mapping to use for resolving the canonical locale\n * @returns The canonical locale\n */\nexport function _resolveCanonicalLocale(\n locale: string,\n customMapping?: CustomMapping\n): string {\n if (customMapping && shouldUseCanonicalLocale(locale, customMapping)) {\n return (customMapping[locale] as { code: string }).code;\n }\n\n return locale;\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\nimport { encode } from '../utils/base64';\nimport { processBatches } from './utils/batch';\n\nimport {\n FileUpload,\n UploadFilesResponse,\n RequiredUploadFilesOptions,\n} from '../types-dir/api/uploadFiles';\n\n/**\n * @internal\n * Uploads source files to the General Translation API in batches.\n * @param files - The files to upload\n * @param options - The options for the API call\n * @param config - The configuration for the API call\n * @returns Promise resolving to a BatchList with all uploaded files\n */\nexport default async function _uploadSourceFiles(\n files: { source: FileUpload }[],\n options: RequiredUploadFilesOptions,\n config: TranslationRequestConfig\n) {\n return processBatches(\n files,\n async (batch) => {\n const body = {\n data: batch.map(({ source }) => ({\n source: {\n content: encode(source.content),\n fileName: source.fileName,\n fileFormat: source.fileFormat,\n locale: source.locale,\n dataFormat: source.dataFormat,\n formatMetadata: source.formatMetadata,\n fileId: source.fileId,\n versionId: source.versionId,\n branchId: source.branchId,\n incomingBranchId: source.incomingBranchId,\n checkedOutBranchId: source.checkedOutBranchId,\n },\n })),\n sourceLocale: options.sourceLocale,\n };\n\n const result = await apiRequest<UploadFilesResponse>(\n config,\n '/v2/project/files/upload-files',\n { body, timeout: options.timeout }\n );\n\n return result.uploadedFiles || [];\n },\n { batchSize: 100 }\n );\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\nimport { processBatches } from './utils/batch';\n\nimport {\n FileUpload,\n UploadFilesResponse,\n RequiredUploadFilesOptions,\n} from '../types-dir/api/uploadFiles';\nimport { encode } from '../utils/base64';\n\n/**\n * @internal\n * Uploads multiple translations to the General Translation API in batches.\n * @param files - Translations to upload with their source\n * @param options - The options for the API call\n * @param config - The configuration for the API call\n * @returns Promise resolving to a BatchList with all uploaded files\n */\nexport default async function _uploadTranslations(\n files: {\n source: FileUpload;\n translations: FileUpload[];\n }[],\n options: RequiredUploadFilesOptions,\n config: TranslationRequestConfig\n) {\n return processBatches(\n files,\n async (batch) => {\n const body = {\n data: batch.map(({ source, translations }) => ({\n source: {\n content: encode(source.content),\n fileName: source.fileName,\n fileFormat: source.fileFormat,\n locale: source.locale,\n dataFormat: source.dataFormat,\n formatMetadata: source.formatMetadata,\n fileId: source.fileId,\n versionId: source.versionId,\n branchId: source.branchId,\n },\n translations: translations.map((t) => ({\n content: encode(t.content),\n fileName: t.fileName,\n fileFormat: t.fileFormat,\n locale: t.locale,\n dataFormat: t.dataFormat,\n fileId: t.fileId,\n versionId: t.versionId,\n branchId: t.branchId,\n })),\n })),\n sourceLocale: options.sourceLocale,\n };\n\n const result = await apiRequest<UploadFilesResponse>(\n config,\n '/v2/project/files/upload-translations',\n { body, timeout: options.timeout }\n );\n\n return result.uploadedFiles || [];\n },\n { batchSize: 100 }\n );\n}\n","import { TranslationRequestConfig } from '../types';\nimport {\n CheckFileTranslationsOptions,\n FileQueryResult,\n} from '../types-dir/api/checkFileTranslations';\nimport { FileQuery } from '../types-dir/api/checkFileTranslations';\nimport apiRequest from './utils/apiRequest';\n\n/**\n * @internal\n * Gets the source file and translation information for a given file ID and version ID.\n * @param query - The file ID and version ID to get the source file and translation information for\n * @param options - The options for the API call\n * @param config - The configuration for the request\n * @returns The source file and translation information for the given file ID and version ID\n */\nexport default async function _querySourceFile(\n query: FileQuery,\n options: CheckFileTranslationsOptions,\n config: TranslationRequestConfig\n): Promise<FileQueryResult> {\n const branchId = query.branchId;\n const versionId = query.versionId;\n const fileId = query.fileId;\n\n const searchParams = new URLSearchParams();\n if (branchId) {\n searchParams.set('branchId', branchId);\n }\n if (versionId) {\n searchParams.set('versionId', versionId);\n }\n const endpoint = `/v2/project/translations/files/status/${encodeURIComponent(fileId)}?${searchParams.toString()}`;\n\n return apiRequest<FileQueryResult>(config, endpoint, {\n method: 'GET',\n timeout: options.timeout,\n });\n}\n","import { defaultBaseUrl } from '../settings/settingsUrls';\nimport fetchWithTimeout from '../translate/utils/fetchWithTimeout';\nimport { defaultTimeout } from '../settings/settings';\nimport validateResponse from '../translate/utils/validateResponse';\nimport handleFetchError from '../translate/utils/handleFetchError';\nimport { TranslationRequestConfig } from '../types';\nimport generateRequestHeaders from '../translate/utils/generateRequestHeaders';\nimport { ProjectData } from '../types-dir/api/project';\n\n/**\n * @internal\n * Gets the project data for a given project ID.\n * @param projectId - The project ID to get the project data for\n * @param options - The options for the API call\n * @param config - The configuration for the request\n * @returns The project data for the given project ID\n */\nexport default async function _getProjectData(\n projectId: string,\n options: { timeout?: number },\n config: TranslationRequestConfig\n): Promise<ProjectData> {\n const { baseUrl } = config;\n const timeout = options.timeout ? options.timeout : defaultTimeout;\n const url = `${baseUrl || defaultBaseUrl}/v2/project/info/${encodeURIComponent(projectId)}`;\n\n // Get the project data\n let response;\n try {\n response = await fetchWithTimeout(\n url,\n {\n method: 'GET',\n headers: generateRequestHeaders(config),\n },\n timeout\n );\n } catch (error) {\n handleFetchError(error, timeout);\n }\n\n // Validate the response\n await validateResponse(response);\n\n const result = await response.json();\n return result as ProjectData;\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\n\nexport type JobStatus =\n | 'queued'\n | 'processing'\n | 'completed'\n | 'failed'\n | 'unknown';\n\nexport type CheckJobStatusResult = {\n jobId: string;\n status: JobStatus;\n error?: { message: string };\n}[];\n\n/**\n * @internal\n * Queries job statuses for a project\n * @param jobIds - Job IDs\n * @param config - The configuration for the API call\n * @param timeoutMS - The timeout in milliseconds\n * @returns The result of the API call\n */\nexport async function _checkJobStatus(\n jobIds: string[],\n config: TranslationRequestConfig,\n timeoutMs?: number\n): Promise<CheckJobStatusResult> {\n return apiRequest<CheckJobStatusResult>(config, '/v2/project/jobs/info', {\n body: { jobIds },\n timeout: timeoutMs,\n });\n}\n","import { EnqueueFilesResult } from '../types-dir/api/enqueueFiles';\nimport { TranslationRequestConfig } from '../types';\nimport { _checkJobStatus, JobStatus } from './checkJobStatus';\n\nexport type AwaitJobsOptions = {\n /** Polling interval in seconds. Defaults to 5. */\n pollingIntervalSeconds?: number;\n /** Timeout in seconds. Defaults to 600 (10 minutes). If reached, resolves with whatever status is current. */\n timeoutSeconds?: number;\n};\n\nexport type JobResult = {\n jobId: string;\n status: JobStatus;\n error?: { message: string };\n};\n\nexport type AwaitJobsResult = {\n /** Whether all jobs completed (none still in progress). */\n complete: boolean;\n jobs: JobResult[];\n};\n\n/**\n * @internal\n * Polls job statuses until all jobs are finished or the timeout is reached.\n * @param enqueueResult - The result from enqueueFiles\n * @param options - Polling configuration\n * @param config - API credentials and configuration\n * @returns The final status of all jobs\n */\nexport default async function _awaitJobs(\n enqueueResult: EnqueueFilesResult,\n options: AwaitJobsOptions | undefined,\n config: TranslationRequestConfig\n): Promise<AwaitJobsResult> {\n const pollingInterval = (options?.pollingIntervalSeconds ?? 5) * 1000;\n const DEFAULT_TIMEOUT_MS = 10 * 60 * 1000; // 10 minutes\n const timeout =\n options?.timeoutSeconds !== undefined\n ? options.timeoutSeconds * 1000\n : DEFAULT_TIMEOUT_MS;\n\n const jobIds = Object.keys(enqueueResult.jobData);\n\n if (jobIds.length === 0) {\n return { complete: true, jobs: [] };\n }\n\n const startTime = Date.now();\n const finalStatuses = new Map<string, JobResult>(\n jobIds.map((id) => [id, { jobId: id, status: 'unknown' as JobStatus }])\n );\n const pendingJobIds = new Set(jobIds);\n\n while (pendingJobIds.size > 0) {\n const statuses = await _checkJobStatus(Array.from(pendingJobIds), config);\n\n for (const job of statuses) {\n if (\n job.status === 'completed' ||\n job.status === 'failed' ||\n job.status === 'unknown'\n ) {\n finalStatuses.set(job.jobId, {\n jobId: job.jobId,\n status: job.status,\n ...(job.error ? { error: job.error } : {}),\n });\n pendingJobIds.delete(job.jobId);\n } else {\n finalStatuses.set(job.jobId, {\n jobId: job.jobId,\n status: job.status,\n });\n }\n }\n\n if (pendingJobIds.size === 0) break;\n\n if (Date.now() - startTime >= timeout) break;\n\n await new Promise((resolve) => setTimeout(resolve, pollingInterval));\n }\n\n return {\n complete: pendingJobIds.size === 0,\n jobs: Array.from(finalStatuses.values()),\n };\n}\n","import { TranslationRequestConfig } from '../types';\nimport { CheckFileTranslationsOptions } from '../types-dir/api/checkFileTranslations';\nimport apiRequest from './utils/apiRequest';\n\nexport type FileDataQuery = {\n sourceFiles?: {\n fileId: string;\n versionId: string;\n branchId: string;\n }[];\n translatedFiles?: {\n fileId: string;\n versionId: string;\n branchId: string;\n locale: string;\n }[];\n};\n\nexport type FileDataResult = {\n sourceFiles?: {\n branchId: string;\n fileId: string;\n versionId: string;\n fileName: string;\n fileFormat: string;\n dataFormat: string | null;\n createdAt: string;\n updatedAt: string;\n approvalRequiredAt: string | null;\n publishedAt: string | null;\n locales: string[];\n sourceLocale: string;\n }[];\n translatedFiles?: {\n branchId: string;\n fileId: string;\n versionId: string;\n fileFormat: string;\n dataFormat: string | null;\n createdAt: string;\n updatedAt: string;\n approvedAt: string | null;\n publishedAt: string | null;\n completedAt: string | null;\n locale: string;\n }[];\n};\n\n/**\n * @internal\n * Queries data about one or more source or translation files.\n * @param data - Object mapping source or translation file information\n * @param options - The options for the API call\n * @param config - The configuration for the API call\n * @returns The file data\n */\nexport default async function _queryFileData(\n data: FileDataQuery,\n options: CheckFileTranslationsOptions = {},\n config: TranslationRequestConfig\n): Promise<FileDataResult> {\n const body = {\n sourceFiles: data.sourceFiles?.map((item) => ({\n fileId: item.fileId,\n versionId: item.versionId,\n branchId: item.branchId,\n })),\n translatedFiles: data.translatedFiles?.map((item) => ({\n fileId: item.fileId,\n versionId: item.versionId,\n branchId: item.branchId,\n locale: item.locale,\n })),\n };\n\n return apiRequest<FileDataResult>(config, '/v2/project/files/info', {\n body,\n timeout: options.timeout,\n });\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\nimport type { BranchDataResult } from '../types-dir/api/branch';\n\nexport type BranchQuery = {\n branchNames: string[];\n};\n\n/**\n * @internal\n * Queries branch information from the API.\n * @param query - Object mapping the current branch and incoming branches\n * @param config - The configuration for the API call\n * @returns The branch information\n */\nexport default async function _queryBranchData(\n query: BranchQuery,\n config: TranslationRequestConfig\n): Promise<BranchDataResult> {\n return apiRequest<BranchDataResult>(config, '/v2/project/branches/info', {\n body: query,\n });\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\n\nexport type CreateBranchQuery = {\n branchName: string;\n defaultBranch: boolean;\n};\n\nexport type CreateBranchResult = {\n branch: { id: string; name: string };\n};\n\n/**\n * @internal\n * Creates a new branch in the API.\n * @param query - Object mapping the branch name and default branch flag\n * @param config - The configuration for the API call\n * @returns The created branch information\n */\nexport default async function _createBranch(\n query: CreateBranchQuery,\n config: TranslationRequestConfig\n): Promise<CreateBranchResult> {\n return apiRequest<CreateBranchResult>(config, '/v2/project/branches/create', {\n body: query,\n });\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\nimport { processBatches } from './utils/batch';\n\nexport type MoveMapping = {\n oldFileId: string;\n newFileId: string;\n newFileName: string;\n};\n\nexport type MoveResult = {\n oldFileId: string;\n newFileId: string;\n success: boolean;\n newSourceFileId?: string;\n clonedTranslationsCount?: number;\n error?: string;\n};\n\nexport type ProcessMovesResponse = {\n results: MoveResult[];\n summary: {\n total: number;\n succeeded: number;\n failed: number;\n };\n};\n\nexport type ProcessMovesOptions = {\n timeout?: number;\n branchId?: string;\n};\n\n/**\n * @internal\n * Processes file moves by cloning source files and translations with new fileIds.\n * Called when the CLI detects that files have been moved/renamed.\n * @param moves - Array of move mappings (old fileId to new fileId)\n * @param options - Options including branchId and timeout\n * @param config - The configuration for the API call\n * @returns Promise resolving to the move results\n */\nexport default async function _processFileMoves(\n moves: MoveMapping[],\n options: ProcessMovesOptions,\n config: TranslationRequestConfig\n): Promise<ProcessMovesResponse> {\n if (moves.length === 0) {\n return {\n results: [],\n summary: { total: 0, succeeded: 0, failed: 0 },\n };\n }\n\n const batchResult = await processBatches(\n moves,\n async (batch) => {\n const result = await apiRequest<ProcessMovesResponse>(\n config,\n '/v2/project/files/moves',\n {\n body: { branchId: options.branchId, moves: batch },\n timeout: options.timeout,\n }\n );\n return result.results;\n },\n { batchSize: 100 }\n );\n\n const succeeded = batchResult.data.filter((r) => r.success).length;\n const failed = batchResult.data.filter((r) => !r.success).length;\n\n return {\n results: batchResult.data,\n summary: {\n total: moves.length,\n succeeded,\n failed,\n },\n };\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\nimport { createBatches } from './utils/batch';\n\nexport type OrphanedFile = {\n fileId: string;\n versionId: string;\n fileName: string;\n};\n\nexport type GetOrphanedFilesResult = {\n orphanedFiles: OrphanedFile[];\n};\n\n/**\n * @internal\n * Gets orphaned files for a branch - files that exist on the branch\n * but whose fileIds are not in the provided list.\n * Used for move detection.\n * @param branchId - The branch to check for orphaned files\n * @param fileIds - List of current file IDs (files that are NOT orphaned)\n * @param options - The options for the API call\n * @param config - The configuration for the API call\n * @returns The orphaned files\n */\nexport default async function _getOrphanedFiles(\n branchId: string,\n fileIds: string[],\n options: { timeout?: number } = {},\n config: TranslationRequestConfig\n): Promise<GetOrphanedFilesResult> {\n const makeRequest = (batchFileIds: string[]) =>\n apiRequest<GetOrphanedFilesResult>(config, '/v2/project/files/orphaned', {\n body: { branchId, fileIds: batchFileIds },\n timeout: options.timeout,\n });\n\n // If no fileIds, make a single request\n if (fileIds.length === 0) {\n return makeRequest([]);\n }\n\n // Split fileIds into batches of 100\n const batches = createBatches(fileIds, 100);\n\n // Process batches in parallel\n // Each batch returns files NOT in that batch's fileIds\n // True orphans are files that appear in ALL batch responses (intersection)\n const batchResults = await Promise.all(\n batches.map((batch) => makeRequest(batch))\n );\n\n if (batchResults.length === 1) {\n return batchResults[0];\n }\n\n // Find intersection of orphaned files across all batches\n // A file is truly orphaned only if it's not in ANY of our fileId batches\n // Start with first batch's orphans\n const orphanedFileMap = new Map<string, OrphanedFile>();\n for (const orphan of batchResults[0].orphanedFiles) {\n orphanedFileMap.set(orphan.fileId, orphan);\n }\n\n // Intersect with each subsequent batch\n for (let i = 1; i < batchResults.length; i++) {\n const batchOrphanIds = new Set(\n batchResults[i].orphanedFiles.map((f) => f.fileId)\n );\n Array.from(orphanedFileMap.keys()).forEach((fileId) => {\n if (!batchOrphanIds.has(fileId)) {\n orphanedFileMap.delete(fileId);\n }\n });\n }\n\n return {\n orphanedFiles: Array.from(orphanedFileMap.values()),\n };\n}\n","import { TranslationRequestConfig } from '../types';\nimport apiRequest from './utils/apiRequest';\n\nexport type PublishFileEntry = {\n fileId: string;\n versionId: string;\n branchId?: string;\n publish: boolean;\n fileName?: string;\n};\n\nexport type PublishFilesResult = {\n results: {\n fileId: string;\n versionId: string;\n locale?: string; // if locale is provided, it means this result is for a translation. Else it is for a source file.\n branchId: string;\n success: boolean;\n error?: string;\n }[];\n};\n\n/**\n * @internal\n * Publishes or unpublishes files on the CDN.\n * @param files - Array of file entries with publish flags\n * @param config - The configuration for the API call\n * @returns The result of the API call\n */\nexport default async function _publishFiles(\n files: PublishFileEntry[],\n config: TranslationRequestConfig\n): Promise<PublishFilesResult> {\n return await apiRequest<PublishFilesResult>(\n config,\n '/v2/project/files/publish',\n {\n body: { files },\n }\n );\n}\n","// `generaltranslation` language toolkit\n// © 2026, General Translation, Inc.\n\n// ----- IMPORTS ----- //\n\nimport _requiresTranslation from './locales/requiresTranslation';\nimport _determineLocale from './locales/determineLocale';\nimport {\n _formatNum,\n _formatCurrency,\n _formatList,\n _formatRelativeTime,\n _formatRelativeTimeFromDate,\n _selectRelativeTimeUnit,\n _formatDateTime,\n _formatMessageICU,\n _formatListToParts,\n _formatCutoff,\n _formatMessageString,\n} from './formatting/format';\nimport {\n CustomMapping,\n FormatVariables,\n TranslateManyResult,\n TranslationError,\n TranslationRequestConfig,\n TranslationResult,\n EnqueueFilesResult,\n CheckFileTranslationsOptions,\n DownloadFileBatchOptions,\n DownloadFileBatchResult,\n DownloadFileOptions,\n TranslateManyEntry,\n} from './types';\nimport _isSameLanguage from './locales/isSameLanguage';\nimport _getLocaleProperties, {\n LocaleProperties,\n} from './locales/getLocaleProperties';\nimport _getLocaleEmoji from './locales/getLocaleEmoji';\nimport { _isValidLocale, _standardizeLocale } from './locales/isValidLocale';\nimport { _getLocaleName } from './locales/getLocaleName';\nimport { _getLocaleDirection } from './locales/getLocaleDirection';\nimport { libraryDefaultLocale } from './internal';\nimport _isSameDialect from './locales/isSameDialect';\nimport _isSupersetLocale from './locales/isSupersetLocale';\nimport {\n noSourceLocaleProvidedError,\n noTargetLocaleProvidedError,\n invalidLocaleError,\n invalidLocalesError,\n noProjectIdProvidedError,\n noApiKeyProvidedError,\n} from './logging/errors';\nimport { gtInstanceLogger } from './logging/logger';\nimport _translateMany from './translate/translateMany';\nimport _setupProject, {\n SetupProjectResult,\n SetupProjectOptions,\n} from './translate/setupProject';\nimport _enqueueFiles, { EnqueueOptions } from './translate/enqueueFiles';\nimport _createTag, {\n CreateTagOptions,\n CreateTagResult,\n} from './translate/createTag';\nimport _downloadFileBatch from './translate/downloadFileBatch';\nimport {\n FileQuery,\n FileQueryResult,\n} from './types-dir/api/checkFileTranslations';\nimport _submitUserEditDiffs, {\n SubmitUserEditDiffsPayload,\n} from './translate/submitUserEditDiffs';\nimport {\n _getRegionProperties,\n CustomRegionMapping,\n} from './locales/getRegionProperties';\nimport { _resolveAliasLocale } from './locales/resolveAliasLocale';\nimport { _resolveCanonicalLocale } from './locales/resolveCanonicalLocale';\nimport _uploadSourceFiles from './translate/uploadSourceFiles';\nimport _uploadTranslations from './translate/uploadTranslations';\nimport {\n FileUpload,\n RequiredUploadFilesOptions,\n UploadFilesOptions,\n UploadFilesResponse,\n} from './types-dir/api/uploadFiles';\nimport _querySourceFile from './translate/querySourceFile';\nimport { ProjectData } from './types-dir/api/project';\nimport _getProjectData from './projects/getProjectData';\nimport { DownloadFileBatchRequest } from './types-dir/api/downloadFileBatch';\nimport {\n _checkJobStatus,\n CheckJobStatusResult,\n} from './translate/checkJobStatus';\nimport _awaitJobs, {\n AwaitJobsOptions,\n AwaitJobsResult,\n} from './translate/awaitJobs';\nimport type { FileDataQuery, FileDataResult } from './translate/queryFileData';\nimport _queryFileData from './translate/queryFileData';\nimport type { BranchQuery } from './translate/queryBranchData';\nimport type { BranchDataResult } from './types-dir/api/branch';\nimport _queryBranchData from './translate/queryBranchData';\nimport type {\n CreateBranchQuery,\n CreateBranchResult,\n} from './translate/createBranch';\nimport _createBranch from './translate/createBranch';\nimport type { FileReference, FileReferenceIds } from './types-dir/api/file';\nimport _processFileMoves, {\n type MoveMapping,\n type ProcessMovesResponse,\n type ProcessMovesOptions,\n} from './translate/processFileMoves';\nimport _getOrphanedFiles, {\n type GetOrphanedFilesResult,\n} from './translate/getOrphanedFiles';\nimport _publishFiles, {\n type PublishFileEntry,\n type PublishFilesResult,\n} from './translate/publishFiles';\nimport { CutoffFormatOptions } from './formatting/custom-formats/CutoffFormat/types';\nimport { TranslateOptions } from './types-dir/api/entry';\nimport { API_VERSION as _API_VERSION } from './translate/api';\nimport { StringFormat } from './types-dir/jsx/content';\n\n// ============================================================ //\n// Core Class //\n// ============================================================ //\n/**\n * Type representing the constructor parameters for the GT class.\n * @typedef {Object} GTConstructorParams\n * @property {string} [apiKey] - The API key for accessing the translation service\n * @property {string} [devApiKey] - The development API key for accessing the translation service\n * @property {string} [sourceLocale] - The default source locale for translations\n * @property {string} [targetLocale] - The default target locale for translations\n * @property {string[]} [locales] - Array of supported locales\n * @property {string} [projectId] - The project ID for the translation service\n * @property {string} [baseUrl] - The base URL for the translation service\n * @property {CustomMapping} [customMapping] - Custom mapping of locale codes to their names\n */\ntype GTConstructorParams = {\n apiKey?: string;\n devApiKey?: string;\n sourceLocale?: string;\n targetLocale?: string;\n locales?: string[];\n projectId?: string;\n baseUrl?: string;\n customMapping?: CustomMapping;\n};\n\n/**\n * GT is the core driver for the General Translation library.\n * This class provides functionality for locale management, formatting, and translation operations.\n *\n * @class GT\n * @description A comprehensive toolkit for handling internationalization and localization.\n *\n * @example\n * const gt = new GT({\n * sourceLocale: 'en-US',\n * targetLocale: 'es-ES',\n * locales: ['en-US', 'es-ES', 'fr-FR']\n * });\n */\nexport class GT {\n /** Base URL for the translation service API */\n baseUrl?: string;\n\n /** Project ID for the translation service */\n projectId?: string;\n\n /** API key for accessing the translation service */\n apiKey?: string;\n\n /** Development API key for accessing the translation service */\n devApiKey?: string;\n\n /** Source locale for translations */\n sourceLocale?: string;\n\n /** Target locale for translations */\n targetLocale?: string;\n\n /** Array of supported locales */\n locales?: string[];\n\n /** Array of locales used for rendering variables */\n _renderingLocales: string[] = [];\n\n /** Custom mapping for locale codes to their names */\n customMapping?: CustomMapping;\n\n /** Lazily derived reverse custom mapping for alias locales */\n reverseCustomMapping?: Record<string, string>;\n\n /** Lazily derived custom mapping for regions */\n customRegionMapping?: CustomRegionMapping;\n\n /**\n * Constructs an instance of the GT class.\n *\n * @param {GTConstructorParams} [params] - The parameters for initializing the GT instance\n * @throws {Error} If an invalid locale is provided\n * @throws {Error} If any of the provided locales are invalid\n *\n * @example\n * const gt = new GT({\n * apiKey: 'your-api-key',\n * sourceLocale: 'en-US',\n * targetLocale: 'es-ES',\n * locales: ['en-US', 'es-ES', 'fr-FR']\n * });\n */\n constructor(params: GTConstructorParams = {}) {\n // Read environment\n if (typeof process !== 'undefined') {\n this.apiKey ||= process.env?.GT_API_KEY;\n this.devApiKey ||= process.env?.GT_DEV_API_KEY;\n this.projectId ||= process.env?.GT_PROJECT_ID;\n }\n // Set up config\n this.setConfig(params);\n }\n\n setConfig({\n apiKey,\n devApiKey,\n sourceLocale,\n targetLocale,\n locales,\n projectId,\n customMapping,\n baseUrl,\n }: GTConstructorParams) {\n // ----- Environment properties ----- //\n if (apiKey) this.apiKey = apiKey;\n if (devApiKey) this.devApiKey = devApiKey;\n if (projectId) this.projectId = projectId;\n\n // ----- Standardize locales ----- //\n\n // source locale\n if (sourceLocale) {\n this.sourceLocale = _standardizeLocale(sourceLocale);\n if (!_isValidLocale(this.sourceLocale, customMapping))\n throw new Error(invalidLocaleError(this.sourceLocale));\n }\n\n // target locale\n if (targetLocale) {\n this.targetLocale = _standardizeLocale(targetLocale);\n if (!_isValidLocale(this.targetLocale, customMapping))\n throw new Error(invalidLocaleError(this.targetLocale));\n }\n\n // rendering locales\n this._renderingLocales = [];\n if (this.sourceLocale) this._renderingLocales.push(this.sourceLocale);\n if (this.targetLocale) this._renderingLocales.push(this.targetLocale);\n this._renderingLocales.push(libraryDefaultLocale);\n\n // locales\n if (locales) {\n const result: string[] = [];\n const invalidLocales: string[] = [];\n locales.forEach((locale) => {\n const standardizedLocale = _standardizeLocale(locale);\n if (_isValidLocale(standardizedLocale)) {\n result.push(standardizedLocale);\n } else {\n invalidLocales.push(locale);\n }\n });\n if (invalidLocales.length > 0) {\n throw new Error(invalidLocalesError(invalidLocales));\n }\n this.locales = result;\n }\n\n // ----- Other properties ----- //\n if (baseUrl) this.baseUrl = baseUrl;\n if (customMapping) {\n this.customMapping = customMapping;\n this.reverseCustomMapping = Object.fromEntries(\n Object.entries(customMapping)\n .filter(\n ([, value]) => value && typeof value === 'object' && 'code' in value\n )\n .map(([key, value]) => [(value as { code: string }).code, key])\n );\n }\n }\n\n // -------------- Private Methods -------------- //\n\n private _getTranslationConfig(): TranslationRequestConfig {\n return {\n baseUrl: this.baseUrl,\n apiKey: this.apiKey || this.devApiKey,\n projectId: this.projectId || '',\n };\n }\n\n private _validateAuth(functionName: string) {\n const errors: string[] = [];\n if (!this.apiKey && !this.devApiKey) {\n const error = noApiKeyProvidedError(functionName);\n errors.push(error);\n }\n if (!this.projectId) {\n const error = noProjectIdProvidedError(functionName);\n errors.push(error);\n }\n if (errors.length) {\n throw new Error(errors.join('\\n'));\n }\n }\n\n // -------------- Branch Methods -------------- //\n\n /**\n * Queries branch information from the API.\n *\n * @param {BranchQuery} query - Object mapping the current branch and incoming branches\n * @returns {Promise<BranchDataResult>} The branch information\n */\n async queryBranchData(query: BranchQuery): Promise<BranchDataResult> {\n this._validateAuth('queryBranchData');\n return await _queryBranchData(query, this._getTranslationConfig());\n }\n\n /**\n * Creates a new branch in the API. If the branch already exists, it will be returned.\n *\n * @param {CreateBranchQuery} query - Object mapping the branch name and default branch flag\n * @returns {Promise<CreateBranchResult>} The created branch information\n */\n async createBranch(query: CreateBranchQuery): Promise<CreateBranchResult> {\n this._validateAuth('createBranch');\n return await _createBranch(query, this._getTranslationConfig());\n }\n\n /**\n * Processes file moves by cloning source files and translations with new fileIds.\n * This is called when files have been moved/renamed and we want to preserve translations.\n *\n * @param {MoveMapping[]} moves - Array of move mappings (old fileId to new fileId)\n * @param {ProcessMovesOptions} options - Options including branchId and timeout\n * @returns {Promise<ProcessMovesResponse>} The move processing results\n *\n * @example\n * const result = await gt.processFileMoves([\n * { oldFileId: 'abc123', newFileId: 'def456', newFileName: 'locales/en.json' }\n * ], { branchId: 'main' });\n */\n async processFileMoves(\n moves: MoveMapping[],\n options: ProcessMovesOptions = {}\n ): Promise<ProcessMovesResponse> {\n this._validateAuth('processFileMoves');\n return await _processFileMoves(\n moves,\n options,\n this._getTranslationConfig()\n );\n }\n\n /**\n * Gets orphaned files for a branch - files that exist on the branch\n * but whose fileIds are not in the provided list.\n * Used for move detection.\n *\n * @param {string} branchId - The branch to check for orphaned files\n * @param {string[]} fileIds - List of current file IDs (files that are NOT orphaned)\n * @param {Object} options - Options including timeout\n * @returns {Promise<GetOrphanedFilesResult>} The orphaned files\n *\n * @example\n * const result = await gt.getOrphanedFiles('branch-id', ['file-1', 'file-2']);\n */\n async getOrphanedFiles(\n branchId: string,\n fileIds: string[],\n options: { timeout?: number } = {}\n ): Promise<GetOrphanedFilesResult> {\n this._validateAuth('getOrphanedFiles');\n return await _getOrphanedFiles(\n branchId,\n fileIds,\n options,\n this._getTranslationConfig()\n );\n }\n\n // -------------- Translation Methods -------------- //\n\n /**\n * Enqueues project setup job using the specified file references\n *\n * This method creates setup jobs that will process source file references\n * and generate a project setup. The files parameter contains references (IDs) to source\n * files that have already been uploaded via uploadSourceFiles. The setup jobs are queued\n * for processing and will generate a project setup based on the source files.\n *\n * @param {FileReference[]} files - Array of file references containing IDs of previously uploaded source files\n * @param {SetupProjectOptions} [options] - Optional settings for target locales and timeout\n * @returns {Promise<SetupProjectResult>} Object containing the jobId and status\n */\n async setupProject(\n files: FileReference[],\n options?: SetupProjectOptions\n ): Promise<SetupProjectResult> {\n this._validateAuth('setupProject');\n options = {\n ...options,\n locales: options?.locales?.map((locale) =>\n this.resolveCanonicalLocale(locale)\n ),\n };\n return await _setupProject(files, this._getTranslationConfig(), options);\n }\n\n /**\n * Checks the current status of one or more project jobs by their unique identifiers.\n *\n * This method polls the API to determine whether one or more jobs are still running,\n * have completed successfully, or have failed. Jobs are created after calling either enqueueFiles or setupProject.\n *\n * @param {string[]} jobIds - The unique identifiers of the jobs to check\n * @param {number} [timeoutMs] - Optional timeout in milliseconds for the API request\n * @returns {Promise<CheckJobStatusResult>} Object containing the job status\n *\n * @example\n * const result = await gt.checkJobStatus([\n * 'job-123',\n * 'job-456',\n * ], {\n * timeout: 10000,\n * });\n */\n async checkJobStatus(\n jobIds: string[],\n timeoutMs?: number\n ): Promise<CheckJobStatusResult> {\n this._validateAuth('checkJobStatus');\n return await _checkJobStatus(\n jobIds,\n this._getTranslationConfig(),\n timeoutMs\n );\n }\n\n /**\n * Polls job statuses until all jobs from enqueueFiles are finished or the timeout is reached.\n *\n * @param {EnqueueFilesResult} enqueueResult - The result returned from enqueueFiles\n * @param {AwaitJobsOptions} [options] - Polling configuration (interval, timeout)\n * @returns {Promise<AwaitJobsResult>} The final status of all jobs and whether they all completed\n */\n async awaitJobs(\n enqueueResult: EnqueueFilesResult,\n options?: AwaitJobsOptions\n ): Promise<AwaitJobsResult> {\n this._validateAuth('awaitJobs');\n return await _awaitJobs(\n enqueueResult,\n options,\n this._getTranslationConfig()\n );\n }\n\n /**\n * Enqueues translation jobs for previously uploaded source files.\n *\n * This method creates translation jobs that will process existing source files\n * and generate translations in the specified target languages. The files parameter\n * contains references (IDs) to source files that have already been uploaded via\n * uploadSourceFiles. The translation jobs are queued for processing and will\n * generate translated content based on the source files and target locales provided.\n *\n * @param {FileReferenceIds[]} files - Array of file references containing IDs of previously uploaded source files\n * @param {EnqueueOptions} options - Configuration options including source locale, target locales, and job settings\n * @returns {Promise<EnqueueFilesResult>} Result containing job IDs, queue status, and processing information\n */\n async enqueueFiles(\n files: FileReferenceIds[],\n options: EnqueueOptions\n ): Promise<EnqueueFilesResult> {\n // Validation\n this._validateAuth('enqueueFiles');\n\n // Merge instance settings with options\n let mergedOptions: EnqueueOptions = {\n ...options,\n sourceLocale: options.sourceLocale ?? this.sourceLocale!,\n targetLocales: options.targetLocales ?? [this.targetLocale!],\n };\n\n // Require source locale\n if (!mergedOptions.sourceLocale) {\n const error = noSourceLocaleProvidedError('enqueueFiles');\n gtInstanceLogger.error(error);\n throw new Error(error);\n }\n\n // Require target locale(s)\n if (\n !mergedOptions.targetLocales ||\n mergedOptions.targetLocales.length === 0\n ) {\n const error = noTargetLocaleProvidedError('enqueueFiles');\n gtInstanceLogger.error(error);\n throw new Error(error);\n }\n\n // Replace target locales with canonical locales\n mergedOptions = {\n ...mergedOptions,\n targetLocales: mergedOptions.targetLocales.map((locale) =>\n this.resolveCanonicalLocale(locale)\n ),\n };\n\n return await _enqueueFiles(\n files,\n mergedOptions,\n this._getTranslationConfig()\n );\n }\n\n /**\n * Creates or upserts a file tag, associating a set of source files\n * with a user-defined tag ID and optional message.\n *\n * @param {CreateTagOptions} options - Tag creation options including tagId, sourceFileIds, and optional message\n * @returns {Promise<CreateTagResult>} The created or updated tag\n */\n async createTag(options: CreateTagOptions): Promise<CreateTagResult> {\n this._validateAuth('createTag');\n return await _createTag(options, this._getTranslationConfig());\n }\n\n /**\n * Publishes or unpublishes files on the CDN.\n *\n * @param {PublishFileEntry[]} files - Array of file entries with publish flags\n * @returns {Promise<PublishFilesResult>} Result containing per-file success/failure\n */\n async publishFiles(files: PublishFileEntry[]): Promise<PublishFilesResult> {\n this._validateAuth('publishFiles');\n return await _publishFiles(files, this._getTranslationConfig());\n }\n\n /**\n * Submits user edit diffs for existing translations so future generations preserve user intent.\n *\n * @param {SubmitUserEditDiffsPayload} payload - Project-scoped diff payload.\n * @returns {Promise<void>} Resolves when submission succeeds.\n */\n async submitUserEditDiffs(\n payload: SubmitUserEditDiffsPayload\n ): Promise<void> {\n this._validateAuth('submitUserEditDiffs');\n // Normalize locales to canonical form before submission\n const normalized: SubmitUserEditDiffsPayload = {\n ...payload,\n diffs: (payload.diffs || []).map((d) => ({\n ...d,\n locale: this.resolveCanonicalLocale(d.locale),\n })),\n };\n await _submitUserEditDiffs(normalized, this._getTranslationConfig());\n }\n\n /**\n * Queries data about one or more source or translation files.\n *\n * @param {FileDataQuery} data - Object mapping source and translation file information.\n * @param {CheckFileTranslationsOptions} options - Options for the API call.\n * @returns {Promise<FileDataResult>} The source and translation file data information.\n *\n * @example\n * const result = await gt.queryFileData({\n * sourceFiles: [\n * { fileId: '1234567890', versionId: '1234567890', branchId: '1234567890' },\n * ],\n * translatedFiles: [\n * { fileId: '1234567890', versionId: '1234567890', branchId: '1234567890', locale: 'es-ES' },\n * ],\n * }, {\n * timeout: 10000,\n * });\n *\n */\n async queryFileData(\n data: FileDataQuery,\n options: CheckFileTranslationsOptions = {}\n ): Promise<FileDataResult> {\n // Validation\n this._validateAuth('queryFileData');\n\n // Replace target locales with canonical locales\n data.translatedFiles = data.translatedFiles?.map((item) => ({\n ...item,\n locale: this.resolveCanonicalLocale(item.locale),\n }));\n\n // Request the file translation status\n const result = await _queryFileData(\n data,\n options,\n this._getTranslationConfig()\n );\n\n // Resolve canonical locales\n result.translatedFiles = result.translatedFiles?.map((item) => ({\n ...item,\n ...(item.locale && { locale: this.resolveAliasLocale(item.locale) }),\n }));\n result.sourceFiles = result.sourceFiles?.map((item) => ({\n ...item,\n ...(item.sourceLocale && {\n sourceLocale: this.resolveAliasLocale(item.sourceLocale),\n }),\n locales: item.locales.map((locale) => this.resolveAliasLocale(locale)),\n }));\n return result;\n }\n\n /**\n * Gets source and translation information for a given file ID and version ID.\n *\n * @param {FileQuery} data - File query containing file ID and version ID.\n * @param {CheckFileTranslationsOptions} options - Options for getting source and translation information.\n * @returns {Promise<FileQueryResult>} The source file and translation information.\n *\n * @example\n * const result = await gt.querySourceFile(\n * { fileId: '1234567890', versionId: '1234567890' },\n * { timeout: 10000 }\n * );\n *\n */\n async querySourceFile(\n data: FileQuery,\n options: CheckFileTranslationsOptions = {}\n ): Promise<FileQueryResult> {\n // Validation\n this._validateAuth('querySourceFile');\n\n // Request the file translation status\n const result = await _querySourceFile(\n data,\n options,\n this._getTranslationConfig()\n );\n // Replace locales with canonical locales\n result.translations = result.translations.map((item) => ({\n ...item,\n ...(item.locale && { locale: this.resolveAliasLocale(item.locale) }),\n }));\n result.sourceFile.locales = result.sourceFile.locales.map((locale) =>\n this.resolveAliasLocale(locale)\n );\n if (result.sourceFile.sourceLocale) {\n result.sourceFile.sourceLocale = this.resolveAliasLocale(\n result.sourceFile.sourceLocale\n );\n }\n return result;\n }\n /**\n * Get project data for a given project ID.\n *\n * @param {string} projectId - The ID of the project to get the data for.\n * @returns {Promise<ProjectData>} The project data.\n *\n * @example\n * const result = await gt.getProjectData(\n * '1234567890'\n * );\n *\n */\n async getProjectData(\n projectId: string,\n options: { timeout?: number } = {}\n ): Promise<ProjectData> {\n // Validation\n this._validateAuth('getProjectData');\n\n // Request the file translation status\n const result = await _getProjectData(\n projectId,\n options,\n this._getTranslationConfig()\n );\n // Replace locales with canonical locales\n result.currentLocales = result.currentLocales.map((item) =>\n this.resolveAliasLocale(item)\n );\n result.defaultLocale = this.resolveAliasLocale(result.defaultLocale);\n return result;\n }\n\n /**\n * Downloads a single file.\n *\n * @param file - The file query object.\n * @param {string} file.fileId - The ID of the file to download.\n * @param {string} [file.branchId] - The ID of the branch to download the file from. If not provided, the default branch will be used.\n * @param {string} [file.locale] - The locale to download the file for. If not provided, the source file will be downloaded.\n * @param {string} [file.versionId] - The version ID to download the file from. If not provided, the latest version will be used.\n * @param {DownloadFileOptions} options - Options for downloading the file.\n * @returns {Promise<string>} The downloaded file content.\n *\n * @example\n * const result = await gt.downloadFile({\n * fileId: '1234567890',\n * branchId: '1234567890',\n * locale: 'es-ES',\n * versionId: '1234567890',\n * }, {\n * timeout: 10000,\n * });\n */\n async downloadFile(\n file: {\n fileId: string;\n branchId?: string;\n locale?: string;\n versionId?: string;\n useLatestAvailableVersion?: boolean;\n },\n options: DownloadFileOptions = {}\n ): Promise<string> {\n // Validation\n this._validateAuth('downloadTranslatedFile');\n\n const result = await _downloadFileBatch(\n [\n {\n fileId: file.fileId,\n branchId: file.branchId,\n locale: file.locale\n ? this.resolveCanonicalLocale(file.locale)\n : undefined,\n versionId: file.versionId,\n useLatestAvailableVersion: file.useLatestAvailableVersion,\n },\n ],\n options,\n this._getTranslationConfig()\n );\n return result.data?.[0]?.data ?? '';\n }\n\n /**\n * Downloads multiple files in a batch.\n *\n * @param {DownloadFileBatchRequest} requests - Array of file query objects to download.\n * @param {DownloadFileBatchOptions} options - Options for the batch download.\n * @returns {Promise<DownloadFileBatchResult>} The batch download results.\n *\n * @example\n * const result = await gt.downloadFileBatch([{\n * fileId: '1234567890',\n * locale: 'es-ES',\n * versionId: '1234567890',\n * }], {\n * timeout: 10000,\n * });\n */\n async downloadFileBatch(\n requests: DownloadFileBatchRequest,\n options: DownloadFileBatchOptions = {}\n ): Promise<DownloadFileBatchResult> {\n // Validation\n this._validateAuth('downloadFileBatch');\n\n requests = requests.map((request) => ({\n ...request,\n locale: request.locale\n ? this.resolveCanonicalLocale(request.locale)\n : undefined,\n }));\n\n // Request the batch download\n const result = await _downloadFileBatch(\n requests,\n options,\n this._getTranslationConfig()\n );\n\n return {\n files: result.data.map((file) => ({\n ...file,\n ...(file.locale && {\n locale: this.resolveAliasLocale(file.locale),\n }),\n })),\n count: result.count,\n };\n }\n\n /**\n * Translates a single source string to the target locale.\n * Routes through {@link translateMany} under the hood.\n *\n * @param {string} source - The source string to translate.\n * @param {object} options - Translation options including targetLocale and optional entry metadata.\n * @returns {Promise<TranslationResult | TranslationError>} The translated content.\n *\n * @example\n * const result = await gt.translate('Hello, world!', { targetLocale: 'es' });\n *\n * @example\n * const result = await gt.translate('Hello, world!', {\n * targetLocale: 'es',\n * dataFormat: 'ICU',\n * context: 'A formal greeting',\n * });\n */\n async translate(\n source: TranslateManyEntry,\n options: string | TranslateOptions,\n timeout?: number\n ): Promise<TranslationResult | TranslationError> {\n // Normalize string shorthand to options object\n if (typeof options === 'string') {\n options = { targetLocale: options };\n }\n\n // Validation\n this._validateAuth('translate');\n\n // Require target locale\n let targetLocale = options?.targetLocale || this.targetLocale;\n if (!targetLocale) {\n const error = noTargetLocaleProvidedError('translate');\n gtInstanceLogger.error(error);\n throw new Error(error);\n }\n\n // Replace target locale with canonical locale\n targetLocale = this.resolveCanonicalLocale(targetLocale);\n\n const sourceLocale = this.resolveCanonicalLocale(\n options?.sourceLocale || this.sourceLocale || libraryDefaultLocale\n );\n\n // Request the translation\n const results = await _translateMany(\n [source],\n {\n ...options,\n targetLocale,\n sourceLocale,\n },\n this._getTranslationConfig(),\n timeout\n );\n return results[0];\n }\n\n /**\n * Translates multiple source strings to the target locale.\n * Each entry can be a plain string or an object with source and metadata fields.\n *\n * @param {TranslateManyEntry[] | Record<string, TranslateManyEntry>} sources - The source entries to translate. Can be an array or a record keyed by hash.\n * @param {object} options - Translation options including targetLocale.\n * @returns {Promise<TranslateManyResult | Record<string, TranslationResult>>} The translated contents. An array if sources was an array, a record if sources was a record.\n *\n * @example\n * const result = await gt.translateMany(\n * ['Hello, world!', 'Goodbye, world!'],\n * { targetLocale: 'es' }\n * );\n *\n * @example\n * const result = await gt.translateMany(\n * [{ source: 'Hello, world!', dataFormat: 'ICU' }],\n * { targetLocale: 'es' }\n * );\n *\n * @example\n * const result = await gt.translateMany(\n * { 'my-hash': 'Hello, world!' },\n * { targetLocale: 'es' }\n * );\n */\n async translateMany(\n sources: TranslateManyEntry[],\n options: string | TranslateOptions,\n timeout?: number\n ): Promise<TranslateManyResult>;\n async translateMany(\n sources: Record<string, TranslateManyEntry>,\n options: string | TranslateOptions,\n timeout?: number\n ): Promise<Record<string, TranslationResult>>;\n async translateMany(\n sources: TranslateManyEntry[] | Record<string, TranslateManyEntry>,\n options: string | TranslateOptions,\n timeout?: number\n ): Promise<TranslateManyResult | Record<string, TranslationResult>> {\n // Normalize string shorthand to options object\n if (typeof options === 'string') {\n options = { targetLocale: options };\n }\n\n // Validation\n this._validateAuth('translateMany');\n\n // Require target locale\n let targetLocale = options?.targetLocale || this.targetLocale;\n if (!targetLocale) {\n const error = noTargetLocaleProvidedError('translateMany');\n gtInstanceLogger.error(error);\n throw new Error(error);\n }\n\n // Replace target locale with canonical locale\n targetLocale = this.resolveCanonicalLocale(targetLocale);\n\n const sourceLocale = this.resolveCanonicalLocale(\n options?.sourceLocale || this.sourceLocale || libraryDefaultLocale\n );\n\n // Request the translation\n return await _translateMany(\n sources,\n {\n ...options,\n targetLocale,\n sourceLocale,\n },\n this._getTranslationConfig(),\n timeout\n );\n }\n\n /**\n * Uploads source files to the translation service without any translation content.\n *\n * This method creates or replaces source file entries in your project. Each uploaded\n * file becomes a source that can later be translated into target languages. The files\n * are processed and stored as base entries that serve as the foundation for generating\n * translations through the translation workflow.\n *\n * @param {Array<{source: FileUpload}>} files - Array of objects containing source file data to upload\n * @param {UploadFilesOptions} options - Configuration options including source locale and other upload settings\n * @returns {Promise<UploadFilesResponse>} Upload result containing file IDs, version information, and upload status\n */\n async uploadSourceFiles(\n files: { source: FileUpload }[],\n options: UploadFilesOptions\n ): Promise<UploadFilesResponse> {\n // Validation\n this._validateAuth('uploadSourceFiles');\n\n // Merge instance settings with options\n const mergedOptions: UploadFilesOptions = {\n ...options,\n sourceLocale: this.resolveCanonicalLocale(\n options.sourceLocale ?? this.sourceLocale ?? libraryDefaultLocale\n ),\n };\n\n // resolve canonical locales\n files = files.map((f) => ({\n ...f,\n source: {\n ...f.source,\n locale: this.resolveCanonicalLocale(f.source.locale),\n },\n }));\n\n // Process files in batches and convert result to UploadFilesResponse\n const result = await _uploadSourceFiles(\n files,\n mergedOptions as RequiredUploadFilesOptions,\n this._getTranslationConfig()\n );\n\n return {\n uploadedFiles: result.data,\n count: result.count,\n message: `Successfully uploaded ${result.count} files in ${result.batchCount} batch(es)`,\n };\n }\n\n /**\n * Uploads translation files that correspond to previously uploaded source files.\n *\n * This method allows you to provide translated content for existing source files in your project.\n * Each translation must reference an existing source file and include the translated content\n * along with the target locale information. This is used when you have pre-existing translations\n * that you want to upload directly rather than generating them through the translation service.\n *\n * @param {Array<{source: FileUpload, translations: FileUpload[]}>} files - Array of file objects where:\n * - `source`: Reference to the existing source file (contains IDs but no content)\n * - `translations`: Array of translated files, each containing content, locale, and reference IDs\n * @param {UploadFilesOptions} options - Configuration options including source locale and upload settings\n * @returns {Promise<UploadFilesResponse>} Upload result containing translation IDs, status, and processing information\n */\n async uploadTranslations(\n files: {\n source: FileUpload; // reference only (no content)\n translations: FileUpload[]; // each has content + ids + locale\n }[],\n options: UploadFilesOptions\n ): Promise<UploadFilesResponse> {\n // Validation\n this._validateAuth('uploadTranslations');\n\n // Merge instance settings with options\n const mergedOptions: UploadFilesOptions = {\n ...options,\n sourceLocale: options.sourceLocale ?? this.sourceLocale,\n };\n\n // Require source locale\n if (!mergedOptions.sourceLocale) {\n const error = noSourceLocaleProvidedError('uploadTranslations');\n gtInstanceLogger.error(error);\n throw new Error(error);\n }\n\n // Ensure all translation locales use canonical locales\n const targetFiles = files.map((f) => ({\n ...f,\n translations: f.translations.map((t) => ({\n ...t,\n locale: this.resolveCanonicalLocale(t.locale),\n })),\n }));\n\n // Process files in batches and convert result to UploadFilesResponse\n const result = await _uploadTranslations(\n targetFiles,\n mergedOptions as RequiredUploadFilesOptions,\n this._getTranslationConfig()\n );\n\n return {\n uploadedFiles: result.data,\n count: result.count,\n message: `Successfully uploaded ${result.count} files in ${result.batchCount} batch(es)`,\n };\n }\n\n // -------------- Formatting -------------- //\n\n /**\n * Formats a string with cutoff behavior, applying a terminator when the string exceeds the maximum character limit.\n *\n * This method uses the GT instance's rendering locales by default for locale-specific terminator selection,\n * but can be overridden with custom locales in the options.\n *\n * @param {string} value - The string value to format with cutoff behavior.\n * @param {Object} [options] - Configuration options for cutoff formatting.\n * @param {string | string[]} [options.locales] - The locales to use for terminator selection. Defaults to instance's rendering locales.\n * @param {number} [options.maxChars] - The maximum number of characters to display.\n * - Undefined values are treated as no cutoff.\n * - Negative values follow .slice() behavior and terminator will be added before the value.\n * - 0 will result in an empty string.\n * - If cutoff results in an empty string, no terminator is added.\n * @param {CutoffFormatStyle} [options.style='ellipsis'] - The style of the terminator.\n * @param {string} [options.terminator] - Optional override the terminator to use.\n * @param {string} [options.separator] - Optional override the separator to use between the terminator and the value.\n * - If no terminator is provided, then separator is ignored.\n * @returns {string} The formatted string with terminator applied if cutoff occurs.\n *\n * @example\n * const gt = new GT({ targetLocale: 'en-US' });\n * gt.formatCutoff('Hello, world!', { maxChars: 8 });\n * // Returns: 'Hello, w...'\n *\n * @example\n * gt.formatCutoff('Hello, world!', { maxChars: -3 });\n * // Returns: '...ld!'\n */\n formatCutoff(\n value: string,\n options?: {\n locales?: string | string[];\n } & CutoffFormatOptions\n ): string {\n return formatCutoff(value, {\n locales: this._renderingLocales,\n ...options,\n });\n }\n\n /**\n * Formats a message according to the specified locales and options.\n *\n * @param {string} message - The message to format.\n * @param {string | string[]} [locales='en'] - The locales to use for formatting.\n * @param {FormatVariables} [variables={}] - The variables to use for formatting.\n * @param {StringFormat} [dataFormat='ICU'] - The format of the message.\n * @returns {string} The formatted message.\n *\n * @example\n * gt.formatMessage('Hello {name}', { name: 'John' });\n * // Returns: \"Hello John\"\n *\n * gt.formatMessage('Hello {name}', { name: 'John' }, { locales: ['fr'] });\n * // Returns: \"Bonjour John\"\n */\n formatMessage(\n message: string,\n options?: {\n locales?: string | string[];\n variables?: FormatVariables;\n dataFormat?: StringFormat;\n }\n ): string {\n return formatMessage(message, {\n locales: this._renderingLocales,\n ...options,\n });\n }\n /**\n * Formats a number according to the specified locales and options.\n *\n * @param {number} number - The number to format\n * @param {Object} [options] - Additional options for number formatting\n * @param {string | string[]} [options.locales] - The locales to use for formatting\n * @param {Intl.NumberFormatOptions} [options] - Additional Intl.NumberFormat options\n * @returns {string} The formatted number\n *\n * @example\n * gt.formatNum(1234.56, { style: 'currency', currency: 'USD' });\n * // Returns: \"$1,234.56\"\n */\n formatNum(\n number: number,\n options?: {\n locales?: string | string[];\n } & Intl.NumberFormatOptions\n ): string {\n return formatNum(number, {\n locales: this._renderingLocales,\n ...options,\n });\n }\n\n /**\n * Formats a date according to the specified locales and options.\n *\n * @param {Date} date - The date to format\n * @param {Object} [options] - Additional options for date formatting\n * @param {string | string[]} [options.locales] - The locales to use for formatting\n * @param {Intl.DateTimeFormatOptions} [options] - Additional Intl.DateTimeFormat options\n * @returns {string} The formatted date\n *\n * @example\n * gt.formatDateTime(new Date(), { dateStyle: 'full', timeStyle: 'long' });\n * // Returns: \"Thursday, March 14, 2024 at 2:30:45 PM GMT-7\"\n */\n formatDateTime(\n date: Date,\n options?: {\n locales?: string | string[];\n } & Intl.DateTimeFormatOptions\n ): string {\n return formatDateTime(date, {\n locales: this._renderingLocales,\n ...options,\n });\n }\n\n /**\n * Formats a currency value according to the specified locales and options.\n *\n * @param {number} value - The currency value to format\n * @param {string} currency - The currency code (e.g., 'USD', 'EUR')\n * @param {Object} [options] - Additional options for currency formatting\n * @param {string | string[]} [options.locales] - The locales to use for formatting\n * @param {Intl.NumberFormatOptions} [options] - Additional Intl.NumberFormat options\n * @returns {string} The formatted currency value\n *\n * @example\n * gt.formatCurrency(1234.56, 'USD', { style: 'currency' });\n * // Returns: \"$1,234.56\"\n */\n formatCurrency(\n value: number,\n currency: string,\n options?: {\n locales?: string | string[];\n } & Intl.NumberFormatOptions\n ): string {\n return formatCurrency(value, currency, {\n locales: this._renderingLocales,\n ...options,\n });\n }\n\n /**\n * Formats a list of items according to the specified locales and options.\n *\n * @param {Array<string | number>} array - The list of items to format\n * @param {Object} [options] - Additional options for list formatting\n * @param {string | string[]} [options.locales] - The locales to use for formatting\n * @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options\n * @returns {string} The formatted list\n *\n * @example\n * gt.formatList(['apple', 'banana', 'orange'], { type: 'conjunction' });\n * // Returns: \"apple, banana, and orange\"\n */\n formatList(\n array: Array<string | number>,\n options?: {\n locales?: string | string[];\n } & Intl.ListFormatOptions\n ) {\n return _formatList({\n value: array,\n locales: options?.locales || this._renderingLocales,\n options: options,\n });\n }\n\n /**\n * Formats a list of items according to the specified locales and options.\n * @param {Array<T>} array - The list of items to format\n * @param {Object} [options] - Additional options for list formatting\n * @param {string | string[]} [options.locales] - The locales to use for formatting\n * @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options\n * @returns {Array<T | string>} The formatted list parts\n *\n * @example\n * gt.formatListToParts(['apple', 42, { foo: 'bar' }], { type: 'conjunction', style: 'short', locales: ['en'] });\n * // Returns: ['apple', ', ', 42, ' and ', '{ foo: \"bar\" }']\n */\n formatListToParts<T>(\n array: Array<T>,\n options?: {\n locales?: string | string[];\n } & Intl.ListFormatOptions\n ): Array<T | string> {\n return _formatListToParts<T>({\n value: array,\n locales: options?.locales || this._renderingLocales,\n options: options,\n });\n }\n\n /**\n * Formats a relative time value according to the specified locales and options.\n *\n * @param {number} value - The relative time value to format\n * @param {Intl.RelativeTimeFormatUnit} unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year')\n * @param {Object} options - Additional options for relative time formatting\n * @param {string | string[]} [options.locales] - The locales to use for formatting\n * @param {Intl.RelativeTimeFormatOptions} [options] - Additional Intl.RelativeTimeFormat options\n * @returns {string} The formatted relative time string\n *\n * @example\n * gt.formatRelativeTime(-1, 'day', { locales: ['en-US'], numeric: 'auto' });\n * // Returns: \"yesterday\"\n */\n formatRelativeTime(\n value: number,\n unit: Intl.RelativeTimeFormatUnit,\n options?: {\n locales?: string | string[];\n } & Omit<Intl.RelativeTimeFormatOptions, 'locales'>\n ): string {\n return formatRelativeTime(value, unit, {\n locales: this._renderingLocales,\n ...options,\n });\n }\n\n /**\n * Formats a relative time string from a Date, automatically selecting the best unit.\n *\n * @param {Date} date - The date to format relative to now\n * @param {Object} [options] - Additional options for relative time formatting\n * @param {string | string[]} [options.locales] - The locales to use for formatting\n * @returns {string} The formatted relative time string (e.g., \"2 hours ago\", \"in 3 days\")\n *\n * @example\n * gt.formatRelativeTimeFromDate(new Date(Date.now() - 3600000));\n * // Returns: \"1 hour ago\"\n */\n formatRelativeTimeFromDate(\n date: Date,\n options?: {\n locales?: string | string[];\n baseDate?: Date;\n } & Omit<Intl.RelativeTimeFormatOptions, 'locales'>\n ): string {\n return formatRelativeTimeFromDate(date, {\n locales: this._renderingLocales,\n ...options,\n });\n }\n\n // -------------- Locale Properties -------------- //\n\n /**\n * Retrieves the display name of a locale code using Intl.DisplayNames, returning an empty string if no name is found.\n *\n * @param {string} [locale=this.targetLocale] - A BCP-47 locale code\n * @returns {string} The display name corresponding to the code\n * @throws {Error} If no target locale is provided\n *\n * @example\n * gt.getLocaleName('es-ES');\n * // Returns: \"Spanish (Spain)\"\n */\n getLocaleName(locale = this.targetLocale): string {\n if (!locale) throw new Error(noTargetLocaleProvidedError('getLocaleName'));\n return _getLocaleName(locale, this.sourceLocale, this.customMapping);\n }\n\n /**\n * Retrieves an emoji based on a given locale code.\n * Uses the locale's region (if present) to select an emoji or falls back on default emojis.\n *\n * @param {string} [locale=this.targetLocale] - A BCP-47 locale code (e.g., 'en-US', 'fr-CA')\n * @returns {string} The emoji representing the locale or its region\n * @throws {Error} If no target locale is provided\n *\n * @example\n * gt.getLocaleEmoji('es-ES');\n * // Returns: \"🇪🇸\"\n */\n getLocaleEmoji(locale = this.targetLocale): string {\n if (!locale) throw new Error(noTargetLocaleProvidedError('getLocaleEmoji'));\n return getLocaleEmoji(locale, this.customMapping);\n }\n\n /**\n * Generates linguistic details for a given locale code.\n *\n * This function returns information about the locale,\n * script, and region of a given language code both in a standard form and in a maximized form (with likely script and region).\n * The function provides these names in both your default language and native forms, and an associated emoji.\n *\n * @param {string} [locale=this.targetLocale] - The locale code to get properties for (e.g., \"de-AT\").\n * @returns {LocaleProperties} - An object containing detailed information about the locale.\n *\n * @property {string} code - The full locale code, e.g., \"de-AT\".\n * @property {string} name - Language name in the default display language, e.g., \"Austrian German\".\n * @property {string} nativeName - Language name in the locale's native language, e.g., \"Österreichisches Deutsch\".\n * @property {string} languageCode - The base language code, e.g., \"de\".\n * @property {string} languageName - The language name in the default display language, e.g., \"German\".\n * @property {string} nativeLanguageName - The language name in the native language, e.g., \"Deutsch\".\n * @property {string} nameWithRegionCode - Language name with region in the default language, e.g., \"German (AT)\".\n * @property {string} nativeNameWithRegionCode - Language name with region in the native language, e.g., \"Deutsch (AT)\".\n * @property {string} regionCode - The region code from maximization, e.g., \"AT\".\n * @property {string} regionName - The region name in the default display language, e.g., \"Austria\".\n * @property {string} nativeRegionName - The region name in the native language, e.g., \"Österreich\".\n * @property {string} scriptCode - The script code from maximization, e.g., \"Latn\".\n * @property {string} scriptName - The script name in the default display language, e.g., \"Latin\".\n * @property {string} nativeScriptName - The script name in the native language, e.g., \"Lateinisch\".\n * @property {string} maximizedCode - The maximized locale code, e.g., \"de-Latn-AT\".\n * @property {string} maximizedName - Maximized locale name with likely script in the default language, e.g., \"Austrian German (Latin)\".\n * @property {string} nativeMaximizedName - Maximized locale name in the native language, e.g., \"Österreichisches Deutsch (Lateinisch)\".\n * @property {string} minimizedCode - Minimized locale code, e.g., \"de-AT\" (or \"de\" for \"de-DE\").\n * @property {string} minimizedName - Minimized language name in the default language, e.g., \"Austrian German\".\n * @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., \"Österreichisches Deutsch\".\n * @property {string} emoji - The emoji associated with the locale's region, if applicable.\n */\n getLocaleProperties(locale = this.targetLocale): LocaleProperties {\n if (!locale)\n throw new Error(noTargetLocaleProvidedError('getLocaleProperties'));\n return getLocaleProperties(locale, this.sourceLocale, this.customMapping);\n }\n\n /**\n * Retrieves multiple properties for a given region code, including:\n * - `code`: the original region code\n * - `name`: the localized display name\n * - `emoji`: the associated flag or symbol\n *\n * Behavior:\n * - Accepts ISO 3166-1 alpha-2 or UN M.49 region codes (e.g., `\"US\"`, `\"FR\"`, `\"419\"`).\n * - Uses the instance's `targetLocale` to localize the region name for the user.\n * - If `customMapping` contains a `name` or `emoji` for the region, those override the default values.\n * - Otherwise, uses `Intl.DisplayNames` to get the localized region name, falling back to `libraryDefaultLocale`.\n * - Falls back to the region code as `name` if display name resolution fails.\n * - Falls back to a default emoji if no emoji mapping is found in built-in data or `customMapping`.\n *\n * @param {string} [region=this.getLocaleProperties().regionCode] - The region code to look up (e.g., `\"US\"`, `\"GB\"`, `\"DE\"`).\n * @param {CustomRegionMapping} [customMapping] - Optional mapping of region codes to custom names and/or emojis.\n * @returns {{ code: string, name: string, emoji: string }} An object containing:\n * - `code`: the input region code\n * - `name`: the localized or custom region name\n * - `emoji`: the matching emoji flag or symbol\n *\n * @throws {Error} If no target locale is available to determine region properties.\n *\n * @example\n * const gt = new GT({ targetLocale: 'en-US' });\n * gt.getRegionProperties('US');\n * // => { code: 'US', name: 'United States', emoji: '🇺🇸' }\n *\n * @example\n * const gt = new GT({ targetLocale: 'fr-FR' });\n * gt.getRegionProperties('US');\n * // => { code: 'US', name: 'États-Unis', emoji: '🇺🇸' }\n *\n * @example\n * gt.getRegionProperties('US', { US: { name: 'USA', emoji: '🗽' } });\n * // => { code: 'US', name: 'USA', emoji: '🗽' }\n */\n getRegionProperties(\n region = this.getLocaleProperties().regionCode,\n customMapping?: CustomRegionMapping\n ): { code: string; name: string; emoji: string } {\n if (!customMapping) {\n if (this.customMapping && !this.customRegionMapping) {\n // Lazy derive custom region mapping from customMapping\n const customRegionMapping: CustomRegionMapping = {};\n for (const [locale, lp] of Object.entries(this.customMapping)) {\n if (\n lp &&\n typeof lp === 'object' &&\n lp.regionCode &&\n !customRegionMapping[lp.regionCode]\n ) {\n const { regionName: name, emoji } = lp;\n customRegionMapping[lp.regionCode] = {\n locale,\n ...(name && { name }),\n ...(emoji && { emoji }),\n };\n }\n }\n this.customRegionMapping = customRegionMapping;\n }\n customMapping = this.customRegionMapping;\n }\n return _getRegionProperties(\n region,\n this.targetLocale, // this.targetLocale because we want it in the user's language\n customMapping\n );\n }\n\n /**\n * Determines whether a translation is required based on the source and target locales.\n *\n * @param {string} [sourceLocale=this.sourceLocale] - The locale code for the original content\n * @param {string} [targetLocale=this.targetLocale] - The locale code to translate into\n * @param {string[]} [approvedLocales=this.locales] - Optional array of approved target locales\n * @returns {boolean} True if translation is required, false otherwise\n * @throws {Error} If no source locale is provided\n * @throws {Error} If no target locale is provided\n *\n * @example\n * gt.requiresTranslation('en-US', 'es-ES');\n * // Returns: true\n */\n requiresTranslation(\n sourceLocale = this.sourceLocale,\n targetLocale = this.targetLocale,\n approvedLocales: string[] | undefined = this.locales,\n customMapping: CustomMapping | undefined = this.customMapping\n ): boolean {\n if (!sourceLocale)\n throw new Error(noSourceLocaleProvidedError('requiresTranslation'));\n if (!targetLocale)\n throw new Error(noTargetLocaleProvidedError('requiresTranslation'));\n return _requiresTranslation(\n sourceLocale,\n targetLocale,\n approvedLocales,\n customMapping\n );\n }\n\n /**\n * Determines the best matching locale from the provided approved locales list.\n *\n * @param {string | string[]} locales - A single locale or array of locales in preference order\n * @param {string[]} [approvedLocales=this.locales] - Array of approved locales in preference order\n * @returns {string | undefined} The best matching locale or undefined if no match is found\n *\n * @example\n * gt.determineLocale(['fr-CA', 'fr-FR'], ['en-US', 'fr-FR', 'es-ES']);\n * // Returns: \"fr-FR\"\n */\n determineLocale(\n locales: string | string[],\n approvedLocales: string[] | undefined = this.locales || [],\n customMapping: CustomMapping | undefined = this.customMapping\n ): string | undefined {\n return _determineLocale(locales, approvedLocales, customMapping);\n }\n\n /**\n * Gets the text direction for a given locale code.\n *\n * @param {string} [locale=this.targetLocale] - A BCP-47 locale code\n * @returns {'ltr' | 'rtl'} 'rtl' if the locale is right-to-left, otherwise 'ltr'\n * @throws {Error} If no target locale is provided\n *\n * @example\n * gt.getLocaleDirection('ar-SA');\n * // Returns: \"rtl\"\n */\n getLocaleDirection(locale = this.targetLocale): 'ltr' | 'rtl' {\n if (!locale)\n throw new Error(noTargetLocaleProvidedError('getLocaleDirection'));\n return getLocaleDirection(locale);\n }\n\n /**\n * Checks if a given BCP 47 locale code is valid.\n *\n * @param {string} [locale=this.targetLocale] - The BCP 47 locale code to validate\n * @param {customMapping} [customMapping=this.customMapping] - The custom mapping to use for validation\n * @returns {boolean} True if the locale code is valid, false otherwise\n * @throws {Error} If no target locale is provided\n *\n * @example\n * gt.isValidLocale('en-US');\n * // Returns: true\n */\n isValidLocale(\n locale = this.targetLocale,\n customMapping: CustomMapping | undefined = this.customMapping\n ): boolean {\n if (!locale) throw new Error(noTargetLocaleProvidedError('isValidLocale'));\n return isValidLocale(locale, customMapping);\n }\n\n /**\n * Resolves the canonical locale for a given locale.\n * @param locale - The locale to resolve the canonical locale for\n * @param customMapping - The custom mapping to use for resolving the canonical locale\n * @returns The canonical locale\n */\n resolveCanonicalLocale(\n locale: string | undefined = this.targetLocale,\n customMapping: CustomMapping | undefined = this.customMapping\n ): string {\n if (!locale)\n throw new Error(noTargetLocaleProvidedError('resolveCanonicalLocale'));\n return _resolveCanonicalLocale(locale, customMapping);\n }\n\n /**\n * Resolves the alias locale for a given locale.\n * @param locale - The locale to resolve the alias locale for\n * @param customMapping - The custom mapping to use for resolving the alias locale\n * @returns The alias locale\n */\n resolveAliasLocale(\n locale: string,\n customMapping: CustomMapping | undefined = this.customMapping\n ): string {\n if (!locale)\n throw new Error(noTargetLocaleProvidedError('resolveAliasLocale'));\n return _resolveAliasLocale(locale, customMapping);\n }\n\n /**\n * Standardizes a BCP 47 locale code to ensure correct formatting.\n *\n * @param {string} [locale=this.targetLocale] - The BCP 47 locale code to standardize\n * @returns {string} The standardized locale code or empty string if invalid\n * @throws {Error} If no target locale is provided\n *\n * @example\n * gt.standardizeLocale('en_us');\n * // Returns: \"en-US\"\n */\n standardizeLocale(locale = this.targetLocale): string {\n if (!locale)\n throw new Error(noTargetLocaleProvidedError('standardizeLocale'));\n return _standardizeLocale(locale);\n }\n\n /**\n * Checks if multiple BCP 47 locale codes represent the same dialect.\n *\n * @param {...(string | string[])} locales - The BCP 47 locale codes to compare\n * @returns {boolean} True if all codes represent the same dialect, false otherwise\n *\n * @example\n * gt.isSameDialect('en-US', 'en-GB');\n * // Returns: false\n *\n * gt.isSameDialect('en', 'en-US');\n * // Returns: true\n */\n isSameDialect(...locales: (string | string[])[]): boolean {\n return isSameDialect(...locales);\n }\n\n /**\n * Checks if multiple BCP 47 locale codes represent the same language.\n *\n * @param {...(string | string[])} locales - The BCP 47 locale codes to compare\n * @returns {boolean} True if all codes represent the same language, false otherwise\n *\n * @example\n * gt.isSameLanguage('en-US', 'en-GB');\n * // Returns: true\n */\n isSameLanguage(...locales: (string | string[])[]): boolean {\n return _isSameLanguage(...locales);\n }\n\n /**\n * Checks if a locale is a superset of another locale.\n *\n * @param {string} superLocale - The locale to check if it is a superset\n * @param {string} subLocale - The locale to check if it is a subset\n * @returns {boolean} True if superLocale is a superset of subLocale, false otherwise\n *\n * @example\n * gt.isSupersetLocale('en', 'en-US');\n * // Returns: true\n *\n * gt.isSupersetLocale('en-US', 'en');\n * // Returns: false\n */\n isSupersetLocale(superLocale: string, subLocale: string): boolean {\n return isSupersetLocale(superLocale, subLocale);\n }\n}\n\n// ============================================================ //\n// Utility methods //\n// ============================================================ //\n\n// -------------- Formatting -------------- //\n\n/**\n * Formats a string with cutoff behavior, applying a terminator when the string exceeds the maximum character limit.\n *\n * This standalone function provides cutoff formatting functionality without requiring a GT instance.\n * The locales parameter is required for proper terminator selection based on the target language.\n *\n * @param {string} value - The string value to format with cutoff behavior.\n * @param {Object} [options] - Configuration options for cutoff formatting.\n * @param {string | string[]} [options.locales] - The locales to use for terminator selection.\n * @param {number} [options.maxChars] - The maximum number of characters to display.\n * - Undefined values are treated as no cutoff.\n * - Negative values follow .slice() behavior and terminator will be added before the value.\n * - 0 will result in an empty string.\n * - If cutoff results in an empty string, no terminator is added.\n * @param {CutoffFormatStyle} [options.style='ellipsis'] - The style of the terminator.\n * @param {string} [options.terminator] - Optional override the terminator to use.\n * @param {string} [options.separator] - Optional override the separator to use between the terminator and the value.\n * - If no terminator is provided, then separator is ignored.\n * @returns {string} The formatted string with terminator applied if cutoff occurs.\n *\n * @example\n * formatCutoff('Hello, world!', { locales: 'en-US', maxChars: 8 });\n * // Returns: 'Hello, w...'\n *\n * @example\n * formatCutoff('Hello, world!', { locales: 'en-US', maxChars: -3 });\n * // Returns: '...ld!'\n *\n * @example\n * formatCutoff('Very long text that needs cutting', {\n * locales: 'en-US',\n * maxChars: 15,\n * style: 'ellipsis',\n * separator: ' '\n * });\n * // Returns: 'Very long text ...'\n */\nexport function formatCutoff(\n value: string,\n options?: {\n locales?: string | string[];\n } & CutoffFormatOptions\n): string {\n return _formatCutoff({ value, locales: options?.locales, options });\n}\n\n/**\n * Formats a message according to the specified locales and options.\n *\n * @param {string} message - The message to format.\n * @param {string | string[]} [locales='en'] - The locales to use for formatting.\n * @param {FormatVariables} [variables={}] - The variables to use for formatting.\n * @param {StringFormat} [dataFormat='ICU'] - The format of the message. (When STRING, the message is returned as is)\n * @returns {string} The formatted message.\n *\n * @example\n * formatMessage('Hello {name}', { name: 'John' });\n * // Returns: \"Hello John\"\n *\n * formatMessage('Hello {name}', { name: 'John' }, { locales: ['fr'] });\n * // Returns: \"Bonjour John\"\n */\nexport function formatMessage(\n message: string,\n options?: {\n locales?: string | string[];\n variables?: FormatVariables;\n dataFormat?: StringFormat;\n }\n): string {\n switch (options?.dataFormat) {\n case 'STRING':\n return _formatMessageString(message);\n default:\n return _formatMessageICU(message, options?.locales, options?.variables);\n }\n}\n\n/**\n * Formats a number according to the specified locales and options.\n * @param {Object} params - The parameters for the number formatting.\n * @param {number} params.value - The number to format.\n * @param {Intl.NumberFormatOptions} [params.options] - Additional options for number formatting.\n * @param {string | string[]} [params.options.locales] - The locales to use for formatting.\n * @returns {string} The formatted number.\n */\nexport function formatNum(\n number: number,\n options: {\n locales: string | string[];\n } & Intl.NumberFormatOptions\n): string {\n return _formatNum({\n value: number,\n locales: options.locales,\n options,\n });\n}\n\n/**\n * Formats a date according to the specified languages and options.\n * @param {Object} params - The parameters for the date formatting.\n * @param {Date} params.value - The date to format.\n * @param {Intl.DateTimeFormatOptions} [params.options] - Additional options for date formatting.\n * @param {string | string[]} [params.options.locales] - The languages to use for formatting.\n * @returns {string} The formatted date.\n */\nexport function formatDateTime(\n date: Date,\n options?: {\n locales?: string | string[];\n } & Intl.DateTimeFormatOptions\n): string {\n return _formatDateTime({\n value: date,\n locales: options?.locales,\n options,\n });\n}\n\n/**\n * Formats a currency value according to the specified languages, currency, and options.\n * @param {Object} params - The parameters for the currency formatting.\n * @param {number} params.value - The currency value to format.\n * @param {string} params.currency - The currency code (e.g., 'USD').\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.\n * @param {string | string[]} [params.options.locales] - The locale codes to use for formatting.\n * @returns {string} The formatted currency value.\n */\nexport function formatCurrency(\n value: number,\n currency: string,\n options: {\n locales: string | string[];\n } & Intl.NumberFormatOptions\n): string {\n return _formatCurrency({\n value,\n currency,\n locales: options.locales,\n options,\n });\n}\n\n/**\n * Formats a list of items according to the specified locales and options.\n * @param {Object} params - The parameters for the list formatting.\n * @param {Array<string | number>} params.value - The list of items to format.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n * @param {string | string[]} [params.options.locales] - The locales to use for formatting.\n * @returns {string} The formatted list.\n */\nexport function formatList(\n array: Array<string | number>,\n options: {\n locales: string | string[];\n } & Intl.ListFormatOptions\n): string {\n return _formatList({\n value: array,\n locales: options.locales,\n options,\n });\n}\n\n/**\n * Formats a list of items according to the specified locales and options.\n * @param {Array<T>} array - The list of items to format\n * @param {Object} [options] - Additional options for list formatting\n * @param {string | string[]} [options.locales] - The locales to use for formatting\n * @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options\n * @returns {Array<T | string>} The formatted list parts\n */\nexport function formatListToParts<T>(\n array: Array<T>,\n options?: {\n locales?: string | string[];\n } & Intl.ListFormatOptions\n): Array<T | string> {\n return _formatListToParts<T>({\n value: array,\n locales: options?.locales,\n options: options,\n });\n}\n\n/**\n * Formats a relative time value according to the specified locales and options.\n * @param {Object} params - The parameters for the relative time formatting.\n * @param {number} params.value - The relative time value to format.\n * @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').\n * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.\n * @param {string | string[]} [params.options.locales] - The locales to use for formatting.\n * @returns {string} The formatted relative time string.\n */\nexport function formatRelativeTime(\n value: number,\n unit: Intl.RelativeTimeFormatUnit,\n options: {\n locales: string | string[];\n } & Omit<Intl.RelativeTimeFormatOptions, 'locales'>\n): string {\n return _formatRelativeTime({\n value,\n unit,\n locales: options.locales,\n options,\n });\n}\n\n/**\n * Formats a relative time string from a Date, automatically selecting the best unit.\n * @param {Date} date - The date to format relative to now.\n * @param {Object} options - Formatting options.\n * @param {string | string[]} options.locales - The locales to use for formatting.\n * @param {Intl.RelativeTimeFormatOptions} [options] - Additional Intl.RelativeTimeFormat options.\n * @returns {string} The formatted relative time string (e.g., \"2 hours ago\", \"in 3 days\").\n */\nexport function formatRelativeTimeFromDate(\n date: Date,\n options: {\n locales: string | string[];\n baseDate?: Date;\n } & Omit<Intl.RelativeTimeFormatOptions, 'locales'>\n): string {\n const { locales, baseDate, ...intlOptions } = options;\n return _formatRelativeTimeFromDate({\n date,\n baseDate: baseDate ?? new Date(),\n locales,\n options: intlOptions,\n });\n}\n\n// -------------- Locale Properties -------------- //\n\n/**\n * Retrieves the display name of locale code using Intl.DisplayNames.\n *\n * @param {string} locale - A BCP-47 locale code.\n * @param {string} [defaultLocale] - The default locale to use for formatting.\n * @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.\n * @returns {string} The display name corresponding to the code.\n */\nexport function getLocaleName(\n locale: string,\n defaultLocale?: string,\n customMapping?: CustomMapping\n): string {\n return _getLocaleName(locale, defaultLocale, customMapping);\n}\n\n/**\n * Retrieves an emoji based on a given locale code, taking into account region, language, and specific exceptions.\n *\n * This function uses the locale's region (if present) to select an emoji or falls back on default emojis for certain languages.\n *\n * @param locale - A string representing the locale code (e.g., 'en-US', 'fr-CA').\n * @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.\n * @returns The emoji representing the locale or its region, or a default emoji if no specific match is found.\n */\nexport function getLocaleEmoji(\n locale: string,\n customMapping?: CustomMapping\n): string {\n return _getLocaleEmoji(locale, customMapping);\n}\n\n/**\n * Generates linguistic details for a given locale code.\n *\n * This function returns information about the locale,\n * script, and region of a given language code both in a standard form and in a maximized form (with likely script and region).\n * The function provides these names in both your default language and native forms, and an associated emoji.\n *\n * @param {string} locale - The locale code to get properties for (e.g., \"de-AT\").\n * @param {string} [defaultLocale] - The default locale to use for formatting.\n * @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.\n * @returns {LocaleProperties} - An object containing detailed information about the locale.\n *\n * @property {string} code - The full locale code, e.g., \"de-AT\".\n * @property {string} name - Language name in the default display language, e.g., \"Austrian German\".\n * @property {string} nativeName - Language name in the locale's native language, e.g., \"Österreichisches Deutsch\".\n * @property {string} languageCode - The base language code, e.g., \"de\".\n * @property {string} languageName - The language name in the default display language, e.g., \"German\".\n * @property {string} nativeLanguageName - The language name in the native language, e.g., \"Deutsch\".\n * @property {string} nameWithRegionCode - Language name with region in the default language, e.g., \"German (AT)\".\n * @property {string} nativeNameWithRegionCode - Language name with region in the native language, e.g., \"Deutsch (AT)\".\n * @property {string} regionCode - The region code from maximization, e.g., \"AT\".\n * @property {string} regionName - The region name in the default display language, e.g., \"Austria\".\n * @property {string} nativeRegionName - The region name in the native language, e.g., \"Österreich\".\n * @property {string} scriptCode - The script code from maximization, e.g., \"Latn\".\n * @property {string} scriptName - The script name in the default display language, e.g., \"Latin\".\n * @property {string} nativeScriptName - The script name in the native language, e.g., \"Lateinisch\".\n * @property {string} maximizedCode - The maximized locale code, e.g., \"de-Latn-AT\".\n * @property {string} maximizedName - Maximized locale name with likely script in the default language, e.g., \"Austrian German (Latin)\".\n * @property {string} nativeMaximizedName - Maximized locale name in the native language, e.g., \"Österreichisches Deutsch (Lateinisch)\".\n * @property {string} minimizedCode - Minimized locale code, e.g., \"de-AT\" (or \"de\" for \"de-DE\").\n * @property {string} minimizedName - Minimized language name in the default language, e.g., \"Austrian German\".\n * @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., \"Österreichisches Deutsch\".\n * @property {string} emoji - The emoji associated with the locale's region, if applicable.\n */\nexport function getLocaleProperties(\n locale: string,\n defaultLocale?: string,\n customMapping?: CustomMapping\n): LocaleProperties {\n return _getLocaleProperties(locale, defaultLocale, customMapping);\n}\n\n/**\n * Retrieves multiple properties for a given region code, including:\n * - `code`: the original region code\n * - `name`: the localized display name\n * - `emoji`: the associated flag or symbol\n *\n * Behavior:\n * - Accepts ISO 3166-1 alpha-2 or UN M.49 region codes (e.g., `\"US\"`, `\"FR\"`, `\"419\"`).\n * - If `customMapping` contains a `name` or `emoji` for the region, those override the default values.\n * - Otherwise, uses `Intl.DisplayNames` to get the localized region name in the given `defaultLocale`,\n * falling back to `libraryDefaultLocale`.\n * - Falls back to the region code as `name` if display name resolution fails.\n * - Falls back to `defaultEmoji` if no emoji mapping is found in `emojis` or `customMapping`.\n *\n * @param {string} region - The region code to look up (e.g., `\"US\"`, `\"GB\"`, `\"DE\"`).\n * @param {string} [defaultLocale=libraryDefaultLocale] - The locale to use when localizing the region name.\n * @param {CustomRegionMapping} [customMapping] - Optional mapping of region codes to custom names and/or emojis.\n * @returns {{ code: string, name: string, emoji: string }} An object containing:\n * - `code`: the input region code\n * - `name`: the localized or custom region name\n * - `emoji`: the matching emoji flag or symbol\n *\n * @example\n * getRegionProperties('US', 'en');\n * // => { code: 'US', name: 'United States', emoji: '🇺🇸' }\n *\n * @example\n * getRegionProperties('US', 'fr');\n * // => { code: 'US', name: 'États-Unis', emoji: '🇺🇸' }\n *\n * @example\n * getRegionProperties('US', 'en', { US: { name: 'USA', emoji: '🗽' } });\n * // => { code: 'US', name: 'USA', emoji: '🗽' }\n */\nexport function getRegionProperties(\n region: string,\n defaultLocale?: string,\n customMapping?: CustomRegionMapping\n): { code: string; name: string; emoji: string } {\n return _getRegionProperties(region, defaultLocale, customMapping);\n}\n\n/**\n * Determines whether a translation is required based on the source and target locales.\n *\n * - If the target locale is not specified, the function returns `false`, as translation is not needed.\n * - If the source and target locale are the same, returns `false`, indicating that no translation is necessary.\n * - If the `approvedLocales` array is provided, and the target locale is not within that array, the function also returns `false`.\n * - Otherwise, it returns `true`, meaning that a translation is required.\n *\n * @param {string} sourceLocale - The locale code for the original content (BCP 47 locale code).\n * @param {string} targetLocale - The locale code of the language to translate the content into (BCP 47 locale code).\n * @param {string[]} [approvedLocale] - An optional array of approved target locales.\n *\n * @returns {boolean} - Returns `true` if translation is required, otherwise `false`.\n */\nexport function requiresTranslation(\n sourceLocale: string,\n targetLocale: string,\n approvedLocales?: string[],\n customMapping?: CustomMapping\n): boolean {\n return _requiresTranslation(\n sourceLocale,\n targetLocale,\n approvedLocales,\n customMapping\n );\n}\n\n/**\n * Determines the best matching locale from the provided approved locales list.\n * @param {string | string[]} locales - A single locale or an array of locales sorted in preference order.\n * @param {string[]} [approvedLocales=this.locales] - An array of approved locales, also sorted by preference.\n * @returns {string | undefined} - The best matching locale from the approvedLocales list, or undefined if no match is found.\n */\nexport function determineLocale(\n locales: string | string[],\n approvedLocales: string[] | undefined = [],\n customMapping: CustomMapping | undefined = undefined\n): string | undefined {\n return _determineLocale(locales, approvedLocales, customMapping);\n}\n\n/**\n * Get the text direction for a given locale code using the Intl.Locale API.\n *\n * @param {string} locale - A BCP-47 locale code.\n * @returns {string} - 'rtl' if the locale is right-to-left, otherwise 'ltr'.\n */\nexport function getLocaleDirection(locale: string): 'ltr' | 'rtl' {\n return _getLocaleDirection(locale);\n}\n\n/**\n * Checks if a given BCP 47 locale code is valid.\n * @param {string} locale - The BCP 47 locale code to validate.\n * @param {CustomMapping} [customMapping] - The custom mapping to use for validation.\n * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n */\nexport function isValidLocale(\n locale: string,\n customMapping?: CustomMapping\n): boolean {\n return _isValidLocale(locale, customMapping);\n}\n\n/**\n * Resolves the alias locale for a given locale.\n * @param {string} locale - The locale to resolve the alias locale for\n * @param {CustomMapping} [customMapping] - The custom mapping to use for resolving the alias locale\n * @returns {string} The alias locale\n */\nexport function resolveAliasLocale(\n locale: string,\n customMapping?: CustomMapping\n): string {\n return _resolveAliasLocale(locale, customMapping);\n}\n\n/**\n * Resolves the canonical locale for a given locale.\n * @param {string} locale - The locale to resolve the canonical locale for\n * @param {CustomMapping} [customMapping] - The custom mapping to use for resolving the canonical locale\n * @returns {string} The canonical locale\n */\nexport function resolveCanonicalLocale(\n locale: string,\n customMapping?: CustomMapping\n): string {\n return _resolveCanonicalLocale(locale, customMapping);\n}\n\n/**\n * Standardizes a BCP 47 locale code to ensure correct formatting.\n * @param {string} locale - The BCP 47 locale code to standardize.\n * @returns {string} The standardized BCP 47 locale code or an empty string if it is an invalid code.\n */\nexport function standardizeLocale(locale: string): string {\n return _standardizeLocale(locale);\n}\n\n/**\n * Checks if multiple BCP 47 locale codes represent the same dialect.\n * @param {string[]} locales - The BCP 47 locale codes to compare.\n * @returns {boolean} True if all BCP 47 codes represent the same dialect, false otherwise.\n */\nexport function isSameDialect(...locales: (string | string[])[]): boolean {\n return _isSameDialect(...locales);\n}\n\n/**\n * Checks if multiple BCP 47 locale codes represent the same language.\n * @param {string[]} locales - The BCP 47 locale codes to compare.\n * @returns {boolean} True if all BCP 47 codes represent the same language, false otherwise.\n */\nexport function isSameLanguage(...locales: (string | string[])[]): boolean {\n return _isSameLanguage(...locales);\n}\n\n/**\n * Checks if a locale is a superset of another locale.\n * A subLocale is a subset of superLocale if it is an extension of superLocale or are otherwise identical.\n *\n * @param {string} superLocale - The locale to check if it is a superset of the other locale.\n * @param {string} subLocale - The locale to check if it is a subset of the other locale.\n * @returns {boolean} True if the first locale is a superset of the second locale, false otherwise.\n */\nexport function isSupersetLocale(\n superLocale: string,\n subLocale: string\n): boolean {\n return _isSupersetLocale(superLocale, subLocale);\n}\n\nexport const API_VERSION = _API_VERSION;\n","import { intlCache } from '../cache/IntlCache';\nimport { _standardizeLocale } from './isValidLocale';\n\n/**\n * @internal\n */\nexport default function _isSupersetLocale(\n superLocale: string,\n subLocale: string\n): boolean {\n try {\n const {\n language: languageSuper,\n region: regionSuper,\n script: scriptSuper,\n } = intlCache.get('Locale', _standardizeLocale(superLocale));\n const {\n language: languageSub,\n region: regionSub,\n script: scriptSub,\n } = intlCache.get('Locale', _standardizeLocale(subLocale));\n\n if (languageSuper !== languageSub) return false;\n if (regionSuper && regionSuper !== regionSub) return false;\n if (scriptSuper && scriptSuper !== scriptSub) return false;\n\n return true;\n } catch (error) {\n console.error(error);\n return false;\n }\n}\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","key","desc","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__param","paramIndex","decorator","__esDecorate","ctor","descriptorIn","contextIn","initializers","extraInitializers","accept","f","_","kind","descriptor","name","done","context","access","addInitializer","push","result","get","set","init","unshift","__runInitializers","thisArg","value","useValue","__propKey","x","concat","__setFunctionName","prefix","description","configurable","__metadata","metadataKey","metadataValue","metadata","__awaiter","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","then","__generator","body","y","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","v","op","pop","__createBinding","o","m","k","k2","undefined","__esModule","writable","enumerable","__exportStar","__values","__read","ar","error","__spread","__spreadArrays","il","a","j","jl","__spreadArray","to","from","pack","l","slice","__await","__asyncGenerator","asyncIterator","q","AsyncIterator","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__setModuleDefault","ownKeys","getOwnPropertyNames","__importStar","mod","__importDefault","default","__classPrivateFieldGet","receiver","state","has","__classPrivateFieldSet","__classPrivateFieldIn","__addDisposableResource","env","async","dispose","inner","asyncDispose","stack","_SuppressedError","SuppressedError","suppressed","message","Error","__disposeResources","fail","hasError","__rewriteRelativeImportExtension","path","preserveJsx","test","replace","tsx","ext","cm","toLowerCase","ErrorKind","TYPE","SKELETON_TYPE","_a","tslib_es6","libraryDefaultLocale","defaultTimeout","DEFAULT_CUTOFF_FORMAT_STYLE","DEFAULT_TERMINATOR_KEY","TERMINATOR_MAP","ellipsis","fr","terminator","separator","zh","ja","none","_b","CutoffFormatConstructor","locales","options","style","presetTerminatorOptions","localesList","isArray","map","canonicalLocales","Intl","getCanonicalLocales","locale","_h","createInvalidCutoffStyleError","maxChars","_c","languageCode","Locale","language","_d","_e","additionLength","_f","_g","Math","abs","format","formatToParts","join","adjustedChars","max","min","slicedValue","resolvedOptions","CustomIntl","Collator","DateTimeFormat","DisplayNames","ListFormat","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter","CutoffFormat","IntlCache","cache","_generateKey","localeKey","sortedOptions","JSON","stringify","keys","sort","args","_i","intlObject","bind","intlCache","defaultBaseUrl","encode","data","Buffer","toString","bytes","TextEncoder","binary","fromCharCode","btoa","decode","base64","atob","Uint8Array","charCodeAt","TextDecoder","RegExp","exec","REGEX_SUPPORTS_U_AND_Y","types","isLiteralElement","el","type","literal","isArgumentElement","argument","isNumberElement","number","isDateElement","date","isTimeElement","time","isSelectElement","select","isPluralElement","plural","isPoundElement","pound","isTagElement","tag","isNumberSkeleton","isDateTimeSkeleton","dateTime","createLiteralElement","createNumberElement","_stringify","node","isFinite","out_1","out","keys_1","stableStringify","printer","printAST","doPrintAST","printDateTimeSkeleton","tslib_1","require$$0","types_1","require$$1","ast","isInPlural","printedNodes","isFirstEl","isLastEl","escaped","printEscapedMessage","printLiteralElement","printArgumentElement","tokens","printNumberSkeletonToken","printSimpleFormatElement","pluralType","msg","offset","id","filter","Boolean","printPluralElement","printSelectElement","children","printTagElement","token","stem","pattern","scriptExceptions","_isValidLocale","customMapping","code","region_1","script_1","split","partCount","of","isCustomLanguage","includes","_standardizeLocale","checkTwoLocalesAreSameDialect","codeA","codeB","languageA","regionA","scriptA","languageB","regionB","scriptB","_isSameDialect","flattenedCodes","flat","console","_isSameLanguage","languages_1","every","_requiresTranslation","sourceLocale","targetLocale","approvedLocales","some","approvedLocale","getCustomProperty","property","shouldUseCanonicalLocale","_getLocaleEmoji","aliasedLocale","standardizedLocale","localeObject","region","customEmoji","emojis","extrapolated","maximize","extrapolatedRegion","exceptions","defaultEmoji","europeAfricaGlobe","ca","eu","ku","bo","ug","gd","cy","gv","grc","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","createCustomLocaleProperties","lArray","merged","lArray_1","_getLocaleProperties","defaultLocale","customLocaleProperties","baseRegion","maximizedLocale","maximizedCode","regionCode","scriptCode","script","minimizedCode","minimize","defaultLanguageOrder","nativeLanguageOrder","languageNames","nativeLanguageNames","customName","customNativeName","nativeName","maximizedName","nativeMaximizedName","minimizedName","nativeMinimizedName","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionNames","nativeRegionNames","regionName","nativeRegionName","scriptNames","nativeScriptNames","scriptName","nativeScriptName","emoji","codeParts","_determineLocale","candidates","getMatchingCode","locales_2","codes","matchingCode","locales_1","memoize","fn","cacheDefault","serializer","serializerDefault","strategy","strategyDefault","monadic","arg","cacheKey","computedValue","variadic","assemble","serialize","ObjectWithoutPrototypeCache","strategies","SPACE_SEPARATOR_REGEX","DATE_TIME_REGEX","parseDateTimeSkeleton","skeleton","match","len","era","year","RangeError","month","day","weekday","hour12","hourCycle","hour","minute","second","timeZoneName","WHITE_SPACE_REGEX","icuUnitToEcma","unit","FRACTION_PRECISION_REGEX","SIGNIFICANT_PRECISION_REGEX","INTEGER_WIDTH_REGEX","CONCISE_INTEGER_WIDTH_REGEX","parseSignificantPrecision","str","roundingPriority","g1","g2","minimumSignificantDigits","maximumSignificantDigits","parseSign","signDisplay","currencySign","parseConciseScientificAndEngineeringStem","notation","minimumIntegerDigits","parseNotationOptions","opt","signOpts","parseNumberSkeleton","tokens_1","scale","currency","useGrouping","maximumFractionDigits","compactDisplay","reduce","all","currencyDisplay","unitDisplay","parseFloat","roundingMode","g3","g4","g5","minimumFractionDigits","trailingZeroDisplay","conciseScientificAndEngineeringOpts","timeData","AC","CP","DG","EA","IC","TA","XK","getDefaultHourSymbolFromLocale","hourCycles","regionTag","languageTag","SPACE_SEPARATOR_START_REGEX","source","SPACE_SEPARATOR_END_REGEX","createLocation","start","end","hasNativeStartsWith","startsWith","hasNativeFromCodePoint","fromCodePoint","hasNativeFromEntries","fromEntries","hasNativeCodePointAt","codePointAt","hasTrimStart","trimStart","hasTrimEnd","trimEnd","isSafeInteger","Number","floor","matchIdentifierAtIndex","search","position","codePoints","elements","entries","obj","entries_1","index","size","first","flag","IDENTIFIER_PREFIX_RE_1","lastIndex","_isWhiteSpace","_isPatternSyntax","ErrorCode","Parser","line","column","ignoreTag","requiresOtherClause","shouldParseSkeletons","parse","parseMessage","nestingLevel","parentArgType","expectingCloseTag","isEOF","char","parseArgument","err","val","peek","UNMATCHED_CLOSING_TAG","clonePosition","_isAlpha","parseTag","parseLiteral","bump","location","startPosition","tagName","parseTagName","bumpSpace","bumpIf","childrenResult","endTagStartPosition","INVALID_TAG","closingTagNameStartPosition","UNCLOSED_TAG","startOffset","_isPotentialElementNameChar","parseQuoteResult","tryParseQuote","parseUnquotedResult","tryParseUnquoted","parseLeftAngleResult","tryParseLeftAngleBracket","codepoint","ch","openingBracePosition","EXPECT_ARGUMENT_CLOSING_BRACE","EMPTY_ARGUMENT","parseIdentifierIfPossible","MALFORMED_ARGUMENT","parseArgumentOptions","startingPosition","endOffset","bumpTo","typeStartPosition","argType","typeEndPosition","EXPECT_ARGUMENT_TYPE","styleAndLocation","styleStartPosition","parseSimpleArgStyleIfPossible","EXPECT_ARGUMENT_STYLE","styleLocation","argCloseResult","tryParseArgumentClose","location_1","parseNumberSkeletonFromString","EXPECT_DATE_TIME_SKELETON","dateTimePattern","skeletonCopy","patternPos","patternChar","charAt","extraLength","hourLen","dayPeriodLen","hourChar","getBestPattern","parsedOptions","typeEndPosition_1","EXPECT_SELECT_ARGUMENT_OPTIONS","identifierAndLocation","pluralOffset","EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE","tryParseDecimalInteger","INVALID_PLURAL_ARGUMENT_OFFSET_VALUE","optionsResult","tryParsePluralOrSelectOptions","location_2","INVALID_ARGUMENT_TYPE","nestedBraces","apostrophePosition","bumpUntil","UNCLOSED_QUOTE_IN_ARGUMENT_STYLE","stringTokens_1","stemAndOptions","options_1","INVALID_NUMBER_SKELETON","expectCloseTag","parsedFirstIdentifier","hasOtherClause","parsedSelectors","Set","selector","selectorLocation","EXPECT_PLURAL_ARGUMENT_SELECTOR","INVALID_PLURAL_ARGUMENT_SELECTOR","DUPLICATE_SELECT_ARGUMENT_SELECTOR","DUPLICATE_PLURAL_ARGUMENT_SELECTOR","EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT","EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT","fragmentResult","add","EXPECT_SELECT_ARGUMENT_SELECTOR","MISSING_OTHER_CLAUSE","expectNumberError","invalidNumberError","sign","hasDigits","decimal","currentOffset","targetOffset","nextCode","pruneLocation","els","forEach","opts","SyntaxError","originalMessage","captureLocation","PART_TYPE","FormatError","_super","_this","InvalidValueError","variableId","INVALID_VALUE","InvalidValueTypeError","MissingValueError","MISSING_VALUE","isFormatXMLElementFn","formatters","formats","values","currentPluralValue","els_1","getNumberFormat","varName","object","getDateTimeFormat","medium","value_1","formatFn","chunks","other","MISSING_INTL_API","rule","getPluralRules","parts","part","lastPart","mergeLiteral","mergeConfigs","defaultConfig","configs","c1","c2","createFastMemoizeCache","store","IntlMessageFormat","overrideFormats","formatterCache","pluralRules","resolvedLocale","supportedLocalesOf","getAst","resolveLocale","__parse","parseOpts","memoizedDefaultLocale","supportedLocales","integer","percent","short","long","full","LOG_LEVELS","debug","info","warn","off","LOG_COLORS","getConfiguredLogLevel","process","_GT_LOG_LEVEL","envLevel","ConsoleLogHandler","config","handle","entry","includeTimestamp","timestamp","toISOString","colorCode","level","levelText","toUpperCase","includeContext","formattedMessage","Logger","enableConsole","handlers","addHandler","handler","removeHandler","splice","configure","shouldLog","log","Date","child","ContextLogger","getConfig","logger","childContext","defaultLogger","fetchLogger","gtInstanceLogger","_formatList","_formatListToParts","formatListParts","partIndex","_formatRelativeTimeFromDate","baseDate","now","getTime","diffMs","absDiffMs","seconds","minutes","hours","days","weeks","months","years","_selectRelativeTimeUnit","_formatRelativeTime","numeric","_getLocaleName","_getLocaleDirection","textInfoDirection","textInfo","direction","extractDirectionWithTextInfo","RTL_SCRIPTS","RTL_LANGUAGES","GT_ERROR_PREFIX","translationTimeoutError","timeout","noTargetLocaleProvidedError","functionName","noSourceLocaleProvidedError","invalidLocaleError","fetchWithTimeout","url","controller","AbortController","signal","timeoutId","setTimeout","abort","fetch","error_1","clearTimeout","ApiError","getCode","getMessage","validateResponse","response","ok","errorMsg","text","errorJson","errorMessage","status","statusText","apiError","handleFetchError","errorMessage_1","translationRequestFailedError","API_VERSION","generateRequestHeaders","excludeContentType","authHeaders","projectId","apiKey","sleep","ms","getRetryDelay","policy","attempt","pow","apiRequest","endpoint","baseUrl","method","retryPolicy","maxRetries","requestInit","headers","json","hashString","string","bytesToHex","sha256","utf8ToBytes","hashSource","hashFunction","sanitizedSource","dataFormat","sanitizeJsxChildren","sanitizeChild","newChild","generaltranslation","variableObj","isVariable","childrenAsObjects","_translateMany","requests","globalMetadata","hashOrder","requestsObject","request","normalized","hash","success","_setupProject","files","branchId","fileId","versionId","force","timeoutMs","createBatches","items","batchSize","batches","processBatches","items_1","processor_1","processor","parallel","count","batchCount","allItems","batch","results","results_1","batches_1","_enqueueFiles","fileName","targetLocales","requireApproval","modelProvider","apiResult","jobData","jobs","_createTag","tagId","_downloadFileBatch","file","_submitUserEditDiffs","payload_1","config_1","payload","diffs","_getRegionProperties","displayNames","_resolveAliasLocale","reverseCustomMapping","_resolveCanonicalLocale","_uploadSourceFiles","content","fileFormat","formatMetadata","incomingBranchId","checkedOutBranchId","uploadedFiles","_uploadTranslations","translations","_querySourceFile","query","searchParams","URLSearchParams","encodeURIComponent","_getProjectData","_checkJobStatus","jobIds","_awaitJobs","enqueueResult","pollingInterval","pollingIntervalSeconds","timeoutSeconds","complete","startTime","finalStatuses","Map","jobId","pendingJobIds","statuses","statuses_1","job","delete","_queryFileData","data_1","sourceFiles","item","translatedFiles","_queryBranchData","_createBranch","_processFileMoves","moves","summary","total","succeeded","failed","batchResult","_getOrphanedFiles","branchId_1","fileIds_1","fileIds","makeRequest","batchFileIds","batchResults","orphanedFileMap","orphanedFiles","orphan","batchOrphanIds","_publishFiles","params","_renderingLocales","GT_API_KEY","devApiKey","GT_DEV_API_KEY","GT_PROJECT_ID","setConfig","result_1","invalidLocales_1","invalidLocalesError","_getTranslationConfig","_validateAuth","errors","noApiKeyProvidedError","noProjectIdProvidedError","queryBranchData","createBranch","processFileMoves","moves_1","getOrphanedFiles","setupProject","resolveCanonicalLocale","checkJobStatus","awaitJobs","enqueueFiles","mergedOptions","createTag","publishFiles","submitUserEditDiffs","queryFileData","resolveAliasLocale","querySourceFile","sourceFile","getProjectData","projectId_1","currentLocales","downloadFile","file_1","useLatestAvailableVersion","downloadFileBatch","requests_1","translate","translateMany","sources","uploadSourceFiles","uploadTranslations","formatCutoff","formatMessage","formatNum","formatDateTime","formatCurrency","formatList","array","formatListToParts","formatRelativeTime","formatRelativeTimeFromDate","getLocaleName","getLocaleEmoji","getLocaleProperties","getRegionProperties","customRegionMapping","lp","requiresTranslation","determineLocale","getLocaleDirection","isValidLocale","standardizeLocale","isSameDialect","isSameLanguage","isSupersetLocale","superLocale","subLocale","_formatCutoff","variables","_formatMessageICU","numberingSystem","_formatNum","calendar","_formatDateTime","_formatCurrency","intlOptions","languageSuper","regionSuper","scriptSuper","languageSub","regionSub","scriptSub","_isSupersetLocale","_API_VERSION"],"mappings":"oHAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,CAAG,GAC1E,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,GAAI,EAC7FP,EAAcC,EAAGC,EAC5B,EAEO,SAASS,EAAUV,EAAGC,GACzB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIU,UAAU,uBAAyBC,OAAOX,GAAK,iCAE7D,SAASY,IAAOC,KAAKC,YAAcf,CAAG,CADtCD,EAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOc,OAAOf,IAAMY,EAAGN,UAAYN,EAAEM,UAAW,IAAIM,EACnF,CAEO,IAAII,EAAW,WAQlB,OAPAA,EAAWf,OAAOgB,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAIf,KADTc,EAAIG,UAAUF,GACOnB,OAAOK,UAAUC,eAAeC,KAAKW,EAAGd,KAAIa,EAAEb,GAAKc,EAAEd,IAE9E,OAAOa,CACX,EACOF,EAASQ,MAAMX,KAAMS,UAChC,EAEO,SAASG,EAAON,EAAGO,GACtB,IAAIR,EAAI,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OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC,GAAI,OACJC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T,GAAM,CACF,IACA,KACA,IACA,MAEJD,GAAM,CACF,IACA,KACA,KAEJG,GAAM,CACF,IACA,MAEJc,GAAM,CACF,IACA,MAEJD,GAAM,CACF,IACA,KACA,KAEJjB,GAAM,CACF,IACA,KACA,KACA,KAEJmB,GAAM,CACF,IACA,KAEJb,GAAM,CACF,IACA,MAEJkK,GAAM,CACF,IACA,MAEJjK,GAAM,CACF,IACA,KACA,IACA,MAEJS,GAAM,CACF,KACA,KACA,IACA,KAEJP,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,KAEJI,GAAM,CACF,IACA,MAEJf,GAAM,CACF,IACA,KACA,IACA,MAEJS,GAAM,CACF,IACA,KAEJI,GAAM,CACF,IACA,IACA,KACA,MAEJT,GAAM,CACF,IACA,KAEJE,GAAM,CACF,IACA,IACA,KACA,MAEJkB,GAAM,CACF,IACA,KACA,IACA,MAEJO,GAAM,CACF,IACA,IACA,KACA,MAEJG,GAAM,CACF,KACA,KAEJR,GAAM,CACF,IACA,IACA,MAEJS,GAAM,CACF,IACA,MAEJoK,GAAM,CACF,IACA,KACA,KAEJjK,GAAM,CACF,IACA,MAEJF,GAAM,CACF,IACA,IACA,KACA,MAEJR,GAAM,CACF,IACA,IACA,KACA,MAEJL,GAAM,CACF,IACA,IACA,MAEJM,GAAM,CACF,IACA,KACA,KACA,KAEJG,GAAM,CACF,IACA,IACA,KACA,MAEJuU,GAAM,CACF,KAEJlU,GAAM,CACF,IACA,IACA,KACA,MAEJG,GAAM,CACF,IACA,IACA,KACA,MAEJnB,GAAM,CACF,IACA,MAEJoB,GAAM,CACF,IACA,MAEJX,GAAM,CACF,IACA,IACA,KACA,MAEJY,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,KAEJwB,GAAM,CACF,IACA,MAEJqS,GAAM,CACF,IACA,IACA,KACA,MAEJ3T,GAAM,CACF,IACA,KAEJD,GAAM,CACF,KAEJE,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJ5D,GAAM,CACF,IACA,KACA,KACA,KAEJsX,GAAM,CACF,IACA,IACA,KACA,MAEJzT,GAAM,CACF,IACA,IACA,KACA,MAEJK,GAAM,CACF,IACA,MAEJJ,GAAM,CACF,IACA,KACA,KACA,KAEJoL,GAAM,CACF,IACA,KACA,KACA,KAEJjL,GAAM,CACF,IACA,KAEJ6I,GAAM,CACF,IACA,KACA,IACA,MAEJ1I,GAAM,CACF,KACA,KACA,IACA,KAEJI,GAAM,CACF,KAEJD,GAAM,CACF,IACA,KACA,IACA,MAEJF,GAAM,CACF,IACA,IACA,KACA,MAEJwE,GAAM,CACF,IACA,KACA,IACA,MAEJvE,GAAM,CACF,IACA,KAEJG,GAAM,CACF,IACA,MAEJI,GAAM,CACF,IACA,MAEJ0J,GAAM,CACF,IACA,IACA,KACA,MAEJlJ,GAAM,CACF,IACA,KACA,IACA,MAEJN,GAAM,CACF,IACA,KACA,KAEJL,GAAM,CACF,IACA,MAEJe,GAAM,CACF,IACA,IACA,KACA,MAEJR,GAAM,CACF,IACA,KAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJE,GAAM,CACF,IACA,KAEJN,GAAM,CACF,IACA,KACA,IACA,MAEJY,GAAM,CACF,IACA,MAEJJ,GAAM,CACF,IACA,MAEJtB,GAAM,CACF,IACA,KACA,IACA,MAEJmB,GAAM,CACF,IACA,IACA,KACA,MAEJK,GAAM,CACF,IACA,IACA,KACA,MAEJD,GAAM,CACF,IACA,KACA,IACA,MAEJI,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJK,GAAM,CACF,IACA,KACA,KACA,KAEJD,GAAM,CACF,IACA,IACA,KACA,MAEJ5C,GAAM,CACF,IACA,MAEJ8C,GAAM,CACF,IACA,KAEJqR,GAAM,CACF,IACA,IACA,KACA,MAEJlR,GAAM,CACF,KAEJG,GAAM,CACF,IACA,IACA,KACA,MAEJE,GAAM,CACF,IACA,MAEJD,GAAM,CACF,IACA,IACA,KACA,MAEJL,GAAM,CACF,IACA,KAEJvE,GAAM,CACF,IACA,IACA,KACA,MAEJ0E,GAAM,CACF,IACA,KACA,KACA,KAEJD,GAAM,CACF,KACA,KAEJH,GAAM,CACF,KAEJQ,GAAM,CACF,IACA,MAEJG,GAAM,CACF,IACA,IACA,KACA,MAEJF,GAAM,CACF,IACA,KACA,IACA,MAEJG,GAAM,CACF,IACA,KACA,KACA,KAEJF,GAAM,CACF,IACA,IACA,KAEJI,GAAM,CACF,KACA,KACA,IACA,KAEJK,GAAM,CACF,IACA,IACA,KACA,MAEJnF,GAAM,CACF,KACA,IACA,IACA,MAEJ+E,GAAM,CACF,IACA,KACA,IACA,MAEJpE,GAAM,CACF,IACA,IACA,KACA,MAEJ0I,GAAM,CACF,IACA,KACA,IACA,MAEJrE,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJ/E,GAAM,CACF,IACA,KACA,IACA,MAEJ0E,GAAM,CACF,IACA,MAEJO,GAAM,CACF,IACA,KACA,KACA,KAEJE,GAAM,CACF,IACA,KACA,KACA,KAEJgE,GAAM,CACF,IACA,KACA,IACA,MAEJ5D,GAAM,CACF,IACA,KACA,KAEJkF,GAAM,CACF,IACA,IACA,KACA,MAEJpF,GAAM,CACF,IACA,KACA,IACA,MAEJD,GAAM,CACF,IACA,KAEJI,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,IACA,MAEJP,GAAM,CACF,IACA,KACA,KACA,KAEJI,GAAM,CACF,IACA,KACA,KACA,KAEJuB,GAAM,CACF,IACA,IACA,KACA,MAEJJ,GAAM,CACF,IACA,MAEJD,GAAM,CACF,IACA,MAEJG,GAAM,CACF,IACA,KACA,KAEJyC,GAAM,CACF,IACA,MAEJzD,GAAM,CACF,IACA,KAEJM,GAAM,CACF,IACA,KACA,IACA,MAEJ0B,GAAM,CACF,IACA,IACA,KACA,MAEJ5B,GAAM,CACF,KAEJgB,GAAM,CACF,KACA,KACA,IACA,KAEJL,GAAM,CACF,IACA,IACA,KACA,MAEJhB,GAAM,CACF,IACA,KACA,KACA,KAEJkC,GAAM,CACF,IACA,KACA,IACA,MAEJ1B,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,KACA,KACA,KAEJS,GAAM,CACF,IACA,IACA,KACA,MAEJZ,GAAM,CACF,IACA,KAEJI,GAAM,CACF,IACA,KAEJN,GAAM,CACF,IACA,KAEJF,GAAM,CACF,IACA,KACA,IACA,MAEJU,GAAM,CACF,IACA,IACA,KACA,MAEJT,GAAM,CACF,KACA,KACA,IACA,KAEJiB,GAAM,CACF,IACA,MAEJE,GAAM,CACF,IACA,IACA,KACA,MAEJI,GAAM,CACF,IACA,MAEJG,GAAM,CACF,KAEJG,GAAM,CACF,IACA,IACA,KACA,MAEJF,GAAM,CACF,IACA,IACA,KACA,MAEJF,GAAM,CACF,IACA,IACA,KACA,MAEJH,GAAM,CACF,IACA,MAEJU,GAAM,CACF,IACA,KAEJX,GAAM,CACF,IACA,IACA,MAEJD,GAAM,CACF,IACA,IACA,KACA,MAEJQ,GAAM,CACF,IACA,IACA,KACA,MAEJJ,GAAM,CACF,IACA,KACA,IACA,MAEJS,GAAM,CACF,IACA,KACA,KACA,KAEJI,GAAM,CACF,IACA,IACA,KACA,MAEJG,GAAM,CACF,IACA,IACA,KACA,MAEJhG,GAAM,CACF,IACA,IACA,MAEJ8F,GAAM,CACF,IACA,KAEJG,GAAM,CACF,IACA,KACA,KACA,KAEJP,GAAM,CACF,IACA,KACA,KAEJS,GAAM,CACF,IACA,KAEJa,GAAM,CACF,IACA,MAEJd,GAAM,CACF,IACA,IACA,KACA,MAEJG,GAAM,CACF,IACA,IACA,KACA,MAEJT,GAAM,CACF,IACA,KACA,KACA,KAEJQ,GAAM,CACF,IACA,MAEJT,GAAM,CACF,IACA,KAEJI,GAAM,CACF,IACA,IACA,KACA,MAEJO,GAAM,CACF,IACA,KACA,KACA,KAEJC,GAAM,CACF,IACA,MAEJC,GAAM,CACF,IACA,MAEJe,GAAM,CACF,IACA,KACA,KAEJd,GAAM,CACF,KAEJC,GAAM,CACF,IACA,KAEJW,GAAM,CACF,IACA,KACA,KACA,KAEJS,GAAM,CACF,IACA,KACA,IACA,MAEJN,GAAM,CACF,IACA,IACA,MAEJa,GAAM,CACF,IACA,KACA,KACA,KAEJG,GAAM,CACF,KAEJd,GAAM,CACF,IACA,KACA,IACA,MAEJd,GAAM,CACF,IACA,IACA,KACA,MAEJiB,GAAM,CACF,IACA,MAEJU,GAAM,CACF,KAEJX,GAAM,CACF,KAEJH,GAAM,CACF,IACA,KACA,IACA,MAEJN,GAAM,CACF,IACA,IACA,MAEJG,GAAM,CACF,IACA,IACA,MAEJS,GAAM,CACF,IACA,KAEJO,GAAM,CACF,IACA,MAEJJ,GAAM,CACF,IACA,KACA,IACA,MAEJd,GAAM,CACF,IACA,MAEJhI,GAAM,CACF,IACA,IACA,KACA,MAEJuI,GAAM,CACF,IACA,IACA,KACA,MAEJe,GAAM,CACF,IACA,KACA,KACA,KAEJlJ,GAAM,CACF,IACA,KACA,IACA,MAEJqT,GAAM,CACF,IACA,IACA,KACA,MAEJtJ,GAAM,CACF,IACA,KACA,IACA,MAEJ1L,GAAM,CACF,IACA,IACA,MAEJoC,GAAM,CACF,IACA,IACA,MAEJ+I,GAAM,CACF,IACA,MAEJF,GAAM,CACF,IACA,KAEJF,GAAM,CACF,IACA,KAEJG,GAAM,CACF,IACA,KACA,KACA,KAEJO,GAAM,CACF,IACA,KAEJF,GAAM,CACF,IACA,KACA,KACA,KAEJF,GAAM,CACF,IACA,KAEJG,GAAM,CACF,IACA,MAEJF,GAAM,CACF,IACA,KACA,IACA,MAEJR,GAAM,CACF,KACA,KACA,IACA,KAEJE,GAAM,CACF,KACA,KACA,IACA,KAEJa,GAAM,CACF,IACA,KACA,KAEJD,GAAM,CACF,KACA,KACA,IACA,KAEJK,GAAM,CACF,IACA,KACA,IACA,MAEJD,GAAM,CACF,IACA,KACA,IACA,MAEJE,GAAM,CACF,IACA,IACA,KACA,MAEJC,GAAM,CACF,IACA,KACA,KAEJ5I,GAAM,CACF,IACA,IACA,MAEJ6F,GAAM,CACF,IACA,KACA,IACA,MAEJiD,GAAM,CACF,IACA,IACA,KACA,MAEJE,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KACA,IACA,MAEJF,GAAM,CACF,IACA,KAEJF,GAAM,CACF,IACA,KAEJK,GAAM,CACF,IACA,MAEJpD,GAAM,CACF,IACA,KAEJ4L,GAAM,CACF,IACA,KACA,KAEJtI,GAAM,CACF,IACA,KACA,KACA,KAEJxG,GAAM,CACF,IACA,MAEJgE,GAAM,CACF,IACA,IACA,KACA,MAEJyC,GAAM,CACF,IACA,KACA,IACA,MAEJC,GAAM,CACF,IACA,KAEJ,QAAS,CACL,IACA,IACA,KACA,MAEJ,SAAU,CACN,IACA,KACA,KACA,KAEJ,QAAS,CACL,IACA,IACA,MAEJ,SAAU,CACN,IACA,KACA,IACA,MAEJ,QAAS,CACL,IACA,KACA,IACA,MAEJ,QAAS,CACL,IACA,IACA,KACA,MAEJ,QAAS,CACL,IACA,KACA,IACA,MAEJ,QAAS,CACL,IACA,IACA,KACA,MAEJ,QAAS,CACL,IACA,IACA,KACA,MAEJ,QAAS,CACL,IACA,IACA,KACA,MAEJ,QAAS,CACL,IACA,IACA,MAEJ,QAAS,CACL,IACA,IACA,MAEJ,QAAS,CACL,KACA,KACA,IACA,KAEJ,QAAS,CACL,KACA,IACA,KAEJ,QAAS,CACL,IACA,IACA,MAEJ,QAAS,CACL,IACA,IACA,MAEJ,QAAS,CACL,KACA,IACA,KAEJ,QAAS,CACL,KACA,IACA,KAEJ,QAAS,CACL,KACA,KACA,IACA,KAEJ,QAAS,CACL,KACA,KACA,IACA,KAEJ,QAAS,CACL,KACA,IACA,KACA,KAEJ,QAAS,CACL,KACA,IACA,KAEJ,QAAS,CACL,IACA,KACA,KACA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4D,GAAUc,GAAQ,MAAU,EAAI,IACvE,OAAOwlB,QAA2CA,EAAW,IACjE,EACOzH,CACX,IAOA,SAASmB,GAASuB,GACd,OAASA,GAAa,IAAMA,GAAa,KACpCA,GAAa,IAAMA,GAAa,EACzC,CAKA,SAASP,GAA4B5zB,GACjC,OAAc,KAANA,GACE,KAANA,GACCA,GAAK,IAAMA,GAAK,IACX,KAANA,GACCA,GAAK,IAAMA,GAAK,KAChBA,GAAK,IAAMA,GAAK,IACZ,KAALA,GACCA,GAAK,KAAQA,GAAK,KAClBA,GAAK,KAAQA,GAAK,KAClBA,GAAK,KAAQA,GAAK,KAClBA,GAAK,KAASA,GAAK,MACnBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAWA,GAAK,MAC9B,CAKA,SAASsxB,GAActxB,GACnB,OAASA,GAAK,GAAUA,GAAK,IACnB,KAANA,GACM,MAANA,GACCA,GAAK,MAAUA,GAAK,MACf,OAANA,GACM,OAANA,CACR,CAKA,SAASuxB,GAAiBvxB,GACtB,OAASA,GAAK,IAAUA,GAAK,IACnB,KAANA,GACCA,GAAK,IAAUA,GAAK,IACf,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACCA,GAAK,IAAUA,GAAK,IACpBA,GAAK,IAAUA,GAAK,IACpBA,GAAK,IAAUA,GAAK,IACpBA,GAAK,IAAUA,GAAK,IACf,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,KAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACCA,GAAK,KAAUA,GAAK,KACf,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MAANA,GACM,MA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AAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACpBA,GAAK,MAAUA,GAAK,MACf,OAANA,GACCA,GAAK,MAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACCA,GAAK,OAAUA,GAAK,OACpBA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,OACf,QAANA,GACM,QAANA,GACM,QAANA,GACM,QAANA,GACCA,GAAK,OAAUA,GAAK,KAC7B,CGvvCA,SAASm5B,GAAcC,GACnBA,EAAIC,QAAQ,SAAU9pB,GAElB,UADOA,EAAGyjB,SACN9iB,GAAgBX,IAAOa,GAAgBb,GACvC,IAAK,IAAI3K,KAAK2K,EAAG7E,eACN6E,EAAG7E,QAAQ9F,GAAGouB,SACrBmG,GAAc5pB,EAAG7E,QAAQ9F,GAAG3C,YAG3B2N,G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