gt-react 11.0.0-odysseus.9 → 11.0.0
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 +254 -0
- package/dist/index.client.cjs +98 -92
- package/dist/index.client.cjs.map +1 -1
- package/dist/index.client.d.cts +17 -39
- package/dist/index.client.d.cts.map +1 -1
- package/dist/index.client.d.mts +17 -39
- package/dist/index.client.d.mts.map +1 -1
- package/dist/index.client.mjs +96 -75
- package/dist/index.client.mjs.map +1 -1
- package/dist/index.rsc.cjs +15 -117
- package/dist/index.rsc.cjs.map +1 -1
- package/dist/index.rsc.d.cts +4 -11
- package/dist/index.rsc.d.cts.map +1 -1
- package/dist/index.rsc.d.mts +4 -11
- package/dist/index.rsc.d.mts.map +1 -1
- package/dist/index.rsc.mjs +8 -18
- package/dist/index.rsc.mjs.map +1 -1
- package/dist/index.server.cjs +51 -531
- package/dist/index.server.cjs.map +1 -1
- package/dist/index.server.d.cts +25 -39
- package/dist/index.server.d.cts.map +1 -1
- package/dist/index.server.d.mts +25 -39
- package/dist/index.server.d.mts.map +1 -1
- package/dist/index.server.mjs +50 -504
- package/dist/index.server.mjs.map +1 -1
- package/dist/index.types.cjs +105 -102
- package/dist/index.types.cjs.map +1 -1
- package/dist/index.types.d.cts +22 -38
- package/dist/index.types.d.cts.map +1 -1
- package/dist/index.types.d.mts +22 -38
- package/dist/index.types.d.mts.map +1 -1
- package/dist/index.types.mjs +102 -73
- package/dist/index.types.mjs.map +1 -1
- package/package.json +6 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.cjs","names":["I18nCache","I18nStore","InternalLocaleSelector","InternalRegionSelector","I18nStore","InternalGTProvider"],"sources":["../src/i18n-cache/constants.ts","../src/i18n-cache/LocalStorageTranslationCache.ts","../../core/dist/base64-r7YWJYWt.mjs","../src/i18n-cache/BrowserI18nCache.ts","../src/condition-store/cookies.ts","../src/condition-store/readBrowserLocale.ts","../src/cookie-names.ts","../src/condition-store/BrowserConditionStore.ts","../src/condition-store/singleton-operations.ts","../src/condition-store/createBrowserConditionStore.ts","../src/setup/initializeGTSPA.ts","../src/setup/initializeGTSRAClient.ts","../src/hooks/conditions-store.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","import { Translation } from 'gt-i18n/types';\n\n// TODO: Add purge key/locks to prevent concurrent purges across tabs\n// TODO: Add cache key/locks for non-atomic read-modify-write operations across tabs\n\n// ===== Types ===== //\n\n/** A cached translation entry with expiry metadata */\ntype CachedEntry = { t: Translation; exp: number };\n\n// ===== Constants ===== //\n\nconst STORAGE_KEY_PREFIX = 'gt:tx:';\nconst PURGE_TIMESTAMP_PREFIX = 'gt:tx:purge:';\nconst FLUSH_INTERVAL = 500;\nconst DEFAULT_MAX_SIZE = 1_000_000; // ~1M characters (localStorage uses UTF-16)\nconst DEFAULT_TTL_MS = 86_400_000; // 24 hours\nconst DEFAULT_PURGE_INTERVAL_MS = 300_000; // 5 minutes\nconst PURGE_TARGET_RATIO = 0.8; // purge down to 80% of max\n\n// Prevents interval leaks on HMR — keyed by storage key\nconst activeIntervals = new Map<string, ReturnType<typeof setInterval>>();\n\n// ===== Class ===== //\n\n/**\n * A localStorage-backed translation cache for a single locale.\n * Used in development mode only to persist runtime translations across page refreshes.\n *\n * Entries are stored with per-entry expiry timestamps and the cache is purged\n * when estimated size exceeds the configured maximum.\n */\nexport class LocalStorageTranslationCache {\n private _storageKey: string;\n private _writeBuffer: Record<string, Translation> = {};\n private _flushTimer: ReturnType<typeof setTimeout> | null = null;\n private _estimatedSize: number = 0;\n private _maxSize: number;\n private _ttl: number;\n private _purgeInterval: number;\n private _purgeTimestampKey: string;\n\n /**\n * @param locale - The locale this cache is for\n * @param projectId - The project id (namespaces localStorage keys)\n * @param init - Optional initial translations to merge on top of localStorage data.\n * init values take priority over stale localStorage entries.\n * @param maxSize - Maximum cache size in characters (default: ~1M)\n * @param ttl - TTL in milliseconds for each entry (default: 24 hours)\n * @param purgeInterval - Background purge check interval in ms (default: 5 min)\n */\n constructor({\n locale,\n projectId,\n init,\n maxSize,\n ttl,\n purgeInterval,\n }: {\n locale: string;\n projectId: string;\n init?: Record<string, Translation>;\n maxSize?: number;\n ttl?: number;\n purgeInterval?: number;\n }) {\n this._storageKey = `${STORAGE_KEY_PREFIX}${projectId}:${locale}`;\n this._purgeTimestampKey = `${PURGE_TIMESTAMP_PREFIX}${projectId}:${locale}`;\n this._maxSize = maxSize ?? DEFAULT_MAX_SIZE;\n this._ttl = ttl ?? DEFAULT_TTL_MS;\n this._purgeInterval = purgeInterval ?? DEFAULT_PURGE_INTERVAL_MS;\n\n // Merge init values on top (init wins on conflict)\n if (init) {\n this.initStorage(init);\n }\n\n // Start background purge interval (clears any existing interval for HMR safety)\n if (activeIntervals.has(this._storageKey)) {\n clearInterval(activeIntervals.get(this._storageKey)!);\n }\n const intervalId = setInterval(\n () => this._backgroundPurge(),\n this._purgeInterval\n );\n activeIntervals.set(this._storageKey, intervalId);\n }\n\n /**\n * Returns the full translation map (cache + pending buffer writes).\n * Filters out expired entries. Buffer entries take priority.\n */\n getInternalCache(): Record<string, Translation> {\n const now = Date.now();\n const cache = this._readFromStorage();\n const result: Record<string, Translation> = {};\n\n for (const [key, entry] of Object.entries(cache)) {\n if (entry.exp > now) {\n result[key] = entry.t;\n }\n }\n\n // Buffer entries are always fresh\n Object.assign(result, this._writeBuffer);\n return result;\n }\n\n /**\n * Queue a translation for writing to localStorage.\n * Writes are batched via a debounced flush.\n */\n write(hash: string, translation: Translation): void {\n this._writeBuffer[hash] = translation;\n this._scheduleFlush();\n }\n\n /**\n * Remove specific entries from the cache by hash.\n */\n purge(hashes: string[]): void {\n const cache = this._readFromStorage();\n for (const hash of hashes) {\n delete cache[hash];\n }\n this._writeRaw(JSON.stringify(cache));\n }\n\n // ===== Private Methods ===== //\n\n /**\n * Schedule a flush of the write buffer.\n * Uses a leading throttle — the first write in a burst schedules a flush\n * after FLUSH_INTERVAL ms; subsequent writes before the timer fires are\n * batched into the same flush.\n */\n private _scheduleFlush(): void {\n if (this._flushTimer) return; // already scheduled\n this._flushTimer = setTimeout(() => {\n this._flushTimer = null;\n this._flush();\n }, FLUSH_INTERVAL);\n }\n\n /**\n * Merge the write buffer into the cache and persist to localStorage.\n * Purges before writing if estimated size exceeds max.\n */\n private _flush(): void {\n if (Object.keys(this._writeBuffer).length === 0) return;\n\n try {\n const cache = this._readFromStorage();\n const now = Date.now();\n\n // Purge if estimated size exceeds max\n if (this._estimatedSize > this._maxSize) {\n this._purgeCache(cache, now);\n }\n\n // Merge buffer entries with expiry\n const exp = now + this._ttl;\n for (const [key, value] of Object.entries(this._writeBuffer)) {\n cache[key] = { t: value, exp };\n }\n\n this._writeRaw(JSON.stringify(cache));\n } catch {\n // Silently fail\n }\n\n this._writeBuffer = {};\n }\n\n /**\n * Purge entries from the cache in place.\n * Phase 1: Remove expired entries.\n * Phase 2: If still over target, drop oldest entries by expiry time.\n */\n private _purgeCache(cache: Record<string, CachedEntry>, now: number): void {\n const keysBeforePurge = Object.keys(cache);\n if (keysBeforePurge.length === 0) return;\n\n const avgEntrySize = this._estimatedSize / keysBeforePurge.length;\n\n // Phase 1: Remove expired entries\n deleteExpiredEntries(cache, now);\n\n // Phase 2: If still over target, drop oldest entries\n const targetSize = this._maxSize * PURGE_TARGET_RATIO;\n const maxEntries = Math.floor(targetSize / avgEntrySize);\n\n const remaining = Object.entries(cache);\n if (remaining.length > maxEntries) {\n remaining.sort((a, b) => a[1].exp - b[1].exp); // oldest first\n const toDrop = remaining.length - maxEntries;\n for (let i = 0; i < toDrop; i++) {\n delete cache[remaining[i][0]];\n }\n }\n }\n\n /**\n * Background purge triggered by setInterval.\n * Checks the last purge timestamp to avoid redundant work across tabs,\n * then removes expired entries. Only writes back if something changed.\n * Timestamp is updated after the purge completes.\n */\n private _backgroundPurge(): void {\n try {\n // Check if a purge is needed (another tab may have purged recently)\n const raw = localStorage.getItem(this._purgeTimestampKey);\n const lastPurge = raw ? parseInt(raw, 10) : 0;\n const now = Date.now();\n\n if (now - lastPurge < this._purgeInterval) return;\n\n // Run TTL purge\n const cache = this._readFromStorage();\n const keysBefore = Object.keys(cache).length;\n\n deleteExpiredEntries(cache, now);\n\n // Only write back if something was actually purged\n if (Object.keys(cache).length < keysBefore) {\n this._writeRaw(JSON.stringify(cache));\n }\n\n // Update timestamp after purge completes\n localStorage.setItem(this._purgeTimestampKey, String(now));\n } catch {\n // Silently fail\n }\n }\n\n /**\n * Read and parse translations from localStorage.\n * Recalibrates estimated size as a side effect.\n * Returns empty object on any error (unavailable, corrupt data, etc.)\n */\n private _readFromStorage(): Record<string, CachedEntry> {\n try {\n const raw = localStorage.getItem(this._storageKey);\n if (!raw) {\n this._estimatedSize = 0;\n return {};\n }\n this._estimatedSize = raw.length;\n return JSON.parse(raw) as Record<string, CachedEntry>;\n } catch {\n this._estimatedSize = 0;\n return {};\n }\n }\n\n /**\n * Persist new entries to localStorage with expiry timestamps.\n * Reads current cache, merges buffer on top, writes back.\n */\n private initStorage(buffer: Record<string, Translation>): void {\n try {\n const cache = this._readFromStorage();\n const exp = Date.now() + this._ttl;\n\n for (const [key, value] of Object.entries(buffer)) {\n cache[key] = { t: value, exp };\n }\n\n this._writeRaw(JSON.stringify(cache));\n } catch {\n // Silently fail — localStorage may be unavailable or full\n }\n }\n\n /**\n * Write a pre-serialized string to localStorage and recalibrate estimate.\n */\n private _writeRaw(serialized: string): void {\n try {\n localStorage.setItem(this._storageKey, serialized);\n this._estimatedSize = serialized.length;\n } catch {\n // Silently fail — localStorage may be unavailable or full\n }\n }\n}\n\n// ===== Helper Functions ===== //\n\n/**\n * Helper function deletes expired entries from a cache in place.\n */\nfunction deleteExpiredEntries(\n cache: Record<string, CachedEntry>,\n now: number = Date.now()\n): void {\n for (const key of Object.keys(cache)) {\n if (cache[key].exp <= now) {\n delete cache[key];\n }\n }\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 lowercaseFirstWord(text) {\n\treturn text.replace(/^[A-Z][a-z]/, (match) => match.toLowerCase());\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 ${lowercaseFirstWord(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 ${lowercaseFirstWord(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/utils/isSupportedFileFormatTransform.ts\nconst SUPPORTED_TRANSFORMATIONS = {\n\tGTJSON: [\"GTJSON\"],\n\tJSON: [\"JSON\"],\n\tPO: [\"PO\"],\n\tPOT: [\"POT\", \"PO\"],\n\tYAML: [\"YAML\"],\n\tMDX: [\"MDX\"],\n\tMD: [\"MD\"],\n\tTS: [\"TS\"],\n\tJS: [\"JS\"],\n\tHTML: [\"HTML\"],\n\tTXT: [\"TXT\"],\n\tTWILIO_CONTENT_JSON: [\"TWILIO_CONTENT_JSON\"]\n};\n/**\n* This function checks if a file format transformation is supported during translation\n* @param from - The source file format.\n* @param to - The target file format.\n* @returns True if the transformation is supported, false otherwise\n*/\nfunction isSupportedFileFormatTransform(from, to) {\n\treturn SUPPORTED_TRANSFORMATIONS[from]?.includes(to) ?? false;\n}\n//#endregion\n//#region src/translate/utils/validateFileFormatTransform.ts\n/**\n* Returns a user-facing validation error when a requested file format transform\n* is missing source format context or is not currently supported.\n*/\nfunction getFileFormatTransformError(file) {\n\tif (!file.transformFormat) return void 0;\n\tconst fileLabel = file.fileName ?? file.fileId ?? \"unknown file\";\n\tif (!file.fileFormat) return `fileFormat is required when transformFormat is provided for ${fileLabel}`;\n\tif (!isSupportedFileFormatTransform(file.fileFormat, file.transformFormat)) return `Unsupported file format transform: ${file.fileFormat} -> ${file.transformFormat}`;\n}\n/**\n* Validates file format transforms before sending upload/enqueue requests.\n*/\nfunction validateFileFormatTransforms(files) {\n\tfor (const file of files) {\n\t\tconst error = getFileFormatTransformError(file);\n\t\tif (error) throw new Error(error);\n\t}\n}\n//#endregion\n//#region src/utils/base64.ts\nfunction encode(data) {\n\tif (typeof Buffer !== \"undefined\") return Buffer.from(data, \"utf8\").toString(\"base64\");\n\tconst bytes = new TextEncoder().encode(data);\n\tlet binary = \"\";\n\tfor (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]);\n\treturn btoa(binary);\n}\nfunction decode(base64) {\n\tif (typeof Buffer !== \"undefined\") return Buffer.from(base64, \"base64\").toString(\"utf8\");\n\tconst binary = atob(base64);\n\tconst bytes = new Uint8Array(binary.length);\n\tfor (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);\n\treturn new TextDecoder().decode(bytes);\n}\n//#endregion\nexport { defaultBaseUrl as a, createDiagnosticMessage as c, libraryDefaultLocale as d, isSupportedFileFormatTransform as i, formatDiagnosticErrorDetails as l, encode as n, defaultCacheUrl as o, validateFileFormatTransforms as r, defaultRuntimeApiUrl as s, decode as t, defaultTimeout as u };\n\n//# sourceMappingURL=base64-r7YWJYWt.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 { LocalStorageTranslationCache } from './LocalStorageTranslationCache';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\n\n/**\n * The configuration for the BrowserI18nCache\n */\nexport type BrowserI18nCacheParams = I18nCacheConstructorParams<Translation> & {\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 /** Per-locale localStorage translation caches (dev mode only) */\n private _localStorageCaches!: Record<string, LocalStorageTranslationCache>;\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: Record<string, LocalStorageTranslationCache> = {};\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._localStorageCaches = localStorageCaches;\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.subscribe(\n 'translations-cache-miss',\n ({ locale, hash, translation }) => {\n const cache = localStorageCaches[locale];\n if (cache) {\n cache.write(hash, translation);\n } else {\n localStorageCaches[locale] = new LocalStorageTranslationCache({\n locale,\n projectId,\n init: { [hash]: translation },\n });\n }\n }\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 * Get or create a LocalStorageTranslationCache for the given locale.\n * Instances are lazily created and cached per locale.\n * Returns undefined if not in development mode.\n */\n getLocalStorageTranslationCache(\n locale: string,\n init?: Record<string, Translation>\n ): LocalStorageTranslationCache | undefined {\n if (!import.meta.env?.DEV) return undefined;\n\n if (!this._localStorageCaches[locale]) {\n this._localStorageCaches[locale] = new LocalStorageTranslationCache({\n locale,\n projectId: this.config.projectId!,\n init,\n });\n }\n return this._localStorageCaches[locale];\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: Record<string, LocalStorageTranslationCache>\n) {\n return async (locale: string) => {\n const loaderTranslations = await originalLoader(locale);\n localStorageCaches[locale] ||= new LocalStorageTranslationCache({\n locale,\n projectId,\n init: loaderTranslations as Record<string, Translation>,\n });\n return localStorageCaches[locale].getInternalCache();\n };\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","/**\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 const rawCookieValue = document.cookie\n .split('; ')\n .find((row) => row.startsWith(`${cookieName}=`))\n ?.split('=')[1];\n return rawCookieValue;\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","/**\n * Cookie name for tracking the user's selected locale.\n */\nexport const defaultLocaleCookieName = 'generaltranslation.locale';\n\n/**\n * Cookie name for tracking the user's selected region.\n */\nexport const defaultRegionCookieName = 'generaltranslation.region';\n\n/**\n * Cookie name for persisting the enableI18n feature flag.\n */\nexport const defaultEnableI18nCookieName = 'generaltranslation.enable-i18n';\n\n/**\n * Cookie name for tracking the locale reset\n * Used by gt-next middleware\n *\n * TODO: remove this cookie when come up with better solution\n */\nexport const defaultResetLocaleCookieName = 'generaltranslation.locale-reset';\n","import { WritableConditionStoreParams } from 'gt-i18n/internal';\nimport { getCookieValue, setCookieValue } from './cookies';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport { GetEnableI18n, GetLocale, GetRegion } from '../i18n-cache/types';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport {\n LocaleCandidates,\n WritableConditionStoreInterface,\n} from 'gt-i18n/internal/types';\nimport {\n defaultEnableI18nCookieName,\n defaultLocaleCookieName,\n defaultRegionCookieName,\n defaultResetLocaleCookieName,\n} from '../cookie-names';\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 * @param {string} [localeCookieName=defaultLocaleCookieName] - The name of the locale cookie to check\n */\nexport type BrowserConditionStoreParams = WritableConditionStoreParams & {\n localeCookieName?: string;\n regionCookieName?: string;\n enableI18nCookieName?: string;\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 localeCookieName: string;\n private regionCookieName: string;\n private enableI18nCookieName: string;\n private customReload: ReloadType;\n private customGetLocale?: GetLocale;\n private customGetRegion?: GetRegion;\n private customGetEnableI18n?: GetEnableI18n;\n\n constructor(config: BrowserConditionStoreParams) {\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 this.localeCookieName = config.localeCookieName ?? defaultLocaleCookieName;\n this.regionCookieName = config.regionCookieName ?? defaultRegionCookieName;\n this.enableI18nCookieName =\n config.enableI18nCookieName ?? defaultEnableI18nCookieName;\n const i18nConfig = getI18nConfig();\n setCookieValue({\n cookieName: this.localeCookieName,\n value:\n i18nConfig.determineLocale(config.locale) ||\n i18nConfig.getDefaultLocale(),\n });\n if (config.region !== undefined) {\n setCookieValue({\n cookieName: this.regionCookieName,\n value: config.region,\n });\n }\n this.updateEnableI18n(config.enableI18n ?? true);\n }\n\n getLocale = (): string => {\n return getBrowserLocale(this.localeCookieName, 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: this.regionCookieName,\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: this.enableI18nCookieName,\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: this.localeCookieName,\n value:\n i18nConfig.determineLocale(locale) || i18nConfig.getDefaultLocale(),\n });\n };\n\n /**\n * Soft region update\n */\n updateRegion = (region: string | undefined): void => {\n setCookieValue({\n cookieName: this.regionCookieName,\n value: region ?? '',\n });\n };\n\n /**\n * Soft enableI18n update\n */\n updateEnableI18n = (enableI18n: boolean): void => {\n setCookieValue({\n cookieName: this.enableI18nCookieName,\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(cookieName: string, getLocale?: GetLocale): string {\n const candidates = readBrowserLocale(cookieName);\n if (getLocale) candidates.push(getLocale());\n const i18nConfig = getI18nConfig();\n return (\n i18nConfig.determineLocale(candidates) || i18nConfig.getDefaultLocale()\n );\n}\n","import {\n createConditionStoreSingleton,\n ReadonlyConditionStore,\n} from 'gt-i18n/internal';\nimport { BrowserConditionStore } from './BrowserConditionStore';\n\nexport const {\n setConditionStore: setReadonlyConditionStore,\n isConditionStoreInitialized: isReadonlyConditionStoreInitialized,\n} = createConditionStoreSingleton<ReadonlyConditionStore>(\n 'ReadonlyConditionStore is not initialized.'\n);\n\nexport const {\n getConditionStore: getBrowserConditionStore,\n setConditionStore: setBrowserConditionStore,\n isConditionStoreInitialized: isBrowserConditionStoreInitialized,\n} = createConditionStoreSingleton<BrowserConditionStore>(\n 'BrowserConditionStore is not initialized.'\n);\n","import type { LocaleCandidates } from 'gt-i18n/internal';\nimport { getI18nConfig } from 'gt-i18n/internal';\nimport {\n BrowserConditionStore,\n BrowserConditionStoreParams,\n} from './BrowserConditionStore';\nimport { readBrowserLocale } from './readBrowserLocale';\nimport {\n defaultEnableI18nCookieName,\n defaultLocaleCookieName,\n defaultRegionCookieName,\n} from '../cookie-names';\nimport { getCookieValue } from './cookies';\nimport {\n getBrowserConditionStore,\n isBrowserConditionStoreInitialized,\n setBrowserConditionStore,\n} from './singleton-operations';\n\nexport type CreateBrowserConditionStoreParams = Omit<\n BrowserConditionStoreParams,\n | 'locale'\n | 'enableI18n'\n | 'localeCookieName'\n | 'regionCookieName'\n | 'enableI18nCookieName'\n> & {\n locale?: LocaleCandidates;\n enableI18n?: boolean;\n localeCookieName?: string;\n regionCookieName?: string;\n enableI18nCookieName?: string;\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 * We want the values that we read from the cookies to override as this\n * persists state across page reloads\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 localeCookieName: defaultLocaleCookieName,\n regionCookieName: defaultRegionCookieName,\n enableI18nCookieName: defaultEnableI18nCookieName,\n locale,\n region,\n enableI18n,\n });\n setBrowserConditionStore(conditionStore);\n return conditionStore;\n}\n\nfunction determineLocale({\n localeCookieName = defaultLocaleCookieName,\n _getLocale: getLocale,\n locale,\n}: CreateBrowserConditionStoreParams): string {\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(localeCookieName));\n return resolveLocale(candidates);\n}\n\nfunction resolveLocale(candidates?: LocaleCandidates): string {\n const i18nConfig = getI18nConfig();\n return (\n i18nConfig.determineLocale(candidates) || i18nConfig.getDefaultLocale()\n );\n}\n\nfunction determineRegion({\n regionCookieName = defaultRegionCookieName,\n _getRegion: getRegion,\n region,\n}: CreateBrowserConditionStoreParams): string | undefined {\n const cookieRegion = getCookieValue({\n cookieName: regionCookieName,\n });\n return cookieRegion || getRegion?.() || region;\n}\n\nfunction determineEnableI18n({\n enableI18n,\n enableI18nCookieName = defaultEnableI18nCookieName,\n _getEnableI18n: getEnableI18n,\n}: CreateBrowserConditionStoreParams): boolean {\n const cookieEnableI18n = getCookieValue({\n cookieName: enableI18nCookieName,\n });\n if (cookieEnableI18n === undefined) {\n return getEnableI18n?.() ?? enableI18n ?? true;\n }\n return cookieEnableI18n === 'true';\n}\n","import {\n getTranslationsSnapshot,\n I18nStore,\n setI18nStore,\n setReactI18nCache,\n getReadonlyConditionStoreWithFallback,\n initializeI18nConfig,\n} from '@generaltranslation/react-core/pure';\nimport type { I18nConfigParams } from '@generaltranslation/react-core/pure';\nimport { setupGTServicesEnabled } from 'gt-i18n/internal';\nimport type { GTServicesEnabledParams } from 'gt-i18n/internal/types';\nimport { BrowserI18nCache } from '../i18n-cache/BrowserI18nCache';\nimport type { BrowserI18nCacheParams } from '../i18n-cache/BrowserI18nCache';\nimport {\n createOrUpdateBrowserConditionStore,\n CreateBrowserConditionStoreParams,\n} from '../condition-store/createBrowserConditionStore';\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(\n config: I18nConfigParams &\n GTServicesEnabledParams &\n BrowserI18nCacheParams &\n CreateBrowserConditionStoreParams\n) {\n setupGTServicesEnabled(config);\n initializeI18nConfig(config, 'SPA');\n\n const i18nCache = new BrowserI18nCache(config);\n setReactI18nCache(i18nCache);\n\n createOrUpdateBrowserConditionStore(config);\n\n const i18nStore = new I18nStore();\n setI18nStore(i18nStore);\n\n // Block until translations are loaded\n await getTranslationsSnapshot(\n getReadonlyConditionStoreWithFallback().getLocale()\n );\n}\n","import {\n internalInitializeGTSRA,\n type ReactI18nCacheParams,\n} from '@generaltranslation/react-core/pure';\nimport type {\n GTServicesEnabledParams,\n I18nConfigParams,\n} from 'gt-i18n/internal/types';\n\n/**\n * Initialize GT for client-side rendering.\n */\nexport function initializeGTSRAClient(\n config: I18nConfigParams & GTServicesEnabledParams & ReactI18nCacheParams\n): void {\n internalInitializeGTSRA({\n cacheExpiryTime: null,\n ...config,\n });\n}\n","import { useCallback } from 'react';\nimport { useConditionStore } from '@generaltranslation/react-core/hooks';\n\n/**\n * Returns a function that sets the locale\n */\nexport function useSetLocale() {\n const conditionStore = useConditionStore();\n return useCallback(\n (locale: string) => {\n conditionStore.setLocale(locale);\n },\n [conditionStore]\n );\n}\n\n/**\n * Returns a function that sets the region\n */\nexport function useSetRegion() {\n const conditionStore = useConditionStore();\n return useCallback(\n (region: string | undefined) => {\n conditionStore.setRegion(region);\n },\n [conditionStore]\n );\n}\n\n/**\n * Returns a function that sets the enableI18n flag in the condition store.\n */\nexport function useSetEnableI18n() {\n const conditionStore = useConditionStore();\n return useCallback(\n (enableI18n: boolean) => {\n conditionStore.setEnableI18n(enableI18n);\n },\n [conditionStore]\n );\n}\n","import { useSetLocale } from '../hooks/conditions-store';\nimport { useInternalLocaleSelector } 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 { useSetLocale, useSetRegion } from '../hooks/conditions-store';\nimport { useInternalRegionSelector } 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';\n\nexport { initializeGTSPA } from './setup/initializeGTSPA';\nexport { initializeGTSRAClient as initializeGT } from './setup/initializeGTSRAClient';\nexport { useLocaleSelector } from './components/useLocaleSelector';\nexport { useRegionSelector } from './components/useRegionSelector';\nexport {\n useSetLocale,\n useSetRegion,\n useSetEnableI18n,\n} from './hooks/conditions-store';\nexport {\n defaultEnableI18nCookieName,\n defaultLocaleCookieName,\n defaultRegionCookieName,\n} from './cookie-names';\n\ntype TxProps = Record<string, ReactNode> & {\n children: ReactNode;\n context?: string;\n locale?: string;\n maxChars?: number;\n $context?: string;\n $locale?: string;\n $maxChars?: number;\n};\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 useVersionId,\n useGTClass,\n useLocaleProperties,\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 getGTClass,\n getLocaleProperties,\n getLocales,\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;;;ACOD,MAAM,qBAAqB;AAC3B,MAAM,yBAAyB;AAC/B,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;AACvB,MAAM,4BAA4B;AAClC,MAAM,qBAAqB;AAG3B,MAAM,kCAAkB,IAAI,KAA6C;;;;;;;;AAWzE,IAAa,+BAAb,MAA0C;;;;;;;;;;CAmBxC,YAAY,EACV,QACA,WACA,MACA,SACA,KACA,iBAQC;sBA/BiD,EAAE;qBACM;wBAC3B;AA8B/B,OAAK,cAAc,GAAG,qBAAqB,UAAU,GAAG;AACxD,OAAK,qBAAqB,GAAG,yBAAyB,UAAU,GAAG;AACnE,OAAK,WAAW,WAAW;AAC3B,OAAK,OAAO,OAAO;AACnB,OAAK,iBAAiB,iBAAiB;AAGvC,MAAI,KACF,MAAK,YAAY,KAAK;AAIxB,MAAI,gBAAgB,IAAI,KAAK,YAAY,CACvC,eAAc,gBAAgB,IAAI,KAAK,YAAY,CAAE;EAEvD,MAAM,aAAa,kBACX,KAAK,kBAAkB,EAC7B,KAAK,eACN;AACD,kBAAgB,IAAI,KAAK,aAAa,WAAW;;;;;;CAOnD,mBAAgD;EAC9C,MAAM,MAAM,KAAK,KAAK;EACtB,MAAM,QAAQ,KAAK,kBAAkB;EACrC,MAAM,SAAsC,EAAE;AAE9C,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC9C,KAAI,MAAM,MAAM,IACd,QAAO,OAAO,MAAM;AAKxB,SAAO,OAAO,QAAQ,KA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,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;;;;ACsBN,eAAsB,GAAG,QAAqC;AAC5D,OAAM,IAAI,MAAM,+BAA+B"}
|
|
1
|
+
{"version":3,"file":"index.client.cjs","names":["I18nCache","defaultResetLocaleCookieName","I18nStore","InternalLocaleSelector","InternalRegionSelector","I18nStore","InternalGTProvider"],"sources":["../src/i18n-cache/constants.ts","../src/i18n-cache/LocalStorageTranslationCache.ts","../../core/dist/api-BOEGbEF6.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/hooks/conditions-store.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","import { Translation } from 'gt-i18n/types';\n\n// TODO: Add purge key/locks to prevent concurrent purges across tabs\n// TODO: Add cache key/locks for non-atomic read-modify-write operations across tabs\n\n// ===== Types ===== //\n\n/** A cached translation entry with expiry metadata */\ntype CachedEntry = { t: Translation; exp: number };\n\n// ===== Constants ===== //\n\nconst STORAGE_KEY_PREFIX = 'gt:tx:';\nconst PURGE_TIMESTAMP_PREFIX = 'gt:tx:purge:';\nconst FLUSH_INTERVAL = 500;\nconst DEFAULT_MAX_SIZE = 1_000_000; // ~1M characters (localStorage uses UTF-16)\nconst DEFAULT_TTL_MS = 86_400_000; // 24 hours\nconst DEFAULT_PURGE_INTERVAL_MS = 300_000; // 5 minutes\nconst PURGE_TARGET_RATIO = 0.8; // purge down to 80% of max\n\n// Prevents interval leaks on HMR — keyed by storage key\nconst activeIntervals = new Map<string, ReturnType<typeof setInterval>>();\n\n// ===== Class ===== //\n\n/**\n * A localStorage-backed translation cache for a single locale.\n * Used in development mode only to persist runtime translations across page refreshes.\n *\n * Entries are stored with per-entry expiry timestamps and the cache is purged\n * when estimated size exceeds the configured maximum.\n */\nexport class LocalStorageTranslationCache {\n private _storageKey: string;\n private _writeBuffer: Record<string, Translation> = {};\n private _flushTimer: ReturnType<typeof setTimeout> | null = null;\n private _estimatedSize: number = 0;\n private _maxSize: number;\n private _ttl: number;\n private _purgeInterval: number;\n private _purgeTimestampKey: string;\n\n /**\n * @param locale - The locale this cache is for\n * @param projectId - The project id (namespaces localStorage keys)\n * @param init - Optional initial translations to merge on top of localStorage data.\n * init values take priority over stale localStorage entries.\n * @param maxSize - Maximum cache size in characters (default: ~1M)\n * @param ttl - TTL in milliseconds for each entry (default: 24 hours)\n * @param purgeInterval - Background purge check interval in ms (default: 5 min)\n */\n constructor({\n locale,\n projectId,\n init,\n maxSize,\n ttl,\n purgeInterval,\n }: {\n locale: string;\n projectId: string;\n init?: Record<string, Translation>;\n maxSize?: number;\n ttl?: number;\n purgeInterval?: number;\n }) {\n this._storageKey = `${STORAGE_KEY_PREFIX}${projectId}:${locale}`;\n this._purgeTimestampKey = `${PURGE_TIMESTAMP_PREFIX}${projectId}:${locale}`;\n this._maxSize = maxSize ?? DEFAULT_MAX_SIZE;\n this._ttl = ttl ?? DEFAULT_TTL_MS;\n this._purgeInterval = purgeInterval ?? DEFAULT_PURGE_INTERVAL_MS;\n\n // Merge init values on top (init wins on conflict)\n if (init) {\n this.initStorage(init);\n }\n\n // Start background purge interval (clears any existing interval for HMR safety)\n if (activeIntervals.has(this._storageKey)) {\n clearInterval(activeIntervals.get(this._storageKey)!);\n }\n const intervalId = setInterval(\n () => this._backgroundPurge(),\n this._purgeInterval\n );\n activeIntervals.set(this._storageKey, intervalId);\n }\n\n /**\n * Returns the full translation map (cache + pending buffer writes).\n * Filters out expired entries. Buffer entries take priority.\n */\n getInternalCache(): Record<string, Translation> {\n const now = Date.now();\n const cache = this._readFromStorage();\n const result: Record<string, Translation> = {};\n\n for (const [key, entry] of Object.entries(cache)) {\n if (entry.exp > now) {\n result[key] = entry.t;\n }\n }\n\n // Buffer entries are always fresh\n Object.assign(result, this._writeBuffer);\n return result;\n }\n\n /**\n * Queue a translation for writing to localStorage.\n * Writes are batched via a debounced flush.\n */\n write(hash: string, translation: Translation): void {\n this._writeBuffer[hash] = translation;\n this._scheduleFlush();\n }\n\n /**\n * Remove specific entries from the cache by hash.\n */\n purge(hashes: string[]): void {\n const cache = this._readFromStorage();\n for (const hash of hashes) {\n delete cache[hash];\n }\n this._writeRaw(JSON.stringify(cache));\n }\n\n // ===== Private Methods ===== //\n\n /**\n * Schedule a flush of the write buffer.\n * Uses a leading throttle — the first write in a burst schedules a flush\n * after FLUSH_INTERVAL ms; subsequent writes before the timer fires are\n * batched into the same flush.\n */\n private _scheduleFlush(): void {\n if (this._flushTimer) return; // already scheduled\n this._flushTimer = setTimeout(() => {\n this._flushTimer = null;\n this._flush();\n }, FLUSH_INTERVAL);\n }\n\n /**\n * Merge the write buffer into the cache and persist to localStorage.\n * Purges before writing if estimated size exceeds max.\n */\n private _flush(): void {\n if (Object.keys(this._writeBuffer).length === 0) return;\n\n try {\n const cache = this._readFromStorage();\n const now = Date.now();\n\n // Purge if estimated size exceeds max\n if (this._estimatedSize > this._maxSize) {\n this._purgeCache(cache, now);\n }\n\n // Merge buffer entries with expiry\n const exp = now + this._ttl;\n for (const [key, value] of Object.entries(this._writeBuffer)) {\n cache[key] = { t: value, exp };\n }\n\n this._writeRaw(JSON.stringify(cache));\n } catch {\n // Silently fail\n }\n\n this._writeBuffer = {};\n }\n\n /**\n * Purge entries from the cache in place.\n * Phase 1: Remove expired entries.\n * Phase 2: If still over target, drop oldest entries by expiry time.\n */\n private _purgeCache(cache: Record<string, CachedEntry>, now: number): void {\n const keysBeforePurge = Object.keys(cache);\n if (keysBeforePurge.length === 0) return;\n\n const avgEntrySize = this._estimatedSize / keysBeforePurge.length;\n\n // Phase 1: Remove expired entries\n deleteExpiredEntries(cache, now);\n\n // Phase 2: If still over target, drop oldest entries\n const targetSize = this._maxSize * PURGE_TARGET_RATIO;\n const maxEntries = Math.floor(targetSize / avgEntrySize);\n\n const remaining = Object.entries(cache);\n if (remaining.length > maxEntries) {\n remaining.sort((a, b) => a[1].exp - b[1].exp); // oldest first\n const toDrop = remaining.length - maxEntries;\n for (let i = 0; i < toDrop; i++) {\n delete cache[remaining[i][0]];\n }\n }\n }\n\n /**\n * Background purge triggered by setInterval.\n * Checks the last purge timestamp to avoid redundant work across tabs,\n * then removes expired entries. Only writes back if something changed.\n * Timestamp is updated after the purge completes.\n */\n private _backgroundPurge(): void {\n try {\n // Check if a purge is needed (another tab may have purged recently)\n const raw = localStorage.getItem(this._purgeTimestampKey);\n const lastPurge = raw ? parseInt(raw, 10) : 0;\n const now = Date.now();\n\n if (now - lastPurge < this._purgeInterval) return;\n\n // Run TTL purge\n const cache = this._readFromStorage();\n const keysBefore = Object.keys(cache).length;\n\n deleteExpiredEntries(cache, now);\n\n // Only write back if something was actually purged\n if (Object.keys(cache).length < keysBefore) {\n this._writeRaw(JSON.stringify(cache));\n }\n\n // Update timestamp after purge completes\n localStorage.setItem(this._purgeTimestampKey, String(now));\n } catch {\n // Silently fail\n }\n }\n\n /**\n * Read and parse translations from localStorage.\n * Recalibrates estimated size as a side effect.\n * Returns empty object on any error (unavailable, corrupt data, etc.)\n */\n private _readFromStorage(): Record<string, CachedEntry> {\n try {\n const raw = localStorage.getItem(this._storageKey);\n if (!raw) {\n this._estimatedSize = 0;\n return {};\n }\n this._estimatedSize = raw.length;\n return JSON.parse(raw) as Record<string, CachedEntry>;\n } catch {\n this._estimatedSize = 0;\n return {};\n }\n }\n\n /**\n * Persist new entries to localStorage with expiry timestamps.\n * Reads current cache, merges buffer on top, writes back.\n */\n private initStorage(buffer: Record<string, Translation>): void {\n try {\n const cache = this._readFromStorage();\n const exp = Date.now() + this._ttl;\n\n for (const [key, value] of Object.entries(buffer)) {\n cache[key] = { t: value, exp };\n }\n\n this._writeRaw(JSON.stringify(cache));\n } catch {\n // Silently fail — localStorage may be unavailable or full\n }\n }\n\n /**\n * Write a pre-serialized string to localStorage and recalibrate estimate.\n */\n private _writeRaw(serialized: string): void {\n try {\n localStorage.setItem(this._storageKey, serialized);\n this._estimatedSize = serialized.length;\n } catch {\n // Silently fail — localStorage may be unavailable or full\n }\n }\n}\n\n// ===== Helper Functions ===== //\n\n/**\n * Helper function deletes expired entries from a cache in place.\n */\nfunction deleteExpiredEntries(\n cache: Record<string, CachedEntry>,\n now: number = Date.now()\n): void {\n for (const key of Object.keys(cache)) {\n if (cache[key].exp <= now) {\n delete cache[key];\n }\n }\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 lowercaseFirstWord(text) {\n\treturn text.replace(/^[A-Z][a-z]/, (match) => match.toLowerCase());\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 ${lowercaseFirstWord(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 ${lowercaseFirstWord(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-BOEGbEF6.mjs.map","import type {\n I18nCacheConstructorParams,\n TranslationsLoader,\n} from 'gt-i18n/internal/types';\nimport {\n getI18nConfig,\n getRuntimeEnvironment,\n I18nCache,\n} from 'gt-i18n/internal';\nimport type { HtmlTagOptions } from './types';\nimport type { Translation } from 'gt-i18n/types';\nimport { DEFAULT_HTML_TAG_OPTIONS } from './constants';\nimport { LocalStorageTranslationCache } from './LocalStorageTranslationCache';\nimport { createDiagnosticMessage } from 'generaltranslation/internal';\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 /** Per-locale localStorage translation caches (dev mode only) */\n private _localStorageCaches!: Record<string, LocalStorageTranslationCache>;\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: Record<string, LocalStorageTranslationCache> = {};\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._localStorageCaches = localStorageCaches;\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 const cache = localStorageCaches[locale];\n if (cache) {\n cache.write(hash, translation);\n } else {\n localStorageCaches[locale] = new LocalStorageTranslationCache({\n locale,\n projectId,\n init: { [hash]: translation },\n });\n }\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 * Get or create a LocalStorageTranslationCache for the given locale.\n * Instances are lazily created and cached per locale.\n * Returns undefined if not in development mode.\n */\n getLocalStorageTranslationCache(\n locale: string,\n init?: Record<string, Translation>\n ): LocalStorageTranslationCache | undefined {\n if (getRuntimeEnvironment() !== 'development') return undefined;\n\n if (!this._localStorageCaches[locale]) {\n this._localStorageCaches[locale] = new LocalStorageTranslationCache({\n locale,\n projectId: this.config.projectId!,\n init,\n });\n }\n return this._localStorageCaches[locale];\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: Record<string, LocalStorageTranslationCache>\n) {\n return async (locale: string) => {\n const loaderTranslations = await originalLoader(locale);\n localStorageCaches[locale] ||= new LocalStorageTranslationCache({\n locale,\n projectId,\n init: loaderTranslations as Record<string, Translation>,\n });\n return localStorageCaches[locale].getInternalCache();\n };\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","/**\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 const rawCookieValue = document.cookie\n .split('; ')\n .find((row) => row.startsWith(`${cookieName}=`))\n ?.split('=')[1];\n return rawCookieValue;\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\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(\n config: I18nConfigParams &\n BrowserI18nCacheParams &\n CreateBrowserConditionStoreParams\n) {\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 I18nConfigParams,\n type ReactI18nCacheParams,\n} from '@generaltranslation/react-core/pure';\nimport { addRuntimeCredentials } from './runtimeCredentials';\n\n/**\n * Initialize GT for client-side rendering.\n */\nexport function initializeGTSRAClient(\n config: I18nConfigParams & ReactI18nCacheParams\n): void {\n internalInitializeGTSRA(\n addRuntimeCredentials({\n cacheExpiryTime: null,\n ...config,\n })\n );\n}\n","import { useCallback } from 'react';\nimport { useConditionStore } from '@generaltranslation/react-core/hooks';\n\n/**\n * Returns a function that sets the locale\n */\nexport function useSetLocale() {\n const conditionStore = useConditionStore();\n return useCallback(\n (locale: string) => {\n conditionStore.setLocale(locale);\n },\n [conditionStore]\n );\n}\n\n/**\n * Returns a function that sets the region\n */\nexport function useSetRegion() {\n const conditionStore = useConditionStore();\n return useCallback(\n (region: string | undefined) => {\n conditionStore.setRegion(region);\n },\n [conditionStore]\n );\n}\n\n/**\n * Returns a function that sets the enableI18n flag in the condition store.\n */\nexport function useSetEnableI18n() {\n const conditionStore = useConditionStore();\n return useCallback(\n (enableI18n: boolean) => {\n conditionStore.setEnableI18n(enableI18n);\n },\n [conditionStore]\n );\n}\n","import { useSetLocale } from '../hooks/conditions-store';\nimport { useInternalLocaleSelector } 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 { useSetLocale, useSetRegion } from '../hooks/conditions-store';\nimport { useInternalRegionSelector } 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 { useLocaleSelector } from './components/useLocaleSelector';\nexport { useRegionSelector } from './components/useRegionSelector';\nexport {\n useSetLocale,\n useSetRegion,\n useSetEnableI18n,\n} from './hooks/conditions-store';\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} 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 ReactI18nCachePar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Cache, ReactI18nCacheParams, ReactI18nCacheParams as ReactI18nCacheParams$1, RenderPipeline, RenderPreparedT, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getFormatLocales,
|
|
3
|
-
import {
|
|
2
|
+
import { I18nConfigParams, ReactI18nCache, ReactI18nCacheParams, ReactI18nCacheParams as ReactI18nCacheParams$1, RenderPipeline, RenderPreparedT, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getFormatLocales, getLocaleProperties, getLocales, getReactI18nCache, getTranslationsSnapshot, getVersionId, gtFallback, mFallback, msg, resolveCanonicalLocale, setReactI18nCache, t } from "@generaltranslation/react-core/pure";
|
|
3
|
+
import { I18nCacheConstructorParams } from "gt-i18n/internal/types";
|
|
4
4
|
import { GtInternalRuntimeTranslateJsx, GtInternalRuntimeTranslateString, LocaleCandidates, WritableConditionStoreParams } from "gt-i18n/internal";
|
|
5
|
-
import { GTTranslationOptions, RuntimeTranslationOptions, SyncResolutionFunction, SyncResolutionFunctionWithFallback
|
|
5
|
+
import { GTTranslationOptions, RuntimeTranslationOptions, SyncResolutionFunction, SyncResolutionFunctionWithFallback } from "gt-i18n/types";
|
|
6
6
|
import * as _$_generaltranslation_react_core_hooks0 from "@generaltranslation/react-core/hooks";
|
|
7
|
-
import { InternalRegionSelectorOptions, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT,
|
|
7
|
+
import { InternalRegionSelectorOptions, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleDirection, useLocaleProperties, useLocales, useMessages, useRegion, useTranslations } from "@generaltranslation/react-core/hooks";
|
|
8
8
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
9
|
import { Branch, Currency, DateTime, Derive, GtInternalTranslateJsx, GtInternalVar, InternalGTProviderProps, Num, Plural, RelativeTime, T, Var } from "@generaltranslation/react-core/components";
|
|
10
10
|
|
|
11
|
+
//#region src/utils/TxProps.d.ts
|
|
12
|
+
type TxProps = Record<string, ReactNode> & {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
context?: string;
|
|
15
|
+
locale?: string;
|
|
16
|
+
maxChars?: number;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
11
19
|
//#region src/i18n-cache/types.d.ts
|
|
12
20
|
/**
|
|
13
21
|
* Type for custom getLocale function
|
|
@@ -29,7 +37,7 @@ type HtmlTagOptions = {
|
|
|
29
37
|
/**
|
|
30
38
|
* The configuration for the BrowserI18nCache
|
|
31
39
|
*/
|
|
32
|
-
type BrowserI18nCacheParams = I18nCacheConstructorParams
|
|
40
|
+
type BrowserI18nCacheParams = I18nCacheConstructorParams & {
|
|
33
41
|
htmlTagOptions?: HtmlTagOptions;
|
|
34
42
|
};
|
|
35
43
|
//#endregion
|
|
@@ -43,12 +51,8 @@ type ReloadType = (state: SerializedBrowserConditionStoreState) => void;
|
|
|
43
51
|
/**
|
|
44
52
|
* The configuration for the BrowserConditionStore
|
|
45
53
|
* @param {GetLocale} getLocale - The function to get the locale
|
|
46
|
-
* @param {string} [localeCookieName=defaultLocaleCookieName] - The name of the locale cookie to check
|
|
47
54
|
*/
|
|
48
55
|
type BrowserConditionStoreParams = WritableConditionStoreParams & {
|
|
49
|
-
localeCookieName?: string;
|
|
50
|
-
regionCookieName?: string;
|
|
51
|
-
enableI18nCookieName?: string;
|
|
52
56
|
_getLocale?: GetLocale;
|
|
53
57
|
_getRegion?: GetRegion;
|
|
54
58
|
_getEnableI18n?: GetEnableI18n;
|
|
@@ -56,12 +60,9 @@ type BrowserConditionStoreParams = WritableConditionStoreParams & {
|
|
|
56
60
|
};
|
|
57
61
|
//#endregion
|
|
58
62
|
//#region src/condition-store/createBrowserConditionStore.d.ts
|
|
59
|
-
type CreateBrowserConditionStoreParams = Omit<BrowserConditionStoreParams, 'locale' | 'enableI18n'
|
|
63
|
+
type CreateBrowserConditionStoreParams = Omit<BrowserConditionStoreParams, 'locale' | 'enableI18n'> & {
|
|
60
64
|
locale?: LocaleCandidates;
|
|
61
65
|
enableI18n?: boolean;
|
|
62
|
-
localeCookieName?: string;
|
|
63
|
-
regionCookieName?: string;
|
|
64
|
-
enableI18nCookieName?: string;
|
|
65
66
|
};
|
|
66
67
|
//#endregion
|
|
67
68
|
//#region src/setup/initializeGTSPA.d.ts
|
|
@@ -73,13 +74,13 @@ type CreateBrowserConditionStoreParams = Omit<BrowserConditionStoreParams, 'loca
|
|
|
73
74
|
*
|
|
74
75
|
* This is SPA for browser runtime
|
|
75
76
|
*/
|
|
76
|
-
declare function initializeGTSPA(config: I18nConfigParams &
|
|
77
|
+
declare function initializeGTSPA(config: I18nConfigParams & BrowserI18nCacheParams & CreateBrowserConditionStoreParams): Promise<void>;
|
|
77
78
|
//#endregion
|
|
78
79
|
//#region src/setup/initializeGTSRAClient.d.ts
|
|
79
80
|
/**
|
|
80
81
|
* Initialize GT for client-side rendering.
|
|
81
82
|
*/
|
|
82
|
-
declare function initializeGTSRAClient(config: I18nConfigParams
|
|
83
|
+
declare function initializeGTSRAClient(config: I18nConfigParams & ReactI18nCacheParams$1): void;
|
|
83
84
|
//#endregion
|
|
84
85
|
//#region ../format/dist/types-COaQnqVZ.d.cts
|
|
85
86
|
//#region src/locales/customLocaleMapping.d.ts
|
|
@@ -173,20 +174,6 @@ declare function useSetRegion(): (region: string | undefined) => void;
|
|
|
173
174
|
*/
|
|
174
175
|
declare function useSetEnableI18n(): (enableI18n: boolean) => void;
|
|
175
176
|
//#endregion
|
|
176
|
-
//#region src/cookie-names.d.ts
|
|
177
|
-
/**
|
|
178
|
-
* Cookie name for tracking the user's selected locale.
|
|
179
|
-
*/
|
|
180
|
-
declare const defaultLocaleCookieName = "generaltranslation.locale";
|
|
181
|
-
/**
|
|
182
|
-
* Cookie name for tracking the user's selected region.
|
|
183
|
-
*/
|
|
184
|
-
declare const defaultRegionCookieName = "generaltranslation.region";
|
|
185
|
-
/**
|
|
186
|
-
* Cookie name for persisting the enableI18n feature flag.
|
|
187
|
-
*/
|
|
188
|
-
declare const defaultEnableI18nCookieName = "generaltranslation.enable-i18n";
|
|
189
|
-
//#endregion
|
|
190
177
|
//#region src/components/LocaleSelector.d.ts
|
|
191
178
|
/**
|
|
192
179
|
* A dropdown component that allows users to select a locale.
|
|
@@ -271,16 +258,7 @@ type SharedGTProviderProps = Omit<InternalGTProviderProps, 'conditionStore' | 'i
|
|
|
271
258
|
declare function BrowserGTProvider(props: SharedGTProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
272
259
|
//#endregion
|
|
273
260
|
//#region src/index.client.d.ts
|
|
274
|
-
type TxProps = Record<string, ReactNode> & {
|
|
275
|
-
children: ReactNode;
|
|
276
|
-
context?: string;
|
|
277
|
-
locale?: string;
|
|
278
|
-
maxChars?: number;
|
|
279
|
-
$context?: string;
|
|
280
|
-
$locale?: string;
|
|
281
|
-
$maxChars?: number;
|
|
282
|
-
};
|
|
283
261
|
declare function Tx(_props: TxProps): Promise<ReactNode>;
|
|
284
262
|
//#endregion
|
|
285
|
-
export { Branch, Currency, DateTime, Derive, BrowserGTProvider as GTProvider, type GTTranslationOptions, GtInternalRuntimeTranslateJsx, GtInternalRuntimeTranslateString, GtInternalTranslateJsx, GtInternalVar, LocaleSelector, Num, Plural, ReactI18nCache, type ReactI18nCacheParams, RegionSelector, RelativeTime, type RenderPipeline, type RenderPreparedT, type RuntimeTranslationOptions, type SharedGTProviderProps, type SyncResolutionFunction, type SyncResolutionFunctionWithFallback, T, Tx, Var, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars,
|
|
263
|
+
export { Branch, Currency, DateTime, Derive, BrowserGTProvider as GTProvider, type GTTranslationOptions, GtInternalRuntimeTranslateJsx, GtInternalRuntimeTranslateString, GtInternalTranslateJsx, GtInternalVar, LocaleSelector, Num, Plural, ReactI18nCache, type ReactI18nCacheParams, RegionSelector, RelativeTime, type RenderPipeline, type RenderPreparedT, type RuntimeTranslationOptions, type SharedGTProviderProps, type SyncResolutionFunction, type SyncResolutionFunctionWithFallback, T, Tx, Var, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getFormatLocales, getLocaleProperties, getLocales, getReactI18nCache, getTranslationsSnapshot, getVersionId, gtFallback, initializeGTSRAClient as initializeGT, initializeGTSPA, mFallback, msg, resolveCanonicalLocale, setReactI18nCache, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleDirection, useLocaleProperties, useLocaleSelector, useLocales, useMessages, useRegion, useRegionSelector, useSetEnableI18n, useSetLocale, useSetRegion, useTranslations };
|
|
286
264
|
//# sourceMappingURL=index.client.d.cts.map
|
|
@@ -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/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","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/hooks/conditions-store.ts","../src/
|
|
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","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/hooks/conditions-store.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;;;;;;KCIU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCNd,oCAAA;EACH,MAAA;EACA,MAAA;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,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;;;iBCuBxC,EAAA,CAAG,MAAA,EAAQ,OAAA,GAAU,OAAA,CAAQ,SAAA"}
|
package/dist/index.client.d.mts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { I18nConfigParams, ReactI18nCache, ReactI18nCacheParams, ReactI18nCacheParams as ReactI18nCacheParams$1, RenderPipeline, RenderPreparedT, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getFormatLocales,
|
|
1
|
+
import { I18nConfigParams, ReactI18nCache, ReactI18nCacheParams, ReactI18nCacheParams as ReactI18nCacheParams$1, RenderPipeline, RenderPreparedT, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getFormatLocales, getLocaleProperties, getLocales, getReactI18nCache, getTranslationsSnapshot, getVersionId, gtFallback, mFallback, msg, resolveCanonicalLocale, setReactI18nCache, t } from "@generaltranslation/react-core/pure";
|
|
2
2
|
import { GtInternalRuntimeTranslateJsx, GtInternalRuntimeTranslateString, I18nCache, LocaleCandidates, WritableConditionStoreParams } from "gt-i18n/internal";
|
|
3
3
|
import React, { ReactNode } from "react";
|
|
4
4
|
import * as _$_generaltranslation_react_core_hooks0 from "@generaltranslation/react-core/hooks";
|
|
5
|
-
import { InternalRegionSelectorOptions, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT,
|
|
5
|
+
import { InternalRegionSelectorOptions, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleDirection, useLocaleProperties, useLocales, useMessages, useRegion, useTranslations } from "@generaltranslation/react-core/hooks";
|
|
6
6
|
import { Branch, Currency, DateTime, Derive, GtInternalTranslateJsx, GtInternalVar, InternalGTProviderProps, Num, Plural, RelativeTime, T, Var } from "@generaltranslation/react-core/components";
|
|
7
7
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
|
-
import {
|
|
9
|
-
import { GTTranslationOptions, RuntimeTranslationOptions, SyncResolutionFunction, SyncResolutionFunctionWithFallback
|
|
8
|
+
import { I18nCacheConstructorParams } from "gt-i18n/internal/types";
|
|
9
|
+
import { GTTranslationOptions, RuntimeTranslationOptions, SyncResolutionFunction, SyncResolutionFunctionWithFallback } from "gt-i18n/types";
|
|
10
10
|
|
|
11
|
+
//#region src/utils/TxProps.d.ts
|
|
12
|
+
type TxProps = Record<string, ReactNode> & {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
context?: string;
|
|
15
|
+
locale?: string;
|
|
16
|
+
maxChars?: number;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
11
19
|
//#region src/i18n-cache/types.d.ts
|
|
12
20
|
/**
|
|
13
21
|
* Type for custom getLocale function
|
|
@@ -29,7 +37,7 @@ type HtmlTagOptions = {
|
|
|
29
37
|
/**
|
|
30
38
|
* The configuration for the BrowserI18nCache
|
|
31
39
|
*/
|
|
32
|
-
type BrowserI18nCacheParams = I18nCacheConstructorParams
|
|
40
|
+
type BrowserI18nCacheParams = I18nCacheConstructorParams & {
|
|
33
41
|
htmlTagOptions?: HtmlTagOptions;
|
|
34
42
|
};
|
|
35
43
|
//#endregion
|
|
@@ -43,12 +51,8 @@ type ReloadType = (state: SerializedBrowserConditionStoreState) => void;
|
|
|
43
51
|
/**
|
|
44
52
|
* The configuration for the BrowserConditionStore
|
|
45
53
|
* @param {GetLocale} getLocale - The function to get the locale
|
|
46
|
-
* @param {string} [localeCookieName=defaultLocaleCookieName] - The name of the locale cookie to check
|
|
47
54
|
*/
|
|
48
55
|
type BrowserConditionStoreParams = WritableConditionStoreParams & {
|
|
49
|
-
localeCookieName?: string;
|
|
50
|
-
regionCookieName?: string;
|
|
51
|
-
enableI18nCookieName?: string;
|
|
52
56
|
_getLocale?: GetLocale;
|
|
53
57
|
_getRegion?: GetRegion;
|
|
54
58
|
_getEnableI18n?: GetEnableI18n;
|
|
@@ -56,12 +60,9 @@ type BrowserConditionStoreParams = WritableConditionStoreParams & {
|
|
|
56
60
|
};
|
|
57
61
|
//#endregion
|
|
58
62
|
//#region src/condition-store/createBrowserConditionStore.d.ts
|
|
59
|
-
type CreateBrowserConditionStoreParams = Omit<BrowserConditionStoreParams, 'locale' | 'enableI18n'
|
|
63
|
+
type CreateBrowserConditionStoreParams = Omit<BrowserConditionStoreParams, 'locale' | 'enableI18n'> & {
|
|
60
64
|
locale?: LocaleCandidates;
|
|
61
65
|
enableI18n?: boolean;
|
|
62
|
-
localeCookieName?: string;
|
|
63
|
-
regionCookieName?: string;
|
|
64
|
-
enableI18nCookieName?: string;
|
|
65
66
|
};
|
|
66
67
|
//#endregion
|
|
67
68
|
//#region src/setup/initializeGTSPA.d.ts
|
|
@@ -73,13 +74,13 @@ type CreateBrowserConditionStoreParams = Omit<BrowserConditionStoreParams, 'loca
|
|
|
73
74
|
*
|
|
74
75
|
* This is SPA for browser runtime
|
|
75
76
|
*/
|
|
76
|
-
declare function initializeGTSPA(config: I18nConfigParams &
|
|
77
|
+
declare function initializeGTSPA(config: I18nConfigParams & BrowserI18nCacheParams & CreateBrowserConditionStoreParams): Promise<void>;
|
|
77
78
|
//#endregion
|
|
78
79
|
//#region src/setup/initializeGTSRAClient.d.ts
|
|
79
80
|
/**
|
|
80
81
|
* Initialize GT for client-side rendering.
|
|
81
82
|
*/
|
|
82
|
-
declare function initializeGTSRAClient(config: I18nConfigParams
|
|
83
|
+
declare function initializeGTSRAClient(config: I18nConfigParams & ReactI18nCacheParams$1): void;
|
|
83
84
|
//#endregion
|
|
84
85
|
//#region ../format/dist/types-COaQnqVZ.d.cts
|
|
85
86
|
//#region src/locales/customLocaleMapping.d.ts
|
|
@@ -173,20 +174,6 @@ declare function useSetRegion(): (region: string | undefined) => void;
|
|
|
173
174
|
*/
|
|
174
175
|
declare function useSetEnableI18n(): (enableI18n: boolean) => void;
|
|
175
176
|
//#endregion
|
|
176
|
-
//#region src/cookie-names.d.ts
|
|
177
|
-
/**
|
|
178
|
-
* Cookie name for tracking the user's selected locale.
|
|
179
|
-
*/
|
|
180
|
-
declare const defaultLocaleCookieName = "generaltranslation.locale";
|
|
181
|
-
/**
|
|
182
|
-
* Cookie name for tracking the user's selected region.
|
|
183
|
-
*/
|
|
184
|
-
declare const defaultRegionCookieName = "generaltranslation.region";
|
|
185
|
-
/**
|
|
186
|
-
* Cookie name for persisting the enableI18n feature flag.
|
|
187
|
-
*/
|
|
188
|
-
declare const defaultEnableI18nCookieName = "generaltranslation.enable-i18n";
|
|
189
|
-
//#endregion
|
|
190
177
|
//#region src/components/LocaleSelector.d.ts
|
|
191
178
|
/**
|
|
192
179
|
* A dropdown component that allows users to select a locale.
|
|
@@ -271,16 +258,7 @@ type SharedGTProviderProps = Omit<InternalGTProviderProps, 'conditionStore' | 'i
|
|
|
271
258
|
declare function BrowserGTProvider(props: SharedGTProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
272
259
|
//#endregion
|
|
273
260
|
//#region src/index.client.d.ts
|
|
274
|
-
type TxProps = Record<string, ReactNode> & {
|
|
275
|
-
children: ReactNode;
|
|
276
|
-
context?: string;
|
|
277
|
-
locale?: string;
|
|
278
|
-
maxChars?: number;
|
|
279
|
-
$context?: string;
|
|
280
|
-
$locale?: string;
|
|
281
|
-
$maxChars?: number;
|
|
282
|
-
};
|
|
283
261
|
declare function Tx(_props: TxProps): Promise<ReactNode>;
|
|
284
262
|
//#endregion
|
|
285
|
-
export { Branch, Currency, DateTime, Derive, BrowserGTProvider as GTProvider, type GTTranslationOptions, GtInternalRuntimeTranslateJsx, GtInternalRuntimeTranslateString, GtInternalTranslateJsx, GtInternalVar, LocaleSelector, Num, Plural, ReactI18nCache, type ReactI18nCacheParams, RegionSelector, RelativeTime, type RenderPipeline, type RenderPreparedT, type RuntimeTranslationOptions, type SharedGTProviderProps, type SyncResolutionFunction, type SyncResolutionFunctionWithFallback, T, Tx, Var, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars,
|
|
263
|
+
export { Branch, Currency, DateTime, Derive, BrowserGTProvider as GTProvider, type GTTranslationOptions, GtInternalRuntimeTranslateJsx, GtInternalRuntimeTranslateString, GtInternalTranslateJsx, GtInternalVar, LocaleSelector, Num, Plural, ReactI18nCache, type ReactI18nCacheParams, RegionSelector, RelativeTime, type RenderPipeline, type RenderPreparedT, type RuntimeTranslationOptions, type SharedGTProviderProps, type SyncResolutionFunction, type SyncResolutionFunctionWithFallback, T, Tx, Var, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getFormatLocales, getLocaleProperties, getLocales, getReactI18nCache, getTranslationsSnapshot, getVersionId, gtFallback, initializeGTSRAClient as initializeGT, initializeGTSPA, mFallback, msg, resolveCanonicalLocale, setReactI18nCache, t, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleDirection, useLocaleProperties, useLocaleSelector, useLocales, useMessages, useRegion, useRegionSelector, useSetEnableI18n, useSetLocale, useSetRegion, useTranslations };
|
|
286
264
|
//# sourceMappingURL=index.client.d.mts.map
|
|
@@ -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/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","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/hooks/conditions-store.ts","../src/
|
|
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","../../format/dist/types-COaQnqVZ.d.cts","../src/components/useLocaleSelector.ts","../src/components/useRegionSelector.ts","../src/hooks/conditions-store.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;;;;;;KCIU,sBAAA,GAAyB,0BAAA;EACnC,cAAA,GAAiB,cAAA;AAAA;;;KCNd,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;;;KCdA,iCAAA,GAAoC,IAAA,CAC9C,2BAAA;EAGA,MAAA,GAAS,gBAAA;EACT,UAAA;AAAA;;;;;;;;;;;iBCMoB,eAAA,CACpB,MAAA,EAAQ,gBAAA,G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