UNPKG

@paroicms/site-generator-plugin

Version:

ParoiCMS Site Generator Plugin

17 lines 375 kB
var A0=Object.defineProperty;var O0=(i,n,r)=>n in i?A0(i,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[n]=r;var Oe=(i,n,r)=>O0(i,typeof n!="symbol"?n+"":n,r);function rm(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ro={exports:{}},ii={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var yp;function k0(){if(yp)return ii;yp=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(s,o,f){var p=null;if(f!==void 0&&(p=""+f),o.key!==void 0&&(p=""+o.key),"key"in o){f={};for(var h in o)h!=="key"&&(f[h]=o[h])}else f=o;return o=f.ref,{$$typeof:i,type:s,key:p,ref:o!==void 0?o:null,props:f}}return ii.Fragment=n,ii.jsx=r,ii.jsxs=r,ii}var bp;function L0(){return bp||(bp=1,Ro.exports=k0()),Ro.exports}var b=L0();const ie=i=>typeof i=="string",ri=()=>{let i,n;const r=new Promise((s,o)=>{i=s,n=o});return r.resolve=i,r.reject=n,r},Sp=i=>i==null?"":""+i,z0=(i,n,r)=>{i.forEach(s=>{n[s]&&(r[s]=n[s])})},D0=/###/g,xp=i=>i&&i.indexOf("###")>-1?i.replace(D0,"."):i,Np=i=>!i||ie(i),di=(i,n,r)=>{const s=ie(n)?n.split("."):n;let o=0;for(;o<s.length-1;){if(Np(i))return{};const f=xp(s[o]);!i[f]&&r&&(i[f]=new r),Object.prototype.hasOwnProperty.call(i,f)?i=i[f]:i={},++o}return Np(i)?{}:{obj:i,k:xp(s[o])}},Ep=(i,n,r)=>{const{obj:s,k:o}=di(i,n,Object);if(s!==void 0||n.length===1){s[o]=r;return}let f=n[n.length-1],p=n.slice(0,n.length-1),h=di(i,p,Object);for(;h.obj===void 0&&p.length;)f=`${p[p.length-1]}.${f}`,p=p.slice(0,p.length-1),h=di(i,p,Object),h!=null&&h.obj&&typeof h.obj[`${h.k}.${f}`]<"u"&&(h.obj=void 0);h.obj[`${h.k}.${f}`]=r},_0=(i,n,r,s)=>{const{obj:o,k:f}=di(i,n,Object);o[f]=o[f]||[],o[f].push(r)},Xr=(i,n)=>{const{obj:r,k:s}=di(i,n);if(r&&Object.prototype.hasOwnProperty.call(r,s))return r[s]},M0=(i,n,r)=>{const s=Xr(i,r);return s!==void 0?s:Xr(n,r)},sm=(i,n,r)=>{for(const s in n)s!=="__proto__"&&s!=="constructor"&&(s in i?ie(i[s])||i[s]instanceof String||ie(n[s])||n[s]instanceof String?r&&(i[s]=n[s]):sm(i[s],n[s],r):i[s]=n[s]);return i},al=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var U0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const B0=i=>ie(i)?i.replace(/[&<>"'\/]/g,n=>U0[n]):i;class H0{constructor(n){this.capacity=n,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(n){const r=this.regExpMap.get(n);if(r!==void 0)return r;const s=new RegExp(n);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(n,s),this.regExpQueue.push(n),s}}const V0=[" ",",","?","!",";"],$0=new H0(20),q0=(i,n,r)=>{n=n||"",r=r||"";const s=V0.filter(p=>n.indexOf(p)<0&&r.indexOf(p)<0);if(s.length===0)return!0;const o=$0.getRegExp(`(${s.map(p=>p==="?"?"\\?":p).join("|")})`);let f=!o.test(i);if(!f){const p=i.indexOf(r);p>0&&!o.test(i.substring(0,p))&&(f=!0)}return f},Uo=(i,n,r=".")=>{if(!i)return;if(i[n])return Object.prototype.hasOwnProperty.call(i,n)?i[n]:void 0;const s=n.split(r);let o=i;for(let f=0;f<s.length;){if(!o||typeof o!="object")return;let p,h="";for(let m=f;m<s.length;++m)if(m!==f&&(h+=r),h+=s[m],p=o[h],p!==void 0){if(["string","number","boolean"].indexOf(typeof p)>-1&&m<s.length-1)continue;f+=m-f+1;break}o=p}return o},pi=i=>i==null?void 0:i.replace("_","-"),G0={type:"logger",log(i){this.output("log",i)},warn(i){this.output("warn",i)},error(i){this.output("error",i)},output(i,n){var r,s;(s=(r=console==null?void 0:console[i])==null?void 0:r.apply)==null||s.call(r,console,n)}};class Jr{constructor(n,r={}){this.init(n,r)}init(n,r={}){this.prefix=r.prefix||"i18next:",this.logger=n||G0,this.options=r,this.debug=r.debug}log(...n){return this.forward(n,"log","",!0)}warn(...n){return this.forward(n,"warn","",!0)}error(...n){return this.forward(n,"error","")}deprecate(...n){return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(n,r,s,o){return o&&!this.debug?null:(ie(n[0])&&(n[0]=`${s}${this.prefix} ${n[0]}`),this.logger[r](n))}create(n){return new Jr(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new Jr(this.logger,n)}}var Wt=new Jr;class ts{constructor(){this.observers={}}on(n,r){return n.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const o=this.observers[s].get(r)||0;this.observers[s].set(r,o+1)}),this}off(n,r){if(this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n].delete(r)}}emit(n,...r){this.observers[n]&&Array.from(this.observers[n].entries()).forEach(([o,f])=>{for(let p=0;p<f;p++)o(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,f])=>{for(let p=0;p<f;p++)o.apply(o,[n,...r])})}}class Rp extends ts{constructor(n,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=n||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}removeNamespaces(n){const r=this.options.ns.indexOf(n);r>-1&&this.options.ns.splice(r,1)}getResource(n,r,s,o={}){var d,v;const f=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,p=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let h;n.indexOf(".")>-1?h=n.split("."):(h=[n,r],s&&(Array.isArray(s)?h.push(...s):ie(s)&&f?h.push(...s.split(f)):h.push(s)));const m=Xr(this.data,h);return!m&&!r&&!s&&n.indexOf(".")>-1&&(n=h[0],r=h[1],s=h.slice(2).join(".")),m||!p||!ie(s)?m:Uo((v=(d=this.data)==null?void 0:d[n])==null?void 0:v[r],s,f)}addResource(n,r,s,o,f={silent:!1}){const p=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let h=[n,r];s&&(h=h.concat(p?s.split(p):s)),n.indexOf(".")>-1&&(h=n.split("."),o=r,r=h[1]),this.addNamespaces(r),Ep(this.data,h,o),f.silent||this.emit("added",n,r,s,o)}addResources(n,r,s,o={silent:!1}){for(const f in s)(ie(s[f])||Array.isArray(s[f]))&&this.addResource(n,r,f,s[f],{silent:!0});o.silent||this.emit("added",n,r,s)}addResourceBundle(n,r,s,o,f,p={silent:!1,skipCopy:!1}){let h=[n,r];n.indexOf(".")>-1&&(h=n.split("."),o=s,s=r,r=h[1]),this.addNamespaces(r);let m=Xr(this.data,h)||{};p.skipCopy||(s=JSON.parse(JSON.stringify(s))),o?sm(m,s,f):m={...m,...s},Ep(this.data,h,m),p.silent||this.emit("added",n,r,s)}removeResourceBundle(n,r){this.hasResourceBundle(n,r)&&delete this.data[n][r],this.removeNamespaces(r),this.emit("removed",n,r)}hasResourceBundle(n,r){return this.getResource(n,r)!==void 0}getResourceBundle(n,r){return r||(r=this.options.defaultNS),this.getResource(n,r)}getDataByLanguage(n){return this.data[n]}hasLanguageSomeTranslations(n){const r=this.getDataByLanguage(n);return!!(r&&Object.keys(r)||[]).find(o=>r[o]&&Object.keys(r[o]).length>0)}toJSON(){return this.data}}var um={processors:{},addPostProcessor(i){this.processors[i.name]=i},handle(i,n,r,s,o){return i.forEach(f=>{var p;n=((p=this.processors[f])==null?void 0:p.process(n,r,s,o))??n}),n}};const Tp={},wp=i=>!ie(i)&&typeof i!="boolean"&&typeof i!="number";class Fr extends ts{constructor(n,r={}){super(),z0(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Wt.create("translator")}changeLanguage(n){n&&(this.language=n)}exists(n,r={interpolation:{}}){const s={...r};if(n==null)return!1;const o=this.resolve(n,s);return(o==null?void 0:o.res)!==void 0}extractFromKey(n,r){let s=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let f=r.ns||this.options.defaultNS||[];const p=s&&n.indexOf(s)>-1,h=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!q0(n,s,o);if(p&&!h){const m=n.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:n,namespaces:ie(f)?[f]:f};const d=n.split(s);(s!==o||s===o&&this.options.ns.indexOf(d[0])>-1)&&(f=d.shift()),n=d.join(o)}return{key:n,namespaces:ie(f)?[f]:f}}translate(n,r,s){let o=typeof r=="object"?{...r}:r;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(o={...o}),o||(o={}),n==null)return"";Array.isArray(n)||(n=[String(n)]);const f=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,p=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:h,namespaces:m}=this.extractFromKey(n[n.length-1],o),d=m[m.length-1];let v=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const x=o.lng||this.language,S=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((x==null?void 0:x.toLowerCase())==="cimode")return S?f?{res:`${d}${v}${h}`,usedKey:h,exactUsedKey:h,usedLng:x,usedNS:d,usedParams:this.getUsedParamsDetails(o)}:`${d}${v}${h}`:f?{res:h,usedKey:h,exactUsedKey:h,usedLng:x,usedNS:d,usedParams:this.getUsedParamsDetails(o)}:h;const C=this.resolve(n,o);let E=C==null?void 0:C.res;const z=(C==null?void 0:C.usedKey)||h,B=(C==null?void 0:C.exactUsedKey)||h,U=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,G=!this.i18nFormat||this.i18nFormat.handleAsObject,J=o.count!==void 0&&!ie(o.count),K=Fr.hasDefaultValue(o),ue=J?this.pluralResolver.getSuffix(x,o.count,o):"",re=o.ordinal&&J?this.pluralResolver.getSuffix(x,o.count,{ordinal:!1}):"",ee=J&&!o.ordinal&&o.count===0,F=ee&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${ue}`]||o[`defaultValue${re}`]||o.defaultValue;let ne=E;G&&!E&&K&&(ne=F);const pe=wp(ne),Ke=Object.prototype.toString.apply(ne);if(G&&ne&&pe&&U.indexOf(Ke)<0&&!(ie(D)&&Array.isArray(ne))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Xe=this.options.returnedObjectHandler?this.options.returnedObjectHandler(z,ne,{...o,ns:m}):`key '${h} (${this.language})' returned an object instead of string.`;return f?(C.res=Xe,C.usedParams=this.getUsedParamsDetails(o),C):Xe}if(p){const Xe=Array.isArray(ne),Ge=Xe?[]:{},Ye=Xe?B:z;for(const _ in ne)if(Object.prototype.hasOwnProperty.call(ne,_)){const Y=`${Ye}${p}${_}`;K&&!E?Ge[_]=this.translate(Y,{...o,defaultValue:wp(F)?F[_]:void 0,joinArrays:!1,ns:m}):Ge[_]=this.translate(Y,{...o,joinArrays:!1,ns:m}),Ge[_]===Y&&(Ge[_]=ne[_])}E=Ge}}else if(G&&ie(D)&&Array.isArray(E))E=E.join(D),E&&(E=this.extendTranslation(E,n,o,s));else{let Xe=!1,Ge=!1;!this.isValidLookup(E)&&K&&(Xe=!0,E=F),this.isValidLookup(E)||(Ge=!0,E=h);const _=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Ge?void 0:E,Y=K&&F!==E&&this.options.updateMissing;if(Ge||Xe||Y){if(this.logger.log(Y?"updateKey":"missingKey",x,d,h,Y?F:E),p){const $=this.resolve(h,{...o,keySeparator:!1});$&&$.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 W=[];const ye=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ye&&ye[0])for(let $=0;$<ye.length;$++)W.push(ye[$]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(o.lng||this.language):W.push(o.lng||this.language);const R=($,Z,Q)=>{var me;const I=K&&Q!==E?Q:_;this.options.missingKeyHandler?this.options.missingKeyHandler($,d,Z,I,Y,o):(me=this.backendConnector)!=null&&me.saveMissing&&this.backendConnector.saveMissing($,d,Z,I,Y,o),this.emit("missingKey",$,d,Z,E)};this.options.saveMissing&&(this.options.saveMissingPlurals&&J?W.forEach($=>{const Z=this.pluralResolver.getSuffixes($,o);ee&&o[`defaultValue${this.options.pluralSeparator}zero`]&&Z.indexOf(`${this.options.pluralSeparator}zero`)<0&&Z.push(`${this.options.pluralSeparator}zero`),Z.forEach(Q=>{R([$],h+Q,o[`defaultValue${Q}`]||F)})}):R(W,h,F))}E=this.extendTranslation(E,n,o,C,s),Ge&&E===h&&this.options.appendNamespaceToMissingKey&&(E=`${d}${v}${h}`),(Ge||Xe)&&this.options.parseMissingKeyHandler&&(E=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${v}${h}`:h,Xe?E:void 0,o))}return f?(C.res=E,C.usedParams=this.getUsedParamsDetails(o),C):E}extendTranslation(n,r,s,o,f){var m,d;if((m=this.i18nFormat)!=null&&m.parse)n=this.i18nFormat.parse(n,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const v=ie(n)&&(((d=s==null?void 0:s.interpolation)==null?void 0:d.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let x;if(v){const C=n.match(this.interpolator.nestingRegexp);x=C&&C.length}let S=s.replace&&!ie(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(S={...this.options.interpolation.defaultVariables,...S}),n=this.interpolator.interpolate(n,S,s.lng||this.language||o.usedLng,s),v){const C=n.match(this.interpolator.nestingRegexp),E=C&&C.length;x<E&&(s.nest=!1)}!s.lng&&o&&o.res&&(s.lng=this.language||o.usedLng),s.nest!==!1&&(n=this.interpolator.nest(n,(...C)=>(f==null?void 0:f[0])===C[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${C[0]} in key: ${r[0]}`),null):this.translate(...C,r),s)),s.interpolation&&this.interpolator.reset()}const p=s.postProcess||this.options.postProcess,h=ie(p)?[p]:p;return n!=null&&(h!=null&&h.length)&&s.applyPostProcessor!==!1&&(n=um.handle(h,n,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),n}resolve(n,r={}){let s,o,f,p,h;return ie(n)&&(n=[n]),n.forEach(m=>{if(this.isValidLookup(s))return;const d=this.extractFromKey(m,r),v=d.key;o=v;let x=d.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const S=r.count!==void 0&&!ie(r.count),C=S&&!r.ordinal&&r.count===0,E=r.context!==void 0&&(ie(r.context)||typeof r.context=="number")&&r.context!=="",z=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);x.forEach(B=>{var U,D;this.isValidLookup(s)||(h=B,!Tp[`${z[0]}-${B}`]&&((U=this.utils)!=null&&U.hasLoadedNamespace)&&!((D=this.utils)!=null&&D.hasLoadedNamespace(h))&&(Tp[`${z[0]}-${B}`]=!0,this.logger.warn(`key "${o}" for languages "${z.join(", ")}" won't get resolved as namespace "${h}" 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!!!")),z.forEach(G=>{var ue;if(this.isValidLookup(s))return;p=G;const J=[v];if((ue=this.i18nFormat)!=null&&ue.addLookupKeys)this.i18nFormat.addLookupKeys(J,v,G,B,r);else{let re;S&&(re=this.pluralResolver.getSuffix(G,r.count,r));const ee=`${this.options.pluralSeparator}zero`,F=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(S&&(J.push(v+re),r.ordinal&&re.indexOf(F)===0&&J.push(v+re.replace(F,this.options.pluralSeparator)),C&&J.push(v+ee)),E){const ne=`${v}${this.options.contextSeparator}${r.context}`;J.push(ne),S&&(J.push(ne+re),r.ordinal&&re.indexOf(F)===0&&J.push(ne+re.replace(F,this.options.pluralSeparator)),C&&J.push(ne+ee))}}let K;for(;K=J.pop();)this.isValidLookup(s)||(f=K,s=this.getResource(G,B,K,r))}))})}),{res:s,usedKey:o,exactUsedKey:f,usedLng:p,usedNS:h}}isValidLookup(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}getResource(n,r,s,o={}){var f;return(f=this.i18nFormat)!=null&&f.getResource?this.i18nFormat.getResource(n,r,s,o):this.resourceStore.getResource(n,r,s,o)}getUsedParamsDetails(n={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=n.replace&&!ie(n.replace);let o=s?n.replace:n;if(s&&typeof n.count<"u"&&(o.count=n.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!s){o={...o};for(const f of r)delete o[f]}return o}static hasDefaultValue(n){const r="defaultValue";for(const s in n)if(Object.prototype.hasOwnProperty.call(n,s)&&r===s.substring(0,r.length)&&n[s]!==void 0)return!0;return!1}}class Cp{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Wt.create("languageUtils")}getScriptPartFromCode(n){if(n=pi(n),!n||n.indexOf("-")<0)return null;const r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(n){if(n=pi(n),!n||n.indexOf("-")<0)return n;const r=n.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(n){if(ie(n)&&n.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(n)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?n.toLowerCase():n)}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}isSupportedCode(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}getBestMatchFromCodes(n){if(!n)return null;let r;return n.forEach(s=>{if(r)return;const o=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(o))&&(r=o)}),!r&&this.options.supportedLngs&&n.forEach(s=>{if(r)return;const o=this.getScriptPartFromCode(s);if(this.isSupportedCode(o))return r=o;const f=this.getLanguagePartFromCode(s);if(this.isSupportedCode(f))return r=f;r=this.options.supportedLngs.find(p=>{if(p===f)return p;if(!(p.indexOf("-")<0&&f.indexOf("-")<0)&&(p.indexOf("-")>0&&f.indexOf("-")<0&&p.substring(0,p.indexOf("-"))===f||p.indexOf(f)===0&&f.length>1))return p})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),ie(n)&&(n=[n]),Array.isArray(n))return n;if(!r)return n.default||[];let s=n[r];return s||(s=n[this.getScriptPartFromCode(r)]),s||(s=n[this.formatLanguageCode(r)]),s||(s=n[this.getLanguagePartFromCode(r)]),s||(s=n.default),s||[]}toResolveHierarchy(n,r){const s=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],n),o=[],f=p=>{p&&(this.isSupportedCode(p)?o.push(p):this.logger.warn(`rejecting language code not found in supportedLngs: ${p}`))};return ie(n)&&(n.indexOf("-")>-1||n.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&f(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&f(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&f(this.getLanguagePartFromCode(n))):ie(n)&&f(this.formatLanguageCode(n)),s.forEach(p=>{o.indexOf(p)<0&&f(this.formatLanguageCode(p))}),o}}const jp={zero:0,one:1,two:2,few:3,many:4,other:5},Ap={select:i=>i===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Y0{constructor(n,r={}){this.languageUtils=n,this.options=r,this.logger=Wt.create("pluralResolver"),this.pluralRulesCache={}}addRule(n,r){this.rules[n]=r}clearCache(){this.pluralRulesCache={}}getRule(n,r={}){const s=pi(n==="dev"?"en":n),o=r.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:s,type:o});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let p;try{p=new Intl.PluralRules(s,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Ap;if(!n.match(/-|_/))return Ap;const m=this.languageUtils.getLanguagePartFromCode(n);p=this.getRule(m,r)}return this.pluralRulesCache[f]=p,p}needsPlural(n,r={}){let s=this.getRule(n,r);return s||(s=this.getRule("dev",r)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(n,r,s={}){return this.getSuffixes(n,s).map(o=>`${r}${o}`)}getSuffixes(n,r={}){let s=this.getRule(n,r);return s||(s=this.getRule("dev",r)),s?s.resolvedOptions().pluralCategories.sort((o,f)=>jp[o]-jp[f]).map(o=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(n,r,s={}){const o=this.getRule(n,s);return o?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o.select(r)}`:(this.logger.warn(`no plural rule found for: ${n}`),this.getSuffix("dev",r,s))}}const Op=(i,n,r,s=".",o=!0)=>{let f=M0(i,n,r);return!f&&o&&ie(r)&&(f=Uo(i,r,s),f===void 0&&(f=Uo(n,r,s))),f},To=i=>i.replace(/\$/g,"$$$$");class Q0{constructor(n={}){var r;this.logger=Wt.create("interpolator"),this.options=n,this.format=((r=n==null?void 0:n.interpolation)==null?void 0:r.format)||(s=>s),this.init(n)}init(n={}){n.interpolation||(n.interpolation={escapeValue:!0});const{escape:r,escapeValue:s,useRawValueToEscape:o,prefix:f,prefixEscaped:p,suffix:h,suffixEscaped:m,formatSeparator:d,unescapeSuffix:v,unescapePrefix:x,nestingPrefix:S,nestingPrefixEscaped:C,nestingSuffix:E,nestingSuffixEscaped:z,nestingOptionsSeparator:B,maxReplaces:U,alwaysFormat:D}=n.interpolation;this.escape=r!==void 0?r:B0,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=f?al(f):p||"{{",this.suffix=h?al(h):m||"}}",this.formatSeparator=d||",",this.unescapePrefix=v?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=S?al(S):C||al("$t("),this.nestingSuffix=E?al(E):z||al(")"),this.nestingOptionsSeparator=B||",",this.maxReplaces=U||1e3,this.alwaysFormat=D!==void 0?D:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const n=(r,s)=>(r==null?void 0:r.source)===s?(r.lastIndex=0,r):new RegExp(s,"g");this.regexp=n(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=n(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=n(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(n,r,s,o){var C;let f,p,h;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=E=>{if(E.indexOf(this.formatSeparator)<0){const D=Op(r,m,E,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(D,void 0,s,{...o,...r,interpolationkey:E}):D}const z=E.split(this.formatSeparator),B=z.shift().trim(),U=z.join(this.formatSeparator).trim();return this.format(Op(r,m,B,this.options.keySeparator,this.options.ignoreJSONStructure),U,s,{...o,...r,interpolationkey:B})};this.resetRegExp();const v=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,x=((C=o==null?void 0:o.interpolation)==null?void 0:C.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:E=>To(E)},{regex:this.regexp,safeValue:E=>this.escapeValue?To(this.escape(E)):To(E)}].forEach(E=>{for(h=0;f=E.regex.exec(n);){const z=f[1].trim();if(p=d(z),p===void 0)if(typeof v=="function"){const U=v(n,f,o);p=ie(U)?U:""}else if(o&&Object.prototype.hasOwnProperty.call(o,z))p="";else if(x){p=f[0];continue}else this.logger.warn(`missed to pass in variable ${z} for interpolating ${n}`),p="";else!ie(p)&&!this.useRawValueToEscape&&(p=Sp(p));const B=E.safeValue(p);if(n=n.replace(f[0],B),x?(E.regex.lastIndex+=p.length,E.regex.lastIndex-=f[0].length):E.regex.lastIndex=0,h++,h>=this.maxReplaces)break}}),n}nest(n,r,s={}){let o,f,p;const h=(m,d)=>{const v=this.nestingOptionsSeparator;if(m.indexOf(v)<0)return m;const x=m.split(new RegExp(`${v}[ ]*{`));let S=`{${x[1]}`;m=x[0],S=this.interpolate(S,p);const C=S.match(/'/g),E=S.match(/"/g);(((C==null?void 0:C.length)??0)%2===0&&!E||E.length%2!==0)&&(S=S.replace(/'/g,'"'));try{p=JSON.parse(S),d&&(p={...d,...p})}catch(z){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,z),`${m}${v}${S}`}return p.defaultValue&&p.defaultValue.indexOf(this.prefix)>-1&&delete p.defaultValue,m};for(;o=this.nestingRegexp.exec(n);){let m=[];p={...s},p=p.replace&&!ie(p.replace)?p.replace:p,p.applyPostProcessor=!1,delete p.defaultValue;let d=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const v=o[1].split(this.formatSeparator).map(x=>x.trim());o[1]=v.shift(),m=v,d=!0}if(f=r(h.call(this,o[1].trim(),p),p),f&&o[0]===n&&!ie(f))return f;ie(f)||(f=Sp(f)),f||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${n}`),f=""),d&&(f=m.reduce((v,x)=>this.format(v,x,s.lng,{...s,interpolationkey:o[1].trim()}),f.trim())),n=n.replace(o[0],f),this.regexp.lastIndex=0}return n}}const Z0=i=>{let n=i.toLowerCase().trim();const r={};if(i.indexOf("(")>-1){const s=i.split("(");n=s[0].toLowerCase().trim();const o=s[1].substring(0,s[1].length-1);n==="currency"&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):n==="relativetime"&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach(p=>{if(p){const[h,...m]=p.split(":"),d=m.join(":").trim().replace(/^'+|'+$/g,""),v=h.trim();r[v]||(r[v]=d),d==="false"&&(r[v]=!1),d==="true"&&(r[v]=!0),isNaN(d)||(r[v]=parseInt(d,10))}})}return{formatName:n,formatOptions:r}},kp=i=>{const n={};return(r,s,o)=>{let f=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(f={...f,[o.interpolationkey]:void 0});const p=s+JSON.stringify(f);let h=n[p];return h||(h=i(pi(s),o),n[p]=h),h(r)}},K0=i=>(n,r,s)=>i(pi(r),s)(n);class X0{constructor(n={}){this.logger=Wt.create("formatter"),this.options=n,this.init(n)}init(n,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const s=r.cacheInBuiltFormats?kp:K0;this.formats={number:s((o,f)=>{const p=new Intl.NumberFormat(o,{...f});return h=>p.format(h)}),currency:s((o,f)=>{const p=new Intl.NumberFormat(o,{...f,style:"currency"});return h=>p.format(h)}),datetime:s((o,f)=>{const p=new Intl.DateTimeFormat(o,{...f});return h=>p.format(h)}),relativetime:s((o,f)=>{const p=new Intl.RelativeTimeFormat(o,{...f});return h=>p.format(h,f.range||"day")}),list:s((o,f)=>{const p=new Intl.ListFormat(o,{...f});return h=>p.format(h)})}}add(n,r){this.formats[n.toLowerCase().trim()]=r}addCached(n,r){this.formats[n.toLowerCase().trim()]=kp(r)}format(n,r,s,o={}){const f=r.split(this.formatSeparator);if(f.length>1&&f[0].indexOf("(")>1&&f[0].indexOf(")")<0&&f.find(h=>h.indexOf(")")>-1)){const h=f.findIndex(m=>m.indexOf(")")>-1);f[0]=[f[0],...f.splice(1,h)].join(this.formatSeparator)}return f.reduce((h,m)=>{var x;const{formatName:d,formatOptions:v}=Z0(m);if(this.formats[d]){let S=h;try{const C=((x=o==null?void 0:o.formatParams)==null?void 0:x[o.interpolationkey])||{},E=C.locale||C.lng||o.locale||o.lng||s;S=this.formats[d](h,E,{...v,...o,...C})}catch(C){this.logger.warn(C)}return S}else this.logger.warn(`there was no format function for ${d}`);return h},n)}}const J0=(i,n)=>{i.pending[n]!==void 0&&(delete i.pending[n],i.pendingCount--)};class F0 extends ts{constructor(n,r,s,o={}){var f,p;super(),this.backend=n,this.store=r,this.services=s,this.languageUtils=s.languageUtils,this.options=o,this.logger=Wt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],(p=(f=this.backend)==null?void 0:f.init)==null||p.call(f,s,o.backend,o)}queueLoad(n,r,s,o){const f={},p={},h={},m={};return n.forEach(d=>{let v=!0;r.forEach(x=>{const S=`${d}|${x}`;!s.reload&&this.store.hasResourceBundle(d,x)?this.state[S]=2:this.state[S]<0||(this.state[S]===1?p[S]===void 0&&(p[S]=!0):(this.state[S]=1,v=!1,p[S]===void 0&&(p[S]=!0),f[S]===void 0&&(f[S]=!0),m[x]===void 0&&(m[x]=!0)))}),v||(h[d]=!0)}),(Object.keys(f).length||Object.keys(p).length)&&this.queue.push({pending:p,pendingCount:Object.keys(p).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(f),pending:Object.keys(p),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(m)}}loaded(n,r,s){const o=n.split("|"),f=o[0],p=o[1];r&&this.emit("failedLoading",f,p,r),!r&&s&&this.store.addResourceBundle(f,p,s,void 0,void 0,{skipCopy:!0}),this.state[n]=r?-1:2,r&&s&&(this.state[n]=0);const h={};this.queue.forEach(m=>{_0(m.loaded,[f],p),J0(m,n),r&&m.errors.push(r),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(d=>{h[d]||(h[d]={});const v=m.loaded[d];v.length&&v.forEach(x=>{h[d][x]===void 0&&(h[d][x]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",h),this.queue=this.queue.filter(m=>!m.done)}read(n,r,s,o=0,f=this.retryTimeout,p){if(!n.length)return p(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:r,fcName:s,tried:o,wait:f,callback:p});return}this.readingCalls++;const h=(d,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(d&&v&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,n,r,s,o+1,f*2,p)},f);return}p(d,v)},m=this.backend[s].bind(this.backend);if(m.length===2){try{const d=m(n,r);d&&typeof d.then=="function"?d.then(v=>h(null,v)).catch(h):h(null,d)}catch(d){h(d)}return}return m(n,r,h)}prepareLoading(n,r,s={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();ie(n)&&(n=this.languageUtils.toResolveHierarchy(n)),ie(r)&&(r=[r]);const f=this.queueLoad(n,r,s,o);if(!f.toLoad.length)return f.pending.length||o(),null;f.toLoad.forEach(p=>{this.loadOne(p)})}load(n,r,s){this.prepareLoading(n,r,{},s)}reload(n,r,s){this.prepareLoading(n,r,{reload:!0},s)}loadOne(n,r=""){const s=n.split("|"),o=s[0],f=s[1];this.read(o,f,"read",void 0,void 0,(p,h)=>{p&&this.logger.warn(`${r}loading namespace ${f} for language ${o} failed`,p),!p&&h&&this.logger.log(`${r}loaded namespace ${f} for language ${o}`,h),this.loaded(n,p,h)})}saveMissing(n,r,s,o,f,p={},h=()=>{}){var m,d,v,x,S;if((d=(m=this.services)==null?void 0:m.utils)!=null&&d.hasLoadedNamespace&&!((x=(v=this.services)==null?void 0:v.utils)!=null&&x.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${s}" as the 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!!!");return}if(!(s==null||s==="")){if((S=this.backend)!=null&&S.create){const C={...p,isUpdate:f},E=this.backend.create.bind(this.backend);if(E.length<6)try{let z;E.length===5?z=E(n,r,s,o,C):z=E(n,r,s,o),z&&typeof z.then=="function"?z.then(B=>h(null,B)).catch(h):h(null,z)}catch(z){h(z)}else E(n,r,s,o,h,C)}!n||!n[0]||this.store.addResource(n[0],r,s,o)}}}const Lp=()=>({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:i=>{let n={};if(typeof i[1]=="object"&&(n=i[1]),ie(i[1])&&(n.defaultValue=i[1]),ie(i[2])&&(n.tDescription=i[2]),typeof i[2]=="object"||typeof i[3]=="object"){const r=i[3]||i[2];Object.keys(r).forEach(s=>{n[s]=r[s]})}return n},interpolation:{escapeValue:!0,format:i=>i,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),zp=i=>{var n,r;return ie(i.ns)&&(i.ns=[i.ns]),ie(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),ie(i.fallbackNS)&&(i.fallbackNS=[i.fallbackNS]),((r=(n=i.supportedLngs)==null?void 0:n.indexOf)==null?void 0:r.call(n,"cimode"))<0&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),typeof i.initImmediate=="boolean"&&(i.initAsync=i.initImmediate),i},Br=()=>{},P0=i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(r=>{typeof i[r]=="function"&&(i[r]=i[r].bind(i))})};class mi extends ts{constructor(n={},r){if(super(),this.options=zp(n),this.services={},this.logger=Wt,this.modules={external:[]},P0(this),r&&!this.isInitialized&&!n.isClone){if(!this.options.initAsync)return this.init(n,r),this;setTimeout(()=>{this.init(n,r)},0)}}init(n={},r){this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(ie(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=Lp();this.options={...s,...this.options,...zp(n)},this.options.interpolation={...s.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Wt.init(o(this.modules.logger),this.options):Wt.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=X0;const v=new Cp(this.options);this.store=new Rp(this.options.resources,this.options);const x=this.services;x.logger=Wt,x.resourceStore=this.store,x.languageUtils=v,x.pluralResolver=new Y0(v,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(x.formatter=o(d),x.formatter.init(x,this.options),this.options.interpolation.format=x.formatter.format.bind(x.formatter)),x.interpolator=new Q0(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new F0(o(this.modules.backend),x.resourceStore,x,this.options),x.backendConnector.on("*",(S,...C)=>{this.emit(S,...C)}),this.modules.languageDetector&&(x.languageDetector=o(this.modules.languageDetector),x.languageDetector.init&&x.languageDetector.init(x,this.options.detection,this.options)),this.modules.i18nFormat&&(x.i18nFormat=o(this.modules.i18nFormat),x.i18nFormat.init&&x.i18nFormat.init(this)),this.translator=new Fr(this.services,this.options),this.translator.on("*",(S,...C)=>{this.emit(S,...C)}),this.modules.external.forEach(S=>{S.init&&S.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Br),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[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(d=>{this[d]=(...v)=>this.store[d](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...v)=>(this.store[d](...v),this)});const h=ri(),m=()=>{const d=(v,x)=>{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),h.resolve(x),r(v,x)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),h}loadResources(n,r=Br){var f,p;let s=r;const o=ie(n)?n:this.language;if(typeof n=="function"&&(s=n),!this.options.resources||this.options.partialBundledLanguages){if((o==null?void 0:o.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const h=[],m=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(x=>{x!=="cimode"&&h.indexOf(x)<0&&h.push(x)})};o?m(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(v=>m(v)),(p=(f=this.options.preload)==null?void 0:f.forEach)==null||p.call(f,d=>m(d)),this.services.backendConnector.load(h,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(d)})}else s(null)}reloadResources(n,r,s){const o=ri();return typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=void 0),n||(n=this.languages),r||(r=this.options.ns),s||(s=Br),this.services.backendConnector.reload(n,r,f=>{o.resolve(),s(f)}),o}use(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&um.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}setResolvedLanguage(n){if(!(!n||!this.languages)&&!(["cimode","dev"].indexOf(n)>-1)){for(let r=0;r<this.languages.length;r++){const s=this.languages[r];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(n)<0&&this.store.hasLanguageSomeTranslations(n)&&(this.resolvedLanguage=n,this.languages.unshift(n))}}changeLanguage(n,r){this.isLanguageChangingTo=n;const s=ri();this.emit("languageChanging",n);const o=h=>{this.language=h,this.languages=this.services.languageUtils.toResolveHierarchy(h),this.resolvedLanguage=void 0,this.setResolvedLanguage(h)},f=(h,m)=>{m?this.isLanguageChangingTo===n&&(o(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,s.resolve((...d)=>this.t(...d)),r&&r(h,(...d)=>this.t(...d))},p=h=>{var v,x;!n&&!h&&this.services.languageDetector&&(h=[]);const m=ie(h)?h:h&&h[0],d=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(ie(h)?[h]:h);d&&(this.language||o(d),this.translator.language||this.translator.changeLanguage(d),(x=(v=this.services.languageDetector)==null?void 0:v.cacheUserLanguage)==null||x.call(v,d)),this.loadResources(d,S=>{f(S,d)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?p(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(p):this.services.languageDetector.detect(p):p(n),s}getFixedT(n,r,s){const o=(f,p,...h)=>{let m;typeof p!="object"?m=this.options.overloadTranslationOptionHandler([f,p].concat(h)):m={...p},m.lng=m.lng||o.lng,m.lngs=m.lngs||o.lngs,m.ns=m.ns||o.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||s||o.keyPrefix);const d=this.options.keySeparator||".";let v;return m.keyPrefix&&Array.isArray(f)?v=f.map(x=>`${m.keyPrefix}${d}${x}`):v=m.keyPrefix?`${m.keyPrefix}${d}${f}`:f,this.t(v,m)};return ie(n)?o.lng=n:o.lngs=n,o.ns=r,o.keyPrefix=s,o}t(...n){var r;return(r=this.translator)==null?void 0:r.translate(...n)}exists(...n){var r;return(r=this.translator)==null?void 0:r.exists(...n)}setDefaultNamespace(n){this.options.defaultNS=n}hasLoadedNamespace(n,r={}){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=r.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const p=(h,m)=>{const d=this.services.backendConnector.state[`${h}|${m}`];return d===-1||d===0||d===2};if(r.precheck){const h=r.precheck(this,p);if(h!==void 0)return h}return!!(this.hasResourceBundle(s,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||p(s,n)&&(!o||p(f,n)))}loadNamespaces(n,r){const s=ri();return this.options.ns?(ie(n)&&(n=[n]),n.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{s.resolve(),r&&r(o)}),s):(r&&r(),Promise.resolve())}loadLanguages(n,r){const s=ri();ie(n)&&(n=[n]);const o=this.options.preload||[],f=n.filter(p=>o.indexOf(p)<0&&this.services.languageUtils.isSupportedCode(p));return f.length?(this.options.preload=o.concat(f),this.loadResources(p=>{s.resolve(),r&&r(p)}),s):(r&&r(),Promise.resolve())}dir(n){var o,f;if(n||(n=this.resolvedLanguage||(((o=this.languages)==null?void 0:o.length)>0?this.languages[0]:this.language)),!n)return"rtl";const r=["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"],s=((f=this.services)==null?void 0:f.languageUtils)||new Cp(Lp());return r.indexOf(s.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(n={},r){return new mi(n,r)}cloneInstance(n={},r=Br){const s=n.forkResourceStore;s&&delete n.forkResourceStore;const o={...this.options,...n,isClone:!0},f=new mi(o);if((n.debug!==void 0||n.prefix!==void 0)&&(f.logger=f.logger.clone(n)),["store","services","language"].forEach(h=>{f[h]=this[h]}),f.services={...this.services},f.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},s){const h=Object.keys(this.store.data).reduce((m,d)=>(m[d]={...this.store.data[d]},m[d]=Object.keys(m[d]).reduce((v,x)=>(v[x]={...m[d][x]},v),m[d]),m),{});f.store=new Rp(h,o),f.services.resourceStore=f.store}return f.translator=new Fr(f.services,o),f.translator.on("*",(h,...m)=>{f.emit(h,...m)}),f.init(o,r),f.translator.options=o,f.translator.backendConnector.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},f}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const at=mi.createInstance();at.createInstance=mi.createInstance;at.createInstance;at.dir;at.init;at.loadResources;at.reloadResources;at.use;at.changeLanguage;at.getFixedT;at.t;at.exists;at.setDefaultNamespace;at.hasLoadedNamespace;at.loadNamespaces;at.loadLanguages;var wo={exports:{}},oe={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Dp;function W0(){if(Dp)return oe;Dp=1;var i=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),x=Symbol.iterator;function S(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,z={};function B(R,$,Z){this.props=R,this.context=$,this.refs=z,this.updater=Z||C}B.prototype.isReactComponent={},B.prototype.setState=function(R,$){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,$,"setState")},B.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function U(){}U.prototype=B.prototype;function D(R,$,Z){this.props=R,this.context=$,this.refs=z,this.updater=Z||C}var G=D.prototype=new U;G.constructor=D,E(G,B.prototype),G.isPureReactComponent=!0;var J=Array.isArray,K={H:null,A:null,T:null,S:null,V:null},ue=Object.prototype.hasOwnProperty;function re(R,$,Z,Q,I,me){return Z=me.ref,{$$typeof:i,type:R,key:$,ref:Z!==void 0?Z:null,props:me}}function ee(R,$){return re(R.type,$,void 0,void 0,void 0,R.props)}function F(R){return typeof R=="object"&&R!==null&&R.$$typeof===i}function ne(R){var $={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(Z){return $[Z]})}var pe=/\/+/g;function Ke(R,$){return typeof R=="object"&&R!==null&&R.key!=null?ne(""+R.key):$.toString(36)}function Xe(){}function Ge(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(Xe,Xe):(R.status="pending",R.then(function($){R.status==="pending"&&(R.status="fulfilled",R.value=$)},function($){R.status==="pending"&&(R.status="rejected",R.reason=$)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function Ye(R,$,Z,Q,I){var me=typeof R;(me==="undefined"||me==="boolean")&&(R=null);var se=!1;if(R===null)se=!0;else switch(me){case"bigint":case"string":case"number":se=!0;break;case"object":switch(R.$$typeof){case i:case n:se=!0;break;case v:return se=R._init,Ye(se(R._payload),$,Z,Q,I)}}if(se)return I=I(R),se=Q===""?"."+Ke(R,0):Q,J(I)?(Z="",se!=null&&(Z=se.replace(pe,"$&/")+"/"),Ye(I,$,Z,"",function(ya){return ya})):I!=null&&(F(I)&&(I=ee(I,Z+(I.key==null||R&&R.key===I.key?"":(""+I.key).replace(pe,"$&/")+"/")+se)),$.push(I)),1;se=0;var gt=Q===""?".":Q+":";if(J(R))for(var ze=0;ze<R.length;ze++)Q=R[ze],me=gt+Ke(Q,ze),se+=Ye(Q,$,Z,me,I);else if(ze=S(R),typeof ze=="function")for(R=ze.call(R),ze=0;!(Q=R.next()).done;)Q=Q.value,me=gt+Ke(Q,ze++),se+=Ye(Q,$,Z,me,I);else if(me==="object"){if(typeof R.then=="function")return Ye(Ge(R),$,Z,Q,I);throw $=String(R),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return se}function _(R,$,Z){if(R==null)return R;var Q=[],I=0;return Ye(R,Q,"","",function(me){return $.call(Z,me,I++)}),Q}function Y(R){if(R._status===-1){var $=R._result;$=$(),$.then(function(Z){(R._status===0||R._status===-1)&&(R._status=1,R._result=Z)},function(Z){(R._status===0||R._status===-1)&&(R._status=2,R._result=Z)}),R._status===-1&&(R._status=0,R._result=$)}if(R._status===1)return R._result.default;throw R._result}var W=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)};function ye(){}return oe.Children={map:_,forEach:function(R,$,Z){_(R,function(){$.apply(this,arguments)},Z)},count:function(R){var $=0;return _(R,function(){$++}),$},toArray:function(R){return _(R,function($){return $})||[]},only:function(R){if(!F(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},oe.Component=B,oe.Fragment=r,oe.Profiler=o,oe.PureComponent=D,oe.StrictMode=s,oe.Suspense=m,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,oe.__COMPILER_RUNTIME={__proto__:null,c:function(R){return K.H.useMemoCache(R)}},oe.cache=function(R){return function(){return R.apply(null,arguments)}},oe.cloneElement=function(R,$,Z){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var Q=E({},R.props),I=R.key,me=void 0;if($!=null)for(se in $.ref!==void 0&&(me=void 0),$.key!==void 0&&(I=""+$.key),$)!ue.call($,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&$.ref===void 0||(Q[se]=$[se]);var se=arguments.length-2;if(se===1)Q.children=Z;else if(1<se){for(var gt=Array(se),ze=0;ze<se;ze++)gt[ze]=arguments[ze+2];Q.children=gt}return re(R.type,I,void 0,void 0,me,Q)},oe.createContext=function(R){return R={$$typeof:p,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:f,_context:R},R},oe.createElement=function(R,$,Z){var Q,I={},me=null;if($!=null)for(Q in $.key!==void 0&&(me=""+$.key),$)ue.call($,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(I[Q]=$[Q]);var se=arguments.length-2;if(se===1)I.children=Z;else if(1<se){for(var gt=Array(se),ze=0;ze<se;ze++)gt[ze]=arguments[ze+2];I.children=gt}if(R&&R.defaultProps)for(Q in se=R.defaultProps,se)I[Q]===void 0&&(I[Q]=se[Q]);return re(R,me,void 0,void 0,null,I)},oe.createRef=function(){return{current:null}},oe.forwardRef=function(R){return{$$typeof:h,render:R}},oe.isValidElement=F,oe.lazy=function(R){return{$$typeof:v,_payload:{_status:-1,_result:R},_init:Y}},oe.memo=function(R,$){return{$$typeof:d,type:R,compare:$===void 0?null:$}},oe.startTransition=function(R){var $=K