gt-react 11.1.6 → 11.1.7
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 +11 -0
- package/LICENSE.md +18 -102
- package/dist/index.client.cjs +39 -77
- package/dist/index.client.cjs.map +1 -1
- package/dist/index.client.d.cts.map +1 -1
- package/dist/index.client.d.mts.map +1 -1
- package/dist/index.client.mjs +39 -77
- package/dist/index.client.mjs.map +1 -1
- package/dist/index.server.d.cts.map +1 -1
- package/dist/index.server.d.mts.map +1 -1
- package/dist/index.types.d.cts.map +1 -1
- package/dist/index.types.d.mts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# gt-react
|
|
2
2
|
|
|
3
|
+
## 11.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2074](https://github.com/generaltranslation/gt/pull/2074) [`240a65e`](https://github.com/generaltranslation/gt/commit/240a65e9305a74cdfd4df07537fb4cfae8a2eac8) Thanks [@eoinest](https://github.com/eoinest)! - Migrate the package license from FSL-1.1-ALv2 to MIT.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`240a65e`](https://github.com/generaltranslation/gt/commit/240a65e9305a74cdfd4df07537fb4cfae8a2eac8)]:
|
|
10
|
+
- @generaltranslation/react-core@11.1.7
|
|
11
|
+
- generaltranslation@9.1.3
|
|
12
|
+
- gt-i18n@1.0.13
|
|
13
|
+
|
|
3
14
|
## 11.1.6
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/LICENSE.md
CHANGED
|
@@ -1,105 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
## Abbreviation
|
|
4
|
-
|
|
5
|
-
FSL-1.1-ALv2
|
|
6
|
-
|
|
7
|
-
## Notice
|
|
1
|
+
MIT License
|
|
8
2
|
|
|
9
3
|
Copyright 2025 General Translation, Inc.
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
-
|
|
30
|
-
### Permitted Purpose
|
|
31
|
-
|
|
32
|
-
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
-
means making the Software available to others in a commercial product or
|
|
34
|
-
service that:
|
|
35
|
-
|
|
36
|
-
1. substitutes for the Software;
|
|
37
|
-
|
|
38
|
-
2. substitutes for any other product or service we offer using the Software
|
|
39
|
-
that exists as of the date we make the Software available; or
|
|
40
|
-
|
|
41
|
-
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
-
|
|
43
|
-
Permitted Purposes specifically include using the Software:
|
|
44
|
-
|
|
45
|
-
1. for your internal use and access;
|
|
46
|
-
|
|
47
|
-
2. for non-commercial education;
|
|
48
|
-
|
|
49
|
-
3. for non-commercial research; and
|
|
50
|
-
|
|
51
|
-
4. in connection with professional services that you provide to a licensee
|
|
52
|
-
using the Software in accordance with these Terms and Conditions.
|
|
53
|
-
|
|
54
|
-
### Patents
|
|
55
|
-
|
|
56
|
-
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
-
patents, the license grant above includes a license under our patents. If you
|
|
58
|
-
make a claim against any party that the Software infringes or contributes to
|
|
59
|
-
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
-
immediately.
|
|
61
|
-
|
|
62
|
-
### Redistribution
|
|
63
|
-
|
|
64
|
-
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
-
the Software.
|
|
66
|
-
|
|
67
|
-
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
-
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
-
remove any copyright notices provided in or with the Software.
|
|
70
|
-
|
|
71
|
-
### Disclaimer
|
|
72
|
-
|
|
73
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
-
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
-
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
-
|
|
77
|
-
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
-
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
-
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
-
|
|
81
|
-
### Trademarks
|
|
82
|
-
|
|
83
|
-
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
-
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
-
trademarks, trade names, service marks or product names.
|
|
86
|
-
|
|
87
|
-
## Grant of Future License
|
|
88
|
-
|
|
89
|
-
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
-
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
-
the date we make the Software available. On or after that date, you may use the
|
|
92
|
-
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
-
will apply:
|
|
94
|
-
|
|
95
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
-
this file except in compliance with the License.
|
|
97
|
-
|
|
98
|
-
You may obtain a copy of the License at
|
|
99
|
-
|
|
100
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
-
|
|
102
|
-
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
-
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
-
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
-
specific language governing permissions and limitations under the License.
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.client.cjs
CHANGED
|
@@ -6,50 +6,6 @@ let _generaltranslation_react_core_hooks = require("@generaltranslation/react-co
|
|
|
6
6
|
let _generaltranslation_react_core_components = require("@generaltranslation/react-core/components");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let react = require("react");
|
|
9
|
-
//#region src/i18n-cache/constants.ts
|
|
10
|
-
const DEFAULT_HTML_TAG_OPTIONS = {
|
|
11
|
-
updateHtmlLangTag: true,
|
|
12
|
-
updateHtmlDirTag: true
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region ../core/dist/api-rqq7klYe.mjs
|
|
16
|
-
function ensureSentence(text) {
|
|
17
|
-
const trimmed = text.trim();
|
|
18
|
-
if (!trimmed) return "";
|
|
19
|
-
return /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
20
|
-
}
|
|
21
|
-
function stripSentence(text) {
|
|
22
|
-
const trimmed = text.trim();
|
|
23
|
-
let end = trimmed.length;
|
|
24
|
-
while (end > 0) {
|
|
25
|
-
const char = trimmed[end - 1];
|
|
26
|
-
if (char !== "." && char !== "!" && char !== "?") break;
|
|
27
|
-
end -= 1;
|
|
28
|
-
}
|
|
29
|
-
return trimmed.slice(0, end);
|
|
30
|
-
}
|
|
31
|
-
function formatDetails(details) {
|
|
32
|
-
if (!details) return "";
|
|
33
|
-
const detailText = Array.isArray(details) ? details.join(", ") : details;
|
|
34
|
-
if (!detailText.trim()) return "";
|
|
35
|
-
return ensureSentence(`Details: ${detailText}`);
|
|
36
|
-
}
|
|
37
|
-
function createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {
|
|
38
|
-
const prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : "";
|
|
39
|
-
const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;
|
|
40
|
-
const shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
|
|
41
|
-
const messageParts = [
|
|
42
|
-
whatAndWhy,
|
|
43
|
-
reassurance,
|
|
44
|
-
shouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,
|
|
45
|
-
shouldCombineWayOut ? void 0 : wayOut,
|
|
46
|
-
formatDetails(details)
|
|
47
|
-
].filter((part) => !!part).map(ensureSentence);
|
|
48
|
-
if (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);
|
|
49
|
-
const message = messageParts.join(" ");
|
|
50
|
-
return prefix ? `${prefix} ${message}` : message;
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
9
|
//#region src/i18n-cache/BrowserI18nCache.ts
|
|
54
10
|
let localStorageCacheModulePromise;
|
|
55
11
|
/**
|
|
@@ -57,7 +13,7 @@ let localStorageCacheModulePromise;
|
|
|
57
13
|
*/
|
|
58
14
|
var BrowserI18nCache = class extends gt_i18n_internal.I18nCache {
|
|
59
15
|
constructor(config) {
|
|
60
|
-
const { htmlTagOptions, ...managerConfig } = config;
|
|
16
|
+
const { htmlTagOptions: _htmlTagOptions, ...managerConfig } = config;
|
|
61
17
|
const localStorageCaches = {};
|
|
62
18
|
const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
|
|
63
19
|
const devHotReloadEnabled = !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();
|
|
@@ -69,10 +25,6 @@ var BrowserI18nCache = class extends gt_i18n_internal.I18nCache {
|
|
|
69
25
|
});
|
|
70
26
|
this._devHotReloadJsx = false;
|
|
71
27
|
this._devHotReloadJsx = devHotReloadEnabled;
|
|
72
|
-
this.htmlTagOptions = {
|
|
73
|
-
...DEFAULT_HTML_TAG_OPTIONS,
|
|
74
|
-
...htmlTagOptions
|
|
75
|
-
};
|
|
76
28
|
if (devHotReloadEnabled) this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {
|
|
77
29
|
getOrCreateLocalStorageCache(localStorageCaches, {
|
|
78
30
|
locale,
|
|
@@ -86,28 +38,6 @@ var BrowserI18nCache = class extends gt_i18n_internal.I18nCache {
|
|
|
86
38
|
isDevHotReloadJsx() {
|
|
87
39
|
return this._devHotReloadJsx;
|
|
88
40
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Update the html tag (lang, dir)
|
|
91
|
-
*
|
|
92
|
-
* @deprecated, TODO: we should use a different system for managing this html tag
|
|
93
|
-
* this should just be for managing translations
|
|
94
|
-
*/
|
|
95
|
-
updateHtmlTag(locale, htmlTagOptions) {
|
|
96
|
-
const htmlLocale = htmlTagOptions?.lang || locale;
|
|
97
|
-
const i18nConfig = (0, gt_i18n_internal.getI18nConfig)();
|
|
98
|
-
const canonicalLocale = i18nConfig.resolveCanonicalLocale(htmlLocale);
|
|
99
|
-
if (!i18nConfig.isValidLocale(canonicalLocale)) {
|
|
100
|
-
console.warn(createInvalidLocaleWarning(htmlLocale));
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const localeDirection = htmlTagOptions?.dir || i18nConfig.getLocaleDirection(canonicalLocale);
|
|
104
|
-
const mergedHtmlTagOptions = {
|
|
105
|
-
...this.htmlTagOptions,
|
|
106
|
-
...htmlTagOptions
|
|
107
|
-
};
|
|
108
|
-
if (mergedHtmlTagOptions.updateHtmlLangTag) document.documentElement.lang = canonicalLocale;
|
|
109
|
-
if (mergedHtmlTagOptions.updateHtmlDirTag) document.documentElement.dir = localeDirection;
|
|
110
|
-
}
|
|
111
41
|
};
|
|
112
42
|
/**
|
|
113
43
|
* Wraps a translation loader to merge localStorage translations in dev mode.
|
|
@@ -132,12 +62,6 @@ function getOrCreateLocalStorageCache(localStorageCaches, params) {
|
|
|
132
62
|
function loadLocalStorageCache() {
|
|
133
63
|
return localStorageCacheModulePromise ??= Promise.resolve().then(() => require("./LocalStorageTranslationCache-DOEJz82p.cjs"));
|
|
134
64
|
}
|
|
135
|
-
const createInvalidLocaleWarning = (locale) => createDiagnosticMessage({
|
|
136
|
-
source: "gt-react",
|
|
137
|
-
severity: "Warning",
|
|
138
|
-
whatHappened: `Locale "${locale}" is not valid`,
|
|
139
|
-
fix: "Use a valid BCP 47 locale code or add a custom mapping"
|
|
140
|
-
});
|
|
141
65
|
//#endregion
|
|
142
66
|
//#region src/condition-store/cookies.ts
|
|
143
67
|
/**
|
|
@@ -255,6 +179,44 @@ function getBrowserLocale(getLocale) {
|
|
|
255
179
|
return i18nConfig.resolveSupportedLocale(candidates);
|
|
256
180
|
}
|
|
257
181
|
//#endregion
|
|
182
|
+
//#region ../core/dist/api-rqq7klYe.mjs
|
|
183
|
+
function ensureSentence(text) {
|
|
184
|
+
const trimmed = text.trim();
|
|
185
|
+
if (!trimmed) return "";
|
|
186
|
+
return /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
187
|
+
}
|
|
188
|
+
function stripSentence(text) {
|
|
189
|
+
const trimmed = text.trim();
|
|
190
|
+
let end = trimmed.length;
|
|
191
|
+
while (end > 0) {
|
|
192
|
+
const char = trimmed[end - 1];
|
|
193
|
+
if (char !== "." && char !== "!" && char !== "?") break;
|
|
194
|
+
end -= 1;
|
|
195
|
+
}
|
|
196
|
+
return trimmed.slice(0, end);
|
|
197
|
+
}
|
|
198
|
+
function formatDetails(details) {
|
|
199
|
+
if (!details) return "";
|
|
200
|
+
const detailText = Array.isArray(details) ? details.join(", ") : details;
|
|
201
|
+
if (!detailText.trim()) return "";
|
|
202
|
+
return ensureSentence(`Details: ${detailText}`);
|
|
203
|
+
}
|
|
204
|
+
function createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {
|
|
205
|
+
const prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : "";
|
|
206
|
+
const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;
|
|
207
|
+
const shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
|
|
208
|
+
const messageParts = [
|
|
209
|
+
whatAndWhy,
|
|
210
|
+
reassurance,
|
|
211
|
+
shouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,
|
|
212
|
+
shouldCombineWayOut ? void 0 : wayOut,
|
|
213
|
+
formatDetails(details)
|
|
214
|
+
].filter((part) => !!part).map(ensureSentence);
|
|
215
|
+
if (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);
|
|
216
|
+
const message = messageParts.join(" ");
|
|
217
|
+
return prefix ? `${prefix} ${message}` : message;
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
258
220
|
//#region src/condition-store/singleton-operations.ts
|
|
259
221
|
const conditionStoreNotInitializedError = createDiagnosticMessage({
|
|
260
222
|
source: "gt-react",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.cjs","names":["I18nCache","getCookieValue","getCookieValue","defaultResetLocaleCookieName","getCookieValue","getCookieValue","I18nStore","InternalLocaleSelector","InternalRegionSelector","I18nStore","InternalGTProvider"],"sources":["../src/i18n-cache/constants.ts","../../core/dist/api-rqq7klYe.mjs","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/cookies.ts","../src/condition-store/readBrowserLocale.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/singleton-operations.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/runtimeCredentials.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"sourcesContent":["import type { HtmlTagOptions } from './types';\n\nexport const DEFAULT_HTML_TAG_OPTIONS: HtmlTagOptions = {\n updateHtmlLangTag: true,\n updateHtmlDirTag: true,\n};\n","//#region src/settings/settings.ts\nconst libraryDefaultLocale = \"en\";\nconst defaultTimeout = 6e4;\n//#endregion\n//#region src/logging/diagnostics.ts\nfunction ensureSentence(text) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return \"\";\n\treturn /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\nfunction stripSentence(text) {\n\tconst trimmed = text.trim();\n\tlet end = trimmed.length;\n\twhile (end > 0) {\n\t\tconst char = trimmed[end - 1];\n\t\tif (char !== \".\" && char !== \"!\" && char !== \"?\") break;\n\t\tend -= 1;\n\t}\n\treturn trimmed.slice(0, end);\n}\nfunction formatDetails(details) {\n\tif (!details) return \"\";\n\tconst detailText = Array.isArray(details) ? details.join(\", \") : details;\n\tif (!detailText.trim()) return \"\";\n\treturn ensureSentence(`Details: ${detailText}`);\n}\nfunction formatDiagnosticErrorDetails(error) {\n\tif (error == null) return void 0;\n\treturn String(error);\n}\nfunction createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {\n\tconst prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : \"\";\n\tconst whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;\n\tconst shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n\tconst messageParts = [\n\t\twhatAndWhy,\n\t\treassurance,\n\t\tshouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,\n\t\tshouldCombineWayOut ? void 0 : wayOut,\n\t\tformatDetails(details)\n\t].filter((part) => !!part).map(ensureSentence);\n\tif (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);\n\tconst message = messageParts.join(\" \");\n\treturn prefix ? `${prefix} ${message}` : message;\n}\n//#endregion\n//#region src/settings/settingsUrls.ts\nconst defaultCacheUrl = \"https://cdn.gtx.dev\";\nconst defaultBaseUrl = \"https://api2.gtx.dev\";\nconst defaultRuntimeApiUrl = \"https://runtime2.gtx.dev\";\n//#endregion\n//#region src/translate/api.ts\nconst API_VERSION = \"2026-03-06.v1\";\n//#endregion\nexport { createDiagnosticMessage as a, libraryDefaultLocale as c, defaultRuntimeApiUrl as i, defaultBaseUrl as n, formatDiagnosticErrorDetails as o, defaultCacheUrl as r, defaultTimeout as s, API_VERSION as t };\n\n//# sourceMappingURL=api-rqq7klYe.mjs.map","import type {\n I18nCacheConstructorParams,\n TranslationsLoader,\n} from 'gt-i18n/internal/types';\nimport { getI18nConfig, I18nCache } from 'gt-i18n/internal';\nimport type { HtmlTagOptions } from './types';\nimport type { Translation } from 'gt-i18n/types';\nimport { DEFAULT_HTML_TAG_OPTIONS } from './constants';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\n\ntype LocalStorageTranslationCache =\n import('./LocalStorageTranslationCache').LocalStorageTranslationCache;\ntype LocalStorageCachePromises = Record<\n string,\n Promise<LocalStorageTranslationCache>\n>;\n\n// Lazily import the development-only cache so bundlers can keep it out of the initial client chunk.\n// `??=` saves the first import promise, so all cache instances reuse the same lazy module load.\nlet localStorageCacheModulePromise:\n | Promise<typeof import('./LocalStorageTranslationCache')>\n | undefined;\n\n/**\n * The configuration for the BrowserI18nCache\n */\nexport type BrowserI18nCacheParams = I18nCacheConstructorParams & {\n htmlTagOptions?: HtmlTagOptions;\n};\n\n/**\n * I18nCache implementation for Browser.\n */\nexport class BrowserI18nCache extends I18nCache<Translation> {\n /** Customize browser-related behavior */\n private htmlTagOptions?: HtmlTagOptions;\n\n /** Whether dev hot reload JSX (Suspense-based <T>) is active */\n private _devHotReloadJsx = false;\n\n constructor(config: BrowserI18nCacheParams) {\n // Must be initialized before super()\n const { htmlTagOptions, ...managerConfig } = config;\n const localStorageCaches: LocalStorageCachePromises = {};\n const i18nConfig = getI18nConfig();\n const devHotReloadEnabled =\n !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();\n const projectId = i18nConfig.getProjectId()!;\n const loadTranslations = devHotReloadEnabled\n ? wrapLoaderWithLocalStorage(\n config.loadTranslations!,\n projectId,\n localStorageCaches\n )\n : config.loadTranslations;\n\n // Initialize the I18nCache\n super({\n ...managerConfig,\n loadTranslations,\n });\n\n this._devHotReloadJsx = devHotReloadEnabled;\n\n this.htmlTagOptions = {\n ...DEFAULT_HTML_TAG_OPTIONS,\n ...htmlTagOptions,\n };\n\n // For dev hot reload, we need to write the translations to the localStorage cache\n if (devHotReloadEnabled) {\n this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {\n void getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n }).then((cache) => cache.write(hash, translation));\n };\n }\n }\n\n /**\n * Whether dev hot reload JSX (Suspense-based <T>) is active\n */\n isDevHotReloadJsx(): boolean {\n return this._devHotReloadJsx;\n }\n\n /**\n * Update the html tag (lang, dir)\n *\n * @deprecated, TODO: we should use a different system for managing this html tag\n * this should just be for managing translations\n */\n updateHtmlTag(\n locale: string,\n htmlTagOptions?: { lang?: string; dir?: 'ltr' | 'rtl' } & HtmlTagOptions\n ): void {\n // Get parameters\n const htmlLocale = htmlTagOptions?.lang || locale;\n const i18nConfig = getI18nConfig();\n const canonicalLocale = i18nConfig.resolveCanonicalLocale(htmlLocale);\n\n // Validate parameters\n if (!i18nConfig.isValidLocale(canonicalLocale)) {\n console.warn(createInvalidLocaleWarning(htmlLocale));\n return;\n }\n\n const localeDirection =\n htmlTagOptions?.dir || i18nConfig.getLocaleDirection(canonicalLocale);\n\n // Merge options\n const mergedHtmlTagOptions = {\n ...this.htmlTagOptions,\n ...htmlTagOptions,\n };\n\n // Update html tag\n if (mergedHtmlTagOptions.updateHtmlLangTag) {\n document.documentElement.lang = canonicalLocale;\n }\n if (mergedHtmlTagOptions.updateHtmlDirTag) {\n document.documentElement.dir = localeDirection;\n }\n }\n}\n\n// ===== Helper Functions ===== //\n\n/**\n * Wraps a translation loader to merge localStorage translations in dev mode.\n * On each call: runs the original loader, seeds a LocalStorageTranslationCache\n * with the result (loader wins over stale localStorage), and returns the merged\n * translations — preserving runtime tx() translations from previous sessions.\n *\n * TODO: this should be moved to wrapping in I18nStore\n */\nfunction wrapLoaderWithLocalStorage(\n originalLoader: TranslationsLoader,\n projectId: string,\n localStorageCaches: LocalStorageCachePromises\n) {\n return async (locale: string) => {\n const loaderTranslations = await originalLoader(locale);\n const cache = await getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n init: loaderTranslations as Record<string, Translation>,\n });\n return cache.getInternalCache();\n };\n}\n\nfunction getOrCreateLocalStorageCache(\n localStorageCaches: LocalStorageCachePromises,\n params: {\n locale: string;\n projectId: string;\n init?: Record<string, Translation>;\n }\n): Promise<LocalStorageTranslationCache> {\n // `||=` saves the first promise for this locale, so concurrent calls reuse one cache instance.\n return (localStorageCaches[params.locale] ||= loadLocalStorageCache().then(\n ({ LocalStorageTranslationCache }) =>\n new LocalStorageTranslationCache(params)\n ));\n}\n\nfunction loadLocalStorageCache() {\n return (localStorageCacheModulePromise ??=\n import('./LocalStorageTranslationCache'));\n}\n\nconst createInvalidLocaleWarning = (locale: string) =>\n createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Warning',\n whatHappened: `Locale \"${locale}\" is not valid`,\n fix: 'Use a valid BCP 47 locale code or add a custom mapping',\n });\n","import { getCookieValue as getCookieValueFromString } from 'gt-i18n/internal';\n\n/**\n * Minimally parses a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @returns The locale from the cookie or undefined if not found or invalid\n */\nexport function getCookieValue({\n cookieName,\n}: {\n cookieName: string;\n}): string | undefined {\n if (typeof document === 'undefined') return undefined;\n return getCookieValueFromString(document.cookie, cookieName);\n}\n\n/**\n * Sets a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @param value - The value to set\n * @returns The value that was set\n */\nexport function setCookieValue({\n cookieName,\n value,\n}: {\n cookieName: string;\n value: string;\n}): void {\n if (typeof document === 'undefined') return;\n document.cookie = `${cookieName}=${value};path=/`;\n}\n","import { getCookieValue } from './cookies';\n\nexport function readBrowserLocale(localeCookieName: string): string[] {\n const candidates = [];\n // (1) Check cookie\n\n const cookieLocale = getCookieValue({\n cookieName: localeCookieName,\n });\n if (cookieLocale) candidates.push(cookieLocale);\n\n // (2) Check navigator locales\n const navigatorLocales = navigator?.languages || [];\n candidates.push(...navigatorLocales);\n\n return candidates;\n}\n","import {\n defaultResetLocaleCookieName,\n getI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { WritableConditionStoreParams } from 'gt-i18n/internal';\nimport { getCookieValue, setCookieValue } from './cookies';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { GetEnableI18n, GetLocale, GetRegion } from '../i18n-cache/types';\nimport {\n LocaleCandidates,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\n\ntype SerializedBrowserConditionStoreState = {\n locale: string;\n region: string | undefined;\n enableI18n: boolean;\n};\nexport type ReloadType = (state: SerializedBrowserConditionStoreState) => void;\n\n/**\n * The configuration for the BrowserConditionStore\n * @param {GetLocale} getLocale - The function to get the locale\n */\nexport type BrowserConditionStoreParams = WritableConditionStoreParams & {\n _getLocale?: GetLocale;\n _getRegion?: GetRegion;\n _getEnableI18n?: GetEnableI18n;\n _reload?: ReloadType;\n};\n\n/**\n * Condition store implementation for Browser.\n */\nexport class BrowserConditionStore implements WritableConditionStoreInterface {\n private customReload: ReloadType;\n private customGetLocale?: GetLocale;\n private customGetRegion?: GetRegion;\n private customGetEnableI18n?: GetEnableI18n;\n\n constructor(config: BrowserConditionStoreParams) {\n const i18nConfig = getI18nConfig();\n this.customReload =\n config._reload ??\n (() =>\n typeof window !== 'undefined' ? window.location.reload() : undefined);\n this.customGetLocale = config._getLocale;\n this.customGetRegion = config._getRegion;\n this.customGetEnableI18n = config._getEnableI18n;\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(config.locale),\n });\n if (config.region !== undefined) {\n setCookieValue({\n cookieName: i18nConfig.getRegionCookieName(),\n value: config.region,\n });\n }\n this.updateEnableI18n(config.enableI18n ?? true);\n }\n\n getLocale = (): string => {\n return getBrowserLocale(this.customGetLocale);\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n this.updateLocale(locale);\n setCookieValue({\n cookieName: defaultResetLocaleCookieName,\n value: 'true',\n });\n this.reload();\n };\n\n getRegion = (): string | undefined => {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n if (cookieRegion) return cookieRegion;\n return this.customGetRegion?.();\n };\n\n setRegion = (region: string | undefined): void => {\n this.updateRegion(region);\n this.reload();\n };\n\n getEnableI18n = (): boolean => {\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return this.customGetEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n };\n\n setEnableI18n = (enableI18n: boolean): void => {\n this.updateEnableI18n(enableI18n);\n this.reload();\n };\n\n /**\n * Soft locale update\n */\n updateLocale = (locale: LocaleCandidates): void => {\n const i18nConfig = getI18nConfig();\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(locale),\n });\n };\n\n /**\n * Soft region update\n */\n updateRegion = (region: string | undefined): void => {\n setCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n value: region ?? '',\n });\n };\n\n /**\n * Soft enableI18n update\n */\n updateEnableI18n = (enableI18n: boolean): void => {\n setCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n value: enableI18n ? 'true' : 'false',\n });\n };\n\n /**\n * Condition store updates come from either the server or the client.\n * Trigger this reload when we update a value in the condition store from\n * the client.\n */\n reload = (): void => {\n const state = {\n locale: this.getLocale(),\n region: this.getRegion(),\n enableI18n: this.getEnableI18n(),\n };\n this.customReload(state);\n };\n}\n\nfunction getBrowserLocale(getLocale?: GetLocale): string {\n const i18nConfig = getI18nConfig();\n const candidates = readBrowserLocale(i18nConfig.getLocaleCookieName());\n if (getLocale) candidates.push(getLocale());\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n createConditionStoreSingleton,\n ReadonlyConditionStore,\n} from 'gt-i18n/internal';\nimport { BrowserConditionStore } from './BrowserConditionStore';\n\n// Both singletons below are typed views of the same global slot (namespace\n// 'i18n', key 'conditionStore'), so there is a single uninitialized state and\n// one message describes it for both getters.\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'the internal ConditionStore singleton is unavailable',\n fix: 'Call initializeGT() (or initializeGTSPA() in SPA apps) before rendering and add a <GTProvider> at the root of your component tree.',\n});\n\nexport const {\n setConditionStore: setReadonlyConditionStore,\n isConditionStoreInitialized: isReadonlyConditionStoreInitialized,\n} = createConditionStoreSingleton<ReadonlyConditionStore>(\n conditionStoreNotInitializedError\n);\n\nexport const {\n getConditionStore: getBrowserConditionStore,\n setConditionStore: setBrowserConditionStore,\n isConditionStoreInitialized: isBrowserConditionStoreInitialized,\n} = createConditionStoreSingleton<BrowserConditionStore>(\n conditionStoreNotInitializedError\n);\n","import type { LocaleCandidates } from 'gt-i18n/internal';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport {\n BrowserConditionStore,\n BrowserConditionStoreParams,\n} from './BrowserConditionStore';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { getCookieValue } from './cookies';\nimport {\n getBrowserConditionStore,\n isBrowserConditionStoreInitialized,\n setBrowserConditionStore,\n} from './singleton-operations';\n\nexport type CreateBrowserConditionStoreParams = Omit<\n BrowserConditionStoreParams,\n 'locale' | 'enableI18n'\n> & {\n locale?: LocaleCandidates;\n enableI18n?: boolean;\n};\n\n/**\n * Factory to create a BrowserConditionStore for Singleton\n *\n * This exists so we can keep the locale param as required in the constructor\n *\n * Server-provided props are the first candidates for hydration consistency.\n * Cookies fill in missing values to persist state across page reloads.\n *\n * Cookie names come from the I18nConfig singleton so custom names passed to\n * initializeGT() apply here without being threaded through provider props.\n */\nexport function createOrUpdateBrowserConditionStore(\n config: CreateBrowserConditionStoreParams\n) {\n const locale = determineLocale(config);\n const region = determineRegion(config);\n const enableI18n = determineEnableI18n(config);\n\n if (isBrowserConditionStoreInitialized()) {\n // This represents an update from server\n const conditionStore = getBrowserConditionStore();\n conditionStore.updateLocale(locale);\n if (region !== undefined) conditionStore.updateRegion(region);\n conditionStore.updateEnableI18n(enableI18n);\n return conditionStore;\n }\n\n const conditionStore = new BrowserConditionStore({\n ...config,\n locale,\n region,\n enableI18n,\n });\n setBrowserConditionStore(conditionStore);\n return conditionStore;\n}\n\nfunction determineLocale({\n _getLocale: getLocale,\n locale,\n}: CreateBrowserConditionStoreParams): string {\n const i18nConfig = getI18nConfig();\n const candidates = [];\n if (locale) {\n candidates.push(...(Array.isArray(locale) ? locale : [locale]));\n }\n if (getLocale) candidates.push(getLocale());\n candidates.push(...readBrowserLocale(i18nConfig.getLocaleCookieName()));\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n\nfunction determineRegion({\n _getRegion: getRegion,\n region,\n}: CreateBrowserConditionStoreParams): string | undefined {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n return cookieRegion || getRegion?.() || region;\n}\n\nfunction determineEnableI18n({\n enableI18n,\n _getEnableI18n: getEnableI18n,\n}: CreateBrowserConditionStoreParams): boolean {\n if (enableI18n !== undefined) return enableI18n;\n\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return getEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n}\n","import { getRuntimeEnvironment } from 'gt-i18n/internal';\nimport type { I18nConfigParams } from 'gt-i18n/internal/types';\n\ntype RuntimeCredentials = Pick<I18nConfigParams, 'projectId' | 'devApiKey'>;\ntype RuntimeEnv = {\n DEV?: boolean;\n VITE_GT_PROJECT_ID?: string;\n VITE_GT_DEV_API_KEY?: string;\n};\n\nexport function addRuntimeCredentials<T extends RuntimeCredentials>(\n config: T\n): T {\n const credentials = getRuntimeCredentials();\n return {\n ...config,\n projectId: config.projectId || credentials.projectId,\n devApiKey: config.devApiKey || credentials.devApiKey,\n };\n}\n\nfunction getRuntimeCredentials(): RuntimeCredentials {\n return {\n projectId:\n readImportMetaVite(\n () =>\n (\n import.meta as ImportMeta & {\n env?: RuntimeEnv;\n }\n ).env?.VITE_GT_PROJECT_ID\n ) || readProcessEnvViteProjectId(),\n devApiKey:\n getRuntimeEnvironment() === 'development'\n ? readImportMetaVite(() =>\n (import.meta as ImportMeta & { env?: RuntimeEnv }).env?.DEV\n ? (import.meta as ImportMeta & { env?: RuntimeEnv }).env\n ?.VITE_GT_DEV_API_KEY\n : undefined\n ) || readProcessEnvViteDevApiKey()\n : undefined,\n };\n}\n\nfunction readImportMetaVite(\n readValue: () => string | undefined\n): string | undefined {\n try {\n return normalizeEnvValue(readValue());\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteProjectId(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_PROJECT_ID);\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteDevApiKey(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_DEV_API_KEY);\n } catch {\n return undefined;\n }\n}\n\nfunction normalizeEnvValue(value: string | undefined): string | undefined {\n return value || undefined;\n}\n","import {\n getTranslationsSnapshot,\n I18nStore,\n setI18nStore,\n setReactI18nCache,\n getReadonlyConditionStore,\n initializeI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { I18nConfigParams } from '@generaltranslation/react-core/pure';\nimport { BrowserI18nCache } from '../i18n-cache/BrowserI18nCache';\nimport type { BrowserI18nCacheParams } from '../i18n-cache/BrowserI18nCache';\nimport {\n createOrUpdateBrowserConditionStore,\n CreateBrowserConditionStoreParams,\n} from '../condition-store/createBrowserConditionStore';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTSPAParams = I18nConfigParams &\n BrowserI18nCacheParams &\n CreateBrowserConditionStoreParams;\n\n/**\n * Initialize GT for an SPA\n * - i18nCache\n * - conditionStore\n * - i18nStore\n *\n * This is SPA for browser runtime\n */\nexport async function initializeGTSPA(config: InitializeGTSPAParams) {\n const runtimeConfig = addRuntimeCredentials(config);\n initializeI18nConfig(runtimeConfig, 'SPA');\n\n const i18nCache = new BrowserI18nCache(runtimeConfig);\n setReactI18nCache(i18nCache);\n\n createOrUpdateBrowserConditionStore(runtimeConfig);\n\n const i18nStore = new I18nStore();\n setI18nStore(i18nStore);\n\n // Block until translations are loaded\n await getTranslationsSnapshot(getReadonlyConditionStore().getLocale());\n}\n","import {\n internalInitializeGTSRA,\n type ReactInitializeGTParams,\n} from '@generaltranslation/react-core/pure';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTClientParams = ReactInitializeGTParams;\n\n/**\n * Initialize GT for client-side rendering.\n */\nexport function initializeGTSRAClient(config: InitializeGTClientParams): void {\n internalInitializeGTSRA(\n addRuntimeCredentials({\n cacheExpiryTime: null,\n ...config,\n })\n );\n}\n","import { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getCookieValue, parseAcceptLanguage } from 'gt-i18n/internal';\n\ntype RequestWithHeaders = Pick<Request, 'headers'>;\n\n/**\n * Resolve the user's locale from a Web Request.\n *\n * The configured locale cookie takes precedence over the Accept-Language\n * header. If neither contains a supported locale, the configured default\n * locale is returned.\n *\n * This is intended for incoming server requests. A Request created in the\n * browser does not automatically include document cookies or Accept-Language.\n */\nexport function parseLocale(request: RequestWithHeaders): string {\n const i18nConfig = getI18nConfig();\n const candidates: string[] = [];\n const cookieLocale = getCookieValue(\n request.headers.get('cookie'),\n i18nConfig.getLocaleCookieName()\n );\n\n if (cookieLocale) {\n candidates.push(cookieLocale);\n }\n\n candidates.push(\n ...parseAcceptLanguage(request.headers.get('accept-language'))\n );\n\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import {\n useInternalLocaleSelector,\n useSetLocale,\n} from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a locale selector.\n * Provides locale management utilities for the application.\n *\n * @param locales an optional list of locales to use for the drop down. These locales must be a subset of the locales provided by the `<GTProvider>` context. When not provided, the list of locales from the `<GTProvider>` context is used.\n *\n * @returns {Object} An object containing locale-related utilities:\n * @returns {string} return.locale - The currently selected locale.\n * @returns {string[]} return.locales - The list of all available locales.\n * @returns {function} return.setLocale - Function to update the current locale.\n * @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.\n */\nexport function useLocaleSelector(locales?: string[]) {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n","import {\n useInternalRegionSelector,\n useSetLocale,\n useSetRegion,\n} from '@generaltranslation/react-core/hooks';\nimport type { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a region selector.\n * Provides region management utilities for the application.\n *\n * @param {Object} [options] - Optional configuration object.\n * @param {string[]} [options.regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales.\n * @param {Object} [options.customMapping] - Optional mapping to override region display names, emojis, or associated locales.\n * @param {boolean} [options.prioritizeCurrentLocaleRegion=true] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [options.sortRegionsAlphabetically=true] - If true, regions are sorted alphabetically by display name.\n *\n * @returns {Object} An object containing region-related utilities:\n * @returns {string | undefined} return.region - The currently selected region code.\n * @returns {function} return.setRegion - Function to update the current region.\n * @returns {string[]} return.regions - The ordered list of available region codes.\n * @returns {Map<string, RegionData>} return.regionData - Map of region codes to their display data (name, emoji, locale).\n * @returns {string} return.locale - The current locale.\n * @returns {function} return.setLocale - Function to update the current locale.\n */\nexport function useRegionSelector(options?: InternalRegionSelectorOptions) {\n const setRegion = useSetRegion();\n const setLocale = useSetLocale();\n return { setRegion, setLocale, ...useInternalRegionSelector(options) };\n}\n","import type React from 'react';\nimport { InternalLocaleSelector } from '@generaltranslation/react-core/components';\nimport { CustomMapping } from 'generaltranslation/types';\nimport { useLocaleSelector } from './useLocaleSelector';\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string[]} [locales] - An optional list of locales to use for the dropdown. If not provided, the list of locales from the `<GTProvider>` context is used.\n * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.\n * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.\n * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.\n */\nexport function LocaleSelector({\n locales: _locales,\n ...props\n}: LocaleSelectorProps): React.JSX.Element | null {\n // Get locale selector properties\n const { locale, locales, getLocaleProperties, setLocale } =\n useLocaleSelector(_locales);\n\n return (\n <InternalLocaleSelector\n locale={locale}\n locales={locales}\n setLocale={setLocale}\n getLocaleProperties={getLocaleProperties}\n {...props}\n />\n );\n}\n\nexport type LocaleSelectorProps = {\n locales?: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n [key: string]: any;\n};\n","import type React from 'react';\nimport type { ReactNode } from 'react';\nimport { InternalRegionSelector } from '@generaltranslation/react-core/components';\nimport { useRegionSelector } from './useRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string[]} [regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from the supported locales in the `<GTProvider>` context.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @param {object} [customMapping] - An optional object to map region codes to custom display names, emojis, or associated locales.\n * @param {boolean} [prioritizeCurrentLocaleRegion] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [sortRegionsAlphabetically] - If true, regions are sorted alphabetically by display name.\n * @param {boolean} [asLocaleSelector=false] - If true, selecting a region will also update the locale to the region's associated locale.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @example\n * ```tsx\n * <RegionSelector\n * regions={['US', 'CA']}\n * customMapping={{ US: { name: \"United States\", emoji: \"🇺🇸\" } }}\n * placeholder=\"Select a region\"\n * />\n * ```\n */\nexport function RegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n asLocaleSelector = false,\n ...props\n}: RegionSelectorProps): React.JSX.Element | null {\n // Get region selector properties\n const { region, regions, regionData, locale, setRegion, setLocale } =\n useRegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n });\n\n const changeRegion = (region: string) => {\n if (asLocaleSelector) {\n const regionLocale = regionData.get(region)?.locale;\n // setRegion reloads the page; update the locale cookie first\n if (regionLocale && locale !== regionLocale) setLocale(regionLocale);\n }\n setRegion(region);\n };\n\n return (\n <InternalRegionSelector\n region={region}\n regions={regions}\n regionData={regionData}\n setRegion={changeRegion}\n {...props}\n />\n );\n}\n\nexport type RegionSelectorProps = {\n regions?: string[];\n placeholder?: ReactNode;\n customMapping?: {\n [region: string]:\n | string\n | { name?: string; emoji?: string; locale?: string };\n };\n prioritizeCurrentLocaleRegion?: boolean;\n sortRegionsAlphabetically?: boolean;\n asLocaleSelector?: boolean;\n [key: string]: any;\n};\n","import {\n I18nStore,\n InternalGTProvider,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { SharedGTProviderProps } from './GTProviderProps';\nimport { createOrUpdateBrowserConditionStore } from '../condition-store/createBrowserConditionStore';\n\n/**\n * Consumes snapshot from server\n * Implementation for client-side only\n */\nexport function BrowserGTProvider(props: SharedGTProviderProps) {\n const conditionStore = useMemo(() => {\n return createOrUpdateBrowserConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { TxProps } from './utils/TxProps';\n\nexport { initializeGTSPA } from './setup/initializeGTSPA';\nexport { initializeGTSRAClient as initializeGT } from './setup/initializeGTSRAClient';\nexport { createOrUpdateBrowserConditionStore } from './condition-store/createBrowserConditionStore';\nexport { parseLocale } from './functions/parseLocale';\nexport { useLocaleSelector } from './components/useLocaleSelector';\nexport { useRegionSelector } from './components/useRegionSelector';\n\n// ===== Components ===== //\nexport { LocaleSelector } from './components/LocaleSelector';\nexport { RegionSelector } from './components/RegionSelector';\nexport { BrowserGTProvider as GTProvider } from './provider/BrowserGTProvider';\n\n// ===== Components ===== //\nexport {\n Branch,\n Plural,\n Derive,\n GtInternalTranslateJsx,\n GtInternalVar,\n T,\n Currency,\n DateTime,\n RelativeTime,\n Var,\n Num,\n} from '@generaltranslation/react-core/components';\n\nexport async function Tx(_props: TxProps): Promise<ReactNode> {\n throw new Error('Tx is only supported via RSC');\n}\n\n// ===== Hooks ===== //\nexport {\n useLocale,\n useRegion,\n useCustomMapping,\n useDefaultLocale,\n useEnableI18n,\n useLocales,\n useFormatLocales,\n useGT,\n useMessages,\n useTranslations,\n useLocaleDirection,\n useLocaleProperties,\n useSetLocale,\n useSetRegion,\n useSetEnableI18n,\n} from '@generaltranslation/react-core/hooks';\n\n// ===== Functions ===== //\nexport {\n msg,\n decodeMsg,\n decodeOptions,\n derive,\n declareVar,\n decodeVars,\n mFallback,\n gtFallback,\n getFormatLocales,\n getDefaultLocale,\n getLocaleProperties,\n getLocales,\n resolveCanonicalLocale,\n getReactI18nCache,\n getTranslationsSnapshot,\n getVersionId,\n createRenderPipeline,\n setReactI18nCache,\n t,\n} from '@generaltranslation/react-core/pure';\n\nexport type {\n RenderPipeline,\n RenderPreparedT,\n} from '@generaltranslation/react-core/pure';\n\nexport type { SharedGTProviderProps } from './provider/GTProviderProps';\nexport {\n GtInternalRuntimeTranslateJsx,\n GtInternalRuntimeTranslateString,\n} from 'gt-i18n/internal';\nexport type {\n GTTranslationOptions,\n RuntimeTranslationOptions,\n} from 'gt-i18n/types';\nexport type {\n SyncResolutionFunction,\n SyncResolutionFunctionWithFallback,\n} from 'gt-i18n/types';\n\n// ===== Singletons ===== //\nexport {\n ReactI18nCache,\n type ReactI18nCacheParams,\n} from '@generaltranslation/react-core/pure';\n"],"mappings":";;;;;;;;;AAEA,MAAa,2BAA2C;CACtD,mBAAmB;CACnB,kBAAkB;CACnB;;;ACAD,SAAS,eAAe,MAAM;CAC7B,MAAM,UAAU,KAAK,MAAM;AAC3B,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG,QAAQ;;AAEvD,SAAS,cAAc,MAAM;CAC5B,MAAM,UAAU,KAAK,MAAM;CAC3B,IAAI,MAAM,QAAQ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vC,MAAI,kBAAkB;GACpB,MAAM,eAAe,WAAW,IAAI,OAAO,EAAE;AAE7C,OAAI,gBAAgB,WAAW,aAAc,WAAU,aAAa;;AAEtE,YAAU,OAAO;;AAGnB,QACE,iBAAA,GAAA,kBAAA,KAACC,0CAAAA,wBAAD;EACU;EACC;EACG;EACZ,WAAW;EACX,GAAI;EACJ,CAAA;;;;;;;;AC7CN,SAAgB,kBAAkB,OAA8B;CAC9D,MAAM,kBAAA,GAAA,MAAA,eAA+B;AACnC,SAAO,oCAAoC,MAAM;IAChD;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,gBAAA,GAAA,MAAA,QAAwC,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAIC,0CAAAA,WAAW;AAGxC,QACE,iBAAA,GAAA,kBAAA,KAACC,0CAAAA,oBAAD;EACE,GAAI;EACY;EAChB,WAAW,aAAa;EACxB,CAAA;;;;ACKN,eAAsB,GAAG,QAAqC;AAC5D,OAAM,IAAI,MAAM,+BAA+B"}
|
|
1
|
+
{"version":3,"file":"index.client.cjs","names":["I18nCache","getCookieValue","getCookieValue","defaultResetLocaleCookieName","getCookieValue","getCookieValue","I18nStore","InternalLocaleSelector","InternalRegionSelector","I18nStore","InternalGTProvider"],"sources":["../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/cookies.ts","../src/condition-store/readBrowserLocale.ts","../src/condition-store/BrowserConditionStore.ts","../../core/dist/api-rqq7klYe.mjs","../src/condition-store/singleton-operations.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/runtimeCredentials.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"sourcesContent":["import type {\n I18nCacheConstructorParams,\n TranslationsLoader,\n} from 'gt-i18n/internal/types';\nimport { getI18nConfig, I18nCache } from 'gt-i18n/internal';\nimport type { HtmlTagOptions } from './types';\nimport type { Translation } from 'gt-i18n/types';\n\ntype LocalStorageTranslationCache =\n import('./LocalStorageTranslationCache').LocalStorageTranslationCache;\ntype LocalStorageCachePromises = Record<\n string,\n Promise<LocalStorageTranslationCache>\n>;\n\n// Lazily import the development-only cache so bundlers can keep it out of the initial client chunk.\n// `??=` saves the first import promise, so all cache instances reuse the same lazy module load.\nlet localStorageCacheModulePromise:\n | Promise<typeof import('./LocalStorageTranslationCache')>\n | undefined;\n\n/**\n * The configuration for the BrowserI18nCache\n */\nexport type BrowserI18nCacheParams = I18nCacheConstructorParams & {\n htmlTagOptions?: HtmlTagOptions;\n};\n\n/**\n * I18nCache implementation for Browser.\n */\nexport class BrowserI18nCache extends I18nCache<Translation> {\n /** Whether dev hot reload JSX (Suspense-based <T>) is active */\n private _devHotReloadJsx = false;\n\n constructor(config: BrowserI18nCacheParams) {\n // Must be initialized before super()\n // Keep accepting htmlTagOptions without passing it to the translation cache.\n const { htmlTagOptions: _htmlTagOptions, ...managerConfig } = config;\n const localStorageCaches: LocalStorageCachePromises = {};\n const i18nConfig = getI18nConfig();\n const devHotReloadEnabled =\n !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();\n const projectId = i18nConfig.getProjectId()!;\n const loadTranslations = devHotReloadEnabled\n ? wrapLoaderWithLocalStorage(\n config.loadTranslations!,\n projectId,\n localStorageCaches\n )\n : config.loadTranslations;\n\n // Initialize the I18nCache\n super({\n ...managerConfig,\n loadTranslations,\n });\n\n this._devHotReloadJsx = devHotReloadEnabled;\n\n // For dev hot reload, we need to write the translations to the localStorage cache\n if (devHotReloadEnabled) {\n this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {\n void getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n }).then((cache) => cache.write(hash, translation));\n };\n }\n }\n\n /**\n * Whether dev hot reload JSX (Suspense-based <T>) is active\n */\n isDevHotReloadJsx(): boolean {\n return this._devHotReloadJsx;\n }\n}\n\n// ===== Helper Functions ===== //\n\n/**\n * Wraps a translation loader to merge localStorage translations in dev mode.\n * On each call: runs the original loader, seeds a LocalStorageTranslationCache\n * with the result (loader wins over stale localStorage), and returns the merged\n * translations — preserving runtime tx() translations from previous sessions.\n *\n * TODO: this should be moved to wrapping in I18nStore\n */\nfunction wrapLoaderWithLocalStorage(\n originalLoader: TranslationsLoader,\n projectId: string,\n localStorageCaches: LocalStorageCachePromises\n) {\n return async (locale: string) => {\n const loaderTranslations = await originalLoader(locale);\n const cache = await getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n init: loaderTranslations as Record<string, Translation>,\n });\n return cache.getInternalCache();\n };\n}\nfunction getOrCreateLocalStorageCache(\n localStorageCaches: LocalStorageCachePromises,\n params: {\n locale: string;\n projectId: string;\n init?: Record<string, Translation>;\n }\n): Promise<LocalStorageTranslationCache> {\n // `||=` saves the first promise for this locale, so concurrent calls reuse one cache instance.\n return (localStorageCaches[params.locale] ||= loadLocalStorageCache().then(\n ({ LocalStorageTranslationCache }) =>\n new LocalStorageTranslationCache(params)\n ));\n}\n\nfunction loadLocalStorageCache() {\n return (localStorageCacheModulePromise ??=\n import('./LocalStorageTranslationCache'));\n}\n","import { getCookieValue as getCookieValueFromString } from 'gt-i18n/internal';\n\n/**\n * Minimally parses a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @returns The locale from the cookie or undefined if not found or invalid\n */\nexport function getCookieValue({\n cookieName,\n}: {\n cookieName: string;\n}): string | undefined {\n if (typeof document === 'undefined') return undefined;\n return getCookieValueFromString(document.cookie, cookieName);\n}\n\n/**\n * Sets a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @param value - The value to set\n * @returns The value that was set\n */\nexport function setCookieValue({\n cookieName,\n value,\n}: {\n cookieName: string;\n value: string;\n}): void {\n if (typeof document === 'undefined') return;\n document.cookie = `${cookieName}=${value};path=/`;\n}\n","import { getCookieValue } from './cookies';\n\nexport function readBrowserLocale(localeCookieName: string): string[] {\n const candidates = [];\n // (1) Check cookie\n\n const cookieLocale = getCookieValue({\n cookieName: localeCookieName,\n });\n if (cookieLocale) candidates.push(cookieLocale);\n\n // (2) Check navigator locales\n const navigatorLocales = navigator?.languages || [];\n candidates.push(...navigatorLocales);\n\n return candidates;\n}\n","import {\n defaultResetLocaleCookieName,\n getI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { WritableConditionStoreParams } from 'gt-i18n/internal';\nimport { getCookieValue, setCookieValue } from './cookies';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { GetEnableI18n, GetLocale, GetRegion } from '../i18n-cache/types';\nimport {\n LocaleCandidates,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\n\ntype SerializedBrowserConditionStoreState = {\n locale: string;\n region: string | undefined;\n enableI18n: boolean;\n};\nexport type ReloadType = (state: SerializedBrowserConditionStoreState) => void;\n\n/**\n * The configuration for the BrowserConditionStore\n * @param {GetLocale} getLocale - The function to get the locale\n */\nexport type BrowserConditionStoreParams = WritableConditionStoreParams & {\n _getLocale?: GetLocale;\n _getRegion?: GetRegion;\n _getEnableI18n?: GetEnableI18n;\n _reload?: ReloadType;\n};\n\n/**\n * Condition store implementation for Browser.\n */\nexport class BrowserConditionStore implements WritableConditionStoreInterface {\n private customReload: ReloadType;\n private customGetLocale?: GetLocale;\n private customGetRegion?: GetRegion;\n private customGetEnableI18n?: GetEnableI18n;\n\n constructor(config: BrowserConditionStoreParams) {\n const i18nConfig = getI18nConfig();\n this.customReload =\n config._reload ??\n (() =>\n typeof window !== 'undefined' ? window.location.reload() : undefined);\n this.customGetLocale = config._getLocale;\n this.customGetRegion = config._getRegion;\n this.customGetEnableI18n = config._getEnableI18n;\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(config.locale),\n });\n if (config.region !== undefined) {\n setCookieValue({\n cookieName: i18nConfig.getRegionCookieName(),\n value: config.region,\n });\n }\n this.updateEnableI18n(config.enableI18n ?? true);\n }\n\n getLocale = (): string => {\n return getBrowserLocale(this.customGetLocale);\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n this.updateLocale(locale);\n setCookieValue({\n cookieName: defaultResetLocaleCookieName,\n value: 'true',\n });\n this.reload();\n };\n\n getRegion = (): string | undefined => {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n if (cookieRegion) return cookieRegion;\n return this.customGetRegion?.();\n };\n\n setRegion = (region: string | undefined): void => {\n this.updateRegion(region);\n this.reload();\n };\n\n getEnableI18n = (): boolean => {\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return this.customGetEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n };\n\n setEnableI18n = (enableI18n: boolean): void => {\n this.updateEnableI18n(enableI18n);\n this.reload();\n };\n\n /**\n * Soft locale update\n */\n updateLocale = (locale: LocaleCandidates): void => {\n const i18nConfig = getI18nConfig();\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(locale),\n });\n };\n\n /**\n * Soft region update\n */\n updateRegion = (region: string | undefined): void => {\n setCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n value: region ?? '',\n });\n };\n\n /**\n * Soft enableI18n update\n */\n updateEnableI18n = (enableI18n: boolean): void => {\n setCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n value: enableI18n ? 'true' : 'false',\n });\n };\n\n /**\n * Condition store updates come from either the server or the client.\n * Trigger this reload when we update a value in the condition store from\n * the client.\n */\n reload = (): void => {\n const state = {\n locale: this.getLocale(),\n region: this.getRegion(),\n enableI18n: this.getEnableI18n(),\n };\n this.customReload(state);\n };\n}\n\nfunction getBrowserLocale(getLocale?: GetLocale): string {\n const i18nConfig = getI18nConfig();\n const candidates = readBrowserLocale(i18nConfig.getLocaleCookieName());\n if (getLocale) candidates.push(getLocale());\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","//#region src/settings/settings.ts\nconst libraryDefaultLocale = \"en\";\nconst defaultTimeout = 6e4;\n//#endregion\n//#region src/logging/diagnostics.ts\nfunction ensureSentence(text) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return \"\";\n\treturn /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\nfunction stripSentence(text) {\n\tconst trimmed = text.trim();\n\tlet end = trimmed.length;\n\twhile (end > 0) {\n\t\tconst char = trimmed[end - 1];\n\t\tif (char !== \".\" && char !== \"!\" && char !== \"?\") break;\n\t\tend -= 1;\n\t}\n\treturn trimmed.slice(0, end);\n}\nfunction formatDetails(details) {\n\tif (!details) return \"\";\n\tconst detailText = Array.isArray(details) ? details.join(\", \") : details;\n\tif (!detailText.trim()) return \"\";\n\treturn ensureSentence(`Details: ${detailText}`);\n}\nfunction formatDiagnosticErrorDetails(error) {\n\tif (error == null) return void 0;\n\treturn String(error);\n}\nfunction createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {\n\tconst prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : \"\";\n\tconst whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;\n\tconst shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n\tconst messageParts = [\n\t\twhatAndWhy,\n\t\treassurance,\n\t\tshouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,\n\t\tshouldCombineWayOut ? void 0 : wayOut,\n\t\tformatDetails(details)\n\t].filter((part) => !!part).map(ensureSentence);\n\tif (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);\n\tconst message = messageParts.join(\" \");\n\treturn prefix ? `${prefix} ${message}` : message;\n}\n//#endregion\n//#region src/settings/settingsUrls.ts\nconst defaultCacheUrl = \"https://cdn.gtx.dev\";\nconst defaultBaseUrl = \"https://api2.gtx.dev\";\nconst defaultRuntimeApiUrl = \"https://runtime2.gtx.dev\";\n//#endregion\n//#region src/translate/api.ts\nconst API_VERSION = \"2026-03-06.v1\";\n//#endregion\nexport { createDiagnosticMessage as a, libraryDefaultLocale as c, defaultRuntimeApiUrl as i, defaultBaseUrl as n, formatDiagnosticErrorDetails as o, defaultCacheUrl as r, defaultTimeout as s, API_VERSION as t };\n\n//# sourceMappingURL=api-rqq7klYe.mjs.map","import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n createConditionStoreSingleton,\n ReadonlyConditionStore,\n} from 'gt-i18n/internal';\nimport { BrowserConditionStore } from './BrowserConditionStore';\n\n// Both singletons below are typed views of the same global slot (namespace\n// 'i18n', key 'conditionStore'), so there is a single uninitialized state and\n// one message describes it for both getters.\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'the internal ConditionStore singleton is unavailable',\n fix: 'Call initializeGT() (or initializeGTSPA() in SPA apps) before rendering and add a <GTProvider> at the root of your component tree.',\n});\n\nexport const {\n setConditionStore: setReadonlyConditionStore,\n isConditionStoreInitialized: isReadonlyConditionStoreInitialized,\n} = createConditionStoreSingleton<ReadonlyConditionStore>(\n conditionStoreNotInitializedError\n);\n\nexport const {\n getConditionStore: getBrowserConditionStore,\n setConditionStore: setBrowserConditionStore,\n isConditionStoreInitialized: isBrowserConditionStoreInitialized,\n} = createConditionStoreSingleton<BrowserConditionStore>(\n conditionStoreNotInitializedError\n);\n","import type { LocaleCandidates } from 'gt-i18n/internal';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport {\n BrowserConditionStore,\n BrowserConditionStoreParams,\n} from './BrowserConditionStore';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { getCookieValue } from './cookies';\nimport {\n getBrowserConditionStore,\n isBrowserConditionStoreInitialized,\n setBrowserConditionStore,\n} from './singleton-operations';\n\nexport type CreateBrowserConditionStoreParams = Omit<\n BrowserConditionStoreParams,\n 'locale' | 'enableI18n'\n> & {\n locale?: LocaleCandidates;\n enableI18n?: boolean;\n};\n\n/**\n * Factory to create a BrowserConditionStore for Singleton\n *\n * This exists so we can keep the locale param as required in the constructor\n *\n * Server-provided props are the first candidates for hydration consistency.\n * Cookies fill in missing values to persist state across page reloads.\n *\n * Cookie names come from the I18nConfig singleton so custom names passed to\n * initializeGT() apply here without being threaded through provider props.\n */\nexport function createOrUpdateBrowserConditionStore(\n config: CreateBrowserConditionStoreParams\n) {\n const locale = determineLocale(config);\n const region = determineRegion(config);\n const enableI18n = determineEnableI18n(config);\n\n if (isBrowserConditionStoreInitialized()) {\n // This represents an update from server\n const conditionStore = getBrowserConditionStore();\n conditionStore.updateLocale(locale);\n if (region !== undefined) conditionStore.updateRegion(region);\n conditionStore.updateEnableI18n(enableI18n);\n return conditionStore;\n }\n\n const conditionStore = new BrowserConditionStore({\n ...config,\n locale,\n region,\n enableI18n,\n });\n setBrowserConditionStore(conditionStore);\n return conditionStore;\n}\n\nfunction determineLocale({\n _getLocale: getLocale,\n locale,\n}: CreateBrowserConditionStoreParams): string {\n const i18nConfig = getI18nConfig();\n const candidates = [];\n if (locale) {\n candidates.push(...(Array.isArray(locale) ? locale : [locale]));\n }\n if (getLocale) candidates.push(getLocale());\n candidates.push(...readBrowserLocale(i18nConfig.getLocaleCookieName()));\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n\nfunction determineRegion({\n _getRegion: getRegion,\n region,\n}: CreateBrowserConditionStoreParams): string | undefined {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n return cookieRegion || getRegion?.() || region;\n}\n\nfunction determineEnableI18n({\n enableI18n,\n _getEnableI18n: getEnableI18n,\n}: CreateBrowserConditionStoreParams): boolean {\n if (enableI18n !== undefined) return enableI18n;\n\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return getEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n}\n","import { getRuntimeEnvironment } from 'gt-i18n/internal';\nimport type { I18nConfigParams } from 'gt-i18n/internal/types';\n\ntype RuntimeCredentials = Pick<I18nConfigParams, 'projectId' | 'devApiKey'>;\ntype RuntimeEnv = {\n DEV?: boolean;\n VITE_GT_PROJECT_ID?: string;\n VITE_GT_DEV_API_KEY?: string;\n};\n\nexport function addRuntimeCredentials<T extends RuntimeCredentials>(\n config: T\n): T {\n const credentials = getRuntimeCredentials();\n return {\n ...config,\n projectId: config.projectId || credentials.projectId,\n devApiKey: config.devApiKey || credentials.devApiKey,\n };\n}\n\nfunction getRuntimeCredentials(): RuntimeCredentials {\n return {\n projectId:\n readImportMetaVite(\n () =>\n (\n import.meta as ImportMeta & {\n env?: RuntimeEnv;\n }\n ).env?.VITE_GT_PROJECT_ID\n ) || readProcessEnvViteProjectId(),\n devApiKey:\n getRuntimeEnvironment() === 'development'\n ? readImportMetaVite(() =>\n (import.meta as ImportMeta & { env?: RuntimeEnv }).env?.DEV\n ? (import.meta as ImportMeta & { env?: RuntimeEnv }).env\n ?.VITE_GT_DEV_API_KEY\n : undefined\n ) || readProcessEnvViteDevApiKey()\n : undefined,\n };\n}\n\nfunction readImportMetaVite(\n readValue: () => string | undefined\n): string | undefined {\n try {\n return normalizeEnvValue(readValue());\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteProjectId(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_PROJECT_ID);\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteDevApiKey(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_DEV_API_KEY);\n } catch {\n return undefined;\n }\n}\n\nfunction normalizeEnvValue(value: string | undefined): string | undefined {\n return value || undefined;\n}\n","import {\n getTranslationsSnapshot,\n I18nStore,\n setI18nStore,\n setReactI18nCache,\n getReadonlyConditionStore,\n initializeI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { I18nConfigParams } from '@generaltranslation/react-core/pure';\nimport { BrowserI18nCache } from '../i18n-cache/BrowserI18nCache';\nimport type { BrowserI18nCacheParams } from '../i18n-cache/BrowserI18nCache';\nimport {\n createOrUpdateBrowserConditionStore,\n CreateBrowserConditionStoreParams,\n} from '../condition-store/createBrowserConditionStore';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTSPAParams = I18nConfigParams &\n BrowserI18nCacheParams &\n CreateBrowserConditionStoreParams;\n\n/**\n * Initialize GT for an SPA\n * - i18nCache\n * - conditionStore\n * - i18nStore\n *\n * This is SPA for browser runtime\n */\nexport async function initializeGTSPA(config: InitializeGTSPAParams) {\n const runtimeConfig = addRuntimeCredentials(config);\n initializeI18nConfig(runtimeConfig, 'SPA');\n\n const i18nCache = new BrowserI18nCache(runtimeConfig);\n setReactI18nCache(i18nCache);\n\n createOrUpdateBrowserConditionStore(runtimeConfig);\n\n const i18nStore = new I18nStore();\n setI18nStore(i18nStore);\n\n // Block until translations are loaded\n await getTranslationsSnapshot(getReadonlyConditionStore().getLocale());\n}\n","import {\n internalInitializeGTSRA,\n type ReactInitializeGTParams,\n} from '@generaltranslation/react-core/pure';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTClientParams = ReactInitializeGTParams;\n\n/**\n * Initialize GT for client-side rendering.\n */\nexport function initializeGTSRAClient(config: InitializeGTClientParams): void {\n internalInitializeGTSRA(\n addRuntimeCredentials({\n cacheExpiryTime: null,\n ...config,\n })\n );\n}\n","import { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getCookieValue, parseAcceptLanguage } from 'gt-i18n/internal';\n\ntype RequestWithHeaders = Pick<Request, 'headers'>;\n\n/**\n * Resolve the user's locale from a Web Request.\n *\n * The configured locale cookie takes precedence over the Accept-Language\n * header. If neither contains a supported locale, the configured default\n * locale is returned.\n *\n * This is intended for incoming server requests. A Request created in the\n * browser does not automatically include document cookies or Accept-Language.\n */\nexport function parseLocale(request: RequestWithHeaders): string {\n const i18nConfig = getI18nConfig();\n const candidates: string[] = [];\n const cookieLocale = getCookieValue(\n request.headers.get('cookie'),\n i18nConfig.getLocaleCookieName()\n );\n\n if (cookieLocale) {\n candidates.push(cookieLocale);\n }\n\n candidates.push(\n ...parseAcceptLanguage(request.headers.get('accept-language'))\n );\n\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import {\n useInternalLocaleSelector,\n useSetLocale,\n} from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a locale selector.\n * Provides locale management utilities for the application.\n *\n * @param locales an optional list of locales to use for the drop down. These locales must be a subset of the locales provided by the `<GTProvider>` context. When not provided, the list of locales from the `<GTProvider>` context is used.\n *\n * @returns {Object} An object containing locale-related utilities:\n * @returns {string} return.locale - The currently selected locale.\n * @returns {string[]} return.locales - The list of all available locales.\n * @returns {function} return.setLocale - Function to update the current locale.\n * @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.\n */\nexport function useLocaleSelector(locales?: string[]) {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n","import {\n useInternalRegionSelector,\n useSetLocale,\n useSetRegion,\n} from '@generaltranslation/react-core/hooks';\nimport type { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a region selector.\n * Provides region management utilities for the application.\n *\n * @param {Object} [options] - Optional configuration object.\n * @param {string[]} [options.regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales.\n * @param {Object} [options.customMapping] - Optional mapping to override region display names, emojis, or associated locales.\n * @param {boolean} [options.prioritizeCurrentLocaleRegion=true] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [options.sortRegionsAlphabetically=true] - If true, regions are sorted alphabetically by display name.\n *\n * @returns {Object} An object containing region-related utilities:\n * @returns {string | undefined} return.region - The currently selected region code.\n * @returns {function} return.setRegion - Function to update the current region.\n * @returns {string[]} return.regions - The ordered list of available region codes.\n * @returns {Map<string, RegionData>} return.regionData - Map of region codes to their display data (name, emoji, locale).\n * @returns {string} return.locale - The current locale.\n * @returns {function} return.setLocale - Function to update the current locale.\n */\nexport function useRegionSelector(options?: InternalRegionSelectorOptions) {\n const setRegion = useSetRegion();\n const setLocale = useSetLocale();\n return { setRegion, setLocale, ...useInternalRegionSelector(options) };\n}\n","import type React from 'react';\nimport { InternalLocaleSelector } from '@generaltranslation/react-core/components';\nimport { CustomMapping } from 'generaltranslation/types';\nimport { useLocaleSelector } from './useLocaleSelector';\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string[]} [locales] - An optional list of locales to use for the dropdown. If not provided, the list of locales from the `<GTProvider>` context is used.\n * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.\n * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.\n * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.\n */\nexport function LocaleSelector({\n locales: _locales,\n ...props\n}: LocaleSelectorProps): React.JSX.Element | null {\n // Get locale selector properties\n const { locale, locales, getLocaleProperties, setLocale } =\n useLocaleSelector(_locales);\n\n return (\n <InternalLocaleSelector\n locale={locale}\n locales={locales}\n setLocale={setLocale}\n getLocaleProperties={getLocaleProperties}\n {...props}\n />\n );\n}\n\nexport type LocaleSelectorProps = {\n locales?: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n [key: string]: any;\n};\n","import type React from 'react';\nimport type { ReactNode } from 'react';\nimport { InternalRegionSelector } from '@generaltranslation/react-core/components';\nimport { useRegionSelector } from './useRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string[]} [regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from the supported locales in the `<GTProvider>` context.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @param {object} [customMapping] - An optional object to map region codes to custom display names, emojis, or associated locales.\n * @param {boolean} [prioritizeCurrentLocaleRegion] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [sortRegionsAlphabetically] - If true, regions are sorted alphabetically by display name.\n * @param {boolean} [asLocaleSelector=false] - If true, selecting a region will also update the locale to the region's associated locale.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @example\n * ```tsx\n * <RegionSelector\n * regions={['US', 'CA']}\n * customMapping={{ US: { name: \"United States\", emoji: \"🇺🇸\" } }}\n * placeholder=\"Select a region\"\n * />\n * ```\n */\nexport function RegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n asLocaleSelector = false,\n ...props\n}: RegionSelectorProps): React.JSX.Element | null {\n // Get region selector properties\n const { region, regions, regionData, locale, setRegion, setLocale } =\n useRegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n });\n\n const changeRegion = (region: string) => {\n if (asLocaleSelector) {\n const regionLocale = regionData.get(region)?.locale;\n // setRegion reloads the page; update the locale cookie first\n if (regionLocale && locale !== regionLocale) setLocale(regionLocale);\n }\n setRegion(region);\n };\n\n return (\n <InternalRegionSelector\n region={region}\n regions={regions}\n regionData={regionData}\n setRegion={changeRegion}\n {...props}\n />\n );\n}\n\nexport type RegionSelectorProps = {\n regions?: string[];\n placeholder?: ReactNode;\n customMapping?: {\n [region: string]:\n | string\n | { name?: string; emoji?: string; locale?: string };\n };\n prioritizeCurrentLocaleRegion?: boolean;\n sortRegionsAlphabetically?: boolean;\n asLocaleSelector?: boolean;\n [key: string]: any;\n};\n","import {\n I18nStore,\n InternalGTProvider,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { SharedGTProviderProps } from './GTProviderProps';\nimport { createOrUpdateBrowserConditionStore } from '../condition-store/createBrowserConditionStore';\n\n/**\n * Consumes snapshot from server\n * Implementation for client-side only\n */\nexport function BrowserGTProvider(props: SharedGTProviderProps) {\n const conditionStore = useMemo(() => {\n return createOrUpdateBrowserConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { TxProps } from './utils/TxProps';\n\nexport { initializeGTSPA } from './setup/initializeGTSPA';\nexport { initializeGTSRAClient as initializeGT } from './setup/initializeGTSRAClient';\nexport { createOrUpdateBrowserConditionStore } from './condition-store/createBrowserConditionStore';\nexport { parseLocale } from './functions/parseLocale';\nexport { useLocaleSelector } from './components/useLocaleSelector';\nexport { useRegionSelector } from './components/useRegionSelector';\n\n// ===== Components ===== //\nexport { LocaleSelector } from './components/LocaleSelector';\nexport { RegionSelector } from './components/RegionSelector';\nexport { BrowserGTProvider as GTProvider } from './provider/BrowserGTProvider';\n\n// ===== Components ===== //\nexport {\n Branch,\n Plural,\n Derive,\n GtInternalTranslateJsx,\n GtInternalVar,\n T,\n Currency,\n DateTime,\n RelativeTime,\n Var,\n Num,\n} from '@generaltranslation/react-core/components';\n\nexport async function Tx(_props: TxProps): Promise<ReactNode> {\n throw new Error('Tx is only supported via RSC');\n}\n\n// ===== Hooks ===== //\nexport {\n useLocale,\n useRegion,\n useCustomMapping,\n useDefaultLocale,\n useEnableI18n,\n useLocales,\n useFormatLocales,\n useGT,\n useMessages,\n useTranslations,\n useLocaleDirection,\n useLocaleProperties,\n useSetLocale,\n useSetRegion,\n useSetEnableI18n,\n} from '@generaltranslation/react-core/hooks';\n\n// ===== Functions ===== //\nexport {\n msg,\n decodeMsg,\n decodeOptions,\n derive,\n declareVar,\n decodeVars,\n mFallback,\n gtFallback,\n getFormatLocales,\n getDefaultLocale,\n getLocaleProperties,\n getLocales,\n resolveCanonicalLocale,\n getReactI18nCache,\n getTranslationsSnapshot,\n getVersionId,\n createRenderPipeline,\n setReactI18nCache,\n t,\n} from '@generaltranslation/react-core/pure';\n\nexport type {\n RenderPipeline,\n RenderPreparedT,\n} from '@generaltranslation/react-core/pure';\n\nexport type { SharedGTProviderProps } from './provider/GTProviderProps';\nexport {\n GtInternalRuntimeTranslateJsx,\n GtInternalRuntimeTranslateString,\n} from 'gt-i18n/internal';\nexport type {\n GTTranslationOptions,\n RuntimeTranslationOptions,\n} from 'gt-i18n/types';\nexport type {\n SyncResolutionFunction,\n SyncResolutionFunctionWithFallback,\n} from 'gt-i18n/types';\n\n// ===== Singletons ===== //\nexport {\n ReactI18nCache,\n type ReactI18nCacheParams,\n} from '@generaltranslation/react-core/pure';\n"],"mappings":";;;;;;;;;AAiBA,IAAI;;;;AAcJ,IAAa,mBAAb,cAAsCA,iBAAAA,UAAuB;CAI3D,YAAY,QAAgC;EAG1C,MAAM,EAAE,gBAAgB,iBAAiB,GAAG,kBAAkB;EAC9D,MAAM,qBAAgD,EAAE;EACxD,MAAM,cAAA,GAAA,iBAAA,gBAA4B;EAClC,MAAM,sBACJ,CAAC,CAAC,OAAO,oBAAoB,WAAW,uBAAuB;EACjE,MAAM,YAAY,WAAW,cAAc;EAC3C,MAAM,mBAAmB,sBACrB,2BACE,OAAO,kBACP,WACA,mBACD,GACD,OAAO;AAGX,QAAM;GACJ,GAAG;GACH;GACD,CAAC;0BAvBuB;AAyBzB,OAAK,mBAAmB;AAGxB,MAAI,oBACF,MAAK,2BAA2B,EAAE,QAAQ,MAAM,kBAAkB;AAC3D,gCAA6B,oBAAoB;IACpD;IACA;IACD,CAAC,CAAC,MAAM,UAAU,MAAM,MAAM,MAAM,YAAY,CAAC;;;;;;CAQxD,oBAA6B;AAC3B,SAAO,KAAK;;;;;;;;;;;AAchB,SAAS,2BACP,gBACA,WACA,oBACA;AACA,QAAO,OAAO,W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ACA,2BACA,mBAAmB,OACnB,GAAG,SAC6C;CAEhD,MAAM,EAAE,QAAQ,SAAS,YAAY,QAAQ,WAAW,cACtD,kBAAkB;EAChB,SAAS;EACT;EACA;EACA;EACD,CAAC;CAEJ,MAAM,gBAAgB,WAAmB;AACvC,MAAI,kBAAkB;GACpB,MAAM,eAAe,WAAW,IAAI,OAAO,EAAE;AAE7C,OAAI,gBAAgB,WAAW,aAAc,WAAU,aAAa;;AAEtE,YAAU,OAAO;;AAGnB,QACE,iBAAA,GAAA,kBAAA,KAACC,0CAAAA,wBAAD;EACU;EACC;EACG;EACZ,WAAW;EACX,GAAI;EACJ,CAAA;;;;;;;;AC7CN,SAAgB,kBAAkB,OAA8B;CAC9D,MAAM,kBAAA,GAAA,MAAA,eAA+B;AACnC,SAAO,oCAAoC,MAAM;IAChD;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,gBAAA,GAAA,MAAA,QAAwC,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAIC,0CAAAA,WAAW;AAGxC,QACE,iBAAA,GAAA,kBAAA,KAACC,0CAAAA,oBAAD;EACE,GAAI;EACY;EAChB,WAAW,aAAa;EACxB,CAAA;;;;ACKN,eAAsB,GAAG,QAAqC;AAC5D,OAAM,IAAI,MAAM,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"mappings":";;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"index.client.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"mappings":";;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;AHhBjC;;KGsBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;;cAMC,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAAA;EAAA,QACA,eAAA;EAAA,QACA,eAAA;EAAA,QACA,mBAAA;cAEI,MAAA,EAAQ,2BAAA;EAsBpB,SAAA;EAIA,SAAA,GAAa,MAAA,EAAQ,gBAAA;EASrB,SAAA;EAQA,SAAA,GAAa,MAAA;EAKb,aAAA;EAUA,aAAA,GAAiB,UAAA;EF/F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AA,EAAS,QAAA;EAAA,GACN;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KAgBvB,mBAAA;EACV,OAAA;EACA,WAAA;IAAA,CAAiB,GAAA;EAAA;EACjB,aAAA,GAAgB,aAAA;EAAA,CACf,GAAA;AAAA;;;;;;;;;;;;AXjCH;;;;;;;;;;iBYsBgB,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EACT,aAAA;EACA,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KA8BvB,mBAAA;EACV,OAAA;EACA,WAAA,GAAc,SAAA;EACd,aAAA;IAAA,CACG,MAAA;MAEK,IAAA;MAAe,KAAA;MAAgB,MAAA;IAAA;EAAA;EAEvC,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,CACC,GAAA;AAAA;;;;;;;;;KC/DS,qBAAA,GAAwB,IAAA,CAClC,uBAAA,oCAGA,IAAA,CAAK,2BAAA;EACH,MAAA;AAAA;;;;;;;iBCFY,iBAAA,CAAkB,KAAA,EAAO,qBAAA,GAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCoBxC,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"mappings":";;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"index.client.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"mappings":";;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;AHhBjC;;KGsBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;;cAMC,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAAA;EAAA,QACA,eAAA;EAAA,QACA,eAAA;EAAA,QACA,mBAAA;cAEI,MAAA,EAAQ,2BAAA;EAsBpB,SAAA;EAIA,SAAA,GAAa,MAAA,EAAQ,kBAAA;EASrB,SAAA;EAQA,SAAA,GAAa,MAAA;EAKb,aAAA;EAUA,aAAA,GAAiB,UAAA;EF/FE;;AACrB;EEsGE,YAAA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GACN;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KAgBvB,mBAAA;EACV,OAAA;EACA,WAAA;IAAA,CAAiB,GAAA;EAAA;EACjB,aAAA,GAAgB,aAAA;EAAA,CACf,GAAA;AAAA;;;;;;;;;;;;AXjCH;;;;;;;;;;iBYsBgB,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EACT,aAAA;EACA,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KA8BvB,mBAAA;EACV,OAAA;EACA,WAAA,GAAc,SAAA;EACd,aAAA;IAAA,CACG,MAAA;MAEK,IAAA;MAAe,KAAA;MAAgB,MAAA;IAAA;EAAA;EAEvC,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,CACC,GAAA;AAAA;;;;;;;;;KC/DS,qBAAA,GAAwB,IAAA,CAClC,uBAAA,oCAGA,IAAA,CAAK,2BAAA;EACH,MAAA;AAAA;;;;;;;iBCFY,iBAAA,CAAkB,KAAA,EAAO,qBAAA,GAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCoBxC,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
|
package/dist/index.client.mjs
CHANGED
|
@@ -5,50 +5,6 @@ import { useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, us
|
|
|
5
5
|
import { Branch, Currency, DateTime, Derive, GtInternalTranslateJsx, GtInternalVar, I18nStore as I18nStore$1, InternalGTProvider, InternalLocaleSelector, InternalRegionSelector, Num, Plural, RelativeTime, T, Var } from "@generaltranslation/react-core/components";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { useMemo, useRef } from "react";
|
|
8
|
-
//#region src/i18n-cache/constants.ts
|
|
9
|
-
const DEFAULT_HTML_TAG_OPTIONS = {
|
|
10
|
-
updateHtmlLangTag: true,
|
|
11
|
-
updateHtmlDirTag: true
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region ../core/dist/api-rqq7klYe.mjs
|
|
15
|
-
function ensureSentence(text) {
|
|
16
|
-
const trimmed = text.trim();
|
|
17
|
-
if (!trimmed) return "";
|
|
18
|
-
return /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
19
|
-
}
|
|
20
|
-
function stripSentence(text) {
|
|
21
|
-
const trimmed = text.trim();
|
|
22
|
-
let end = trimmed.length;
|
|
23
|
-
while (end > 0) {
|
|
24
|
-
const char = trimmed[end - 1];
|
|
25
|
-
if (char !== "." && char !== "!" && char !== "?") break;
|
|
26
|
-
end -= 1;
|
|
27
|
-
}
|
|
28
|
-
return trimmed.slice(0, end);
|
|
29
|
-
}
|
|
30
|
-
function formatDetails(details) {
|
|
31
|
-
if (!details) return "";
|
|
32
|
-
const detailText = Array.isArray(details) ? details.join(", ") : details;
|
|
33
|
-
if (!detailText.trim()) return "";
|
|
34
|
-
return ensureSentence(`Details: ${detailText}`);
|
|
35
|
-
}
|
|
36
|
-
function createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {
|
|
37
|
-
const prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : "";
|
|
38
|
-
const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;
|
|
39
|
-
const shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
|
|
40
|
-
const messageParts = [
|
|
41
|
-
whatAndWhy,
|
|
42
|
-
reassurance,
|
|
43
|
-
shouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,
|
|
44
|
-
shouldCombineWayOut ? void 0 : wayOut,
|
|
45
|
-
formatDetails(details)
|
|
46
|
-
].filter((part) => !!part).map(ensureSentence);
|
|
47
|
-
if (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);
|
|
48
|
-
const message = messageParts.join(" ");
|
|
49
|
-
return prefix ? `${prefix} ${message}` : message;
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
8
|
//#region src/i18n-cache/BrowserI18nCache.ts
|
|
53
9
|
let localStorageCacheModulePromise;
|
|
54
10
|
/**
|
|
@@ -56,7 +12,7 @@ let localStorageCacheModulePromise;
|
|
|
56
12
|
*/
|
|
57
13
|
var BrowserI18nCache = class extends I18nCache {
|
|
58
14
|
constructor(config) {
|
|
59
|
-
const { htmlTagOptions, ...managerConfig } = config;
|
|
15
|
+
const { htmlTagOptions: _htmlTagOptions, ...managerConfig } = config;
|
|
60
16
|
const localStorageCaches = {};
|
|
61
17
|
const i18nConfig = getI18nConfig$1();
|
|
62
18
|
const devHotReloadEnabled = !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();
|
|
@@ -68,10 +24,6 @@ var BrowserI18nCache = class extends I18nCache {
|
|
|
68
24
|
});
|
|
69
25
|
this._devHotReloadJsx = false;
|
|
70
26
|
this._devHotReloadJsx = devHotReloadEnabled;
|
|
71
|
-
this.htmlTagOptions = {
|
|
72
|
-
...DEFAULT_HTML_TAG_OPTIONS,
|
|
73
|
-
...htmlTagOptions
|
|
74
|
-
};
|
|
75
27
|
if (devHotReloadEnabled) this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {
|
|
76
28
|
getOrCreateLocalStorageCache(localStorageCaches, {
|
|
77
29
|
locale,
|
|
@@ -85,28 +37,6 @@ var BrowserI18nCache = class extends I18nCache {
|
|
|
85
37
|
isDevHotReloadJsx() {
|
|
86
38
|
return this._devHotReloadJsx;
|
|
87
39
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Update the html tag (lang, dir)
|
|
90
|
-
*
|
|
91
|
-
* @deprecated, TODO: we should use a different system for managing this html tag
|
|
92
|
-
* this should just be for managing translations
|
|
93
|
-
*/
|
|
94
|
-
updateHtmlTag(locale, htmlTagOptions) {
|
|
95
|
-
const htmlLocale = htmlTagOptions?.lang || locale;
|
|
96
|
-
const i18nConfig = getI18nConfig$1();
|
|
97
|
-
const canonicalLocale = i18nConfig.resolveCanonicalLocale(htmlLocale);
|
|
98
|
-
if (!i18nConfig.isValidLocale(canonicalLocale)) {
|
|
99
|
-
console.warn(createInvalidLocaleWarning(htmlLocale));
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const localeDirection = htmlTagOptions?.dir || i18nConfig.getLocaleDirection(canonicalLocale);
|
|
103
|
-
const mergedHtmlTagOptions = {
|
|
104
|
-
...this.htmlTagOptions,
|
|
105
|
-
...htmlTagOptions
|
|
106
|
-
};
|
|
107
|
-
if (mergedHtmlTagOptions.updateHtmlLangTag) document.documentElement.lang = canonicalLocale;
|
|
108
|
-
if (mergedHtmlTagOptions.updateHtmlDirTag) document.documentElement.dir = localeDirection;
|
|
109
|
-
}
|
|
110
40
|
};
|
|
111
41
|
/**
|
|
112
42
|
* Wraps a translation loader to merge localStorage translations in dev mode.
|
|
@@ -131,12 +61,6 @@ function getOrCreateLocalStorageCache(localStorageCaches, params) {
|
|
|
131
61
|
function loadLocalStorageCache() {
|
|
132
62
|
return localStorageCacheModulePromise ??= import("./LocalStorageTranslationCache-B66Ni5IM.mjs");
|
|
133
63
|
}
|
|
134
|
-
const createInvalidLocaleWarning = (locale) => createDiagnosticMessage({
|
|
135
|
-
source: "gt-react",
|
|
136
|
-
severity: "Warning",
|
|
137
|
-
whatHappened: `Locale "${locale}" is not valid`,
|
|
138
|
-
fix: "Use a valid BCP 47 locale code or add a custom mapping"
|
|
139
|
-
});
|
|
140
64
|
//#endregion
|
|
141
65
|
//#region src/condition-store/cookies.ts
|
|
142
66
|
/**
|
|
@@ -254,6 +178,44 @@ function getBrowserLocale(getLocale) {
|
|
|
254
178
|
return i18nConfig.resolveSupportedLocale(candidates);
|
|
255
179
|
}
|
|
256
180
|
//#endregion
|
|
181
|
+
//#region ../core/dist/api-rqq7klYe.mjs
|
|
182
|
+
function ensureSentence(text) {
|
|
183
|
+
const trimmed = text.trim();
|
|
184
|
+
if (!trimmed) return "";
|
|
185
|
+
return /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
186
|
+
}
|
|
187
|
+
function stripSentence(text) {
|
|
188
|
+
const trimmed = text.trim();
|
|
189
|
+
let end = trimmed.length;
|
|
190
|
+
while (end > 0) {
|
|
191
|
+
const char = trimmed[end - 1];
|
|
192
|
+
if (char !== "." && char !== "!" && char !== "?") break;
|
|
193
|
+
end -= 1;
|
|
194
|
+
}
|
|
195
|
+
return trimmed.slice(0, end);
|
|
196
|
+
}
|
|
197
|
+
function formatDetails(details) {
|
|
198
|
+
if (!details) return "";
|
|
199
|
+
const detailText = Array.isArray(details) ? details.join(", ") : details;
|
|
200
|
+
if (!detailText.trim()) return "";
|
|
201
|
+
return ensureSentence(`Details: ${detailText}`);
|
|
202
|
+
}
|
|
203
|
+
function createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {
|
|
204
|
+
const prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : "";
|
|
205
|
+
const whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;
|
|
206
|
+
const shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));
|
|
207
|
+
const messageParts = [
|
|
208
|
+
whatAndWhy,
|
|
209
|
+
reassurance,
|
|
210
|
+
shouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,
|
|
211
|
+
shouldCombineWayOut ? void 0 : wayOut,
|
|
212
|
+
formatDetails(details)
|
|
213
|
+
].filter((part) => !!part).map(ensureSentence);
|
|
214
|
+
if (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);
|
|
215
|
+
const message = messageParts.join(" ");
|
|
216
|
+
return prefix ? `${prefix} ${message}` : message;
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
257
219
|
//#region src/condition-store/singleton-operations.ts
|
|
258
220
|
const conditionStoreNotInitializedError = createDiagnosticMessage({
|
|
259
221
|
source: "gt-react",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.mjs","names":["getI18nConfig","getCookieValue","getCookieValueFromString","getCookieValue","getCookieValue","getCookieValue","getTranslationsSnapshot","useSetLocale","useSetRegion","useSetLocale","I18nStore"],"sources":["../src/i18n-cache/constants.ts","../../core/dist/api-rqq7klYe.mjs","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/cookies.ts","../src/condition-store/readBrowserLocale.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/singleton-operations.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/runtimeCredentials.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"sourcesContent":["import type { HtmlTagOptions } from './types';\n\nexport const DEFAULT_HTML_TAG_OPTIONS: HtmlTagOptions = {\n updateHtmlLangTag: true,\n updateHtmlDirTag: true,\n};\n","//#region src/settings/settings.ts\nconst libraryDefaultLocale = \"en\";\nconst defaultTimeout = 6e4;\n//#endregion\n//#region src/logging/diagnostics.ts\nfunction ensureSentence(text) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return \"\";\n\treturn /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\nfunction stripSentence(text) {\n\tconst trimmed = text.trim();\n\tlet end = trimmed.length;\n\twhile (end > 0) {\n\t\tconst char = trimmed[end - 1];\n\t\tif (char !== \".\" && char !== \"!\" && char !== \"?\") break;\n\t\tend -= 1;\n\t}\n\treturn trimmed.slice(0, end);\n}\nfunction formatDetails(details) {\n\tif (!details) return \"\";\n\tconst detailText = Array.isArray(details) ? details.join(\", \") : details;\n\tif (!detailText.trim()) return \"\";\n\treturn ensureSentence(`Details: ${detailText}`);\n}\nfunction formatDiagnosticErrorDetails(error) {\n\tif (error == null) return void 0;\n\treturn String(error);\n}\nfunction createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {\n\tconst prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : \"\";\n\tconst whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;\n\tconst shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n\tconst messageParts = [\n\t\twhatAndWhy,\n\t\treassurance,\n\t\tshouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,\n\t\tshouldCombineWayOut ? void 0 : wayOut,\n\t\tformatDetails(details)\n\t].filter((part) => !!part).map(ensureSentence);\n\tif (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);\n\tconst message = messageParts.join(\" \");\n\treturn prefix ? `${prefix} ${message}` : message;\n}\n//#endregion\n//#region src/settings/settingsUrls.ts\nconst defaultCacheUrl = \"https://cdn.gtx.dev\";\nconst defaultBaseUrl = \"https://api2.gtx.dev\";\nconst defaultRuntimeApiUrl = \"https://runtime2.gtx.dev\";\n//#endregion\n//#region src/translate/api.ts\nconst API_VERSION = \"2026-03-06.v1\";\n//#endregion\nexport { createDiagnosticMessage as a, libraryDefaultLocale as c, defaultRuntimeApiUrl as i, defaultBaseUrl as n, formatDiagnosticErrorDetails as o, defaultCacheUrl as r, defaultTimeout as s, API_VERSION as t };\n\n//# sourceMappingURL=api-rqq7klYe.mjs.map","import type {\n I18nCacheConstructorParams,\n TranslationsLoader,\n} from 'gt-i18n/internal/types';\nimport { getI18nConfig, I18nCache } from 'gt-i18n/internal';\nimport type { HtmlTagOptions } from './types';\nimport type { Translation } from 'gt-i18n/types';\nimport { DEFAULT_HTML_TAG_OPTIONS } from './constants';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\n\ntype LocalStorageTranslationCache =\n import('./LocalStorageTranslationCache').LocalStorageTranslationCache;\ntype LocalStorageCachePromises = Record<\n string,\n Promise<LocalStorageTranslationCache>\n>;\n\n// Lazily import the development-only cache so bundlers can keep it out of the initial client chunk.\n// `??=` saves the first import promise, so all cache instances reuse the same lazy module load.\nlet localStorageCacheModulePromise:\n | Promise<typeof import('./LocalStorageTranslationCache')>\n | undefined;\n\n/**\n * The configuration for the BrowserI18nCache\n */\nexport type BrowserI18nCacheParams = I18nCacheConstructorParams & {\n htmlTagOptions?: HtmlTagOptions;\n};\n\n/**\n * I18nCache implementation for Browser.\n */\nexport class BrowserI18nCache extends I18nCache<Translation> {\n /** Customize browser-related behavior */\n private htmlTagOptions?: HtmlTagOptions;\n\n /** Whether dev hot reload JSX (Suspense-based <T>) is active */\n private _devHotReloadJsx = false;\n\n constructor(config: BrowserI18nCacheParams) {\n // Must be initialized before super()\n const { htmlTagOptions, ...managerConfig } = config;\n const localStorageCaches: LocalStorageCachePromises = {};\n const i18nConfig = getI18nConfig();\n const devHotReloadEnabled =\n !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();\n const projectId = i18nConfig.getProjectId()!;\n const loadTranslations = devHotReloadEnabled\n ? wrapLoaderWithLocalStorage(\n config.loadTranslations!,\n projectId,\n localStorageCaches\n )\n : config.loadTranslations;\n\n // Initialize the I18nCache\n super({\n ...managerConfig,\n loadTranslations,\n });\n\n this._devHotReloadJsx = devHotReloadEnabled;\n\n this.htmlTagOptions = {\n ...DEFAULT_HTML_TAG_OPTIONS,\n ...htmlTagOptions,\n };\n\n // For dev hot reload, we need to write the translations to the localStorage cache\n if (devHotReloadEnabled) {\n this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {\n void getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n }).then((cache) => cache.write(hash, translation));\n };\n }\n }\n\n /**\n * Whether dev hot reload JSX (Suspense-based <T>) is active\n */\n isDevHotReloadJsx(): boolean {\n return this._devHotReloadJsx;\n }\n\n /**\n * Update the html tag (lang, dir)\n *\n * @deprecated, TODO: we should use a different system for managing this html tag\n * this should just be for managing translations\n */\n updateHtmlTag(\n locale: string,\n htmlTagOptions?: { lang?: string; dir?: 'ltr' | 'rtl' } & HtmlTagOptions\n ): void {\n // Get parameters\n const htmlLocale = htmlTagOptions?.lang || locale;\n const i18nConfig = getI18nConfig();\n const canonicalLocale = i18nConfig.resolveCanonicalLocale(htmlLocale);\n\n // Validate parameters\n if (!i18nConfig.isValidLocale(canonicalLocale)) {\n console.warn(createInvalidLocaleWarning(htmlLocale));\n return;\n }\n\n const localeDirection =\n htmlTagOptions?.dir || i18nConfig.getLocaleDirection(canonicalLocale);\n\n // Merge options\n const mergedHtmlTagOptions = {\n ...this.htmlTagOptions,\n ...htmlTagOptions,\n };\n\n // Update html tag\n if (mergedHtmlTagOptions.updateHtmlLangTag) {\n document.documentElement.lang = canonicalLocale;\n }\n if (mergedHtmlTagOptions.updateHtmlDirTag) {\n document.documentElement.dir = localeDirection;\n }\n }\n}\n\n// ===== Helper Functions ===== //\n\n/**\n * Wraps a translation loader to merge localStorage translations in dev mode.\n * On each call: runs the original loader, seeds a LocalStorageTranslationCache\n * with the result (loader wins over stale localStorage), and returns the merged\n * translations — preserving runtime tx() translations from previous sessions.\n *\n * TODO: this should be moved to wrapping in I18nStore\n */\nfunction wrapLoaderWithLocalStorage(\n originalLoader: TranslationsLoader,\n projectId: string,\n localStorageCaches: LocalStorageCachePromises\n) {\n return async (locale: string) => {\n const loaderTranslations = await originalLoader(locale);\n const cache = await getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n init: loaderTranslations as Record<string, Translation>,\n });\n return cache.getInternalCache();\n };\n}\n\nfunction getOrCreateLocalStorageCache(\n localStorageCaches: LocalStorageCachePromises,\n params: {\n locale: string;\n projectId: string;\n init?: Record<string, Translation>;\n }\n): Promise<LocalStorageTranslationCache> {\n // `||=` saves the first promise for this locale, so concurrent calls reuse one cache instance.\n return (localStorageCaches[params.locale] ||= loadLocalStorageCache().then(\n ({ LocalStorageTranslationCache }) =>\n new LocalStorageTranslationCache(params)\n ));\n}\n\nfunction loadLocalStorageCache() {\n return (localStorageCacheModulePromise ??=\n import('./LocalStorageTranslationCache'));\n}\n\nconst createInvalidLocaleWarning = (locale: string) =>\n createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Warning',\n whatHappened: `Locale \"${locale}\" is not valid`,\n fix: 'Use a valid BCP 47 locale code or add a custom mapping',\n });\n","import { getCookieValue as getCookieValueFromString } from 'gt-i18n/internal';\n\n/**\n * Minimally parses a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @returns The locale from the cookie or undefined if not found or invalid\n */\nexport function getCookieValue({\n cookieName,\n}: {\n cookieName: string;\n}): string | undefined {\n if (typeof document === 'undefined') return undefined;\n return getCookieValueFromString(document.cookie, cookieName);\n}\n\n/**\n * Sets a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @param value - The value to set\n * @returns The value that was set\n */\nexport function setCookieValue({\n cookieName,\n value,\n}: {\n cookieName: string;\n value: string;\n}): void {\n if (typeof document === 'undefined') return;\n document.cookie = `${cookieName}=${value};path=/`;\n}\n","import { getCookieValue } from './cookies';\n\nexport function readBrowserLocale(localeCookieName: string): string[] {\n const candidates = [];\n // (1) Check cookie\n\n const cookieLocale = getCookieValue({\n cookieName: localeCookieName,\n });\n if (cookieLocale) candidates.push(cookieLocale);\n\n // (2) Check navigator locales\n const navigatorLocales = navigator?.languages || [];\n candidates.push(...navigatorLocales);\n\n return candidates;\n}\n","import {\n defaultResetLocaleCookieName,\n getI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { WritableConditionStoreParams } from 'gt-i18n/internal';\nimport { getCookieValue, setCookieValue } from './cookies';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { GetEnableI18n, GetLocale, GetRegion } from '../i18n-cache/types';\nimport {\n LocaleCandidates,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\n\ntype SerializedBrowserConditionStoreState = {\n locale: string;\n region: string | undefined;\n enableI18n: boolean;\n};\nexport type ReloadType = (state: SerializedBrowserConditionStoreState) => void;\n\n/**\n * The configuration for the BrowserConditionStore\n * @param {GetLocale} getLocale - The function to get the locale\n */\nexport type BrowserConditionStoreParams = WritableConditionStoreParams & {\n _getLocale?: GetLocale;\n _getRegion?: GetRegion;\n _getEnableI18n?: GetEnableI18n;\n _reload?: ReloadType;\n};\n\n/**\n * Condition store implementation for Browser.\n */\nexport class BrowserConditionStore implements WritableConditionStoreInterface {\n private customReload: ReloadType;\n private customGetLocale?: GetLocale;\n private customGetRegion?: GetRegion;\n private customGetEnableI18n?: GetEnableI18n;\n\n constructor(config: BrowserConditionStoreParams) {\n const i18nConfig = getI18nConfig();\n this.customReload =\n config._reload ??\n (() =>\n typeof window !== 'undefined' ? window.location.reload() : undefined);\n this.customGetLocale = config._getLocale;\n this.customGetRegion = config._getRegion;\n this.customGetEnableI18n = config._getEnableI18n;\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(config.locale),\n });\n if (config.region !== undefined) {\n setCookieValue({\n cookieName: i18nConfig.getRegionCookieName(),\n value: config.region,\n });\n }\n this.updateEnableI18n(config.enableI18n ?? true);\n }\n\n getLocale = (): string => {\n return getBrowserLocale(this.customGetLocale);\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n this.updateLocale(locale);\n setCookieValue({\n cookieName: defaultResetLocaleCookieName,\n value: 'true',\n });\n this.reload();\n };\n\n getRegion = (): string | undefined => {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n if (cookieRegion) return cookieRegion;\n return this.customGetRegion?.();\n };\n\n setRegion = (region: string | undefined): void => {\n this.updateRegion(region);\n this.reload();\n };\n\n getEnableI18n = (): boolean => {\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return this.customGetEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n };\n\n setEnableI18n = (enableI18n: boolean): void => {\n this.updateEnableI18n(enableI18n);\n this.reload();\n };\n\n /**\n * Soft locale update\n */\n updateLocale = (locale: LocaleCandidates): void => {\n const i18nConfig = getI18nConfig();\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(locale),\n });\n };\n\n /**\n * Soft region update\n */\n updateRegion = (region: string | undefined): void => {\n setCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n value: region ?? '',\n });\n };\n\n /**\n * Soft enableI18n update\n */\n updateEnableI18n = (enableI18n: boolean): void => {\n setCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n value: enableI18n ? 'true' : 'false',\n });\n };\n\n /**\n * Condition store updates come from either the server or the client.\n * Trigger this reload when we update a value in the condition store from\n * the client.\n */\n reload = (): void => {\n const state = {\n locale: this.getLocale(),\n region: this.getRegion(),\n enableI18n: this.getEnableI18n(),\n };\n this.customReload(state);\n };\n}\n\nfunction getBrowserLocale(getLocale?: GetLocale): string {\n const i18nConfig = getI18nConfig();\n const candidates = readBrowserLocale(i18nConfig.getLocaleCookieName());\n if (getLocale) candidates.push(getLocale());\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n createConditionStoreSingleton,\n ReadonlyConditionStore,\n} from 'gt-i18n/internal';\nimport { BrowserConditionStore } from './BrowserConditionStore';\n\n// Both singletons below are typed views of the same global slot (namespace\n// 'i18n', key 'conditionStore'), so there is a single uninitialized state and\n// one message describes it for both getters.\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'the internal ConditionStore singleton is unavailable',\n fix: 'Call initializeGT() (or initializeGTSPA() in SPA apps) before rendering and add a <GTProvider> at the root of your component tree.',\n});\n\nexport const {\n setConditionStore: setReadonlyConditionStore,\n isConditionStoreInitialized: isReadonlyConditionStoreInitialized,\n} = createConditionStoreSingleton<ReadonlyConditionStore>(\n conditionStoreNotInitializedError\n);\n\nexport const {\n getConditionStore: getBrowserConditionStore,\n setConditionStore: setBrowserConditionStore,\n isConditionStoreInitialized: isBrowserConditionStoreInitialized,\n} = createConditionStoreSingleton<BrowserConditionStore>(\n conditionStoreNotInitializedError\n);\n","import type { LocaleCandidates } from 'gt-i18n/internal';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport {\n BrowserConditionStore,\n BrowserConditionStoreParams,\n} from './BrowserConditionStore';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { getCookieValue } from './cookies';\nimport {\n getBrowserConditionStore,\n isBrowserConditionStoreInitialized,\n setBrowserConditionStore,\n} from './singleton-operations';\n\nexport type CreateBrowserConditionStoreParams = Omit<\n BrowserConditionStoreParams,\n 'locale' | 'enableI18n'\n> & {\n locale?: LocaleCandidates;\n enableI18n?: boolean;\n};\n\n/**\n * Factory to create a BrowserConditionStore for Singleton\n *\n * This exists so we can keep the locale param as required in the constructor\n *\n * Server-provided props are the first candidates for hydration consistency.\n * Cookies fill in missing values to persist state across page reloads.\n *\n * Cookie names come from the I18nConfig singleton so custom names passed to\n * initializeGT() apply here without being threaded through provider props.\n */\nexport function createOrUpdateBrowserConditionStore(\n config: CreateBrowserConditionStoreParams\n) {\n const locale = determineLocale(config);\n const region = determineRegion(config);\n const enableI18n = determineEnableI18n(config);\n\n if (isBrowserConditionStoreInitialized()) {\n // This represents an update from server\n const conditionStore = getBrowserConditionStore();\n conditionStore.updateLocale(locale);\n if (region !== undefined) conditionStore.updateRegion(region);\n conditionStore.updateEnableI18n(enableI18n);\n return conditionStore;\n }\n\n const conditionStore = new BrowserConditionStore({\n ...config,\n locale,\n region,\n enableI18n,\n });\n setBrowserConditionStore(conditionStore);\n return conditionStore;\n}\n\nfunction determineLocale({\n _getLocale: getLocale,\n locale,\n}: CreateBrowserConditionStoreParams): string {\n const i18nConfig = getI18nConfig();\n const candidates = [];\n if (locale) {\n candidates.push(...(Array.isArray(locale) ? locale : [locale]));\n }\n if (getLocale) candidates.push(getLocale());\n candidates.push(...readBrowserLocale(i18nConfig.getLocaleCookieName()));\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n\nfunction determineRegion({\n _getRegion: getRegion,\n region,\n}: CreateBrowserConditionStoreParams): string | undefined {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n return cookieRegion || getRegion?.() || region;\n}\n\nfunction determineEnableI18n({\n enableI18n,\n _getEnableI18n: getEnableI18n,\n}: CreateBrowserConditionStoreParams): boolean {\n if (enableI18n !== undefined) return enableI18n;\n\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return getEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n}\n","import { getRuntimeEnvironment } from 'gt-i18n/internal';\nimport type { I18nConfigParams } from 'gt-i18n/internal/types';\n\ntype RuntimeCredentials = Pick<I18nConfigParams, 'projectId' | 'devApiKey'>;\ntype RuntimeEnv = {\n DEV?: boolean;\n VITE_GT_PROJECT_ID?: string;\n VITE_GT_DEV_API_KEY?: string;\n};\n\nexport function addRuntimeCredentials<T extends RuntimeCredentials>(\n config: T\n): T {\n const credentials = getRuntimeCredentials();\n return {\n ...config,\n projectId: config.projectId || credentials.projectId,\n devApiKey: config.devApiKey || credentials.devApiKey,\n };\n}\n\nfunction getRuntimeCredentials(): RuntimeCredentials {\n return {\n projectId:\n readImportMetaVite(\n () =>\n (\n import.meta as ImportMeta & {\n env?: RuntimeEnv;\n }\n ).env?.VITE_GT_PROJECT_ID\n ) || readProcessEnvViteProjectId(),\n devApiKey:\n getRuntimeEnvironment() === 'development'\n ? readImportMetaVite(() =>\n (import.meta as ImportMeta & { env?: RuntimeEnv }).env?.DEV\n ? (import.meta as ImportMeta & { env?: RuntimeEnv }).env\n ?.VITE_GT_DEV_API_KEY\n : undefined\n ) || readProcessEnvViteDevApiKey()\n : undefined,\n };\n}\n\nfunction readImportMetaVite(\n readValue: () => string | undefined\n): string | undefined {\n try {\n return normalizeEnvValue(readValue());\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteProjectId(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_PROJECT_ID);\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteDevApiKey(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_DEV_API_KEY);\n } catch {\n return undefined;\n }\n}\n\nfunction normalizeEnvValue(value: string | undefined): string | undefined {\n return value || undefined;\n}\n","import {\n getTranslationsSnapshot,\n I18nStore,\n setI18nStore,\n setReactI18nCache,\n getReadonlyConditionStore,\n initializeI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { I18nConfigParams } from '@generaltranslation/react-core/pure';\nimport { BrowserI18nCache } from '../i18n-cache/BrowserI18nCache';\nimport type { BrowserI18nCacheParams } from '../i18n-cache/BrowserI18nCache';\nimport {\n createOrUpdateBrowserConditionStore,\n CreateBrowserConditionStoreParams,\n} from '../condition-store/createBrowserConditionStore';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTSPAParams = I18nConfigParams &\n BrowserI18nCacheParams &\n CreateBrowserConditionStoreParams;\n\n/**\n * Initialize GT for an SPA\n * - i18nCache\n * - conditionStore\n * - i18nStore\n *\n * This is SPA for browser runtime\n */\nexport async function initializeGTSPA(config: InitializeGTSPAParams) {\n const runtimeConfig = addRuntimeCredentials(config);\n initializeI18nConfig(runtimeConfig, 'SPA');\n\n const i18nCache = new BrowserI18nCache(runtimeConfig);\n setReactI18nCache(i18nCache);\n\n createOrUpdateBrowserConditionStore(runtimeConfig);\n\n const i18nStore = new I18nStore();\n setI18nStore(i18nStore);\n\n // Block until translations are loaded\n await getTranslationsSnapshot(getReadonlyConditionStore().getLocale());\n}\n","import {\n internalInitializeGTSRA,\n type ReactInitializeGTParams,\n} from '@generaltranslation/react-core/pure';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTClientParams = ReactInitializeGTParams;\n\n/**\n * Initialize GT for client-side rendering.\n */\nexport function initializeGTSRAClient(config: InitializeGTClientParams): void {\n internalInitializeGTSRA(\n addRuntimeCredentials({\n cacheExpiryTime: null,\n ...config,\n })\n );\n}\n","import { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getCookieValue, parseAcceptLanguage } from 'gt-i18n/internal';\n\ntype RequestWithHeaders = Pick<Request, 'headers'>;\n\n/**\n * Resolve the user's locale from a Web Request.\n *\n * The configured locale cookie takes precedence over the Accept-Language\n * header. If neither contains a supported locale, the configured default\n * locale is returned.\n *\n * This is intended for incoming server requests. A Request created in the\n * browser does not automatically include document cookies or Accept-Language.\n */\nexport function parseLocale(request: RequestWithHeaders): string {\n const i18nConfig = getI18nConfig();\n const candidates: string[] = [];\n const cookieLocale = getCookieValue(\n request.headers.get('cookie'),\n i18nConfig.getLocaleCookieName()\n );\n\n if (cookieLocale) {\n candidates.push(cookieLocale);\n }\n\n candidates.push(\n ...parseAcceptLanguage(request.headers.get('accept-language'))\n );\n\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import {\n useInternalLocaleSelector,\n useSetLocale,\n} from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a locale selector.\n * Provides locale management utilities for the application.\n *\n * @param locales an optional list of locales to use for the drop down. These locales must be a subset of the locales provided by the `<GTProvider>` context. When not provided, the list of locales from the `<GTProvider>` context is used.\n *\n * @returns {Object} An object containing locale-related utilities:\n * @returns {string} return.locale - The currently selected locale.\n * @returns {string[]} return.locales - The list of all available locales.\n * @returns {function} return.setLocale - Function to update the current locale.\n * @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.\n */\nexport function useLocaleSelector(locales?: string[]) {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n","import {\n useInternalRegionSelector,\n useSetLocale,\n useSetRegion,\n} from '@generaltranslation/react-core/hooks';\nimport type { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a region selector.\n * Provides region management utilities for the application.\n *\n * @param {Object} [options] - Optional configuration object.\n * @param {string[]} [options.regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales.\n * @param {Object} [options.customMapping] - Optional mapping to override region display names, emojis, or associated locales.\n * @param {boolean} [options.prioritizeCurrentLocaleRegion=true] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [options.sortRegionsAlphabetically=true] - If true, regions are sorted alphabetically by display name.\n *\n * @returns {Object} An object containing region-related utilities:\n * @returns {string | undefined} return.region - The currently selected region code.\n * @returns {function} return.setRegion - Function to update the current region.\n * @returns {string[]} return.regions - The ordered list of available region codes.\n * @returns {Map<string, RegionData>} return.regionData - Map of region codes to their display data (name, emoji, locale).\n * @returns {string} return.locale - The current locale.\n * @returns {function} return.setLocale - Function to update the current locale.\n */\nexport function useRegionSelector(options?: InternalRegionSelectorOptions) {\n const setRegion = useSetRegion();\n const setLocale = useSetLocale();\n return { setRegion, setLocale, ...useInternalRegionSelector(options) };\n}\n","import type React from 'react';\nimport { InternalLocaleSelector } from '@generaltranslation/react-core/components';\nimport { CustomMapping } from 'generaltranslation/types';\nimport { useLocaleSelector } from './useLocaleSelector';\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string[]} [locales] - An optional list of locales to use for the dropdown. If not provided, the list of locales from the `<GTProvider>` context is used.\n * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.\n * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.\n * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.\n */\nexport function LocaleSelector({\n locales: _locales,\n ...props\n}: LocaleSelectorProps): React.JSX.Element | null {\n // Get locale selector properties\n const { locale, locales, getLocaleProperties, setLocale } =\n useLocaleSelector(_locales);\n\n return (\n <InternalLocaleSelector\n locale={locale}\n locales={locales}\n setLocale={setLocale}\n getLocaleProperties={getLocaleProperties}\n {...props}\n />\n );\n}\n\nexport type LocaleSelectorProps = {\n locales?: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n [key: string]: any;\n};\n","import type React from 'react';\nimport type { ReactNode } from 'react';\nimport { InternalRegionSelector } from '@generaltranslation/react-core/components';\nimport { useRegionSelector } from './useRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string[]} [regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from the supported locales in the `<GTProvider>` context.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @param {object} [customMapping] - An optional object to map region codes to custom display names, emojis, or associated locales.\n * @param {boolean} [prioritizeCurrentLocaleRegion] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [sortRegionsAlphabetically] - If true, regions are sorted alphabetically by display name.\n * @param {boolean} [asLocaleSelector=false] - If true, selecting a region will also update the locale to the region's associated locale.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @example\n * ```tsx\n * <RegionSelector\n * regions={['US', 'CA']}\n * customMapping={{ US: { name: \"United States\", emoji: \"🇺🇸\" } }}\n * placeholder=\"Select a region\"\n * />\n * ```\n */\nexport function RegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n asLocaleSelector = false,\n ...props\n}: RegionSelectorProps): React.JSX.Element | null {\n // Get region selector properties\n const { region, regions, regionData, locale, setRegion, setLocale } =\n useRegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n });\n\n const changeRegion = (region: string) => {\n if (asLocaleSelector) {\n const regionLocale = regionData.get(region)?.locale;\n // setRegion reloads the page; update the locale cookie first\n if (regionLocale && locale !== regionLocale) setLocale(regionLocale);\n }\n setRegion(region);\n };\n\n return (\n <InternalRegionSelector\n region={region}\n regions={regions}\n regionData={regionData}\n setRegion={changeRegion}\n {...props}\n />\n );\n}\n\nexport type RegionSelectorProps = {\n regions?: string[];\n placeholder?: ReactNode;\n customMapping?: {\n [region: string]:\n | string\n | { name?: string; emoji?: string; locale?: string };\n };\n prioritizeCurrentLocaleRegion?: boolean;\n sortRegionsAlphabetically?: boolean;\n asLocaleSelector?: boolean;\n [key: string]: any;\n};\n","import {\n I18nStore,\n InternalGTProvider,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { SharedGTProviderProps } from './GTProviderProps';\nimport { createOrUpdateBrowserConditionStore } from '../condition-store/createBrowserConditionStore';\n\n/**\n * Consumes snapshot from server\n * Implementation for client-side only\n */\nexport function BrowserGTProvider(props: SharedGTProviderProps) {\n const conditionStore = useMemo(() => {\n return createOrUpdateBrowserConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { TxProps } from './utils/TxProps';\n\nexport { initializeGTSPA } from './setup/initializeGTSPA';\nexport { initializeGTSRAClient as initializeGT } from './setup/initializeGTSRAClient';\nexport { createOrUpdateBrowserConditionStore } from './condition-store/createBrowserConditionStore';\nexport { parseLocale } from './functions/parseLocale';\nexport { useLocaleSelector } from './components/useLocaleSelector';\nexport { useRegionSelector } from './components/useRegionSelector';\n\n// ===== Components ===== //\nexport { LocaleSelector } from './components/LocaleSelector';\nexport { RegionSelector } from './components/RegionSelector';\nexport { BrowserGTProvider as GTProvider } from './provider/BrowserGTProvider';\n\n// ===== Components ===== //\nexport {\n Branch,\n Plural,\n Derive,\n GtInternalTranslateJsx,\n GtInternalVar,\n T,\n Currency,\n DateTime,\n RelativeTime,\n Var,\n Num,\n} from '@generaltranslation/react-core/components';\n\nexport async function Tx(_props: TxProps): Promise<ReactNode> {\n throw new Error('Tx is only supported via RSC');\n}\n\n// ===== Hooks ===== //\nexport {\n useLocale,\n useRegion,\n useCustomMapping,\n useDefaultLocale,\n useEnableI18n,\n useLocales,\n useFormatLocales,\n useGT,\n useMessages,\n useTranslations,\n useLocaleDirection,\n useLocaleProperties,\n useSetLocale,\n useSetRegion,\n useSetEnableI18n,\n} from '@generaltranslation/react-core/hooks';\n\n// ===== Functions ===== //\nexport {\n msg,\n decodeMsg,\n decodeOptions,\n derive,\n declareVar,\n decodeVars,\n mFallback,\n gtFallback,\n getFormatLocales,\n getDefaultLocale,\n getLocaleProperties,\n getLocales,\n resolveCanonicalLocale,\n getReactI18nCache,\n getTranslationsSnapshot,\n getVersionId,\n createRenderPipeline,\n setReactI18nCache,\n t,\n} from '@generaltranslation/react-core/pure';\n\nexport type {\n RenderPipeline,\n RenderPreparedT,\n} from '@generaltranslation/react-core/pure';\n\nexport type { SharedGTProviderProps } from './provider/GTProviderProps';\nexport {\n GtInternalRuntimeTranslateJsx,\n GtInternalRuntimeTranslateString,\n} from 'gt-i18n/internal';\nexport type {\n GTTranslationOptions,\n RuntimeTranslationOptions,\n} from 'gt-i18n/types';\nexport type {\n SyncResolutionFunction,\n SyncResolutionFunctionWithFallback,\n} from 'gt-i18n/types';\n\n// ===== Singletons ===== //\nexport {\n ReactI18nCache,\n type ReactI18nCacheParams,\n} from '@generaltranslation/react-core/pure';\n"],"mappings":";;;;;;;;AAEA,MAAa,2BAA2C;CACtD,mBAAmB;CACnB,kBAAkB;CACnB;;;ACAD,SAAS,eAAe,MAAM;CAC7B,MAAM,UAAU,KAAK,MAAM;AAC3B,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG,QAAQ;;AAEvD,SAAS,cAAc,MAAM;CAC5B,MAAM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EAChB,WAAW,aAAa;EACxB,CAAA;;;;ACKN,eAAsB,GAAG,QAAqC;AAC5D,OAAM,IAAI,MAAM,+BAA+B"}
|
|
1
|
+
{"version":3,"file":"index.client.mjs","names":["getI18nConfig","getCookieValue","getCookieValueFromString","getCookieValue","getCookieValue","getCookieValue","getTranslationsSnapshot","useSetLocale","useSetRegion","useSetLocale","I18nStore"],"sources":["../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/cookies.ts","../src/condition-store/readBrowserLocale.ts","../src/condition-store/BrowserConditionStore.ts","../../core/dist/api-rqq7klYe.mjs","../src/condition-store/singleton-operations.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/runtimeCredentials.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/functions/parseLocale.ts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/BrowserGTProvider.tsx","../src/index.client.ts"],"sourcesContent":["import type {\n I18nCacheConstructorParams,\n TranslationsLoader,\n} from 'gt-i18n/internal/types';\nimport { getI18nConfig, I18nCache } from 'gt-i18n/internal';\nimport type { HtmlTagOptions } from './types';\nimport type { Translation } from 'gt-i18n/types';\n\ntype LocalStorageTranslationCache =\n import('./LocalStorageTranslationCache').LocalStorageTranslationCache;\ntype LocalStorageCachePromises = Record<\n string,\n Promise<LocalStorageTranslationCache>\n>;\n\n// Lazily import the development-only cache so bundlers can keep it out of the initial client chunk.\n// `??=` saves the first import promise, so all cache instances reuse the same lazy module load.\nlet localStorageCacheModulePromise:\n | Promise<typeof import('./LocalStorageTranslationCache')>\n | undefined;\n\n/**\n * The configuration for the BrowserI18nCache\n */\nexport type BrowserI18nCacheParams = I18nCacheConstructorParams & {\n htmlTagOptions?: HtmlTagOptions;\n};\n\n/**\n * I18nCache implementation for Browser.\n */\nexport class BrowserI18nCache extends I18nCache<Translation> {\n /** Whether dev hot reload JSX (Suspense-based <T>) is active */\n private _devHotReloadJsx = false;\n\n constructor(config: BrowserI18nCacheParams) {\n // Must be initialized before super()\n // Keep accepting htmlTagOptions without passing it to the translation cache.\n const { htmlTagOptions: _htmlTagOptions, ...managerConfig } = config;\n const localStorageCaches: LocalStorageCachePromises = {};\n const i18nConfig = getI18nConfig();\n const devHotReloadEnabled =\n !!config.loadTranslations && i18nConfig.isDevHotReloadEnabled();\n const projectId = i18nConfig.getProjectId()!;\n const loadTranslations = devHotReloadEnabled\n ? wrapLoaderWithLocalStorage(\n config.loadTranslations!,\n projectId,\n localStorageCaches\n )\n : config.loadTranslations;\n\n // Initialize the I18nCache\n super({\n ...managerConfig,\n loadTranslations,\n });\n\n this._devHotReloadJsx = devHotReloadEnabled;\n\n // For dev hot reload, we need to write the translations to the localStorage cache\n if (devHotReloadEnabled) {\n this.onTranslationsCacheMiss = ({ locale, hash, translation }) => {\n void getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n }).then((cache) => cache.write(hash, translation));\n };\n }\n }\n\n /**\n * Whether dev hot reload JSX (Suspense-based <T>) is active\n */\n isDevHotReloadJsx(): boolean {\n return this._devHotReloadJsx;\n }\n}\n\n// ===== Helper Functions ===== //\n\n/**\n * Wraps a translation loader to merge localStorage translations in dev mode.\n * On each call: runs the original loader, seeds a LocalStorageTranslationCache\n * with the result (loader wins over stale localStorage), and returns the merged\n * translations — preserving runtime tx() translations from previous sessions.\n *\n * TODO: this should be moved to wrapping in I18nStore\n */\nfunction wrapLoaderWithLocalStorage(\n originalLoader: TranslationsLoader,\n projectId: string,\n localStorageCaches: LocalStorageCachePromises\n) {\n return async (locale: string) => {\n const loaderTranslations = await originalLoader(locale);\n const cache = await getOrCreateLocalStorageCache(localStorageCaches, {\n locale,\n projectId,\n init: loaderTranslations as Record<string, Translation>,\n });\n return cache.getInternalCache();\n };\n}\nfunction getOrCreateLocalStorageCache(\n localStorageCaches: LocalStorageCachePromises,\n params: {\n locale: string;\n projectId: string;\n init?: Record<string, Translation>;\n }\n): Promise<LocalStorageTranslationCache> {\n // `||=` saves the first promise for this locale, so concurrent calls reuse one cache instance.\n return (localStorageCaches[params.locale] ||= loadLocalStorageCache().then(\n ({ LocalStorageTranslationCache }) =>\n new LocalStorageTranslationCache(params)\n ));\n}\n\nfunction loadLocalStorageCache() {\n return (localStorageCacheModulePromise ??=\n import('./LocalStorageTranslationCache'));\n}\n","import { getCookieValue as getCookieValueFromString } from 'gt-i18n/internal';\n\n/**\n * Minimally parses a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @returns The locale from the cookie or undefined if not found or invalid\n */\nexport function getCookieValue({\n cookieName,\n}: {\n cookieName: string;\n}): string | undefined {\n if (typeof document === 'undefined') return undefined;\n return getCookieValueFromString(document.cookie, cookieName);\n}\n\n/**\n * Sets a cookie value for a given cookie name\n * @param cookieName - The name of the cookie\n * @param value - The value to set\n * @returns The value that was set\n */\nexport function setCookieValue({\n cookieName,\n value,\n}: {\n cookieName: string;\n value: string;\n}): void {\n if (typeof document === 'undefined') return;\n document.cookie = `${cookieName}=${value};path=/`;\n}\n","import { getCookieValue } from './cookies';\n\nexport function readBrowserLocale(localeCookieName: string): string[] {\n const candidates = [];\n // (1) Check cookie\n\n const cookieLocale = getCookieValue({\n cookieName: localeCookieName,\n });\n if (cookieLocale) candidates.push(cookieLocale);\n\n // (2) Check navigator locales\n const navigatorLocales = navigator?.languages || [];\n candidates.push(...navigatorLocales);\n\n return candidates;\n}\n","import {\n defaultResetLocaleCookieName,\n getI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { WritableConditionStoreParams } from 'gt-i18n/internal';\nimport { getCookieValue, setCookieValue } from './cookies';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { GetEnableI18n, GetLocale, GetRegion } from '../i18n-cache/types';\nimport {\n LocaleCandidates,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\n\ntype SerializedBrowserConditionStoreState = {\n locale: string;\n region: string | undefined;\n enableI18n: boolean;\n};\nexport type ReloadType = (state: SerializedBrowserConditionStoreState) => void;\n\n/**\n * The configuration for the BrowserConditionStore\n * @param {GetLocale} getLocale - The function to get the locale\n */\nexport type BrowserConditionStoreParams = WritableConditionStoreParams & {\n _getLocale?: GetLocale;\n _getRegion?: GetRegion;\n _getEnableI18n?: GetEnableI18n;\n _reload?: ReloadType;\n};\n\n/**\n * Condition store implementation for Browser.\n */\nexport class BrowserConditionStore implements WritableConditionStoreInterface {\n private customReload: ReloadType;\n private customGetLocale?: GetLocale;\n private customGetRegion?: GetRegion;\n private customGetEnableI18n?: GetEnableI18n;\n\n constructor(config: BrowserConditionStoreParams) {\n const i18nConfig = getI18nConfig();\n this.customReload =\n config._reload ??\n (() =>\n typeof window !== 'undefined' ? window.location.reload() : undefined);\n this.customGetLocale = config._getLocale;\n this.customGetRegion = config._getRegion;\n this.customGetEnableI18n = config._getEnableI18n;\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(config.locale),\n });\n if (config.region !== undefined) {\n setCookieValue({\n cookieName: i18nConfig.getRegionCookieName(),\n value: config.region,\n });\n }\n this.updateEnableI18n(config.enableI18n ?? true);\n }\n\n getLocale = (): string => {\n return getBrowserLocale(this.customGetLocale);\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n this.updateLocale(locale);\n setCookieValue({\n cookieName: defaultResetLocaleCookieName,\n value: 'true',\n });\n this.reload();\n };\n\n getRegion = (): string | undefined => {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n if (cookieRegion) return cookieRegion;\n return this.customGetRegion?.();\n };\n\n setRegion = (region: string | undefined): void => {\n this.updateRegion(region);\n this.reload();\n };\n\n getEnableI18n = (): boolean => {\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return this.customGetEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n };\n\n setEnableI18n = (enableI18n: boolean): void => {\n this.updateEnableI18n(enableI18n);\n this.reload();\n };\n\n /**\n * Soft locale update\n */\n updateLocale = (locale: LocaleCandidates): void => {\n const i18nConfig = getI18nConfig();\n setCookieValue({\n cookieName: i18nConfig.getLocaleCookieName(),\n value: i18nConfig.resolveSupportedLocale(locale),\n });\n };\n\n /**\n * Soft region update\n */\n updateRegion = (region: string | undefined): void => {\n setCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n value: region ?? '',\n });\n };\n\n /**\n * Soft enableI18n update\n */\n updateEnableI18n = (enableI18n: boolean): void => {\n setCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n value: enableI18n ? 'true' : 'false',\n });\n };\n\n /**\n * Condition store updates come from either the server or the client.\n * Trigger this reload when we update a value in the condition store from\n * the client.\n */\n reload = (): void => {\n const state = {\n locale: this.getLocale(),\n region: this.getRegion(),\n enableI18n: this.getEnableI18n(),\n };\n this.customReload(state);\n };\n}\n\nfunction getBrowserLocale(getLocale?: GetLocale): string {\n const i18nConfig = getI18nConfig();\n const candidates = readBrowserLocale(i18nConfig.getLocaleCookieName());\n if (getLocale) candidates.push(getLocale());\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","//#region src/settings/settings.ts\nconst libraryDefaultLocale = \"en\";\nconst defaultTimeout = 6e4;\n//#endregion\n//#region src/logging/diagnostics.ts\nfunction ensureSentence(text) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return \"\";\n\treturn /[.!?)]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\nfunction stripSentence(text) {\n\tconst trimmed = text.trim();\n\tlet end = trimmed.length;\n\twhile (end > 0) {\n\t\tconst char = trimmed[end - 1];\n\t\tif (char !== \".\" && char !== \"!\" && char !== \"?\") break;\n\t\tend -= 1;\n\t}\n\treturn trimmed.slice(0, end);\n}\nfunction formatDetails(details) {\n\tif (!details) return \"\";\n\tconst detailText = Array.isArray(details) ? details.join(\", \") : details;\n\tif (!detailText.trim()) return \"\";\n\treturn ensureSentence(`Details: ${detailText}`);\n}\nfunction formatDiagnosticErrorDetails(error) {\n\tif (error == null) return void 0;\n\treturn String(error);\n}\nfunction createDiagnosticMessage({ source, severity, whatHappened, reassurance, why, fix, wayOut, details, docsUrl }) {\n\tconst prefix = source ? severity ? `${source} ${severity}:` : `${source}:` : severity ? `${severity}:` : \"\";\n\tconst whatAndWhy = why ? `${stripSentence(whatHappened)} because ${stripSentence(why)}` : whatHappened;\n\tconst shouldCombineWayOut = !!fix && !!wayOut && /^[a-z]/.test(stripSentence(wayOut));\n\tconst messageParts = [\n\t\twhatAndWhy,\n\t\treassurance,\n\t\tshouldCombineWayOut ? `${stripSentence(fix)}, or ${stripSentence(wayOut)}` : fix,\n\t\tshouldCombineWayOut ? void 0 : wayOut,\n\t\tformatDetails(details)\n\t].filter((part) => !!part).map(ensureSentence);\n\tif (docsUrl) messageParts.push(`Learn more: ${docsUrl}`);\n\tconst message = messageParts.join(\" \");\n\treturn prefix ? `${prefix} ${message}` : message;\n}\n//#endregion\n//#region src/settings/settingsUrls.ts\nconst defaultCacheUrl = \"https://cdn.gtx.dev\";\nconst defaultBaseUrl = \"https://api2.gtx.dev\";\nconst defaultRuntimeApiUrl = \"https://runtime2.gtx.dev\";\n//#endregion\n//#region src/translate/api.ts\nconst API_VERSION = \"2026-03-06.v1\";\n//#endregion\nexport { createDiagnosticMessage as a, libraryDefaultLocale as c, defaultRuntimeApiUrl as i, defaultBaseUrl as n, formatDiagnosticErrorDetails as o, defaultCacheUrl as r, defaultTimeout as s, API_VERSION as t };\n\n//# sourceMappingURL=api-rqq7klYe.mjs.map","import { createDiagnosticMessage } from 'generaltranslation/internal';\nimport {\n createConditionStoreSingleton,\n ReadonlyConditionStore,\n} from 'gt-i18n/internal';\nimport { BrowserConditionStore } from './BrowserConditionStore';\n\n// Both singletons below are typed views of the same global slot (namespace\n// 'i18n', key 'conditionStore'), so there is a single uninitialized state and\n// one message describes it for both getters.\nconst conditionStoreNotInitializedError = createDiagnosticMessage({\n source: 'gt-react',\n severity: 'Error',\n whatHappened: 'Cannot read GT runtime context before it has been initialized',\n why: 'the internal ConditionStore singleton is unavailable',\n fix: 'Call initializeGT() (or initializeGTSPA() in SPA apps) before rendering and add a <GTProvider> at the root of your component tree.',\n});\n\nexport const {\n setConditionStore: setReadonlyConditionStore,\n isConditionStoreInitialized: isReadonlyConditionStoreInitialized,\n} = createConditionStoreSingleton<ReadonlyConditionStore>(\n conditionStoreNotInitializedError\n);\n\nexport const {\n getConditionStore: getBrowserConditionStore,\n setConditionStore: setBrowserConditionStore,\n isConditionStoreInitialized: isBrowserConditionStoreInitialized,\n} = createConditionStoreSingleton<BrowserConditionStore>(\n conditionStoreNotInitializedError\n);\n","import type { LocaleCandidates } from 'gt-i18n/internal';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport {\n BrowserConditionStore,\n BrowserConditionStoreParams,\n} from './BrowserConditionStore';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { getCookieValue } from './cookies';\nimport {\n getBrowserConditionStore,\n isBrowserConditionStoreInitialized,\n setBrowserConditionStore,\n} from './singleton-operations';\n\nexport type CreateBrowserConditionStoreParams = Omit<\n BrowserConditionStoreParams,\n 'locale' | 'enableI18n'\n> & {\n locale?: LocaleCandidates;\n enableI18n?: boolean;\n};\n\n/**\n * Factory to create a BrowserConditionStore for Singleton\n *\n * This exists so we can keep the locale param as required in the constructor\n *\n * Server-provided props are the first candidates for hydration consistency.\n * Cookies fill in missing values to persist state across page reloads.\n *\n * Cookie names come from the I18nConfig singleton so custom names passed to\n * initializeGT() apply here without being threaded through provider props.\n */\nexport function createOrUpdateBrowserConditionStore(\n config: CreateBrowserConditionStoreParams\n) {\n const locale = determineLocale(config);\n const region = determineRegion(config);\n const enableI18n = determineEnableI18n(config);\n\n if (isBrowserConditionStoreInitialized()) {\n // This represents an update from server\n const conditionStore = getBrowserConditionStore();\n conditionStore.updateLocale(locale);\n if (region !== undefined) conditionStore.updateRegion(region);\n conditionStore.updateEnableI18n(enableI18n);\n return conditionStore;\n }\n\n const conditionStore = new BrowserConditionStore({\n ...config,\n locale,\n region,\n enableI18n,\n });\n setBrowserConditionStore(conditionStore);\n return conditionStore;\n}\n\nfunction determineLocale({\n _getLocale: getLocale,\n locale,\n}: CreateBrowserConditionStoreParams): string {\n const i18nConfig = getI18nConfig();\n const candidates = [];\n if (locale) {\n candidates.push(...(Array.isArray(locale) ? locale : [locale]));\n }\n if (getLocale) candidates.push(getLocale());\n candidates.push(...readBrowserLocale(i18nConfig.getLocaleCookieName()));\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n\nfunction determineRegion({\n _getRegion: getRegion,\n region,\n}: CreateBrowserConditionStoreParams): string | undefined {\n const cookieRegion = getCookieValue({\n cookieName: getI18nConfig().getRegionCookieName(),\n });\n return cookieRegion || getRegion?.() || region;\n}\n\nfunction determineEnableI18n({\n enableI18n,\n _getEnableI18n: getEnableI18n,\n}: CreateBrowserConditionStoreParams): boolean {\n if (enableI18n !== undefined) return enableI18n;\n\n const cookieEnableI18n = getCookieValue({\n cookieName: getI18nConfig().getEnableI18nCookieName(),\n });\n if (cookieEnableI18n === undefined) {\n return getEnableI18n?.() ?? true;\n }\n return cookieEnableI18n === 'true';\n}\n","import { getRuntimeEnvironment } from 'gt-i18n/internal';\nimport type { I18nConfigParams } from 'gt-i18n/internal/types';\n\ntype RuntimeCredentials = Pick<I18nConfigParams, 'projectId' | 'devApiKey'>;\ntype RuntimeEnv = {\n DEV?: boolean;\n VITE_GT_PROJECT_ID?: string;\n VITE_GT_DEV_API_KEY?: string;\n};\n\nexport function addRuntimeCredentials<T extends RuntimeCredentials>(\n config: T\n): T {\n const credentials = getRuntimeCredentials();\n return {\n ...config,\n projectId: config.projectId || credentials.projectId,\n devApiKey: config.devApiKey || credentials.devApiKey,\n };\n}\n\nfunction getRuntimeCredentials(): RuntimeCredentials {\n return {\n projectId:\n readImportMetaVite(\n () =>\n (\n import.meta as ImportMeta & {\n env?: RuntimeEnv;\n }\n ).env?.VITE_GT_PROJECT_ID\n ) || readProcessEnvViteProjectId(),\n devApiKey:\n getRuntimeEnvironment() === 'development'\n ? readImportMetaVite(() =>\n (import.meta as ImportMeta & { env?: RuntimeEnv }).env?.DEV\n ? (import.meta as ImportMeta & { env?: RuntimeEnv }).env\n ?.VITE_GT_DEV_API_KEY\n : undefined\n ) || readProcessEnvViteDevApiKey()\n : undefined,\n };\n}\n\nfunction readImportMetaVite(\n readValue: () => string | undefined\n): string | undefined {\n try {\n return normalizeEnvValue(readValue());\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteProjectId(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_PROJECT_ID);\n } catch {\n return undefined;\n }\n}\n\nfunction readProcessEnvViteDevApiKey(): string | undefined {\n try {\n return normalizeEnvValue(process.env.VITE_GT_DEV_API_KEY);\n } catch {\n return undefined;\n }\n}\n\nfunction normalizeEnvValue(value: string | undefined): string | undefined {\n return value || undefined;\n}\n","import {\n getTranslationsSnapshot,\n I18nStore,\n setI18nStore,\n setReactI18nCache,\n getReadonlyConditionStore,\n initializeI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { I18nConfigParams } from '@generaltranslation/react-core/pure';\nimport { BrowserI18nCache } from '../i18n-cache/BrowserI18nCache';\nimport type { BrowserI18nCacheParams } from '../i18n-cache/BrowserI18nCache';\nimport {\n createOrUpdateBrowserConditionStore,\n CreateBrowserConditionStoreParams,\n} from '../condition-store/createBrowserConditionStore';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTSPAParams = I18nConfigParams &\n BrowserI18nCacheParams &\n CreateBrowserConditionStoreParams;\n\n/**\n * Initialize GT for an SPA\n * - i18nCache\n * - conditionStore\n * - i18nStore\n *\n * This is SPA for browser runtime\n */\nexport async function initializeGTSPA(config: InitializeGTSPAParams) {\n const runtimeConfig = addRuntimeCredentials(config);\n initializeI18nConfig(runtimeConfig, 'SPA');\n\n const i18nCache = new BrowserI18nCache(runtimeConfig);\n setReactI18nCache(i18nCache);\n\n createOrUpdateBrowserConditionStore(runtimeConfig);\n\n const i18nStore = new I18nStore();\n setI18nStore(i18nStore);\n\n // Block until translations are loaded\n await getTranslationsSnapshot(getReadonlyConditionStore().getLocale());\n}\n","import {\n internalInitializeGTSRA,\n type ReactInitializeGTParams,\n} from '@generaltranslation/react-core/pure';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\nexport type InitializeGTClientParams = ReactInitializeGTParams;\n\n/**\n * Initialize GT for client-side rendering.\n */\nexport function initializeGTSRAClient(config: InitializeGTClientParams): void {\n internalInitializeGTSRA(\n addRuntimeCredentials({\n cacheExpiryTime: null,\n ...config,\n })\n );\n}\n","import { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getCookieValue, parseAcceptLanguage } from 'gt-i18n/internal';\n\ntype RequestWithHeaders = Pick<Request, 'headers'>;\n\n/**\n * Resolve the user's locale from a Web Request.\n *\n * The configured locale cookie takes precedence over the Accept-Language\n * header. If neither contains a supported locale, the configured default\n * locale is returned.\n *\n * This is intended for incoming server requests. A Request created in the\n * browser does not automatically include document cookies or Accept-Language.\n */\nexport function parseLocale(request: RequestWithHeaders): string {\n const i18nConfig = getI18nConfig();\n const candidates: string[] = [];\n const cookieLocale = getCookieValue(\n request.headers.get('cookie'),\n i18nConfig.getLocaleCookieName()\n );\n\n if (cookieLocale) {\n candidates.push(cookieLocale);\n }\n\n candidates.push(\n ...parseAcceptLanguage(request.headers.get('accept-language'))\n );\n\n return i18nConfig.resolveSupportedLocale(candidates);\n}\n","import {\n useInternalLocaleSelector,\n useSetLocale,\n} from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a locale selector.\n * Provides locale management utilities for the application.\n *\n * @param locales an optional list of locales to use for the drop down. These locales must be a subset of the locales provided by the `<GTProvider>` context. When not provided, the list of locales from the `<GTProvider>` context is used.\n *\n * @returns {Object} An object containing locale-related utilities:\n * @returns {string} return.locale - The currently selected locale.\n * @returns {string[]} return.locales - The list of all available locales.\n * @returns {function} return.setLocale - Function to update the current locale.\n * @returns {(locale: string) => LocaleProperties} return.getLocaleProperties - Function to retrieve properties for a given locale.\n */\nexport function useLocaleSelector(locales?: string[]) {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n","import {\n useInternalRegionSelector,\n useSetLocale,\n useSetRegion,\n} from '@generaltranslation/react-core/hooks';\nimport type { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';\n\n/**\n * Gets the list of properties for using a region selector.\n * Provides region management utilities for the application.\n *\n * @param {Object} [options] - Optional configuration object.\n * @param {string[]} [options.regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from supported locales.\n * @param {Object} [options.customMapping] - Optional mapping to override region display names, emojis, or associated locales.\n * @param {boolean} [options.prioritizeCurrentLocaleRegion=true] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [options.sortRegionsAlphabetically=true] - If true, regions are sorted alphabetically by display name.\n *\n * @returns {Object} An object containing region-related utilities:\n * @returns {string | undefined} return.region - The currently selected region code.\n * @returns {function} return.setRegion - Function to update the current region.\n * @returns {string[]} return.regions - The ordered list of available region codes.\n * @returns {Map<string, RegionData>} return.regionData - Map of region codes to their display data (name, emoji, locale).\n * @returns {string} return.locale - The current locale.\n * @returns {function} return.setLocale - Function to update the current locale.\n */\nexport function useRegionSelector(options?: InternalRegionSelectorOptions) {\n const setRegion = useSetRegion();\n const setLocale = useSetLocale();\n return { setRegion, setLocale, ...useInternalRegionSelector(options) };\n}\n","import type React from 'react';\nimport { InternalLocaleSelector } from '@generaltranslation/react-core/components';\nimport { CustomMapping } from 'generaltranslation/types';\nimport { useLocaleSelector } from './useLocaleSelector';\n\n/**\n * A dropdown component that allows users to select a locale.\n * @param {string[]} [locales] - An optional list of locales to use for the dropdown. If not provided, the list of locales from the `<GTProvider>` context is used.\n * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.\n * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.\n * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.\n */\nexport function LocaleSelector({\n locales: _locales,\n ...props\n}: LocaleSelectorProps): React.JSX.Element | null {\n // Get locale selector properties\n const { locale, locales, getLocaleProperties, setLocale } =\n useLocaleSelector(_locales);\n\n return (\n <InternalLocaleSelector\n locale={locale}\n locales={locales}\n setLocale={setLocale}\n getLocaleProperties={getLocaleProperties}\n {...props}\n />\n );\n}\n\nexport type LocaleSelectorProps = {\n locales?: string[];\n customNames?: { [key: string]: string };\n customMapping?: CustomMapping;\n [key: string]: any;\n};\n","import type React from 'react';\nimport type { ReactNode } from 'react';\nimport { InternalRegionSelector } from '@generaltranslation/react-core/components';\nimport { useRegionSelector } from './useRegionSelector';\n\n/**\n * A dropdown component that allows users to select a region.\n * @param {string[]} [regions] - An optional array of ISO 3166 region codes to display. If not provided, regions are inferred from the supported locales in the `<GTProvider>` context.\n * @param {React.ReactNode} [placeholder] - Optional placeholder node to display as the first option when no region is selected.\n * @param {object} [customMapping] - An optional object to map region codes to custom display names, emojis, or associated locales.\n * @param {boolean} [prioritizeCurrentLocaleRegion] - If true, the region corresponding to the current locale is prioritized in the list.\n * @param {boolean} [sortRegionsAlphabetically] - If true, regions are sorted alphabetically by display name.\n * @param {boolean} [asLocaleSelector=false] - If true, selecting a region will also update the locale to the region's associated locale.\n * @returns {React.ReactElement | null} The rendered region dropdown component or null to prevent rendering.\n *\n * @example\n * ```tsx\n * <RegionSelector\n * regions={['US', 'CA']}\n * customMapping={{ US: { name: \"United States\", emoji: \"🇺🇸\" } }}\n * placeholder=\"Select a region\"\n * />\n * ```\n */\nexport function RegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n asLocaleSelector = false,\n ...props\n}: RegionSelectorProps): React.JSX.Element | null {\n // Get region selector properties\n const { region, regions, regionData, locale, setRegion, setLocale } =\n useRegionSelector({\n regions: _regions,\n customMapping,\n prioritizeCurrentLocaleRegion,\n sortRegionsAlphabetically,\n });\n\n const changeRegion = (region: string) => {\n if (asLocaleSelector) {\n const regionLocale = regionData.get(region)?.locale;\n // setRegion reloads the page; update the locale cookie first\n if (regionLocale && locale !== regionLocale) setLocale(regionLocale);\n }\n setRegion(region);\n };\n\n return (\n <InternalRegionSelector\n region={region}\n regions={regions}\n regionData={regionData}\n setRegion={changeRegion}\n {...props}\n />\n );\n}\n\nexport type RegionSelectorProps = {\n regions?: string[];\n placeholder?: ReactNode;\n customMapping?: {\n [region: string]:\n | string\n | { name?: string; emoji?: string; locale?: string };\n };\n prioritizeCurrentLocaleRegion?: boolean;\n sortRegionsAlphabetically?: boolean;\n asLocaleSelector?: boolean;\n [key: string]: any;\n};\n","import {\n I18nStore,\n InternalGTProvider,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { SharedGTProviderProps } from './GTProviderProps';\nimport { createOrUpdateBrowserConditionStore } from '../condition-store/createBrowserConditionStore';\n\n/**\n * Consumes snapshot from server\n * Implementation for client-side only\n */\nexport function BrowserGTProvider(props: SharedGTProviderProps) {\n const conditionStore = useMemo(() => {\n return createOrUpdateBrowserConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport type { TxProps } from './utils/TxProps';\n\nexport { initializeGTSPA } from './setup/initializeGTSPA';\nexport { initializeGTSRAClient as initializeGT } from './setup/initializeGTSRAClient';\nexport { createOrUpdateBrowserConditionStore } from './condition-store/createBrowserConditionStore';\nexport { parseLocale } from './functions/parseLocale';\nexport { useLocaleSelector } from './components/useLocaleSelector';\nexport { useRegionSelector } from './components/useRegionSelector';\n\n// ===== Components ===== //\nexport { LocaleSelector } from './components/LocaleSelector';\nexport { RegionSelector } from './components/RegionSelector';\nexport { BrowserGTProvider as GTProvider } from './provider/BrowserGTProvider';\n\n// ===== Components ===== //\nexport {\n Branch,\n Plural,\n Derive,\n GtInternalTranslateJsx,\n GtInternalVar,\n T,\n Currency,\n DateTime,\n RelativeTime,\n Var,\n Num,\n} from '@generaltranslation/react-core/components';\n\nexport async function Tx(_props: TxProps): Promise<ReactNode> {\n throw new Error('Tx is only supported via RSC');\n}\n\n// ===== Hooks ===== //\nexport {\n useLocale,\n useRegion,\n useCustomMapping,\n useDefaultLocale,\n useEnableI18n,\n useLocales,\n useFormatLocales,\n useGT,\n useMessages,\n useTranslations,\n useLocaleDirection,\n useLocaleProperties,\n useSetLocale,\n useSetRegion,\n useSetEnableI18n,\n} from '@generaltranslation/react-core/hooks';\n\n// ===== Functions ===== //\nexport {\n msg,\n decodeMsg,\n decodeOptions,\n derive,\n declareVar,\n decodeVars,\n mFallback,\n gtFallback,\n getFormatLocales,\n getDefaultLocale,\n getLocaleProperties,\n getLocales,\n resolveCanonicalLocale,\n getReactI18nCache,\n getTranslationsSnapshot,\n getVersionId,\n createRenderPipeline,\n setReactI18nCache,\n t,\n} from '@generaltranslation/react-core/pure';\n\nexport type {\n RenderPipeline,\n RenderPreparedT,\n} from '@generaltranslation/react-core/pure';\n\nexport type { SharedGTProviderProps } from './provider/GTProviderProps';\nexport {\n GtInternalRuntimeTranslateJsx,\n GtInternalRuntimeTranslateString,\n} from 'gt-i18n/internal';\nexport type {\n GTTranslationOptions,\n RuntimeTranslationOptions,\n} from 'gt-i18n/types';\nexport type {\n SyncResolutionFunction,\n SyncResolutionFunctionWithFallback,\n} from 'gt-i18n/types';\n\n// ===== Singletons ===== //\nexport {\n ReactI18nCache,\n type ReactI18nCacheParams,\n} from '@generaltranslation/react-core/pure';\n"],"mappings":";;;;;;;;AAiBA,IAAI;;;;AAcJ,IAAa,mBAAb,cAAsC,UAAuB;C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U;EACC;EACE;EACU;EACrB,GAAI;EACJ,CAAA;;;;;;;;;;;;;;;;;;;;;;;ACHN,SAAgB,eAAe,EAC7B,SAAS,UACT,eACA,+BACA,2BACA,mBAAmB,OACnB,GAAG,SAC6C;CAEhD,MAAM,EAAE,QAAQ,SAAS,YAAY,QAAQ,WAAW,cACtD,kBAAkB;EAChB,SAAS;EACT;EACA;EACA;EACD,CAAC;CAEJ,MAAM,gBAAgB,WAAmB;AACvC,MAAI,kBAAkB;GACpB,MAAM,eAAe,WAAW,IAAI,OAAO,EAAE;AAE7C,OAAI,gBAAgB,WAAW,aAAc,WAAU,aAAa;;AAEtE,YAAU,OAAO;;AAGnB,QACE,oBAAC,wBAAD;EACU;EACC;EACG;EACZ,WAAW;EACX,GAAI;EACJ,CAAA;;;;;;;;AC7CN,SAAgB,kBAAkB,OAA8B;CAC9D,MAAM,iBAAiB,cAAc;AACnC,SAAO,oCAAoC,MAAM;IAChD;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,eAAe,OAAyB,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAIC,aAAW;AAGxC,QACE,oBAAC,oBAAD;EACE,GAAI;EACY;EAChB,WAAW,aAAa;EACxB,CAAA;;;;ACKN,eAAsB,GAAG,QAAqC;AAC5D,OAAM,IAAI,MAAM,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.server.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/utils/TxProps.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/provider/GTProviderProps.ts","../src/provider/ServerGTProvider.tsx","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/index.server.ts"],"mappings":";;;;;;;;;;;;;;KAGY,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"index.server.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/utils/TxProps.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/provider/GTProviderProps.ts","../src/provider/ServerGTProvider.tsx","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/index.server.ts"],"mappings":";;;;;;;;;;;;;;KAGY,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;AFfjC;;KEqBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;AFvBZ;cE6Ba,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAAA;EAAA,QACA,eAAA;EAAA,QACA,eAAA;EAAA,QACA,mBAAA;cAEI,MAAA,EAAQ,2BAAA;EAsBpB,SAAA;EAIA,SAAA,GAAa,MAAA,EAAQ,gBAAA;EASrB,SAAA;EAQA,SAAA,GAAa,MAAA;EAKb,aAAA;EAUA,aAAA,GAAiB,UAAA;ED1EP;;;ECkFV,YAAA,GAAgB,MAAA,EAAQ,gBAAA;EDlFW;;;EC6FnC,YAAA,GAAgB,MAAA;ED5Fe;;;ECsG/B,gBAAA,GAAoB,UAAA;EAlHjB;;;;;EA8HH,MAAA;AAAA;;;KC7HU,iCAAA,GAAoC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CDY,gBAAA,CAAA;EACd,MAAA;EACA,MAAA;EACA,UAAA;EAAA,GACG;AAAA,GACF,qBAAA,GAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;;;iBCNR,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EAAA,GACN;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KAgBvB,mBAAA;EACV,OAAA;EACA,WAAA;IAAA,CAAiB,GAAA;EAAA;EACjB,aAAA,GAAgB,aAAA;EAAA,CACf,GAAA;AAAA;;;;;;;;;;;;AbhCH;;;;;AACA;;;;;iBcoBgB,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EACT,aAAA;EACA,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KA8BvB,mBAAA;EACV,OAAA;EACA,WAAA,GAAc,SAAA;EACd,aAAA;IAAA,CACG,MAAA;MAEK,IAAA;MAAe,KAAA;MAAgB,MAAA;IAAA;EAAA;EAEvC,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,CACC,GAAA;AAAA;;;KCzDE,eAAA,UAAe,iBAAA;AAAA,KACf,mCAAA,UAAmC,qCAAA;AAAA,cAY3B,eAAA,EAAiB,eAAA;AAAA,cAajB,mCAAA,EAAqC,mCAAA;AAAA,iBAyB5B,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.server.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/utils/TxProps.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/provider/GTProviderProps.ts","../src/provider/ServerGTProvider.tsx","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/index.server.ts"],"mappings":";;;;;;;;;;;;;;KAGY,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"index.server.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/utils/TxProps.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/provider/GTProviderProps.ts","../src/provider/ServerGTProvider.tsx","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/index.server.ts"],"mappings":";;;;;;;;;;;;;;KAGY,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;AFfjC;;KEqBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;AFvBZ;cE6Ba,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAAA;EAAA,QACA,eAAA;EAAA,QACA,eAAA;EAAA,QACA,mBAAA;cAEI,MAAA,EAAQ,2BAAA;EAsBpB,SAAA;EAIA,SAAA,GAAa,MAAA,EAAQ,kBAAA;EASrB,SAAA;EAQA,SAAA,GAAa,MAAA;EAKb,aAAA;EAUA,aAAA,GAAiB,UAAA;ED1EP;;;ECkFV,YAAA,GAAgB,MAAA,EAAQ,kBAAA;EDlFW;;;EC6FnC,YAAA,GAAgB,MAAA;ED5Fe;;;ECsG/B,gBAAA,GAA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AClC,uBAAA,oCAGA,IAAA,CAAK,2BAAA;EACH,MAAA;AAAA;;;;;;;iBCDY,gBAAA,CAAA;EACd,MAAA;EACA,MAAA;EACA,UAAA;EAAA,GACG;AAAA,GACF,qBAAA,GAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;;;;iBCNR,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EAAA,GACN;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KAgBvB,mBAAA;EACV,OAAA;EACA,WAAA;IAAA,CAAiB,GAAA;EAAA;EACjB,aAAA,GAAgB,aAAA;EAAA,CACf,GAAA;AAAA;;;;;;;;;;;;AbhCH;;;;;AACA;;;;;iBcoBgB,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EACT,aAAA;EACA,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KA8BvB,mBAAA;EACV,OAAA;EACA,WAAA,GAAc,SAAA;EACd,aAAA;IAAA,CACG,MAAA;MAEK,IAAA;MAAe,KAAA;MAAgB,MAAA;IAAA;EAAA;EAEvC,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,CACC,GAAA;AAAA;;;KCzDE,eAAA,UAAe,iBAAA;AAAA,KACf,mCAAA,UAAmC,qCAAA;AAAA,cAY3B,eAAA,EAAiB,eAAA;AAAA,cAajB,mCAAA,EAAqC,mCAAA;AAAA,iBAyB5B,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.types.ts"],"mappings":";;;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"index.types.d.cts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.types.ts"],"mappings":";;;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;;AHhBjC;KGsBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;;cAMC,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAAA;EAAA,QACA,eAAA;EAAA,QACA,eAAA;EAAA,QACA,mBAAA;cAEI,M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;;;;ATfjC;;;;;;;iBUuBgB,iBAAA,CAAkB,OAAA,GAAU,6BAAA;;;0BAA6B,uCAAA,CAAA,UAAA;;;;;;;;;;;;;;;iBCbzD,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EAAA,GACN;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KAgBvB,mBAAA;EACV,OAAA;EACA,WAAA;IAAA,CAAiB,GAAA;EAAA;EACjB,aAAA,GAAgB,aAAA;EAAA,CACf,GAAA;AAAA;;;;;;;;;;;;;AXjCH;;;;;;;;;iBYsBgB,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EACT,aAAA;EACA,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KA8BvB,mBAAA;EACV,OAAA;EACA,WAAA,GAAc,SAAA;EACd,aAAA;IAAA,CACG,MAAA;MAEK,IAAA;MAAe,KAAA;MAAgB,MAAA;IAAA;EAAA;EAEvC,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,CACC,GAAA;AAAA;;;;;;;;;KC/DS,qBAAA,GAAwB,IAAA,CAClC,uBAAA,oCAGA,IAAA,CAAK,2BAAA;EACH,MAAA;AAAA;;;;;;;iBCFY,iBAAA,CAAkB,KAAA,EAAO,qBAAA,GAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCoBxC,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.types.ts"],"mappings":";;;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"index.types.d.mts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y"],"sources":["../src/utils/TxProps.ts","../src/i18n-cache/types.ts","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRA.ts","../src/functions/parseLocale.ts","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/components/LocaleSelector.tsx","../src/components/RegionSelector.tsx","../src/provider/GTProviderProps.ts","../src/provider/BrowserGTProvider.tsx","../src/index.types.ts"],"mappings":";;;;;;;;;;;;KAEY,OAAA,GAAU,MAAA,SAAe,SAAA;EACnC,QAAA,EAAU,SAAA;EACV,OAAA;EACA,MAAA;EACA,QAAA;AAAA;;;;;;KCHU,SAAA;AAAA,KACA,SAAA;AAAA,KACA,aAAA;;;;;;KAOA,cAAA;EACV,iBAAA;EACA,gBAAA;AAAA;;;;;;KCUU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCZd,oCAAA;EACH,MAAA;EACA,MAAA;EACA,UAAA;AAAA;AAAA,KAEU,UAAA,IAAc,KAAA,EAAO,oCAAA;;;;AHhBjC;KGsBY,2BAAA,GAA8B,4BAAA;EACxC,UAAA,GAAa,SAAA;EACb,UAAA,GAAa,SAAA;EACb,cAAA,GAAiB,aAAA;EACjB,OAAA,GAAU,UAAA;AAAA;;;;cAMC,qBAAA,YAAiC,+BAAA;EAAA,QACpC,YAAA;EAAA,QACA,eAAA;EAAA,QACA,eAAA;EAAA,QACA,mBAAA;cAEI,MAAA,EAAQ,2BAAA;EAsBpB,SAAA;EAI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AAkB,OAAA,GAAU,6BAAA;;;0BAA6B,uCAAA,CAAA,UAAA;;;;;;;;;;;;;;;iBCbzD,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EAAA,GACN;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KAgBvB,mBAAA;EACV,OAAA;EACA,WAAA;IAAA,CAAiB,GAAA;EAAA;EACjB,aAAA,GAAgB,aAAA;EAAA,CACf,GAAA;AAAA;;;;;;;;;;;;;AXjCH;;;;;;;;;iBYsBgB,cAAA,CAAA;EACd,OAAA,EAAS,QAAA;EACT,aAAA;EACA,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,GACG;AAAA,GACF,mBAAA,GAAsB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,KA8BvB,mBAAA;EACV,OAAA;EACA,WAAA,GAAc,SAAA;EACd,aAAA;IAAA,CACG,MAAA;MAEK,IAAA;MAAe,KAAA;MAAgB,MAAA;IAAA;EAAA;EAEvC,6BAAA;EACA,yBAAA;EACA,gBAAA;EAAA,CACC,GAAA;AAAA;;;;;;;;;KC/DS,qBAAA,GAAwB,IAAA,CAClC,uBAAA,oCAGA,IAAA,CAAK,2BAAA;EACH,MAAA;AAAA;;;;;;;iBCFY,iBAAA,CAAkB,KAAA,EAAO,qBAAA,GAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;;;iBCoBxC,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gt-react",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.7",
|
|
4
4
|
"description": "A React library for automatic internationalization.",
|
|
5
5
|
"main": "./dist/index.server.cjs",
|
|
6
6
|
"module": "./dist/index.server.mjs",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"react-dom": ">=18.0.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"generaltranslation": "
|
|
21
|
-
"
|
|
22
|
-
"
|
|
20
|
+
"@generaltranslation/react-core": "11.1.7",
|
|
21
|
+
"gt-i18n": "1.0.13",
|
|
22
|
+
"generaltranslation": "9.1.3"
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
26
|
"url": "git+https://github.com/generaltranslation/gt.git"
|
|
27
27
|
},
|
|
28
28
|
"author": "General Translation, Inc.",
|
|
29
|
-
"license": "
|
|
29
|
+
"license": "MIT",
|
|
30
30
|
"bugs": {
|
|
31
31
|
"url": "https://github.com/generaltranslation/gt/issues"
|
|
32
32
|
},
|