@spscommerce/i18n 8.2.2 → 8.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const K=require("react"),ht=a=>a&&typeof a=="object"&&"default"in a?a:{default:a};function vt(a,n){for(var t=0;t<n.length;t++){const e=n[t];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in a)){const i=Object.getOwnPropertyDescriptor(e,r);i&&Object.defineProperty(a,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}const U=ht(K);function I(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?I=function(t){return typeof t}:I=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(a)}function ve(a,n,t){return n in a?Object.defineProperty(a,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[n]=t,a}function D(a){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?Object(arguments[n]):{},e=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&e.push.apply(e,Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.forEach(function(r){ve(a,r,t[r])})}return a}function M(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function Te(a,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,e.key,e)}}function q(a,n,t){return n&&Te(a.prototype,n),t&&Te(a,t),a}function J(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function re(a,n){if(n&&(I(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return J(a)}function Z(a){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Z(a)}function Le(a,n){return Le=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},Le(a,n)}function me(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(n&&n.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),n&&Le(a,n)}var mt={type:"logger",log:function(n){this.output("log",n)},warn:function(n){this.output("warn",n)},error:function(n){this.output("error",n)},output:function(n,t){console&&console[n]&&console[n].apply(console,t)}},yt=function(){function a(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,a),this.init(n,t)}return q(a,[{key:"init",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||mt,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,e,r,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]="".concat(r).concat(this.prefix," ").concat(t[0])),this.logger[e](t))}},{key:"create",value:function(t){return new a(this.logger,D({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),a}(),$=new yt,W=function(){function a(){M(this,a),this.observers={}}return q(a,[{key:"on",value:function(t,e){var r=this;return t.split(" ").forEach(function(i){r.observers[i]=r.observers[i]||[],r.observers[i].push(e)}),this}},{key:"off",value:function(t,e){if(!!this.observers[t]){if(!e){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(function(r){return r!==e})}}},{key:"emit",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];if(this.observers[t]){var o=[].concat(this.observers[t]);o.forEach(function(u){u.apply(void 0,r)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[t].concat(r))})}}}]),a}();function ee(){var a,n,t=new Promise(function(e,r){a=e,n=r});return t.resolve=a,t.reject=n,t}function Ne(a){return a==null?"":""+a}function bt(a,n,t){a.forEach(function(e){n[e]&&(t[e]=n[e])})}function je(a,n,t){function e(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function r(){return!a||typeof a=="string"}for(var i=typeof n!="string"?[].concat(n):n.split(".");i.length>1;){if(r())return{};var o=e(i.shift());!a[o]&&t&&(a[o]=new t),Object.prototype.hasOwnProperty.call(a,o)?a=a[o]:a={}}return r()?{}:{obj:a,k:e(i.shift())}}function _e(a,n,t){var e=je(a,n,Object),r=e.obj,i=e.k;r[i]=t}function wt(a,n,t,e){var r=je(a,n,Object),i=r.obj,o=r.k;i[o]=i[o]||[],e&&(i[o]=i[o].concat(t)),e||i[o].push(t)}function le(a,n){var t=je(a,n),e=t.obj,r=t.k;if(!!e)return e[r]}function De(a,n,t){var e=le(a,t);return e!==void 0?e:le(n,t)}function et(a,n,t){for(var e in n)e!=="__proto__"&&e!=="constructor"&&(e in a?typeof a[e]=="string"||a[e]instanceof String||typeof n[e]=="string"||n[e]instanceof String?t&&(a[e]=n[e]):et(a[e],n[e],t):a[e]=n[e]);return a}function Y(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var St={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function xt(a){return typeof a=="string"?a.replace(/[&<>"'\/]/g,function(n){return St[n]}):a}var ye=typeof window<"u"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Ot=function(a){me(n,a);function n(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return M(this,n),e=re(this,Z(n).call(this)),ye&&W.call(J(e)),e.data=t||{},e.options=r,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e}return q(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}},{key:"getResource",value:function(e,r,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=[e,r];return i&&typeof i!="string"&&(u=u.concat(i)),i&&typeof i=="string"&&(u=u.concat(s?i.split(s):i)),e.indexOf(".")>-1&&(u=e.split(".")),le(this.data,u)}},{key:"addResource",value:function(e,r,i,o){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var l=[e,r];i&&(l=l.concat(u?i.split(u):i)),e.indexOf(".")>-1&&(l=e.split("."),o=r,r=l[1]),this.addNamespaces(r),_e(this.data,l,o),s.silent||this.emit("added",e,r,i,o)}},{key:"addResources",value:function(e,r,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var s in i)(typeof i[s]=="string"||Object.prototype.toString.apply(i[s])==="[object Array]")&&this.addResource(e,r,s,i[s],{silent:!0});o.silent||this.emit("added",e,r,i)}},{key:"addResourceBundle",value:function(e,r,i,o,s){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},l=[e,r];e.indexOf(".")>-1&&(l=e.split("."),o=i,i=r,r=l[1]),this.addNamespaces(r);var c=le(this.data,l)||{};o?et(c,i,s):c=D({},c,i),_e(this.data,l,c),u.silent||this.emit("added",e,r,i)}},{key:"removeResourceBundle",value:function(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}},{key:"hasResourceBundle",value:function(e,r){return this.getResource(e,r)!==void 0}},{key:"getResourceBundle",value:function(e,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?D({},{},this.getResource(e,r)):this.getResource(e,r)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),n}(W),tt={processors:{},addPostProcessor:function(n){this.processors[n.name]=n},handle:function(n,t,e,r,i){var o=this;return n.forEach(function(s){o.processors[s]&&(t=o.processors[s].process(t,e,r,i))}),t}},Fe={},Ie=function(a){me(n,a);function n(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return M(this,n),e=re(this,Z(n).call(this)),ye&&W.call(J(e)),bt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,J(e)),e.options=r,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e.logger=$.create("translator"),e}return q(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=this.resolve(e,r);return i&&i.res!==void 0}},{key:"extractFromKey",value:function(e,r){var i=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");var o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,s=r.ns||this.options.defaultNS;if(i&&e.indexOf(i)>-1){var u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:s};var l=e.split(i);(i!==o||i===o&&this.options.ns.indexOf(l[0])>-1)&&(s=l.shift()),e=l.join(o)}return typeof s=="string"&&(s=[s]),{key:e,namespaces:s}}},{key:"translate",value:function(e,r,i){var o=this;if(I(r)!=="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),r||(r={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);var s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],r),l=u.key,c=u.namespaces,p=c[c.length-1],v=r.lng||this.language,m=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v&&v.toLowerCase()==="cimode"){if(m){var d=r.nsSeparator||this.options.nsSeparator;return p+d+l}return l}var y=this.resolve(e,r),h=y&&y.res,b=y&&y.usedKey||l,S=y&&y.exactUsedKey||l,x=Object.prototype.toString.apply(h),R=["[object Number]","[object Function]","[object RegExp]"],k=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,P=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(w&&h&&P&&R.indexOf(x)<0&&!(typeof k=="string"&&x==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,h,r):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(s){var A=x==="[object Array]",T=A?[]:{},C=A?S:b;for(var j in h)if(Object.prototype.hasOwnProperty.call(h,j)){var z="".concat(C).concat(s).concat(j);T[j]=this.translate(z,D({},r,{joinArrays:!1,ns:c})),T[j]===z&&(T[j]=h[j])}h=T}}else if(w&&typeof k=="string"&&x==="[object Array]")h=h.join(k),h&&(h=this.extendTranslation(h,e,r,i));else{var B=!1,f=!1,g=r.count!==void 0&&typeof r.count!="string",O=n.hasDefaultValue(r),N=g?this.pluralResolver.getSuffix(v,r.count):"",E=r["defaultValue".concat(N)]||r.defaultValue;!this.isValidLookup(h)&&O&&(B=!0,h=E),this.isValidLookup(h)||(f=!0,h=l);var L=O&&E!==h&&this.options.updateMissing;if(f||B||L){if(this.logger.log(L?"updateKey":"missingKey",v,p,l,L?E:h),s){var V=this.resolve(l,D({},r,{keySeparator:!1}));V&&V.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.")}var F=[],H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&H&&H[0])for(var Q=0;Q<H.length;Q++)F.push(H[Q]);else this.options.saveMissingTo==="all"?F=this.languageUtils.toResolveHierarchy(r.lng||this.language):F.push(r.lng||this.language);var Ce=function(G,we,Ae){o.options.missingKeyHandler?o.options.missingKeyHandler(G,p,we,L?Ae:h,L,r):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(G,p,we,L?Ae:h,L,r),o.emit("missingKey",G,p,we,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&g?F.forEach(function(be){o.pluralResolver.getSuffixes(be).forEach(function(G){Ce([be],l+G,r["defaultValue".concat(G)]||E)})}):Ce(F,l,E))}h=this.extendTranslation(h,e,r,y,i),f&&h===l&&this.options.appendNamespaceToMissingKey&&(h="".concat(p,":").concat(l)),f&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,r,i,o,s){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,i,o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(D({},i,{interpolation:D({},this.options.interpolation,i.interpolation)}));var l=i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,c;if(l){var p=e.match(this.interpolator.nestingRegexp);c=p&&p.length}var v=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(v=D({},this.options.interpolation.defaultVariables,v)),e=this.interpolator.interpolate(e,v,i.lng||this.language,i),l){var m=e.match(this.interpolator.nestingRegexp),d=m&&m.length;c<d&&(i.nest=!1)}i.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var b=arguments.length,S=new Array(b),x=0;x<b;x++)S[x]=arguments[x];return s&&s[0]===S[0]&&!i.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(S[0]," in key: ").concat(r[0])),null):u.translate.apply(u,S.concat([r]))},i)),i.interpolation&&this.interpolator.reset()}var y=i.postProcess||this.options.postProcess,h=typeof y=="string"?[y]:y;return e!=null&&h&&h.length&&i.applyPostProcessor!==!1&&(e=tt.handle(h,e,r,this.options&&this.options.postProcessPassResolved?D({i18nResolved:o},i):i,this)),e}},{key:"resolve",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o,s,u,l,c;return typeof e=="string"&&(e=[e]),e.forEach(function(p){if(!r.isValidLookup(o)){var v=r.extractFromKey(p,i),m=v.key;s=m;var d=v.namespaces;r.options.fallbackNS&&(d=d.concat(r.options.fallbackNS));var y=i.count!==void 0&&typeof i.count!="string",h=i.context!==void 0&&typeof i.context=="string"&&i.context!=="",b=i.lngs?i.lngs:r.languageUtils.toResolveHierarchy(i.lng||r.language,i.fallbackLng);d.forEach(function(S){r.isValidLookup(o)||(c=S,!Fe["".concat(b[0],"-").concat(S)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(c)&&(Fe["".concat(b[0],"-").concat(S)]=!0,r.logger.warn('key "'.concat(s,'" for languages "').concat(b.join(", "),`" won't get resolved as namespace "`).concat(c,'" 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!!!")),b.forEach(function(x){if(!r.isValidLookup(o)){l=x;var R=m,k=[R];if(r.i18nFormat&&r.i18nFormat.addLookupKeys)r.i18nFormat.addLookupKeys(k,m,x,S,i);else{var w;y&&(w=r.pluralResolver.getSuffix(x,i.count)),y&&h&&k.push(R+w),h&&k.push(R+="".concat(r.options.contextSeparator).concat(i.context)),y&&k.push(R+=w)}for(var P;P=k.pop();)r.isValidLookup(o)||(u=P,o=r.getResource(x,S,P,i))}}))})}}),{res:o,usedKey:s,exactUsedKey:u,usedLng:l,usedNS:c}}},{key:"isValidLookup",value:function(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}},{key:"getResource",value:function(e,r,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,r,i,o):this.resourceStore.getResource(e,r,i,o)}}],[{key:"hasDefaultValue",value:function(e){var r="defaultValue";for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&r===i.substring(0,r.length)&&e[i]!==void 0)return!0;return!1}}]),n}(W);function Se(a){return a.charAt(0).toUpperCase()+a.slice(1)}var kt=function(){function a(n){M(this,a),this.options=n,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$.create("languageUtils")}return q(a,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return e.length===2||(e.pop(),e[e.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(e.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(t){if(typeof t=="string"&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],r=t.split("-");return this.options.lowerCaseLng?r=r.map(function(i){return i.toLowerCase()}):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=Se(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=Se(r[1].toLowerCase())),e.indexOf(r[2].toLowerCase())>-1&&(r[2]=Se(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function(t){return this.logger.deprecate("languageUtils.isWhitelisted",`function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it's usage asap.`),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var e=this;if(!t)return null;var r;return t.forEach(function(i){if(!r){var o=e.formatLanguageCode(i);(!e.options.supportedLngs||e.isSupportedCode(o))&&(r=o)}}),!r&&this.options.supportedLngs&&t.forEach(function(i){if(!r){var o=e.getLanguagePartFromCode(i);if(e.isSupportedCode(o))return r=o;r=e.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}},{key:"getFallbackCodes",value:function(t,e){if(!t)return[];if(typeof t=="function"&&(t=t(e)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!e)return t.default||[];var r=t[e];return r||(r=t[this.getScriptPartFromCode(e)]),r||(r=t[this.formatLanguageCode(e)]),r||(r=t[this.getLanguagePartFromCode(e)]),r||(r=t.default),r||[]}},{key:"toResolveHierarchy",value:function(t,e){var r=this,i=this.getFallbackCodes(e||this.options.fallbackLng||[],t),o=[],s=function(l){!l||(r.isSupportedCode(l)?o.push(l):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(l)))};return typeof t=="string"&&t.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):typeof t=="string"&&s(this.formatLanguageCode(t)),i.forEach(function(u){o.indexOf(u)<0&&s(r.formatLanguageCode(u))}),o}}]),a}(),Lt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Pt={1:function(n){return Number(n>1)},2:function(n){return Number(n!=1)},3:function(n){return 0},4:function(n){return Number(n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2)},5:function(n){return Number(n==0?0:n==1?1:n==2?2:n%100>=3&&n%100<=10?3:n%100>=11?4:5)},6:function(n){return Number(n==1?0:n>=2&&n<=4?1:2)},7:function(n){return Number(n==1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2)},8:function(n){return Number(n==1?0:n==2?1:n!=8&&n!=11?2:3)},9:function(n){return Number(n>=2)},10:function(n){return Number(n==1?0:n==2?1:n<7?2:n<11?3:4)},11:function(n){return Number(n==1||n==11?0:n==2||n==12?1:n>2&&n<20?2:3)},12:function(n){return Number(n%10!=1||n%100==11)},13:function(n){return Number(n!==0)},14:function(n){return Number(n==1?0:n==2?1:n==3?2:3)},15:function(n){return Number(n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2)},16:function(n){return Number(n%10==1&&n%100!=11?0:n!==0?1:2)},17:function(n){return Number(n==1||n%10==1&&n%100!=11?0:1)},18:function(n){return Number(n==0?0:n==1?1:2)},19:function(n){return Number(n==1?0:n==0||n%100>1&&n%100<11?1:n%100>10&&n%100<20?2:3)},20:function(n){return Number(n==1?0:n==0||n%100>0&&n%100<20?1:2)},21:function(n){return Number(n%100==1?1:n%100==2?2:n%100==3||n%100==4?3:0)},22:function(n){return Number(n==1?0:n==2?1:(n<0||n>10)&&n%10==0?2:3)}};function Et(){var a={};return Lt.forEach(function(n){n.lngs.forEach(function(t){a[t]={numbers:n.nr,plurals:Pt[n.fc]}})}),a}var Rt=function(){function a(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,a),this.languageUtils=n,this.options=t,this.logger=$.create("pluralResolver"),this.rules=Et()}return q(a,[{key:"addRule",value:function(t,e){this.rules[t]=e}},{key:"getRule",value:function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var e=this.getRule(t);return e&&e.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,e){return this.getSuffixes(t).map(function(r){return e+r})}},{key:"getSuffixes",value:function(t){var e=this,r=this.getRule(t);return r?r.numbers.map(function(i){return e.getSuffix(t,i)}):[]}},{key:"getSuffix",value:function(t,e){var r=this,i=this.getRule(t);if(i){var o=i.noAbs?i.plurals(e):i.plurals(Math.abs(e)),s=i.numbers[o];this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var u=function(){return r.options.prepend&&s.toString()?r.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):u():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1?u():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),a}(),jt=function(){function a(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,a),this.logger=$.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(t){return t},this.init(n)}return q(a,[{key:"init",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escape=e.escape!==void 0?e.escape:xt,this.escapeValue=e.escapeValue!==void 0?e.escapeValue:!0,this.useRawValueToEscape=e.useRawValueToEscape!==void 0?e.useRawValueToEscape:!1,this.prefix=e.prefix?Y(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?Y(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?Y(e.nestingPrefix):e.nestingPrefixEscaped||Y("$t("),this.nestingSuffix=e.nestingSuffix?Y(e.nestingSuffix):e.nestingSuffixEscaped||Y(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=e.alwaysFormat!==void 0?e.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(t,e,r,i){var o=this,s,u,l,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(h){return h.replace(/\$/g,"$$$$")}var v=function(b){if(b.indexOf(o.formatSeparator)<0){var S=De(e,c,b);return o.alwaysFormat?o.format(S,void 0,r):S}var x=b.split(o.formatSeparator),R=x.shift().trim(),k=x.join(o.formatSeparator).trim();return o.format(De(e,c,R),k,r,i)};this.resetRegExp();var m=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,y=[{regex:this.regexpUnescape,safeValue:function(b){return p(b)}},{regex:this.regexp,safeValue:function(b){return o.escapeValue?p(o.escape(b)):p(b)}}];return y.forEach(function(h){for(l=0;s=h.regex.exec(t);){if(u=v(s[1].trim()),u===void 0)if(typeof m=="function"){var b=m(t,s,i);u=typeof b=="string"?b:""}else if(d){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(s[1]," for interpolating ").concat(t)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=Ne(u));if(t=t.replace(s[0],h.safeValue(u)),h.regex.lastIndex=0,l++,l>=o.maxReplaces)break}}),t}},{key:"nest",value:function(t,e){var r=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,u=D({},i);u.applyPostProcessor=!1,delete u.defaultValue;function l(m,d){var y=this.nestingOptionsSeparator;if(m.indexOf(y)<0)return m;var h=m.split(new RegExp("".concat(y,"[ ]*{"))),b="{".concat(h[1]);m=h[0],b=this.interpolate(b,u),b=b.replace(/'/g,'"');try{u=JSON.parse(b),d&&(u=D({},d,u))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(m),S),"".concat(m).concat(y).concat(b)}return delete u.defaultValue,m}for(;o=this.nestingRegexp.exec(t);){var c=[],p=!1;if(o[0].includes(this.formatSeparator)&&!/{.*}/.test(o[1])){var v=o[1].split(this.formatSeparator).map(function(m){return m.trim()});o[1]=v.shift(),c=v,p=!0}if(s=e(l.call(this,o[1].trim(),u),u),s&&o[0]===t&&typeof s!="string")return s;typeof s!="string"&&(s=Ne(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(t)),s=""),p&&(s=c.reduce(function(m,d){return r.format(m,d,i.lng,i)},s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}]),a}();function Ct(a,n){for(var t=a.indexOf(n);t!==-1;)a.splice(t,1),t=a.indexOf(n)}var At=function(a){me(n,a);function n(t,e,r){var i,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return M(this,n),i=re(this,Z(n).call(this)),ye&&W.call(J(i)),i.backend=t,i.store=e,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=$.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return q(n,[{key:"queueLoad",value:function(e,r,i,o){var s=this,u=[],l=[],c=[],p=[];return e.forEach(function(v){var m=!0;r.forEach(function(d){var y="".concat(v,"|").concat(d);!i.reload&&s.store.hasResourceBundle(v,d)?s.state[y]=2:s.state[y]<0||(s.state[y]===1?l.indexOf(y)<0&&l.push(y):(s.state[y]=1,m=!1,l.indexOf(y)<0&&l.push(y),u.indexOf(y)<0&&u.push(y),p.indexOf(d)<0&&p.push(d)))}),m||c.push(v)}),(u.length||l.length)&&this.queue.push({pending:l,loaded:{},errors:[],callback:o}),{toLoad:u,pending:l,toLoadLanguages:c,toLoadNamespaces:p}}},{key:"loaded",value:function(e,r,i){var o=e.split("|"),s=o[0],u=o[1];r&&this.emit("failedLoading",s,u,r),i&&this.store.addResourceBundle(s,u,i),this.state[e]=r?-1:2;var l={};this.queue.forEach(function(c){wt(c.loaded,[s],u),Ct(c.pending,e),r&&c.errors.push(r),c.pending.length===0&&!c.done&&(Object.keys(c.loaded).forEach(function(p){l[p]||(l[p]=[]),c.loaded[p].length&&c.loaded[p].forEach(function(v){l[p].indexOf(v)<0&&l[p].push(v)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(function(c){return!c.done})}},{key:"read",value:function(e,r,i){var o=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,l=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[i](e,r,function(c,p){if(c&&p&&s<5){setTimeout(function(){o.read.call(o,e,r,i,s+1,u*2,l)},u);return}l(c,p)}):l(null,{})}},{key:"prepareLoading",value:function(e,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof r=="string"&&(r=[r]);var u=this.queueLoad(e,r,o,s);if(!u.toLoad.length)return u.pending.length||s(),null;u.toLoad.forEach(function(l){i.loadOne(l)})}},{key:"load",value:function(e,r,i){this.prepareLoading(e,r,{},i)}},{key:"reload",value:function(e,r,i){this.prepareLoading(e,r,{reload:!0},i)}},{key:"loadOne",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=e.split("|"),s=o[0],u=o[1];this.read(s,u,"read",void 0,void 0,function(l,c){l&&r.logger.warn("".concat(i,"loading namespace ").concat(u," for language ").concat(s," failed"),l),!l&&c&&r.logger.log("".concat(i,"loaded namespace ").concat(u," for language ").concat(s),c),r.loaded(e,l,c)})}},{key:"saveMissing",value:function(e,r,i,o,s){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(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}i==null||i===""||(this.backend&&this.backend.create&&this.backend.create(e,r,i,o,null,D({},u,{isUpdate:s})),!(!e||!e[0])&&this.store.addResource(e[0],r,i,o))}}]),n}(W);function Tt(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(n){var t={};if(I(n[1])==="object"&&(t=n[1]),typeof n[1]=="string"&&(t.defaultValue=n[1]),typeof n[2]=="string"&&(t.tDescription=n[2]),I(n[2])==="object"||I(n[3])==="object"){var e=n[3]||n[2];Object.keys(e).forEach(function(r){t[r]=e[r]})}return t},interpolation:{escapeValue:!0,format:function(n,t,e,r){return n},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function Ue(a){return typeof a.ns=="string"&&(a.ns=[a.ns]),typeof a.fallbackLng=="string"&&(a.fallbackLng=[a.fallbackLng]),typeof a.fallbackNS=="string"&&(a.fallbackNS=[a.fallbackNS]),a.whitelist&&(a.whitelist&&a.whitelist.indexOf("cimode")<0&&(a.whitelist=a.whitelist.concat(["cimode"])),a.supportedLngs=a.whitelist),a.nonExplicitWhitelist&&(a.nonExplicitSupportedLngs=a.nonExplicitWhitelist),a.supportedLngs&&a.supportedLngs.indexOf("cimode")<0&&(a.supportedLngs=a.supportedLngs.concat(["cimode"])),a}function ie(){}var Nt=function(a){me(n,a);function n(){var t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(M(this,n),t=re(this,Z(n).call(this)),ye&&W.call(J(t)),t.options=Ue(e),t.services={},t.logger=$,t.modules={external:[]},r&&!t.isInitialized&&!e.isClone){if(!t.options.initImmediate)return t.init(e,r),re(t,J(t));setTimeout(function(){t.init(e,r)},0)}return t}return q(n,[{key:"init",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;typeof r=="function"&&(i=r,r={}),r.whitelist&&!r.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),r.nonExplicitWhitelist&&!r.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=D({},Tt(),this.options,Ue(r)),this.format=this.options.interpolation.format,i||(i=ie);function o(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?$.init(o(this.modules.logger),this.options):$.init(null,this.options);var s=new kt(this.options);this.store=new Ot(this.options.resources,this.options);var u=this.services;u.logger=$,u.resourceStore=this.store,u.languageUtils=s,u.pluralResolver=new Rt(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u.interpolator=new jt(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new At(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(d){for(var y=arguments.length,h=new Array(y>1?y-1:0),b=1;b<y;b++)h[b-1]=arguments[b];e.emit.apply(e,[d].concat(h))}),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Ie(this.services,this.options),this.translator.on("*",function(d){for(var y=arguments.length,h=new Array(y>1?y-1:0),b=1;b<y;b++)h[b-1]=arguments[b];e.emit.apply(e,[d].concat(h))}),this.modules.external.forEach(function(d){d.init&&d.init(e)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach(function(d){e[d]=function(){var y;return(y=e.store)[d].apply(y,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(d){e[d]=function(){var y;return(y=e.store)[d].apply(y,arguments),e}});var v=ee(),m=function(){var y=function(b,S){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),v.resolve(S),i(b,S)};if(e.languages&&e.options.compatibilityAPI!=="v1"&&!e.isInitialized)return y(null,e.t.bind(e));e.changeLanguage(e.options.lng,y)};return this.options.resources||!this.options.initImmediate?m():setTimeout(m,0),v}},{key:"loadResources",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ie,o=i,s=typeof e=="string"?e:this.language;if(typeof e=="function"&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode")return o();var u=[],l=function(v){if(!!v){var m=r.services.languageUtils.toResolveHierarchy(v);m.forEach(function(d){u.indexOf(d)<0&&u.push(d)})}};if(s)l(s);else{var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.forEach(function(p){return l(p)})}this.options.preload&&this.options.preload.forEach(function(p){return l(p)}),this.services.backendConnector.load(u,this.options.ns,o)}else o(null)}},{key:"reloadResources",value:function(e,r,i){var o=ee();return e||(e=this.languages),r||(r=this.options.ns),i||(i=ie),this.services.backendConnector.reload(e,r,function(s){o.resolve(),i(s)}),o}},{key:"use",value:function(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 e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&tt.addPostProcessor(e),e.type==="3rdParty"&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,r){var i=this;this.isLanguageChangingTo=e;var o=ee();this.emit("languageChanging",e);var s=function(c,p){p?(i.language=p,i.languages=i.services.languageUtils.toResolveHierarchy(p),i.translator.changeLanguage(p),i.isLanguageChangingTo=void 0,i.emit("languageChanged",p),i.logger.log("languageChanged",p)):i.isLanguageChangingTo=void 0,o.resolve(function(){return i.t.apply(i,arguments)}),r&&r(c,function(){return i.t.apply(i,arguments)})},u=function(c){var p=typeof c=="string"?c:i.services.languageUtils.getBestMatchFromCodes(c);p&&(i.language||(i.language=p,i.languages=i.services.languageUtils.toResolveHierarchy(p)),i.translator.language||i.translator.changeLanguage(p),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(p)),i.loadResources(p,function(v){s(v,p)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(e),o}},{key:"getFixedT",value:function(e,r){var i=this,o=function s(u,l){var c;if(I(l)!=="object"){for(var p=arguments.length,v=new Array(p>2?p-2:0),m=2;m<p;m++)v[m-2]=arguments[m];c=i.options.overloadTranslationOptionHandler([u,l].concat(v))}else c=D({},l);return c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,i.t(u,c)};return typeof e=="string"?o.lng=e:o.lngs=e,o.ns=r,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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;var o=this.languages[0],s=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;var l=function(v,m){var d=r.services.backendConnector.state["".concat(v,"|").concat(m)];return d===-1||d===2};if(i.precheck){var c=i.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(o,e)||!this.services.backendConnector.backend||l(o,e)&&(!s||l(u,e)))}},{key:"loadNamespaces",value:function(e,r){var i=this,o=ee();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(function(s){i.options.ns.indexOf(s)<0&&i.options.ns.push(s)}),this.loadResources(function(s){o.resolve(),r&&r(s)}),o):(r&&r(),Promise.resolve())}},{key:"loadLanguages",value:function(e,r){var i=ee();typeof e=="string"&&(e=[e]);var o=this.options.preload||[],s=e.filter(function(u){return o.indexOf(u)<0});return s.length?(this.options.preload=o.concat(s),this.loadResources(function(u){i.resolve(),r&&r(u)}),i):(r&&r(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";var 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"];return r.indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new n(e,r)}},{key:"cloneInstance",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ie,o=D({},this.options,r,{isClone:!0}),s=new n(o),u=["store","services","language"];return u.forEach(function(l){s[l]=e[l]}),s.services=D({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new Ie(s.services,s.options),s.translator.on("*",function(l){for(var c=arguments.length,p=new Array(c>1?c-1:0),v=1;v<c;v++)p[v-1]=arguments[v];s.emit.apply(s,[l].concat(p))}),s.init(o,i),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}}]),n}(W),_t=new Nt;function Dt(a,n){if(a==null)return{};var t={},e=Object.keys(a),r,i;for(i=0;i<e.length;i++)r=e[i],!(n.indexOf(r)>=0)&&(t[r]=a[r]);return t}function nt(a,n){if(a==null)return{};var t=Dt(a,n),e,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);for(r=0;r<i.length;r++)e=i[r],!(n.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(a,e)||(t[e]=a[e]))}return t}var se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ft={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},It=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Be(a){var n={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},t=a.match(/<\/?([^\s]+?)[/\s>]/);if(t&&(n.name=t[1],(Ft[t[1]]||a.charAt(a.length-2)==="/")&&(n.voidElement=!0),n.name.startsWith("!--"))){var e=a.indexOf("-->");return{type:"comment",comment:e!==-1?a.slice(4,e):""}}for(var r=new RegExp(It),i=null;(i=r.exec(a))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),s=[o,""];o.indexOf("=")>-1&&(s=o.split("=")),n.attrs[s[0]]=s[1],r.lastIndex--}else i[2]&&(n.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return n}var Ut=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Bt=/^\s*$/,Ht=Object.create(null);function rt(a,n){switch(n.type){case"text":return a+n.content;case"tag":return a+="<"+n.name+(n.attrs?function(t){var e=[];for(var r in t)e.push(r+'="'+t[r]+'"');return e.length?" "+e.join(" "):""}(n.attrs):"")+(n.voidElement?"/>":">"),n.voidElement?a:a+n.children.reduce(rt,"")+"</"+n.name+">";case"comment":return a+"<!--"+n.comment+"-->"}}var Mt={parse:function(a,n){n||(n={}),n.components||(n.components=Ht);var t,e=[],r=[],i=-1,o=!1;if(a.indexOf("<")!==0){var s=a.indexOf("<");e.push({type:"text",content:s===-1?a:a.substring(0,s)})}return a.replace(Ut,function(u,l){if(o){if(u!=="</"+t.name+">")return;o=!1}var c,p=u.charAt(1)!=="/",v=u.startsWith("<!--"),m=l+u.length,d=a.charAt(m);if(v){var y=Be(u);return i<0?(e.push(y),e):((c=r[i]).children.push(y),e)}if(p&&(i++,(t=Be(u)).type==="tag"&&n.components[t.name]&&(t.type="component",o=!0),t.voidElement||o||!d||d==="<"||t.children.push({type:"text",content:a.slice(m,a.indexOf("<",m))}),i===0&&e.push(t),(c=r[i-1])&&c.children.push(t),r[i]=t),(!p||t.voidElement)&&(i>-1&&(t.voidElement||t.name===u.slice(2,-1))&&(i--,t=i===-1?e:r[i]),!o&&d!=="<"&&d)){c=i===-1?e:r[i].children;var h=a.indexOf("<",m),b=a.slice(m,h===-1?void 0:h);Bt.test(b)&&(b=" "),(h>-1&&i+c.length>=0||b!==" ")&&c.push({type:"text",content:b})}}),e},stringify:function(a){return a.reduce(function(n,t){return n+rt("",t)},"")}},qt="".replace,Vt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g,$t={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"'};function zt(a){return qt.call(a,Vt,Kt)}function Kt(a){return $t[a]}function He(a,n){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);n&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),t.push.apply(t,e)}return t}function Me(a){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?He(Object(t),!0).forEach(function(e){ve(a,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):He(Object(t)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(t,e))})}return a}var Pe={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},at,it=U.default.createContext();function Wt(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pe=Me(Me({},Pe),a)}function ot(){return Pe}var Xt=function(){function a(){M(this,a),this.usedNamespaces={}}return q(a,[{key:"addUsedNamespaces",value:function(t){var e=this;t.forEach(function(r){e.usedNamespaces[r]||(e.usedNamespaces[r]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),a}();function Jt(a){at=a}function st(){return at}var Qt={type:"3rdParty",init:function(n){Wt(n.options.react),Jt(n)}};function ue(){if(console&&console.warn){for(var a,n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];typeof t[0]=="string"&&(t[0]="react-i18next:: ".concat(t[0])),(a=console).warn.apply(a,t)}}var qe={};function ce(){for(var a=arguments.length,n=new Array(a),t=0;t<a;t++)n[t]=arguments[t];typeof n[0]=="string"&&qe[n[0]]||(typeof n[0]=="string"&&(qe[n[0]]=new Date),ue.apply(void 0,n))}function Ve(a,n,t){a.loadNamespaces(n,function(){if(a.isInitialized)t();else{var e=function r(){setTimeout(function(){a.off("initialized",r)},0),t()};a.on("initialized",e)}})}function Gt(a,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},e=n.languages[0],r=n.options?n.options.fallbackLng:!1,i=n.languages[n.languages.length-1];if(e.toLowerCase()==="cimode")return!0;var o=function(u,l){var c=n.services.backendConnector.state["".concat(u,"|").concat(l)];return c===-1||c===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,a)?!1:!!(n.hasResourceBundle(e,a)||!n.services.backendConnector.backend||n.options.resources&&!n.options.partialBundledLanguages||o(e,a)&&(!r||o(i,a)))}function Yt(a,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!n.languages||!n.languages.length)return ce("i18n.languages were undefined or empty",n.languages),!0;var e=n.options.ignoreJSONStructure!==void 0;return e?n.hasLoadedNamespace(a,{precheck:function(i,o){if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,a))return!1}}):Gt(a,n,t)}var Zt=["format"],en=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function $e(a,n){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);n&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),t.push.apply(t,e)}return t}function _(a){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?$e(Object(t),!0).forEach(function(e){ve(a,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(t,e))})}return a}function xe(a,n){if(!a)return!1;var t=a.props?a.props.children:a.children;return n?t.length>0:!!t}function Oe(a){return a?a&&a.children?a.children:a.props&&a.props.children:[]}function tn(a){return Object.prototype.toString.call(a)!=="[object Array]"?!1:a.every(function(n){return U.default.isValidElement(n)})}function te(a){return Array.isArray(a)?a:[a]}function nn(a,n){var t=_({},n);return t.props=Object.assign(a.props,n.props),t}function ut(a,n){if(!a)return"";var t="",e=te(a),r=n.transSupportBasicHtmlNodes&&n.transKeepBasicHtmlNodesFor?n.transKeepBasicHtmlNodesFor:[];return e.forEach(function(i,o){if(typeof i=="string")t+="".concat(i);else if(U.default.isValidElement(i)){var s=Object.keys(i.props).length,u=r.indexOf(i.type)>-1,l=i.props.children;if(!l&&u&&s===0)t+="<".concat(i.type,"/>");else if(!l&&(!u||s!==0))t+="<".concat(o,"></").concat(o,">");else if(i.props.i18nIsDynamicList)t+="<".concat(o,"></").concat(o,">");else if(u&&s===1&&typeof l=="string")t+="<".concat(i.type,">").concat(l,"</").concat(i.type,">");else{var c=ut(l,n);t+="<".concat(o,">").concat(c,"</").concat(o,">")}}else if(i===null)ue("Trans: the passed in value is invalid - seems you passed in a null child.");else if(I(i)==="object"){var p=i.format,v=nt(i,Zt),m=Object.keys(v);if(m.length===1){var d=p?"".concat(m[0],", ").concat(p):m[0];t+="{{".concat(d,"}}")}else ue("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",i)}else ue("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",i)}),t}function rn(a,n,t,e,r,i){if(n==="")return[];var o=e.transKeepBasicHtmlNodesFor||[],s=n&&new RegExp(o.join("|")).test(n);if(!a&&!s)return[n];var u={};function l(h){var b=te(h);b.forEach(function(S){typeof S!="string"&&(xe(S)?l(Oe(S)):I(S)==="object"&&!U.default.isValidElement(S)&&Object.assign(u,S))})}l(a);var c=Mt.parse("<0>".concat(n,"</0>")),p=_(_({},u),r);function v(h,b,S){var x=Oe(h),R=d(x,b.children,S);return tn(x)&&R.length===0?x:R}function m(h,b,S,x,R){h.dummy&&(h.children=b),S.push(U.default.cloneElement(h,_(_({},h.props),{},{key:x}),R?void 0:b))}function d(h,b,S){var x=te(h),R=te(b);return R.reduce(function(k,w,P){var A=w.children&&w.children[0]&&w.children[0].content&&t.services.interpolator.interpolate(w.children[0].content,p,t.language);if(w.type==="tag"){var T=x[parseInt(w.name,10)];!T&&S.length===1&&S[0][w.name]&&(T=S[0][w.name]),T||(T={});var C=Object.keys(w.attrs).length!==0?nn({props:w.attrs},T):T,j=U.default.isValidElement(C),z=j&&xe(w,!0)&&!w.voidElement,B=s&&I(C)==="object"&&C.dummy&&!j,f=I(a)==="object"&&a!==null&&Object.hasOwnProperty.call(a,w.name);if(typeof C=="string"){var g=t.services.interpolator.interpolate(C,p,t.language);k.push(g)}else if(xe(C)||z){var O=v(C,w,S);m(C,O,k,P)}else if(B){var N=d(x,w.children,S);k.push(U.default.cloneElement(C,_(_({},C.props),{},{key:P}),N))}else if(Number.isNaN(parseFloat(w.name)))if(f){var E=v(C,w,S);m(C,E,k,P,w.voidElement)}else if(e.transSupportBasicHtmlNodes&&o.indexOf(w.name)>-1)if(w.voidElement)k.push(U.default.createElement(w.name,{key:"".concat(w.name,"-").concat(P)}));else{var L=d(x,w.children,S);k.push(U.default.createElement(w.name,{key:"".concat(w.name,"-").concat(P)},L))}else if(w.voidElement)k.push("<".concat(w.name," />"));else{var V=d(x,w.children,S);k.push("<".concat(w.name,">").concat(V,"</").concat(w.name,">"))}else if(I(C)==="object"&&!j){var F=w.children[0]?A:null;F&&k.push(F)}else w.children.length===1&&A?k.push(U.default.cloneElement(C,_(_({},C.props),{},{key:P}),A)):k.push(U.default.cloneElement(C,_(_({},C.props),{},{key:P})))}else if(w.type==="text"){var H=e.transWrapTextNodes,Q=i?zt(t.services.interpolator.interpolate(w.content,p,t.language)):t.services.interpolator.interpolate(w.content,p,t.language);H?k.push(U.default.createElement(H,{key:"".concat(w.name,"-").concat(P)},Q)):k.push(Q)}return k},[])}var y=d([{dummy:!0,children:a||[]}],c,te(a||[]));return Oe(y[0])}function an(a){var n=a.children,t=a.count,e=a.parent,r=a.i18nKey,i=a.context,o=a.tOptions,s=o===void 0?{}:o,u=a.values,l=a.defaults,c=a.components,p=a.ns,v=a.i18n,m=a.t,d=a.shouldUnescape,y=nt(a,en),h=K.useContext(it)||{},b=h.i18n,S=h.defaultNS,x=v||b||st();if(!x)return ce("You will need to pass in an i18next instance by using i18nextReactModule"),n;var R=m||x.t.bind(x)||function(g){return g};i&&(s.context=i);var k=_(_({},ot()),x.options&&x.options.react),w=p||R.ns||S||x.options&&x.options.defaultNS;w=typeof w=="string"?[w]:w||["translation"];var P=l||ut(n,k)||k.transEmptyNodeValue||r,A=k.hashTransKey,T=r||(A?A(P):P),C=u?s.interpolation:{interpolation:_(_({},s.interpolation),{},{prefix:"#$?",suffix:"?$#"})},j=_(_(_(_({},s),{},{count:t},u),C),{},{defaultValue:P,ns:w}),z=T?R(T,j):P,B=rn(c||n,z,x,k,j,d),f=e!==void 0?e:k.defaultTransParent;return f?U.default.createElement(f,y,B):B}function on(a){if(Array.isArray(a))return a}function sn(a,n){var t=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(t!=null){var e=[],r=!0,i=!1,o,s;try{for(t=t.call(a);!(r=(o=t.next()).done)&&(e.push(o.value),!(n&&e.length===n));r=!0);}catch(u){i=!0,s=u}finally{try{!r&&t.return!=null&&t.return()}finally{if(i)throw s}}return e}}function ze(a,n){(n==null||n>a.length)&&(n=a.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=a[t];return e}function un(a,n){if(!!a){if(typeof a=="string")return ze(a,n);var t=Object.prototype.toString.call(a).slice(8,-1);if(t==="Object"&&a.constructor&&(t=a.constructor.name),t==="Map"||t==="Set")return Array.from(a);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ze(a,n)}}function fn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ln(a,n){return on(a)||sn(a,n)||un(a,n)||fn()}function Ke(a,n){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);n&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),t.push.apply(t,e)}return t}function ke(a){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Ke(Object(t),!0).forEach(function(e){ve(a,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Ke(Object(t)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(t,e))})}return a}function cn(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=n.i18n,e=K.useContext(it)||{},r=e.i18n,i=e.defaultNS,o=t||r||st();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Xt),!o){ce("You will need to pass in an i18next instance by using initReactI18next");var s=function(P){return Array.isArray(P)?P[P.length-1]:P},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&ce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=ke(ke(ke({},ot()),o.options.react),n),c=l.useSuspense,p=l.keyPrefix,v=a||i||o.options&&o.options.defaultNS;v=typeof v=="string"?[v]:v||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(v);var m=(o.isInitialized||o.initializedStoreOnce)&&v.every(function(w){return Yt(w,o,l)});function d(){return o.getFixedT(null,l.nsMode==="fallback"?v:v[0],p)}var y=K.useState(d),h=ln(y,2),b=h[0],S=h[1],x=K.useRef(!0);K.useEffect(function(){var w=l.bindI18n,P=l.bindI18nStore;x.current=!0,!m&&!c&&Ve(o,v,function(){x.current&&S(d)});function A(){x.current&&S(d)}return w&&o&&o.on(w,A),P&&o&&o.store.on(P,A),function(){x.current=!1,w&&o&&w.split(" ").forEach(function(T){return o.off(T,A)}),P&&o&&P.split(" ").forEach(function(T){return o.store.off(T,A)})}},[o,v.join()]);var R=K.useRef(!0);K.useEffect(function(){x.current&&!R.current&&S(d),R.current=!1},[o]);var k=[b,o,m];if(k.t=b,k.i18n=o,k.ready=m,m||!m&&!c)return k;throw new Promise(function(w){Ve(o,v,function(){w()})})}function fe(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(t){return typeof t}:fe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(a)}var ft=[],pn=ft.forEach,dn=ft.slice;function Ee(a){return pn.call(dn.call(arguments,1),function(n){if(n)for(var t in n)a[t]===void 0&&(a[t]=n[t])}),a}function lt(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":fe(XMLHttpRequest))==="object"}function gn(a){return!!a&&typeof a.then=="function"}function hn(a){return gn(a)?a:Promise.resolve(a)}function vn(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pe={exports:{}},oe={exports:{}},We;function mn(){return We||(We=1,function(a,n){var t=typeof self<"u"?self:se,e=function(){function i(){this.fetch=!1,this.DOMException=t.DOMException}return i.prototype=t,new i}();(function(i){(function(o){var s={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function u(f){return f&&DataView.prototype.isPrototypeOf(f)}if(s.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(f){return f&&l.indexOf(Object.prototype.toString.call(f))>-1};function p(f){if(typeof f!="string"&&(f=String(f)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(f))throw new TypeError("Invalid character in header field name");return f.toLowerCase()}function v(f){return typeof f!="string"&&(f=String(f)),f}function m(f){var g={next:function(){var O=f.shift();return{done:O===void 0,value:O}}};return s.iterable&&(g[Symbol.iterator]=function(){return g}),g}function d(f){this.map={},f instanceof d?f.forEach(function(g,O){this.append(O,g)},this):Array.isArray(f)?f.forEach(function(g){this.append(g[0],g[1])},this):f&&Object.getOwnPropertyNames(f).forEach(function(g){this.append(g,f[g])},this)}d.prototype.append=function(f,g){f=p(f),g=v(g);var O=this.map[f];this.map[f]=O?O+", "+g:g},d.prototype.delete=function(f){delete this.map[p(f)]},d.prototype.get=function(f){return f=p(f),this.has(f)?this.map[f]:null},d.prototype.has=function(f){return this.map.hasOwnProperty(p(f))},d.prototype.set=function(f,g){this.map[p(f)]=v(g)},d.prototype.forEach=function(f,g){for(var O in this.map)this.map.hasOwnProperty(O)&&f.call(g,this.map[O],O,this)},d.prototype.keys=function(){var f=[];return this.forEach(function(g,O){f.push(O)}),m(f)},d.prototype.values=function(){var f=[];return this.forEach(function(g){f.push(g)}),m(f)},d.prototype.entries=function(){var f=[];return this.forEach(function(g,O){f.push([O,g])}),m(f)},s.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function y(f){if(f.bodyUsed)return Promise.reject(new TypeError("Already read"));f.bodyUsed=!0}function h(f){return new Promise(function(g,O){f.onload=function(){g(f.result)},f.onerror=function(){O(f.error)}})}function b(f){var g=new FileReader,O=h(g);return g.readAsArrayBuffer(f),O}function S(f){var g=new FileReader,O=h(g);return g.readAsText(f),O}function x(f){for(var g=new Uint8Array(f),O=new Array(g.length),N=0;N<g.length;N++)O[N]=String.fromCharCode(g[N]);return O.join("")}function R(f){if(f.slice)return f.slice(0);var g=new Uint8Array(f.byteLength);return g.set(new Uint8Array(f)),g.buffer}function k(){return this.bodyUsed=!1,this._initBody=function(f){this._bodyInit=f,f?typeof f=="string"?this._bodyText=f:s.blob&&Blob.prototype.isPrototypeOf(f)?this._bodyBlob=f:s.formData&&FormData.prototype.isPrototypeOf(f)?this._bodyFormData=f:s.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)?this._bodyText=f.toString():s.arrayBuffer&&s.blob&&u(f)?(this._bodyArrayBuffer=R(f.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(f)||c(f))?this._bodyArrayBuffer=R(f):this._bodyText=f=Object.prototype.toString.call(f):this._bodyText="",this.headers.get("content-type")||(typeof f=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s.blob&&(this.blob=function(){var f=y(this);if(f)return f;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var f=y(this);if(f)return f;if(this._bodyBlob)return S(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(x(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s.formData&&(this.formData=function(){return this.text().then(T)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function P(f){var g=f.toUpperCase();return w.indexOf(g)>-1?g:f}function A(f,g){g=g||{};var O=g.body;if(f instanceof A){if(f.bodyUsed)throw new TypeError("Already read");this.url=f.url,this.credentials=f.credentials,g.headers||(this.headers=new d(f.headers)),this.method=f.method,this.mode=f.mode,this.signal=f.signal,!O&&f._bodyInit!=null&&(O=f._bodyInit,f.bodyUsed=!0)}else this.url=String(f);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new d(g.headers)),this.method=P(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&O)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(O)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})};function T(f){var g=new FormData;return f.trim().split("&").forEach(function(O){if(O){var N=O.split("="),E=N.shift().replace(/\+/g," "),L=N.join("=").replace(/\+/g," ");g.append(decodeURIComponent(E),decodeURIComponent(L))}}),g}function C(f){var g=new d,O=f.replace(/\r?\n[\t ]+/g," ");return O.split(/\r?\n/).forEach(function(N){var E=N.split(":"),L=E.shift().trim();if(L){var V=E.join(":").trim();g.append(L,V)}}),g}k.call(A.prototype);function j(f,g){g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in g?g.statusText:"OK",this.headers=new d(g.headers),this.url=g.url||"",this._initBody(f)}k.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},j.error=function(){var f=new j(null,{status:0,statusText:""});return f.type="error",f};var z=[301,302,303,307,308];j.redirect=function(f,g){if(z.indexOf(g)===-1)throw new RangeError("Invalid status code");return new j(null,{status:g,headers:{location:f}})},o.DOMException=i.DOMException;try{new o.DOMException}catch{o.DOMException=function(g,O){this.message=g,this.name=O;var N=Error(g);this.stack=N.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function B(f,g){return new Promise(function(O,N){var E=new A(f,g);if(E.signal&&E.signal.aborted)return N(new o.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function V(){L.abort()}L.onload=function(){var F={status:L.status,statusText:L.statusText,headers:C(L.getAllResponseHeaders()||"")};F.url="responseURL"in L?L.responseURL:F.headers.get("X-Request-URL");var H="response"in L?L.response:L.responseText;O(new j(H,F))},L.onerror=function(){N(new TypeError("Network request failed"))},L.ontimeout=function(){N(new TypeError("Network request failed"))},L.onabort=function(){N(new o.DOMException("Aborted","AbortError"))},L.open(E.method,E.url,!0),E.credentials==="include"?L.withCredentials=!0:E.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&s.blob&&(L.responseType="blob"),E.headers.forEach(function(F,H){L.setRequestHeader(H,F)}),E.signal&&(E.signal.addEventListener("abort",V),L.onreadystatechange=function(){L.readyState===4&&E.signal.removeEventListener("abort",V)}),L.send(typeof E._bodyInit>"u"?null:E._bodyInit)})}return B.polyfill=!0,i.fetch||(i.fetch=B,i.Headers=d,i.Request=A,i.Response=j),o.Headers=d,o.Request=A,o.Response=j,o.fetch=B,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(e),e.fetch.ponyfill=!0,delete e.fetch.polyfill;var r=e;n=r.fetch,n.default=r.fetch,n.fetch=r.fetch,n.Headers=r.Headers,n.Request=r.Request,n.Response=r.Response,a.exports=n}(oe,oe.exports)),oe.exports}(function(a,n){var t;if(typeof fetch=="function"&&(typeof se<"u"&&se.fetch?t=se.fetch:typeof window<"u"&&window.fetch&&(t=window.fetch)),typeof vn<"u"&&(typeof window>"u"||typeof window.document>"u")){var e=t||mn();e.default&&(e=e.default),n.default=e,a.exports=n.default}})(pe,pe.exports);const ct=pe.exports,Xe=vt({__proto__:null,default:ct},[pe.exports]);function ne(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ne=function(t){return typeof t}:ne=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ne(a)}var X;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?X=global.fetch:typeof window<"u"&&window.fetch&&(X=window.fetch));var ae;lt&&(typeof global<"u"&&global.XMLHttpRequest?ae=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ae=window.XMLHttpRequest));var de;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?de=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(de=window.ActiveXObject));!X&&Xe&&!ae&&!de&&(X=ct||Xe);typeof X!="function"&&(X=void 0);var Re=function(n,t){if(t&&ne(t)==="object"){var e="";for(var r in t)e+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]);if(!e)return n;n=n+(n.indexOf("?")!==-1?"&":"?")+e.slice(1)}return n},yn=function(n,t,e,r){n.queryStringParams&&(t=Re(t,n.queryStringParams));var i=Ee({},typeof n.customHeaders=="function"?n.customHeaders():n.customHeaders);e&&(i["Content-Type"]="application/json"),X(t,Ee({method:e?"POST":"GET",body:e?n.stringify(e):void 0,headers:i},typeof n.requestOptions=="function"?n.requestOptions(e):n.requestOptions)).then(function(o){if(!o.ok)return r(o.statusText||"Error",{status:o.status});o.text().then(function(s){r(null,{status:o.status,data:s})}).catch(r)}).catch(r)},bn=function(n,t,e,r){e&&ne(e)==="object"&&(e=Re("",e).slice(1)),n.queryStringParams&&(t=Re(t,n.queryStringParams));try{var i;ae?i=new ae:i=new de("MSXML2.XMLHTTP.3.0"),i.open(e?"POST":"GET",t,1),n.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!n.withCredentials,e&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var o=n.customHeaders;if(o=typeof o=="function"?o():o,o)for(var s in o)i.setRequestHeader(s,o[s]);i.onreadystatechange=function(){i.readyState>3&&r(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(e)}catch(u){console&&console.log(u)}},wn=function(n,t,e,r){if(typeof e=="function"&&(r=e,e=void 0),r=r||function(){},X)return yn(n,t,e,r);if(lt||typeof ActiveXObject=="function")return bn(n,t,e,r)};function Sn(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function Je(a,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,e.key,e)}}function xn(a,n,t){return n&&Je(a.prototype,n),t&&Je(a,t),a}function On(a,n,t){return n in a?Object.defineProperty(a,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[n]=t,a}var kn=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(t){return JSON.parse(t)},stringify:JSON.stringify,parsePayload:function(t,e,r){return On({},e,r||"")},request:wn,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},pt=function(){function a(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Sn(this,a),this.services=n,this.options=t,this.allOptions=e,this.type="backend",this.init(n,t,e)}return xn(a,[{key:"init",value:function(t){var e=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=Ee(r,this.options||{},kn()),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return e.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(t,e,r){this._readAny(t,t,e,e,r)}},{key:"read",value:function(t,e,r){this._readAny([t],t,[e],e,r)}},{key:"_readAny",value:function(t,e,r,i,o){var s=this,u=this.options.loadPath;typeof this.options.loadPath=="function"&&(u=this.options.loadPath(t,r)),u=hn(u),u.then(function(l){var c=s.services.interpolator.interpolate(l,{lng:t.join("+"),ns:r.join("+")});s.loadUrl(c,o,e,i)})}},{key:"loadUrl",value:function(t,e,r,i){var o=this;this.options.request(this.options,t,void 0,function(s,u){if(u&&(u.status>=500&&u.status<600||!u.status))return e("failed loading "+t+"; status code: "+u.status,!0);if(u&&u.status>=400&&u.status<500)return e("failed loading "+t+"; status code: "+u.status,!1);if(!u&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return e("failed loading "+t+": "+s.message,!0);if(s)return e(s,!1);var l,c;try{typeof u.data=="string"?l=o.options.parse(u.data,r,i):l=u.data}catch{c="failed parsing "+t+" to json"}if(c)return e(c,!1);e(null,l)})}},{key:"create",value:function(t,e,r,i,o){var s=this;if(!!this.options.addPath){typeof t=="string"&&(t=[t]);var u=this.options.parsePayload(e,r,i),l=0,c=[],p=[];t.forEach(function(v){var m=s.options.addPath;typeof s.options.addPath=="function"&&(m=s.options.addPath(v,e));var d=s.services.interpolator.interpolate(m,{lng:v,ns:e});s.options.request(s.options,d,u,function(y,h){l+=1,c.push(y),p.push(h),l===t.length&&o&&o(c,p)})})}}},{key:"reload",value:function(){var t=this,e=this.services,r=e.backendConnector,i=e.languageUtils,o=e.logger,s=r.language;if(!(s&&s.toLowerCase()==="cimode")){var u=[],l=function(p){var v=i.toResolveHierarchy(p);v.forEach(function(m){u.indexOf(m)<0&&u.push(m)})};l(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return l(c)}),u.forEach(function(c){t.allOptions.ns.forEach(function(p){r.read(c,p,"read",null,null,function(v,m){v&&o.warn("loading namespace ".concat(p," for language ").concat(c," failed"),v),!v&&m&&o.log("loaded namespace ".concat(p," for language ").concat(c),m),r.loaded("".concat(c,"|").concat(p),v,m)})})})}}}]),a}();pt.type="backend";var dt=[],Ln=dt.forEach,Pn=dt.slice;function En(a){return Ln.call(Pn.call(arguments,1),function(n){if(n)for(var t in n)a[t]===void 0&&(a[t]=n[t])}),a}var Qe=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Rn=function(n,t,e){var r=e||{};r.path=r.path||"/";var i=encodeURIComponent(t),o=n+"="+i;if(r.maxAge>0){var s=r.maxAge-0;if(isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age="+Math.floor(s)}if(r.domain){if(!Qe.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!Qe.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite){var u=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},Ge={create:function(n,t,e,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};e&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+e*60*1e3)),r&&(i.domain=r),document.cookie=Rn(n,encodeURIComponent(t),i)},read:function(n){for(var t=n+"=",e=document.cookie.split(";"),r=0;r<e.length;r++){for(var i=e[r];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove:function(n){this.create(n,"",-1)}},jn={name:"cookie",lookup:function(n){var t;if(n.lookupCookie&&typeof document<"u"){var e=Ge.read(n.lookupCookie);e&&(t=e)}return t},cacheUserLanguage:function(n,t){t.lookupCookie&&typeof document<"u"&&Ge.create(t.lookupCookie,n,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},Cn={name:"querystring",lookup:function(n){var t;if(typeof window<"u")for(var e=window.location.search.substring(1),r=e.split("&"),i=0;i<r.length;i++){var o=r[i].indexOf("=");if(o>0){var s=r[i].substring(0,o);s===n.lookupQuerystring&&(t=r[i].substring(o+1))}}return t}},ge;try{ge=window!=="undefined"&&window.localStorage!==null;var Ye="i18next.translate.boo";window.localStorage.setItem(Ye,"foo"),window.localStorage.removeItem(Ye)}catch{ge=!1}var An={name:"localStorage",lookup:function(n){var t;if(n.lookupLocalStorage&&ge){var e=window.localStorage.getItem(n.lookupLocalStorage);e&&(t=e)}return t},cacheUserLanguage:function(n,t){t.lookupLocalStorage&&ge&&window.localStorage.setItem(t.lookupLocalStorage,n)}},he;try{he=window!=="undefined"&&window.sessionStorage!==null;var Ze="i18next.translate.boo";window.sessionStorage.setItem(Ze,"foo"),window.sessionStorage.removeItem(Ze)}catch{he=!1}var Tn={name:"sessionStorage",lookup:function(n){var t;if(n.lookupsessionStorage&&he){var e=window.sessionStorage.getItem(n.lookupsessionStorage);e&&(t=e)}return t},cacheUserLanguage:function(n,t){t.lookupsessionStorage&&he&&window.sessionStorage.setItem(t.lookupsessionStorage,n)}},Nn={name:"navigator",lookup:function(n){var t=[];if(typeof navigator<"u"){if(navigator.languages)for(var e=0;e<navigator.languages.length;e++)t.push(navigator.languages[e]);navigator.userLanguage&&t.push(navigator.userLanguage),navigator.language&&t.push(navigator.language)}return t.length>0?t:void 0}},_n={name:"htmlTag",lookup:function(n){var t,e=n.htmlTag||(typeof document<"u"?document.documentElement:null);return e&&typeof e.getAttribute=="function"&&(t=e.getAttribute("lang")),t}},Dn={name:"path",lookup:function(n){var t;if(typeof window<"u"){var e=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(e instanceof Array)if(typeof n.lookupFromPathIndex=="number"){if(typeof e[n.lookupFromPathIndex]!="string")return;t=e[n.lookupFromPathIndex].replace("/","")}else t=e[0].replace("/","")}return t}},Fn={name:"subdomain",lookup:function(n){var t;if(typeof window<"u"){var e=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);e instanceof Array&&(typeof n.lookupFromSubdomainIndex=="number"?t=e[n.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):t=e[0].replace("http://","").replace("https://","").replace(".",""))}return t}};function In(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var gt=function(){function a(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,a),this.type="languageDetector",this.detectors={},this.init(n,t)}return q(a,[{key:"init",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=En(e,this.options||{},In()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(jn),this.addDetector(Cn),this.addDetector(An),this.addDetector(Tn),this.addDetector(Nn),this.addDetector(_n),this.addDetector(Dn),this.addDetector(Fn)}},{key:"addDetector",value:function(t){this.detectors[t.name]=t}},{key:"detect",value:function(t){var e=this;t||(t=this.options.order);var r=[];return t.forEach(function(i){if(e.detectors[i]){var o=e.detectors[i].lookup(e.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}},{key:"cacheUserLanguage",value:function(t,e){var r=this;e||(e=this.options.caches),e&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||e.forEach(function(i){r.detectors[i]&&r.detectors[i].cacheUserLanguage(t,r.options)}))}}]),a}();gt.type="languageDetector";function Un({detectorConfig:a,translationPath:n,customDetectors:t,...e}){const r=new gt,i={name:"hashRouterQuerystringDetector",lookup:l=>{try{const c=l&&l.lookupQuerystring||"lang",v=new RegExp(`[?&]${c}(=([^&#]*)|&|#|$)`).exec(window.location.href);if(v&&v[2]){const m=decodeURIComponent(v[2].replace(/\+/g," "));if(m)return m}}catch(c){console.error(c)}}};r.addDetector(i),Array.isArray(t)&&t.forEach(l=>{r.addDetector(l)});const u={fallbackLng:"en-US",debug:!0,keySeparator:".",backend:{loadPath:n||"/locales/{{lng}}/{{ns}}.json"},interpolation:{escapeValue:!1},detection:a||{order:["querystring","hashRouterQuerystringDetector","cookie","localStorage"],lookupQuerystring:"lang",lookupCookie:"lang",lookupSessionStorage:"lang",lookupLocalStorage:"lang",caches:["localStorage","cookie"],excludeCacheFor:["cimode"],cookieOptions:{path:"/",sameSite:"strict"}},...e};return _t.use(pt).use(r).use(Qt).init(u)}const Bn=an;function Hn(a="translation",n){return cn([a,"design-system"],n)}exports.SpsLanguage=Bn;exports.localize=Un;exports.useSpsLanguage=Hn;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("react");function mt(a,t){for(var n=0;n<t.length;n++){const e=t[n];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in a)){const i=Object.getOwnPropertyDescriptor(e,r);i&&Object.defineProperty(a,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}function I(a){return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(a)}function yt(a,t){if(I(a)!="object"||!a)return a;var n=a[Symbol.toPrimitive];if(n!==void 0){var e=n.call(a,t||"default");if(I(e)!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(a)}function tt(a){var t=yt(a,"string");return I(t)=="symbol"?t:String(t)}function ge(a,t,n){return t=tt(t),t in a?Object.defineProperty(a,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[t]=n,a}function D(a){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},e=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&e.push.apply(e,Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),e.forEach(function(r){ge(a,r,n[r])})}return a}function M(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function Ne(a,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,tt(e.key),e)}}function q(a,t,n){return t&&Ne(a.prototype,t),n&&Ne(a,n),Object.defineProperty(a,"prototype",{writable:!1}),a}function X(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function te(a,t){if(t&&(I(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X(a)}function Y(a){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Y(a)}function xe(a,t){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,r){return e.__proto__=r,e},xe(a,t)}function he(a,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),t&&xe(a,t)}var bt={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},wt=function(){function a(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,a),this.init(t,n)}return q(a,[{key:"init",value:function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=n||bt,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,e,r,i){return i&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(r).concat(this.prefix," ").concat(n[0])),this.logger[e](n))}},{key:"create",value:function(n){return new a(this.logger,D({},{prefix:"".concat(this.prefix,":").concat(n,":")},this.options))}}]),a}(),$=new wt,W=function(){function a(){M(this,a),this.observers={}}return q(a,[{key:"on",value:function(n,e){var r=this;return n.split(" ").forEach(function(i){r.observers[i]=r.observers[i]||[],r.observers[i].push(e)}),this}},{key:"off",value:function(n,e){if(!!this.observers[n]){if(!e){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(r){return r!==e})}}},{key:"emit",value:function(n){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];if(this.observers[n]){var o=[].concat(this.observers[n]);o.forEach(function(u){u.apply(void 0,r)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[n].concat(r))})}}}]),a}();function Z(){var a,t,n=new Promise(function(e,r){a=e,t=r});return n.resolve=a,n.reject=t,n}function Ae(a){return a==null?"":""+a}function St(a,t,n){a.forEach(function(e){t[e]&&(n[e]=t[e])})}function je(a,t,n){function e(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function r(){return!a||typeof a=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(r())return{};var o=e(i.shift());!a[o]&&n&&(a[o]=new n),Object.prototype.hasOwnProperty.call(a,o)?a=a[o]:a={}}return r()?{}:{obj:a,k:e(i.shift())}}function Te(a,t,n){var e=je(a,t,Object),r=e.obj,i=e.k;r[i]=n}function Ot(a,t,n,e){var r=je(a,t,Object),i=r.obj,o=r.k;i[o]=i[o]||[],e&&(i[o]=i[o].concat(n)),e||i[o].push(n)}function se(a,t){var n=je(a,t),e=n.obj,r=n.k;if(!!e)return e[r]}function Fe(a,t,n){var e=se(a,n);return e!==void 0?e:se(t,n)}function nt(a,t,n){for(var e in t)e!=="__proto__"&&e!=="constructor"&&(e in a?typeof a[e]=="string"||a[e]instanceof String||typeof t[e]=="string"||t[e]instanceof String?n&&(a[e]=t[e]):nt(a[e],t[e],n):a[e]=t[e]);return a}function G(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var xt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function kt(a){return typeof a=="string"?a.replace(/[&<>"'\/]/g,function(t){return xt[t]}):a}var ve=typeof window<"u"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Lt=function(a){he(t,a);function t(n){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return M(this,t),e=te(this,Y(t).call(this)),ve&&W.call(X(e)),e.data=n||{},e.options=r,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e}return q(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}},{key:"getResource",value:function(e,r,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=[e,r];return i&&typeof i!="string"&&(u=u.concat(i)),i&&typeof i=="string"&&(u=u.concat(s?i.split(s):i)),e.indexOf(".")>-1&&(u=e.split(".")),se(this.data,u)}},{key:"addResource",value:function(e,r,i,o){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var f=[e,r];i&&(f=f.concat(u?i.split(u):i)),e.indexOf(".")>-1&&(f=e.split("."),o=r,r=f[1]),this.addNamespaces(r),Te(this.data,f,o),s.silent||this.emit("added",e,r,i,o)}},{key:"addResources",value:function(e,r,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var s in i)(typeof i[s]=="string"||Object.prototype.toString.apply(i[s])==="[object Array]")&&this.addResource(e,r,s,i[s],{silent:!0});o.silent||this.emit("added",e,r,i)}},{key:"addResourceBundle",value:function(e,r,i,o,s){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},f=[e,r];e.indexOf(".")>-1&&(f=e.split("."),o=i,i=r,r=f[1]),this.addNamespaces(r);var c=se(this.data,f)||{};o?nt(c,i,s):c=D({},c,i),Te(this.data,f,c),u.silent||this.emit("added",e,r,i)}},{key:"removeResourceBundle",value:function(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}},{key:"hasResourceBundle",value:function(e,r){return this.getResource(e,r)!==void 0}},{key:"getResourceBundle",value:function(e,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?D({},{},this.getResource(e,r)):this.getResource(e,r)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(W),rt={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,e,r,i){var o=this;return t.forEach(function(s){o.processors[s]&&(n=o.processors[s].process(n,e,r,i))}),n}},_e={},De=function(a){he(t,a);function t(n){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return M(this,t),e=te(this,Y(t).call(this)),ve&&W.call(X(e)),St(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,X(e)),e.options=r,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e.logger=$.create("translator"),e}return q(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=this.resolve(e,r);return i&&i.res!==void 0}},{key:"extractFromKey",value:function(e,r){var i=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");var o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,s=r.ns||this.options.defaultNS;if(i&&e.indexOf(i)>-1){var u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:s};var f=e.split(i);(i!==o||i===o&&this.options.ns.indexOf(f[0])>-1)&&(s=f.shift()),e=f.join(o)}return typeof s=="string"&&(s=[s]),{key:e,namespaces:s}}},{key:"translate",value:function(e,r,i){var o=this;if(I(r)!=="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),r||(r={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);var s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],r),f=u.key,c=u.namespaces,p=c[c.length-1],v=r.lng||this.language,m=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v&&v.toLowerCase()==="cimode"){if(m){var d=r.nsSeparator||this.options.nsSeparator;return p+d+f}return f}var y=this.resolve(e,r),h=y&&y.res,b=y&&y.usedKey||f,S=y&&y.exactUsedKey||f,O=Object.prototype.toString.apply(h),A=["[object Number]","[object Function]","[object RegExp]"],k=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,j=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(w&&h&&j&&A.indexOf(O)<0&&!(typeof k=="string"&&O==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,h,r):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");if(s){var R=O==="[object Array]",C=R?[]:{},P=R?S:b;for(var E in h)if(Object.prototype.hasOwnProperty.call(h,E)){var K="".concat(P).concat(s).concat(E);C[E]=this.translate(K,D({},r,{joinArrays:!1,ns:c})),C[E]===K&&(C[E]=h[E])}h=C}}else if(w&&typeof k=="string"&&O==="[object Array]")h=h.join(k),h&&(h=this.extendTranslation(h,e,r,i));else{var B=!1,l=!1,g=r.count!==void 0&&typeof r.count!="string",x=t.hasDefaultValue(r),F=g?this.pluralResolver.getSuffix(v,r.count):"",N=r["defaultValue".concat(F)]||r.defaultValue;!this.isValidLookup(h)&&x&&(B=!0,h=N),this.isValidLookup(h)||(l=!0,h=f);var L=x&&N!==h&&this.options.updateMissing;if(l||B||L){if(this.logger.log(L?"updateKey":"missingKey",v,p,f,L?N:h),s){var V=this.resolve(f,D({},r,{keySeparator:!1}));V&&V.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.")}var U=[],H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&H&&H[0])for(var J=0;J<H.length;J++)U.push(H[J]);else this.options.saveMissingTo==="all"?U=this.languageUtils.toResolveHierarchy(r.lng||this.language):U.push(r.lng||this.language);var Re=function(Q,ye,Ce){o.options.missingKeyHandler?o.options.missingKeyHandler(Q,p,ye,L?Ce:h,L,r):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(Q,p,ye,L?Ce:h,L,r),o.emit("missingKey",Q,p,ye,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&g?U.forEach(function(me){o.pluralResolver.getSuffixes(me).forEach(function(Q){Re([me],f+Q,r["defaultValue".concat(Q)]||N)})}):Re(U,f,N))}h=this.extendTranslation(h,e,r,y,i),l&&h===f&&this.options.appendNamespaceToMissingKey&&(h="".concat(p,":").concat(f)),l&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,r,i,o,s){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,i,o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(D({},i,{interpolation:D({},this.options.interpolation,i.interpolation)}));var f=i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,c;if(f){var p=e.match(this.interpolator.nestingRegexp);c=p&&p.length}var v=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(v=D({},this.options.interpolation.defaultVariables,v)),e=this.interpolator.interpolate(e,v,i.lng||this.language,i),f){var m=e.match(this.interpolator.nestingRegexp),d=m&&m.length;c<d&&(i.nest=!1)}i.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var b=arguments.length,S=new Array(b),O=0;O<b;O++)S[O]=arguments[O];return s&&s[0]===S[0]&&!i.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(S[0]," in key: ").concat(r[0])),null):u.translate.apply(u,S.concat([r]))},i)),i.interpolation&&this.interpolator.reset()}var y=i.postProcess||this.options.postProcess,h=typeof y=="string"?[y]:y;return e!=null&&h&&h.length&&i.applyPostProcessor!==!1&&(e=rt.handle(h,e,r,this.options&&this.options.postProcessPassResolved?D({i18nResolved:o},i):i,this)),e}},{key:"resolve",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o,s,u,f,c;return typeof e=="string"&&(e=[e]),e.forEach(function(p){if(!r.isValidLookup(o)){var v=r.extractFromKey(p,i),m=v.key;s=m;var d=v.namespaces;r.options.fallbackNS&&(d=d.concat(r.options.fallbackNS));var y=i.count!==void 0&&typeof i.count!="string",h=i.context!==void 0&&typeof i.context=="string"&&i.context!=="",b=i.lngs?i.lngs:r.languageUtils.toResolveHierarchy(i.lng||r.language,i.fallbackLng);d.forEach(function(S){r.isValidLookup(o)||(c=S,!_e["".concat(b[0],"-").concat(S)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(c)&&(_e["".concat(b[0],"-").concat(S)]=!0,r.logger.warn('key "'.concat(s,'" for languages "').concat(b.join(", "),`" won't get resolved as namespace "`).concat(c,'" 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!!!")),b.forEach(function(O){if(!r.isValidLookup(o)){f=O;var A=m,k=[A];if(r.i18nFormat&&r.i18nFormat.addLookupKeys)r.i18nFormat.addLookupKeys(k,m,O,S,i);else{var w;y&&(w=r.pluralResolver.getSuffix(O,i.count)),y&&h&&k.push(A+w),h&&k.push(A+="".concat(r.options.contextSeparator).concat(i.context)),y&&k.push(A+=w)}for(var j;j=k.pop();)r.isValidLookup(o)||(u=j,o=r.getResource(O,S,j,i))}}))})}}),{res:o,usedKey:s,exactUsedKey:u,usedLng:f,usedNS:c}}},{key:"isValidLookup",value:function(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}},{key:"getResource",value:function(e,r,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,r,i,o):this.resourceStore.getResource(e,r,i,o)}}],[{key:"hasDefaultValue",value:function(e){var r="defaultValue";for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&r===i.substring(0,r.length)&&e[i]!==void 0)return!0;return!1}}]),t}(W);function be(a){return a.charAt(0).toUpperCase()+a.slice(1)}var Pt=function(){function a(t){M(this,a),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$.create("languageUtils")}return q(a,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var e=n.split("-");return e.length===2||(e.pop(),e[e.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(e.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var e=n.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],r=n.split("-");return this.options.lowerCaseLng?r=r.map(function(i){return i.toLowerCase()}):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=be(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),e.indexOf(r[1].toLowerCase())>-1&&(r[1]=be(r[1].toLowerCase())),e.indexOf(r[2].toLowerCase())>-1&&(r[2]=be(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isWhitelisted",value:function(n){return this.logger.deprecate("languageUtils.isWhitelisted",`function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it's usage asap.`),this.isSupportedCode(n)}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var e=this;if(!n)return null;var r;return n.forEach(function(i){if(!r){var o=e.formatLanguageCode(i);(!e.options.supportedLngs||e.isSupportedCode(o))&&(r=o)}}),!r&&this.options.supportedLngs&&n.forEach(function(i){if(!r){var o=e.getLanguagePartFromCode(i);if(e.isSupportedCode(o))return r=o;r=e.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}},{key:"getFallbackCodes",value:function(n,e){if(!n)return[];if(typeof n=="function"&&(n=n(e)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!e)return n.default||[];var r=n[e];return r||(r=n[this.getScriptPartFromCode(e)]),r||(r=n[this.formatLanguageCode(e)]),r||(r=n[this.getLanguagePartFromCode(e)]),r||(r=n.default),r||[]}},{key:"toResolveHierarchy",value:function(n,e){var r=this,i=this.getFallbackCodes(e||this.options.fallbackLng||[],n),o=[],s=function(f){!f||(r.isSupportedCode(f)?o.push(f):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(f)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),i.forEach(function(u){o.indexOf(u)<0&&s(r.formatLanguageCode(u))}),o}}]),a}(),Et=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],jt={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}};function Rt(){var a={};return Et.forEach(function(t){t.lngs.forEach(function(n){a[n]={numbers:t.nr,plurals:jt[t.fc]}})}),a}var Ct=function(){function a(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,a),this.languageUtils=t,this.options=n,this.logger=$.create("pluralResolver"),this.rules=Rt()}return q(a,[{key:"addRule",value:function(n,e){this.rules[n]=e}},{key:"getRule",value:function(n){return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var e=this.getRule(n);return e&&e.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,e){return this.getSuffixes(n).map(function(r){return e+r})}},{key:"getSuffixes",value:function(n){var e=this,r=this.getRule(n);return r?r.numbers.map(function(i){return e.getSuffix(n,i)}):[]}},{key:"getSuffix",value:function(n,e){var r=this,i=this.getRule(n);if(i){var o=i.noAbs?i.plurals(e):i.plurals(Math.abs(e)),s=i.numbers[o];this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var u=function(){return r.options.prepend&&s.toString()?r.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):u():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&i.numbers.length===2&&i.numbers[0]===1?u():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(n)),""}}]),a}(),Nt=function(){function a(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,a),this.logger=$.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return q(a,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var e=n.interpolation;this.escape=e.escape!==void 0?e.escape:kt,this.escapeValue=e.escapeValue!==void 0?e.escapeValue:!0,this.useRawValueToEscape=e.useRawValueToEscape!==void 0?e.useRawValueToEscape:!1,this.prefix=e.prefix?G(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?G(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?G(e.nestingPrefix):e.nestingPrefixEscaped||G("$t("),this.nestingSuffix=e.nestingSuffix?G(e.nestingSuffix):e.nestingSuffixEscaped||G(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=e.alwaysFormat!==void 0?e.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(n,e,r,i){var o=this,s,u,f,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(h){return h.replace(/\$/g,"$$$$")}var v=function(b){if(b.indexOf(o.formatSeparator)<0){var S=Fe(e,c,b);return o.alwaysFormat?o.format(S,void 0,r):S}var O=b.split(o.formatSeparator),A=O.shift().trim(),k=O.join(o.formatSeparator).trim();return o.format(Fe(e,c,A),k,r,i)};this.resetRegExp();var m=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,y=[{regex:this.regexpUnescape,safeValue:function(b){return p(b)}},{regex:this.regexp,safeValue:function(b){return o.escapeValue?p(o.escape(b)):p(b)}}];return y.forEach(function(h){for(f=0;s=h.regex.exec(n);){if(u=v(s[1].trim()),u===void 0)if(typeof m=="function"){var b=m(n,s,i);u=typeof b=="string"?b:""}else if(d){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(s[1]," for interpolating ").concat(n)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=Ae(u));if(n=n.replace(s[0],h.safeValue(u)),h.regex.lastIndex=0,f++,f>=o.maxReplaces)break}}),n}},{key:"nest",value:function(n,e){var r=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,u=D({},i);u.applyPostProcessor=!1,delete u.defaultValue;function f(m,d){var y=this.nestingOptionsSeparator;if(m.indexOf(y)<0)return m;var h=m.split(new RegExp("".concat(y,"[ ]*{"))),b="{".concat(h[1]);m=h[0],b=this.interpolate(b,u),b=b.replace(/'/g,'"');try{u=JSON.parse(b),d&&(u=D({},d,u))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(m),S),"".concat(m).concat(y).concat(b)}return delete u.defaultValue,m}for(;o=this.nestingRegexp.exec(n);){var c=[],p=!1;if(o[0].includes(this.formatSeparator)&&!/{.*}/.test(o[1])){var v=o[1].split(this.formatSeparator).map(function(m){return m.trim()});o[1]=v.shift(),c=v,p=!0}if(s=e(f.call(this,o[1].trim(),u),u),s&&o[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=Ae(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(n)),s=""),p&&(s=c.reduce(function(m,d){return r.format(m,d,i.lng,i)},s.trim())),n=n.replace(o[0],s),this.regexp.lastIndex=0}return n}}]),a}();function At(a,t){for(var n=a.indexOf(t);n!==-1;)a.splice(n,1),n=a.indexOf(t)}var Tt=function(a){he(t,a);function t(n,e,r){var i,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return M(this,t),i=te(this,Y(t).call(this)),ve&&W.call(X(i)),i.backend=n,i.store=e,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=$.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return q(t,[{key:"queueLoad",value:function(e,r,i,o){var s=this,u=[],f=[],c=[],p=[];return e.forEach(function(v){var m=!0;r.forEach(function(d){var y="".concat(v,"|").concat(d);!i.reload&&s.store.hasResourceBundle(v,d)?s.state[y]=2:s.state[y]<0||(s.state[y]===1?f.indexOf(y)<0&&f.push(y):(s.state[y]=1,m=!1,f.indexOf(y)<0&&f.push(y),u.indexOf(y)<0&&u.push(y),p.indexOf(d)<0&&p.push(d)))}),m||c.push(v)}),(u.length||f.length)&&this.queue.push({pending:f,loaded:{},errors:[],callback:o}),{toLoad:u,pending:f,toLoadLanguages:c,toLoadNamespaces:p}}},{key:"loaded",value:function(e,r,i){var o=e.split("|"),s=o[0],u=o[1];r&&this.emit("failedLoading",s,u,r),i&&this.store.addResourceBundle(s,u,i),this.state[e]=r?-1:2;var f={};this.queue.forEach(function(c){Ot(c.loaded,[s],u),At(c.pending,e),r&&c.errors.push(r),c.pending.length===0&&!c.done&&(Object.keys(c.loaded).forEach(function(p){f[p]||(f[p]=[]),c.loaded[p].length&&c.loaded[p].forEach(function(v){f[p].indexOf(v)<0&&f[p].push(v)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(function(c){return!c.done})}},{key:"read",value:function(e,r,i){var o=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,f=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[i](e,r,function(c,p){if(c&&p&&s<5){setTimeout(function(){o.read.call(o,e,r,i,s+1,u*2,f)},u);return}f(c,p)}):f(null,{})}},{key:"prepareLoading",value:function(e,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof r=="string"&&(r=[r]);var u=this.queueLoad(e,r,o,s);if(!u.toLoad.length)return u.pending.length||s(),null;u.toLoad.forEach(function(f){i.loadOne(f)})}},{key:"load",value:function(e,r,i){this.prepareLoading(e,r,{},i)}},{key:"reload",value:function(e,r,i){this.prepareLoading(e,r,{reload:!0},i)}},{key:"loadOne",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=e.split("|"),s=o[0],u=o[1];this.read(s,u,"read",void 0,void 0,function(f,c){f&&r.logger.warn("".concat(i,"loading namespace ").concat(u," for language ").concat(s," failed"),f),!f&&c&&r.logger.log("".concat(i,"loaded namespace ").concat(u," for language ").concat(s),c),r.loaded(e,f,c)})}},{key:"saveMissing",value:function(e,r,i,o,s){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(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}i==null||i===""||(this.backend&&this.backend.create&&this.backend.create(e,r,i,o,null,D({},u,{isUpdate:s})),!(!e||!e[0])&&this.store.addResource(e[0],r,i,o))}}]),t}(W);function Ft(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(I(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),I(t[2])==="object"||I(t[3])==="object"){var e=t[3]||t[2];Object.keys(e).forEach(function(r){n[r]=e[r]})}return n},interpolation:{escapeValue:!0,format:function(t,n,e,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function Ie(a){return typeof a.ns=="string"&&(a.ns=[a.ns]),typeof a.fallbackLng=="string"&&(a.fallbackLng=[a.fallbackLng]),typeof a.fallbackNS=="string"&&(a.fallbackNS=[a.fallbackNS]),a.whitelist&&(a.whitelist&&a.whitelist.indexOf("cimode")<0&&(a.whitelist=a.whitelist.concat(["cimode"])),a.supportedLngs=a.whitelist),a.nonExplicitWhitelist&&(a.nonExplicitSupportedLngs=a.nonExplicitWhitelist),a.supportedLngs&&a.supportedLngs.indexOf("cimode")<0&&(a.supportedLngs=a.supportedLngs.concat(["cimode"])),a}function re(){}var _t=function(a){he(t,a);function t(){var n,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(M(this,t),n=te(this,Y(t).call(this)),ve&&W.call(X(n)),n.options=Ie(e),n.services={},n.logger=$,n.modules={external:[]},r&&!n.isInitialized&&!e.isClone){if(!n.options.initImmediate)return n.init(e,r),te(n,X(n));setTimeout(function(){n.init(e,r)},0)}return n}return q(t,[{key:"init",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;typeof r=="function"&&(i=r,r={}),r.whitelist&&!r.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),r.nonExplicitWhitelist&&!r.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=D({},Ft(),this.options,Ie(r)),this.format=this.options.interpolation.format,i||(i=re);function o(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?$.init(o(this.modules.logger),this.options):$.init(null,this.options);var s=new Pt(this.options);this.store=new Lt(this.options.resources,this.options);var u=this.services;u.logger=$,u.resourceStore=this.store,u.languageUtils=s,u.pluralResolver=new Ct(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u.interpolator=new Nt(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Tt(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(d){for(var y=arguments.length,h=new Array(y>1?y-1:0),b=1;b<y;b++)h[b-1]=arguments[b];e.emit.apply(e,[d].concat(h))}),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new De(this.services,this.options),this.translator.on("*",function(d){for(var y=arguments.length,h=new Array(y>1?y-1:0),b=1;b<y;b++)h[b-1]=arguments[b];e.emit.apply(e,[d].concat(h))}),this.modules.external.forEach(function(d){d.init&&d.init(e)})}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach(function(d){e[d]=function(){var y;return(y=e.store)[d].apply(y,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(d){e[d]=function(){var y;return(y=e.store)[d].apply(y,arguments),e}});var v=Z(),m=function(){var y=function(b,S){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),v.resolve(S),i(b,S)};if(e.languages&&e.options.compatibilityAPI!=="v1"&&!e.isInitialized)return y(null,e.t.bind(e));e.changeLanguage(e.options.lng,y)};return this.options.resources||!this.options.initImmediate?m():setTimeout(m,0),v}},{key:"loadResources",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:re,o=i,s=typeof e=="string"?e:this.language;if(typeof e=="function"&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode")return o();var u=[],f=function(v){if(!!v){var m=r.services.languageUtils.toResolveHierarchy(v);m.forEach(function(d){u.indexOf(d)<0&&u.push(d)})}};if(s)f(s);else{var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.forEach(function(p){return f(p)})}this.options.preload&&this.options.preload.forEach(function(p){return f(p)}),this.services.backendConnector.load(u,this.options.ns,o)}else o(null)}},{key:"reloadResources",value:function(e,r,i){var o=Z();return e||(e=this.languages),r||(r=this.options.ns),i||(i=re),this.services.backendConnector.reload(e,r,function(s){o.resolve(),i(s)}),o}},{key:"use",value:function(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 e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&rt.addPostProcessor(e),e.type==="3rdParty"&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,r){var i=this;this.isLanguageChangingTo=e;var o=Z();this.emit("languageChanging",e);var s=function(c,p){p?(i.language=p,i.languages=i.services.languageUtils.toResolveHierarchy(p),i.translator.changeLanguage(p),i.isLanguageChangingTo=void 0,i.emit("languageChanged",p),i.logger.log("languageChanged",p)):i.isLanguageChangingTo=void 0,o.resolve(function(){return i.t.apply(i,arguments)}),r&&r(c,function(){return i.t.apply(i,arguments)})},u=function(c){var p=typeof c=="string"?c:i.services.languageUtils.getBestMatchFromCodes(c);p&&(i.language||(i.language=p,i.languages=i.services.languageUtils.toResolveHierarchy(p)),i.translator.language||i.translator.changeLanguage(p),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(p)),i.loadResources(p,function(v){s(v,p)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(e),o}},{key:"getFixedT",value:function(e,r){var i=this,o=function s(u,f){var c;if(I(f)!=="object"){for(var p=arguments.length,v=new Array(p>2?p-2:0),m=2;m<p;m++)v[m-2]=arguments[m];c=i.options.overloadTranslationOptionHandler([u,f].concat(v))}else c=D({},f);return c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,i.t(u,c)};return typeof e=="string"?o.lng=e:o.lngs=e,o.ns=r,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};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;var o=this.languages[0],s=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;var f=function(v,m){var d=r.services.backendConnector.state["".concat(v,"|").concat(m)];return d===-1||d===2};if(i.precheck){var c=i.precheck(this,f);if(c!==void 0)return c}return!!(this.hasResourceBundle(o,e)||!this.services.backendConnector.backend||f(o,e)&&(!s||f(u,e)))}},{key:"loadNamespaces",value:function(e,r){var i=this,o=Z();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(function(s){i.options.ns.indexOf(s)<0&&i.options.ns.push(s)}),this.loadResources(function(s){o.resolve(),r&&r(s)}),o):(r&&r(),Promise.resolve())}},{key:"loadLanguages",value:function(e,r){var i=Z();typeof e=="string"&&(e=[e]);var o=this.options.preload||[],s=e.filter(function(u){return o.indexOf(u)<0});return s.length?(this.options.preload=o.concat(s),this.loadResources(function(u){i.resolve(),r&&r(u)}),i):(r&&r(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";var 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"];return r.indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new t(e,r)}},{key:"cloneInstance",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:re,o=D({},this.options,r,{isClone:!0}),s=new t(o),u=["store","services","language"];return u.forEach(function(f){s[f]=e[f]}),s.services=D({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new De(s.services,s.options),s.translator.on("*",function(f){for(var c=arguments.length,p=new Array(c>1?c-1:0),v=1;v<c;v++)p[v-1]=arguments[v];s.emit.apply(s,[f].concat(p))}),s.init(o,i),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}}]),t}(W),Dt=new _t;function It(a,t){if(a==null)return{};var n={},e=Object.keys(a),r,i;for(i=0;i<e.length;i++)r=e[i],!(t.indexOf(r)>=0)&&(n[r]=a[r]);return n}function at(a,t){if(a==null)return{};var n=It(a,t),e,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);for(r=0;r<i.length;r++)e=i[r],!(t.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(a,e)||(n[e]=a[e]))}return n}var ie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ut={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Bt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Ue(a){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=a.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(Ut[n[1]]||a.charAt(a.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var e=a.indexOf("-->");return{type:"comment",comment:e!==-1?a.slice(4,e):""}}for(var r=new RegExp(Bt),i=null;(i=r.exec(a))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),s=[o,""];o.indexOf("=")>-1&&(s=o.split("=")),t.attrs[s[0]]=s[1],r.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var Ht=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Mt=/^\s*$/,qt=Object.create(null);function it(a,t){switch(t.type){case"text":return a+t.content;case"tag":return a+="<"+t.name+(t.attrs?function(n){var e=[];for(var r in n)e.push(r+'="'+n[r]+'"');return e.length?" "+e.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?a:a+t.children.reduce(it,"")+"</"+t.name+">";case"comment":return a+"<!--"+t.comment+"-->"}}var Vt={parse:function(a,t){t||(t={}),t.components||(t.components=qt);var n,e=[],r=[],i=-1,o=!1;if(a.indexOf("<")!==0){var s=a.indexOf("<");e.push({type:"text",content:s===-1?a:a.substring(0,s)})}return a.replace(Ht,function(u,f){if(o){if(u!=="</"+n.name+">")return;o=!1}var c,p=u.charAt(1)!=="/",v=u.startsWith("<!--"),m=f+u.length,d=a.charAt(m);if(v){var y=Ue(u);return i<0?(e.push(y),e):((c=r[i]).children.push(y),e)}if(p&&(i++,(n=Ue(u)).type==="tag"&&t.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!d||d==="<"||n.children.push({type:"text",content:a.slice(m,a.indexOf("<",m))}),i===0&&e.push(n),(c=r[i-1])&&c.children.push(n),r[i]=n),(!p||n.voidElement)&&(i>-1&&(n.voidElement||n.name===u.slice(2,-1))&&(i--,n=i===-1?e:r[i]),!o&&d!=="<"&&d)){c=i===-1?e:r[i].children;var h=a.indexOf("<",m),b=a.slice(m,h===-1?void 0:h);Mt.test(b)&&(b=" "),(h>-1&&i+c.length>=0||b!==" ")&&c.push({type:"text",content:b})}}),e},stringify:function(a){return a.reduce(function(t,n){return t+it("",n)},"")}},$t=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,zt={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},Kt=function(t){return zt[t]},Wt=function(t){return t.replace($t,Kt)};function Be(a,t){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),n.push.apply(n,e)}return n}function He(a){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Be(Object(n),!0).forEach(function(e){ge(a,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(n,e))})}return a}var ke={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Wt},ot,st=T.createContext();function Xt(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ke=He(He({},ke),a)}function ut(){return ke}var Jt=function(){function a(){M(this,a),this.usedNamespaces={}}return q(a,[{key:"addUsedNamespaces",value:function(n){var e=this;n.forEach(function(r){e.usedNamespaces[r]||(e.usedNamespaces[r]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),a}();function Qt(a){ot=a}function ft(){return ot}var Gt={type:"3rdParty",init:function(t){Xt(t.options.react),Qt(t)}};function oe(){if(console&&console.warn){for(var a,t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(a=console).warn.apply(a,n)}}var Me={};function ue(){for(var a=arguments.length,t=new Array(a),n=0;n<a;n++)t[n]=arguments[n];typeof t[0]=="string"&&Me[t[0]]||(typeof t[0]=="string"&&(Me[t[0]]=new Date),oe.apply(void 0,t))}function qe(a,t,n){a.loadNamespaces(t,function(){if(a.isInitialized)n();else{var e=function r(){setTimeout(function(){a.off("initialized",r)},0),n()};a.on("initialized",e)}})}function Yt(a,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},e=t.languages[0],r=t.options?t.options.fallbackLng:!1,i=t.languages[t.languages.length-1];if(e.toLowerCase()==="cimode")return!0;var o=function(u,f){var c=t.services.backendConnector.state["".concat(u,"|").concat(f)];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,a)?!1:!!(t.hasResourceBundle(e,a)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(e,a)&&(!r||o(i,a)))}function Zt(a,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return ue("i18n.languages were undefined or empty",t.languages),!0;var e=t.options.ignoreJSONStructure!==void 0;return e?t.hasLoadedNamespace(a,{precheck:function(i,o){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,a))return!1}}):Yt(a,t,n)}var en=["format"],tn=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function Ve(a,t){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),n.push.apply(n,e)}return n}function _(a){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ve(Object(n),!0).forEach(function(e){ge(a,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(n,e))})}return a}function we(a,t){if(!a)return!1;var n=a.props?a.props.children:a.children;return t?n.length>0:!!n}function Se(a){return a?a.props?a.props.children:a.children:[]}function nn(a){return Object.prototype.toString.call(a)!=="[object Array]"?!1:a.every(function(t){return T.isValidElement(t)})}function ee(a){return Array.isArray(a)?a:[a]}function rn(a,t){var n=_({},t);return n.props=Object.assign(a.props,t.props),n}function lt(a,t){if(!a)return"";var n="",e=ee(a),r=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return e.forEach(function(i,o){if(typeof i=="string")n+="".concat(i);else if(T.isValidElement(i)){var s=Object.keys(i.props).length,u=r.indexOf(i.type)>-1,f=i.props.children;if(!f&&u&&s===0)n+="<".concat(i.type,"/>");else if(!f&&(!u||s!==0))n+="<".concat(o,"></").concat(o,">");else if(i.props.i18nIsDynamicList)n+="<".concat(o,"></").concat(o,">");else if(u&&s===1&&typeof f=="string")n+="<".concat(i.type,">").concat(f,"</").concat(i.type,">");else{var c=lt(f,t);n+="<".concat(o,">").concat(c,"</").concat(o,">")}}else if(i===null)oe("Trans: the passed in value is invalid - seems you passed in a null child.");else if(I(i)==="object"){var p=i.format,v=at(i,en),m=Object.keys(v);if(m.length===1){var d=p?"".concat(m[0],", ").concat(p):m[0];n+="{{".concat(d,"}}")}else oe("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",i)}else oe("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",i)}),n}function an(a,t,n,e,r,i){if(t==="")return[];var o=e.transKeepBasicHtmlNodesFor||[],s=t&&new RegExp(o.join("|")).test(t);if(!a&&!s)return[t];var u={};function f(h){var b=ee(h);b.forEach(function(S){typeof S!="string"&&(we(S)?f(Se(S)):I(S)==="object"&&!T.isValidElement(S)&&Object.assign(u,S))})}f(a);var c=Vt.parse("<0>".concat(t,"</0>")),p=_(_({},u),r);function v(h,b,S){var O=Se(h),A=d(O,b.children,S);return nn(O)&&A.length===0?O:A}function m(h,b,S,O,A){h.dummy&&(h.children=b),S.push(T.cloneElement(h,_(_({},h.props),{},{key:O}),A?void 0:b))}function d(h,b,S){var O=ee(h),A=ee(b);return A.reduce(function(k,w,j){var R=w.children&&w.children[0]&&w.children[0].content&&n.services.interpolator.interpolate(w.children[0].content,p,n.language);if(w.type==="tag"){var C=O[parseInt(w.name,10)];!C&&S.length===1&&S[0][w.name]&&(C=S[0][w.name]),C||(C={});var P=Object.keys(w.attrs).length!==0?rn({props:w.attrs},C):C,E=T.isValidElement(P),K=E&&we(w,!0)&&!w.voidElement,B=s&&I(P)==="object"&&P.dummy&&!E,l=I(a)==="object"&&a!==null&&Object.hasOwnProperty.call(a,w.name);if(typeof P=="string"){var g=n.services.interpolator.interpolate(P,p,n.language);k.push(g)}else if(we(P)||K){var x=v(P,w,S);m(P,x,k,j)}else if(B){var F=d(O,w.children,S);k.push(T.cloneElement(P,_(_({},P.props),{},{key:j}),F))}else if(Number.isNaN(parseFloat(w.name)))if(l){var N=v(P,w,S);m(P,N,k,j,w.voidElement)}else if(e.transSupportBasicHtmlNodes&&o.indexOf(w.name)>-1)if(w.voidElement)k.push(T.createElement(w.name,{key:"".concat(w.name,"-").concat(j)}));else{var L=d(O,w.children,S);k.push(T.createElement(w.name,{key:"".concat(w.name,"-").concat(j)},L))}else if(w.voidElement)k.push("<".concat(w.name," />"));else{var V=d(O,w.children,S);k.push("<".concat(w.name,">").concat(V,"</").concat(w.name,">"))}else if(I(P)==="object"&&!E){var U=w.children[0]?R:null;U&&k.push(U)}else w.children.length===1&&R?k.push(T.cloneElement(P,_(_({},P.props),{},{key:j}),R)):k.push(T.cloneElement(P,_(_({},P.props),{},{key:j})))}else if(w.type==="text"){var H=e.transWrapTextNodes,J=i?e.unescape(n.services.interpolator.interpolate(w.content,p,n.language)):n.services.interpolator.interpolate(w.content,p,n.language);H?k.push(T.createElement(H,{key:"".concat(w.name,"-").concat(j)},J)):k.push(J)}return k},[])}var y=d([{dummy:!0,children:a||[]}],c,ee(a||[]));return Se(y[0])}function on(a){var t=a.children,n=a.count,e=a.parent,r=a.i18nKey,i=a.context,o=a.tOptions,s=o===void 0?{}:o,u=a.values,f=a.defaults,c=a.components,p=a.ns,v=a.i18n,m=a.t,d=a.shouldUnescape,y=at(a,tn),h=T.useContext(st)||{},b=h.i18n,S=h.defaultNS,O=v||b||ft();if(!O)return ue("You will need to pass in an i18next instance by using i18nextReactModule"),t;var A=m||O.t.bind(O)||function(g){return g};i&&(s.context=i);var k=_(_({},ut()),O.options&&O.options.react),w=p||A.ns||S||O.options&&O.options.defaultNS;w=typeof w=="string"?[w]:w||["translation"];var j=f||lt(t,k)||k.transEmptyNodeValue||r,R=k.hashTransKey,C=r||(R?R(j):j),P=u?s.interpolation:{interpolation:_(_({},s.interpolation),{},{prefix:"#$?",suffix:"?$#"})},E=_(_(_(_({},s),{},{count:n},u),P),{},{defaultValue:j,ns:w}),K=C?A(C,E):j,B=an(c||t,K,O,k,E,d),l=e!==void 0?e:k.defaultTransParent;return l?T.createElement(l,y,B):B}function sn(a){if(Array.isArray(a))return a}function un(a,t){var n=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(n!=null){var e,r,i,o,s=[],u=!0,f=!1;try{if(i=(n=n.call(a)).next,t===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(e=i.call(n)).done)&&(s.push(e.value),s.length!==t);u=!0);}catch(c){f=!0,r=c}finally{try{if(!u&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw r}}return s}}function $e(a,t){(t==null||t>a.length)&&(t=a.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=a[n];return e}function fn(a,t){if(!!a){if(typeof a=="string")return $e(a,t);var n=Object.prototype.toString.call(a).slice(8,-1);if(n==="Object"&&a.constructor&&(n=a.constructor.name),n==="Map"||n==="Set")return Array.from(a);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $e(a,t)}}function ln(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cn(a,t){return sn(a)||un(a,t)||fn(a,t)||ln()}function ze(a,t){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),n.push.apply(n,e)}return n}function Oe(a){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ze(Object(n),!0).forEach(function(e){ge(a,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(n,e))})}return a}var pn=function(t,n){var e=T.useRef();return T.useEffect(function(){e.current=n?e.current:t},[t,n]),e.current};function dn(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,e=T.useContext(st)||{},r=e.i18n,i=e.defaultNS,o=n||r||ft();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Jt),!o){ue("You will need to pass in an i18next instance by using initReactI18next");var s=function(C){return Array.isArray(C)?C[C.length-1]:C},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&ue("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var f=Oe(Oe(Oe({},ut()),o.options.react),t),c=f.useSuspense,p=f.keyPrefix,v=a||i||o.options&&o.options.defaultNS;v=typeof v=="string"?[v]:v||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(v);var m=(o.isInitialized||o.initializedStoreOnce)&&v.every(function(R){return Zt(R,o,f)});function d(){return o.getFixedT(null,f.nsMode==="fallback"?v:v[0],p)}var y=T.useState(d),h=cn(y,2),b=h[0],S=h[1],O=v.join(),A=pn(O),k=T.useRef(!0);T.useEffect(function(){var R=f.bindI18n,C=f.bindI18nStore;k.current=!0,!m&&!c&&qe(o,v,function(){k.current&&S(d)}),m&&A&&A!==O&&k.current&&S(d);function P(){k.current&&S(d)}return R&&o&&o.on(R,P),C&&o&&o.store.on(C,P),function(){k.current=!1,R&&o&&R.split(" ").forEach(function(E){return o.off(E,P)}),C&&o&&C.split(" ").forEach(function(E){return o.store.off(E,P)})}},[o,O]);var w=T.useRef(!0);T.useEffect(function(){k.current&&!w.current&&S(d),w.current=!1},[o,p]);var j=[b,o,m];if(j.t=b,j.i18n=o,j.ready=m,m||!m&&!c)return j;throw new Promise(function(R){qe(o,v,function(){R()})})}function Le(a){return Le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(a)}var ct=[],gn=ct.forEach,hn=ct.slice;function Pe(a){return gn.call(hn.call(arguments,1),function(t){if(t)for(var n in t)a[n]===void 0&&(a[n]=t[n])}),a}function pt(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Le(XMLHttpRequest))==="object"}function vn(a){return!!a&&typeof a.then=="function"}function mn(a){return vn(a)?a:Promise.resolve(a)}function yn(a){throw new Error('Could not dynamically require "'+a+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var fe={exports:{}},ae={exports:{}},Ke;function bn(){return Ke||(Ke=1,function(a,t){var n=typeof self<"u"?self:ie,e=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(o){var s={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function u(l){return l&&DataView.prototype.isPrototypeOf(l)}if(s.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(l){return l&&f.indexOf(Object.prototype.toString.call(l))>-1};function p(l){if(typeof l!="string"&&(l=String(l)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(l))throw new TypeError("Invalid character in header field name");return l.toLowerCase()}function v(l){return typeof l!="string"&&(l=String(l)),l}function m(l){var g={next:function(){var x=l.shift();return{done:x===void 0,value:x}}};return s.iterable&&(g[Symbol.iterator]=function(){return g}),g}function d(l){this.map={},l instanceof d?l.forEach(function(g,x){this.append(x,g)},this):Array.isArray(l)?l.forEach(function(g){this.append(g[0],g[1])},this):l&&Object.getOwnPropertyNames(l).forEach(function(g){this.append(g,l[g])},this)}d.prototype.append=function(l,g){l=p(l),g=v(g);var x=this.map[l];this.map[l]=x?x+", "+g:g},d.prototype.delete=function(l){delete this.map[p(l)]},d.prototype.get=function(l){return l=p(l),this.has(l)?this.map[l]:null},d.prototype.has=function(l){return this.map.hasOwnProperty(p(l))},d.prototype.set=function(l,g){this.map[p(l)]=v(g)},d.prototype.forEach=function(l,g){for(var x in this.map)this.map.hasOwnProperty(x)&&l.call(g,this.map[x],x,this)},d.prototype.keys=function(){var l=[];return this.forEach(function(g,x){l.push(x)}),m(l)},d.prototype.values=function(){var l=[];return this.forEach(function(g){l.push(g)}),m(l)},d.prototype.entries=function(){var l=[];return this.forEach(function(g,x){l.push([x,g])}),m(l)},s.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function y(l){if(l.bodyUsed)return Promise.reject(new TypeError("Already read"));l.bodyUsed=!0}function h(l){return new Promise(function(g,x){l.onload=function(){g(l.result)},l.onerror=function(){x(l.error)}})}function b(l){var g=new FileReader,x=h(g);return g.readAsArrayBuffer(l),x}function S(l){var g=new FileReader,x=h(g);return g.readAsText(l),x}function O(l){for(var g=new Uint8Array(l),x=new Array(g.length),F=0;F<g.length;F++)x[F]=String.fromCharCode(g[F]);return x.join("")}function A(l){if(l.slice)return l.slice(0);var g=new Uint8Array(l.byteLength);return g.set(new Uint8Array(l)),g.buffer}function k(){return this.bodyUsed=!1,this._initBody=function(l){this._bodyInit=l,l?typeof l=="string"?this._bodyText=l:s.blob&&Blob.prototype.isPrototypeOf(l)?this._bodyBlob=l:s.formData&&FormData.prototype.isPrototypeOf(l)?this._bodyFormData=l:s.searchParams&&URLSearchParams.prototype.isPrototypeOf(l)?this._bodyText=l.toString():s.arrayBuffer&&s.blob&&u(l)?(this._bodyArrayBuffer=A(l.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(l)||c(l))?this._bodyArrayBuffer=A(l):this._bodyText=l=Object.prototype.toString.call(l):this._bodyText="",this.headers.get("content-type")||(typeof l=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s.searchParams&&URLSearchParams.prototype.isPrototypeOf(l)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s.blob&&(this.blob=function(){var l=y(this);if(l)return l;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var l=y(this);if(l)return l;if(this._bodyBlob)return S(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(O(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s.formData&&(this.formData=function(){return this.text().then(C)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function j(l){var g=l.toUpperCase();return w.indexOf(g)>-1?g:l}function R(l,g){g=g||{};var x=g.body;if(l instanceof R){if(l.bodyUsed)throw new TypeError("Already read");this.url=l.url,this.credentials=l.credentials,g.headers||(this.headers=new d(l.headers)),this.method=l.method,this.mode=l.mode,this.signal=l.signal,!x&&l._bodyInit!=null&&(x=l._bodyInit,l.bodyUsed=!0)}else this.url=String(l);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new d(g.headers)),this.method=j(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x)}R.prototype.clone=function(){return new R(this,{body:this._bodyInit})};function C(l){var g=new FormData;return l.trim().split("&").forEach(function(x){if(x){var F=x.split("="),N=F.shift().replace(/\+/g," "),L=F.join("=").replace(/\+/g," ");g.append(decodeURIComponent(N),decodeURIComponent(L))}}),g}function P(l){var g=new d,x=l.replace(/\r?\n[\t ]+/g," ");return x.split(/\r?\n/).forEach(function(F){var N=F.split(":"),L=N.shift().trim();if(L){var V=N.join(":").trim();g.append(L,V)}}),g}k.call(R.prototype);function E(l,g){g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in g?g.statusText:"OK",this.headers=new d(g.headers),this.url=g.url||"",this._initBody(l)}k.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},E.error=function(){var l=new E(null,{status:0,statusText:""});return l.type="error",l};var K=[301,302,303,307,308];E.redirect=function(l,g){if(K.indexOf(g)===-1)throw new RangeError("Invalid status code");return new E(null,{status:g,headers:{location:l}})},o.DOMException=i.DOMException;try{new o.DOMException}catch{o.DOMException=function(g,x){this.message=g,this.name=x;var F=Error(g);this.stack=F.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function B(l,g){return new Promise(function(x,F){var N=new R(l,g);if(N.signal&&N.signal.aborted)return F(new o.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function V(){L.abort()}L.onload=function(){var U={status:L.status,statusText:L.statusText,headers:P(L.getAllResponseHeaders()||"")};U.url="responseURL"in L?L.responseURL:U.headers.get("X-Request-URL");var H="response"in L?L.response:L.responseText;x(new E(H,U))},L.onerror=function(){F(new TypeError("Network request failed"))},L.ontimeout=function(){F(new TypeError("Network request failed"))},L.onabort=function(){F(new o.DOMException("Aborted","AbortError"))},L.open(N.method,N.url,!0),N.credentials==="include"?L.withCredentials=!0:N.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&s.blob&&(L.responseType="blob"),N.headers.forEach(function(U,H){L.setRequestHeader(H,U)}),N.signal&&(N.signal.addEventListener("abort",V),L.onreadystatechange=function(){L.readyState===4&&N.signal.removeEventListener("abort",V)}),L.send(typeof N._bodyInit>"u"?null:N._bodyInit)})}return B.polyfill=!0,i.fetch||(i.fetch=B,i.Headers=d,i.Request=R,i.Response=E),o.Headers=d,o.Request=R,o.Response=E,o.fetch=B,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(e),e.fetch.ponyfill=!0,delete e.fetch.polyfill;var r=e;t=r.fetch,t.default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,a.exports=t}(ae,ae.exports)),ae.exports}(function(a,t){var n;if(typeof fetch=="function"&&(typeof ie<"u"&&ie.fetch?n=ie.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof yn<"u"&&(typeof window>"u"||typeof window.document>"u")){var e=n||bn();e.default&&(e=e.default),t.default=e,a.exports=t.default}})(fe,fe.exports);const dt=fe.exports,We=mt({__proto__:null,default:dt},[fe.exports]);function le(a){return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(a)}var z;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?z=global.fetch:typeof window<"u"&&window.fetch?z=window.fetch:z=fetch);var ne;pt()&&(typeof global<"u"&&global.XMLHttpRequest?ne=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ne=window.XMLHttpRequest));var ce;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?ce=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(ce=window.ActiveXObject));!z&&We&&!ne&&!ce&&(z=dt||We);typeof z!="function"&&(z=void 0);var Ee=function(t,n){if(n&&le(n)==="object"){var e="";for(var r in n)e+="&"+encodeURIComponent(r)+"="+encodeURIComponent(n[r]);if(!e)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+e.slice(1)}return t},Xe=function(t,n,e){z(t,n).then(function(r){if(!r.ok)return e(r.statusText||"Error",{status:r.status});r.text().then(function(i){e(null,{status:r.status,data:i})}).catch(e)}).catch(e)},Je=!1,wn=function(t,n,e,r){t.queryStringParams&&(n=Ee(n,t.queryStringParams));var i=Pe({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);e&&(i["Content-Type"]="application/json");var o=typeof t.requestOptions=="function"?t.requestOptions(e):t.requestOptions,s=Pe({method:e?"POST":"GET",body:e?t.stringify(e):void 0,headers:i},Je?{}:o);try{Xe(n,s,r)}catch(u){if(!o||Object.keys(o).length===0||!u.message||u.message.indexOf("not implemented")<0)return r(u);try{Object.keys(o).forEach(function(f){delete s[f]}),Xe(n,s,r),Je=!0}catch(f){r(f)}}},Sn=function(t,n,e,r){e&&le(e)==="object"&&(e=Ee("",e).slice(1)),t.queryStringParams&&(n=Ee(n,t.queryStringParams));try{var i;ne?i=new ne:i=new ce("MSXML2.XMLHTTP.3.0"),i.open(e?"POST":"GET",n,1),t.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!t.withCredentials,e&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var o=t.customHeaders;if(o=typeof o=="function"?o():o,o)for(var s in o)i.setRequestHeader(s,o[s]);i.onreadystatechange=function(){i.readyState>3&&r(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(e)}catch(u){console&&console.log(u)}},On=function(t,n,e,r){if(typeof e=="function"&&(r=e,e=void 0),r=r||function(){},z)return wn(t,n,e,r);if(pt()||typeof ActiveXObject=="function")return Sn(t,n,e,r);r(new Error("No fetch and no xhr implementation found!"))};function xn(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function Qe(a,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,e.key,e)}}function kn(a,t,n){return t&&Qe(a.prototype,t),n&&Qe(a,n),Object.defineProperty(a,"prototype",{writable:!1}),a}function Ln(a,t,n){return t in a?Object.defineProperty(a,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[t]=n,a}var Pn=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,e,r){return Ln({},e,r||"")},request:On,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},gt=function(){function a(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};xn(this,a),this.services=t,this.options=n,this.allOptions=e,this.type="backend",this.init(t,n,e)}return kn(a,[{key:"init",value:function(n){var e=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Pe(r,this.options||{},Pn()),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return e.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,e,r){this._readAny(n,n,e,e,r)}},{key:"read",value:function(n,e,r){this._readAny([n],n,[e],e,r)}},{key:"_readAny",value:function(n,e,r,i,o){var s=this,u=this.options.loadPath;typeof this.options.loadPath=="function"&&(u=this.options.loadPath(n,r)),u=mn(u),u.then(function(f){if(!f)return o(null,{});var c=s.services.interpolator.interpolate(f,{lng:n.join("+"),ns:r.join("+")});s.loadUrl(c,o,e,i)})}},{key:"loadUrl",value:function(n,e,r,i){var o=this;this.options.request(this.options,n,void 0,function(s,u){if(u&&(u.status>=500&&u.status<600||!u.status))return e("failed loading "+n+"; status code: "+u.status,!0);if(u&&u.status>=400&&u.status<500)return e("failed loading "+n+"; status code: "+u.status,!1);if(!u&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return e("failed loading "+n+": "+s.message,!0);if(s)return e(s,!1);var f,c;try{typeof u.data=="string"?f=o.options.parse(u.data,r,i):f=u.data}catch{c="failed parsing "+n+" to json"}if(c)return e(c,!1);e(null,f)})}},{key:"create",value:function(n,e,r,i,o){var s=this;if(!!this.options.addPath){typeof n=="string"&&(n=[n]);var u=this.options.parsePayload(e,r,i),f=0,c=[],p=[];n.forEach(function(v){var m=s.options.addPath;typeof s.options.addPath=="function"&&(m=s.options.addPath(v,e));var d=s.services.interpolator.interpolate(m,{lng:v,ns:e});s.options.request(s.options,d,u,function(y,h){f+=1,c.push(y),p.push(h),f===n.length&&o&&o(c,p)})})}}},{key:"reload",value:function(){var n=this,e=this.services,r=e.backendConnector,i=e.languageUtils,o=e.logger,s=r.language;if(!(s&&s.toLowerCase()==="cimode")){var u=[],f=function(p){var v=i.toResolveHierarchy(p);v.forEach(function(m){u.indexOf(m)<0&&u.push(m)})};f(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return f(c)}),u.forEach(function(c){n.allOptions.ns.forEach(function(p){r.read(c,p,"read",null,null,function(v,m){v&&o.warn("loading namespace ".concat(p," for language ").concat(c," failed"),v),!v&&m&&o.log("loaded namespace ".concat(p," for language ").concat(c),m),r.loaded("".concat(c,"|").concat(p),v,m)})})})}}}]),a}();gt.type="backend";var ht=[],En=ht.forEach,jn=ht.slice;function Rn(a){return En.call(jn.call(arguments,1),function(t){if(t)for(var n in t)a[n]===void 0&&(a[n]=t[n])}),a}var Ge=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Cn=function(t,n,e){var r=e||{};r.path=r.path||"/";var i=encodeURIComponent(n),o=t+"="+i;if(r.maxAge>0){var s=r.maxAge-0;if(isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age="+Math.floor(s)}if(r.domain){if(!Ge.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!Ge.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite){var u=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},Ye={create:function(t,n,e,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};e&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+e*60*1e3)),r&&(i.domain=r),document.cookie=Cn(t,encodeURIComponent(n),i)},read:function(t){for(var n=t+"=",e=document.cookie.split(";"),r=0;r<e.length;r++){for(var i=e[r];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(n)===0)return i.substring(n.length,i.length)}return null},remove:function(t){this.create(t,"",-1)}},Nn={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var e=Ye.read(t.lookupCookie);e&&(n=e)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&Ye.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},An={name:"querystring",lookup:function(t){var n;if(typeof window<"u")for(var e=window.location.search.substring(1),r=e.split("&"),i=0;i<r.length;i++){var o=r[i].indexOf("=");if(o>0){var s=r[i].substring(0,o);s===t.lookupQuerystring&&(n=r[i].substring(o+1))}}return n}},pe;try{pe=window!=="undefined"&&window.localStorage!==null;var Ze="i18next.translate.boo";window.localStorage.setItem(Ze,"foo"),window.localStorage.removeItem(Ze)}catch{pe=!1}var Tn={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&pe){var e=window.localStorage.getItem(t.lookupLocalStorage);e&&(n=e)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&pe&&window.localStorage.setItem(n.lookupLocalStorage,t)}},de;try{de=window!=="undefined"&&window.sessionStorage!==null;var et="i18next.translate.boo";window.sessionStorage.setItem(et,"foo"),window.sessionStorage.removeItem(et)}catch{de=!1}var Fn={name:"sessionStorage",lookup:function(t){var n;if(t.lookupsessionStorage&&de){var e=window.sessionStorage.getItem(t.lookupsessionStorage);e&&(n=e)}return n},cacheUserLanguage:function(t,n){n.lookupsessionStorage&&de&&window.sessionStorage.setItem(n.lookupsessionStorage,t)}},_n={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var e=0;e<navigator.languages.length;e++)n.push(navigator.languages[e]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},Dn={name:"htmlTag",lookup:function(t){var n,e=t.htmlTag||(typeof document<"u"?document.documentElement:null);return e&&typeof e.getAttribute=="function"&&(n=e.getAttribute("lang")),n}},In={name:"path",lookup:function(t){var n;if(typeof window<"u"){var e=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(e instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof e[t.lookupFromPathIndex]!="string")return;n=e[t.lookupFromPathIndex].replace("/","")}else n=e[0].replace("/","")}return n}},Un={name:"subdomain",lookup:function(t){var n;if(typeof window<"u"){var e=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);e instanceof Array&&(typeof t.lookupFromSubdomainIndex=="number"?n=e[t.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):n=e[0].replace("http://","").replace("https://","").replace(".",""))}return n}};function Bn(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var vt=function(){function a(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,a),this.type="languageDetector",this.detectors={},this.init(t,n)}return q(a,[{key:"init",value:function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Rn(e,this.options||{},Bn()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Nn),this.addDetector(An),this.addDetector(Tn),this.addDetector(Fn),this.addDetector(_n),this.addDetector(Dn),this.addDetector(In),this.addDetector(Un)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var e=this;n||(n=this.options.order);var r=[];return n.forEach(function(i){if(e.detectors[i]){var o=e.detectors[i].lookup(e.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}},{key:"cacheUserLanguage",value:function(n,e){var r=this;e||(e=this.options.caches),e&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||e.forEach(function(i){r.detectors[i]&&r.detectors[i].cacheUserLanguage(n,r.options)}))}}]),a}();vt.type="languageDetector";function Hn({detectorConfig:a,translationPath:t,customDetectors:n,...e}){const r=new vt,i={name:"hashRouterQuerystringDetector",lookup:f=>{try{const c=f&&f.lookupQuerystring||"lang",v=new RegExp(`[?&]${c}(=([^&#]*)|&|#|$)`).exec(window.location.href);if(v&&v[2]){const m=decodeURIComponent(v[2].replace(/\+/g," "));if(m)return m}}catch(c){console.error(c)}}};r.addDetector(i),Array.isArray(n)&&n.forEach(f=>{r.addDetector(f)});const u={fallbackLng:"en-US",debug:!0,keySeparator:".",backend:{loadPath:t||"/locales/{{lng}}/{{ns}}.json"},interpolation:{escapeValue:!1},detection:a||{order:["querystring","hashRouterQuerystringDetector","cookie","localStorage"],lookupQuerystring:"lang",lookupCookie:"lang",lookupSessionStorage:"lang",lookupLocalStorage:"lang",caches:["localStorage","cookie"],excludeCacheFor:["cimode"],cookieOptions:{path:"/",sameSite:"strict"}},...e};return Dt.use(gt).use(r).use(Gt).init(u)}const Mn=on;function qn(a="translation",t){return dn([a,"design-system"],t)}exports.SpsLanguage=Mn;exports.localize=Hn;exports.useSpsLanguage=qn;