generaltranslation 4.0.1 โ†’ 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.min.cjs","sources":["../node_modules/tslib/tslib.es6.js","../src/settings/defaultAPIRoutes.ts","../src/translation/batch/_translateBatch.ts","../src/locales/_isSameLanguage.ts","../src/internal.ts","../src/locales/_isValidLocale.ts","../src/locales/_requiresTranslation.ts","../src/translation/translate/_translate.ts","../src/translation/react/_translateReact.ts","../src/projects/_updateProjectDictionary.ts","../src/projects/_getProjectLocales.ts","../src/formatting/format.ts","../src/formatting/string_content.ts","../src/locales/_getLocaleEmoji.ts","../src/index.ts","../src/locales/_determineLocale.ts","../src/locales/_getLocaleDirection.ts","../src/locales/_getLocaleName.ts","../src/locales/_getLocaleProperties.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\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\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","const defaultAPIRoutes = {\n \"translateBatch\": \"/v1/translate/batch\",\n \"translateReact\": \"/v1/translate/react\",\n \"translateContent\": \"/v1/translate/content\",\n \"updateProjectDictionary\": \"/v1/project/dictionary/update\",\n \"getProjectLocales\": \"/v1/project/locales\"\n} as const;\n\nexport default defaultAPIRoutes;","import { ContentTranslationResult, ReactTranslationResult, Request } from '../../types/types'\nimport defaultAPIRoutes from '../../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _translateBatch(\n gt: { baseURL: string, apiKey: string },\n requests: Request[]\n): Promise<Array<ReactTranslationResult | ContentTranslationResult>> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (requests[0]?.data?.metadata?.timeout) {\n setTimeout(() => controller.abort(), requests[0].data.metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateBatch}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify(requests),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const resultArray = await response.json();\n return resultArray as Array<ReactTranslationResult | ContentTranslationResult>;\n}","/**\n * @internal\n */\nexport default function _isSameLanguage(...locales: (string | string[])[]): boolean {\n try {\n const flattenedCodes = locales.flat();\n // Get the language for each code\n const languages = flattenedCodes.map(locale => new Intl.Locale(locale).language);\n return languages.every(language => language === languages[0]);\n } catch (error) {\n console.error(error);\n return false;\n }\n}\n","export const libraryDefaultLocale = \"en-US\" as const;\nexport const localeCookieName = \"generaltranslation.locale\" as const;\nexport const pluralForms = [\"singular\", \"plural\", \"dual\", \"zero\", \"one\", \"two\", \"few\", \"many\", \"other\"] as const;\nexport const defaultCacheURL = \"https://cache.gtx.dev\" as const;\nexport const defaultAPIURL = \"https://prod.gtx.dev\" as const;\nexport const localeHeaderName = \"x-generaltranslation-locale\";\nexport function isAcceptedPluralForm(\n form: string\n ): form is (typeof pluralForms)[number] {\n return pluralForms.includes(form as (typeof pluralForms)[number]);\n}","import { libraryDefaultLocale } from \"../internal\";\n\nconst scriptExceptions = [\n \"Cham\",\n \"Jamo\",\n \"Kawi\",\n \"Lisu\",\n \"Toto\",\n \"Thai\"\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 * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n * @internal\n */\nexport const _isValidLocale = (locale: string): boolean => {\n try {\n const { language, region, script } = new Intl.Locale(locale);\n const displayLanguageNames = new Intl.DisplayNames([libraryDefaultLocale], { type: 'language' });\n if (displayLanguageNames.of(language) === language) return false;\n if (region) {\n const displayRegionNames = new Intl.DisplayNames([libraryDefaultLocale], { type: 'region' });\n if (displayRegionNames.of(region) === region) return false;\n }\n if (script) {\n const displayScriptNames = new Intl.DisplayNames([libraryDefaultLocale], { type: 'script' });\n if (displayScriptNames.of(script) === script && !scriptExceptions.includes(script)) 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 return Intl.getCanonicalLocales(locale)[0];\n};","import _isSameLanguage from \"./_isSameLanguage\";\nimport { _isValidLocale, _standardizeLocale } from \"./_isValidLocale\";\n\nfunction checkTwoLocalesAreSameDialect(codeA: string, codeB: string) {\n const { language: languageA, region: regionA, script: scriptA } = new Intl.Locale(codeA);\n const { language: languageB, region: regionB, script: scriptB } = new Intl.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 function _isSameDialect(...locales: (string | string[])[]): boolean {\n try {\n\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 (!checkTwoLocalesAreSameDialect(flattenedCodes[i], flattenedCodes[j])) return false;\n } \n }\n\n return true;\n } catch (error) {\n console.error(error);\n return false;\n }\n}\n\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, targetLocale: string, approvedLocales?: string[]\n): boolean {\n\n // If codes are invalid\n if (!_isValidLocale(sourceLocale) ||\n !_isValidLocale(targetLocale) || \n (approvedLocales && approvedLocales.some(approvedLocale => !_isValidLocale(approvedLocale)))\n ) return false;\n\n // Check if the languages are identical, if so, a translation is not required\n if (_isSameDialect(sourceLocale, targetLocale)) return false;\n \n // if no translation is possible\n // isSameLanguage rather than isIdenticalDialect so we can show different dialects as a fallback\n if (approvedLocales && !approvedLocales.some(approvedLocale => _isSameLanguage(targetLocale, approvedLocale))) return false;\n \n // otherwise, a translation is required!\n return true;\n}","import { Content, ContentTranslationResult } from \"src/types/types\";\nimport defaultAPIRoutes from \"../../settings/defaultAPIRoutes\";\n\n/**\n * @internal\n**/\nexport default async function _translate(\n gt: { baseURL: string; apiKey: string },\n content: Content,\n targetLocale: string,\n metadata: { [key: string]: any }\n): Promise<ContentTranslationResult> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (metadata.timeout) {\n setTimeout(() => controller.abort(), metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateContent}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n content, targetLocale, metadata\n }),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json();\n return result as ContentTranslationResult;\n}\n\n","import { ReactChildrenAsObject, ReactTranslationResult } from \"src/types/types\";\nimport defaultAPIRoutes from \"../../settings/defaultAPIRoutes\";\n\n/**\n * @internal\n**/\nexport default async function _translateReact(\n gt: { baseURL: string, apiKey: string },\n content: ReactChildrenAsObject,\n targetLocale: string,\n metadata: { [key: string]: any }\n): Promise<ReactTranslationResult> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (metadata.timeout) {\n setTimeout(() => controller.abort(), metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateReact}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n children: content,\n targetLocale,\n metadata: metadata\n }),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n return await response.json() as ReactTranslationResult;\n}","import { Content, Update } from '../types/types'\nimport defaultAPIRoutes from '../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _updateProjectDictionary(\n gt: { baseURL: string, apiKey: string },\n updates: Update[],\n locales: string[],\n options: Record<string, any>\n): Promise<string[]> {\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.updateProjectDictionary}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n updates, locales, options\n })\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json();\n return (result as { locales: string[] })?.locales;\n}","import defaultAPIRoutes from '../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _getProjectLocales(\n gt: { baseURL: string, apiKey: string },\n projectID: string\n): Promise<{ locales: string[] }> {\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.getProjectLocales}?projectID=${projectID}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n }\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json() as any;\n return result;\n}","import { libraryDefaultLocale } from \"../internal\";\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-US']] - 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, locales?: string | string[]\n options?: Intl.NumberFormatOptions\n}): string {\n return new Intl.NumberFormat(locales, { numberingSystem: 'latn', ...options }).format(value);\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-US']] - 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, locales?: string | string[]\n options?: Intl.DateTimeFormatOptions\n}): string {\n return new Intl.DateTimeFormat(locales, { calendar: \"gregory\", numberingSystem: \"latn\", ...options }).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-US']] - 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 new Intl.NumberFormat(locales, { style: 'currency', currency, numberingSystem: 'latn', ...options }).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-US']] - 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 new Intl.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 }).format(value);\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-US']] - 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 new Intl.RelativeTimeFormat(locales, { style: \"long\", numeric: 'auto', ...options }).format(value, unit);\n}","import { libraryDefaultLocale } from '../internal';\nimport { Content, VariableObject } from '../types/types'\nimport { _formatCurrency, _formatDateTime, _formatNum, _formatList, _formatRelativeTime } from './format'\n\n// Variable types mapping\nconst variableTypeMap: { [key: string]: string } = {\n var: \"variable\",\n num: \"number\",\n datetime: \"datetime\",\n currency: \"currency\"\n};\n\n/** \n* @internal\n*/\n/** \n * @internal\n */\nexport function _splitStringToContent(string: string): Content {\n if (typeof string !== 'string')\n throw new Error(`splitStringToContent: ${string} is not a string!`)\n\n const result: (string | VariableObject)[] = [];\n const regex = /{([^}]+)}/g;\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n while ((match = regex.exec(string)) !== null) {\n const [fullMatch, content] = match;\n const startIndex = match.index;\n\n // Check for escaped braces with '^' right before the opening brace\n if (string[startIndex - 1] === \"^\") {\n // Add text before the escape sequence\n if (startIndex - 1 > lastIndex) {\n result.push(string.slice(lastIndex, startIndex - 1));\n }\n // Add the escaped content as literal text\n result.push(fullMatch);\n lastIndex = startIndex + fullMatch.length;\n continue;\n }\n\n // Add text before the match\n if (startIndex > lastIndex) {\n result.push(string.slice(lastIndex, startIndex));\n }\n\n // Handle the variable substitution inside the braces\n const parts = content.split(\",\").map(part => part.trim());\n const key = parts[0];\n const variableType = parts[1] ? variableTypeMap[parts[1]] : undefined;\n\n const variableObject: VariableObject = {\n key,\n ...(variableType && { variable: variableType })\n };\n result.push(variableObject);\n\n lastIndex = startIndex + fullMatch.length;\n }\n\n // Add the remaining part of the string after the last match\n if (lastIndex < string.length) {\n result.push(string.slice(lastIndex));\n }\n\n return result;\n}\n\n\n/** \n* @internal\n*/\nexport function _renderContentToString(content: Content, locales: string | string[] = libraryDefaultLocale, variables: Record<string, any> = {}, variableOptions: Record<string, any> = {}): string {\n if (typeof content === 'string')\n content = _splitStringToContent(content);\n if (typeof content === 'string')\n return content;\n if (!Array.isArray(content))\n throw new Error(`renderContentToString: content ${content} is invalid`);\n return content.map(item => {\n if (typeof item === 'string') return item;\n if (typeof item === 'object') {\n const value = variables[item.key]\n if (!item.variable) return value;\n else if (item.variable === \"number\") {\n return _formatNum({\n value, locales, \n options: variableOptions[item.key]\n })\n }\n else if (item.variable === \"currency\") {\n return _formatCurrency({\n value, locales, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n ...(variableOptions[item.key]?.currency && { currency: variableOptions[item.key].currency })\n })\n }\n else if (item.variable === \"datetime\") {\n return _formatDateTime({\n value, locales, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n })\n }\n else if (item.variable === \"list\") {\n return _formatList({\n value, locales, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n })\n }\n return value;\n }\n }).join('') \n}","import { _isValidLocale, _standardizeLocale } from \"./_isValidLocale\";\n\n/**\n* @internal\n*/\nexport default function _getLocaleEmoji(\n locale: string, \n customMapping: Record<string, string> = {}\n): string {\n if (!_isValidLocale(locale))\n return defaultEmoji;\n\n locale = _standardizeLocale(locale)\n\n if (customMapping[locale]) return customMapping[locale];\n \n // if a region is specified, use it!\n const localeObject = new Intl.Locale(locale);\n const { region } = localeObject;\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}\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\nconst 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} as Record<string, string>;","// `generaltranslation` language toolkit\n// ยฉ 2024, General Translation, Inc.\n\n// ----- IMPORTS ----- //\n\nimport _translateBatch from './translation/batch/_translateBatch';\nimport _requiresTranslation, { _isSameDialect } from './locales/_requiresTranslation';\nimport _translate from './translation/translate/_translate';\nimport _translateReact from './translation/react/_translateReact';\nimport _updateProjectDictionary from './projects/_updateProjectDictionary';\nimport _getProjectLocales from './projects/_getProjectLocales';\nimport _determineLocale from './locales/_determineLocale';\nimport { _formatNum, _formatCurrency, _formatList, _formatRelativeTime, _formatDateTime } from './formatting/format';\nimport { _splitStringToContent, _renderContentToString } from './formatting/string_content'\nimport { Content, Update, Request, ReactChildrenAsObject, ReactTranslationResult, ContentTranslationResult } from './types/types'\nimport _isSameLanguage from './locales/_isSameLanguage'\nimport _getLocaleProperties 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 { defaultAPIURL, libraryDefaultLocale } from './internal';\n\n// ----- CORE CLASS ----- // \n\nconst getDefaultFromEnv = (VARIABLE: string): string => {\n if (typeof process !== 'undefined' && process.env) {\n return process.env[VARIABLE] || '';\n }\n return '';\n}\n\n/**\n * Type representing the constructor parameters for the GT class.\n */\ntype GTConstructorParams = {\n apiKey?: string;\n defaultLocale?: string;\n projectID?: string;\n baseURL?: string;\n};\n\n/**\n * GT is the core driver for the General Translation library.\n */\nclass GT {\n apiKey: string;\n defaultLocale: string;\n projectID: string;\n baseURL: string;\n\n /**\n * Constructs an instance of the GT class.\n * \n * @param {GTConstructorParams} [params] - The parameters for initializing the GT instance.\n * @param {string} [params.apiKey=''] - The API key for accessing the translation service.\n * @param {string} [params.defaultLocale='en-US'] - The default locale for translations.\n * @param {string} [params.projectID=''] - The project ID for the translation service.\n * @param {string} [params.baseURL='https://prod.gtx.dev'] - The base URL for the translation service.\n */\n constructor({\n apiKey = '',\n defaultLocale = libraryDefaultLocale,\n projectID = '',\n baseURL = defaultAPIURL\n }: GTConstructorParams = {}) {\n this.apiKey = apiKey || getDefaultFromEnv('GT_API_KEY');\n this.projectID = projectID || getDefaultFromEnv('GT_PROJECT_ID');\n this.defaultLocale = _standardizeLocale(defaultLocale) || libraryDefaultLocale;\n this.baseURL = baseURL;\n }\n\n /**\n * Translates a string or an array of strings/variables into a target locale.\n * If `metadata.save` is provided, the translation is cached for use in a public project.\n * \n * @param {Content} content - The string or array of strings/variables to be translated.\n * @param {string} locale - The target locale code (e.g., 'en-US', 'fr') for the translation.\n * @param {{ context?: string, save?: boolean, [key: string]: any }} [metadata] - Additional metadata for the translation request.\n * @param {string} [metadata.context] - Contextual information to assist with the translation.\n * @param {boolean} [metadata.save] - Whether to cache the translation for use in a public project.\n * \n * @returns {Promise<ContentTranslationResult>} A promise that resolves to the translated content, or an error if the translation fails.\n */\n async translate(content: Content, locale: string, metadata?: { \n context?: string,\n save?: boolean, \n [key: string]: any \n }): Promise<{ translation: Content, locale: string }> {\n return await _translate(this, content, locale, { defaultLocale: this.defaultLocale, ...metadata })\n }\n\n /**\n * Translates the content of React children elements.\n * \n * @param {Object} params - The parameters for the translation.\n * @param {ReactChildrenAsObject} params.children - The React children content to be translated.\n * @param {string} params.locale - The target locale for the translation.\n * @param {Object} params.metadata - Additional metadata for the translation process.\n * \n * @returns {Promise<ReactTranslationResult>} - A promise that resolves to the translated content.\n */\n async translateReact(children: ReactChildrenAsObject, locale: string, metadata?: { context?: string, [key: string]: any }): Promise<ReactTranslationResult> {\n return await _translateReact(this, children, locale, { defaultLocale: this.defaultLocale, ...metadata });\n }\n\n /**\n * Batches multiple translation requests and sends them to the server.\n * @param requests - Array of requests to be processed and sent.\n * @returns A promise that resolves to an array of processed results.\n */\n async translateBatch(requests: Request[]): Promise<Array<ReactTranslationResult | ContentTranslationResult>> {\n return _translateBatch(this, requests);\n }\n\n /**\n * Pushes updates to a remotely cached translation dictionary.\n * @param {Update[]} updates - Array of updates.\n * @param {string[]} [locales] - Array of locales to create translations into.\n * @param {string} [projectID=this.projectID] - The ID of the project. Defaults to the instance's projectID.\n * @param {Record<string, any>} [object] - Options, such as whether to replace the existing dictionary. Defaults to false.\n * @returns {Promise<string[]>} A promise that resolves to an array of strings indicating the locales which have been updated.\n */\n async updateProjectDictionary(\n updates: Update[], \n locales: string[] = [], \n options: {\n replace?: boolean,\n retranslate?: boolean,\n projectID?: string;\n [key: string]: any\n } = {}\n ): Promise<string[]> {\n return _updateProjectDictionary(this, updates, locales, options);\n }\n\n /**\n * Retrieves the locales for a GT project as BCP 47 locale tags.\n * @param projectID - The project ID to retrieve locales for. If not provided, `this.projectID` should be set.\n * @returns A promise that resolves with an object containing an array of locale codes.\n */\n async getProjectLocales(\n projectID?: string\n ): Promise<{ locales: string[] }> {\n return _getProjectLocales(this, projectID || this.projectID);\n }\n\n}\n\n// ----- EXPORTS ----- //\n\n/**\n * Get the text direction for a given locale code using the Intl.Locale API.\n * \n * @param {string} locale - The locale code to check.\n * @returns {string} - 'rtl' if the locale is right-to-left, otherwise 'ltr'.\n */\nexport function getLocaleDirection(locale: string): string {\n return _getLocaleDirection(locale);\n};\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 = 'en-US'] - The locale for display names.\n * @returns {string} The display name corresponding to the code.\n */\nexport function getLocaleName(locale: string, defaultLocale : string = libraryDefaultLocale): string {\n return _getLocaleName(locale, defaultLocale);\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=libraryDefaultLocale] - The default locale code for display 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(locale: string, defaultLocale?: string): {\n // assume code = \"de-AT\", defaultLocale = \"en-US\"\n code: string; // \"de-AT\"\n name: string; // \"Austrian German\"\n nativeName: string; // \"ร–sterreichisches Deutsch\"\n languageCode: string; // \"de\"\n languageName: string; // \"German\"\n nativeLanguageName: string; // \"Deutsch\"\n // note that maximize() is NOT called here!\n nameWithRegionCode: string // \"German (AT)\"\n nativeNameWithRegionCode: string // \"Deutsch (AT)\"\n // for most likely script and region, maximize() is called\n regionCode: string // \"AT\"\n regionName: string // \"Austria\"\n nativeRegionName: string // ร–sterreich\n scriptCode: string; // \"Latn\"\n scriptName: string; // \"Latin\"\n nativeScriptName: string; // \"Lateinisch\"\n maximizedCode: string // \"de-Latn-AT\"\n maximizedName: string // \"Austrian German (Latin)\"\n nativeMaximizedName: string; // ร–sterreichisches Deutsch (Lateinisch)\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 // Emoji depending on region code\n // In order not to accidentally spark international conflict, some emojis are hard-coded\n emoji: string; \n} {\n return _getLocaleProperties(locale, defaultLocale)\n};\n\n/**\n * Retrieves an emoji based on a given locale code, taking into account region, language, and specific exceptions.\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 code - A string representing the locale code (e.g., 'en-US', 'fr-CA').\n * @param custom - An optional custom mapping of locale codes to emojis.\n * @returns The emoji representing the locale or its region, or a default emoji if no specific match is found.\n*/\nexport function getLocaleEmoji(locale: string, custom?: Record<string, string>) {\n return _getLocaleEmoji(locale, custom);\n}\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 * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n */\nexport function isValidLocale(locale: string): boolean {\n return _isValidLocale(locale);\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 * \n * For example, `\"en-US\"` and `\"en-GB\"` are the same language, but different dialects.\n * `isSameDialect(\"en-US\", \"en-GB\")` would return `false`.\n * \n * For checking if two locale codes represent the same language, see `isSameLanguage()`.\n * \n * Note that `isSameDialect(\"en\", \"en-US\")` and `isSameDialect(\"en\", \"en-GB\")` would both return true.\n * \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 * \n * For example, `\"en-US\"` and `\"en-GB\"` are the same language, English.\n * `isSameDialect(\"en-US\", \"en-GB\")` would return `true`.\n * \n * For checking if two codes represent the exact same dialect, see `isSameDialect()`.\n * \n * @param {string[]} locales - The BCP 47 locale codes to compare.\n * @returns {boolean} True if all BCP 47 codes represent the same locale, false otherwise.\n*/\nexport function isSameLanguage(...locales: (string | string[])[]): boolean {\n return _isSameLanguage(...locales)\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 {string | string[]} [params.locales=['en-US']] - The locales to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for number formatting.\n * @returns {string} The formatted number.\n */\nexport function formatNum(params: { value: number; locales?: string | string[]; options?: Intl.NumberFormatOptions }): string {\n return _formatNum(params);\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 {string | string[]} [params.locales=['en-US']] - The languages to use for formatting.\n * @param {Intl.DateTimeFormatOptions} [params.options={}] - Additional options for date formatting.\n * @returns {string} The formatted date.\n */\nexport function formatDateTime(params: { value: Date; locales?: string | string[]; options?: Intl.DateTimeFormatOptions }): string {\n return _formatDateTime(params);\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 {string | string[]} [params.locales=['en-US']] - The locale codes to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.\n * @returns {string} The formatted currency value.\n */\nexport function formatCurrency(params: { value: number; currency: string; locales?: string | string[]; options?: Intl.NumberFormatOptions }): string {\n return _formatCurrency(params);\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 {string | string[]} [params.locales=['en-US']] - The locales to use for formatting.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n * @returns {string} The formatted list.\n */\nexport function formatList(params: { value: Array<string | number>; locales?: string | string[]; options?: Intl.ListFormatOptions }) {\n return _formatList(params);\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 {string | string[]} [params.locales=['en-US']] - The locales to use for formatting.\n * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.\n * @returns {string} The formatted relative time string.\n */\nexport function formatRelativeTime(params: { value: number; unit: Intl.RelativeTimeFormatUnit; locales?: string | string[]; options?: Intl.RelativeTimeFormatOptions }): string {\n return _formatRelativeTime(params);\n};\n\n/**\n * Splits a string into an array of text and variable objects.\n * @param {string} string - The input string to split.\n * @returns {Content} - An array containing strings and VariableObjects.\n */\nexport function splitStringToContent(string: string): Content {\n return _splitStringToContent(string);\n};\n\n/**\n * Renders content to a string by replacing variables with their formatted values.\n * @param {Content} content - The content to render.\n * @param {string | string[]} [locales='en-US'] - The locale(s) to use for formatting.\n * @param {Record<string, any>} [variables={}] - An object containing variable values.\n * @param {Record<string, any>} [variableOptions={}] - An object containing options for formatting variables.\n * @returns {string} - The rendered string with variables replaced by their formatted values.\n */\nexport function renderContentToString(content: Content, locales?: string | string[], variables?: Record<string, any>, variableOptions?: Record<string, any>): string {\n return _renderContentToString(content, locales, variables, variableOptions)\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 - 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(locales: string | string[], approvedLocales: string[]): string | undefined {\n return _determineLocale(locales, approvedLocales);\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(sourceLocale: string, targetLocale: string, approvedLocales?: string[]): boolean {\n return _requiresTranslation(sourceLocale, targetLocale, approvedLocales);\n};\n\n// DEFAULT EXPORT\n\nexport default GT;","import { _standardizeLocale } from './_isValidLocale';\nimport _isSameLanguage from './_isSameLanguage';\nimport { _isSameDialect } from './_requiresTranslation';\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[], approvedLocales: string[]\n): string | undefined {\n if (typeof locales === 'string')\n locales = [locales];\n if (!approvedLocales) return locales[0];\n for (const locale of locales) {\n const currentLocale = _standardizeLocale(locale)\n const candidates: string[] = [];\n for (const approvedLocale of approvedLocales) {\n const currentApprovedLocale = _standardizeLocale(approvedLocale);\n if (currentLocale === currentApprovedLocale) \n return currentApprovedLocale; // instant match! return\n if (_isSameLanguage(currentLocale, currentApprovedLocale)) \n candidates.push(currentApprovedLocale); // covers same dialect as well\n }\n if (candidates.length) \n return candidates.find(candidate => _isSameDialect(currentLocale, candidate)) || \n candidates[0];\n }\n return undefined;\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): string {\n try {\n const locale = new Intl.Locale(code);\n // Return 'rtl' if the text direction of the language is right-to-left, otherwise 'ltr'\n return (locale as any)?.textInfo?.direction === 'rtl' ? 'rtl' : 'ltr';\n } catch {\n // If the code is invalid or causes an error, fallback to 'ltr'\n return 'ltr';\n }\n}\n","import { libraryDefaultLocale } from \"../internal\";\n\n/**\n * Retrieves the display name(s) of language code(s) using Intl.DisplayNames.\n *\n * @param {string} code - A language code.\n * @param {string} [defaultLanguage=libraryDefaultLanguage] - The language 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(code: string, defaultLanguage: string = libraryDefaultLocale): string {\n try {\n const displayNames = new Intl.DisplayNames([defaultLanguage, libraryDefaultLocale], { type: 'language' });\n return displayNames.of(code) || '';\n } catch {\n // In case Intl.DisplayNames construction fails, return empty string(s)\n return '';\n }\n}","import { standardizeLocale } from \"src\";\nimport { libraryDefaultLocale } from \"../internal\";\nimport _getLocale from \"./_getLocaleEmoji\";\nimport { _isValidLocale, _standardizeLocale } from \"./_isValidLocale\";\nimport _getLocaleEmoji from \"./_getLocaleEmoji\";\n\ntype LocaleProperties = {\n \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* @internal\n*/\nexport default function _getLocaleProperties(\n locale: string, defaultLocale: string = libraryDefaultLocale\n): LocaleProperties {\n try {\n\n locale = standardizeLocale(locale); // \"de-AT\"\n\n const localeObject = new Intl.Locale(locale);\n const languageCode = localeObject.language; // \"de\"\n const baseRegion = localeObject.region; // \"AT\"\n \n const maximizedLocale = new Intl.Locale(locale).maximize(); \n const maximizedCode = maximizedLocale.toString(); // \"de-Latn-AT\"\n const regionCode = maximizedLocale.region || ''; // \"AT\"\n const scriptCode = maximizedLocale.script || ''; // \"Latn\"\n \n const minimizedLocale = new Intl.Locale(locale).minimize();\n const minimizedCode = minimizedLocale.toString(); // \"de-AT\"\n\n // Language names (default and native)\n\n const languageNames = new Intl.DisplayNames([defaultLocale, locale, libraryDefaultLocale], { type: 'language' });\n const nativeLanguageNames = new Intl.DisplayNames([locale, defaultLocale, libraryDefaultLocale], { type: 'language' });\n\n const name = languageNames.of(locale) || locale; // \"Austrian German\"\n const nativeName = nativeLanguageNames.of(locale) || locale; // \"ร–sterreichisches Deutsch\"\n \n const maximizedName = languageNames.of(maximizedCode) || locale; // \"Austrian German (Latin)\"\n const nativeMaximizedName = nativeLanguageNames.of(maximizedCode) || locale; // \"ร–sterreichisches Deutsch (Lateinisch)\"\n \n const minimizedName = languageNames.of(minimizedCode) || locale; // \"Austrian German\", but for \"de-DE\" would just be \"German\"\n const nativeMinimizedName = nativeLanguageNames.of(minimizedCode) || locale; // \"ร–sterreichisches Deutsch\", but for \"de-DE\" would just be \"Deutsch\"\n \n const languageName = languageNames.of(languageCode) || locale; // \"German\"\n const nativeLanguageName = nativeLanguageNames.of(languageCode) || locale; // \"Deutsch\"\n\n const nameWithRegionCode = baseRegion ? `${languageName} (${baseRegion})`: languageName; // German (AT)\n const nativeNameWithRegionCode = baseRegion ? `${nativeLanguageName} (${baseRegion})`: nativeLanguageName; // \"Deutsch (AT)\"\n\n // Region names (default and native)\n\n const regionNames = new Intl.DisplayNames([defaultLocale, locale, libraryDefaultLocale], { type: 'region' });\n const nativeRegionNames = new Intl.DisplayNames([locale, defaultLocale, libraryDefaultLocale], { type: 'region' });\n\n const regionName = regionNames.of(regionCode) || ''; // \"Austria\"\n const nativeRegionName = nativeRegionNames.of(regionCode) || ''; // \"ร–sterreich\"\n\n // Script names (default and native)\n\n const scriptNames = new Intl.DisplayNames([defaultLocale, locale, libraryDefaultLocale], { type: 'script' }); \n const nativeScriptNames = new Intl.DisplayNames([locale, defaultLocale, libraryDefaultLocale], { type: 'script' }); \n\n const scriptName = scriptNames.of(scriptCode) || ''; // \"Latin\"\n const nativeScriptName = nativeScriptNames.of(scriptCode) || ''; // \"Lateinisch\"\n\n // Emoji \n\n const emoji = _getLocaleEmoji(locale);\n\n return {\n code: locale, name, nativeName,\n maximizedCode, maximizedName, nativeMaximizedName,\n minimizedCode, minimizedName, nativeMinimizedName,\n languageCode, languageName, nativeLanguageName,\n nameWithRegionCode, nativeNameWithRegionCode,\n regionCode, regionName, nativeRegionName,\n scriptCode, scriptName, nativeScriptName,\n emoji\n }\n } catch (error) {\n \n const code = locale || '';\n const codeParts = code?.split('-');\n const languageCode = codeParts?.[0] || code || '';\n const regionCode = codeParts.length > 2 ? codeParts?.[2] : codeParts?.[1] || '';\n const scriptCode = codeParts?.[3] || '';\n const nameWithRegionCode = languageCode ? (regionCode ? `${languageCode} (${regionCode})` : languageCode) : '';\n \n return {\n code, name: code, nativeName: code, \n maximizedCode: code, maximizedName: code, nativeMaximizedName: code,\n minimizedCode: code, minimizedName: code, nativeMinimizedName: code,\n languageCode, languageName: languageCode, nativeLanguageName: languageCode,\n regionCode, regionName: regionCode, nativeRegionName: regionCode,\n scriptCode, scriptName: scriptCode, nativeScriptName: scriptCode,\n nameWithRegionCode, nativeNameWithRegionCode: code,\n emoji: _getLocaleEmoji(code)\n }\n }\n\n}"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","_","label","sent","trys","ops","g","create","Iterator","verb","Symbol","iterator","v","op","TypeError","pop","push","SuppressedError","defaultAPIRoutes","_translateBatch","gt","requests","controller","AbortController","signal","_f","_e","_d","data","metadata","timeout","setTimeout","abort","fetch","concat","baseURL","method","headers","apiKey","JSON","stringify","response","_g","ok","Error","bind","_c","_b","status","text","json","_isSameLanguage","locales","_i","languages_1","flat","map","locale","Intl","Locale","language","every","error","console","libraryDefaultLocale","scriptExceptions","_isValidLocale","_a","region","script","DisplayNames","type","of","includes","_standardizeLocale","getCanonicalLocales","_isSameDialect","codeA","codeB","languageA","regionA","scriptA","languageB","regionB","scriptB","flattenedCodes","j","_translate","content","targetLocale","_translateReact","children","_updateProjectDictionary","updates","options","_getProjectLocales","projectID","_formatNum","NumberFormat","numberingSystem","format","_formatDateTime","DateTimeFormat","calendar","_formatCurrency","currency","style","_formatList","ListFormat","variableTypeMap","var","num","datetime","_splitStringToContent","string","match","regex","lastIndex","exec","fullMatch","startIndex","index","slice","parts","split","part","trim","key","variableType","undefined","variableObject","variable","_getLocaleEmoji","customMapping","defaultEmoji","localeObject","emojis","extrapolated","maximize","extrapolatedRegion","exceptions","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","getDefaultFromEnv","VARIABLE","process","env","defaultLocale","translate","translateReact","translateBatch","updateProjectDictionary","updates_1","getProjectLocales","standardizeLocale","approvedLocales","currentLocale","candidates","approvedLocales_1","approvedLocale","currentApprovedLocale","find","candidate","locales_1","_determineLocale","params","unit","RelativeTimeFormat","numeric","code","textInfo","direction","_getLocaleDirection","custom","defaultLanguage","_getLocaleName","languageCode","baseRegion","maximizedLocale","maximizedCode","toString","regionCode","scriptCode","minimizedCode","minimize","languageNames","nativeLanguageNames","name","nativeName","maximizedName","nativeMaximizedName","minimizedName","nativeMinimizedName","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionNames","nativeRegionNames","regionName","nativeRegionName","scriptNames","nativeScriptNames","scriptName","nativeScriptName","emoji","codeParts","_getLocaleProperties","variables","variableOptions","Array","isArray","item","join","_renderContentToString","sourceLocale","some","_requiresTranslation"],"mappings":"oEA+BO,IAAIA,EAAW,WAQlB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAChC,EA0EO,SAASQ,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,GAAU,CAAC,MAAOG,GAAKL,EAAOK,GAAO,CAC9F,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1C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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,OACJ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D,GAAkB,OAAA9W,EAAgBsC,EAAcwU,EAAe,IAIhH,CQuVW0D,CAAqBF,EAAchY,EAAcoU,EAC5D,+BA1CM,SAA+B3S,GACjC,OAAOD,EAAsBC,EACjC","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.cjs.min.cjs","sources":["../node_modules/tslib/tslib.es6.js","../src/settings/defaultAPIRoutes.ts","../src/translation/batch/_translateBatch.ts","../src/locales/_isSameLanguage.ts","../src/internal.ts","../src/locales/_isValidLocale.ts","../src/locales/_requiresTranslation.ts","../src/translation/translate/_translate.ts","../src/translation/react/_translateReact.ts","../src/projects/_updateProjectDictionary.ts","../src/projects/_getProjectLocales.ts","../src/formatting/format.ts","../src/formatting/string_content.ts","../src/locales/_getLocaleEmoji.ts","../src/index.ts","../src/locales/_determineLocale.ts","../src/locales/_getLocaleDirection.ts","../src/locales/_getLocaleName.ts","../src/locales/_getLocaleProperties.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\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\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","const defaultAPIRoutes = {\n \"translateBatch\": \"/v1/translate/batch\",\n \"translateReact\": \"/v1/translate/react\",\n \"translateContent\": \"/v1/translate/content\",\n \"updateProjectDictionary\": \"/v1/project/dictionary/update\",\n \"getProjectLocales\": \"/v1/project/locales\"\n} as const;\n\nexport default defaultAPIRoutes;","import { ContentTranslationResult, ReactTranslationResult, Request } from '../../types/types'\nimport defaultAPIRoutes from '../../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _translateBatch(\n gt: { baseURL: string, apiKey: string },\n requests: Request[]\n): Promise<Array<ReactTranslationResult | ContentTranslationResult>> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (requests[0]?.data?.metadata?.timeout) {\n setTimeout(() => controller.abort(), requests[0].data.metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateBatch}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify(requests),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const resultArray = await response.json();\n return resultArray as Array<ReactTranslationResult | ContentTranslationResult>;\n}","/**\n * @internal\n */\nexport default function _isSameLanguage(...locales: (string | string[])[]): boolean {\n try {\n const flattenedCodes = locales.flat();\n // Get the language for each code\n const languages = flattenedCodes.map(locale => new Intl.Locale(locale).language);\n return languages.every(language => language === languages[0]);\n } catch (error) {\n console.error(error);\n return false;\n }\n}\n","export const libraryDefaultLocale = \"en-US\" as const;\nexport const localeCookieName = \"generaltranslation.locale\" as const;\nexport const pluralForms = [\"singular\", \"plural\", \"dual\", \"zero\", \"one\", \"two\", \"few\", \"many\", \"other\"] as const;\nexport const defaultCacheURL = \"https://cache.gtx.dev\" as const;\nexport const defaultAPIURL = \"https://prod.gtx.dev\" as const;\nexport const localeHeaderName = \"x-generaltranslation-locale\";\nexport function isAcceptedPluralForm(\n form: string\n ): form is (typeof pluralForms)[number] {\n return pluralForms.includes(form as (typeof pluralForms)[number]);\n}","import { libraryDefaultLocale } from \"../internal\";\n\nconst scriptExceptions = [\n \"Cham\",\n \"Jamo\",\n \"Kawi\",\n \"Lisu\",\n \"Toto\",\n \"Thai\"\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 * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n * @internal\n */\nexport const _isValidLocale = (locale: string): boolean => {\n try {\n const { language, region, script } = new Intl.Locale(locale);\n const displayLanguageNames = new Intl.DisplayNames([libraryDefaultLocale], { type: 'language' });\n if (displayLanguageNames.of(language) === language) return false;\n if (region) {\n const displayRegionNames = new Intl.DisplayNames([libraryDefaultLocale], { type: 'region' });\n if (displayRegionNames.of(region) === region) return false;\n }\n if (script) {\n const displayScriptNames = new Intl.DisplayNames([libraryDefaultLocale], { type: 'script' });\n if (displayScriptNames.of(script) === script && !scriptExceptions.includes(script)) 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 return Intl.getCanonicalLocales(locale)[0];\n};","import _isSameLanguage from \"./_isSameLanguage\";\nimport { _isValidLocale, _standardizeLocale } from \"./_isValidLocale\";\n\nfunction checkTwoLocalesAreSameDialect(codeA: string, codeB: string) {\n const { language: languageA, region: regionA, script: scriptA } = new Intl.Locale(codeA);\n const { language: languageB, region: regionB, script: scriptB } = new Intl.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 function _isSameDialect(...locales: (string | string[])[]): boolean {\n try {\n\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 (!checkTwoLocalesAreSameDialect(flattenedCodes[i], flattenedCodes[j])) return false;\n } \n }\n\n return true;\n } catch (error) {\n console.error(error);\n return false;\n }\n}\n\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, targetLocale: string, approvedLocales?: string[]\n): boolean {\n\n // If codes are invalid\n if (!_isValidLocale(sourceLocale) ||\n !_isValidLocale(targetLocale) || \n (approvedLocales && approvedLocales.some(approvedLocale => !_isValidLocale(approvedLocale)))\n ) return false;\n\n // Check if the languages are identical, if so, a translation is not required\n if (_isSameDialect(sourceLocale, targetLocale)) return false;\n \n // if no translation is possible\n // isSameLanguage rather than isIdenticalDialect so we can show different dialects as a fallback\n if (approvedLocales && !approvedLocales.some(approvedLocale => _isSameLanguage(targetLocale, approvedLocale))) return false;\n \n // otherwise, a translation is required!\n return true;\n}","import { Content, ContentTranslationResult } from \"src/types/types\";\nimport defaultAPIRoutes from \"../../settings/defaultAPIRoutes\";\n\n/**\n * @internal\n**/\nexport default async function _translate(\n gt: { baseURL: string; apiKey: string },\n content: Content,\n targetLocale: string,\n metadata: { [key: string]: any }\n): Promise<ContentTranslationResult> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (metadata.timeout) {\n setTimeout(() => controller.abort(), metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateContent}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n content, targetLocale, metadata\n }),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json();\n return result as ContentTranslationResult;\n}\n\n","import { ReactChildrenAsObject, ReactTranslationResult } from \"src/types/types\";\nimport defaultAPIRoutes from \"../../settings/defaultAPIRoutes\";\n\n/**\n * @internal\n**/\nexport default async function _translateReact(\n gt: { baseURL: string, apiKey: string },\n content: ReactChildrenAsObject,\n targetLocale: string,\n metadata: { [key: string]: any }\n): Promise<ReactTranslationResult> {\n const controller = new AbortController();\n const signal = controller.signal;\n if (metadata.timeout) {\n setTimeout(() => controller.abort(), metadata.timeout);\n }\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.translateReact}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n children: content,\n targetLocale,\n metadata: metadata\n }),\n signal\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n return await response.json() as ReactTranslationResult;\n}","import { Content, Update } from '../types/types'\nimport defaultAPIRoutes from '../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _updateProjectDictionary(\n gt: { baseURL: string, apiKey: string },\n updates: Update[],\n locales: string[],\n options: Record<string, any>\n): Promise<{ locales?: string[] }> {\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.updateProjectDictionary}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n },\n body: JSON.stringify({\n updates, locales, options\n })\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json();\n return result as any;\n}","import defaultAPIRoutes from '../settings/defaultAPIRoutes';\n\n/**\n * @internal\n */\nexport default async function _getProjectLocales(\n gt: { baseURL: string, apiKey: string },\n projectID: string\n): Promise<{ locales: string[] }> {\n const response = await fetch(`${gt.baseURL}${defaultAPIRoutes.getProjectLocales}?projectID=${projectID}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'gtx-api-key': gt.apiKey,\n }\n });\n if (!response.ok) {\n throw new Error(`${response.status}: ${await response.text()}`);\n }\n const result = await response.json() as any;\n return result;\n}","import { libraryDefaultLocale } from \"../internal\";\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-US']] - 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, locales?: string | string[]\n options?: Intl.NumberFormatOptions\n}): string {\n return new Intl.NumberFormat(locales, { numberingSystem: 'latn', ...options }).format(value);\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-US']] - 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, locales?: string | string[]\n options?: Intl.DateTimeFormatOptions\n}): string {\n return new Intl.DateTimeFormat(locales, { calendar: \"gregory\", numberingSystem: \"latn\", ...options }).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-US']] - 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 new Intl.NumberFormat(locales, { style: 'currency', currency, numberingSystem: 'latn', ...options }).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-US']] - 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 new Intl.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 }).format(value);\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-US']] - 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 new Intl.RelativeTimeFormat(locales, { style: \"long\", numeric: 'auto', ...options }).format(value, unit);\n}","import { libraryDefaultLocale } from '../internal';\nimport { Content, VariableObject } from '../types/types'\nimport { _formatCurrency, _formatDateTime, _formatNum, _formatList, _formatRelativeTime } from './format'\n\n// Variable types mapping\nconst variableTypeMap: { [key: string]: string } = {\n var: \"variable\",\n num: \"number\",\n datetime: \"datetime\",\n currency: \"currency\"\n};\n\n/** \n* @internal\n*/\n/** \n * @internal\n */\nexport function _splitStringToContent(string: string): Content {\n if (typeof string !== 'string')\n throw new Error(`splitStringToContent: ${string} is not a string!`)\n\n const result: (string | VariableObject)[] = [];\n const regex = /{([^}]+)}/g;\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n while ((match = regex.exec(string)) !== null) {\n const [fullMatch, content] = match;\n const startIndex = match.index;\n\n // Check for escaped braces with '^' right before the opening brace\n if (string[startIndex - 1] === \"^\") {\n // Add text before the escape sequence\n if (startIndex - 1 > lastIndex) {\n result.push(string.slice(lastIndex, startIndex - 1));\n }\n // Add the escaped content as literal text\n result.push(fullMatch);\n lastIndex = startIndex + fullMatch.length;\n continue;\n }\n\n // Add text before the match\n if (startIndex > lastIndex) {\n result.push(string.slice(lastIndex, startIndex));\n }\n\n // Handle the variable substitution inside the braces\n const parts = content.split(\",\").map(part => part.trim());\n const key = parts[0];\n const variableType = parts[1] ? variableTypeMap[parts[1]] : undefined;\n\n const variableObject: VariableObject = {\n key,\n ...(variableType && { variable: variableType })\n };\n result.push(variableObject);\n\n lastIndex = startIndex + fullMatch.length;\n }\n\n // Add the remaining part of the string after the last match\n if (lastIndex < string.length) {\n result.push(string.slice(lastIndex));\n }\n\n return result;\n}\n\n\n/** \n* @internal\n*/\nexport function _renderContentToString(content: Content, locales: string | string[] = libraryDefaultLocale, variables: Record<string, any> = {}, variableOptions: Record<string, any> = {}): string {\n if (typeof content === 'string')\n content = _splitStringToContent(content);\n if (typeof content === 'string')\n return content;\n if (!Array.isArray(content))\n throw new Error(`renderContentToString: content ${content} is invalid`);\n return content.map(item => {\n if (typeof item === 'string') return item;\n if (typeof item === 'object') {\n const value = variables[item.key]\n if (!item.variable) return value;\n else if (item.variable === \"number\") {\n return _formatNum({\n value, locales, \n options: variableOptions[item.key]\n })\n }\n else if (item.variable === \"currency\") {\n return _formatCurrency({\n value, locales, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n ...(variableOptions[item.key]?.currency && { currency: variableOptions[item.key].currency })\n })\n }\n else if (item.variable === \"datetime\") {\n return _formatDateTime({\n value, locales, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n })\n }\n else if (item.variable === \"list\") {\n return _formatList({\n value, locales, \n ...(variableOptions[item.key] && { options: variableOptions[item.key]}),\n })\n }\n return value;\n }\n }).join('') \n}","import { _isValidLocale, _standardizeLocale } from \"./_isValidLocale\";\n\n/**\n* @internal\n*/\nexport default function _getLocaleEmoji(\n locale: string, \n customMapping: Record<string, string> = {}\n): string {\n if (!_isValidLocale(locale))\n return defaultEmoji;\n\n locale = _standardizeLocale(locale)\n\n if (customMapping[locale]) return customMapping[locale];\n \n // if a region is specified, use it!\n const localeObject = new Intl.Locale(locale);\n const { region } = localeObject;\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}\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\nconst 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} as Record<string, string>;","// `generaltranslation` language toolkit\n// ยฉ 2024, General Translation, Inc.\n\n// ----- IMPORTS ----- //\n\nimport _translateBatch from './translation/batch/_translateBatch';\nimport _requiresTranslation, { _isSameDialect } from './locales/_requiresTranslation';\nimport _translate from './translation/translate/_translate';\nimport _translateReact from './translation/react/_translateReact';\nimport _updateProjectDictionary from './projects/_updateProjectDictionary';\nimport _getProjectLocales from './projects/_getProjectLocales';\nimport _determineLocale from './locales/_determineLocale';\nimport { _formatNum, _formatCurrency, _formatList, _formatRelativeTime, _formatDateTime } from './formatting/format';\nimport { _splitStringToContent, _renderContentToString } from './formatting/string_content'\nimport { Content, Update, Request, ReactChildrenAsObject, ReactTranslationResult, ContentTranslationResult } from './types/types'\nimport _isSameLanguage from './locales/_isSameLanguage'\nimport _getLocaleProperties 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 { defaultAPIURL, libraryDefaultLocale } from './internal';\n\n// ----- CORE CLASS ----- // \n\nconst getDefaultFromEnv = (VARIABLE: string): string => {\n if (typeof process !== 'undefined' && process.env) {\n return process.env[VARIABLE] || '';\n }\n return '';\n}\n\n/**\n * Type representing the constructor parameters for the GT class.\n */\ntype GTConstructorParams = {\n apiKey?: string;\n defaultLocale?: string;\n projectID?: string;\n baseURL?: string;\n};\n\n/**\n * GT is the core driver for the General Translation library.\n */\nclass GT {\n apiKey: string;\n defaultLocale: string;\n projectID: string;\n baseURL: string;\n\n /**\n * Constructs an instance of the GT class.\n * \n * @param {GTConstructorParams} [params] - The parameters for initializing the GT instance.\n * @param {string} [params.apiKey=''] - The API key for accessing the translation service.\n * @param {string} [params.defaultLocale='en-US'] - The default locale for translations.\n * @param {string} [params.projectID=''] - The project ID for the translation service.\n * @param {string} [params.baseURL='https://prod.gtx.dev'] - The base URL for the translation service.\n */\n constructor({\n apiKey = '',\n defaultLocale = libraryDefaultLocale,\n projectID = '',\n baseURL = defaultAPIURL\n }: GTConstructorParams = {}) {\n this.apiKey = apiKey || getDefaultFromEnv('GT_API_KEY');\n this.projectID = projectID || getDefaultFromEnv('GT_PROJECT_ID');\n this.defaultLocale = _standardizeLocale(defaultLocale) || libraryDefaultLocale;\n this.baseURL = baseURL;\n }\n\n /**\n * Translates a string or an array of strings/variables into a target locale.\n * If `metadata.save` is provided, the translation is cached for use in a public project.\n * \n * @param {Content} content - The string or array of strings/variables to be translated.\n * @param {string} locale - The target locale code (e.g., 'en-US', 'fr') for the translation.\n * @param {{ context?: string, save?: boolean, [key: string]: any }} [metadata] - Additional metadata for the translation request.\n * @param {string} [metadata.context] - Contextual information to assist with the translation.\n * @param {boolean} [metadata.save] - Whether to cache the translation for use in a public project.\n * \n * @returns {Promise<ContentTranslationResult>} A promise that resolves to the translated content, or an error if the translation fails.\n */\n async translate(content: Content, locale: string, metadata?: { \n context?: string,\n save?: boolean, \n [key: string]: any \n }): Promise<{ translation: Content, locale: string }> {\n return await _translate(this, content, locale, { defaultLocale: this.defaultLocale, ...metadata })\n }\n\n /**\n * Translates the content of React children elements.\n * \n * @param {Object} params - The parameters for the translation.\n * @param {ReactChildrenAsObject} params.children - The React children content to be translated.\n * @param {string} params.locale - The target locale for the translation.\n * @param {Object} params.metadata - Additional metadata for the translation process.\n * \n * @returns {Promise<ReactTranslationResult>} - A promise that resolves to the translated content.\n */\n async translateReact(children: ReactChildrenAsObject, locale: string, metadata?: { context?: string, [key: string]: any }): Promise<ReactTranslationResult> {\n return await _translateReact(this, children, locale, { defaultLocale: this.defaultLocale, ...metadata });\n }\n\n /**\n * Batches multiple translation requests and sends them to the server.\n * @param requests - Array of requests to be processed and sent.\n * @returns A promise that resolves to an array of processed results.\n */\n async translateBatch(requests: Request[]): Promise<Array<ReactTranslationResult | ContentTranslationResult>> {\n return _translateBatch(this, requests);\n }\n\n /**\n * Pushes updates to a remotely cached translation dictionary.\n * @param {Update[]} updates - Array of updates.\n * @param {string[]} [locales] - Array of locales to create translations into.\n * @param {string} [projectID=this.projectID] - The ID of the project. Defaults to the instance's projectID.\n * @param {Record<string, any>} [object] - Options, such as whether to replace the existing dictionary. Defaults to false.\n * @returns {Promise<string[]>} A promise that resolves to an array of strings indicating the locales which have been updated.\n */\n async updateProjectDictionary(\n updates: Update[], \n locales: string[] = [], \n options: {\n replace?: boolean,\n retranslate?: boolean,\n projectID?: string;\n [key: string]: any\n } = {}\n ): Promise<{ locales?: string[] }> {\n return await _updateProjectDictionary(this, updates, locales, options);\n }\n\n /**\n * Retrieves the locales for a GT project as BCP 47 locale tags.\n * @param projectID - The project ID to retrieve locales for. If not provided, `this.projectID` should be set.\n * @returns A promise that resolves with an object containing an array of locale codes.\n */\n async getProjectLocales(\n projectID?: string\n ): Promise<{ locales: string[] }> {\n return _getProjectLocales(this, projectID || this.projectID);\n }\n\n}\n\n// ----- EXPORTS ----- //\n\n/**\n * Get the text direction for a given locale code using the Intl.Locale API.\n * \n * @param {string} locale - The locale code to check.\n * @returns {string} - 'rtl' if the locale is right-to-left, otherwise 'ltr'.\n */\nexport function getLocaleDirection(locale: string): string {\n return _getLocaleDirection(locale);\n};\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 = 'en-US'] - The locale for display names.\n * @returns {string} The display name corresponding to the code.\n */\nexport function getLocaleName(locale: string, defaultLocale : string = libraryDefaultLocale): string {\n return _getLocaleName(locale, defaultLocale);\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=libraryDefaultLocale] - The default locale code for display 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(locale: string, defaultLocale?: string): {\n // assume code = \"de-AT\", defaultLocale = \"en-US\"\n code: string; // \"de-AT\"\n name: string; // \"Austrian German\"\n nativeName: string; // \"ร–sterreichisches Deutsch\"\n languageCode: string; // \"de\"\n languageName: string; // \"German\"\n nativeLanguageName: string; // \"Deutsch\"\n // note that maximize() is NOT called here!\n nameWithRegionCode: string // \"German (AT)\"\n nativeNameWithRegionCode: string // \"Deutsch (AT)\"\n // for most likely script and region, maximize() is called\n regionCode: string // \"AT\"\n regionName: string // \"Austria\"\n nativeRegionName: string // ร–sterreich\n scriptCode: string; // \"Latn\"\n scriptName: string; // \"Latin\"\n nativeScriptName: string; // \"Lateinisch\"\n maximizedCode: string // \"de-Latn-AT\"\n maximizedName: string // \"Austrian German (Latin)\"\n nativeMaximizedName: string; // ร–sterreichisches Deutsch (Lateinisch)\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 // Emoji depending on region code\n // In order not to accidentally spark international conflict, some emojis are hard-coded\n emoji: string; \n} {\n return _getLocaleProperties(locale, defaultLocale)\n};\n\n/**\n * Retrieves an emoji based on a given locale code, taking into account region, language, and specific exceptions.\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 code - A string representing the locale code (e.g., 'en-US', 'fr-CA').\n * @param custom - An optional custom mapping of locale codes to emojis.\n * @returns The emoji representing the locale or its region, or a default emoji if no specific match is found.\n*/\nexport function getLocaleEmoji(locale: string, custom?: Record<string, string>) {\n return _getLocaleEmoji(locale, custom);\n}\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 * @returns {boolean} True if the BCP 47 code is valid, false otherwise.\n */\nexport function isValidLocale(locale: string): boolean {\n return _isValidLocale(locale);\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 * \n * For example, `\"en-US\"` and `\"en-GB\"` are the same language, but different dialects.\n * `isSameDialect(\"en-US\", \"en-GB\")` would return `false`.\n * \n * For checking if two locale codes represent the same language, see `isSameLanguage()`.\n * \n * Note that `isSameDialect(\"en\", \"en-US\")` and `isSameDialect(\"en\", \"en-GB\")` would both return true.\n * \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 * \n * For example, `\"en-US\"` and `\"en-GB\"` are the same language, English.\n * `isSameDialect(\"en-US\", \"en-GB\")` would return `true`.\n * \n * For checking if two codes represent the exact same dialect, see `isSameDialect()`.\n * \n * @param {string[]} locales - The BCP 47 locale codes to compare.\n * @returns {boolean} True if all BCP 47 codes represent the same locale, false otherwise.\n*/\nexport function isSameLanguage(...locales: (string | string[])[]): boolean {\n return _isSameLanguage(...locales)\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 {string | string[]} [params.locales=['en-US']] - The locales to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for number formatting.\n * @returns {string} The formatted number.\n */\nexport function formatNum(params: { value: number; locales?: string | string[]; options?: Intl.NumberFormatOptions }): string {\n return _formatNum(params);\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 {string | string[]} [params.locales=['en-US']] - The languages to use for formatting.\n * @param {Intl.DateTimeFormatOptions} [params.options={}] - Additional options for date formatting.\n * @returns {string} The formatted date.\n */\nexport function formatDateTime(params: { value: Date; locales?: string | string[]; options?: Intl.DateTimeFormatOptions }): string {\n return _formatDateTime(params);\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 {string | string[]} [params.locales=['en-US']] - The locale codes to use for formatting.\n * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.\n * @returns {string} The formatted currency value.\n */\nexport function formatCurrency(params: { value: number; currency: string; locales?: string | string[]; options?: Intl.NumberFormatOptions }): string {\n return _formatCurrency(params);\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 {string | string[]} [params.locales=['en-US']] - The locales to use for formatting.\n * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.\n * @returns {string} The formatted list.\n */\nexport function formatList(params: { value: Array<string | number>; locales?: string | string[]; options?: Intl.ListFormatOptions }) {\n return _formatList(params);\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 {string | string[]} [params.locales=['en-US']] - The locales to use for formatting.\n * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.\n * @returns {string} The formatted relative time string.\n */\nexport function formatRelativeTime(params: { value: number; unit: Intl.RelativeTimeFormatUnit; locales?: string | string[]; options?: Intl.RelativeTimeFormatOptions }): string {\n return _formatRelativeTime(params);\n};\n\n/**\n * Splits a string into an array of text and variable objects.\n * @param {string} string - The input string to split.\n * @returns {Content} - An array containing strings and VariableObjects.\n */\nexport function splitStringToContent(string: string): Content {\n return _splitStringToContent(string);\n};\n\n/**\n * Renders content to a string by replacing variables with their formatted values.\n * @param {Content} content - The content to render.\n * @param {string | string[]} [locales='en-US'] - The locale(s) to use for formatting.\n * @param {Record<string, any>} [variables={}] - An object containing variable values.\n * @param {Record<string, any>} [variableOptions={}] - An object containing options for formatting variables.\n * @returns {string} - The rendered string with variables replaced by their formatted values.\n */\nexport function renderContentToString(content: Content, locales?: string | string[], variables?: Record<string, any>, variableOptions?: Record<string, any>): string {\n return _renderContentToString(content, locales, variables, variableOptions)\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 - 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(locales: string | string[], approvedLocales: string[]): string | undefined {\n return _determineLocale(locales, approvedLocales);\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(sourceLocale: string, targetLocale: string, approvedLocales?: string[]): boolean {\n return _requiresTranslation(sourceLocale, targetLocale, approvedLocales);\n};\n\n// DEFAULT EXPORT\n\nexport default GT;","import { _standardizeLocale } from './_isValidLocale';\nimport _isSameLanguage from './_isSameLanguage';\nimport { _isSameDialect } from './_requiresTranslation';\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[], approvedLocales: string[]\n): string | undefined {\n if (typeof locales === 'string')\n locales = [locales];\n if (!approvedLocales) return locales[0];\n for (const locale of locales) {\n const currentLocale = _standardizeLocale(locale)\n const candidates: string[] = [];\n for (const approvedLocale of approvedLocales) {\n const currentApprovedLocale = _standardizeLocale(approvedLocale);\n if (currentLocale === currentApprovedLocale) \n return currentApprovedLocale; // instant match! return\n if (_isSameLanguage(currentLocale, currentApprovedLocale)) \n candidates.push(currentApprovedLocale); // covers same dialect as well\n }\n if (candidates.length) \n return candidates.find(candidate => _isSameDialect(currentLocale, candidate)) || \n candidates[0];\n }\n return undefined;\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): string {\n try {\n const locale = new Intl.Locale(code);\n // Return 'rtl' if the text direction of the language is right-to-left, otherwise 'ltr'\n return (locale as any)?.textInfo?.direction === 'rtl' ? 'rtl' : 'ltr';\n } catch {\n // If the code is invalid or causes an error, fallback to 'ltr'\n return 'ltr';\n }\n}\n","import { libraryDefaultLocale } from \"../internal\";\n\n/**\n * Retrieves the display name(s) of language code(s) using Intl.DisplayNames.\n *\n * @param {string} code - A language code.\n * @param {string} [defaultLanguage=libraryDefaultLanguage] - The language 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(code: string, defaultLanguage: string = libraryDefaultLocale): string {\n try {\n const displayNames = new Intl.DisplayNames([defaultLanguage, libraryDefaultLocale], { type: 'language' });\n return displayNames.of(code) || '';\n } catch {\n // In case Intl.DisplayNames construction fails, return empty string(s)\n return '';\n }\n}","import { standardizeLocale } from \"src\";\nimport { libraryDefaultLocale } from \"../internal\";\nimport _getLocale from \"./_getLocaleEmoji\";\nimport { _isValidLocale, _standardizeLocale } from \"./_isValidLocale\";\nimport _getLocaleEmoji from \"./_getLocaleEmoji\";\n\ntype LocaleProperties = {\n \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* @internal\n*/\nexport default function _getLocaleProperties(\n locale: string, defaultLocale: string = libraryDefaultLocale\n): LocaleProperties {\n try {\n\n locale = standardizeLocale(locale); // \"de-AT\"\n\n const localeObject = new Intl.Locale(locale);\n const languageCode = localeObject.language; // \"de\"\n const baseRegion = localeObject.region; // \"AT\"\n \n const maximizedLocale = new Intl.Locale(locale).maximize(); \n const maximizedCode = maximizedLocale.toString(); // \"de-Latn-AT\"\n const regionCode = maximizedLocale.region || ''; // \"AT\"\n const scriptCode = maximizedLocale.script || ''; // \"Latn\"\n \n const minimizedLocale = new Intl.Locale(locale).minimize();\n const minimizedCode = minimizedLocale.toString(); // \"de-AT\"\n\n // Language names (default and native)\n\n const languageNames = new Intl.DisplayNames([defaultLocale, locale, libraryDefaultLocale], { type: 'language' });\n const nativeLanguageNames = new Intl.DisplayNames([locale, defaultLocale, libraryDefaultLocale], { type: 'language' });\n\n const name = languageNames.of(locale) || locale; // \"Austrian German\"\n const nativeName = nativeLanguageNames.of(locale) || locale; // \"ร–sterreichisches Deutsch\"\n \n const maximizedName = languageNames.of(maximizedCode) || locale; // \"Austrian German (Latin)\"\n const nativeMaximizedName = nativeLanguageNames.of(maximizedCode) || locale; // \"ร–sterreichisches Deutsch (Lateinisch)\"\n \n const minimizedName = languageNames.of(minimizedCode) || locale; // \"Austrian German\", but for \"de-DE\" would just be \"German\"\n const nativeMinimizedName = nativeLanguageNames.of(minimizedCode) || locale; // \"ร–sterreichisches Deutsch\", but for \"de-DE\" would just be \"Deutsch\"\n \n const languageName = languageNames.of(languageCode) || locale; // \"German\"\n const nativeLanguageName = nativeLanguageNames.of(languageCode) || locale; // \"Deutsch\"\n\n const nameWithRegionCode = baseRegion ? `${languageName} (${baseRegion})`: languageName; // German (AT)\n const nativeNameWithRegionCode = baseRegion ? `${nativeLanguageName} (${baseRegion})`: nativeLanguageName; // \"Deutsch (AT)\"\n\n // Region names (default and native)\n\n const regionNames = new Intl.DisplayNames([defaultLocale, locale, libraryDefaultLocale], { type: 'region' });\n const nativeRegionNames = new Intl.DisplayNames([locale, defaultLocale, libraryDefaultLocale], { type: 'region' });\n\n const regionName = regionNames.of(regionCode) || ''; // \"Austria\"\n const nativeRegionName = nativeRegionNames.of(regionCode) || ''; // \"ร–sterreich\"\n\n // Script names (default and native)\n\n const scriptNames = new Intl.DisplayNames([defaultLocale, locale, libraryDefaultLocale], { type: 'script' }); \n const nativeScriptNames = new Intl.DisplayNames([locale, defaultLocale, libraryDefaultLocale], { type: 'script' }); \n\n const scriptName = scriptNames.of(scriptCode) || ''; // \"Latin\"\n const nativeScriptName = nativeScriptNames.of(scriptCode) || ''; // \"Lateinisch\"\n\n // Emoji \n\n const emoji = _getLocaleEmoji(locale);\n\n return {\n code: locale, name, nativeName,\n maximizedCode, maximizedName, nativeMaximizedName,\n minimizedCode, minimizedName, nativeMinimizedName,\n languageCode, languageName, nativeLanguageName,\n nameWithRegionCode, nativeNameWithRegionCode,\n regionCode, regionName, nativeRegionName,\n scriptCode, scriptName, nativeScriptName,\n emoji\n }\n } catch (error) {\n \n const code = locale || '';\n const codeParts = code?.split('-');\n const languageCode = codeParts?.[0] || code || '';\n const regionCode = codeParts.length > 2 ? codeParts?.[2] : codeParts?.[1] || '';\n const scriptCode = codeParts?.[3] || '';\n const nameWithRegionCode = languageCode ? (regionCode ? `${languageCode} (${regionCode})` : languageCode) : '';\n \n return {\n code, name: code, nativeName: code, \n maximizedCode: code, maximizedName: code, nativeMaximizedName: code,\n minimizedCode: code, minimizedName: code, nativeMinimizedName: code,\n languageCode, languageName: languageCode, nativeLanguageName: languageCode,\n regionCode, regionName: regionCode, nativeRegionName: regionCode,\n scriptCode, scriptName: scriptCode, nativeScriptName: scriptCode,\n nameWithRegionCode, nativeNameWithRegionCode: code,\n emoji: _getLocaleEmoji(code)\n }\n }\n\n}"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","_","label","sent","trys","ops","g","create","Iterator","verb","Symbol","iterator","v","op","TypeError","pop","push","SuppressedError","defaultAPIRoutes","_translateBatch","gt","requests","controller","AbortController","signal","_f","_e","_d","data","metadata","timeout","setTimeout","abort","fetch","concat","baseURL","method","headers","apiKey","JSON","stringify","response","_g","ok","Error","bind","_c","_b","status","text","json","_isSameLanguage","locales","_i","languages_1","flat","map","locale","Intl","Locale","language","every","error","console","libraryDefaultLocale","scriptExceptions","_isValidLocale","_a","region","script","DisplayNames","type","of","includes","_standardizeLocale","getCanonicalLocales","_isSameDialect","codeA","codeB","languageA","regionA","scriptA","languageB","regionB","scriptB","flattenedCodes","j","_translate","content","targetLocale","_translateReact","children","_updateProjectDictionary","updates","options","_getProjectLocales","projectID","_formatNum","NumberFormat","numberingSystem","format","_formatDateTime","DateTimeFormat","calendar","_formatCurrency","currency","style","_formatList","ListFormat","variableTypeMap","var","num","datetime","_splitStringToContent","string","match","regex","lastIndex","exec","fullMatch","startIndex","index","slice","parts","split","part","trim","key","variableType","undefined","variableObject","variable","_getLocaleEmoji","customMapping","defaultEmoji","localeObject","emojis","extrapolated","maximize","extrapolatedRegion","exceptions","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","getDefaultFromEnv","VARIABLE","process","env","defaultLocale","translate","translateReact","translateBatch","updateProjectDictionary","updates_1","getProjectLocales","standardizeLocale","approvedLocales","currentLocale","candidates","approvedLocales_1","approvedLocale","currentApprovedLocale","find","candidate","locales_1","_determineLocale","params","unit","RelativeTimeFormat","numeric","code","textInfo","direction","_getLocaleDirection","custom","defaultLanguage","_getLocaleName","languageCode","baseRegion","maximizedLocale","maximizedCode","toString","regionCode","scriptCode","minimizedCode","minimize","languageNames","nativeLanguageNames","name","nativeName","maximizedName","nativeMaximizedName","minimizedName","nativeMinimizedName","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionNames","nativeRegionNames","regionName","nativeRegionName","scriptNames","nativeScriptNames","scriptName","nativeScriptName","emoji","codeParts","_getLocaleProperties","variables","variableOptions","Array","isArray","item","join","_renderContentToString","sourceLocale","some","_requiresTranslation"],"mappings":"oEA+BO,IAAIA,EAAW,WAQlB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,CACV,EACMH,EAASa,MAAMC,KAAMP,UAChC,EA0EO,SAASQ,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,GAAU,CAAC,MAAOG,GAAKL,EAAOK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OAAC/V,EAAe+V,EAAhB,KAI3DrV,EAAe6Y,EAAchY,IAI7BoU,IAAoBA,EAAgB6D,MAAK,SAAAzD,GAAkB,OAAA9W,EAAgBsC,EAAcwU,EAAe,IAIhH,CQuVW0D,CAAqBF,EAAchY,EAAcoU,EAC5D,+BA1CM,SAA+B3S,GACjC,OAAOD,EAAsBC,EACjC","x_google_ignoreList":[0]}
package/dist/index.d.ts CHANGED
@@ -79,7 +79,9 @@ declare class GT {
79
79
  retranslate?: boolean;
80
80
  projectID?: string;
81
81
  [key: string]: any;
82
- }): Promise<string[]>;
82
+ }): Promise<{
83
+ locales?: string[];
84
+ }>;
83
85
  /**
84
86
  * Retrieves the locales for a GT project as BCP 47 locale tags.
85
87
  * @param projectID - The project ID to retrieve locales for. If not provided, `this.projectID` should be set.