import{r as e}from"./vendor-C-P32XZn.js";const t=e=>"string"==typeof e,s=()=>{let e,t;const s=new Promise((s,i)=>{e=s,t=i});return s.resolve=e,s.reject=t,s},i=e=>null==e?"":""+e,n=/###/g,o=e=>e&&e.indexOf("###")>-1?e.replace(n,"."):e,a=e=>!e||t(e),r=(e,s,i)=>{const n=t(s)?s.split("."):s;let r=0;for(;r{const{obj:i,k:n}=r(e,t,Object);if(void 0!==i||1===t.length)return void(i[n]=s);let o=t[t.length-1],a=t.slice(0,t.length-1),l=r(e,a,Object);for(;void 0===l.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),l=r(e,a,Object),(null==l?void 0:l.obj)&&void 0!==l.obj[`${l.k}.${o}`]&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=s},u=(e,t)=>{const{obj:s,k:i}=r(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},c=(e,s,i)=>{for(const n in s)"__proto__"!==n&&"constructor"!==n&&(n in e?t(e[n])||e[n]instanceof String||t(s[n])||s[n]instanceof String?i&&(e[n]=s[n]):c(e[n],s[n],i):e[n]=s[n]);return e},p=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var h={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const d=e=>t(e)?e.replace(/[&<>"'\/]/g,e=>h[e]):e;const g=[" ",",","?","!",";"],f=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),m=(e,t,s=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const i=t.split(s);let n=e;for(let o=0;o-1&&anull==e?void 0:e.replace("_","-"),y={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var s,i;null==(i=null==(s=null==console?void 0:console[e])?void 0:s.apply)||i.call(s,console,t)}};class x{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||y,this.options=t,this.debug=t.debug}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)}forward(e,s,i,n){return n&&!this.debug?null:(t(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[s](e))}create(e){return new x(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new x(this.logger,e)}}var b=new x;class S{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){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,s])=>{for(let i=0;i{for(let n=0;n-1&&this.options.ns.splice(t,1)}getResource(e,s,i,n={}){var o,a;const r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,l=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;e.indexOf(".")>-1?c=e.split("."):(c=[e,s],i&&(Array.isArray(i)?c.push(...i):t(i)&&r?c.push(...i.split(r)):c.push(i)));const p=u(this.data,c);return!p&&!s&&!i&&e.indexOf(".")>-1&&(e=c[0],s=c[1],i=c.slice(2).join(".")),!p&&l&&t(i)?m(null==(a=null==(o=this.data)?void 0:o[e])?void 0:a[s],i,r):p}addResource(e,t,s,i,n={silent:!1}){const o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let a=[e,t];s&&(a=a.concat(o?s.split(o):s)),e.indexOf(".")>-1&&(a=e.split("."),i=t,t=a[1]),this.addNamespaces(t),l(this.data,a,i),n.silent||this.emit("added",e,t,s,i)}addResources(e,s,i,n={silent:!1}){for(const o in i)(t(i[o])||Array.isArray(i[o]))&&this.addResource(e,s,o,i[o],{silent:!0});n.silent||this.emit("added",e,s,i)}addResourceBundle(e,t,s,i,n,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),i=s,s=t,t=a[1]),this.addNamespaces(t);let r=u(this.data,a)||{};o.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?c(r,s,n):r={...r,...s},l(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=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var O={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,i,n){return e.forEach(e=>{var o,a;t=null!=(a=null==(o=this.processors[e])?void 0:o.process(t,s,i,n))?a:t}),t}};const L=Symbol("i18next/PATH_KEY");function w(e,t){var s;const{[L]:i}=e(function(){const e=[],t=Object.create(null);let s;return t.get=(i,n)=>{var o;return null==(o=null==s?void 0:s.revoke)||o.call(s),n===L?e:(e.push(n),s=Proxy.revocable(i,t),s.proxy)},Proxy.revocable(Object.create(null),t).proxy}());return i.join(null!=(s=null==t?void 0:t.keySeparator)?s:".")}const N={},R=e=>!t(e)&&"boolean"!=typeof e&&"number"!=typeof e;class $ extends S{constructor(e,t={}){var s,i;super(),s=e,i=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{s[e]&&(i[e]=s[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=b.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(null==e)return!1;const i=this.resolve(e,s);if(void 0===(null==i?void 0:i.res))return!1;const n=R(i.res);return!1!==s.returnObjects||!n}extractFromKey(e,s){let i=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator;let o=s.ns||this.options.defaultNS||[];const a=i&&e.indexOf(i)>-1,r=!(this.options.userDefinedKeySeparator||s.keySeparator||this.options.userDefinedNsSeparator||s.nsSeparator||((e,t,s)=>{t=t||"",s=s||"";const i=g.filter(e=>t.indexOf(e)<0&&s.indexOf(e)<0);if(0===i.length)return!0;const n=f.getRegExp(`(${i.map(e=>"?"===e?"\\?":e).join("|")})`);let o=!n.test(e);if(!o){const t=e.indexOf(s);t>0&&!n.test(e.substring(0,t))&&(o=!0)}return o})(e,i,n));if(a&&!r){const s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:t(o)?[o]:o};const a=e.split(i);(i!==n||i===n&&this.options.ns.indexOf(a[0])>-1)&&(o=a.shift()),e=a.join(n)}return{key:e,namespaces:t(o)?[o]:o}}translate(e,s,i){let n="object"==typeof s?{...s}:s;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=w(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:r,namespaces:l}=this.extractFromKey(e[e.length-1],n),u=l[l.length-1];let c=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const p=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===(null==p?void 0:p.toLowerCase()))return h?o?{res:`${u}${c}${r}`,usedKey:r,exactUsedKey:r,usedLng:p,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${c}${r}`:o?{res:r,usedKey:r,exactUsedKey:r,usedLng:p,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:r;const d=this.resolve(e,n);let g=null==d?void 0:d.res;const f=(null==d?void 0:d.usedKey)||r,m=(null==d?void 0:d.exactUsedKey)||r,v=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,x=void 0!==n.count&&!t(n.count),b=$.hasDefaultValue(n),S=x?this.pluralResolver.getSuffix(p,n.count,n):"",k=n.ordinal&&x?this.pluralResolver.getSuffix(p,n.count,{ordinal:!1}):"",O=x&&!n.ordinal&&0===n.count,L=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${S}`]||n[`defaultValue${k}`]||n.defaultValue;let N=g;y&&!g&&b&&(N=L);const C=R(N),P=Object.prototype.toString.apply(N);if(!(y&&N&&C&&["[object Number]","[object Function]","[object RegExp]"].indexOf(P)<0)||t(v)&&Array.isArray(N))if(y&&t(v)&&Array.isArray(g))g=g.join(v),g&&(g=this.extendTranslation(g,e,n,i));else{let t=!1,s=!1;!this.isValidLookup(g)&&b&&(t=!0,g=L),this.isValidLookup(g)||(s=!0,g=r);const o=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:g,l=b&&L!==g&&this.options.updateMissing;if(s||t||l){if(this.logger.log(l?"updateKey":"missingKey",p,u,r,l?L:g),a){const e=this.resolve(r,{...n,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,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let i=0;i{var i;const a=b&&s!==g?s:o;this.options.missingKeyHandler?this.options.missingKeyHandler(e,u,t,a,l,n):(null==(i=this.backendConnector)?void 0:i.saveMissing)&&this.backendConnector.saveMissing(e,u,t,a,l,n),this.emit("missingKey",e,u,t,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,n);O&&n[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{s([e],r+t,n[`defaultValue${t}`]||L)})}):s(e,r,L))}g=this.extendTranslation(g,e,n,d,i),s&&g===r&&this.options.appendNamespaceToMissingKey&&(g=`${u}${c}${r}`),(s||t)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${r}`:r,t?g:void 0,n))}else{if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,N,{...n,ns:l}):`key '${r} (${this.language})' returned an object instead of string.`;return o?(d.res=e,d.usedParams=this.getUsedParamsDetails(n),d):e}if(a){const e=Array.isArray(N),t=e?[]:{},s=e?m:f;for(const i in N)if(Object.prototype.hasOwnProperty.call(N,i)){const e=`${s}${a}${i}`;t[i]=b&&!g?this.translate(e,{...n,defaultValue:R(L)?L[i]:void 0,joinArrays:!1,ns:l}):this.translate(e,{...n,joinArrays:!1,ns:l}),t[i]===e&&(t[i]=N[i])}g=t}}return o?(d.res=g,d.usedParams=this.getUsedParamsDetails(n),d):g}extendTranslation(e,s,i,n,o){var a,r;if(null==(a=this.i18nFormat)?void 0:a.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const a=t(e)&&(void 0!==(null==(r=null==i?void 0:i.interpolation)?void 0:r.skipOnVariables)?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(a){const t=e.match(this.interpolator.nestingRegexp);l=t&&t.length}let u=i.replace&&!t(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,i.lng||this.language||n.usedLng,i),a){const t=e.match(this.interpolator.nestingRegexp);l<(t&&t.length)&&(i.nest=!1)}!i.lng&&n&&n.res&&(i.lng=this.language||n.usedLng),!1!==i.nest&&(e=this.interpolator.nest(e,(...e)=>(null==o?void 0:o[0])!==e[0]||i.context?this.translate(...e,s):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${s[0]}`),null),i)),i.interpolation&&this.interpolator.reset()}const l=i.postProcess||this.options.postProcess,u=t(l)?[l]:l;return null!=e&&(null==u?void 0:u.length)&&!1!==i.applyPostProcessor&&(e=O.handle(u,e,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,s={}){let i,n,o,a,r;return t(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(i))return;const l=this.extractFromKey(e,s),u=l.key;n=u;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const p=void 0!==s.count&&!t(s.count),h=p&&!s.ordinal&&0===s.count,d=void 0!==s.context&&(t(s.context)||"number"==typeof s.context)&&""!==s.context,g=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);c.forEach(e=>{var t,l;this.isValidLookup(i)||(r=e,N[`${g[0]}-${e}`]||!(null==(t=this.utils)?void 0:t.hasLoadedNamespace)||(null==(l=this.utils)?void 0:l.hasLoadedNamespace(r))||(N[`${g[0]}-${e}`]=!0,this.logger.warn(`key "${n}" 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(t=>{var n;if(this.isValidLookup(i))return;a=t;const r=[u];if(null==(n=this.i18nFormat)?void 0:n.addLookupKeys)this.i18nFormat.addLookupKeys(r,u,t,e,s);else{let e;p&&(e=this.pluralResolver.getSuffix(t,s.count,s));const i=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(s.ordinal&&0===e.indexOf(n)&&r.push(u+e.replace(n,this.options.pluralSeparator)),r.push(u+e),h&&r.push(u+i)),d){const t=`${u}${this.options.contextSeparator||"_"}${s.context}`;r.push(t),p&&(s.ordinal&&0===e.indexOf(n)&&r.push(t+e.replace(n,this.options.pluralSeparator)),r.push(t+e),h&&r.push(t+i))}}let l;for(;l=r.pop();)this.isValidLookup(i)||(o=l,i=this.getResource(t,e,l,s))}))})}),{res:i,usedKey:n,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,i={}){var n;return(null==(n=this.i18nFormat)?void 0:n.getResource)?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(e={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!t(e.replace);let n=i?e.replace:e;if(i&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!i){n={...n};for(const e of s)delete n[e]}return n}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,12)&&void 0!==e[s])return!0;return!1}}class C{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=b.create("languageUtils")}getScriptPartFromCode(e){if(!(e=v(e))||e.indexOf("-")<0)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.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(t(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(s){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}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 i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(e=>e===i?e:e.indexOf("-")<0&&i.indexOf("-")<0?void 0:e.indexOf("-")>0&&i.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===i||0===e.indexOf(i)&&i.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,s){if(!e)return[];if("function"==typeof e&&(e=e(s)),t(e)&&(e=[e]),Array.isArray(e))return e;if(!s)return e.default||[];let i=e[s];return i||(i=e[this.getScriptPartFromCode(s)]),i||(i=e[this.formatLanguageCode(s)]),i||(i=e[this.getLanguagePartFromCode(s)]),i||(i=e.default),i||[]}toResolveHierarchy(e,s){const i=this.getFallbackCodes((!1===s?[]:s)||this.options.fallbackLng||[],e),n=[],o=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return t(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):t(e)&&o(this.formatLanguageCode(e)),i.forEach(e=>{n.indexOf(e)<0&&o(this.formatLanguageCode(e))}),n}}const P={zero:0,one:1,two:2,few:3,many:4,other:5},j={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class E{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=b.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=v("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",n=JSON.stringify({cleanedCode:s,type:i});if(n in this.pluralRulesCache)return this.pluralRulesCache[n];let o;try{o=new Intl.PluralRules(s,{type:i})}catch(a){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),j;if(!e.match(/-|_/))return j;const s=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(s,t)}return this.pluralRulesCache[n]=o,o}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),(null==s?void 0: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)=>P[e]-P[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,s={}){const i=this.getRule(e,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const I=(e,s,i,n=".",o=!0)=>{let a=((e,t,s)=>{const i=u(e,s);return void 0!==i?i:u(t,s)})(e,s,i);return!a&&o&&t(i)&&(a=m(e,i,n),void 0===a&&(a=m(s,i,n))),a},F=e=>e.replace(/\$/g,"$$$$");class T{constructor(e={}){var t;this.logger=b.create("interpolator"),this.options=e,this.format=(null==(t=null==e?void 0:e.interpolation)?void 0:t.format)||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:n,prefixEscaped:o,suffix:a,suffixEscaped:r,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:h,nestingPrefixEscaped:g,nestingSuffix:f,nestingSuffixEscaped:m,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:x}=e.interpolation;this.escape=void 0!==t?t:d,this.escapeValue=void 0===s||s,this.useRawValueToEscape=void 0!==i&&i,this.prefix=n?p(n):o||"{{",this.suffix=a?p(a):r||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?p(h):g||p("$t("),this.nestingSuffix=f?p(f):m||p(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==x&&x,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>(null==e?void 0: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,s,n,o){var a;let r,l,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=e=>{if(e.indexOf(this.formatSeparator)<0){const t=I(s,c,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(t,void 0,n,{...o,...s,interpolationkey:e}):t}const t=e.split(this.formatSeparator),i=t.shift().trim(),a=t.join(this.formatSeparator).trim();return this.format(I(s,c,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...o,...s,interpolationkey:i})};this.resetRegExp();const h=(null==o?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=void 0!==(null==(a=null==o?void 0:o.interpolation)?void 0:a.skipOnVariables)?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>F(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?F(this.escape(e)):F(e)}].forEach(s=>{for(u=0;r=s.regex.exec(e);){const n=r[1].trim();if(l=p(n),void 0===l)if("function"==typeof h){const s=h(e,r,o);l=t(s)?s:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))l="";else{if(d){l=r[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),l=""}else t(l)||this.useRawValueToEscape||(l=i(l));const a=s.safeValue(l);if(e=e.replace(r[0],a),d?(s.regex.lastIndex+=l.length,s.regex.lastIndex-=r[0].length):s.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),e}nest(e,s,n={}){let o,a,r;const l=(e,t)=>{var s;const i=this.nestingOptionsSeparator;if(e.indexOf(i)<0)return e;const n=e.split(new RegExp(`${i}[ ]*{`));let o=`{${n[1]}`;e=n[0],o=this.interpolate(o,r);const a=o.match(/'/g),l=o.match(/"/g);((null!=(s=null==a?void 0:a.length)?s:0)%2==0&&!l||l.length%2!=0)&&(o=o.replace(/'/g,'"'));try{r=JSON.parse(o),t&&(r={...t,...r})}catch(u){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,u),`${e}${i}${o}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let u=[];r={...n},r=r.replace&&!t(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const c=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(-1!==c&&(u=o[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),o[1]=o[1].slice(0,c)),a=s(l.call(this,o[1].trim(),r),r),a&&o[0]===e&&!t(a))return a;t(a)||(a=i(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),a=""),u.length&&(a=u.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()}),a.trim())),e=e.replace(o[0],a),this.regexp.lastIndex=0}return e}}const V=e=>{const t={};return(s,i,n)=>{let o=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(o={...o,[n.interpolationkey]:void 0});const a=i+JSON.stringify(o);let r=t[a];return r||(r=e(v(i),n),t[a]=r),r(s)}},D=e=>(t,s,i)=>e(v(s),i)(t);class A{constructor(e={}){this.logger=b.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,i={}){const n=t.split(this.formatSeparator);if(n.length>1&&n[0].indexOf("(")>1&&n[0].indexOf(")")<0&&n.find(e=>e.indexOf(")")>-1)){const e=n.findIndex(e=>e.indexOf(")")>-1);n[0]=[n[0],...n.splice(1,e)].join(this.formatSeparator)}return n.reduce((e,t)=>{var n;const{formatName:o,formatOptions:a}=(e=>{let t=e.toLowerCase().trim();const s={};if(e.indexOf("(")>-1){const i=e.split("(");t=i[0].toLowerCase().trim();const n=i[1].substring(0,i[1].length-1);"currency"===t&&n.indexOf(":")<0?s.currency||(s.currency=n.trim()):"relativetime"===t&&n.indexOf(":")<0?s.range||(s.range=n.trim()):n.split(";").forEach(e=>{if(e){const[t,...i]=e.split(":"),n=i.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();s[o]||(s[o]=n),"false"===n&&(s[o]=!1),"true"===n&&(s[o]=!0),isNaN(n)||(s[o]=parseInt(n,10))}})}return{formatName:t,formatOptions:s}})(t);if(this.formats[o]){let t=e;try{const r=(null==(n=null==i?void 0:i.formatParams)?void 0:n[i.interpolationkey])||{},l=r.locale||r.lng||i.locale||i.lng||s;t=this.formats[o](e,l,{...a,...i,...r})}catch(r){this.logger.warn(r)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class U extends S{constructor(e,t,s,i={}){var n,o;super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=b.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],null==(o=null==(n=this.backend)?void 0:n.init)||o.call(n,s,i.backend,i)}queueLoad(e,t,s,i){const n={},o={},a={},r={};return e.forEach(e=>{let i=!0;t.forEach(t=>{const a=`${e}|${t}`;!s.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,i=!1,void 0===o[a]&&(o[a]=!0),void 0===n[a]&&(n[a]=!0),void 0===r[t]&&(r[t]=!0)))}),i||(a[e]=!0)}),(Object.keys(n).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(n),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(r)}}loaded(e,t,s){const i=e.split("|"),n=i[0],o=i[1];t&&this.emit("failedLoading",n,o,t),!t&&s&&this.store.addResourceBundle(n,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:i,k:n}=r(e,t,Object);i[n]=i[n]||[],i[n].push(s)})(s.loaded,[n],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,i=0,n=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:i,wait:n,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&&i{this.read.call(this,e,t,s,i+1,2*n,o)},n):o(a,r)},r=this.backend[s].bind(this.backend);if(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(l){a(l)}}prepareLoading(e,s,i={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();t(e)&&(e=this.languageUtils.toResolveHierarchy(e)),t(s)&&(s=[s]);const o=this.queueLoad(e,s,i,n);if(!o.toLoad.length)return o.pending.length||n(),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)}loadOne(e,t=""){const s=e.split("|"),i=s[0],n=s[1];this.read(i,n,"read",void 0,void 0,(s,o)=>{s&&this.logger.warn(`${t}loading namespace ${n} for language ${i} failed`,s),!s&&o&&this.logger.log(`${t}loaded namespace ${n} for language ${i}`,o),this.loaded(e,s,o)})}saveMissing(e,t,s,i,n,o={},a=()=>{}){var r,l,u,c,p;if(!(null==(l=null==(r=this.services)?void 0:r.utils)?void 0:l.hasLoadedNamespace)||(null==(c=null==(u=this.services)?void 0:u.utils)?void 0:c.hasLoadedNamespace(t))){if(null!=s&&""!==s){if(null==(p=this.backend)?void 0:p.create){const r={...o,isUpdate:n},l=this.backend.create.bind(this.backend);if(l.length<6)try{let n;n=5===l.length?l(e,t,s,i,r):l(e,t,s,i),n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(h){a(h)}else l(e,t,s,i,a,r)}e&&e[0]&&this.store.addResource(e[0],t,s,i)}}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,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",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 s={};if("object"==typeof e[1]&&(s=e[1]),t(e[1])&&(s.defaultValue=e[1]),t(e[2])&&(s.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const t=e[3]||e[2];Object.keys(t).forEach(e=>{s[e]=t[e]})}return s},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),M=e=>{var s,i;return t(e.ns)&&(e.ns=[e.ns]),t(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),t(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),(null==(i=null==(s=e.supportedLngs)?void 0:s.indexOf)?void 0:i.call(s,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e},H=()=>{};class z extends S{constructor(e={},t){var s;if(super(),this.options=M(e),this.services={},this.logger=b,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={},i){this.isInitializing=!0,"function"==typeof e&&(i=e,e={}),null==e.defaultNS&&e.ns&&(t(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=K();this.options={...n,...this.options,...M(e)},this.options.interpolation={...n.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=n.overloadTranslationOptionHandler);const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?b.init(o(this.modules.logger),this.options):b.init(null,this.options),e=this.modules.formatter?this.modules.formatter:A;const t=new C(this.options);this.store=new k(this.options.resources,this.options);const s=this.services;s.logger=b,s.resourceStore=this.store,s.languageUtils=t,s.pluralResolver=new E(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(s.formatter=o(e),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new T(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new U(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(s.languageDetector=o(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=o(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new $(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,i||(i=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 a=s(),r=()=>{const e=(e,t)=>{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),a.resolve(t),i(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),a}loadResources(e,s=H){var i,n;let o=s;const a=t(e)?e:this.language;if("function"==typeof e&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===(null==a?void 0:a.toLowerCase())&&(!this.options.preload||0===this.options.preload.length))return o();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(a)t(a);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}null==(n=null==(i=this.options.preload)?void 0:i.forEach)||n.call(i,e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),o(e)})}else o(null)}reloadResources(e,t,i){const n=s();return"function"==typeof e&&(i=e,e=void 0),"function"==typeof t&&(i=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),i||(i=H),this.services.backendConnector.reload(e,t,e=>{n.resolve(),i(e)}),n}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()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&O.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,i){this.isLanguageChangingTo=e;const n=s();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(t,s)=>{s?this.isLanguageChangingTo===e&&(o(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),i&&i(t,(...e)=>this.t(...e))},r=s=>{var i,n;e||s||!this.services.languageDetector||(s=[]);const r=t(s)?s:s&&s[0],l=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(t(s)?[s]:s);l&&(this.language||o(l),this.translator.language||this.translator.changeLanguage(l),null==(n=null==(i=this.services.languageDetector)?void 0:i.cacheUserLanguage)||n.call(i,l)),this.loadResources(l,e=>{a(e,l)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),n}getFixedT(e,s,i){const n=(e,t,...s)=>{let o;o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(s)):{...t},o.lng=o.lng||n.lng,o.lngs=o.lngs||n.lngs,o.ns=o.ns||n.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||i||n.keyPrefix);const a=this.options.keySeparator||".";let r;return o.keyPrefix&&Array.isArray(e)?r=e.map(e=>("function"==typeof e&&(e=w(e,{...this.options,...t})),`${o.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=w(e,{...this.options,...t})),r=o.keyPrefix?`${o.keyPrefix}${a}${e}`:e),this.t(r,o)};return t(e)?n.lng=e:n.lngs=e,n.ns=s,n.keyPrefix=i,n}t(...e){var t;return null==(t=this.translator)?void 0:t.translate(...e)}exists(...e){var t;return null==(t=this.translator)?void 0:t.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],i=!!this.options&&this.options.fallbackLng,n=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}return!!this.hasResourceBundle(s,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(s,e)||i&&!o(n,e)))}loadNamespaces(e,i){const n=s();return this.options.ns?(t(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),i&&i(e)}),n):(i&&i(),Promise.resolve())}loadLanguages(e,i){const n=s();t(e)&&(e=[e]);const o=this.options.preload||[],a=e.filter(e=>o.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return a.length?(this.options.preload=o.concat(a),this.loadResources(e=>{n.resolve(),i&&i(e)}),n):(i&&i(),Promise.resolve())}dir(e){var t,s;if(e||(e=this.resolvedLanguage||((null==(t=this.languages)?void 0:t.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(n){}const i=(null==(s=this.services)?void 0:s.languageUtils)||new C(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"].indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new z(e,t);return s.createInstance=z.createInstance,s}cloneInstance(e={},t=H){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},n=new z(i);void 0===e.debug&&void 0===e.prefix||(n.logger=n.logger.clone(e));if(["store","services","language"].forEach(e=>{n[e]=this[e]}),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},s){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((s,i)=>(s[i]={...e[t][i]},s),e[t]),e),{});n.store=new k(e,i),n.services.resourceStore=n.store}return e.interpolation&&(n.services.interpolator=new T(i)),n.translator=new $(n.services,i),n.translator.on("*",(e,...t)=>{n.emit(e,...t)}),n.init(i,t),n.translator.options=i,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const B=z.createInstance();B.createInstance,B.dir,B.init,B.loadResources,B.reloadResources,B.use,B.changeLanguage,B.getFixedT,B.t,B.exists,B.setDefaultNamespace,B.hasLoadedNamespace,B.loadNamespaces,B.loadLanguages;const _={},J=(e,t,s,i)=>{G(s)&&_[s]||(G(s)&&(_[s]=new Date),((e,t,s,i)=>{var n,o,a,r;const l=[s,{code:t,...i||{}}];if(null==(o=null==(n=null==e?void 0:e.services)?void 0:n.logger)?void 0:o.forward)return e.services.logger.forward(l,"warn","react-i18next::",!0);G(l[0])&&(l[0]=`react-i18next:: ${l[0]}`),(null==(r=null==(a=null==e?void 0:e.services)?void 0:a.logger)?void 0:r.warn)?e.services.logger.warn(...l):null==console||console.warn})(e,t,s,i))},q=(e,t)=>()=>{if(e.isInitialized)t();else{const s=()=>{setTimeout(()=>{e.off("initialized",s)},0),t()};e.on("initialized",s)}},W=(e,t,s)=>{e.loadNamespaces(t,q(e,s))},Y=(e,t,s,i)=>{if(G(s)&&(s=[s]),e.options.preload&&e.options.preload.indexOf(t)>-1)return W(e,s,i);s.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,q(e,i))},G=e=>"string"==typeof e,Q=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,X={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Z=e=>X[e];let ee={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Q,Z)};let te;const se={type:"3rdParty",init(e){((e={})=>{ee={...ee,...e}})(e.options.react),(e=>{te=e})(e)}},ie=e.createContext();class ne{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var oe={exports:{}},ae={},re=e;var le="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},ue=re.useState,ce=re.useEffect,pe=re.useLayoutEffect,he=re.useDebugValue;function de(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!le(e,s)}catch(i){return!0}}var ge="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var s=t(),i=ue({inst:{value:s,getSnapshot:t}}),n=i[0].inst,o=i[1];return pe(function(){n.value=s,n.getSnapshot=t,de(n)&&o({inst:n})},[e,s,t]),ce(function(){return de(n)&&o({inst:n}),e(function(){de(n)&&o({inst:n})})},[e]),he(s),s};ae.useSyncExternalStore=void 0!==re.useSyncExternalStore?re.useSyncExternalStore:ge,oe.exports=ae;var fe=oe.exports;const me={t:(e,t)=>{return G(t)?t:"object"==typeof(s=t)&&null!==s&&G(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e;var s},ready:!1},ve=()=>()=>{},ye=(t,s={})=>{var i,n,o;const{i18n:a}=s,{i18n:r,defaultNS:l}=e.useContext(ie)||{},u=a||r||te;u&&!u.reportNamespaces&&(u.reportNamespaces=new ne),u||J(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const c=e.useMemo(()=>{var e;return{...ee,...null==(e=null==u?void 0:u.options)?void 0:e.react,...s}},[u,s]),{useSuspense:p,keyPrefix:h}=c,d=l||(null==(i=null==u?void 0:u.options)?void 0:i.defaultNS),g=G(d)?[d]:d||["translation"],f=e.useMemo(()=>g,g);null==(o=null==(n=null==u?void 0:u.reportNamespaces)?void 0:n.addUsedNamespaces)||o.call(n,f);const m=e.useRef(0),v=e.useCallback(e=>{if(!u)return ve;const{bindI18n:t,bindI18nStore:s}=c,i=()=>{m.current+=1,e()};return t&&u.on(t,i),s&&u.store.on(s,i),()=>{t&&t.split(" ").forEach(e=>u.off(e,i)),s&&s.split(" ").forEach(e=>u.store.off(e,i))}},[u,c]),y=e.useRef(),x=e.useCallback(()=>{if(!u)return me;const e=!(!u.isInitialized&&!u.initializedStoreOnce)&&f.every(e=>((e,t,s={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:s.lng,precheck:(t,i)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!i(t.isLanguageChangingTo,e))return!1}}):(J(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,u,c)),t=s.lng||u.language,i=m.current,n=y.current;if(n&&n.ready===e&&n.lng===t&&n.keyPrefix===h&&n.revision===i)return n;const o={t:u.getFixedT(t,"fallback"===c.nsMode?f:f[0],h),ready:e,lng:t,keyPrefix:h,revision:i};return y.current=o,o},[u,f,h,c,s.lng]),[b,S]=e.useState(0),{t:k,ready:O}=fe.useSyncExternalStore(v,x,x);e.useEffect(()=>{if(u&&!O&&!p){const e=()=>S(e=>e+1);s.lng?Y(u,s.lng,f,e):W(u,f,e)}},[u,s.lng,f,O,p,b]);const L=u||{},w=e.useRef(null),N=e.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(i){}return s},$=e.useMemo(()=>{const e=L,t=null==e?void 0:e.language;let s=e;e&&(w.current&&w.current.__original===e?N.current!==t?(s=R(e),w.current=s,N.current=t):s=w.current:(s=R(e),w.current=s,N.current=t));const i=[k,s,O];return i.t=k,i.i18n=s,i.ready=O,i},[k,L,O,L.resolvedLanguage,L.language,L.languages]);if(u&&p&&!O)throw new Promise(e=>{const t=()=>e();s.lng?Y(u,s.lng,f,t):W(u,f,t)});return $};function xe({i18n:t,defaultNS:s,children:i}){const n=e.useMemo(()=>({i18n:t,defaultNS:s}),[t,s]);return e.createElement(ie.Provider,{value:n},i)}export{xe as I,se as a,B as i,fe as s,ye as u};