react-i18next
Version:
Internationalization for react done right. Using the i18next i18n ecosystem.
2 lines • 77.6 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactI18next={},e.React)}(this,function(e,t){"use strict";const s=e=>"string"==typeof e,n=()=>{let e,t;const s=new Promise((s,n)=>{e=s,t=n});return s.resolve=e,s.reject=t,s},i=e=>null==e?"":String(e),o=e=>e?.callbackApi??e?.constructor?.callbackApi,a=/###/g,r=e=>e&&e.includes("###")?e.replace(a,"."):e,l=e=>!e||s(e),c=(e,t,n)=>{const i=s(t)?t.split("."):t;let o=0;for(;o<i.length-1;){if(l(e))return{};const t=r(i[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return l(e)?{}:{obj:e,k:r(i[o])}},u=(e,t,s)=>{const{obj:n,k:i}=c(e,t,Object);if(void 0!==n||1===t.length)return void(n[i]=s);let o=t[t.length-1],a=t.slice(0,t.length-1),r=c(e,a,Object);for(;void 0===r.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),r=c(e,a,Object),r?.obj&&void 0!==r.obj[`${r.k}.${o}`]&&(r.obj=void 0);r.obj[`${r.k}.${o}`]=s},p=(e,t)=>{const{obj:s,k:n}=c(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,n))return s[n]},h=(e,t,n)=>{for(const i in t)"__proto__"!==i&&"constructor"!==i&&(Object.prototype.hasOwnProperty.call(e,i)?s(e[i])||e[i]instanceof String||s(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):h(e[i],t[i],n):e[i]=t[i]);return e},d=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),g={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},f=e=>s(e)?e.replace(/[&<>"'\/]/g,e=>g[e]):e;const m=[" ",",","?","!",";"],y=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}(20),b=(e,t,s=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const n=t.split(s);let i=e;for(let e=0;e<n.length;){if(!i||"object"!=typeof i)return;let t,o="";for(let a=e;a<n.length;++a)if(a!==e&&(o+=s),o+=n[a],t=i[o],"function"!=typeof t&&"__proto__"!==o||Object.prototype.hasOwnProperty.call(i,o)||(t=void 0),void 0!==t){if(["string","number","boolean"].includes(typeof t)&&a<n.length-1)continue;e+=a-e+1;break}i=t}return i},v=e=>e?.replace(/_/g,"-"),x={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class k{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||x,this.options=t,this.debug=t.debug,this.seen=new Set}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}once(e,t,...s){return!this.debug||this.seen.has(e)||this.seen.size>=1e3?null:(this.seen.add(e),this[t](...s))}forward(e,t,n,i){return i&&!this.debug?null:(e=e.map(e=>s(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g," "):e),s(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new k(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new k(this.logger,e)}}var S=new k;class O{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const s=this.observers[e].get(t)||0;this.observers[e].set(t,s+1)}),this}off(e,t){("string"==typeof e?e.split(" "):[e]).forEach(e=>{this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])})}once(e,t){const s=(...n)=>{t(...n),this.off(e,s)};return this.on(e,s),this}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,s])=>{for(let n=0;n<s;n++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([s,n])=>{for(let i=0;i<n;i++)s(e,...t)})}}}const w=new WeakSet;class L extends O{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.logger=S.create("resourceStore"),void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}deprecateDottedLng(e){this.logger.once(e,"deprecate",`${e}: a dotted language ('en.translation.key') that carries the namespace and key is removed in v27; pass language, namespace and key as separate arguments`)}getResource(e,t,n,i={}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,a=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let r;e.includes(".")?(this.deprecateDottedLng("getResource"),r=e.split(".")):(r=[e,t],n&&(Array.isArray(n)?r.push(...n):s(n)&&o?r.push(...n.split(o)):r.push(n)));const l=p(this.data,r);return null!=l||t||n||!e.includes(".")||(e=r[0],t=r[1],n=r.slice(2).join(".")),null==l&&a&&s(n)?b(this.data?.[e]?.[t],n,o):l}addResource(e,t,s,n,i={silent:!1}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let a=[e,t];s&&(a=a.concat(o?s.split(o):s)),e.includes(".")&&(this.deprecateDottedLng("addResource"),a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),u(this.data,a,n),i.silent||this.emit("added",e,t,s,n)}addResources(e,t,n,i={silent:!1}){for(const i in n)(s(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});i.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,s,n,i,o={silent:!1,skipCopy:!1}){let a=[e,t];e.includes(".")&&(this.deprecateDottedLng("addResourceBundle"),a=e.split("."),n=s,s=t,t=a[1]),this.addNamespaces(t);let r=p(this.data,a)||{};o.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?h(r,s,i):r={...r,...s},u(this.data,a,r),o.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>{const s=t[e];return!!w.has(s)||!(!s||0===Object.keys(s).length)&&("object"==typeof s&&w.add(s),!0)})}toJSON(){return this.data}}var $={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,n,i){return e.forEach(e=>{t=this.processors[e]?.process(t,s,n,i)??t}),t}};const E=Symbol("i18next/PATH_KEY");function N(e,t){const{[E]:s}=e(function(){const e=[],t=Object.create(null);let s;return t.get=(n,i)=>(s?.revoke?.(),i===E?e:(e.push(i),s=Proxy.revocable(n,t),s.proxy)),Proxy.revocable(Object.create(null),t).proxy}()),n=t?.keySeparator??".",i=t?.nsSeparator??":",o="strict"===t?.enableSelector;if(s.length>1&&i){const e=t?.ns,a=o?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(a){if((o?a:a.length>1?a.slice(1):[]).includes(s[0]))return`${s[0]}${i}${s.slice(1).join(n)}`}}return s.join(n)}const R=e=>!s(e)&&"boolean"!=typeof e&&"number"!=typeof e;class C extends O{constructor(e,t={}){var s,n;super(),s=e,n=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils","ownPostProcessors"].forEach(e=>{s[e]&&(n[e]=s[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=S.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(null==e)return!1;const n=this.resolve(e,s);if(void 0===n?.res)return!1;const i=R(n.res);return!1!==s.returnObjects||!i}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const a=n&&e.includes(n),r=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,s)=>{t=t||"",s=s||"";const n=m.filter(e=>!t.includes(e)&&!s.includes(e));if(0===n.length)return!0;const i=y.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(s);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,i));if(a&&!r){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:s(o)?[o]:o};const a=e.split(n);(n!==i||n===i&&this.options.ns.includes(a[0]))&&(o=a.shift()),e=a.join(i)}return{key:e,namespaces:s(o)?[o]:o}}translate(e,t,n){let i="object"==typeof t?{...t}:t;if("object"!=typeof i&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof i&&(i={...i}),i||(i={}),null==e)return"";"function"==typeof e&&(e=N(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(e=>"function"==typeof e?N(e,{...this.options,...i}):String(e));const o=void 0!==i.returnDetails?i.returnDetails:this.options.returnDetails,a=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,{key:r,namespaces:l}=this.extractFromKey(e[e.length-1],i),c=l[l.length-1];let u=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");const p=i.lng||this.language,h=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===p?.toLowerCase())return h?o?{res:`${c}${u}${r}`,usedKey:r,exactUsedKey:r,usedLng:p,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:`${c}${u}${r}`:o?{res:r,usedKey:r,exactUsedKey:r,usedLng:p,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:r;const d=this.resolve(e,i);let g=d?.res;const f=d?.usedKey||r,m=d?.exactUsedKey||r,y=void 0!==i.joinArrays?i.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==i.count&&!s(i.count),x=C.hasDefaultValue(i),k=v?this.pluralResolver.getSuffix(p,i.count,i):"",S=i.ordinal&&v?this.pluralResolver.getSuffix(p,i.count,{ordinal:!1}):"",O=v&&!i.ordinal&&0===i.count,w=O&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${k}`]||i[`defaultValue${S}`]||i.defaultValue;let L=g;b&&!g&&x&&(L=w);const $=R(L),E=Object.prototype.toString.apply(L);if(!(b&&L&&$)||["[object Number]","[object Function]","[object RegExp]"].includes(E)||s(y)&&Array.isArray(L))if(b&&s(y)&&Array.isArray(g))g=g.join(y),g&&(g=this.extendTranslation(g,e,i,d,n));else{let t=!1,s=!1;!this.isValidLookup(g)&&x&&(t=!0,g=w),this.isValidLookup(g)||(s=!0,g=r);const o=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:g,l=x&&w!==g&&this.options.updateMissing;if(s||t||l){if(this.logger.log(l?"updateKey":"missingKey",p,c,v&&!l?`${r}${this.pluralResolver.getSuffix(p,i.count,i)}`:r,l?w:g),a){const e=this.resolve(r,{...i,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let s=0;s<t.length;s++)e.push(t[s]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);const s=(e,t,s)=>{const n=x&&s!==g?s:o;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,n,l,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,c,t,n,l,i,void 0,this.utils?.hasLoadedNamespace),this.emit("missingKey",e,c,t,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,i);O&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{s([e],r+t,i[`defaultValue${t}`]||w)})}):s(e,r,w))}g=this.extendTranslation(g,e,i,d,n),s&&g===r&&this.options.appendNamespaceToMissingKey&&(g=`${c}${u}${r}`),(s||t)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${r}`:r,t?g:void 0,i))}else{if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||(this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.logger.once("returnedObject","deprecate","accessing an object without returnObjects returns a sentence about it today; from v27 t() returns the key, as for a missing key (returnedObjectHandler can keep today's text)"));const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,L,{...i,ns:l}):`key '${r} (${this.language})' returned an object instead of string.`;return o?(d.res=e,d.usedParams=this.getUsedParamsDetails(i),d):e}if(a){const e=Array.isArray(L),t=e?[]:{},s=e?m:f;for(const e in L)if(Object.prototype.hasOwnProperty.call(L,e)){const n=`${s}${a}${e}`;t[e]=x&&!g?this.translate(n,{...i,defaultValue:R(w)?w[e]:void 0,joinArrays:!1,ns:l}):this.translate(n,{...i,joinArrays:!1,ns:l}),t[e]===n&&(t[e]=L[e])}g=t}}return o?(d.res=g,d.usedParams=this.getUsedParamsDetails(i),d):g}extendTranslation(e,t,n,i,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a=s(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(a){const t=e.match(this.interpolator.nestingRegexp);r=t&&t.length}let l=n.replace&&!s(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||i.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);r<(t&&t.length)&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>o?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,r=s(a)?[a]:a;return null!=e&&r?.length&&!1!==n.applyPostProcessor&&(r.forEach(e=>{this.logger.debug&&$.processors[e]&&this.ownPostProcessors&&!this.ownPostProcessors.has(e)&&this.logger.once(e,"deprecate",`postProcess: '${e}' was registered with use() on another i18next instance; from v27 post-processors are per instance, so call use() with it on this instance too`)}),e=$.handle(r,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,i,o,a,r;return s(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>"function"==typeof e?N(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(e,t),c=l.key;i=c;let u=l.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const p=void 0!==t.count&&!s(t.count),h=p&&!t.ordinal&&0===t.count,d=void 0!==t.context&&(s(t.context)||"number"==typeof t.context)&&""!==t.context,g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(n)||(r=e,this.checkedLoadedFor[`${g[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(r)||(this.checkedLoadedFor[`${g[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${g.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(s=>{if(this.isValidLookup(n))return;a=s;const i=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(i,c,s,e,t);else{let e;p&&(e=this.pluralResolver.getSuffix(s,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(t.ordinal&&e.startsWith(o)&&i.push(c+e.replace(o,this.options.pluralSeparator)),i.push(c+e),h&&i.push(c+n)),d){const s=`${c}${this.options.contextSeparator||"_"}${t.context}`;i.push(s),p&&(t.ordinal&&e.startsWith(o)&&i.push(s+e.replace(o,this.options.pluralSeparator)),i.push(s+e),h&&i.push(s+n))}}let r;for(;r=i.pop();)this.isValidLookup(n)||(o=r,n=this.getResource(s,e,r,t))}))})}),{res:n,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:r}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,s,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!s(e.replace);let i=n?e.replace:e;if(n&&void 0!==e.count&&(i={...i,count:e.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const e of t)delete i[e]}return i}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class P{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=S.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(!(e=v(e))||!e.includes("-"))return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=v(e))||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(s(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}const t=this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e;return this.logger.debug&&s(e)&&this.deprecateBareCode(e,t),t}deprecateBareCode(e,t){let s;try{s=Intl.getCanonicalLocales(e)[0]}catch(e){return}this.options.lowerCaseLng&&(s=s.toLowerCase()),s!==t&&this.logger.once(e,"deprecate",`language code '${e}' is used as '${t}'; i18next v27 canonicalizes it to '${s}', use '${s}' in lng, fallbackLng, supportedLngs and the resources`)}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const s=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(s)||(t=s)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const s=this.getScriptPartFromCode(e);if(this.isSupportedCode(s))return t=s;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n||!(!e.includes("-")&&!n.includes("-"))&&!(!e.includes("-")||n.includes("-")||e.slice(0,e.indexOf("-"))!==n))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),s(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.options.fallbackLng,i=Array.isArray(n)?n.join("|"):n;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);const o=void 0===t||!1===t||s(t),a=void 0===t&&"function"==typeof this.options.fallbackLng;let r=null;if(s(e)&&o&&!a){let s;s=void 0===t?"undefined":!1===t?"boolean:false":`string:${t}`,r=`${e.length}:${e}|${s}`}if(null!==r){const e=this.resolveHierarchyCache[r];if(void 0!==e)return e.slice()}const l=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),c=[],u=e=>{e&&(this.isSupportedCode(e)?c.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return s(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&u(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&u(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&u(this.getLanguagePartFromCode(e))):s(e)&&u(this.formatLanguageCode(e)),l.forEach(e=>{const t=this.formatLanguageCode(e);c.includes(t)||u(t)}),null!==r?(this.resolveHierarchyCache[r]=c,c.slice()):c}}const j={zero:0,one:1,two:2,few:3,many:4,other:5},I={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class A{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=S.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=v("dev"===e?"en":e),n=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:s,type:n});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(s,{type:n})}catch(s){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),I;if(!e.match(/-|_/))return I;const n=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(n,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((e,t)=>j[e]-j[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,s={}){const n=this.getRule(e,s);return n?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const T=(e,t,n,i=".",o=!0)=>{let a=((e,t,s)=>{const n=p(e,s);return void 0!==n?n:p(t,s)})(e,t,n);return null==a&&o&&s(n)&&(a=b(e,n,i),void 0===a&&(a=b(t,n,i))),a};class F{constructor(e={}){this.logger=S.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:r,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:p,nestingPrefixEscaped:h,nestingSuffix:g,nestingSuffixEscaped:m,nestingOptionsSeparator:y,maxReplaces:b,alwaysFormat:v}=e.interpolation;if(o||r||h||m){const e=Object.entries({prefixEscaped:o,suffixEscaped:r,nestingPrefixEscaped:h,nestingSuffixEscaped:m}).filter(([,e])=>e).map(([e])=>e);this.logger.once(e.join(),"deprecate",`interpolation.${e.join(", interpolation.")}: the regex-escaped delimiter options are removed in v27; pass the literal delimiters as prefix, suffix, nestingPrefix and nestingSuffix`)}this.escape=void 0!==t?t:f,this.escapeValue=void 0===s||s,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?d(i):o||"{{",this.suffix=a?d(a):r||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u?d(u):"-",this.unescapeSuffix=this.unescapePrefix?"":c?d(c):"",this.nestingPrefix=p?d(p):h||d("$t("),this.nestingSuffix=g?d(g):m||d(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=b||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,o){let a,r,l;const c=e,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=e=>{if(!e.includes(this.formatSeparator)){const s=T(t,u,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(s,void 0,n,{...o,...t,interpolationkey:e}):s}const s=e.split(this.formatSeparator),i=s.shift().trim(),a=s.join(this.formatSeparator).trim();return this.format(T(t,u,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...o,...t,interpolationkey:i})};this.resetRegExp(),!this.escapeValue&&"string"==typeof e&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const h=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=void 0!==o?.interpolation?.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,g=[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?(this.escape===f&&!1!==this.options?.interpolation?.escapeValue&&s(e)&&e.includes("/")&&this.logger.once("/","deprecate","escapeValue renders '/' in a value as '/' today; from v27 the default escape leaves '/' as it is"),this.escape(e)):e}],m=[];let y=0;return g.forEach(t=>{for(l=0;a=t.regex.exec(e);){const n=a.index-y,u=m.find(([e,t])=>n>=e&&n<t);if(u){t.regex.lastIndex=u[1]+y;continue}const g=a[1].trim();if(r=p(g),void 0===r)if("function"==typeof h){const t=h(e,a,o);r=s(t)?t:""}else if(o&&Object.prototype.hasOwnProperty.call(o,g))r="";else{if(d){this.logger.debug&&this.logger.once(`${c}\0${a[0]}`,"warn",`missed to pass in variable ${g} for interpolating ${c}`),r=a[0];continue}this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),r=""}else s(r)||this.useRawValueToEscape||(r=i(r));const f=i(t.safeValue(r));if(e=e.slice(0,a.index)+f+e.slice(a.index+a[0].length),d?(t.regex===this.regexpUnescape?m.push([a.index,a.index+f.length]):y+=f.length-a[0].length,t.regex.lastIndex+=f.length,t.regex.lastIndex-=a[0].length):t.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),e}nest(e,t,n={}){let o,a,r;const l=(e,t)=>{const s=this.nestingOptionsSeparator;if(!e.includes(s))return e;const n=e.split(new RegExp(`${d(s)}[ ]*{`));let i=`{${n[1]}`;e=n[0],i=this.interpolate(i,r);const o=i.match(/'/g),a=i.match(/"/g);((o?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(i=i.replace(/'/g,'"'));try{r=JSON.parse(i),t&&(r={...t,...r})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${s}${i}`}return r.defaultValue&&r.defaultValue.includes(this.prefix)&&delete r.defaultValue,e},c=new RegExp(this.nestingRegexp);let u="",p=0;for(;o=c.exec(e);){let h=[];r={...n},r=r.replace&&!s(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const d=/{.*}/s.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(-1!==d&&(h=o[1].slice(d).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),o[1]=o[1].slice(0,d)),a=t(l.call(this,o[1].trim(),r),r),a&&o[0]===e&&!s(a))return a;s(a)||(a=i(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),a=""),h.length&&(a=h.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()}),a.trim())),u+=e.slice(p,o.index)+i(a),p=c.lastIndex,this.regexp.lastIndex=0}return p?u+e.slice(p):e}}const V=e=>{const t={};return(s,n,i)=>{let o,a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});try{o=n+JSON.stringify(a)}catch(t){return e(v(n),i)(s)}let r=t[o];return r||(r=e(v(n),i),t[o]=r),r(s)}},D=e=>(t,s,n)=>e(v(s),n)(t);class _{constructor(e={}){this.logger=S.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?V:D;this.formats={number:s((e,t)=>{const s=new Intl.NumberFormat(e,{...t});return e=>s.format(e)}),currency:s((e,t)=>{const s=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>s.format(e)}),datetime:s((e,t)=>{const s=new Intl.DateTimeFormat(e,{...t});return e=>s.format(e)}),relativetime:s((e,t)=>{const s=new Intl.RelativeTimeFormat(e,{...t});return e=>s.format(e,t.range||"day")}),list:s((e,t)=>{const s=new Intl.ListFormat(e,{...t});return e=>s.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=V(t)}format(e,t,s,n={}){if(!t)return e;if(null==e)return e;const i=t.split(this.formatSeparator),o=[];for(let e=0;e<i.length;e++){let t=i[e];for(;t.indexOf("(")>-1&&!t.includes(")")&&e+1<i.length;)t=`${t}${this.formatSeparator}${i[++e]}`;o.push(t)}return o.reduce((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const s={};if(e.includes("(")){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].slice(0,-1);"currency"!==t||i.includes(":")?"relativetime"!==t||i.includes(":")?i.split(";").forEach(e=>{if(e){const[t,...n]=e.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();s[o]||(s[o]=i),"false"===i&&(s[o]=!1),"true"===i&&(s[o]=!0),isNaN(i)||(s[o]=parseInt(i,10))}}):s.range||(s.range=i.trim()):s.currency||(s.currency=i.trim())}return{formatName:t,formatOptions:s}})(t);if(this.formats[i]){let t=e;try{const a=n?.formatParams?.[n.interpolationkey]||{},r=a.locale||a.lng||n.locale||n.lng||s;t=this.formats[i](e,r,{...o,...n,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}}class U extends O{constructor(e,t,s,n={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=S.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,n.backend,n),this.callbackApi=o(this.backend),this.backend&&void 0===this.callbackApi&&(this.backend.read||this.backend.create)&&this.logger.deprecate("backend: set callbackApi to declare the calling convention (true: read(language, namespace, callback) and create(languages, namespace, key, fallbackValue, callback, options); false: both return a promise or a value); guessing it from the number of parameters is deprecated")}queueLoad(e,t,s,n){const i={},o={},a={},r={};return e.forEach(e=>{let n=!0;t.forEach(t=>{const a=`${e}|${t}`;!s.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:!s.reload&&this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,n=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===r[t]&&(r[t]=!0)))}),n||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(r)}}loaded(e,t,s){const n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),!t&&s&&this.store.addResourceBundle(i,o,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const a={};this.queue.forEach(s=>{((e,t,s)=>{const{obj:n,k:i}=c(e,t,Object);n[i]=n[i]||[],n[i].push(s)})(s.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(s,e),t&&s.errors.push(t),0!==s.pendingCount||s.done||(Object.keys(s.loaded).forEach(e=>{a[e]||(a[e]={});const t=s.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),s.done=!0,s.errors.length?s.callback(s.errors):s.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,s,n=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:i,callback:o});this.readingCalls++;const a=(a,r)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&r&&n<this.maxRetries?setTimeout(()=>{this.read(e,t,s,n+1,2*i,o)},i):o(a,r)},r=this.backend[s].bind(this.backend);if(!1!==this.callbackApi&&(void 0!==this.callbackApi||2!==r.length))return r(e,t,a);try{const s=r(e,t);s&&"function"==typeof s.then?s.then(e=>a(null,e)).catch(a):a(null,s)}catch(e){a(e)}}prepareLoading(e,t,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();s(e)&&(e=this.languageUtils.toResolveHierarchy(e)),s(t)&&(t=[t]);const o=this.queueLoad(e,t,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}noticeDevFallback(e){"dev"===e&&this.devIsDefaultFallback&&this.logger.once("dev","warn","language 'dev' is requested because fallbackLng is not set (its default is ['dev']); i18next v27 defaults to fallbackLng: false and loads and saves missing keys in the requested language instead. Set fallbackLng to your source language, or to 'dev' to keep this behavior")}loadOne(e,t=""){const s=e.split("|"),n=s[0],i=s[1];this.noticeDevFallback(n),this.read(n,i,"read",void 0,void 0,(s,o)=>{s&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,s),!s&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,o),this.loaded(e,s,o)})}saveMissing(e,t,s,n,i,o={},a=()=>{},r=this.newestCloneHasLoadedNamespace||this.services?.utils?.hasLoadedNamespace){if(!r||r(t)){if(null!=s&&""!==s){if(this.backend?.create){e?.forEach?.(e=>this.noticeDevFallback(e));const r={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(!1===this.callbackApi||void 0===this.callbackApi&&l.length<6)try{let i;i=!1===this.callbackApi||5===l.length?l(e,t,s,n,r):l(e,t,s,n),i&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,s,n,a,r)}e&&e[0]&&this.store.addResource(e[0],t,s,n)}}else this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const K=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),s(e[1])&&(t.defaultValue=e[1]),s(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const s=e[3]||e[2];Object.keys(s).forEach(e=>{t[e]=s[e]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),z=e=>(s(e.ns)&&(e.ns=[e.ns]),s(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),s(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),H=()=>{};let M;class B extends O{constructor(e={},t){var s;if(super(),this.options=z(e),this.services={ownPostProcessors:new Set},this.logger=S,this.modules={external:[]},s=this,Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(e=>{"function"==typeof s[e]&&(s[e]=s[e].bind(s))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(s(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const i=void 0===e.fallbackLng&&void 0===this.options.fallbackLng,a=K();this.options={...a,...this.options,...z(e)},this.options.interpolation={...a.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=a.overloadTranslationOptionHandler);const r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;M&&M!==this&&M.modules.logger!==this.modules.logger&&S.deprecate("init: this init() replaces the logger another i18next instance set with use(), as the logger is shared in v26; from v27 each instance keeps its own logger"),M=this.modules.logger?this:void 0,this.modules.logger?S.init(r(this.modules.logger),this.options):S.init(null,this.options),this.pendingWarnings?.forEach(e=>this.logger.warn(e)),this.pendingWarnings=void 0,e=this.modules.formatter?this.modules.formatter:_;const t=new P(this.options);this.store=new L(this.options.resources,this.options);const s=this.services;s.logger=S,s.resourceStore=this.store,s.languageUtils=t,s.pluralResolver=new A(t,{prepend:this.options.pluralSeparator}),e&&(s.formatter=r(e),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new F(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this),reloadResources:this.reloadResources.bind(this)},s.backendConnector=new U(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.devIsDefaultFallback=i,s.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options),s.languageDetector.async&&void 0===o(s.languageDetector)&&this.logger.deprecate("languageDetector: set callbackApi to declare how the async detect() answers (true: detect(callback); false: detect() returns a promise); guessing it from the number of parameters is deprecated")),this.modules.i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new C(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=H),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const l=n(),c=()=>{const e=(e,s)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(s),t(e,s)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(e,t=H){let n=t;const i=s(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===i?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&(e.includes(t)||e.push(t))})};if(i)t(i);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,s){const i=n();if("function"==typeof e&&(s=e,e=void 0),"function"==typeof t&&(s=t,t=void 0),!e){const t=Object.keys(this.services.backendConnector.state).map(e=>e.split("|")[0]);e=[...new Set([...this.languages||[],...t])].filter(e=>"cimode"!==e)}return t||(t=this.options.ns),s||(s=H),this.services.backendConnector.reload(e,t,e=>{i.resolve(),s(e)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");const t=t=>{if(this.modules[t]&&this.modules[t]!==e){const e=`use: this ${t} replaces the ${t} passed to an earlier use() call; only one ${t} is used per instance`;this.isInitializing||this.isInitialized?this.logger.warn(e):(this.pendingWarnings=this.pendingWarnings||[]).push(e)}this.modules[t]=e};return"backend"===e.type&&t("backend"),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&t("languageDetector"),"i18nFormat"===e.type&&t("i18nFormat"),"postProcessor"===e.type&&($.addPostProcessor(e),this.services.ownPostProcessors?.add(e.name)),"formatter"===e.type&&t("formatter"),"3rdParty"===e.type&&this.modules.external.push(e),this}hydrate(e,t){return this.options.isClone?this:this.services.resourceStore?(e&&!this.initializedStoreOnce&&(this.services.resourceStore.data=e,Object.values(e).forEach(e=>{Object.keys(e).forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)})}),this.initializedStoreOnce=!0,this.isInitialized=!0),t&&!this.initializedLanguageOnce&&(this.changeLanguage(t),this.initializedLanguageOnce=!0),this):(this.logger.warn("hydrate: call init() first, the instance has no resource store yet"),this)}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!["cimode","dev"].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}this.resolvedLanguage||this.languages.includes(e)||!this.store.hasLanguageSomeTranslations(e)||(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const i=n();this.emit("languageChanging",e);const a=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(s,n)=>{n?this.isLanguageChangingTo===e&&(a(n),this.translator.changeLanguage(n),this.isLanguageChangingTo=void 0,this.emit("languageChanged",n),this.logger.log("languageChanged",n)):this.isLanguageChangingTo=void 0,i.resolve((...e)=>this.t(...e)),t&&t(s,(...e)=>this.t(...e))},l=t=>{e||t||!this.services.languageDetector||(t=[]);const n=s(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(s(t)?[t]:t);if(i&&this.logger.debug&&(!s(o=i)||!/^[A-Za-z0-9_@.-]{1,128}$/.test(o)||o.includes("..")||["__proto__","constructor","prototype"].includes(o))){[].concat(this.options.supportedLngs||[],this.services.languageUtils.getFallbackCodes(this.options.fallbackLng,i),this.options.preload||[]).includes(i)||Object.prototype.hasOwnProperty.call(this.store.data,i)||this.logger.once(`lng:${i}`,"deprecate",`changeLanguage: the language code '${i.slice(0,64)}' comes from lng, changeLanguage() or the language detector and is not configured; from v27 such a code is refused unless it has only letters, digits, '-', '_', '@' and '.' (no '..'), at most 128 characters. Set supportedLngs, or check the code before passing it on`)}var o;i&&(this.language||a(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,e=>{r(e,i)})};if(e||!this.services.languageDetector||this.services.languageDetector.async)if(!e&&this.services.languageDetector&&this.services.languageDetector.async){const e=o(this.services.languageDetector);!1===e||void 0===e&&0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l)}else l(e);else l(this.services.languageDetector.detect());return i}getFixedT(e,t,n,i){const o=i?.scopeNs,a=(e,t,...s)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(s)):{...t},i.lng=i.lng||a.lng,i.lngs=i.lngs||a.lngs;const r=void 0!==i.ns&&null!==i.ns;i.ns=i.ns||a.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||a.keyPrefix);const l={...this.options,...i};Array.isArray(o)&&!r&&(l.ns=o),"function"==typeof i.keyPrefix&&(i.keyPrefix=N(i.keyPrefix,l));const c=this.options.keySeparator||".";let u;return i.keyPrefix&&Array.isArray(e)?u=e.map(e=>("function"==typeof e&&(e=N(e,l)),`${i.keyPrefix}${c}${e}`)):("function"==typeof e&&(e=N(e,l)),u=i.keyPrefix?`${i.keyPrefix}${c}${e}`:e),this.t(u,i)};return s(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?this.translator.translate(...e):(this.logger.warn("t: called before init(); returning an empty string"),"")}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===s.toLowerCase())return!0;const o=(e,t)=>{const s=this.services.backendConnector.state[`${e}|${t}`];return-1===s||0===s||2===s};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}if(this.hasResourceBundle(s,e))return!0;if(!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;const{languageUtils:a}=this.services,r=t.lng?a.isSupportedCode(s)&&a.toResolveHierarchy(s,!1)[0]:s;return!(r&&!o(r,e)||n&&!o(i,e))}loadNamespaces(e,t){const i=n();return this.options.ns?(s(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{i.resolve(),t&&t(e)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){const i=n();s(e)&&(e=[e]);const o=this.options.preload||[],a=e.filter(e=>!o.includes(e)&&this.services.languageUtils.isSupportedCode(e));return a.length?(this.options.preload=o.concat(a),this.loadResources(e=>{i.resolve(),t&&t(e)}),i):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"ltr";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new P(K());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new B(e,t);return s.createInstance=B.createInstance,s}cloneInstance(e={},t=H){const s=e.forkResourceStore;s&&delete(e={...e}).forkResourceStore;const n={...this.options,preload:!1,...e,isClone:!0},i=new B(n);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));if(["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={...i.services.utils,hasLoadedNamespace:i.hasLoadedNamespace.bind(i),reloadResources:i.reloadResources.bind(i)},s){const e=t=>{const s=Array.isArray(t)?[...t]:{...t};return Object.keys(s).forEach(t=>{s[t]&&"object"==typeof s[t]&&(s[t]=e(s[t]))}),s},t=e(this.store.data);i.store=new L(t,n),i.services.resourceStore=i.store}if(e.interpolation){const t={...K().interpolation,...this.options.interpolation,...e.interpolation},s={...n,interpolation:t};i.services.interpolator=new F(s)}return i.translator=new C(i.services,n),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(n,t),i.translator.options=n,i.translator.backendConnector.newestCloneHasLoadedNamespace=i.hasLoadedNamespace.bind(i),i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const q=B.createInstance();q.createInstance,q.dir,q.init,q.loadResources,q.reloadResources,q.use,q.changeLanguage,q.getFixedT,q.t,q.exists,q.setDefaultNamespace,q.hasLoadedNamespace,q.loadNamespaces,q.loadLanguages;const W={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},J=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function Y(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},s=e.match(/<\/?([^\s]+?)[/\s>]/);if(s&&(t.name=s[1],(W[s[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){const t=e.indexOf("--\x3e");return{type:"comment",comment:-1!==t?e.slice(4,t):""}}const n=new RegExp(J);let i=null;for(;i=n.exec(e),null!==i;)if(i[0].trim())if(i[1]){const e=i[1].trim();let s=[e,null];const o=e.indexOf("=");o>-1&&(s=[e.slice(0,o),e.slice(o+1)]),t.attrs[s[0]]=s[1],n.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}const G=/<!--[\s\S]*?-->|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Z=/<\/?([^\s]+?)[/\s>]/,X=/^\s*$/,Q=/^(script|style)$/i,ee="\0",te=Object.create(null);function se(e){e.forEach(function(e){if("text"!==e.type)if("comment"!==e.type){for(const t in e.attrs){const s=e.attrs[t];"string"==typeof s&&s.indexOf(ee)>-1&&(e.attrs[t]=s.split(ee).join("<"))}e.children.length&&se(e.children)}else e.comment=e.comment.split(ee).join("<");else e.content=e.content.split(ee).join("<")})}function ne(e,t){switch(t.type){case"text":return e+t.content;case"tag":{const s=t.voidElement&&"!doctype"!==t.name.toLowerCase()?"/>":">";return e+="<"+t.name+(t.attrs?function(e){const t=[];for(const s in e)null===e[s]?t.push(s):t.push(s+'="'+String(e[s]).replace(/"/g,""")+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+s,t.voidElement?e:e+t.children.reduce(ne,"")+"</"+t.name+">"}case"comment":return e+="\x3c!--"+t.comment+"--\x3e"}}var ie={parse:function(e,t){const s=t&&t.components||te,n=t&&t.allowedTags;let i=!1;if(n){const t="function"==typeof n?n:function(e){return n.indexOf(e)>-1};let s,o="",a=0;for(G.lastIndex=0;s=G.exec(e);){const n=s[0];o+=e.slice(a,s.index);const r=n.match(Z);n.startsWith("\x3c!--")||r&&t(r[1])?(o+=n,a=s.index+n.length):(i=!0,o+=ee,a=s.index+1,G.lastIndex=a)}e=o+e.slice(a)}const o=[],a=[];let r,l,c=-1,u=!1,p=0;if(0!==e.indexOf("<")){const t=e.indexOf("<");o.push({type:"text",content:-1===t?e:e.substring(0,t)})}const h=[];let d;for(;d=G.exec(e);)h.push(d);return h.forEach(function(e,t){const s=e[0];if(!s)return;if(s.startsWith("\x3c!--"))return;let n=0,i=0,o=-1,a=null;for(let e=0;e<s.length;e++){const t=s.charAt(e);a?t===a&&(a=null):'"'===t||"'"===t?a=t:"<"===t?(n++,2===n&&(o=e)):">"===t&&i++}const r=o>-1&&/[a-zA-Z0-9\-!/]/.test(s.charAt(o+1));if(n>i&&r){const e=s.substring(0,o),n=s.substring(e.length);h[t][0]=n,h[t].index+=e.length}}),h.forEach(function(t,n){const i=t[0];if(!i)return;const d=t.index;if(d<p)return;if(u){if(i!=="</"+r.name+">")return;u=!1}const g="/"!==i.charAt(1),f=i.startsWith("\x3c!--"),m=d+i.length,y=e.charAt(m),b=h[n+1];let v,x;if("<"===y&&b){const t=e.substring(m,b.index);v=t.split("<").length>t.split(">").length}if(f){const t=Y(i);if(c<0)return o.push(t),o;x=a[c],x.children.push(t);const s=e.slice(m,b?b.index:void 0);return s.length>0&&x.children.push({type:"text",content:s}),o}if(g){c++,r=Y(i),"tag"===r.type&&s[r.name]&&(r.type="component",u=!0);let t=!1;if(!u&&!r.voidElement&&Q.test(r.name)){t=!0,l||(l=e.toLowerCase());const s=l.indexOf("</"+r.name.toLowerCase()+">",m),n=-1===s?e.length:s,i=e.slice(m,n);i&&r.children.push({type:"text",content:i}),p=n}r.voidElement||u||t||!y||"<"===y||r.children.push({type:"text",content:e.slice(m,b?b.index:void 0)}),0===c&&o.push(r),x=a[c-1],x&&x.children.push(r),a[c]=r}if((!g||r.voidElement)&&(c>-1&&(r.voidElement||r.name===i.slice(2,-1))&&(c--,r=-1===c?o:a[c]),!u&&("<"!==y||v)&&y)){x=-1===c?o:a[c].children;const t=b?b.index:-1;let s=e.slice(m,-1===t?void 0:t);X.test(s)&&(s=" "),(t>-1&&c+x.length>=0||" "!==s)&&x.push({type:"text",content:s})}}),i&&se(o),o},stringify:function(e){return e.reduce(function(e,t){return e+ne("",t)},"")}};const oe=(e,t,s,n)=>{const i=[s,{code:t,...n||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);he(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},ae={},re=(e,t,s,n)=>{he(s)&&ae[s]||(he(s)&&(ae[s]=new Date),oe(e,t,s,n))},le=(e,t)=>()=>{if(e.isInitialized)t();else{const s=()=>{setTimeout(()=>{e.off("initialized",s)},0),t()};e.on("initialized",s)}},ce=(e,t,s)=>{e.loadNamespaces(t,le(e,s))},ue=(e,t,s,n)=>{if(he(s)&&(s=[s]),e.options.preload&&e.options.preload.indexOf(t)>-1)return ce(e,s,n);s.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,le(e,n))},pe=e=>e.displayName||e.name||(he(e)&&e.length>0?e:"Unknown"),he=e=>"string"==typeof e,de=e=>"object"==typeof e&&null!==e,ge=e=>{const t=e?.services?.i18nFormat;return"function"==typeof t?.parse?t:void 0},fe={"&":"&","<":"<",">":">",'"':""","'":"'"},me=e=>{if(!e)return e;const t={};return Object.keys(e).forEach(s=>{const n=e[s];t[s]=he(n)?n.replace(/[&<>"']/g,e=>fe[e]):n}),t},ye=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,be={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ve=e=>be[e],xe=e=>e.replace(ye,ve);let ke={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:xe,transDefaultProps:void 0};const Se=(e={})=>{ke={...ke,...e}},Oe=()=>ke;let we;const Le=e=>{we=e},$e=()=>we,Ee=(e,t)=>{if(!e)return!1;const s=e.props?.children??e.children;return t?s.length>0:!!s},Ne=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?Re(t):t},Re=e=>Array.isArray(e)?e:[e],Ce=(e,s,n,i)=>{if(!e)return"";let o="";const a=Re(e),r=s?.transSupportBasicHtmlNodes?s.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((e,a)=>{if(he(e))o+=`${e}`;else{if(t.isValidElement(e)){const{props:t,type:l}=e,c=Object.keys(t).length,u=r.indexOf(l)>-1,p=t.children;if(!p&&u&&!c)return void(o+=`<${l}/>`);if(!p&&(!u||c)||t.i18nIsDynamicList)return void(o+=`<${a}></${a}>`);if(u&&c<=1){const e=he(p)?p:Ce(p,s,n,i);return void(o+=`<${l}>${e}</${l}>`)}const h=Ce(p,s,n,i);return void(o+=`<${a}>${h}</${a}>`)}if(null!==e){if(de(e)){const{format:t,...s}=e,a=Object.keys(s);if(1===a.length){const e=t?`${a[0]}, ${t}`:a[0];return void(o+=`{{${e}}}`)}return!a.length&&1===Object.keys(e).length&&"format"in e?void(o+="{{format}}"):void oe(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:e})}oe(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:e})}else oe(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i})}}),o},Pe=(e,s,n,i,o,a,r,l)=>{if(""===n)return[];const c=o.transKeepBasicHtmlNodesFor||[],u=n&&new RegExp(c.map(e=>`<${e}`).join("|")).test(n),p="function"==typeof o.unescape?o.unescape:Oe().unescape;if(!(e||s||u||r))return[l&&he(n)?p(n):n];const h=r||l,d=s??{},g=e=>{Re(e).forEach(e=>{he(e)||(Ee(e)?g(Ne(e)):de(e)&&!t.isValidElement(e)&&Object.assign(d,e))})};g(e);const f=Object.keys(d),m=ie.parse(`<0>${n}</0>`,{allowedTags:e=>/^\d+$/.test(e)||c.indexOf(e)>-1||f.indexOf(e)>-1}),y={...d,...a},b=(e,s,n)=>{const i=Ne(e),o=x(i,s.children,n);return(e=>Re(e).every(t.isValidElement))(i)&&0===o.length||e.props?.i18nIsDynamicList?i:o},v=(e,s,n,i,o)=>{e.dummy?(e.children=s,n.push(t.cloneElement(e,{key:i},o?void 0:s))):n.push(...t.Children.map([e],e=>{if(e.type===t.Fragment||void 0!==e.props?.i18nIsDynamicList){const n={key:i};return e&&e.props&&Object.keys(e.props).forEach(t=>{"children"!==t&&"i18nIsDynamicList"!==t&&(n[t]=e.props[t])}),t.createElement(e.type,n,o?null:s)}const n={key:i};return e&&e.props&&Object.keys(e.props).forEach(t=>{"ref"!==t&&"children"!==t&&(n[t]=e.props[t])}),t.cloneElement(e,n,o?null:s)}))},x=(e,n,a)=>{const r=Re(e),l=Re(n),d={};return l.reduce((e,n,l)=>{const g=n.children?.[0]?.content&&i.services.interpolator.interpolate(n.children[0].content,y,i.language),f=h&&g?p(g):g;if("tag"===n.type){let p=r[parseInt(n.name,10)];!p&&s&&(p=s[n.name]),1===a.length&&!p&&de(a[0])&&(p=a[0][n.name]),p||(p={});const g={...n.attrs};h&&Object.keys(g).forEach(e=>{const t=g[e];he(t)&&(g[e]=xe(t))});const m=0!==Object.keys(g).length?((e,t)=>{const s={...t};return s.props={...t.props,...e.props},s})({props:g},p):p,k=t.isValidElement(m),S=k&&Ee(n,!0)&&!n.voidElement,O=u&&de(m)&&m.dummy&&!k,w=de(s)&&Object.hasOwnProperty.call(s,n.name);if(he(m)){const t=i.services.interpolator.interpolate(m,y,i.language);e.push(t)}else if(Ee(m)||S){const t=b(m,n,a);v(m,t,e,l)}else if(O){const t=x(r,n.children,a);v(m,t,e,l)}else if(Number.isNaN(parseFloat(n.name)))if(w){const t=b(m,n,a);v(m,t,e,l,n.voidElement)}else if(o.transSupportBasicHtmlNodes&&c.indexOf(n.name)>-1)if(n.voidElement)e.push(t.createElement(n.name,{key:`${n.name}-${l}`}));else{const s=d[n.name]||0;let i;d[n.name]=s+1;let o=0;for(let e=0;e<r.length;e+=1){const a=r[e];if(t.isValidElement(a)&&a.type===n.name){if(o===s){i=a;break}o+=1}}const c=i?Re(Ne(i)):r,u=x(c,n.children,a);e.push(t.createElement(n.name,{key:`${n.name}-${l}`},u))}else if(n.voidElement)e.push(`<${n.name} />`);else{const t=x(r,n.children,a);e.push(`<${n.name}>${t}</${n.name}>`)}else if(de(m)&&!k){const t=n.children[0]?f:null;t&&e.push(t)}else v(m,f,e,l,1!==n.children.length||!f)}else if("text"===n.type){const s=o.transWrapTextNodes,a=h?p(i.services.interpolator.interpolate(n.content,y,i.language)):i.services.interpolator.interpolate(n.content,y,i.language);s?e.push(t.createElement(s,{key:`${n.name}-${l}`},a)):e.push(a)}return e},[])},k=x([{dummy:!0,children:e||[]}],m,Re(e||[]));return Ne(k[0])},je=(e,s,n)=>{const i=e.key||s,o=t.cloneElement(e,{key:i});if(!o.props||!o.props.children||n.indexOf(`${s}/>`)<0&&n.indexOf(`${s} />`)<0)return o;return t.createElement(function(){return t.createElement(t.Fragment,null,o)},{key:i})},Ie=(e,t,s,n)=>e?Array.isArray(e)?((e,t)=>e.map((e,s)=>je(e,s,t)))(e,t):de(e)?((e,t)=>{const s={};return Object.keys(e).forEach(n=>{Object.assign(s,{[n]:je(e[n],n,t)})}),s})(e,t):(re(s,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:n}),null):null;function Ae({children:e,count:s,parent:n,i18nKey:i,context:o,tOptions:a={},values:r,defaults:l,components:c,ns:u,i18n:p,t:h,shouldUnescape:d,...g}){const f=p||$e();if(!f)return re(f,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const m=h||f.t.bind(f)||(e=>e),y={...Oe(),...f.options?.react};let b=u||(m.ns?void 0:f.options?.defaultNS||"translation");he(b)&&(b=[b]);const{transDefaultProps:v}=y,x=v?.tOptions?{...v.tOptions,...a}:a,k=d??v?.shouldUnescape,S=v?.values?{...v.values,...r}:r,O=v?.components?{...v.components,...c}:c,w=Ce(e,y,f,i),L=Array.isArray(i)?i[i.length-1]:i,$=l||x?.defaultValue||w||y.transEmptyNodeValue||("function"==typeof L?N(L):L),{hashTransKey:E}=y,R=i||(E?E(w||$):w||$);r=f.options?.interpolation?.defaultVariables?{...f.options.interpolation.defaultVariables,...S}:S;const C=(e=>{const s={};if(!e)return s;const n=e=>{Re(e).forEach(e=>{he(e)||(Ee(e)?n(Ne(e)):de(e)&&!t.isValidElement(e)&&Object.assign(s,e))})};return n(e),s})(e);C&&"number"==typeof C.count&&void 0===s&&(s=C.count),void 0===s&&(s=x?.count);const P=r||void 0!==s&&!f.options?.interpolation?.alwaysFormat||!e,j=ge(f),I=P&&(j?!j.options?.escapeVariables:!1===(x.interpolation?.escapeValue??f.options?.interpolation?.escapeValue));let A=P?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}};I&&!j&&(A={interpolation:{...x.interpolation,escapeValue:!0}});const T={...f.options?.interpolation,...x.interpolation},F=T.escape||f.services?.interpolator?.escape,V=Object.keys(C).map(e=>`${T.prefix??"{{"}${e}${T.suffix??"}}"}`),D=P&&!j&&V.length>0&&!1!==T.skipOnVariables&&!x.missingInterpolationHandler&&!f.options?.missingInterpolationHandler&&"function"==typeof F&&V.every(e=>F(e)===e),_=I&&j?me:e=>e,U={..._(x),context:o||x.context,count:s,..._(r),...D&&{missingInterpolationHandler:(e,t,s)=>s&&Object.prototype.hasOwnProperty.call(s,t[1].trim())?"":t[0]},...A,defaultValue:$,ns:b};let K=R?m(R,U):$;K===R&&$&&(K=$);const z=Ie(O,K,f,i);let H=z||e,M=null;var B;de(B=z)&&!Array.isArray(B)&&Object.keys(B).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0)?(M=z,H=e):z&&!Array.isArray(z)&&(M=z,H=void 0);const q=Pe(H,M,K,f,y,U,k,I),W=n??y.defaultTransParent;return W?t.createElement(W,g,q):q}const Te={type:"3rdParty",init(e){Se(e.options.react),Le(e)}},Fe=t.createContext();class Ve{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const De=e=>async t=>({...await(e.getInitialProps?.(t))??{},..._e()}),_e=()=>{const e=$e();if(!e)return console.warn("react-i18next:: getInitialProps: You will need to pass in an i18next instance by using initReactI18next"),{};const t=e.reportNamespaces?.getUsedNamespaces()??[],s={},n={};return e.languages.forEach(s=>{n[s]={},t.forEach(t=>{n[s][t]=e.getResourceBundle(s,t)||{}})}),s.initialI18nStore=n,s.initialLanguage=e.language,s};class Ue extends Error{constructor(e,t,s){super(e),this.name="TranslationParserError",this.position=t,this.translationString=s,Error.captureStackTrace&&Error.captureStackTrace(this,Ue)}}const Ke={" ":" ","&":"&","<":"<",">":">",""":'"',"'":"'","©":"©","®":"®","™":"™","…":"…","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","′":"′","″":"″","‹":"‹","›":"›","§":"§","¶":"¶","·":"·"," ":" "," ":" "," ":" ","€":"€","£":"£","¥":"¥","¢":"¢","¤":"¤","×":"×","÷":"÷","−":"−","±":"±","≠":"≠","≤":"≤","≥":"≥","≈":"≈","≡":"≡","∞":"∞","∫":"∫","∑":"∑","∏":"∏","√":"√","∂":"∂","‰":"‰","°":"°","µ":"µ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ","¡":"¡","¿":"¿","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ª":"ª","º":"º","¯":"¯","´":"´","¸":"¸","¹":"¹","²":"²","³":"³","¼":"¼","½":"½","¾":"¾","♠":"♠","♣":"♣","♥":"♥","♦":"♦","◊":"◊","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","ℵ":"ℵ"},ze=/&(?:#(\d+)|#x([0-9a-fA-F]+)|[A-Za-z][A-Za-z0-9]*);/g,He=(e,t)=>t<=1114111?String.fromCodePoint(t):e,Me=(e,s=[])=>{if(!e)return[];const n=(e=>{const t=[];let s=0,n="";const i=()=>{n&&(t.push({type:"Text",value:n,position:s-n.length}),n="")};for(;s<e.length;){const o=e[s];if("<"===o){const a=e.slice(s).match(/^<(\d+)>/);if(a)i(),t.push({type:"TagOpen",value:a[0],position:s,tagNumber:parseInt(a[1],10)}),s+=a[0].length;else{const a=e.slice(s).match(/^<\/(\d+)>/);a?(i(),t.push({type:"TagClose",value:a[0],position:s,tagNumber:parseInt(a[1],10)}),s+=a[0].length):(n+=o,s+=1)}}else n+=o,s+=1}return i(),t})(e),i=[],o=[],a=new Set;if(n.forEach(n=>{switch(n.type){case"Text":{const e=n.value.replace(ze,(e,t,s)=>t?He(e,parseInt(t,10)):s?He(e,parseInt(s,16)):Object.prototype.hasOwnProperty.call(Ke,e)?Ke[e]:e);(o.length>0?o[o.length-1].children:i).push(e)}break;case"TagOpen":{const{tagNumber:e}=n,t=(()=>{if(0===o.length)return s;const e=o[o.length-1];return e.declaration.props?.children&&Array.isArray(e.declaration.props.children)?e.declaration.props.children:e.declarations})(),r=t[e];if(!r){a.add(e);const t=`<${e}>`;(o.length>0?o[o.length-1].children:i).push(t);break}o.push({tagNumber:e,children:[],position:n.position,declaration:r,declarations:t})}break;case"TagClose":{const{tagNumber:s}=n;if(a.has(s)){const e=`</${s}>`;(o.length>0?o[o.length-1].children:i).push(e),a.delete(s);break}if(0===o.length)throw new Ue(`Unexpected closing tag </${s}> at position ${n.position}`,n.position,e);const r=o.pop();if(r.tagNumber!==s)throw new Ue(`Mismatched tags: expected </${r.tagNumber}> but got </${s}> at position ${n.position}`,n.position,e);const l=((e,s,n)=>{const{type:i,props:o={}}=e;if(o.children&&Array.isArray(o.children)&&n){const{children:e,...n}=o;return t.createElement(i,n,...s)}return 0===s.length?t.createElement(i,o):1===s.length?t.createElement(i,o,s[0]):t.createElement(i,o,...s)})(r.declaration,r.children,r.declarations);(o.length>0?o[o.length-1].children:i).push(l)}}}),o.length>0){const t=o[o.length-1];throw new Ue(`Unclosed tag <${t.tagNumber}> at position ${t.position}`,t.position,e)}return i};function Be({i18nKey:e,defaultTranslation:s,content:n,ns:i,values:o={},i18n:a,t:r}){const l=a||$e();if(!l)return re(l,"NO_I18NEXT_INSTANCE","IcuTrans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:e}),t.createElement(t.Fragment,{},s);const c=r||l.t?.bind(l)||(e=>e);let u=i||c.ns||l.options?.defaultNS;u=he(u)?[u]:u||["translation"];const p={...l.options?.interpolation?.defaultVariables,...o},h=ge(l),d=h?!h.options?.escapeVariables:!1===l.options?.interpolation?.escapeValue,g=c(e||s,{defaultValue:s,...d&&h?me(p):p,...d&&!h&&{interpolation:{escapeValue:!0}},ns:u});try{const e=Me(g,n);return t.createElement(t.Fragment,{},...e)}catch(s){return oe(l,"ICU_TRANS_RENDER_ERROR",`IcuTrans component error for key "${e}": ${s.message}`,{i18nKey:e,error:s}),t.createElement(t.Fragment,{},g)}}function qe({i18nKey:e,defaultTranslation:s,content:n,ns:i,values:o={},i18n:a,t:r}){const{i18n:l,defaultNS:c}=t.useContext(Fe)||{},u=a||l||$e(),p=r||u?.t.bind(u);return Be({i18nKey:e,defaultTranslation:s,content:n,ns:i||p?.ns||c||u?.options?.defaultNS,values:o,i18n:u,t:r})}Be.displayName="IcuTransWithoutContext",qe.displayName="IcuTrans";var We,Je,Ye={exports:{}},Ge={};var Ze=(Je||(Je=1,Ye.exports=function(){if(We)return Ge;We=1;var e=t,s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!s(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var s=t(),l=n({inst:{value:s,getSnapshot:t}}),c=l[0].inst,u=l[1];return o(function(){c.value=s,c.getSnapshot=t,r(c)&&u({inst:c})},[e,s,t]),i(function(){return r(c)&&u({inst:c}),e(function(){r(c)&&u({inst:c})})},[e]),a(s),s};return Ge.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,Ge}()),Ye.exports);const Xe={t:(e,t)=>{if(he(t))return t;if(de(t)&&he(t.defaultValue))return t.defaultValue;if("function"==typeof e)return"";if(Array.isArray(e)){const t=e[e.length-1];return"function"==typeof t?"":t}return e},ready:!1},Qe=()=>()=>{},et=(e,s={})=>{const{i18n:n}=s,{i18n:i,defaultNS:o}=t.useContext(Fe)||{},a=n||i||$e();a&&!a.reportNamespaces&&(a.reportNamespaces=new Ve),a||re(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const r=t.useMemo(()=>({...Oe(),...a?.options?.react,...s}),[a,s]),{useSuspense:l,keyPrefix:c,bindI18n:u,bindI18nStore:p}=r,h=e||o||a?.options?.defaultNS,d=he(h)?[h]:h||["translation"],g=JSON.stringify(d),f=t.useMemo(()=>d,[g]);a?.reportNamespaces?.addUsedNamespaces?.(f);const m=t.useRef(0),y=t.useCallback(e=>{if(!a)return Qe;const t=()=>{m.current+=1,e()};return u&&a.on(u,t),p&&a.store.on(p,t),()=>{u&&u.split(" ").forEach(e=>a.off(e,t)),p&&p.split(" ").forEach(e=>a.store.off(e,t))}},[a,u,p]),b=t.useRef(),v=t.useCallback(()=>{if(!a)return Xe;const e=!(!a.isInitialized&&!a.initializedStoreOnce)&&f.every(e=>((e,t,s={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:s.lng,precheck:(t,n)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):(re(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,a,r)),t=s.lng||a.language,n=m.current,i="function"==typeof c?N(c,{...a.options,ns:f}):c,o=b.current;if(o&&o.i18n===a&&o.ready===e&&o.lng===t&&o.namespaces===f&&o.keyPrefix===i&&o.revision===n)return o;const l={t:a.getFixedT(t,"fallback"===r.nsMode?f:f[0],c,{scopeNs:f}),i18n:a,ready:e,lng:t,namespaces:f,keyPrefix:i,revision:n};return b.current=l,l},[a,f,c,r,s.lng]),[x,k]=t.useState(0);let S,{t:O,ready:w}=Ze.useSyncExternalStore(y,v,v);a&&l&&!w&&(S=new Promise(e=>{const t=()=>e();s.lng?ue(a,s.lng,f,t):ce(a,f,t)}),({t:O,ready:w}=v())),t.useEffect(()=>{if(a&&!w&&!l){const e=()=>k(e=>e+1);s.lng?ue(a,s.lng,f,e):ce(a,f,e)}},[a,s.lng,f,w,l,x]);const L=a||{},$=t.useRef(null),E=t.useRef(),R=e=>{const t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;const s=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(s,"__original"))try{Object.defineProperty(s,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch(e){}return s},C=t.useMemo(()=>{const e=L,t=e&&`${(s=e).language}|${s.resolvedLanguage}|${s.languages?.join(",")}`;var s;let n=e;e&&($.current&&$.current.__original===e?E.current!==t?(n=R(e),$.current=n,E.current=t):n=$.current:(n=R(e),$.current=n,E.current=t));const i=w||l?O:(...e)=>(re(a,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),O(...e)),o=[i,n,w];return o.t=i,o.i18n=n,o.ready=w,o},[O,L,w,L.resolvedLanguage,L.language,L.languages]);if(a&&l&&!w){let e=!1;try{e=!1}catch(e){}throw e&&re(a,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),S}return C};const tt=(e,s,n={})=>{const{i18n:i}=n,{i18n:o}=t.useContext(Fe)||{},a=i||o||$e();if(a){if(!a.options?.isClone){if(e&&!a.initializedStoreOnce){if(!a.services?.resourceStore)return void re(a,"I18N_NOT_INITIALIZED","useSSR: i18n instance was found but not initialized (services.resourceStore is missing). Make sure you call i18next.init() before using useSSR — e.g. at module level, not only in getStaticProps/getServerSideProps.");a.services.resourceStore.data=e,a.options.ns=Object.values(e).reduce((e,t)=>(Object.keys(t).forEach(t=>{e.indexOf(t)<0&&e.push(t)}),e),a.options.ns),a.initializedStoreOnce=!0,a.isInitialized=!0}s&&!a.initializedLanguageOnce&&(a.changeLanguage(s),a.initializedLanguageOnce=!0)}}else re(a,"NO_I18NEXT_INSTANCE","useSSR: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.")};e.I18nContext=Fe,e.I18nextProvider=function({i18n:e,defaultNS:s,children:n}){const i=t.useMemo(()=>({i18n:e,defaultNS:s}),[e,s]);return t.createElement(Fe.Provider,{value:i},n)},e.IcuTrans=qe,e.IcuTransWithoutContext=Be,e.Trans=function({children:e,count:s,parent:n,i18nKey:i,context:o,tOptions:a={},values:r,defaults:l,components:c,ns:u,i18n:p,t:h,shouldUnescape:d,...g}){const{i18n:f,defaultNS:m}=t.useContext(Fe)||{},y=p||f||$e(),b=h||y?.t.bind(y);return Ae({children:e,count:s,parent:n,i18nKey:i,context:o,tOptions:a,values:r,defaults:l,components:c,ns:u||(b?.ns?void 0:m||y?.options?.defaultNS),i18n:y,t:h,shouldUnescape:d,...g})},e.TransWithoutContext=Ae,e.Translation=({ns:e,children:t,...s})=>{const[n,i,o]=et(e,s);return t(n,{i18n:i,lng:i?.language},o)},e.composeInitialProps=De,e.date=()=>"",e.getDefaults=Oe,e.getI18n=$e,e.getInitialProps=_e,e.initReactI18next=Te,e.nodesToString=Ce,e.number=()=>"",e.plural=()=>"",e.select=()=>"",e.selectOrdinal=()=>"",e.setDefaults=Se,e.setI18n=Le,e.time=()=>"",e.useSSR=tt,e.useTranslation=et,e.withSSR=()=>function(e){function s({initialI18nStore:s,initialLanguage:n,...i}){return tt(s,n),t.createElement(e,{...i})}return s.getInitialProps=De(e),s.displayName=`withI18nextSSR(${pe(e)})`,s.WrappedComponent=e,s},e.withTranslation=(e,s={})=>function(n){function i({forwardedRef:i,...o}){const[a,r,l]=et(e,{...o,keyPrefix:s.keyPrefix}),c={...o,t:a,i18n:r,tReady:l};return s.withRef&&i?c.ref=i:!s.withRef&&i&&(c.forwardedRef=i),t.createElement(n,c)}i.displayName=`withI18nextTranslation(${pe(n)})`,i.WrappedComponent=n;return s.withRef?t.forwardRef((e,s)=>t.createElement(i,Object.assign({},e,{forwardedRef:s}))):i}});