gt-node 0.6.4 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/AsyncStorageAdapter-D852UaVa.mjs +71 -0
- package/dist/AsyncStorageAdapter-D852UaVa.mjs.map +1 -0
- package/dist/AsyncStorageAdapter-xUXP4qma.cjs +100 -0
- package/dist/AsyncStorageAdapter-xUXP4qma.cjs.map +1 -0
- package/dist/index.cjs +179 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.ts → index.d.cts} +12 -18
- package/dist/index.d.mts +48 -0
- package/dist/index.mjs +86 -0
- package/dist/index.mjs.map +1 -0
- package/dist/internal.cjs +31 -0
- package/dist/internal.d.cts +54 -0
- package/dist/internal.d.mts +54 -0
- package/dist/internal.mjs +3 -0
- package/dist/types-BA-INDkb.d.mts +15 -0
- package/dist/types-Ctyskm8X.d.cts +15 -0
- package/dist/types.cjs +0 -0
- package/dist/types.d.cts +3 -0
- package/dist/types.d.mts +3 -0
- package/dist/types.mjs +1 -0
- package/package.json +36 -26
- package/dist/async-i18n-manager/AsyncStorageAdapter.d.ts +0 -19
- package/dist/async-i18n-manager/AsyncStorageI18nManager.d.ts +0 -17
- package/dist/async-i18n-manager/index.d.ts +0 -3
- package/dist/async-i18n-manager/singleton-operations.d.ts +0 -15
- package/dist/helpers/getRequestLocale.d.ts +0 -27
- package/dist/helpers/index.d.ts +0 -3
- package/dist/index.cjs.min.cjs +0 -2
- package/dist/index.cjs.min.cjs.map +0 -1
- package/dist/index.esm.min.mjs +0 -2
- package/dist/index.esm.min.mjs.map +0 -1
- package/dist/internal.cjs.min.cjs +0 -2
- package/dist/internal.cjs.min.cjs.map +0 -1
- package/dist/internal.d.ts +0 -51
- package/dist/internal.esm.min.mjs +0 -2
- package/dist/internal.esm.min.mjs.map +0 -1
- package/dist/setup/index.d.ts +0 -2
- package/dist/setup/initializeGT.d.ts +0 -7
- package/dist/setup/types.d.ts +0 -11
- package/dist/setup/withGT.d.ts +0 -4
- package/dist/translation-functions/index.d.ts +0 -6
- package/dist/translation-functions/types.d.ts +0 -6
- package/dist/types.cjs.min.cjs +0 -2
- package/dist/types.cjs.min.cjs.map +0 -1
- package/dist/types.d.ts +0 -15
- package/dist/types.esm.min.mjs +0 -2
- package/dist/types.esm.min.mjs.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { I18nManagerConstructorParams } from "gt-i18n/internal/types";
|
|
2
|
+
import { I18nManager, I18nManager as I18nManager$1, StorageAdapter, StorageAdapter as StorageAdapter$1, getI18nManager as getI18nManager$1, setI18nManager as setI18nManager$1 } from "gt-i18n/internal";
|
|
3
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
|
+
import { Translation } from "gt-i18n/types";
|
|
5
|
+
|
|
6
|
+
//#region src/async-i18n-manager/AsyncStorageAdapter.d.ts
|
|
7
|
+
type Store = {
|
|
8
|
+
locale: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* AsyncStorageAdapter implementation that uses AsyncLocalStorage as the storage adapter.
|
|
12
|
+
*/
|
|
13
|
+
declare class AsyncStorageAdapter extends StorageAdapter$1 {
|
|
14
|
+
readonly type: "async-storage-adapter";
|
|
15
|
+
private store;
|
|
16
|
+
constructor(store?: AsyncLocalStorage<Store>);
|
|
17
|
+
run<T>(store: Store, callback: () => T): T;
|
|
18
|
+
getItem(key: keyof Store): string | undefined;
|
|
19
|
+
setItem(key: keyof Store, value: string): void;
|
|
20
|
+
removeItem(key: keyof Store): void;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/async-i18n-manager/AsyncStorageI18nManager.d.ts
|
|
24
|
+
/**
|
|
25
|
+
* I18nManager implementation that uses AsyncStorage as the storage adapter.
|
|
26
|
+
*/
|
|
27
|
+
declare class AsyncStorageI18nManager extends I18nManager$1<AsyncStorageAdapter, string> {
|
|
28
|
+
/**
|
|
29
|
+
* Creates an instance of AsyncStorageI18nManager.
|
|
30
|
+
* @param {I18nManagerConstructorParams<AsyncStorageAdapter>} config - The configuration for the AsyncStorageI18nManager
|
|
31
|
+
*/
|
|
32
|
+
constructor(config: I18nManagerConstructorParams<AsyncStorageAdapter>);
|
|
33
|
+
/**
|
|
34
|
+
* Create the context for the given locale using the store adapter
|
|
35
|
+
*/
|
|
36
|
+
run<T>(locale: string, fn: () => T): T;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/async-i18n-manager/singleton-operations.d.ts
|
|
40
|
+
/**
|
|
41
|
+
* @description Get the singleton instance of I18nManager.
|
|
42
|
+
* @returns The singleton instance of I18nManager
|
|
43
|
+
*
|
|
44
|
+
* Node only does string translation
|
|
45
|
+
*/
|
|
46
|
+
declare function getI18nManager(): I18nManager$1<AsyncStorageAdapter, string> | I18nManager$1<StorageAdapter$1, string> | I18nManager$1<AsyncStorageAdapter, Translation> | I18nManager$1<StorageAdapter$1, Translation>;
|
|
47
|
+
/**
|
|
48
|
+
* Set the singleton instance of I18nManager
|
|
49
|
+
* @param {I18nManager<AsyncStorageAdapter>} i18nManager - The I18nManager instance
|
|
50
|
+
*/
|
|
51
|
+
declare function setI18nManager(i18nManager: I18nManager$1<AsyncStorageAdapter>): void;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { AsyncStorageAdapter, AsyncStorageI18nManager, I18nManager, StorageAdapter, getI18nManager as asyncStorageGetI18nManager, setI18nManager as asyncStorageSetI18nManager, getI18nManager$1 as getI18nManager, setI18nManager$1 as setI18nManager };
|
|
54
|
+
//# sourceMappingURL=internal.d.cts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { I18nManager, I18nManager as I18nManager$1, StorageAdapter, StorageAdapter as StorageAdapter$1, getI18nManager as getI18nManager$1, setI18nManager as setI18nManager$1 } from "gt-i18n/internal";
|
|
2
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
+
import { I18nManagerConstructorParams } from "gt-i18n/internal/types";
|
|
4
|
+
import { Translation } from "gt-i18n/types";
|
|
5
|
+
|
|
6
|
+
//#region src/async-i18n-manager/AsyncStorageAdapter.d.ts
|
|
7
|
+
type Store = {
|
|
8
|
+
locale: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* AsyncStorageAdapter implementation that uses AsyncLocalStorage as the storage adapter.
|
|
12
|
+
*/
|
|
13
|
+
declare class AsyncStorageAdapter extends StorageAdapter$1 {
|
|
14
|
+
readonly type: "async-storage-adapter";
|
|
15
|
+
private store;
|
|
16
|
+
constructor(store?: AsyncLocalStorage<Store>);
|
|
17
|
+
run<T>(store: Store, callback: () => T): T;
|
|
18
|
+
getItem(key: keyof Store): string | undefined;
|
|
19
|
+
setItem(key: keyof Store, value: string): void;
|
|
20
|
+
removeItem(key: keyof Store): void;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/async-i18n-manager/AsyncStorageI18nManager.d.ts
|
|
24
|
+
/**
|
|
25
|
+
* I18nManager implementation that uses AsyncStorage as the storage adapter.
|
|
26
|
+
*/
|
|
27
|
+
declare class AsyncStorageI18nManager extends I18nManager$1<AsyncStorageAdapter, string> {
|
|
28
|
+
/**
|
|
29
|
+
* Creates an instance of AsyncStorageI18nManager.
|
|
30
|
+
* @param {I18nManagerConstructorParams<AsyncStorageAdapter>} config - The configuration for the AsyncStorageI18nManager
|
|
31
|
+
*/
|
|
32
|
+
constructor(config: I18nManagerConstructorParams<AsyncStorageAdapter>);
|
|
33
|
+
/**
|
|
34
|
+
* Create the context for the given locale using the store adapter
|
|
35
|
+
*/
|
|
36
|
+
run<T>(locale: string, fn: () => T): T;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/async-i18n-manager/singleton-operations.d.ts
|
|
40
|
+
/**
|
|
41
|
+
* @description Get the singleton instance of I18nManager.
|
|
42
|
+
* @returns The singleton instance of I18nManager
|
|
43
|
+
*
|
|
44
|
+
* Node only does string translation
|
|
45
|
+
*/
|
|
46
|
+
declare function getI18nManager(): I18nManager$1<AsyncStorageAdapter, string> | I18nManager$1<StorageAdapter$1, string> | I18nManager$1<AsyncStorageAdapter, Translation> | I18nManager$1<StorageAdapter$1, Translation>;
|
|
47
|
+
/**
|
|
48
|
+
* Set the singleton instance of I18nManager
|
|
49
|
+
* @param {I18nManager<AsyncStorageAdapter>} i18nManager - The I18nManager instance
|
|
50
|
+
*/
|
|
51
|
+
declare function setI18nManager(i18nManager: I18nManager$1<AsyncStorageAdapter>): void;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { AsyncStorageAdapter, AsyncStorageI18nManager, I18nManager, StorageAdapter, getI18nManager as asyncStorageGetI18nManager, setI18nManager as asyncStorageSetI18nManager, getI18nManager$1 as getI18nManager, setI18nManager$1 as setI18nManager };
|
|
54
|
+
//# sourceMappingURL=internal.d.mts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as setI18nManager, i as getI18nManager, n as AsyncStorageAdapter, r as AsyncStorageI18nManager } from "./AsyncStorageAdapter-D852UaVa.mjs";
|
|
2
|
+
import { I18nManager, StorageAdapter, getI18nManager as getI18nManager$1, setI18nManager as setI18nManager$1 } from "gt-i18n/internal";
|
|
3
|
+
export { AsyncStorageAdapter, AsyncStorageI18nManager, I18nManager, StorageAdapter, getI18nManager as asyncStorageGetI18nManager, setI18nManager as asyncStorageSetI18nManager, getI18nManager$1 as getI18nManager, setI18nManager$1 as setI18nManager };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GTConfig, GTConfig as GTConfig$1, TranslationsLoader, TranslationsLoader as TranslationsLoader$1 } from "gt-i18n/internal/types";
|
|
2
|
+
|
|
3
|
+
//#region src/setup/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for the initializing GT
|
|
6
|
+
* @param {string} params.defaultLocale - The default locale to use
|
|
7
|
+
* @param {string[]} params.locales - The locales to support
|
|
8
|
+
* @param {object} params.loadTranslations - The custom translation loader to use
|
|
9
|
+
*/
|
|
10
|
+
type InitializeGTParams = GTConfig & {
|
|
11
|
+
loadTranslations?: TranslationsLoader;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { InitializeGTParams as n, TranslationsLoader$1 as r, GTConfig$1 as t };
|
|
15
|
+
//# sourceMappingURL=types-BA-INDkb.d.mts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GTConfig, GTConfig as GTConfig$1, TranslationsLoader, TranslationsLoader as TranslationsLoader$1 } from "gt-i18n/internal/types";
|
|
2
|
+
|
|
3
|
+
//#region src/setup/types.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for the initializing GT
|
|
6
|
+
* @param {string} params.defaultLocale - The default locale to use
|
|
7
|
+
* @param {string[]} params.locales - The locales to support
|
|
8
|
+
* @param {object} params.loadTranslations - The custom translation loader to use
|
|
9
|
+
*/
|
|
10
|
+
type InitializeGTParams = GTConfig & {
|
|
11
|
+
loadTranslations?: TranslationsLoader;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { InitializeGTParams as n, TranslationsLoader$1 as r, GTConfig$1 as t };
|
|
15
|
+
//# sourceMappingURL=types-Ctyskm8X.d.cts.map
|
package/dist/types.cjs
ADDED
|
File without changes
|
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { n as InitializeGTParams, r as TranslationsLoader, t as GTConfig } from "./types-Ctyskm8X.cjs";
|
|
2
|
+
import { DictionaryTranslationOptions, GTFunctionType, InlineTranslationOptions, MFunctionType, RuntimeTranslationOptions, TFunctionType } from "gt-i18n/types";
|
|
3
|
+
export { type DictionaryTranslationOptions, GTConfig, type GTFunctionType, InitializeGTParams, type InlineTranslationOptions, type MFunctionType, type RuntimeTranslationOptions, type TFunctionType, TranslationsLoader };
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { n as InitializeGTParams, r as TranslationsLoader, t as GTConfig } from "./types-BA-INDkb.mjs";
|
|
2
|
+
import { DictionaryTranslationOptions, GTFunctionType, InlineTranslationOptions, MFunctionType, RuntimeTranslationOptions, TFunctionType } from "gt-i18n/types";
|
|
3
|
+
export { type DictionaryTranslationOptions, GTConfig, type GTFunctionType, InitializeGTParams, type InlineTranslationOptions, type MFunctionType, type RuntimeTranslationOptions, type TFunctionType, TranslationsLoader };
|
package/dist/types.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gt-node",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "Node.js utilities for General Translation",
|
|
5
|
-
"main": "dist/index.cjs
|
|
6
|
-
"module": "dist/index.
|
|
7
|
-
"types": "dist/index.d.
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.cts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"CHANGELOG.md"
|
|
11
11
|
],
|
|
12
|
+
"sideEffects": false,
|
|
12
13
|
"engines": {
|
|
13
14
|
"node": ">=18.0.0"
|
|
14
15
|
},
|
|
@@ -35,47 +36,56 @@
|
|
|
35
36
|
},
|
|
36
37
|
"homepage": "https://generaltranslation.com/",
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@rollup/plugin-commonjs": "^28.0.1",
|
|
39
|
-
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
40
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
41
|
-
"@rollup/plugin-typescript": "^12.1.1",
|
|
42
39
|
"@types/node": "^20.14.9",
|
|
43
|
-
"
|
|
44
|
-
"rollup-plugin-dts": "^6.1.1",
|
|
45
|
-
"tslib": "^2.8.0",
|
|
40
|
+
"tsdown": "^0.21.10",
|
|
46
41
|
"typescript": "^5.6.2"
|
|
47
42
|
},
|
|
48
43
|
"typescript": {
|
|
49
|
-
"definition": "dist/index.d.
|
|
44
|
+
"definition": "dist/index.d.cts"
|
|
50
45
|
},
|
|
51
46
|
"dependencies": {
|
|
52
|
-
"gt-i18n": "0.8.
|
|
53
|
-
"generaltranslation": "8.2.
|
|
47
|
+
"gt-i18n": "0.8.6",
|
|
48
|
+
"generaltranslation": "8.2.7"
|
|
54
49
|
},
|
|
55
50
|
"exports": {
|
|
56
51
|
".": {
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
"require": {
|
|
53
|
+
"types": "./dist/index.d.cts",
|
|
54
|
+
"default": "./dist/index.cjs"
|
|
55
|
+
},
|
|
56
|
+
"import": {
|
|
57
|
+
"types": "./dist/index.d.mts",
|
|
58
|
+
"default": "./dist/index.mjs"
|
|
59
|
+
}
|
|
60
60
|
},
|
|
61
61
|
"./types": {
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
"require": {
|
|
63
|
+
"types": "./dist/types.d.cts",
|
|
64
|
+
"default": "./dist/types.cjs"
|
|
65
|
+
},
|
|
66
|
+
"import": {
|
|
67
|
+
"types": "./dist/types.d.mts",
|
|
68
|
+
"default": "./dist/types.mjs"
|
|
69
|
+
}
|
|
65
70
|
},
|
|
66
71
|
"./internal": {
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
"require": {
|
|
73
|
+
"types": "./dist/internal.d.cts",
|
|
74
|
+
"default": "./dist/internal.cjs"
|
|
75
|
+
},
|
|
76
|
+
"import": {
|
|
77
|
+
"types": "./dist/internal.d.mts",
|
|
78
|
+
"default": "./dist/internal.mjs"
|
|
79
|
+
}
|
|
70
80
|
}
|
|
71
81
|
},
|
|
72
82
|
"typesVersions": {
|
|
73
83
|
"*": {
|
|
74
84
|
"types": [
|
|
75
|
-
"./dist/types.d.
|
|
85
|
+
"./dist/types.d.cts"
|
|
76
86
|
],
|
|
77
87
|
"internal": [
|
|
78
|
-
"./dist/internal.d.
|
|
88
|
+
"./dist/internal.d.cts"
|
|
79
89
|
]
|
|
80
90
|
}
|
|
81
91
|
},
|
|
@@ -93,7 +103,7 @@
|
|
|
93
103
|
"scripts": {
|
|
94
104
|
"build:release": "pnpm run build:clean",
|
|
95
105
|
"build:clean": "sh ../../scripts/clean.sh && pnpm run build",
|
|
96
|
-
"build": "
|
|
106
|
+
"build": "tsdown",
|
|
97
107
|
"lint": "eslint \"src/**/*.{js,ts}\" \"./**/__tests__/**/*.{js,ts}\"",
|
|
98
108
|
"lint:fix": "eslint \"src/**/*.{js,ts}\" \"./**/__tests__/**/*.{js,ts}\" --fix",
|
|
99
109
|
"test": "vitest run --config=./vitest.config.ts",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { StorageAdapter } from 'gt-i18n/internal';
|
|
2
|
-
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
3
|
-
type Store = {
|
|
4
|
-
locale: string;
|
|
5
|
-
};
|
|
6
|
-
declare const ASYNC_STORAGE_ADAPTER_TYPE: "async-storage-adapter";
|
|
7
|
-
/**
|
|
8
|
-
* AsyncStorageAdapter implementation that uses AsyncLocalStorage as the storage adapter.
|
|
9
|
-
*/
|
|
10
|
-
declare class AsyncStorageAdapter extends StorageAdapter {
|
|
11
|
-
readonly type: "async-storage-adapter";
|
|
12
|
-
private store;
|
|
13
|
-
constructor(store?: AsyncLocalStorage<Store>);
|
|
14
|
-
run<T>(store: Store, callback: () => T): T;
|
|
15
|
-
getItem(key: keyof Store): string | undefined;
|
|
16
|
-
setItem(key: keyof Store, value: string): void;
|
|
17
|
-
removeItem(key: keyof Store): void;
|
|
18
|
-
}
|
|
19
|
-
export { AsyncStorageAdapter, ASYNC_STORAGE_ADAPTER_TYPE };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { I18nManager } from 'gt-i18n/internal';
|
|
2
|
-
import { AsyncStorageAdapter } from './AsyncStorageAdapter';
|
|
3
|
-
import { I18nManagerConstructorParams } from 'gt-i18n/internal/types';
|
|
4
|
-
/**
|
|
5
|
-
* I18nManager implementation that uses AsyncStorage as the storage adapter.
|
|
6
|
-
*/
|
|
7
|
-
export declare class AsyncStorageI18nManager extends I18nManager<AsyncStorageAdapter, string> {
|
|
8
|
-
/**
|
|
9
|
-
* Creates an instance of AsyncStorageI18nManager.
|
|
10
|
-
* @param {I18nManagerConstructorParams<AsyncStorageAdapter>} config - The configuration for the AsyncStorageI18nManager
|
|
11
|
-
*/
|
|
12
|
-
constructor(config: I18nManagerConstructorParams<AsyncStorageAdapter>);
|
|
13
|
-
/**
|
|
14
|
-
* Create the context for the given locale using the store adapter
|
|
15
|
-
*/
|
|
16
|
-
run<T>(locale: string, fn: () => T): T;
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { I18nManager, StorageAdapter } from 'gt-i18n/internal';
|
|
2
|
-
import { AsyncStorageAdapter } from './AsyncStorageAdapter';
|
|
3
|
-
import { Translation } from 'gt-i18n/types';
|
|
4
|
-
/**
|
|
5
|
-
* @description Get the singleton instance of I18nManager.
|
|
6
|
-
* @returns The singleton instance of I18nManager
|
|
7
|
-
*
|
|
8
|
-
* Node only does string translation
|
|
9
|
-
*/
|
|
10
|
-
export declare function getI18nManager(): I18nManager<AsyncStorageAdapter, string> | I18nManager<StorageAdapter, string> | I18nManager<AsyncStorageAdapter, Translation> | I18nManager<StorageAdapter, Translation>;
|
|
11
|
-
/**
|
|
12
|
-
* Set the singleton instance of I18nManager
|
|
13
|
-
* @param {I18nManager<AsyncStorageAdapter>} i18nManager - The I18nManager instance
|
|
14
|
-
*/
|
|
15
|
-
export declare function setI18nManager(i18nManager: I18nManager<AsyncStorageAdapter>): void;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A request object like interface
|
|
3
|
-
* @interface RequestLike
|
|
4
|
-
* @property {Record<string, string | string[] | undefined>} headers - The request headers
|
|
5
|
-
*/
|
|
6
|
-
interface RequestLike {
|
|
7
|
-
headers: Record<string, string | string[] | undefined>;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Resolve the preferred locale from the request Accept-Language header, fallback to the default locale if no match is found
|
|
11
|
-
* @param request - The request object
|
|
12
|
-
* @returns The preferred locale
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* const locale = getRequestLocale({ headers: { 'accept-language': 'fr-FR,fr;q=0.9,en;q=0.8' } });
|
|
16
|
-
* console.log(locale); // 'fr'
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* app.get('/', (req, res) => {
|
|
20
|
-
* const locale = getRequestLocale(req);
|
|
21
|
-
* withGT(locale, () => {
|
|
22
|
-
* res.send(`Locale: ${locale}`);
|
|
23
|
-
* });
|
|
24
|
-
* });
|
|
25
|
-
*/
|
|
26
|
-
export declare function getRequestLocale(request: RequestLike): string;
|
|
27
|
-
export {};
|
package/dist/helpers/index.d.ts
DELETED
package/dist/index.cjs.min.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var t=require("gt-i18n/internal"),e=require("generaltranslation"),r=require("node:async_hooks"),n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function a(){return t.getI18nManager()}"function"==typeof SuppressedError&&SuppressedError;var s=function(t){function r(e){return t.call(this,e)||this}return o(r,t),r.prototype.run=function(t,r){return this.storeAdapter.run({locale:e.determineLocale(t,this.config.locales,this.config.customMapping)||this.config.defaultLocale},r)},r}(t.I18nManager),c="async-storage-adapter",u=function(t){function e(e){var n=t.call(this)||this;return n.type=c,n.store=null!=e?e:new r.AsyncLocalStorage,n}return o(e,t),e.prototype.run=function(t,e){return this.store.run(t,e)},e.prototype.getItem=function(t){var e=this.store.getStore();if(e)return e[t]},e.prototype.setItem=function(t,e){var r=this.store.getStore();if(!r)throw new Error("setItem() called outside of an async context. Make sure you are inside a run() call.");r[t]=e},e.prototype.removeItem=function(t){},e}(t.StorageAdapter);function h(t,e,r=""){const n=function(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name&&"BYTES_PER_ELEMENT"in t&&1===t.BYTES_PER_ELEMENT}(t),o=t?.length;if(!n||void 0!==e){const e=(r&&`"${r}" `)+"expected Uint8Array"+""+", got "+(n?`length=${o}`:"type="+typeof t);if(!n)throw new TypeError(e);throw new RangeError(e)}return t}function l(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function f(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function p(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function d(t,e){return t<<32-e|t>>>e}const y=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),g=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function v(t,e={}){const r=(e,r)=>t(r).update(e).digest(),n=t(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.canXOF=n.canXOF,r.create=e=>t(e),Object.assign(r,e),Object.freeze(r)}const E=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function b(t,e,r){return t&e^~t&r}function m(t,e,r){return t&e^t&r^e&r}class _{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,e,r,n){this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(t),this.view=p(this.buffer)}update(t){l(this),h(t);const{view:e,buffer:r,blockLen:n}=this,o=t.length;for(let i=0;i<o;){const a=Math.min(n-this.pos,o-i);if(a===n){const e=p(t);for(;n<=o-i;i+=n)this.process(e,i);continue}r.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){l(this),function(t,e){h(t,void 0,"digestInto() output");const r=e.outputLen;if(t.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}(t,this),this.finished=!0;const{buffer:e,view:r,blockLen:n,isLE:o}=this;let{pos:i}=this;e[i++]=128,f(this.buffer.subarray(i)),this.padOffset>n-i&&(this.process(r,0),i=0);for(let t=i;t<n;t++)e[t]=0;r.setBigUint64(n-8,BigInt(8*this.length),o),this.process(r,0);const a=p(t),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const c=s/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<c;t++)a.setUint32(4*t,u[t],o)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||=new this.constructor,t.set(...this.get());const{blockLen:e,buffer:r,length:n,finished:o,destroyed:i,pos:a}=this;return t.destroyed=i,t.finished=o,t.length=n,t.pos=a,n%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const T=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),H=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),B=new Uint32Array(64);class L extends _{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:e,C:r,D:n,E:o,F:i,G:a,H:s}=this;return[t,e,r,n,o,i,a,s]}set(t,e,r,n,o,i,a,s){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(t,e){for(let r=0;r<16;r++,e+=4)B[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=B[t-15],r=B[t-2],n=d(e,7)^d(e,18)^e>>>3,o=d(r,17)^d(r,19)^r>>>10;B[t]=o+B[t-7]+n+B[t-16]|0}let{A:r,B:n,C:o,D:i,E:a,F:s,G:c,H:u}=this;for(let t=0;t<64;t++){const e=u+(d(a,6)^d(a,11)^d(a,25))+b(a,s,c)+H[t]+B[t]|0,h=(d(r,2)^d(r,13)^d(r,22))+m(r,n,o)|0;u=c,c=s,s=a,a=i+e|0,i=o,o=n,n=r,r=e+h|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,s=s+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,o,i,a,s,c,u)}roundClean(){f(B)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),f(this.buffer)}}class A extends L{A=0|T[0];B=0|T[1];C=0|T[2];D=0|T[3];E=0|T[4];F=0|T[5];G=0|T[6];H=0|T[7];constructor(){super(32)}}const w=v(()=>new A,E(1));var S="https://cdn.gtx.dev",P="en",C=function(t,e){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},C(t,e)};function I(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}C(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var O=function(){return O=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},O.apply(this,arguments)};function M(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function R(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function N(t,e){return function(r,n){e(r,n,t)}}function U(t,e,r,n,o,i){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,c=n.kind,u="getter"===c?"get":"setter"===c?"set":"value",h=!e&&t?n.static?t:t.prototype:null,l=e||(h?Object.getOwnPropertyDescriptor(h,n.name):{}),f=!1,p=r.length-1;p>=0;p--){var d={};for(var y in n)d[y]="access"===y?{}:n[y];for(var y in n.access)d.access[y]=n.access[y];d.addInitializer=function(t){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(t||null))};var g=(0,r[p])("accessor"===c?{get:l.get,set:l.set}:l[u],d);if("accessor"===c){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(l.get=s),(s=a(g.set))&&(l.set=s),(s=a(g.init))&&o.unshift(s)}else(s=a(g))&&("field"===c?o.unshift(s):l[u]=s)}h&&Object.defineProperty(h,n.name,l),f=!0}function G(t,e,r){for(var n=arguments.length>2,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0}function D(t){return"symbol"==typeof t?t:"".concat(t)}function x(t,e,r){return"symbol"==typeof e&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function j(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function k(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})}function F(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var K=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]};function V(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||K(e,t,r)}function $(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function X(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function q(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(X(arguments[e]));return t}function Y(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}function W(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function Z(t){return this instanceof Z?(this.v=t,this):new Z(t)}function z(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(t,e||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",function(t){return function(e){return Promise.resolve(e).then(t,u)}}),n[Symbol.asyncIterator]=function(){return this},n;function a(t,e){o[t]&&(n[t]=function(e){return new Promise(function(r,n){i.push([t,e,r,n])>1||s(t,e)})},e&&(n[t]=e(n[t])))}function s(t,e){try{(r=o[t](e)).value instanceof Z?Promise.resolve(r.value.v).then(c,u):h(i[0][2],r)}catch(t){h(i[0][3],t)}var r}function c(t){s("next",t)}function u(t){s("throw",t)}function h(t,e){t(e),i.shift(),i.length&&s(i[0][0],i[0][1])}}function J(t){var e,r;return e={},n("next"),n("throw",function(t){throw t}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,o){e[n]=t[n]?function(e){return(r=!r)?{value:Z(t[n](e)),done:!1}:o?o(e):e}:o}}function Q(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=$(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise(function(n,o){!function(t,e,r,n){Promise.resolve(n).then(function(e){t({value:e,done:r})},e)}(n,o,(e=t[r](e)).done,e.value)})}}}function tt(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var et=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},rt=function(t){return rt=Object.getOwnPropertyNames||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[e.length]=r);return e},rt(t)};function nt(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r=rt(t),n=0;n<r.length;n++)"default"!==r[n]&&K(e,t,r[n]);return et(e,t),e}function ot(t){return t&&t.__esModule?t:{default:t}}function it(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function at(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),r}function st(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function ct(t,e,r){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var ut="function"==typeof SuppressedError?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function ht(t){function e(e){t.error=t.hasError?new ut(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}var r,n=0;return function o(){for(;r=t.stack.pop();)try{if(!r.async&&1===n)return n=0,t.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(t){return e(t),o()})}else n|=1}catch(t){e(t)}if(1===n)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}function lt(t,e){return"string"==typeof t&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,r,n,o,i){return r?e?".jsx":".js":!n||o&&i?n+o+"."+i.toLowerCase()+"js":t}):t}var ft,pt,dt,yt={__extends:I,__assign:O,__rest:M,__decorate:R,__param:N,__esDecorate:U,__runInitializers:G,__propKey:D,__setFunctionName:x,__metadata:j,__awaiter:k,__generator:F,__createBinding:K,__exportStar:V,__values:$,__read:X,__spread:q,__spreadArrays:Y,__spreadArray:W,__await:Z,__asyncGenerator:z,__asyncDelegator:J,__asyncValues:Q,__makeTemplateObject:tt,__importStar:nt,__importDefault:ot,__classPrivateFieldGet:it,__classPrivateFieldSet:at,__classPrivateFieldIn:st,__addDisposableResource:ct,__disposeResources:ht,__rewriteRelativeImportExtension:lt},gt=Object.freeze({__proto__:null,__addDisposableResource:ct,get __assign(){return O},__asyncDelegator:J,__asyncGenerator:z,__asyncValues:Q,__await:Z,__awaiter:k,__classPrivateFieldGet:it,__classPrivateFieldIn:st,__classPrivateFieldSet:at,__createBinding:K,__decorate:R,__disposeResources:ht,__esDecorate:U,__exportStar:V,__extends:I,__generator:F,__importDefault:ot,__importStar:nt,__makeTemplateObject:tt,__metadata:j,__param:N,__propKey:D,__read:X,__rest:M,__rewriteRelativeImportExtension:lt,__runInitializers:G,__setFunctionName:x,__spread:q,__spreadArray:W,__spreadArrays:Y,__values:$,default:yt}),vt="DEFAULT_TERMINATOR_KEY";!function(t){t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",t[t.INVALID_TAG=23]="INVALID_TAG",t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(ft||(ft={})),function(t){t[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound",t[t.tag=8]="tag"}(pt||(pt={})),function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}(dt||(dt={}));var Et=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,bt=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function mt(t){var e={};return t.replace(bt,function(t){var r=t.length;switch(t[0]){case"G":e.era=4===r?"long":5===r?"narrow":"short";break;case"y":e.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":e.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][r-4];break;case"a":e.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][r-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][r-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][r-1];break;case"k":e.hourCycle="h24",e.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":e.minute=["numeric","2-digit"][r-1];break;case"s":e.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":e.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),e}var _t=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Tt(t){return t.replace(/^(.*?)-/,"")}var Ht=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Bt=/^(@+)?(\+|#+)?[rs]?$/g,Lt=/(\*)(0+)|(#+)(0+)|(0+)/g,At=/^(0+)$/;function wt(t){var e={};return"r"===t[t.length-1]?e.roundingPriority="morePrecision":"s"===t[t.length-1]&&(e.roundingPriority="lessPrecision"),t.replace(Bt,function(t,r,n){return"string"!=typeof n?(e.minimumSignificantDigits=r.length,e.maximumSignificantDigits=r.length):"+"===n?e.minimumSignificantDigits=r.length:"#"===r[0]?e.maximumSignificantDigits=r.length:(e.minimumSignificantDigits=r.length,e.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),e}function St(t){switch(t){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Pt(t){var e;if("E"===t[0]&&"E"===t[1]?(e={notation:"engineering"},t=t.slice(2)):"E"===t[0]&&(e={notation:"scientific"},t=t.slice(1)),e){var r=t.slice(0,2);if("+!"===r?(e.signDisplay="always",t=t.slice(2)):"+?"===r&&(e.signDisplay="exceptZero",t=t.slice(2)),!At.test(t))throw new Error("Malformed concise eng/scientific notation");e.minimumIntegerDigits=t.length}return e}function Ct(t){return St(t)||{}}function It(t){for(var e={},r=0,n=t;r<n.length;r++){var o=n[r];switch(o.stem){case"percent":case"%":e.style="percent";continue;case"%x100":e.style="percent",e.scale=100;continue;case"currency":e.style="currency",e.currency=o.options[0];continue;case"group-off":case",_":e.useGrouping=!1;continue;case"precision-integer":case".":e.maximumFractionDigits=0;continue;case"measure-unit":case"unit":e.style="unit",e.unit=Tt(o.options[0]);continue;case"compact-short":case"K":e.notation="compact",e.compactDisplay="short";continue;case"compact-long":case"KK":e.notation="compact",e.compactDisplay="long";continue;case"scientific":e=O(O(O({},e),{notation:"scientific"}),o.options.reduce(function(t,e){return O(O({},t),Ct(e))},{}));continue;case"engineering":e=O(O(O({},e),{notation:"engineering"}),o.options.reduce(function(t,e){return O(O({},t),Ct(e))},{}));continue;case"notation-simple":e.notation="standard";continue;case"unit-width-narrow":e.currencyDisplay="narrowSymbol",e.unitDisplay="narrow";continue;case"unit-width-short":e.currencyDisplay="code",e.unitDisplay="short";continue;case"unit-width-full-name":e.currencyDisplay="name",e.unitDisplay="long";continue;case"unit-width-iso-code":e.currencyDisplay="symbol";continue;case"scale":e.scale=parseFloat(o.options[0]);continue;case"rounding-mode-floor":e.roundingMode="floor";continue;case"rounding-mode-ceiling":e.roundingMode="ceil";continue;case"rounding-mode-down":e.roundingMode="trunc";continue;case"rounding-mode-up":e.roundingMode="expand";continue;case"rounding-mode-half-even":e.roundingMode="halfEven";continue;case"rounding-mode-half-down":e.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":e.roundingMode="halfExpand";continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(Lt,function(t,r,n,o,i,a){if(r)e.minimumIntegerDigits=n.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""});continue}if(At.test(o.stem))e.minimumIntegerDigits=o.stem.length;else if(Ht.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(Ht,function(t,r,n,o,i,a){return"*"===n?e.minimumFractionDigits=r.length:o&&"#"===o[0]?e.maximumFractionDigits=o.length:i&&a?(e.minimumFractionDigits=i.length,e.maximumFractionDigits=i.length+a.length):(e.minimumFractionDigits=r.length,e.maximumFractionDigits=r.length),""});var i=o.options[0];"w"===i?e=O(O({},e),{trailingZeroDisplay:"stripIfInteger"}):i&&(e=O(O({},e),wt(i)))}else if(Bt.test(o.stem))e=O(O({},e),wt(o.stem));else{var a=St(o.stem);a&&(e=O(O({},e),a));var s=Pt(o.stem);s&&(e=O(O({},e),s))}}return e}var Ot,Mt={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function Rt(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=t.language;return"root"!==n&&(r=t.maximize().region),(Mt[r||""]||Mt[n||""]||Mt["".concat(n,"-001")]||Mt["001"])[0]}var Nt=new RegExp("^".concat(Et.source,"*")),Ut=new RegExp("".concat(Et.source,"*$"));function Gt(t,e){return{start:t,end:e}}var Dt=!!String.prototype.startsWith&&"_a".startsWith("a",1),xt=!!String.fromCodePoint,jt=!!Object.fromEntries,kt=!!String.prototype.codePointAt,Ft=!!String.prototype.trimStart,Kt=!!String.prototype.trimEnd,Vt=Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},$t=!0;try{$t="a"===(null===(Ot=Qt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Ot?void 0:Ot[0])}catch(Te){$t=!1}var Xt,qt=Dt?function(t,e,r){return t.startsWith(e,r)}:function(t,e,r){return t.slice(r,r+e.length)===e},Yt=xt?String.fromCodePoint:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r,n="",o=t.length,i=0;o>i;){if((r=t[i++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},Wt=jt?Object.fromEntries:function(t){for(var e={},r=0,n=t;r<n.length;r++){var o=n[r],i=o[0],a=o[1];e[i]=a}return e},Zt=kt?function(t,e){return t.codePointAt(e)}:function(t,e){var r=t.length;if(!(e<0||e>=r)){var n,o=t.charCodeAt(e);return o<55296||o>56319||e+1===r||(n=t.charCodeAt(e+1))<56320||n>57343?o:n-56320+(o-55296<<10)+65536}},zt=Ft?function(t){return t.trimStart()}:function(t){return t.replace(Nt,"")},Jt=Kt?function(t){return t.trimEnd()}:function(t){return t.replace(Ut,"")};function Qt(t,e){return new RegExp(t,e)}if($t){var te=Qt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Xt=function(t,e){var r;return te.lastIndex=e,null!==(r=te.exec(t)[1])&&void 0!==r?r:""}}else Xt=function(t,e){for(var r=[];;){var n=Zt(t,e);if(void 0===n||oe(n)||ie(n))break;r.push(n),e+=n>=65536?2:1}return Yt.apply(void 0,r)};var ee=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,r){for(var n=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(t,r)).err)return i;n.push(i.val)}else{if(125===o&&t>0)break;if(35!==o||"plural"!==e&&"selectordinal"!==e){if(60===o&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(ft.UNMATCHED_CLOSING_TAG,Gt(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&re(this.peek()||0)){if((i=this.parseTag(t,e)).err)return i;n.push(i.val)}else{var i;if((i=this.parseLiteral(t,e)).err)return i;n.push(i.val)}}else{var a=this.clonePosition();this.bump(),n.push({type:pt.pound,location:Gt(a,this.clonePosition())})}}}return{val:n,err:null}},t.prototype.parseTag=function(t,e){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:pt.literal,value:"<".concat(n,"/>"),location:Gt(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,e,!0);if(o.err)return o;var i=o.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!re(this.char()))return this.error(ft.INVALID_TAG,Gt(a,this.clonePosition()));var s=this.clonePosition();return n!==this.parseTagName()?this.error(ft.UNMATCHED_CLOSING_TAG,Gt(s,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:pt.tag,value:n,children:i,location:Gt(r,this.clonePosition())},err:null}:this.error(ft.INVALID_TAG,Gt(a,this.clonePosition())))}return this.error(ft.UNCLOSED_TAG,Gt(r,this.clonePosition()))}return this.error(ft.INVALID_TAG,Gt(r,this.clonePosition()))},t.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&ne(this.char());)this.bump();return this.message.slice(t,this.offset())},t.prototype.parseLiteral=function(t,e){for(var r=this.clonePosition(),n="";;){var o=this.tryParseQuote(e);if(o)n+=o;else{var i=this.tryParseUnquoted(t,e);if(i)n+=i;else{var a=this.tryParseLeftAngleBracket();if(!a)break;n+=a}}}var s=Gt(r,this.clonePosition());return{val:{type:pt.literal,value:n,location:s},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(re(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(r);this.bump()}return Yt.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===e||"selectordinal"===e)||125===r&&t>0?null:(this.bump(),Yt(r))},t.prototype.parseArgument=function(t,e){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(ft.EXPECT_ARGUMENT_CLOSING_BRACE,Gt(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(ft.EMPTY_ARGUMENT,Gt(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(ft.MALFORMED_ARGUMENT,Gt(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(ft.EXPECT_ARGUMENT_CLOSING_BRACE,Gt(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:pt.argument,value:n,location:Gt(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(ft.EXPECT_ARGUMENT_CLOSING_BRACE,Gt(r,this.clonePosition())):this.parseArgumentOptions(t,e,n,r);default:return this.error(ft.MALFORMED_ARGUMENT,Gt(r,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),r=Xt(this.message,e),n=e+r.length;return this.bumpTo(n),{value:r,location:Gt(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,r,n){var o,i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(a){case"":return this.error(ft.EXPECT_ARGUMENT_TYPE,Gt(i,s));case"number":case"date":case"time":this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition();if((v=this.parseSimpleArgStyleIfPossible()).err)return v;if(0===(p=Jt(v.val)).length)return this.error(ft.EXPECT_ARGUMENT_STYLE,Gt(this.clonePosition(),this.clonePosition()));c={style:p,styleLocation:Gt(u,this.clonePosition())}}if((E=this.tryParseArgumentClose(n)).err)return E;var h=Gt(n,this.clonePosition());if(c&&qt(null==c?void 0:c.style,"::",0)){var l=zt(c.style.slice(2));if("number"===a)return(v=this.parseNumberSkeletonFromString(l,c.styleLocation)).err?v:{val:{type:pt.number,value:r,location:h,style:v.val},err:null};if(0===l.length)return this.error(ft.EXPECT_DATE_TIME_SKELETON,h);var f=l;this.locale&&(f=function(t,e){for(var r="",n=0;n<t.length;n++){var o=t.charAt(n);if("j"===o){for(var i=0;n+1<t.length&&t.charAt(n+1)===o;)i++,n++;var a=1+(1&i),s=i<2?1:3+(i>>1),c=Rt(e);for("H"!=c&&"k"!=c||(s=0);s-- >0;)r+="a";for(;a-- >0;)r=c+r}else r+="J"===o?"H":o}return r}(l,this.locale));var p={type:dt.dateTime,pattern:f,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?mt(f):{}};return{val:{type:"date"===a?pt.date:pt.time,value:r,location:h,style:p},err:null}}return{val:{type:"number"===a?pt.number:"date"===a?pt.date:pt.time,value:r,location:h,style:null!==(o=null==c?void 0:c.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(ft.EXPECT_SELECT_ARGUMENT_OPTIONS,Gt(d,O({},d)));this.bumpSpace();var y=this.parseIdentifierIfPossible(),g=0;if("select"!==a&&"offset"===y.value){if(!this.bumpIf(":"))return this.error(ft.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Gt(this.clonePosition(),this.clonePosition()));var v;if(this.bumpSpace(),(v=this.tryParseDecimalInteger(ft.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,ft.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return v;this.bumpSpace(),y=this.parseIdentifierIfPossible(),g=v.val}var E,b=this.tryParsePluralOrSelectOptions(t,a,e,y);if(b.err)return b;if((E=this.tryParseArgumentClose(n)).err)return E;var m=Gt(n,this.clonePosition());return"select"===a?{val:{type:pt.select,value:r,options:Wt(b.val),location:m},err:null}:{val:{type:pt.plural,value:r,options:Wt(b.val),offset:g,pluralType:"plural"===a?"cardinal":"ordinal",location:m},err:null};default:return this.error(ft.INVALID_ARGUMENT_TYPE,Gt(i,s))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(ft.EXPECT_ARGUMENT_CLOSING_BRACE,Gt(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(ft.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Gt(r,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var r=[];try{r=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=[],r=0,n=t.split(_t).filter(function(t){return t.length>0});r<n.length;r++){var o=n[r].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],a=o.slice(1),s=0,c=a;s<c.length;s++)if(0===c[s].length)throw new Error("Invalid number skeleton");e.push({stem:i,options:a})}return e}(t)}catch(t){return this.error(ft.INVALID_NUMBER_SKELETON,e)}return{val:{type:dt.number,tokens:r,location:e,parsedOptions:this.shouldParseSkeletons?It(r):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(t,e,r,n){for(var o,i=!1,a=[],s=new Set,c=n.value,u=n.location;;){if(0===c.length){var h=this.clonePosition();if("select"===e||!this.bumpIf("="))break;var l=this.tryParseDecimalInteger(ft.EXPECT_PLURAL_ARGUMENT_SELECTOR,ft.INVALID_PLURAL_ARGUMENT_SELECTOR);if(l.err)return l;u=Gt(h,this.clonePosition()),c=this.message.slice(h.offset,this.offset())}if(s.has(c))return this.error("select"===e?ft.DUPLICATE_SELECT_ARGUMENT_SELECTOR:ft.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);"other"===c&&(i=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===e?ft.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:ft.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Gt(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(t+1,e,r);if(p.err)return p;var d=this.tryParseArgumentClose(f);if(d.err)return d;a.push([c,{value:p.val,location:Gt(f,this.clonePosition())}]),s.add(c),this.bumpSpace(),c=(o=this.parseIdentifierIfPossible()).value,u=o.location}return 0===a.length?this.error("select"===e?ft.EXPECT_SELECT_ARGUMENT_SELECTOR:ft.EXPECT_PLURAL_ARGUMENT_SELECTOR,Gt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(ft.MISSING_OTHER_CLAUSE,Gt(this.clonePosition(),this.clonePosition())):{val:a,err:null}},t.prototype.tryParseDecimalInteger=function(t,e){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=!1,i=0;!this.isEOF();){var a=this.char();if(!(a>=48&&a<=57))break;o=!0,i=10*i+(a-48),this.bump()}var s=Gt(n,this.clonePosition());return o?Vt(i*=r)?{val:i,err:null}:this.error(e,s):this.error(t,s)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=Zt(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(qt(this.message,t,this.offset())){for(var e=0;e<t.length;e++)this.bump();return!0}return!1},t.prototype.bumpUntil=function(t){var e=this.offset(),r=this.message.indexOf(t,e);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&oe(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),r=this.message.charCodeAt(e+(t>=65536?2:1));return null!=r?r:null},t}();function re(t){return t>=97&&t<=122||t>=65&&t<=90}function ne(t){return 45===t||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}function oe(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function ie(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function ae(t){t.forEach(function(t){if(delete t.location,function(t){return t.type===pt.select}(t)||function(t){return t.type===pt.plural}(t))for(var e in t.options)delete t.options[e].location,ae(t.options[e].value);else(function(t){return t.type===pt.number})(t)&&function(t){return!(!t||"object"!=typeof t||t.type!==dt.number)}(t.style)||(function(t){return t.type===pt.date}(t)||function(t){return t.type===pt.time}(t))&&function(t){return!(!t||"object"!=typeof t||t.type!==dt.dateTime)}(t.style)?delete t.style.location:function(t){return t.type===pt.tag}(t)&&ae(t.children)})}function se(t){var e=t.icuString,r=t.shouldVisit,n=t.visitor,o=t.options,i=o.recurseIntoVisited,a=void 0===i||i,s=function(t,e){void 0===e&&(e={}),e=O({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var r=new ee(t,e).parse();if(r.err){var n=SyntaxError(ft[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==e?void 0:e.captureLocation)||ae(r.val),r.val}(e,M(o,["recurseIntoVisited"]));return c(s),s;function c(t){t.map(u)}function u(t){var e=!1;r(t)&&(n(t),e=!0),e&&!a||(t.type===pt.select||t.type===pt.plural?Object.values(t.options).map(function(t){return t.value}).map(c):t.type===pt.tag&&c(t.children))}}var ce="_gt_",ue=new RegExp("^".concat(ce,"$"));var he,le={};function fe(){return he||(he=1,Object.defineProperty(le,"__esModule",{value:!0}),le.SKELETON_TYPE=le.TYPE=void 0,le.isLiteralElement=function(e){return e.type===t.literal},le.isArgumentElement=function(e){return e.type===t.argument},le.isNumberElement=function(e){return e.type===t.number},le.isDateElement=function(e){return e.type===t.date},le.isTimeElement=function(e){return e.type===t.time},le.isSelectElement=function(e){return e.type===t.select},le.isPluralElement=function(e){return e.type===t.plural},le.isPoundElement=function(e){return e.type===t.pound},le.isTagElement=function(e){return e.type===t.tag},le.isNumberSkeleton=function(t){return!(!t||"object"!=typeof t||t.type!==e.number)},le.isDateTimeSkeleton=function(t){return!(!t||"object"!=typeof t||t.type!==e.dateTime)},le.createLiteralElement=function(e){return{type:t.literal,value:e}},le.createNumberElement=function(e,r){return{type:t.number,value:e,style:r}},function(t){t[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound",t[t.tag=8]="tag"}(t||(le.TYPE=t={})),function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}(e||(le.SKELETON_TYPE=e={}))),le;var t,e}var pe=fe();function de(t){var e;return t.type===pe.TYPE.select&&ue.test(t.value)&&!!t.options.other&&(0===t.options.other.value.length||t.options.other.value.length>0&&(null===(e=t.options.other.value[0])||void 0===e?void 0:e.type)===pe.TYPE.literal)}function ye(t){var e=t.replace(/['\']/g,"''"),r=/[{}<>]/,n=e.search(r);if(-1===n)return e;for(var o=-1,i=e.length-1;i>=0;i--)if(r.test(e[i])){o=i;break}return e.slice(0,n)+"'"+e.slice(n,o+1)+"'"+e.slice(o+1)}function ge(t){return t}var ve=ge;function Ee(t){if(!t.includes(ce))return t;var e=[];se({icuString:t,shouldVisit:de,visitor:function(t){var r,n,o,i,a,s,c,u;e.push({start:null!==(n=null===(r=t.location)||void 0===r?void 0:r.start.offset)&&void 0!==n?n:0,end:null!==(i=null===(o=t.location)||void 0===o?void 0:o.end.offset)&&void 0!==i?i:0,otherStart:null!==(s=null===(a=t.options.other.location)||void 0===a?void 0:a.start.offset)&&void 0!==s?s:0,otherEnd:null!==(u=null===(c=t.options.other.location)||void 0===c?void 0:c.end.offset)&&void 0!==u?u:0})},options:{recurseIntoVisited:!1,captureLocation:!0}});for(var r=[],n=0,o=0;o<e.length;o++){var i=e[o],a=i.start,s=i.end,c=i.otherStart,u=i.otherEnd;r.push(t.slice(n,a)),r.push(t.slice(a,a+4+1)),r.push(String(o+1)),r.push(t.slice(a+4+1,c)),r.push("{}"),r.push(t.slice(u,s)),n=s}return r.push(t.slice(n,t.length)),r.join("")}var be,me={},_e=function(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var r=function t(){var r=!1;try{r=this instanceof t}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}),r}(gt);!function(){if(be)return me;be=1,Object.defineProperty(me,"__esModule",{value:!0}),me.printAST=r,me.doPrintAST=n,me.printDateTimeSkeleton=a;var t=_e,e=fe();function r(t){return n(t,!1)}function n(s,c){var u=s.map(function(u,h){return(0,e.isLiteralElement)(u)?function(t,e,r,n){var i=t.value;return r||"'"!==i[0]||(i="''".concat(i.slice(1))),n||"'"!==i[i.length-1]||(i="".concat(i.slice(0,i.length-1),"''")),i=o(i),e?i.replace("#","'#'"):i}(u,c,0===h,h===s.length-1):(0,e.isArgumentElement)(u)?function(t){var e=t.value;return"{".concat(e,"}")}(u):(0,e.isDateElement)(u)||(0,e.isTimeElement)(u)||(0,e.isNumberElement)(u)?function(t){return"{".concat(t.value,", ").concat(e.TYPE[t.type]).concat(t.style?", ".concat("string"==typeof(r=t.style)?o(r):r.type===e.SKELETON_TYPE.dateTime?"::".concat(a(r)):"::".concat(r.tokens.map(i).join(" "))):"","}");var r}(u):(0,e.isPluralElement)(u)?function(e){var r="cardinal"===e.pluralType?"plural":"selectordinal",o=[e.value,r,t.__spreadArray([e.offset?"offset:".concat(e.offset):""],Object.keys(e.options).map(function(t){return"".concat(t,"{").concat(n(e.options[t].value,!0),"}")}),!0).filter(Boolean).join(" ")].join(",");return"{".concat(o,"}")}(u):(0,e.isSelectElement)(u)?function(t){var e=[t.value,"select",Object.keys(t.options).map(function(e){return"".concat(e,"{").concat(n(t.options[e].value,!1),"}")}).join(" ")].join(",");return"{".concat(e,"}")}(u):(0,e.isPoundElement)(u)?"#":(0,e.isTagElement)(u)?function(t){return"<".concat(t.value,">").concat(r(t.children),"</").concat(t.value,">")}(u):void 0});return u.join("")}function o(t){return t.replace(/([{}](?:[\s\S]*[{}])?)/,"'$1'")}function i(t){var e=t.stem,r=t.options;return 0===r.length?e:"".concat(e).concat(r.map(function(t){return"/".concat(t)}).join(""))}function a(t){return t.pattern}}();var Te=function(){return Te=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Te.apply(this,arguments)};function He(t){if(void 0!==t){if(null===t)return"null";if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);if(Array.isArray(t)){for(var e="[",r=0;r<t.length;r++)r&&(e+=","),e+=He(t[r])||"null";return e+"]"}for(var n="",o=0,i=Object.keys(t).sort();o<i.length;o++){var a=i[o],s=He(t[a]);s&&(n&&(n+=","),n+=JSON.stringify(a)+":"+s)}return"{"+n+"}"}}function Be(t){var e;return null!==(e=He(t))&&void 0!==e?e:""}function Le(t){return function(t){if(h(t),y)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=g[t[r]];return e}(w(function(t){if("string"!=typeof t)throw new TypeError("string expected");return new Uint8Array((new TextEncoder).encode(t))}(t))).slice(0,16)}function Ae(t,e){var r,n=t.source,o=t.context,i=t.id,a=t.maxChars,s=t.dataFormat;return void 0===e&&(e=Le),r="JSX"===s?Se(n):n,e(Be(Te(Te(Te(Te({source:r},i&&{id:i}),o&&{context:o}),null!=a&&{maxChars:Math.abs(a)}),s&&{dataFormat:s})))}"function"==typeof SuppressedError&&SuppressedError;var we=function(t){if(t&&"object"==typeof t){var e={};if("c"in t&&t.c&&(e.c=Se(t.c)),"d"in t){var r=null==t?void 0:t.d;(null==r?void 0:r.b)&&(e.b=Object.fromEntries(Object.entries(r.b).map(function(t){return[t[0],Se(t[1])]}))),(null==r?void 0:r.t)&&(e.t=r.t)}return function(t){var e=t;if(e&&"object"==typeof e&&"string"==typeof e.k){var r=Object.keys(e);if(1===r.length)return!0;if(2===r.length){if("number"==typeof e.i)return!0;if("string"==typeof e.v)return!0}if(3===r.length&&"string"==typeof e.v&&"number"==typeof e.i)return!0}return!1}(t)?Te({k:t.k},t.v&&{v:t.v}):e}return t};function Se(t){return Array.isArray(t)?t.map(we):we(t)}var Pe=function(t,e){return Pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},Pe(t,e)};function Ce(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}Pe(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var Ie=function(){return Ie=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ie.apply(this,arguments)};function Oe(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})}function Me(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function Re(t,e,r){for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var Ne,Ue,Ge,De=function(t){console.warn(t)},xe=function(t){console.error(t)};function je(t){return t.loadTranslations?Ne.CUSTOM:t.cacheUrl?Ne.REMOTE:void 0!==t.cacheUrl&&t.cacheUrl!==S||!t.projectId?Ne.DISABLED:Ne.GT_REMOTE}function ke(t){return void 0!==t.runtimeUrl&&"https://runtime2.gtx.dev"!==t.runtimeUrl||!t.projectId||!t.devApiKey&&!t.apiKey?t.runtimeUrl?Ue.CUSTOM:Ue.DISABLED:Ue.GT}function Fe(t){return je(t)===Ne.GT_REMOTE||ke(t)===Ue.GT}(Ge=Ne||(Ne={})).GT_REMOTE="gt-remote",Ge.REMOTE="remote",Ge.CUSTOM="custom",Ge.DISABLED="disabled",function(t){t.GT="gt",t.CUSTOM="custom",t.DISABLED="disabled"}(Ue||(Ue={}));var Ke=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="fallback-storage-adapter",e.storage={},e}return Ce(e,t),e.prototype.getItem=function(t){return this.storage[t]},e.prototype.setItem=function(t,e){this.storage[t]=e},e.prototype.removeItem=function(t){delete this.storage[t]},e}(function(){});function Ve(t){var r=this,n=function(t){var e=t.cacheUrl,r=void 0===e?S:e,n=t.projectId,o=t._versionId,i=t._branchId,a=o?"/".concat(o):"",s=i?"?branchId=".concat(i):"";return"".concat(r,"/").concat(n,"/[locale]")+a+s}(t);return function(o){return Oe(r,void 0,void 0,function(){var r,i;return Me(this,function(a){switch(a.label){case 0:return o=e.resolveCanonicalLocale(o,t.customMapping),r=n.replace("[locale]",o),[4,fetch(r)];case 1:if(!(i=a.sent()).ok)throw new Error("Failed to load translations from ".concat(r));return[4,i.json()];case 2:return[2,a.sent()]}})})}}var $e=function(){function t(t,e){this.cache={},this.fallbackPromises={},this.cache=structuredClone(t),this.onHit=null==e?void 0:e.onHit,this.onMiss=null==e?void 0:e.onMiss}return t.prototype.setCache=function(t,e){this.cache[t]=e},t.prototype.getCache=function(t){var e=this.genKey(t);return this.cache[e]},t.prototype.getInternalCache=function(){return this.cache},t.prototype.missCache=function(t){return Oe(this,void 0,void 0,function(){var e,r,n;return Me(this,function(o){switch(o.label){case 0:return e=this.genKey(t),void 0===this.fallbackPromises[e]?[3,2]:[4,this.fallbackPromises[e]];case 1:return[2,o.sent()];case 2:r=this.fallback(t),this.fallbackPromises[e]=r,o.label=3;case 3:return o.trys.push([3,,5,6]),[4,r];case 4:return n=o.sent(),this.cache[e]=n,[2,n];case 5:return delete this.fallbackPromises[e],[7];case 6:return[2]}})})},t}();function Xe(t,e){return Ae(Ie(Ie(Ie(Ie({source:"ICU"===e.$format?Ee(t):t},(null==e?void 0:e.$context)&&{context:e.$context}),(null==e?void 0:e.$id)&&{id:e.$id}),"$maxChars"in e&&null!=e.$maxChars&&{$maxChars:Math.abs(e.$maxChars)}),{dataFormat:e.$format}))}var qe=function(t){function e(e){var r=e.init,n=e.translateMany,o=e.lifecycle,i=t.call(this,r,o)||this;return i._queue=[],i._batchTimer=null,i._activeRequests=0,i._translateMany=n,i}return Ce(e,t),e.prototype.get=function(t){var e=this.getCache(t);return null!=e&&this.onHit&&this.onHit({inputKey:t,cacheKey:this.genKey(t),cacheValue:e,outputValue:e}),e},e.prototype.miss=function(t){return Oe(this,void 0,void 0,function(){var e;return Me(this,function(r){switch(r.label){case 0:return[4,this.missCache(t)];case 1:return null!=(e=r.sent())&&this.onMiss&&this.onMiss({inputKey:t,cacheKey:this.genKey(t),cacheValue:e,outputValue:e}),[2,e]}})})},e.prototype.genKey=function(t){return Xe(t.message,t.options)},e.prototype.fallback=function(t){var e=this._enqueueTranslation(t);return this._queue.length>=25?this._flushNow():this._scheduleBatch(),e},e.prototype._flushNow=function(){this._batchTimer&&(clearTimeout(this._batchTimer),this._batchTimer=null),this._drainQueue()},e.prototype._scheduleBatch=function(){var t=this;this._batchTimer||(this._batchTimer=setTimeout(function(){t._batchTimer=null,t._drainQueue()},50))},e.prototype._drainQueue=function(){for(;this._queue.length>0&&this._activeRequests<100;){var t=this._queue.splice(0,25);this._sendBatchRequest(t)}this._queue.length>0&&this._scheduleBatch()},e.prototype._enqueueTranslation=function(t){var e=this,r=this.genKey(t),n=t.options;return new Promise(function(o,i){e._queue.push({key:r,source:t.message,metadata:Ie(Ie(Ie(Ie({},(null==n?void 0:n.$context)&&{context:n.$context}),(null==n?void 0:n.$id)&&{id:n.$id}),"$maxChars"in n&&null!=n.$maxChars&&{$maxChars:Math.abs(n.$maxChars)}),{dataFormat:n.$format}),resolve:function(t){return o(t)},reject:i})})},e.prototype._sendBatchRequest=function(t){return Oe(this,void 0,void 0,function(){var e,r;return Me(this,function(n){switch(n.label){case 0:return this._activeRequests++,e=function(t){return t.reduce(function(t,e){return t[e.key]={source:e.source,metadata:e.metadata},t},{})}(t),[4,this._sendBatchRequestWithErrorHandling(t,e)];case 1:return(r=n.sent())&&this._handleTranslationResponse(t,r),this._activeRequests--,[2]}})})},e.prototype._sendBatchRequestWithErrorHandling=function(t,e){return Oe(this,void 0,void 0,function(){var r,n,o;return Me(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this._translateMany(e)];case 1:return[2,i.sent()];case 2:for(r=i.sent(),n=0,o=t;n<o.length;n++)o[n].reject(r);return[2,void 0];case 3:return[2]}})})},e.prototype._handleTranslationResponse=function(t,e){for(var r=0,n=t;r<n.length;r++){var o=n[r],i=o.key,a=e[i];if(a&&a.success){var s=a.translation;this.setCache(i,s),o.resolve(s)}else o.reject(null==a?void 0:a.error)}},e}($e),Ye=function(t){function e(e){var r=e.init,n=void 0===r?{}:r,o=e.ttl,i=e.loadTranslations,a=e.createTranslateMany,s=e.lifecycle,c=s.onLocalesCacheHit,u=s.onLocalesCacheMiss,h=s.onTranslationsCacheHit,l=s.onTranslationsCacheMiss,f=t.call(this,n,{onHit:c,onMiss:u})||this;return f.ttl=6e4,f.ttl=null===o?-1:null!=o?o:6e4,f._translationLoader=i,f._createTranslateMany=a,f._onTranslationsCacheHit=h,f._onTranslationsCacheMiss=l,f}return Ce(e,t),e.prototype.get=function(t){var e=this.getCache(t);if(e&&!(e.expiresAt>0&&e.expiresAt<Date.now())){var r=e.translationsCache;return null!=r&&this.onHit&&this.onHit({inputKey:t,cacheKey:this.genKey(t),cacheValue:e,outputValue:r}),r}},e.prototype.miss=function(t){return Oe(this,void 0,void 0,function(){var e,r;return Me(this,function(n){switch(n.label){case 0:return[4,this.missCache(t)];case 1:return e=n.sent(),null!=(r=e.translationsCache)&&this.onMiss&&this.onMiss({inputKey:t,cacheKey:this.genKey(t),cacheValue:e,outputValue:r}),[2,r]}})})},e.prototype.genKey=function(t){return t},e.prototype.fallback=function(t){return Oe(this,void 0,void 0,function(){var e,r,n,o;return Me(this,function(i){switch(i.label){case 0:return e=this._translationLoader(t),r=this.ttl<0?this.ttl:Date.now()+this.ttl,n=qe.bind,o={},[4,e];case 1:return[2,{translationsCache:new(n.apply(qe,[void 0,(o.init=i.sent(),o.lifecycle=this._createTranslationsCacheLifecycle(t),o.translateMany=this._createTranslateMany(t),o)])),expiresAt:r}]}})})},e.prototype._createTranslationsCacheLifecycle=function(t){var e=this;return{onHit:this._onTranslationsCacheHit?function(r){return e._onTranslationsCacheHit(Ie({locale:t},r))}:void 0,onMiss:this._onTranslationsCacheMiss?function(r){return e._onTranslationsCacheMiss(Ie({locale:t},r))}:void 0}},e}($e);function We(t){var e=t.onLocalesCacheHit,r=t.onLocalesCacheMiss,n=t.onTranslationsCacheHit,o=t.onTranslationsCacheMiss;return{onLocalesCacheHit:function(t){null==e||e({locale:t.inputKey,value:t.outputValue.getInternalCache()})},onLocalesCacheMiss:function(t){null==r||r({locale:t.inputKey,value:t.outputValue.getInternalCache()})},onTranslationsCacheHit:function(t){null==n||n({locale:t.locale,hash:t.cacheKey,value:t.outputValue})},onTranslationsCacheMiss:function(t){null==o||o({locale:t.locale,hash:t.cacheKey,value:t.outputValue})}}}var Ze=function(){function t(t){var r,n,o,i,a,s=this;this.resolveTranslationSync=function(t,e){return s.lookupTranslation(t,e)},function(t,e,r){if(void 0===r&&(r=!0),t.forEach(function(t){switch(t.type){case"error":xe(e+t.message);break;case"warning":De(e+t.message)}}),r&&t.some(function(t){return"error"===t.type}))throw new Error("Validation errors occurred")}(function(t){var r=[];return r.push.apply(r,function(t){var e=[],r=t.projectId,n=t.loadTranslations;switch(je(t)){case Ne.REMOTE:case Ne.GT_REMOTE:r||e.push({type:"warning",message:"projectId is required when loading translations from a remote store"});break;case Ne.CUSTOM:n||e.push({type:"error",message:"loadTranslations is required when loading translations from a custom loader"});case Ne.DISABLED:}return e}(t)),r.push.apply(r,function(t){var e=[];switch(ke(t)){case Ue.CUSTOM:case Ue.GT:t.projectId||e.push({type:"warning",message:"projectId is required"}),t.devApiKey||t.apiKey||e.push({type:"warning",message:"devApiKey or apiKey is required"});case Ue.DISABLED:}return e}(t)),r.push.apply(r,function(t){var r=[];if(!Fe(t))return r;var n=t.defaultLocale,o=t.locales,i=t.customMapping;return new Set(Re(Re([],n?[n]:[]),o||[])).forEach(function(t){e.isValidLocale(t,i)||r.push({type:"error",message:"Invalid locale: ".concat(t)})}),r}(t)),r}(t),"I18nManager: "),this.config=(i=Fe(o=t),a=function(t){var e=t.defaultLocale,r=t.locales,n=t.customMapping;return{defaultLocale:e,locales:Array.from(new Set(Re([e],r))),customMapping:n||{}}}({defaultLocale:o.defaultLocale||P,locales:o.locales||[P],customMapping:o.customMapping}),Ie({environment:o.environment||"production",enableI18n:void 0===o.enableI18n||o.enableI18n,projectId:o.projectId,devApiKey:o.devApiKey,apiKey:o.apiKey,runtimeUrl:o.runtimeUrl,_versionId:o._versionId},i?function(t){var r=e.standardizeLocale(t.defaultLocale),n=t.locales.map(function(r){var n,o,i,a;return("string"==typeof(null===(n=t.customMapping)||void 0===n?void 0:n[r])?null===(o=t.customMapping)||void 0===o?void 0:o[r]:null===(a=null===(i=t.customMapping)||void 0===i?void 0:i[r])||void 0===a?void 0:a.code)?r:e.standardizeLocale(r)}),o=Object.fromEntries(Object.entries(t.customMapping||{}).map(function(t){var r=t[0],n=t[1];return[r,"string"==typeof n?e.standardizeLocale(n):Ie(Ie({},n),n.code?{code:e.standardizeLocale(n.code)}:{})]}));return{defaultLocale:r,locales:n,customMapping:o}}(a):a)),this.storeAdapter=null!==(r=t.storeAdapter)&&void 0!==r?r:new Ke;var c,u=function(t){return function(t){var e=t.type,r=t.remoteTranslationLoaderParams,n=t.loadTranslations;e===Ne.DISABLED&&De("I18nManager: No translation loader found. No translations will be loaded.");var o=r.cacheUrl,i=r.projectId,a=r._versionId,s=r._branchId,c=r.customMapping;switch(e){case Ne.REMOTE:case Ne.GT_REMOTE:return Ve({cacheUrl:o||"",projectId:i||"",_versionId:a,_branchId:s,customMapping:c});case Ne.CUSTOM:return n;case Ne.DISABLED:return function(){var t=this;return function(e){return Oe(t,void 0,void 0,function(){return Me(this,function(t){return[2,{}]})})}}()}}({loadTranslations:t.loadTranslations,type:je(t),remoteTranslationLoaderParams:{cacheUrl:t.cacheUrl,projectId:t.projectId,_versionId:t._versionId,_branchId:t._branchId,customMapping:t.customMapping}})}(t),h=(c=this.getGTClassClean(),function(t){return function(e){return c.translateMany(e,{targetLocale:t},12e3)}});this.localesCache=new Ye({loadTranslations:u,createTranslateMany:h,lifecycle:We(null!==(n=t.lifecycle)&&void 0!==n?n:{})})}return t.prototype.getAdapterType=function(){return this.storeAdapter.type},t.prototype.getLocale=function(){return this.storeAdapter.getItem("locale")||(De("getLocale() invoked outside of translation context, falling back to default locale"),this.config.defaultLocale)},t.prototype.setLocale=function(t){try{this.validateLocale(t);var e=this.getGTClass();this.storeAdapter.setItem("locale",e.determineLocale(t))}catch(t){this.handleError(t)}},t.prototype.getDefaultLocale=function(){return this.config.defaultLocale},t.prototype.getLocales=function(){return this.config.locales},t.prototype.getVersionId=function(){return this.config._versionId},t.prototype.getGTClass=function(){return this.getGTClassClean(this.getLocale())},t.prototype.isTranslationEnabled=function(){return this.config.enableI18n},t.prototype.getTranslationLoader=function(){var t=this;return function(e){return t.loadTranslations(e)}},t.prototype.loadTranslations=function(){return Oe(this,arguments,void 0,function(t){var e,r;return void 0===t&&(t=this.getLocale()),Me(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),this.validateLocale(t),this.requiresTranslation(t)?(e=this.localesCache.get(t))?[3,2]:[4,this.localesCache.miss(t)]:[2,{}];case 1:e=n.sent(),n.label=2;case 2:return[2,e.getInternalCache()];case 3:return r=n.sent(),this.handleError(r),[2,{}];case 4:return[2]}})})},t.prototype.lookupTranslation=function(t,e){var r;try{var n=null!==(r=e.$locale)&&void 0!==r?r:this.getLocale();if(this.validateLocale(n),!this.requiresTranslation(n))return t;var o=this.localesCache.get(n);if(!o)return;return o.get({message:t,options:e})}catch(t){return void this.handleError(t)}},t.prototype.lookupTranslationWithFallback=function(t,e){return Oe(this,void 0,void 0,function(){var r,n,o,i,a;return Me(this,function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),r=null!==(a=e.$locale)&&void 0!==a?a:this.getLocale(),this.validateLocale(r),this.requiresTranslation(r)?(n=this.localesCache.get(r))?[3,2]:[4,this.localesCache.miss(r)]:[2,t];case 1:n=s.sent(),s.label=2;case 2:return null!=(o=n.get({message:t,options:e}))?[3,4]:[4,n.miss({message:t,options:e})];case 3:o=s.sent(),s.label=4;case 4:return[2,o];case 5:return i=s.sent(),this.handleError(i),[2,void 0];case 6:return[2]}})})},t.prototype.getLookupTranslation=function(){return Oe(this,arguments,void 0,function(t,e){var r,n,o;return void 0===t&&(t=this.getLocale()),void 0===e&&(e=[]),Me(this,function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),this.validateLocale(t),this.requiresTranslation(t)?(r=function(t,e){return t.filter(function(t){return null==t.options.$locale||t.options.$locale===e})}(e,t),r.length!==e.length&&De("I18nManager: getLookupTranslation(): prefetchEntries must all be the same locale, ignoring all entries that are not for ".concat(t)),(n=this.localesCache.get(t))?[3,2]:[4,this.localesCache.miss(t)]):[2,function(t){return t}];case 1:n=i.sent(),i.label=2;case 2:return n?[4,Promise.all(r.filter(function(t){return null==n.get(t)}).map(function(t){return n.miss(t)}))]:[2,function(){}];case 3:return i.sent(),[2,function(t,e){return n.get({message:t,options:e})}];case 4:return o=i.sent(),this.handleError(o),[2,function(t){return t}];case 5:return[2]}})})},t.prototype.getTranslations=function(){return Oe(this,arguments,void 0,function(t){return void 0===t&&(t=this.getLocale()),Me(this,function(e){try{return this.validateLocale(t),[2,this.loadTranslations(t)]}catch(t){return this.handleError(t),[2,{}]}return[2]})})},t.prototype.getTranslationResolver=function(){return Oe(this,arguments,void 0,function(t){return void 0===t&&(t=this.getLocale()),Me(this,function(e){return[2,this.getLookupTranslation(t)]})})},t.prototype.requiresTranslation=function(t){void 0===t&&(t=this.getLocale());var e=this.getDefaultLocale(),r=this.getGTClass(),n=this.getLocales();return this.isTranslationEnabled()&&r.requiresTranslation(e,t,n)},t.prototype.requiresDialectTranslation=function(t){void 0===t&&(t=this.getLocale());var e=this.getDefaultLocale(),r=this.getGTClass();return this.requiresTranslation(t)&&r.isSameLanguage(e,t)},t.prototype.handleError=function(t){if("development"===this.config.environment)throw t;xe("I18nManager: "+t)},t.prototype.validateLocale=function(t){var e=this.getGTClass();if(!e.isValidLocale(t)||!e.determineLocale(t))throw new Error("I18nManager: validateLocale(): locale ".concat(t," is not valid"))},t.prototype.getGTClassClean=function(t){return new e.GT({sourceLocale:this.config.defaultLocale,targetLocale:t,locales:this.config.locales,customMapping:this.config.customMapping,projectId:this.config.projectId,baseUrl:this.config.runtimeUrl||void 0,apiKey:this.config.apiKey,devApiKey:this.config.devApiKey})},t}(),ze=void 0;function Je(){return ze||(De("getI18nManager(): Translation failed because I18nManager not initialized."),ze=new Ze({defaultLocale:P,locales:[P]})),ze}Object.defineProperty(exports,"getGT",{enumerable:!0,get:function(){return t.getGT}}),Object.defineProperty(exports,"getMessages",{enumerable:!0,get:function(){return t.getMessages}}),Object.defineProperty(exports,"tx",{enumerable:!0,get:function(){return t.tx}}),exports.declareStatic=ve,exports.declareVar=function(t,e){var r=ye(String(null!=t?t:"")),n=" other {".concat(r,"}"),o="";if(null==e?void 0:e.$name){var i=ye(e.$name);o=" ".concat("_gt_var_name"," {").concat(i,"}")}return"{".concat(ce,", select,").concat(n).concat(o,"}")},exports.decodeMsg=function(t){return"string"==typeof t&&-1!==t.lastIndexOf(":")?t.slice(0,t.lastIndexOf(":")):t},exports.decodeOptions=function(t){if(-1===t.lastIndexOf(":"))return null;var e=t.slice(t.lastIndexOf(":")+1);try{return JSON.parse(function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"base64").toString("utf8");for(var e=atob(t),r=new Uint8Array(e.length),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return(new TextDecoder).decode(r)}(e))}catch(t){return null}},exports.decodeVars=function(t){if(!t.includes(ce))return t;var e=[];se({icuString:t,shouldVisit:de,visitor:function(t){var r,n,o,i;e.push({start:null!==(n=null===(r=t.location)||void 0===r?void 0:r.start.offset)&&void 0!==n?n:0,end:null!==(i=null===(o=t.location)||void 0===o?void 0:o.end.offset)&&void 0!==i?i:0,value:t.options.other.value.length>0?t.options.other.value[0].value:""})},options:{recurseIntoVisited:!1,captureLocation:!0}});for(var r=0,n=[],o=0;o<e.length;o++)n.push(t.slice(r,e[o].start)),n.push(e[o].value),r=e[o].end;return r<t.length&&n.push(t.slice(r)),n.join("")},exports.derive=ge,exports.getDefaultLocale=function(){return Je().getDefaultLocale()},exports.getLocale=function(){return Je().getLocale()},exports.getLocaleProperties=function(t){return Je().getGTClass().getLocaleProperties(t)},exports.getLocales=function(){return Je().getLocales()},exports.getRequestLocale=function(t){var e=a(),r=e.getDefaultLocale(),n=e.getGTClass(),o=t.headers["accept-language"],i=Array.isArray(o)?o[0]:o;if(!i)return r;var s=i.split(",").map(function(t){var e=t.trim().split(";"),r=e[0],n=e[1],o=null==n?void 0:n.split("=")[1],i=void 0!==o?parseFloat(o):1;return{locale:r.trim(),quality:isNaN(i)?1:i}}).sort(function(t,e){return e.quality-t.quality}).map(function(t){return t.locale});return n.determineLocale(s)||r},exports.getVersionId=function(){return Je().getVersionId()},exports.initializeGT=function(e){!function(e){t.setI18nManager(e)}(new s(i(i({},e),{storeAdapter:new u})))},exports.msg=function t(r,n){var o;if("string"!=typeof r)return n?r.map(function(e,r){return t(e,Ie(Ie({},n),n.$id&&{$id:"".concat(n.$id,".").concat(r)}))}):r;if(!n)return r;var i=function(t){return Object.fromEntries(Object.entries(t).filter(function(t){var e=t[0];return"$id"!==e&&"$context"!==e&&"$maxChars"!==e&&"$hash"!==e&&"$_hash"!==e&&"$_source"!==e&&"$_fallback"!==e&&"$format"!==e&&"$_locales"!==e&&"$locale"!==e}))}(n),a=r;try{a=e.formatMessage(r,{locales:[P],variables:Ie(Ie({},i),(o={},o[ce]="other",o))})}catch(n){return De(function(t){return'String interpolation failed for message: "'.concat(t,'".')}(r)),r}var s=r,c=n.$_hash||Xe(r,Ie({$format:"ICU"},n)),u=Ie(Ie({},n),{$_source:s,$_hash:c}),h=function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"utf8").toString("base64");for(var e=(new TextEncoder).encode(t),r="",n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}(JSON.stringify(u));return"".concat(a,":").concat(h)},exports.withGT=function(t,e){var r=a();if(!function(t){return t.getAdapterType()===c&&"run"in t&&"function"==typeof t.run}(r))throw new Error("I18nManager not initialized. Invoke configGT() to initialize.");return r.run(t,e)};
|
|
2
|
-
//# sourceMappingURL=index.cjs.min.cjs.map
|