/** @license MIT | @cube-dev/ui-kit v0.147.0 | Cube Dev Team */
import { SUPPORTED_LOCALES } from "./locales.js";
import uikit_default from "./locales/de-DE/uikit.js";
import uikit_default$1 from "./locales/en-US/uikit.js";
import uikit_default$2 from "./locales/es-ES/uikit.js";
import uikit_default$3 from "./locales/es-MX/uikit.js";
import uikit_default$4 from "./locales/fr-FR/uikit.js";
import uikit_default$5 from "./locales/it-IT/uikit.js";
import uikit_default$6 from "./locales/ja-JP/uikit.js";
import uikit_default$7 from "./locales/nb-NO/uikit.js";
import uikit_default$8 from "./locales/pt-BR/uikit.js";
import uikit_default$9 from "./locales/pt-PT/uikit.js";
import uikit_default$10 from "./locales/sv-SE/uikit.js";
import uikit_default$11 from "./locales/vi-VN/uikit.js";
import i18next from "i18next";
import { initReactI18next } from "react-i18next";

//#region src/i18n/instance.ts
/** The dedicated namespace all UI Kit strings live under. */
const UIKIT_I18N_NAMESPACE = "uikit";
const BUNDLES = {
	"en-US": uikit_default$1,
	"de-DE": uikit_default,
	"es-ES": uikit_default$2,
	"es-MX": uikit_default$3,
	"fr-FR": uikit_default$4,
	"it-IT": uikit_default$5,
	"ja-JP": uikit_default$6,
	"nb-NO": uikit_default$7,
	"pt-BR": uikit_default$8,
	"pt-PT": uikit_default$9,
	"sv-SE": uikit_default$10,
	"vi-VN": uikit_default$11
};
const DEFAULT_OPTIONS = {
	resources: Object.fromEntries(SUPPORTED_LOCALES.map((locale) => [locale, { [UIKIT_I18N_NAMESPACE]: BUNDLES[locale] }])),
	lng: "en-US",
	fallbackLng: "en-US",
	load: "currentOnly",
	defaultNS: UIKIT_I18N_NAMESPACE,
	ns: [UIKIT_I18N_NAMESPACE],
	interpolation: { escapeValue: false },
	returnNull: false,
	returnEmptyString: true,
	initAsync: false,
	react: { useSuspense: false },
	enableSelector: true
};
/**
* Creates an isolated, synchronously initialized UI Kit i18next instance.
*
* Create one per server request and pass it to `<Root i18n={instance}>` (or
* `<I18nProvider i18n={instance}>`). Its language can then be changed without
* racing with another request rendered by the same server process.
*/
function createUIKitI18n(locale = "en-US") {
	const isolatedInstance = i18next.createInstance();
	isolatedInstance.init({
		...DEFAULT_OPTIONS,
		lng: locale
	});
	return isolatedInstance;
}
/**
* The browser-friendly default instance. Existing hosts can continue to drive
* it through `getI18n()`. Concurrent server renders must use a request-local
* instance from `createUIKitI18n()` instead.
*/
const instance = i18next.createInstance();
instance.use(initReactI18next).init(DEFAULT_OPTIONS);
/** Returns the shared UI Kit i18next instance. */
function getI18n() {
	return instance;
}

//#endregion
export { UIKIT_I18N_NAMESPACE, createUIKitI18n, getI18n };
//# sourceMappingURL=instance.js.map