@spscommerce/i18n 6.0.0-rc1 → 6.1.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/SpsLanguage.d.ts +2 -2
- package/lib/index.cjs.js +2 -2
- package/lib/index.es.js +49 -14
- package/lib/useSpsLanguage.d.ts +1 -1
- package/package.json +4 -3
- package/.pnpm-debug.log +0 -23
package/lib/SpsLanguage.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { Trans } from "react-i18next";
|
|
2
|
+
export declare const SpsLanguage: typeof Trans;
|
package/lib/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var wt=Object.defineProperty;var ae=Object.getOwnPropertySymbols;var De=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable;var Ie=(a,n,t)=>n in a?wt(a,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[n]=t,Se=(a,n)=>{for(var t in n||(n={}))De.call(n,t)&&Ie(a,t,n[t]);if(ae)for(var t of ae(n))Fe.call(n,t)&&Ie(a,t,n[t]);return a};var Oe=(a,n)=>{var t={};for(var e in a)De.call(a,e)&&n.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&ae)for(var e of ae(a))n.indexOf(e)<0&&Fe.call(a,e)&&(t[e]=a[e]);return t};Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var z=require("react");function St(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}function Ot(a){if(a&&a.__esModule)return a;var n={__proto__:null,[Symbol.toStringTag]:"Module"};return a&&Object.keys(a).forEach(function(t){if(t!=="default"){var e=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(n,t,e.get?e:{enumerable:!0,get:function(){return a[t]}})}}),n.default=a,Object.freeze(n)}function xt(a,n){return n.forEach(function(t){Object.keys(t).forEach(function(e){if(e!=="default"&&!(e in a)){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})}})}),Object.freeze(a)}var I=St(z),kt=Ot(z);function F(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?F=function(t){return typeof t}:F=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(a)}function ie(a,n,t){return n in a?Object.defineProperty(a,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[n]=t,a}function N(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){ie(a,r,t[r])})}return a}function B(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function Ue(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 H(a,n,t){return n&&Ue(a.prototype,n),t&&Ue(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 Z(a,n){if(n&&(F(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 G(a){return G=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},G(a)}function xe(a,n){return xe=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},xe(a,n)}function oe(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&&xe(a,n)}var Lt={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)}},Pt=function(){function a(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};B(this,a),this.init(n,t)}return H(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||Lt,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,N({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),a}(),K=new Pt,W=function(){function a(){B(this,a),this.observers={}}return H(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 Be(a){return a==null?"":""+a}function Et(a,n,t){a.forEach(function(e){n[e]&&(t[e]=n[e])})}function ke(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 He(a,n,t){var e=ke(a,n,Object),r=e.obj,i=e.k;r[i]=t}function jt(a,n,t,e){var r=ke(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 se(a,n){var t=ke(a,n),e=t.obj,r=t.k;if(!!e)return e[r]}function Me(a,n,t){var e=se(a,t);return e!==void 0?e:se(n,t)}function qe(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]):qe(a[e],n[e],t):a[e]=n[e]);return a}function Y(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Rt={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Ct(a){return typeof a=="string"?a.replace(/[&<>"'\/]/g,function(n){return Rt[n]}):a}var ue=typeof window!="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,At=function(a){oe(n,a);function n(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return B(this,n),e=Z(this,G(n).call(this)),ue&&W.call(J(e)),e.data=t||{},e.options=r,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e}return H(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(".")),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 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),He(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=se(this.data,l)||{};o?qe(c,i,s):c=N({},c,i),He(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"?N({},{},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),Ve={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}},$e={},ze=function(a){oe(n,a);function n(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return B(this,n),e=Z(this,G(n).call(this)),ue&&W.call(J(e)),Et(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,J(e)),e.options=r,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e.logger=K.create("translator"),e}return H(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(F(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],m=r.lng||this.language,y=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m&&m.toLowerCase()==="cimode"){if(y){var d=r.nsSeparator||this.options.nsSeparator;return p+d+l}return l}var b=this.resolve(e,r),h=b&&b.res,v=b&&b.usedKey||l,O=b&&b.exactUsedKey||l,x=Object.prototype.toString.apply(h),L=["[object Number]","[object Function]","[object RegExp]"],w=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,R=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(E&&h&&R&&L.indexOf(x)<0&&!(typeof w=="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(v,h,r):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(s){var C=x==="[object Array]",P=C?[]:{},V=C?O:v;for(var A in h)if(Object.prototype.hasOwnProperty.call(h,A)){var $="".concat(V).concat(s).concat(A);P[A]=this.translate($,N({},r,{joinArrays:!1,ns:c})),P[A]===$&&(P[A]=h[A])}h=P}}else if(E&&typeof w=="string"&&x==="[object Array]")h=h.join(w),h&&(h=this.extendTranslation(h,e,r,i));else{var M=!1,f=!1,g=r.count!==void 0&&typeof r.count!="string",S=n.hasDefaultValue(r),T=g?this.pluralResolver.getSuffix(m,r.count):"",j=r["defaultValue".concat(T)]||r.defaultValue;!this.isValidLookup(h)&&S&&(M=!0,h=j),this.isValidLookup(h)||(f=!0,h=l);var k=S&&j!==h&&this.options.updateMissing;if(f||M||k){if(this.logger.log(k?"updateKey":"missingKey",m,p,l,k?j:h),s){var q=this.resolve(l,N({},r,{keySeparator:!1}));q&&q.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 D=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(var ye=0;ye<U.length;ye++)D.push(U[ye]);else this.options.saveMissingTo==="all"?D=this.languageUtils.toResolveHierarchy(r.lng||this.language):D.push(r.lng||this.language);var _e=function(Q,we,Ne){o.options.missingKeyHandler?o.options.missingKeyHandler(Q,p,we,k?Ne:h,k,r):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(Q,p,we,k?Ne:h,k,r),o.emit("missingKey",Q,p,we,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&g?D.forEach(function(be){o.pluralResolver.getSuffixes(be).forEach(function(Q){_e([be],l+Q,r["defaultValue".concat(Q)]||j)})}):_e(D,l,j))}h=this.extendTranslation(h,e,r,b,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(N({},i,{interpolation:N({},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 m=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(m=N({},this.options.interpolation.defaultVariables,m)),e=this.interpolator.interpolate(e,m,i.lng||this.language,i),l){var y=e.match(this.interpolator.nestingRegexp),d=y&&y.length;c<d&&(i.nest=!1)}i.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var v=arguments.length,O=new Array(v),x=0;x<v;x++)O[x]=arguments[x];return s&&s[0]===O[0]&&!i.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(O[0]," in key: ").concat(r[0])),null):u.translate.apply(u,O.concat([r]))},i)),i.interpolation&&this.interpolator.reset()}var b=i.postProcess||this.options.postProcess,h=typeof b=="string"?[b]:b;return e!=null&&h&&h.length&&i.applyPostProcessor!==!1&&(e=Ve.handle(h,e,r,this.options&&this.options.postProcessPassResolved?N({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 m=r.extractFromKey(p,i),y=m.key;s=y;var d=m.namespaces;r.options.fallbackNS&&(d=d.concat(r.options.fallbackNS));var b=i.count!==void 0&&typeof i.count!="string",h=i.context!==void 0&&typeof i.context=="string"&&i.context!=="",v=i.lngs?i.lngs:r.languageUtils.toResolveHierarchy(i.lng||r.language,i.fallbackLng);d.forEach(function(O){r.isValidLookup(o)||(c=O,!$e["".concat(v[0],"-").concat(O)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(c)&&($e["".concat(v[0],"-").concat(O)]=!0,r.logger.warn('key "'.concat(s,'" for languages "').concat(v.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!!!")),v.forEach(function(x){if(!r.isValidLookup(o)){l=x;var L=y,w=[L];if(r.i18nFormat&&r.i18nFormat.addLookupKeys)r.i18nFormat.addLookupKeys(w,y,x,O,i);else{var E;b&&(E=r.pluralResolver.getSuffix(x,i.count)),b&&h&&w.push(L+E),h&&w.push(L+="".concat(r.options.contextSeparator).concat(i.context)),b&&w.push(L+=E)}for(var R;R=w.pop();)r.isValidLookup(o)||(u=R,o=r.getResource(x,O,R,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 Le(a){return a.charAt(0).toUpperCase()+a.slice(1)}var Tt=function(){function a(n){B(this,a),this.options=n,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=K.create("languageUtils")}return H(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]=Le(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]=Le(r[1].toLowerCase())),e.indexOf(r[2].toLowerCase())>-1&&(r[2]=Le(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}(),_t=[{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}],Nt={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 Dt(){var a={};return _t.forEach(function(n){n.lngs.forEach(function(t){a[t]={numbers:n.nr,plurals:Nt[n.fc]}})}),a}var Ft=function(){function a(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};B(this,a),this.languageUtils=n,this.options=t,this.logger=K.create("pluralResolver"),this.rules=Dt()}return H(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}(),It=function(){function a(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};B(this,a),this.logger=K.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(t){return t},this.init(n)}return H(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:Ct,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 m=function(v){if(v.indexOf(o.formatSeparator)<0){var O=Me(e,c,v);return o.alwaysFormat?o.format(O,void 0,r):O}var x=v.split(o.formatSeparator),L=x.shift().trim(),w=x.join(o.formatSeparator).trim();return o.format(Me(e,c,L),w,r,i)};this.resetRegExp();var y=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,b=[{regex:this.regexpUnescape,safeValue:function(v){return p(v)}},{regex:this.regexp,safeValue:function(v){return o.escapeValue?p(o.escape(v)):p(v)}}];return b.forEach(function(h){for(l=0;s=h.regex.exec(t);){if(u=m(s[1].trim()),u===void 0)if(typeof y=="function"){var v=y(t,s,i);u=typeof v=="string"?v:""}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=Be(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=N({},i);u.applyPostProcessor=!1,delete u.defaultValue;function l(y,d){var b=this.nestingOptionsSeparator;if(y.indexOf(b)<0)return y;var h=y.split(new RegExp("".concat(b,"[ ]*{"))),v="{".concat(h[1]);y=h[0],v=this.interpolate(v,u),v=v.replace(/'/g,'"');try{u=JSON.parse(v),d&&(u=N({},d,u))}catch(O){return this.logger.warn("failed parsing options string in nesting for key ".concat(y),O),"".concat(y).concat(b).concat(v)}return delete u.defaultValue,y}for(;o=this.nestingRegexp.exec(t);){var c=[],p=!1;if(o[0].includes(this.formatSeparator)&&!/{.*}/.test(o[1])){var m=o[1].split(this.formatSeparator).map(function(y){return y.trim()});o[1]=m.shift(),c=m,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=Be(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(t)),s=""),p&&(s=c.reduce(function(y,d){return r.format(y,d,i.lng,i)},s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}]),a}();function Ut(a,n){for(var t=a.indexOf(n);t!==-1;)a.splice(t,1),t=a.indexOf(n)}var Bt=function(a){oe(n,a);function n(t,e,r){var i,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return B(this,n),i=Z(this,G(n).call(this)),ue&&W.call(J(i)),i.backend=t,i.store=e,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=K.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return H(n,[{key:"queueLoad",value:function(e,r,i,o){var s=this,u=[],l=[],c=[],p=[];return e.forEach(function(m){var y=!0;r.forEach(function(d){var b="".concat(m,"|").concat(d);!i.reload&&s.store.hasResourceBundle(m,d)?s.state[b]=2:s.state[b]<0||(s.state[b]===1?l.indexOf(b)<0&&l.push(b):(s.state[b]=1,y=!1,l.indexOf(b)<0&&l.push(b),u.indexOf(b)<0&&u.push(b),p.indexOf(d)<0&&p.push(d)))}),y||c.push(m)}),(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){jt(c.loaded,[s],u),Ut(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(m){l[p].indexOf(m)<0&&l[p].push(m)})}),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,N({},u,{isUpdate:s})),!(!e||!e[0])&&this.store.addResource(e[0],r,i,o))}}]),n}(W);function Ht(){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(F(n[1])==="object"&&(t=n[1]),typeof n[1]=="string"&&(t.defaultValue=n[1]),typeof n[2]=="string"&&(t.tDescription=n[2]),F(n[2])==="object"||F(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 Ke(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 fe(){}var Mt=function(a){oe(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(B(this,n),t=Z(this,G(n).call(this)),ue&&W.call(J(t)),t.options=Ke(e),t.services={},t.logger=K,t.modules={external:[]},r&&!t.isInitialized&&!e.isClone){if(!t.options.initImmediate)return t.init(e,r),Z(t,J(t));setTimeout(function(){t.init(e,r)},0)}return t}return H(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=N({},Ht(),this.options,Ke(r)),this.format=this.options.interpolation.format,i||(i=fe);function o(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?K.init(o(this.modules.logger),this.options):K.init(null,this.options);var s=new Tt(this.options);this.store=new At(this.options.resources,this.options);var u=this.services;u.logger=K,u.resourceStore=this.store,u.languageUtils=s,u.pluralResolver=new Ft(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u.interpolator=new It(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Bt(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(d){for(var b=arguments.length,h=new Array(b>1?b-1:0),v=1;v<b;v++)h[v-1]=arguments[v];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 ze(this.services,this.options),this.translator.on("*",function(d){for(var b=arguments.length,h=new Array(b>1?b-1:0),v=1;v<b;v++)h[v-1]=arguments[v];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 b;return(b=e.store)[d].apply(b,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(d){e[d]=function(){var b;return(b=e.store)[d].apply(b,arguments),e}});var m=ee(),y=function(){var b=function(v,O){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),m.resolve(O),i(v,O)};if(e.languages&&e.options.compatibilityAPI!=="v1"&&!e.isInitialized)return b(null,e.t.bind(e));e.changeLanguage(e.options.lng,b)};return this.options.resources||!this.options.initImmediate?y():setTimeout(y,0),m}},{key:"loadResources",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fe,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(m){if(!!m){var y=r.services.languageUtils.toResolveHierarchy(m);y.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=fe),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"&&Ve.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(m){s(m,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(F(l)!=="object"){for(var p=arguments.length,m=new Array(p>2?p-2:0),y=2;y<p;y++)m[y-2]=arguments[y];c=i.options.overloadTranslationOptionHandler([u,l].concat(m))}else c=N({},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(m,y){var d=r.services.backendConnector.state["".concat(m,"|").concat(y)];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]:fe,o=N({},this.options,r,{isClone:!0}),s=new n(o),u=["store","services","language"];return u.forEach(function(l){s[l]=e[l]}),s.services=N({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new ze(s.services,s.options),s.translator.on("*",function(l){for(var c=arguments.length,p=new Array(c>1?c-1:0),m=1;m<c;m++)p[m-1]=arguments[m];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),qt=new Mt;function Vt(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 We(a,n){if(a==null)return{};var t=Vt(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 le=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function $t(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 zt={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},Kt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Xe(a){var n={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},t=a.match(/<\/?([^\s]+?)[/\s>]/);if(t&&(n.name=t[1],(zt[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(Kt),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 Wt=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Xt=/^\s*$/,Jt=Object.create(null);function Je(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(Je,"")+"</"+n.name+">";case"comment":return a+"<!--"+n.comment+"-->"}}var Qt={parse:function(a,n){n||(n={}),n.components||(n.components=Jt);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(Wt,function(u,l){if(o){if(u!=="</"+t.name+">")return;o=!1}var c,p=u.charAt(1)!=="/",m=u.startsWith("<!--"),y=l+u.length,d=a.charAt(y);if(m){var b=Xe(u);return i<0?(e.push(b),e):((c=r[i]).children.push(b),e)}if(p&&(i++,(t=Xe(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(y,a.indexOf("<",y))}),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("<",y),v=a.slice(y,h===-1?void 0:h);Xt.test(v)&&(v=" "),(h>-1&&i+c.length>=0||v!==" ")&&c.push({type:"text",content:v})}}),e},stringify:function(a){return a.reduce(function(n,t){return n+Je("",t)},"")}};function Qe(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 Ge(a){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Qe(Object(t),!0).forEach(function(e){ie(a,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Qe(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},Ye,Ze=I.default.createContext();function Gt(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pe=Ge(Ge({},Pe),a)}function et(){return Pe}var Yt=function(){function a(){B(this,a),this.usedNamespaces={}}return H(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 Zt(a){Ye=a}function tt(){return Ye}var en={type:"3rdParty",init:function(n){Gt(n.options.react),Zt(n)}};function ce(){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 nt={};function pe(){for(var a=arguments.length,n=new Array(a),t=0;t<a;t++)n[t]=arguments[t];typeof n[0]=="string"&&nt[n[0]]||(typeof n[0]=="string"&&(nt[n[0]]=new Date),ce.apply(void 0,n))}function rt(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 tn(a,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!n.languages||!n.languages.length)return pe("i18n.languages were undefined or empty",n.languages),!0;var 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||o(e,a)&&(!r||o(i,a)))}var nn=["format"],rn=["children","count","parent","i18nKey","tOptions","values","defaults","components","ns","i18n","t"];function at(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?at(Object(t),!0).forEach(function(e){ie(a,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):at(Object(t)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(t,e))})}return a}function Ee(a,n){if(!a)return!1;var t=a.props?a.props.children:a.children;return n?t.length>0:!!t}function je(a){return a?a&&a.children?a.children:a.props&&a.props.children:[]}function an(a){return Object.prototype.toString.call(a)!=="[object Array]"?!1:a.every(function(n){return I.default.isValidElement(n)})}function te(a){return Array.isArray(a)?a:[a]}function on(a,n){var t=_({},n);return t.props=Object.assign(a.props,n.props),t}function it(a,n){if(!a)return"";var t="",e=te(a),r=n.transKeepBasicHtmlNodesFor||[];return e.forEach(function(i,o){if(typeof i=="string")t+="".concat(i);else if(I.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=it(l,n);t+="<".concat(o,">").concat(c,"</").concat(o,">")}}else if(i===null)ce("Trans: the passed in value is invalid - seems you passed in a null child.");else if(F(i)==="object"){var p=i.format,m=We(i,nn),y=Object.keys(m);if(y.length===1){var d=p?"".concat(y[0],", ").concat(p):y[0];t+="{{".concat(d,"}}")}else ce("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",i)}else ce("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 sn(a,n,t,e,r){if(n==="")return[];var i=e.transKeepBasicHtmlNodesFor||[],o=n&&new RegExp(i.join("|")).test(n);if(!a&&!o)return[n];var s={};function u(b){var h=te(b);h.forEach(function(v){typeof v!="string"&&(Ee(v)?u(je(v)):F(v)==="object"&&!I.default.isValidElement(v)&&Object.assign(s,v))})}u(a);var l=Qt.parse("<0>".concat(n,"</0>")),c=_(_({},s),r);function p(b,h,v){var O=je(b),x=y(O,h.children,v);return an(O)&&x.length===0?O:x}function m(b,h,v,O,x){b.dummy&&(b.children=h),v.push(I.default.cloneElement(b,_(_({},b.props),{},{key:O}),x?void 0:h))}function y(b,h,v){var O=te(b),x=te(h);return x.reduce(function(L,w,E){var R=w.children&&w.children[0]&&w.children[0].content&&t.services.interpolator.interpolate(w.children[0].content,c,t.language);if(w.type==="tag"){var C=O[parseInt(w.name,10)];!C&&v.length===1&&v[0][w.name]&&(C=v[0][w.name]),C||(C={});var P=Object.keys(w.attrs).length!==0?on({props:w.attrs},C):C,V=I.default.isValidElement(P),A=V&&Ee(w,!0)&&!w.voidElement,$=o&&F(P)==="object"&&P.dummy&&!V,M=F(a)==="object"&&a!==null&&Object.hasOwnProperty.call(a,w.name);if(typeof P=="string"){var f=t.services.interpolator.interpolate(P,c,t.language);L.push(f)}else if(Ee(P)||A){var g=p(P,w,v);m(P,g,L,E)}else if($){var S=y(O,w.children,v);L.push(I.default.cloneElement(P,_(_({},P.props),{},{key:E}),S))}else if(Number.isNaN(parseFloat(w.name)))if(M){var T=p(P,w,v);m(P,T,L,E,w.voidElement)}else if(e.transSupportBasicHtmlNodes&&i.indexOf(w.name)>-1)if(w.voidElement)L.push(I.default.createElement(w.name,{key:"".concat(w.name,"-").concat(E)}));else{var j=y(O,w.children,v);L.push(I.default.createElement(w.name,{key:"".concat(w.name,"-").concat(E)},j))}else if(w.voidElement)L.push("<".concat(w.name," />"));else{var k=y(O,w.children,v);L.push("<".concat(w.name,">").concat(k,"</").concat(w.name,">"))}else if(F(P)==="object"&&!V){var q=w.children[0]?R:null;q&&L.push(q)}else w.children.length===1&&R?L.push(I.default.cloneElement(P,_(_({},P.props),{},{key:E}),R)):L.push(I.default.cloneElement(P,_(_({},P.props),{},{key:E})))}else if(w.type==="text"){var D=e.transWrapTextNodes,U=t.services.interpolator.interpolate(w.content,c,t.language);D?L.push(I.default.createElement(D,{key:"".concat(w.name,"-").concat(E)},U)):L.push(U)}return L},[])}var d=y([{dummy:!0,children:a||[]}],l,te(a||[]));return je(d[0])}function un(a){var n=a.children,t=a.count,e=a.parent,r=a.i18nKey,i=a.tOptions,o=i===void 0?{}:i,s=a.values,u=a.defaults,l=a.components,c=a.ns,p=a.i18n,m=a.t,y=We(a,rn),d=z.useContext(Ze)||{},b=d.i18n,h=d.defaultNS,v=p||b||tt();if(!v)return pe("You will need to pass in an i18next instance by using i18nextReactModule"),n;var O=m||v.t.bind(v)||function(M){return M},x=_(_({},et()),v.options&&v.options.react),L=c||O.ns||h||v.options&&v.options.defaultNS;L=typeof L=="string"?[L]:L||["translation"];var w=u||it(n,x)||x.transEmptyNodeValue||r,E=x.hashTransKey,R=r||(E?E(w):w),C=s?o.interpolation:{interpolation:_(_({},o.interpolation),{},{prefix:"#$?",suffix:"?$#"})},P=_(_(_(_({},o),{},{count:t},s),C),{},{defaultValue:w,ns:L}),V=R?O(R,P):w,A=sn(l||n,V,v,x,P),$=e!==void 0?e:x.defaultTransParent;return $?I.default.createElement($,y,A):A}function fn(a){if(Array.isArray(a))return a}function ln(a,n){var t=a==null?null:typeof Symbol!="undefined"&&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 ot(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 cn(a,n){if(!!a){if(typeof a=="string")return ot(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 ot(a,n)}}function pn(){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 dn(a,n){return fn(a)||ln(a,n)||cn(a,n)||pn()}function st(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 Re(a){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?st(Object(t),!0).forEach(function(e){ie(a,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):st(Object(t)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(t,e))})}return a}function gn(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=n.i18n,e=z.useContext(Ze)||{},r=e.i18n,i=e.defaultNS,o=t||r||tt();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Yt),!o){pe("You will need to pass in an i18next instance by using initReactI18next");var s=function(R){return Array.isArray(R)?R[R.length-1]:R},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&pe("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=Re(Re(Re({},et()),o.options.react),n),c=l.useSuspense,p=l.keyPrefix,m=a||i||o.options&&o.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(m);var y=(o.isInitialized||o.initializedStoreOnce)&&m.every(function(E){return tn(E,o,l)});function d(){return o.getFixedT(null,l.nsMode==="fallback"?m:m[0],p)}var b=z.useState(d),h=dn(b,2),v=h[0],O=h[1],x=z.useRef(!0);z.useEffect(function(){var E=l.bindI18n,R=l.bindI18nStore;x.current=!0,!y&&!c&&rt(o,m,function(){x.current&&O(d)});function C(){x.current&&O(d)}return E&&o&&o.on(E,C),R&&o&&o.store.on(R,C),function(){x.current=!1,E&&o&&E.split(" ").forEach(function(P){return o.off(P,C)}),R&&o&&R.split(" ").forEach(function(P){return o.store.off(P,C)})}},[o,m.join()]);var L=z.useRef(!0);z.useEffect(function(){x.current&&!L.current&&O(d),L.current=!1},[o]);var w=[v,o,y];if(w.t=v,w.i18n=o,w.ready=y,y||!y&&!c)return w;throw new Promise(function(E){rt(o,m,function(){E()})})}function de(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?de=function(t){return typeof t}:de=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(a)}var ut=[],hn=ut.forEach,vn=ut.slice;function Ce(a){return hn.call(vn.call(arguments,1),function(n){if(n)for(var t in n)a[t]===void 0&&(a[t]=n[t])}),a}function ft(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest=="undefined"?"undefined":de(XMLHttpRequest))==="object"}function mn(a){return!!a&&typeof a.then=="function"}function yn(a){return mn(a)?a:Promise.resolve(a)}var ge={exports:{}},Ae={exports:{}};(function(a,n){var t=typeof self!="undefined"?self:le,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 m(f){return typeof f!="string"&&(f=String(f)),f}function y(f){var g={next:function(){var S=f.shift();return{done:S===void 0,value:S}}};return s.iterable&&(g[Symbol.iterator]=function(){return g}),g}function d(f){this.map={},f instanceof d?f.forEach(function(g,S){this.append(S,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=m(g);var S=this.map[f];this.map[f]=S?S+", "+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)]=m(g)},d.prototype.forEach=function(f,g){for(var S in this.map)this.map.hasOwnProperty(S)&&f.call(g,this.map[S],S,this)},d.prototype.keys=function(){var f=[];return this.forEach(function(g,S){f.push(S)}),y(f)},d.prototype.values=function(){var f=[];return this.forEach(function(g){f.push(g)}),y(f)},d.prototype.entries=function(){var f=[];return this.forEach(function(g,S){f.push([S,g])}),y(f)},s.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function b(f){if(f.bodyUsed)return Promise.reject(new TypeError("Already read"));f.bodyUsed=!0}function h(f){return new Promise(function(g,S){f.onload=function(){g(f.result)},f.onerror=function(){S(f.error)}})}function v(f){var g=new FileReader,S=h(g);return g.readAsArrayBuffer(f),S}function O(f){var g=new FileReader,S=h(g);return g.readAsText(f),S}function x(f){for(var g=new Uint8Array(f),S=new Array(g.length),T=0;T<g.length;T++)S[T]=String.fromCharCode(g[T]);return S.join("")}function L(f){if(f.slice)return f.slice(0);var g=new Uint8Array(f.byteLength);return g.set(new Uint8Array(f)),g.buffer}function w(){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=L(f.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(f)||c(f))?this._bodyArrayBuffer=L(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=b(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?b(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var f=b(this);if(f)return f;if(this._bodyBlob)return O(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(P)}),this.json=function(){return this.text().then(JSON.parse)},this}var E=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function R(f){var g=f.toUpperCase();return E.indexOf(g)>-1?g:f}function C(f,g){g=g||{};var S=g.body;if(f instanceof C){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,!S&&f._bodyInit!=null&&(S=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=R(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")&&S)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(S)}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})};function P(f){var g=new FormData;return f.trim().split("&").forEach(function(S){if(S){var T=S.split("="),j=T.shift().replace(/\+/g," "),k=T.join("=").replace(/\+/g," ");g.append(decodeURIComponent(j),decodeURIComponent(k))}}),g}function V(f){var g=new d,S=f.replace(/\r?\n[\t ]+/g," ");return S.split(/\r?\n/).forEach(function(T){var j=T.split(":"),k=j.shift().trim();if(k){var q=j.join(":").trim();g.append(k,q)}}),g}w.call(C.prototype);function A(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)}w.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},A.error=function(){var f=new A(null,{status:0,statusText:""});return f.type="error",f};var $=[301,302,303,307,308];A.redirect=function(f,g){if($.indexOf(g)===-1)throw new RangeError("Invalid status code");return new A(null,{status:g,headers:{location:f}})},o.DOMException=i.DOMException;try{new o.DOMException}catch{o.DOMException=function(g,S){this.message=g,this.name=S;var T=Error(g);this.stack=T.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function M(f,g){return new Promise(function(S,T){var j=new C(f,g);if(j.signal&&j.signal.aborted)return T(new o.DOMException("Aborted","AbortError"));var k=new XMLHttpRequest;function q(){k.abort()}k.onload=function(){var D={status:k.status,statusText:k.statusText,headers:V(k.getAllResponseHeaders()||"")};D.url="responseURL"in k?k.responseURL:D.headers.get("X-Request-URL");var U="response"in k?k.response:k.responseText;S(new A(U,D))},k.onerror=function(){T(new TypeError("Network request failed"))},k.ontimeout=function(){T(new TypeError("Network request failed"))},k.onabort=function(){T(new o.DOMException("Aborted","AbortError"))},k.open(j.method,j.url,!0),j.credentials==="include"?k.withCredentials=!0:j.credentials==="omit"&&(k.withCredentials=!1),"responseType"in k&&s.blob&&(k.responseType="blob"),j.headers.forEach(function(D,U){k.setRequestHeader(U,D)}),j.signal&&(j.signal.addEventListener("abort",q),k.onreadystatechange=function(){k.readyState===4&&j.signal.removeEventListener("abort",q)}),k.send(typeof j._bodyInit=="undefined"?null:j._bodyInit)})}return M.polyfill=!0,i.fetch||(i.fetch=M,i.Headers=d,i.Request=C,i.Response=A),o.Headers=d,o.Request=C,o.Response=A,o.fetch=M,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})(Ae,Ae.exports);(function(a,n){var t;if(typeof fetch=="function"&&(typeof le!="undefined"&&le.fetch?t=le.fetch:typeof window!="undefined"&&window.fetch&&(t=window.fetch)),typeof $t!="undefined"&&(typeof window=="undefined"||typeof window.document=="undefined")){var e=t||Ae.exports;e.default&&(e=e.default),n.default=e,a.exports=n.default}})(ge,ge.exports);var lt=ge.exports,ct=Object.freeze(xt({__proto__:null,[Symbol.toStringTag]:"Module",default:lt},[ge.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!="undefined"&&global.fetch?X=global.fetch:typeof window!="undefined"&&window.fetch&&(X=window.fetch));var re;ft&&(typeof global!="undefined"&&global.XMLHttpRequest?re=global.XMLHttpRequest:typeof window!="undefined"&&window.XMLHttpRequest&&(re=window.XMLHttpRequest));var he;typeof ActiveXObject=="function"&&(typeof global!="undefined"&&global.ActiveXObject?he=global.ActiveXObject:typeof window!="undefined"&&window.ActiveXObject&&(he=window.ActiveXObject));!X&&ct&&!re&&!he&&(X=lt||ct);typeof X!="function"&&(X=void 0);var Te=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},bn=function(n,t,e,r){n.queryStringParams&&(t=Te(t,n.queryStringParams));var i=Ce({},typeof n.customHeaders=="function"?n.customHeaders():n.customHeaders);e&&(i["Content-Type"]="application/json"),X(t,Ce({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)},wn=function(n,t,e,r){e&&ne(e)==="object"&&(e=Te("",e).slice(1)),n.queryStringParams&&(t=Te(t,n.queryStringParams));try{var i;re?i=new re:i=new he("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)}},Sn=function(n,t,e,r){if(typeof e=="function"&&(r=e,e=void 0),r=r||function(){},X)return bn(n,t,e,r);if(ft||typeof ActiveXObject=="function")return wn(n,t,e,r)};function On(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function pt(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&&pt(a.prototype,n),t&&pt(a,t),a}function kn(a,n,t){return n in a?Object.defineProperty(a,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[n]=t,a}var Ln=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 kn({},e,r||"")},request:Sn,reloadInterval:typeof window!="undefined"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},dt=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]:{};On(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=Ce(r,this.options||{},Ln()),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=yn(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(m){var y=s.options.addPath;typeof s.options.addPath=="function"&&(y=s.options.addPath(m,e));var d=s.services.interpolator.interpolate(y,{lng:m,ns:e});s.options.request(s.options,d,u,function(b,h){l+=1,c.push(b),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 m=i.toResolveHierarchy(p);m.forEach(function(y){u.indexOf(y)<0&&u.push(y)})};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(m,y){m&&o.warn("loading namespace ".concat(p," for language ").concat(c," failed"),m),!m&&y&&o.log("loaded namespace ".concat(p," for language ").concat(c),y),r.loaded("".concat(c,"|").concat(p),m,y)})})})}}}]),a}();dt.type="backend";var gt=[],Pn=gt.forEach,En=gt.slice;function jn(a){return Pn.call(En.call(arguments,1),function(n){if(n)for(var t in n)a[t]===void 0&&(a[t]=n[t])}),a}var ht=/^[\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(!ht.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!ht.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},vt={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)}},Cn={name:"cookie",lookup:function(n){var t;if(n.lookupCookie&&typeof document!="undefined"){var e=vt.read(n.lookupCookie);e&&(t=e)}return t},cacheUserLanguage:function(n,t){t.lookupCookie&&typeof document!="undefined"&&vt.create(t.lookupCookie,n,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},An={name:"querystring",lookup:function(n){var t;if(typeof window!="undefined")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}},ve;try{ve=window!=="undefined"&&window.localStorage!==null;var mt="i18next.translate.boo";window.localStorage.setItem(mt,"foo"),window.localStorage.removeItem(mt)}catch{ve=!1}var Tn={name:"localStorage",lookup:function(n){var t;if(n.lookupLocalStorage&&ve){var e=window.localStorage.getItem(n.lookupLocalStorage);e&&(t=e)}return t},cacheUserLanguage:function(n,t){t.lookupLocalStorage&&ve&&window.localStorage.setItem(t.lookupLocalStorage,n)}},me;try{me=window!=="undefined"&&window.sessionStorage!==null;var yt="i18next.translate.boo";window.sessionStorage.setItem(yt,"foo"),window.sessionStorage.removeItem(yt)}catch{me=!1}var _n={name:"sessionStorage",lookup:function(n){var t;if(n.lookupsessionStorage&&me){var e=window.sessionStorage.getItem(n.lookupsessionStorage);e&&(t=e)}return t},cacheUserLanguage:function(n,t){t.lookupsessionStorage&&me&&window.sessionStorage.setItem(t.lookupsessionStorage,n)}},Nn={name:"navigator",lookup:function(n){var t=[];if(typeof navigator!="undefined"){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}},Dn={name:"htmlTag",lookup:function(n){var t,e=n.htmlTag||(typeof document!="undefined"?document.documentElement:null);return e&&typeof e.getAttribute=="function"&&(t=e.getAttribute("lang")),t}},Fn={name:"path",lookup:function(n){var t;if(typeof window!="undefined"){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}},In={name:"subdomain",lookup:function(n){var t;if(typeof window!="undefined"){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 Un(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var bt=function(){function a(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};B(this,a),this.type="languageDetector",this.detectors={},this.init(n,t)}return H(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=jn(e,this.options||{},Un()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Cn),this.addDetector(An),this.addDetector(Tn),this.addDetector(_n),this.addDetector(Nn),this.addDetector(Dn),this.addDetector(Fn),this.addDetector(In)}},{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}();bt.type="languageDetector";function Bn(r){var i=r,{detectorConfig:a,translationPath:n,customDetectors:t}=i,e=Oe(i,["detectorConfig","translationPath","customDetectors"]);const o=new bt,s={name:"hashRouterQuerystringDetector",lookup:p=>{try{const m=p&&p.lookupQuerystring||"lang",d=new RegExp(`[?&]${m}(=([^&#]*)|&|#|$)`).exec(window.location.href);if(d&&d[2]){const b=decodeURIComponent(d[2].replace(/\+/g," "));if(b)return b}}catch(m){console.error(m)}}};o.addDetector(s),Array.isArray(t)&&t.forEach(p=>{o.addDetector(p)});const c=Se({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 qt.use(dt).use(o).use(en).init(c)}function Hn(t){var e=t,{children:a}=e,n=Oe(e,["children"]);return kt.createElement(un,Se({},n),a)}function Mn(a="translation",n){return gn([a,"design-system"],n)}exports.SpsLanguage=Hn;exports.localize=Bn;exports.useSpsLanguage=Mn;
|
|
1
|
+
"use strict";var wt=Object.defineProperty;var ie=Object.getOwnPropertySymbols;var De=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable;var Ie=(r,n,t)=>n in r?wt(r,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[n]=t,Se=(r,n)=>{for(var t in n||(n={}))De.call(n,t)&&Ie(r,t,n[t]);if(ie)for(var t of ie(n))Fe.call(n,t)&&Ie(r,t,n[t]);return r};var Oe=(r,n)=>{var t={};for(var e in r)De.call(r,e)&&n.indexOf(e)<0&&(t[e]=r[e]);if(r!=null&&ie)for(var e of ie(r))n.indexOf(e)<0&&Fe.call(r,e)&&(t[e]=r[e]);return t};Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var $=require("react");function St(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}function Ot(r){if(r&&r.__esModule)return r;var n={__proto__:null,[Symbol.toStringTag]:"Module"};return r&&Object.keys(r).forEach(function(t){if(t!=="default"){var e=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(n,t,e.get?e:{enumerable:!0,get:function(){return r[t]}})}}),n.default=r,Object.freeze(n)}function xt(r,n){return n.forEach(function(t){Object.keys(t).forEach(function(e){if(e!=="default"&&!(e in r)){var a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:function(){return t[e]}})}})}),Object.freeze(r)}var U=St($),kt=Ot($);function I(r){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(r)}function oe(r,n,t){return n in r?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,r}function D(r){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(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),e.forEach(function(a){oe(r,a,t[a])})}return r}function M(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function Ue(r,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(r,e.key,e)}}function q(r,n,t){return n&&Ue(r.prototype,n),t&&Ue(r,t),r}function J(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ee(r,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(r)}function Y(r){return Y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Y(r)}function xe(r,n){return xe=Object.setPrototypeOf||function(e,a){return e.__proto__=a,e},xe(r,n)}function se(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),n&&xe(r,n)}var Lt={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)}},Pt=function(){function r(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,r),this.init(n,t)}return q(r,[{key:"init",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||Lt,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),a=0;a<t;a++)e[a]=arguments[a];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,e,a,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]="".concat(a).concat(this.prefix," ").concat(t[0])),this.logger[e](t))}},{key:"create",value:function(t){return new r(this.logger,D({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),r}(),z=new Pt,W=function(){function r(){M(this,r),this.observers={}}return q(r,[{key:"on",value:function(t,e){var a=this;return t.split(" ").forEach(function(i){a.observers[i]=a.observers[i]||[],a.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(a){return a!==e})}}},{key:"emit",value:function(t){for(var e=arguments.length,a=new Array(e>1?e-1:0),i=1;i<e;i++)a[i-1]=arguments[i];if(this.observers[t]){var o=[].concat(this.observers[t]);o.forEach(function(u){u.apply(void 0,a)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[t].concat(a))})}}}]),r}();function te(){var r,n,t=new Promise(function(e,a){r=e,n=a});return t.resolve=r,t.reject=n,t}function Be(r){return r==null?"":""+r}function Et(r,n,t){r.forEach(function(e){n[e]&&(t[e]=n[e])})}function ke(r,n,t){function e(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function a(){return!r||typeof r=="string"}for(var i=typeof n!="string"?[].concat(n):n.split(".");i.length>1;){if(a())return{};var o=e(i.shift());!r[o]&&t&&(r[o]=new t),Object.prototype.hasOwnProperty.call(r,o)?r=r[o]:r={}}return a()?{}:{obj:r,k:e(i.shift())}}function He(r,n,t){var e=ke(r,n,Object),a=e.obj,i=e.k;a[i]=t}function jt(r,n,t,e){var a=ke(r,n,Object),i=a.obj,o=a.k;i[o]=i[o]||[],e&&(i[o]=i[o].concat(t)),e||i[o].push(t)}function ue(r,n){var t=ke(r,n),e=t.obj,a=t.k;if(!!e)return e[a]}function Me(r,n,t){var e=ue(r,t);return e!==void 0?e:ue(n,t)}function qe(r,n,t){for(var e in n)e!=="__proto__"&&e!=="constructor"&&(e in r?typeof r[e]=="string"||r[e]instanceof String||typeof n[e]=="string"||n[e]instanceof String?t&&(r[e]=n[e]):qe(r[e],n[e],t):r[e]=n[e]);return r}function Z(r){return r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Rt={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Ct(r){return typeof r=="string"?r.replace(/[&<>"'\/]/g,function(n){return Rt[n]}):r}var fe=typeof window!="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Tt=function(r){se(n,r);function n(t){var e,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return M(this,n),e=ee(this,Y(n).call(this)),fe&&W.call(J(e)),e.data=t||{},e.options=a,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 a=this.options.ns.indexOf(e);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(e,a,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=[e,a];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(".")),ue(this.data,u)}},{key:"addResource",value:function(e,a,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,a];i&&(l=l.concat(u?i.split(u):i)),e.indexOf(".")>-1&&(l=e.split("."),o=a,a=l[1]),this.addNamespaces(a),He(this.data,l,o),s.silent||this.emit("added",e,a,i,o)}},{key:"addResources",value:function(e,a,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,a,s,i[s],{silent:!0});o.silent||this.emit("added",e,a,i)}},{key:"addResourceBundle",value:function(e,a,i,o,s){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},l=[e,a];e.indexOf(".")>-1&&(l=e.split("."),o=i,i=a,a=l[1]),this.addNamespaces(a);var c=ue(this.data,l)||{};o?qe(c,i,s):c=D({},c,i),He(this.data,l,c),u.silent||this.emit("added",e,a,i)}},{key:"removeResourceBundle",value:function(e,a){this.hasResourceBundle(e,a)&&delete this.data[e][a],this.removeNamespaces(a),this.emit("removed",e,a)}},{key:"hasResourceBundle",value:function(e,a){return this.getResource(e,a)!==void 0}},{key:"getResourceBundle",value:function(e,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?D({},{},this.getResource(e,a)):this.getResource(e,a)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),n}(W),Ve={processors:{},addPostProcessor:function(n){this.processors[n.name]=n},handle:function(n,t,e,a,i){var o=this;return n.forEach(function(s){o.processors[s]&&(t=o.processors[s].process(t,e,a,i))}),t}},$e={},ze=function(r){se(n,r);function n(t){var e,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return M(this,n),e=ee(this,Y(n).call(this)),fe&&W.call(J(e)),Et(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,J(e)),e.options=a,e.options.keySeparator===void 0&&(e.options.keySeparator="."),e.logger=z.create("translator"),e}return q(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=this.resolve(e,a);return i&&i.res!==void 0}},{key:"extractFromKey",value:function(e,a){var i=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");var o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,s=a.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,a,i){var o=this;if(I(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),a||(a={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);var s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],a),l=u.key,c=u.namespaces,p=c[c.length-1],v=a.lng||this.language,m=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v&&v.toLowerCase()==="cimode"){if(m){var d=a.nsSeparator||this.options.nsSeparator;return p+d+l}return l}var y=this.resolve(e,a),h=y&&y.res,b=y&&y.usedKey||l,S=y&&y.exactUsedKey||l,O=Object.prototype.toString.apply(h),j=["[object Number]","[object Function]","[object RegExp]"],k=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,P=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(w&&h&&P&&j.indexOf(O)<0&&!(typeof k=="string"&&O==="[object Array]")){if(!a.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,a):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(s){var T=O==="[object Array]",N=T?[]:{},C=T?S:b;for(var R in h)if(Object.prototype.hasOwnProperty.call(h,R)){var K="".concat(C).concat(s).concat(R);N[R]=this.translate(K,D({},a,{joinArrays:!1,ns:c})),N[R]===K&&(N[R]=h[R])}h=N}}else if(w&&typeof k=="string"&&O==="[object Array]")h=h.join(k),h&&(h=this.extendTranslation(h,e,a,i));else{var B=!1,f=!1,g=a.count!==void 0&&typeof a.count!="string",x=n.hasDefaultValue(a),A=g?this.pluralResolver.getSuffix(v,a.count):"",E=a["defaultValue".concat(A)]||a.defaultValue;!this.isValidLookup(h)&&x&&(B=!0,h=E),this.isValidLookup(h)||(f=!0,h=l);var L=x&&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({},a,{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,a.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(a.lng||this.language):F.push(a.lng||this.language);var Ae=function(G,we,_e){o.options.missingKeyHandler?o.options.missingKeyHandler(G,p,we,L?_e:h,L,a):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(G,p,we,L?_e:h,L,a),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){Ae([be],l+G,a["defaultValue".concat(G)]||E)})}):Ae(F,l,E))}h=this.extendTranslation(h,e,a,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,a,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),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(a[0])),null):u.translate.apply(u,S.concat([a]))},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=Ve.handle(h,e,a,this.options&&this.options.postProcessPassResolved?D({i18nResolved:o},i):i,this)),e}},{key:"resolve",value:function(e){var a=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(!a.isValidLookup(o)){var v=a.extractFromKey(p,i),m=v.key;s=m;var d=v.namespaces;a.options.fallbackNS&&(d=d.concat(a.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:a.languageUtils.toResolveHierarchy(i.lng||a.language,i.fallbackLng);d.forEach(function(S){a.isValidLookup(o)||(c=S,!$e["".concat(b[0],"-").concat(S)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(c)&&($e["".concat(b[0],"-").concat(S)]=!0,a.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(!a.isValidLookup(o)){l=O;var j=m,k=[j];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(k,m,O,S,i);else{var w;y&&(w=a.pluralResolver.getSuffix(O,i.count)),y&&h&&k.push(j+w),h&&k.push(j+="".concat(a.options.contextSeparator).concat(i.context)),y&&k.push(j+=w)}for(var P;P=k.pop();)a.isValidLookup(o)||(u=P,o=a.getResource(O,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,a,i){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,a,i,o):this.resourceStore.getResource(e,a,i,o)}}],[{key:"hasDefaultValue",value:function(e){var a="defaultValue";for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&a===i.substring(0,a.length)&&e[i]!==void 0)return!0;return!1}}]),n}(W);function Le(r){return r.charAt(0).toUpperCase()+r.slice(1)}var Nt=function(){function r(n){M(this,r),this.options=n,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=z.create("languageUtils")}return q(r,[{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"],a=t.split("-");return this.options.lowerCaseLng?a=a.map(function(i){return i.toLowerCase()}):a.length===2?(a[0]=a[0].toLowerCase(),a[1]=a[1].toUpperCase(),e.indexOf(a[1].toLowerCase())>-1&&(a[1]=Le(a[1].toLowerCase()))):a.length===3&&(a[0]=a[0].toLowerCase(),a[1].length===2&&(a[1]=a[1].toUpperCase()),a[0]!=="sgn"&&a[2].length===2&&(a[2]=a[2].toUpperCase()),e.indexOf(a[1].toLowerCase())>-1&&(a[1]=Le(a[1].toLowerCase())),e.indexOf(a[2].toLowerCase())>-1&&(a[2]=Le(a[2].toLowerCase()))),a.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 a;return t.forEach(function(i){if(!a){var o=e.formatLanguageCode(i);(!e.options.supportedLngs||e.isSupportedCode(o))&&(a=o)}}),!a&&this.options.supportedLngs&&t.forEach(function(i){if(!a){var o=e.getLanguagePartFromCode(i);if(e.isSupportedCode(o))return a=o;a=e.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}},{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 a=t[e];return a||(a=t[this.getScriptPartFromCode(e)]),a||(a=t[this.formatLanguageCode(e)]),a||(a=t[this.getLanguagePartFromCode(e)]),a||(a=t.default),a||[]}},{key:"toResolveHierarchy",value:function(t,e){var a=this,i=this.getFallbackCodes(e||this.options.fallbackLng||[],t),o=[],s=function(l){!l||(a.isSupportedCode(l)?o.push(l):a.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(a.formatLanguageCode(u))}),o}}]),r}(),At=[{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}],_t={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 Dt(){var r={};return At.forEach(function(n){n.lngs.forEach(function(t){r[t]={numbers:n.nr,plurals:_t[n.fc]}})}),r}var Ft=function(){function r(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,r),this.languageUtils=n,this.options=t,this.logger=z.create("pluralResolver"),this.rules=Dt()}return q(r,[{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(a){return e+a})}},{key:"getSuffixes",value:function(t){var e=this,a=this.getRule(t);return a?a.numbers.map(function(i){return e.getSuffix(t,i)}):[]}},{key:"getSuffix",value:function(t,e){var a=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 a.options.prepend&&s.toString()?a.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)),""}}]),r}(),It=function(){function r(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};M(this,r),this.logger=z.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(t){return t},this.init(n)}return q(r,[{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:Ct,this.escapeValue=e.escapeValue!==void 0?e.escapeValue:!0,this.useRawValueToEscape=e.useRawValueToEscape!==void 0?e.useRawValueToEscape:!1,this.prefix=e.prefix?Z(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?Z(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?Z(e.nestingPrefix):e.nestingPrefixEscaped||Z("$t("),this.nestingSuffix=e.nestingSuffix?Z(e.nestingSuffix):e.nestingSuffixEscaped||Z(")"),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 a="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(a,"g")}},{key:"interpolate",value:function(t,e,a,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=Me(e,c,b);return o.alwaysFormat?o.format(S,void 0,a):S}var O=b.split(o.formatSeparator),j=O.shift().trim(),k=O.join(o.formatSeparator).trim();return o.format(Me(e,c,j),k,a,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=Be(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 a=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=Be(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(t)),s=""),p&&(s=c.reduce(function(m,d){return a.format(m,d,i.lng,i)},s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}]),r}();function Ut(r,n){for(var t=r.indexOf(n);t!==-1;)r.splice(t,1),t=r.indexOf(n)}var Bt=function(r){se(n,r);function n(t,e,a){var i,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return M(this,n),i=ee(this,Y(n).call(this)),fe&&W.call(J(i)),i.backend=t,i.store=e,i.services=a,i.languageUtils=a.languageUtils,i.options=o,i.logger=z.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(a,o.backend,o),i}return q(n,[{key:"queueLoad",value:function(e,a,i,o){var s=this,u=[],l=[],c=[],p=[];return e.forEach(function(v){var m=!0;a.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,a,i){var o=e.split("|"),s=o[0],u=o[1];a&&this.emit("failedLoading",s,u,a),i&&this.store.addResourceBundle(s,u,i),this.state[e]=a?-1:2;var l={};this.queue.forEach(function(c){jt(c.loaded,[s],u),Ut(c.pending,e),a&&c.errors.push(a),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,a,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,a,function(c,p){if(c&&p&&s<5){setTimeout(function(){o.read.call(o,e,a,i,s+1,u*2,l)},u);return}l(c,p)}):l(null,{})}},{key:"prepareLoading",value:function(e,a){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 a=="string"&&(a=[a]);var u=this.queueLoad(e,a,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,a,i){this.prepareLoading(e,a,{},i)}},{key:"reload",value:function(e,a,i){this.prepareLoading(e,a,{reload:!0},i)}},{key:"loadOne",value:function(e){var a=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&&a.logger.warn("".concat(i,"loading namespace ").concat(u," for language ").concat(s," failed"),l),!l&&c&&a.logger.log("".concat(i,"loaded namespace ").concat(u," for language ").concat(s),c),a.loaded(e,l,c)})}},{key:"saveMissing",value:function(e,a,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(a)){this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(a,'" 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,a,i,o,null,D({},u,{isUpdate:s})),!(!e||!e[0])&&this.store.addResource(e[0],a,i,o))}}]),n}(W);function Ht(){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(a){t[a]=e[a]})}return t},interpolation:{escapeValue:!0,format:function(n,t,e,a){return n},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function Ke(r){return typeof r.ns=="string"&&(r.ns=[r.ns]),typeof r.fallbackLng=="string"&&(r.fallbackLng=[r.fallbackLng]),typeof r.fallbackNS=="string"&&(r.fallbackNS=[r.fallbackNS]),r.whitelist&&(r.whitelist&&r.whitelist.indexOf("cimode")<0&&(r.whitelist=r.whitelist.concat(["cimode"])),r.supportedLngs=r.whitelist),r.nonExplicitWhitelist&&(r.nonExplicitSupportedLngs=r.nonExplicitWhitelist),r.supportedLngs&&r.supportedLngs.indexOf("cimode")<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),r}function le(){}var Mt=function(r){se(n,r);function n(){var t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(M(this,n),t=ee(this,Y(n).call(this)),fe&&W.call(J(t)),t.options=Ke(e),t.services={},t.logger=z,t.modules={external:[]},a&&!t.isInitialized&&!e.isClone){if(!t.options.initImmediate)return t.init(e,a),ee(t,J(t));setTimeout(function(){t.init(e,a)},0)}return t}return q(n,[{key:"init",value:function(){var e=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(i=a,a={}),a.whitelist&&!a.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),a.nonExplicitWhitelist&&!a.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({},Ht(),this.options,Ke(a)),this.format=this.options.interpolation.format,i||(i=le);function o(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?z.init(o(this.modules.logger),this.options):z.init(null,this.options);var s=new Nt(this.options);this.store=new Tt(this.options.resources,this.options);var u=this.services;u.logger=z,u.resourceStore=this.store,u.languageUtils=s,u.pluralResolver=new Ft(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u.interpolator=new It(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Bt(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 ze(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=te(),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 a=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:le,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=a.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,a,i){var o=te();return e||(e=this.languages),a||(a=this.options.ns),i||(i=le),this.services.backendConnector.reload(e,a,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"&&Ve.addPostProcessor(e),e.type==="3rdParty"&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,a){var i=this;this.isLanguageChangingTo=e;var o=te();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)}),a&&a(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,a){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=a,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 a=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=a.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,a){var i=this,o=te();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(),a&&a(s)}),o):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(e,a){var i=te();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(),a&&a(u)}),i):(a&&a(),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 a=["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 a.indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;return new n(e,a)}},{key:"cloneInstance",value:function(){var e=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:le,o=D({},this.options,a,{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 ze(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),qt=new Mt;function Vt(r,n){if(r==null)return{};var t={},e=Object.keys(r),a,i;for(i=0;i<e.length;i++)a=e[i],!(n.indexOf(a)>=0)&&(t[a]=r[a]);return t}function We(r,n){if(r==null)return{};var t=Vt(r,n),e,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)e=i[a],!(n.indexOf(e)>=0)&&(!Object.prototype.propertyIsEnumerable.call(r,e)||(t[e]=r[e]))}return t}var ce=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function $t(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zt={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},Kt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Xe(r){var n={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},t=r.match(/<\/?([^\s]+?)[/\s>]/);if(t&&(n.name=t[1],(zt[t[1]]||r.charAt(r.length-2)==="/")&&(n.voidElement=!0),n.name.startsWith("!--"))){var e=r.indexOf("-->");return{type:"comment",comment:e!==-1?r.slice(4,e):""}}for(var a=new RegExp(Kt),i=null;(i=a.exec(r))!==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],a.lastIndex--}else i[2]&&(n.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return n}var Wt=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Xt=/^\s*$/,Jt=Object.create(null);function Je(r,n){switch(n.type){case"text":return r+n.content;case"tag":return r+="<"+n.name+(n.attrs?function(t){var e=[];for(var a in t)e.push(a+'="'+t[a]+'"');return e.length?" "+e.join(" "):""}(n.attrs):"")+(n.voidElement?"/>":">"),n.voidElement?r:r+n.children.reduce(Je,"")+"</"+n.name+">";case"comment":return r+"<!--"+n.comment+"-->"}}var Qt={parse:function(r,n){n||(n={}),n.components||(n.components=Jt);var t,e=[],a=[],i=-1,o=!1;if(r.indexOf("<")!==0){var s=r.indexOf("<");e.push({type:"text",content:s===-1?r:r.substring(0,s)})}return r.replace(Wt,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=r.charAt(m);if(v){var y=Xe(u);return i<0?(e.push(y),e):((c=a[i]).children.push(y),e)}if(p&&(i++,(t=Xe(u)).type==="tag"&&n.components[t.name]&&(t.type="component",o=!0),t.voidElement||o||!d||d==="<"||t.children.push({type:"text",content:r.slice(m,r.indexOf("<",m))}),i===0&&e.push(t),(c=a[i-1])&&c.children.push(t),a[i]=t),(!p||t.voidElement)&&(i>-1&&(t.voidElement||t.name===u.slice(2,-1))&&(i--,t=i===-1?e:a[i]),!o&&d!=="<"&&d)){c=i===-1?e:a[i].children;var h=r.indexOf("<",m),b=r.slice(m,h===-1?void 0:h);Xt.test(b)&&(b=" "),(h>-1&&i+c.length>=0||b!==" ")&&c.push({type:"text",content:b})}}),e},stringify:function(r){return r.reduce(function(n,t){return n+Je("",t)},"")}},Gt="".replace,Yt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g,Zt={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'};function en(r){return Gt.call(r,Yt,tn)}function tn(r){return Zt[r]}function Qe(r,n){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,e)}return t}function Ge(r){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Qe(Object(t),!0).forEach(function(e){oe(r,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Qe(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}return r}var Pe={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},Ye,Ze=U.default.createContext();function nn(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pe=Ge(Ge({},Pe),r)}function et(){return Pe}var rn=function(){function r(){M(this,r),this.usedNamespaces={}}return q(r,[{key:"addUsedNamespaces",value:function(t){var e=this;t.forEach(function(a){e.usedNamespaces[a]||(e.usedNamespaces[a]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),r}();function an(r){Ye=r}function tt(){return Ye}var on={type:"3rdParty",init:function(n){nn(n.options.react),an(n)}};function pe(){if(console&&console.warn){for(var r,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])),(r=console).warn.apply(r,t)}}var nt={};function de(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];typeof n[0]=="string"&&nt[n[0]]||(typeof n[0]=="string"&&(nt[n[0]]=new Date),pe.apply(void 0,n))}function rt(r,n,t){r.loadNamespaces(n,function(){if(r.isInitialized)t();else{var e=function a(){setTimeout(function(){r.off("initialized",a)},0),t()};r.on("initialized",e)}})}function sn(r,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},e=n.languages[0],a=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,r)?!1:!!(n.hasResourceBundle(e,r)||!n.services.backendConnector.backend||n.options.resources&&!n.options.partialBundledLanguages||o(e,r)&&(!a||o(i,r)))}function un(r,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!n.languages||!n.languages.length)return de("i18n.languages were undefined or empty",n.languages),!0;var e=n.options.ignoreJSONStructure!==void 0;return e?n.hasLoadedNamespace(r,{precheck:function(i,o){if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,r))return!1}}):sn(r,n,t)}var fn=["format"],ln=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function at(r,n){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,e)}return t}function _(r){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?at(Object(t),!0).forEach(function(e){oe(r,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):at(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}return r}function Ee(r,n){if(!r)return!1;var t=r.props?r.props.children:r.children;return n?t.length>0:!!t}function je(r){return r?r&&r.children?r.children:r.props&&r.props.children:[]}function cn(r){return Object.prototype.toString.call(r)!=="[object Array]"?!1:r.every(function(n){return U.default.isValidElement(n)})}function ne(r){return Array.isArray(r)?r:[r]}function pn(r,n){var t=_({},n);return t.props=Object.assign(r.props,n.props),t}function it(r,n){if(!r)return"";var t="",e=ne(r),a=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=a.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=it(l,n);t+="<".concat(o,">").concat(c,"</").concat(o,">")}}else if(i===null)pe("Trans: the passed in value is invalid - seems you passed in a null child.");else if(I(i)==="object"){var p=i.format,v=We(i,fn),m=Object.keys(v);if(m.length===1){var d=p?"".concat(m[0],", ").concat(p):m[0];t+="{{".concat(d,"}}")}else pe("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",i)}else pe("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 dn(r,n,t,e,a,i){if(n==="")return[];var o=e.transKeepBasicHtmlNodesFor||[],s=n&&new RegExp(o.join("|")).test(n);if(!r&&!s)return[n];var u={};function l(h){var b=ne(h);b.forEach(function(S){typeof S!="string"&&(Ee(S)?l(je(S)):I(S)==="object"&&!U.default.isValidElement(S)&&Object.assign(u,S))})}l(r);var c=Qt.parse("<0>".concat(n,"</0>")),p=_(_({},u),a);function v(h,b,S){var O=je(h),j=d(O,b.children,S);return cn(O)&&j.length===0?O:j}function m(h,b,S,O,j){h.dummy&&(h.children=b),S.push(U.default.cloneElement(h,_(_({},h.props),{},{key:O}),j?void 0:b))}function d(h,b,S){var O=ne(h),j=ne(b);return j.reduce(function(k,w,P){var T=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 N=O[parseInt(w.name,10)];!N&&S.length===1&&S[0][w.name]&&(N=S[0][w.name]),N||(N={});var C=Object.keys(w.attrs).length!==0?pn({props:w.attrs},N):N,R=U.default.isValidElement(C),K=R&&Ee(w,!0)&&!w.voidElement,B=s&&I(C)==="object"&&C.dummy&&!R,f=I(r)==="object"&&r!==null&&Object.hasOwnProperty.call(r,w.name);if(typeof C=="string"){var g=t.services.interpolator.interpolate(C,p,t.language);k.push(g)}else if(Ee(C)||K){var x=v(C,w,S);m(C,x,k,P)}else if(B){var A=d(O,w.children,S);k.push(U.default.cloneElement(C,_(_({},C.props),{},{key:P}),A))}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(O,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(O,w.children,S);k.push("<".concat(w.name,">").concat(V,"</").concat(w.name,">"))}else if(I(C)==="object"&&!R){var F=w.children[0]?T:null;F&&k.push(F)}else w.children.length===1&&T?k.push(U.default.cloneElement(C,_(_({},C.props),{},{key:P}),T)):k.push(U.default.cloneElement(C,_(_({},C.props),{},{key:P})))}else if(w.type==="text"){var H=e.transWrapTextNodes,Q=i?en(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:r||[]}],c,ne(r||[]));return je(y[0])}function gn(r){var n=r.children,t=r.count,e=r.parent,a=r.i18nKey,i=r.context,o=r.tOptions,s=o===void 0?{}:o,u=r.values,l=r.defaults,c=r.components,p=r.ns,v=r.i18n,m=r.t,d=r.shouldUnescape,y=We(r,ln),h=$.useContext(Ze)||{},b=h.i18n,S=h.defaultNS,O=v||b||tt();if(!O)return de("You will need to pass in an i18next instance by using i18nextReactModule"),n;var j=m||O.t.bind(O)||function(g){return g};i&&(s.context=i);var k=_(_({},et()),O.options&&O.options.react),w=p||j.ns||S||O.options&&O.options.defaultNS;w=typeof w=="string"?[w]:w||["translation"];var P=l||it(n,k)||k.transEmptyNodeValue||a,T=k.hashTransKey,N=a||(T?T(P):P),C=u?s.interpolation:{interpolation:_(_({},s.interpolation),{},{prefix:"#$?",suffix:"?$#"})},R=_(_(_(_({},s),{},{count:t},u),C),{},{defaultValue:P,ns:w}),K=N?j(N,R):P,B=dn(c||n,K,O,k,R,d),f=e!==void 0?e:k.defaultTransParent;return f?U.default.createElement(f,y,B):B}function hn(r){if(Array.isArray(r))return r}function vn(r,n){var t=r==null?null:typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var e=[],a=!0,i=!1,o,s;try{for(t=t.call(r);!(a=(o=t.next()).done)&&(e.push(o.value),!(n&&e.length===n));a=!0);}catch(u){i=!0,s=u}finally{try{!a&&t.return!=null&&t.return()}finally{if(i)throw s}}return e}}function ot(r,n){(n==null||n>r.length)&&(n=r.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=r[t];return e}function mn(r,n){if(!!r){if(typeof r=="string")return ot(r,n);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ot(r,n)}}function yn(){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 bn(r,n){return hn(r)||vn(r,n)||mn(r,n)||yn()}function st(r,n){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),t.push.apply(t,e)}return t}function Re(r){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?st(Object(t),!0).forEach(function(e){oe(r,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):st(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))})}return r}function wn(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=n.i18n,e=$.useContext(Ze)||{},a=e.i18n,i=e.defaultNS,o=t||a||tt();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new rn),!o){de("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&&de("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=Re(Re(Re({},et()),o.options.react),n),c=l.useSuspense,p=l.keyPrefix,v=r||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 un(w,o,l)});function d(){return o.getFixedT(null,l.nsMode==="fallback"?v:v[0],p)}var y=$.useState(d),h=bn(y,2),b=h[0],S=h[1],O=$.useRef(!0);$.useEffect(function(){var w=l.bindI18n,P=l.bindI18nStore;O.current=!0,!m&&!c&&rt(o,v,function(){O.current&&S(d)});function T(){O.current&&S(d)}return w&&o&&o.on(w,T),P&&o&&o.store.on(P,T),function(){O.current=!1,w&&o&&w.split(" ").forEach(function(N){return o.off(N,T)}),P&&o&&P.split(" ").forEach(function(N){return o.store.off(N,T)})}},[o,v.join()]);var j=$.useRef(!0);$.useEffect(function(){O.current&&!j.current&&S(d),j.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){rt(o,v,function(){w()})})}function ge(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ge=function(t){return typeof t}:ge=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(r)}var ut=[],Sn=ut.forEach,On=ut.slice;function Ce(r){return Sn.call(On.call(arguments,1),function(n){if(n)for(var t in n)r[t]===void 0&&(r[t]=n[t])}),r}function ft(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest=="undefined"?"undefined":ge(XMLHttpRequest))==="object"}function xn(r){return!!r&&typeof r.then=="function"}function kn(r){return xn(r)?r:Promise.resolve(r)}var he={exports:{}},Te={exports:{}};(function(r,n){var t=typeof self!="undefined"?self:ce,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 x=f.shift();return{done:x===void 0,value:x}}};return s.iterable&&(g[Symbol.iterator]=function(){return g}),g}function d(f){this.map={},f instanceof d?f.forEach(function(g,x){this.append(x,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 x=this.map[f];this.map[f]=x?x+", "+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 x in this.map)this.map.hasOwnProperty(x)&&f.call(g,this.map[x],x,this)},d.prototype.keys=function(){var f=[];return this.forEach(function(g,x){f.push(x)}),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,x){f.push([x,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,x){f.onload=function(){g(f.result)},f.onerror=function(){x(f.error)}})}function b(f){var g=new FileReader,x=h(g);return g.readAsArrayBuffer(f),x}function S(f){var g=new FileReader,x=h(g);return g.readAsText(f),x}function O(f){for(var g=new Uint8Array(f),x=new Array(g.length),A=0;A<g.length;A++)x[A]=String.fromCharCode(g[A]);return x.join("")}function j(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=j(f.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(f)||c(f))?this._bodyArrayBuffer=j(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(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(N)}),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 T(f,g){g=g||{};var x=g.body;if(f instanceof T){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,!x&&f._bodyInit!=null&&(x=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")&&x)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(x)}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})};function N(f){var g=new FormData;return f.trim().split("&").forEach(function(x){if(x){var A=x.split("="),E=A.shift().replace(/\+/g," "),L=A.join("=").replace(/\+/g," ");g.append(decodeURIComponent(E),decodeURIComponent(L))}}),g}function C(f){var g=new d,x=f.replace(/\r?\n[\t ]+/g," ");return x.split(/\r?\n/).forEach(function(A){var E=A.split(":"),L=E.shift().trim();if(L){var V=E.join(":").trim();g.append(L,V)}}),g}k.call(T.prototype);function R(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(R.prototype),R.prototype.clone=function(){return new R(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},R.error=function(){var f=new R(null,{status:0,statusText:""});return f.type="error",f};var K=[301,302,303,307,308];R.redirect=function(f,g){if(K.indexOf(g)===-1)throw new RangeError("Invalid status code");return new R(null,{status:g,headers:{location:f}})},o.DOMException=i.DOMException;try{new o.DOMException}catch{o.DOMException=function(g,x){this.message=g,this.name=x;var A=Error(g);this.stack=A.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function B(f,g){return new Promise(function(x,A){var E=new T(f,g);if(E.signal&&E.signal.aborted)return A(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;x(new R(H,F))},L.onerror=function(){A(new TypeError("Network request failed"))},L.ontimeout=function(){A(new TypeError("Network request failed"))},L.onabort=function(){A(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=="undefined"?null:E._bodyInit)})}return B.polyfill=!0,i.fetch||(i.fetch=B,i.Headers=d,i.Request=T,i.Response=R),o.Headers=d,o.Request=T,o.Response=R,o.fetch=B,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(e),e.fetch.ponyfill=!0,delete e.fetch.polyfill;var a=e;n=a.fetch,n.default=a.fetch,n.fetch=a.fetch,n.Headers=a.Headers,n.Request=a.Request,n.Response=a.Response,r.exports=n})(Te,Te.exports);(function(r,n){var t;if(typeof fetch=="function"&&(typeof ce!="undefined"&&ce.fetch?t=ce.fetch:typeof window!="undefined"&&window.fetch&&(t=window.fetch)),typeof $t!="undefined"&&(typeof window=="undefined"||typeof window.document=="undefined")){var e=t||Te.exports;e.default&&(e=e.default),n.default=e,r.exports=n.default}})(he,he.exports);var lt=he.exports,ct=Object.freeze(xt({__proto__:null,[Symbol.toStringTag]:"Module",default:lt},[he.exports]));function re(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?re=function(t){return typeof t}:re=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},re(r)}var X;typeof fetch=="function"&&(typeof global!="undefined"&&global.fetch?X=global.fetch:typeof window!="undefined"&&window.fetch&&(X=window.fetch));var ae;ft&&(typeof global!="undefined"&&global.XMLHttpRequest?ae=global.XMLHttpRequest:typeof window!="undefined"&&window.XMLHttpRequest&&(ae=window.XMLHttpRequest));var ve;typeof ActiveXObject=="function"&&(typeof global!="undefined"&&global.ActiveXObject?ve=global.ActiveXObject:typeof window!="undefined"&&window.ActiveXObject&&(ve=window.ActiveXObject));!X&&ct&&!ae&&!ve&&(X=lt||ct);typeof X!="function"&&(X=void 0);var Ne=function(n,t){if(t&&re(t)==="object"){var e="";for(var a in t)e+="&"+encodeURIComponent(a)+"="+encodeURIComponent(t[a]);if(!e)return n;n=n+(n.indexOf("?")!==-1?"&":"?")+e.slice(1)}return n},Ln=function(n,t,e,a){n.queryStringParams&&(t=Ne(t,n.queryStringParams));var i=Ce({},typeof n.customHeaders=="function"?n.customHeaders():n.customHeaders);e&&(i["Content-Type"]="application/json"),X(t,Ce({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 a(o.statusText||"Error",{status:o.status});o.text().then(function(s){a(null,{status:o.status,data:s})}).catch(a)}).catch(a)},Pn=function(n,t,e,a){e&&re(e)==="object"&&(e=Ne("",e).slice(1)),n.queryStringParams&&(t=Ne(t,n.queryStringParams));try{var i;ae?i=new ae:i=new ve("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&&a(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(e)}catch(u){console&&console.log(u)}},En=function(n,t,e,a){if(typeof e=="function"&&(a=e,e=void 0),a=a||function(){},X)return Ln(n,t,e,a);if(ft||typeof ActiveXObject=="function")return Pn(n,t,e,a)};function jn(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function pt(r,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(r,e.key,e)}}function Rn(r,n,t){return n&&pt(r.prototype,n),t&&pt(r,t),r}function Cn(r,n,t){return n in r?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,r}var Tn=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,a){return Cn({},e,a||"")},request:En,reloadInterval:typeof window!="undefined"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},dt=function(){function r(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};jn(this,r),this.services=n,this.options=t,this.allOptions=e,this.type="backend",this.init(n,t,e)}return Rn(r,[{key:"init",value:function(t){var e=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=Ce(a,this.options||{},Tn()),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return e.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(t,e,a){this._readAny(t,t,e,e,a)}},{key:"read",value:function(t,e,a){this._readAny([t],t,[e],e,a)}},{key:"_readAny",value:function(t,e,a,i,o){var s=this,u=this.options.loadPath;typeof this.options.loadPath=="function"&&(u=this.options.loadPath(t,a)),u=kn(u),u.then(function(l){var c=s.services.interpolator.interpolate(l,{lng:t.join("+"),ns:a.join("+")});s.loadUrl(c,o,e,i)})}},{key:"loadUrl",value:function(t,e,a,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,a,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,a,i,o){var s=this;if(!!this.options.addPath){typeof t=="string"&&(t=[t]);var u=this.options.parsePayload(e,a,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,a=e.backendConnector,i=e.languageUtils,o=e.logger,s=a.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){a.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),a.loaded("".concat(c,"|").concat(p),v,m)})})})}}}]),r}();dt.type="backend";var gt=[],Nn=gt.forEach,An=gt.slice;function _n(r){return Nn.call(An.call(arguments,1),function(n){if(n)for(var t in n)r[t]===void 0&&(r[t]=n[t])}),r}var ht=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Dn=function(n,t,e){var a=e||{};a.path=a.path||"/";var i=encodeURIComponent(t),o=n+"="+i;if(a.maxAge>0){var s=a.maxAge-0;if(isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age="+Math.floor(s)}if(a.domain){if(!ht.test(a.domain))throw new TypeError("option domain is invalid");o+="; Domain="+a.domain}if(a.path){if(!ht.test(a.path))throw new TypeError("option path is invalid");o+="; Path="+a.path}if(a.expires){if(typeof a.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires="+a.expires.toUTCString()}if(a.httpOnly&&(o+="; HttpOnly"),a.secure&&(o+="; Secure"),a.sameSite){var u=typeof a.sameSite=="string"?a.sameSite.toLowerCase():a.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},vt={create:function(n,t,e,a){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)),a&&(i.domain=a),document.cookie=Dn(n,encodeURIComponent(t),i)},read:function(n){for(var t=n+"=",e=document.cookie.split(";"),a=0;a<e.length;a++){for(var i=e[a];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)}},Fn={name:"cookie",lookup:function(n){var t;if(n.lookupCookie&&typeof document!="undefined"){var e=vt.read(n.lookupCookie);e&&(t=e)}return t},cacheUserLanguage:function(n,t){t.lookupCookie&&typeof document!="undefined"&&vt.create(t.lookupCookie,n,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},In={name:"querystring",lookup:function(n){var t;if(typeof window!="undefined")for(var e=window.location.search.substring(1),a=e.split("&"),i=0;i<a.length;i++){var o=a[i].indexOf("=");if(o>0){var s=a[i].substring(0,o);s===n.lookupQuerystring&&(t=a[i].substring(o+1))}}return t}},me;try{me=window!=="undefined"&&window.localStorage!==null;var mt="i18next.translate.boo";window.localStorage.setItem(mt,"foo"),window.localStorage.removeItem(mt)}catch{me=!1}var Un={name:"localStorage",lookup:function(n){var t;if(n.lookupLocalStorage&&me){var e=window.localStorage.getItem(n.lookupLocalStorage);e&&(t=e)}return t},cacheUserLanguage:function(n,t){t.lookupLocalStorage&&me&&window.localStorage.setItem(t.lookupLocalStorage,n)}},ye;try{ye=window!=="undefined"&&window.sessionStorage!==null;var yt="i18next.translate.boo";window.sessionStorage.setItem(yt,"foo"),window.sessionStorage.removeItem(yt)}catch{ye=!1}var Bn={name:"sessionStorage",lookup:function(n){var t;if(n.lookupsessionStorage&&ye){var e=window.sessionStorage.getItem(n.lookupsessionStorage);e&&(t=e)}return t},cacheUserLanguage:function(n,t){t.lookupsessionStorage&&ye&&window.sessionStorage.setItem(t.lookupsessionStorage,n)}},Hn={name:"navigator",lookup:function(n){var t=[];if(typeof navigator!="undefined"){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}},Mn={name:"htmlTag",lookup:function(n){var t,e=n.htmlTag||(typeof document!="undefined"?document.documentElement:null);return e&&typeof e.getAttribute=="function"&&(t=e.getAttribute("lang")),t}},qn={name:"path",lookup:function(n){var t;if(typeof window!="undefined"){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}},Vn={name:"subdomain",lookup:function(n){var t;if(typeof window!="undefined"){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 $n(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var bt=function(){function r(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M(this,r),this.type="languageDetector",this.detectors={},this.init(n,t)}return q(r,[{key:"init",value:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=_n(e,this.options||{},$n()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=a,this.addDetector(Fn),this.addDetector(In),this.addDetector(Un),this.addDetector(Bn),this.addDetector(Hn),this.addDetector(Mn),this.addDetector(qn),this.addDetector(Vn)}},{key:"addDetector",value:function(t){this.detectors[t.name]=t}},{key:"detect",value:function(t){var e=this;t||(t=this.options.order);var a=[];return t.forEach(function(i){if(e.detectors[i]){var o=e.detectors[i].lookup(e.options);o&&typeof o=="string"&&(o=[o]),o&&(a=a.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?a:a.length>0?a[0]:null}},{key:"cacheUserLanguage",value:function(t,e){var a=this;e||(e=this.options.caches),!!e&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||e.forEach(function(i){a.detectors[i]&&a.detectors[i].cacheUserLanguage(t,a.options)}))}}]),r}();bt.type="languageDetector";function zn(a){var i=a,{detectorConfig:r,translationPath:n,customDetectors:t}=i,e=Oe(i,["detectorConfig","translationPath","customDetectors"]);const o=new bt,s={name:"hashRouterQuerystringDetector",lookup:p=>{try{const v=p&&p.lookupQuerystring||"lang",d=new RegExp(`[?&]${v}(=([^&#]*)|&|#|$)`).exec(window.location.href);if(d&&d[2]){const y=decodeURIComponent(d[2].replace(/\+/g," "));if(y)return y}}catch(v){console.error(v)}}};o.addDetector(s),Array.isArray(t)&&t.forEach(p=>{o.addDetector(p)});const c=Se({fallbackLng:"en-US",debug:!0,keySeparator:".",backend:{loadPath:n||"/locales/{{lng}}/{{ns}}.json"},interpolation:{escapeValue:!1},detection:r||{order:["querystring","hashRouterQuerystringDetector","cookie","localStorage"],lookupQuerystring:"lang",lookupCookie:"lang",lookupSessionStorage:"lang",lookupLocalStorage:"lang",caches:["localStorage","cookie"],excludeCacheFor:["cimode"],cookieOptions:{path:"/",sameSite:"strict"}}},e);return qt.use(dt).use(o).use(on).init(c)}const Kn=function(t){var e=t,{children:r}=e,n=Oe(e,["children"]);return kt.createElement(gn,Se({},n),r)};function Wn(r="translation",n){return wn([r,"design-system"],n)}exports.SpsLanguage=Kn;exports.localize=zn;exports.useSpsLanguage=Wn;
|
package/lib/index.es.js
CHANGED
|
@@ -2367,6 +2367,26 @@ var c = { parse: function(e, t2) {
|
|
|
2367
2367
|
return e2 + a("", t2);
|
|
2368
2368
|
}, "");
|
|
2369
2369
|
} };
|
|
2370
|
+
var replace = "".replace;
|
|
2371
|
+
var es = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g;
|
|
2372
|
+
var unes = {
|
|
2373
|
+
"&": "&",
|
|
2374
|
+
"&": "&",
|
|
2375
|
+
"<": "<",
|
|
2376
|
+
"<": "<",
|
|
2377
|
+
">": ">",
|
|
2378
|
+
">": ">",
|
|
2379
|
+
"'": "'",
|
|
2380
|
+
"'": "'",
|
|
2381
|
+
""": '"',
|
|
2382
|
+
""": '"'
|
|
2383
|
+
};
|
|
2384
|
+
function unescape(un) {
|
|
2385
|
+
return replace.call(un, es, cape);
|
|
2386
|
+
}
|
|
2387
|
+
function cape(m) {
|
|
2388
|
+
return unes[m];
|
|
2389
|
+
}
|
|
2370
2390
|
function ownKeys$2(object, enumerableOnly) {
|
|
2371
2391
|
var keys = Object.keys(object);
|
|
2372
2392
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -2487,12 +2507,8 @@ function loadNamespaces(i18n, ns, cb) {
|
|
|
2487
2507
|
}
|
|
2488
2508
|
});
|
|
2489
2509
|
}
|
|
2490
|
-
function
|
|
2510
|
+
function oldI18nextHasLoadedNamespace(ns, i18n) {
|
|
2491
2511
|
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2492
|
-
if (!i18n.languages || !i18n.languages.length) {
|
|
2493
|
-
warnOnce("i18n.languages were undefined or empty", i18n.languages);
|
|
2494
|
-
return true;
|
|
2495
|
-
}
|
|
2496
2512
|
var lng = i18n.languages[0];
|
|
2497
2513
|
var fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
|
|
2498
2514
|
var lastLng = i18n.languages[i18n.languages.length - 1];
|
|
@@ -2506,13 +2522,30 @@ function hasLoadedNamespace(ns, i18n) {
|
|
|
2506
2522
|
return false;
|
|
2507
2523
|
if (i18n.hasResourceBundle(lng, ns))
|
|
2508
2524
|
return true;
|
|
2509
|
-
if (!i18n.services.backendConnector.backend)
|
|
2525
|
+
if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages)
|
|
2510
2526
|
return true;
|
|
2511
2527
|
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns)))
|
|
2512
2528
|
return true;
|
|
2513
2529
|
return false;
|
|
2514
2530
|
}
|
|
2515
|
-
|
|
2531
|
+
function hasLoadedNamespace(ns, i18n) {
|
|
2532
|
+
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2533
|
+
if (!i18n.languages || !i18n.languages.length) {
|
|
2534
|
+
warnOnce("i18n.languages were undefined or empty", i18n.languages);
|
|
2535
|
+
return true;
|
|
2536
|
+
}
|
|
2537
|
+
var isNewerI18next = i18n.options.ignoreJSONStructure !== void 0;
|
|
2538
|
+
if (!isNewerI18next) {
|
|
2539
|
+
return oldI18nextHasLoadedNamespace(ns, i18n, options);
|
|
2540
|
+
}
|
|
2541
|
+
return i18n.hasLoadedNamespace(ns, {
|
|
2542
|
+
precheck: function precheck(i18nInstance2, loadNotPending) {
|
|
2543
|
+
if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns))
|
|
2544
|
+
return false;
|
|
2545
|
+
}
|
|
2546
|
+
});
|
|
2547
|
+
}
|
|
2548
|
+
var _excluded = ["format"], _excluded2 = ["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
|
|
2516
2549
|
function ownKeys$1(object, enumerableOnly) {
|
|
2517
2550
|
var keys = Object.keys(object);
|
|
2518
2551
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -2576,7 +2609,7 @@ function nodesToString(children, i18nOptions) {
|
|
|
2576
2609
|
return "";
|
|
2577
2610
|
var stringNode = "";
|
|
2578
2611
|
var childrenArray = getAsArray(children);
|
|
2579
|
-
var keepArray = i18nOptions.transKeepBasicHtmlNodesFor
|
|
2612
|
+
var keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
|
|
2580
2613
|
childrenArray.forEach(function(child, childIndex) {
|
|
2581
2614
|
if (typeof child === "string") {
|
|
2582
2615
|
stringNode += "".concat(child);
|
|
@@ -2613,7 +2646,7 @@ function nodesToString(children, i18nOptions) {
|
|
|
2613
2646
|
});
|
|
2614
2647
|
return stringNode;
|
|
2615
2648
|
}
|
|
2616
|
-
function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts) {
|
|
2649
|
+
function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {
|
|
2617
2650
|
if (targetString === "")
|
|
2618
2651
|
return [];
|
|
2619
2652
|
var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
|
|
@@ -2712,7 +2745,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts) {
|
|
|
2712
2745
|
}
|
|
2713
2746
|
} else if (node.type === "text") {
|
|
2714
2747
|
var wrapTextNodes = i18nOptions.transWrapTextNodes;
|
|
2715
|
-
var _content = i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
|
|
2748
|
+
var _content = shouldUnescape ? unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
|
|
2716
2749
|
if (wrapTextNodes) {
|
|
2717
2750
|
mem.push(React__default.createElement(wrapTextNodes, {
|
|
2718
2751
|
key: "".concat(node.name, "-").concat(i2)
|
|
@@ -2731,7 +2764,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts) {
|
|
|
2731
2764
|
return getChildren(result[0]);
|
|
2732
2765
|
}
|
|
2733
2766
|
function Trans(_ref) {
|
|
2734
|
-
var children = _ref.children, count = _ref.count, parent = _ref.parent, i18nKey = _ref.i18nKey, _ref$tOptions = _ref.tOptions, tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions, values = _ref.values, defaults2 = _ref.defaults, components = _ref.components, ns = _ref.ns, i18nFromProps = _ref.i18n, tFromProps = _ref.t, additionalProps = _objectWithoutProperties(_ref, _excluded2);
|
|
2767
|
+
var children = _ref.children, count = _ref.count, parent = _ref.parent, i18nKey = _ref.i18nKey, context = _ref.context, _ref$tOptions = _ref.tOptions, tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions, values = _ref.values, defaults2 = _ref.defaults, components = _ref.components, ns = _ref.ns, i18nFromProps = _ref.i18n, tFromProps = _ref.t, shouldUnescape = _ref.shouldUnescape, additionalProps = _objectWithoutProperties(_ref, _excluded2);
|
|
2735
2768
|
var _ref2 = useContext(I18nContext) || {}, i18nFromContext = _ref2.i18n, defaultNSFromContext = _ref2.defaultNS;
|
|
2736
2769
|
var i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
2737
2770
|
if (!i18n) {
|
|
@@ -2741,6 +2774,8 @@ function Trans(_ref) {
|
|
|
2741
2774
|
var t2 = tFromProps || i18n.t.bind(i18n) || function(k) {
|
|
2742
2775
|
return k;
|
|
2743
2776
|
};
|
|
2777
|
+
if (context)
|
|
2778
|
+
tOptions.context = context;
|
|
2744
2779
|
var reactI18nextOptions = _objectSpread$1(_objectSpread$1({}, getDefaults$2()), i18n.options && i18n.options.react);
|
|
2745
2780
|
var namespaces = ns || t2.ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
2746
2781
|
namespaces = typeof namespaces === "string" ? [namespaces] : namespaces || ["translation"];
|
|
@@ -2760,7 +2795,7 @@ function Trans(_ref) {
|
|
|
2760
2795
|
ns: namespaces
|
|
2761
2796
|
});
|
|
2762
2797
|
var translation = key ? t2(key, combinedTOpts) : defaultValue;
|
|
2763
|
-
var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts);
|
|
2798
|
+
var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
|
|
2764
2799
|
var useAsParent = parent !== void 0 ? parent : reactI18nextOptions.defaultTransParent;
|
|
2765
2800
|
return useAsParent ? React__default.createElement(useAsParent, additionalProps, content) : content;
|
|
2766
2801
|
}
|
|
@@ -4204,10 +4239,10 @@ function localize(_a) {
|
|
|
4204
4239
|
}, i18nConfig);
|
|
4205
4240
|
return i18next.use(Backend).use(languageDetector).use(initReactI18next).init(mergedConfig);
|
|
4206
4241
|
}
|
|
4207
|
-
|
|
4242
|
+
const SpsLanguage = function(_c) {
|
|
4208
4243
|
var _d = _c, { children } = _d, rest = __objRest(_d, ["children"]);
|
|
4209
4244
|
return /* @__PURE__ */ React.createElement(Trans, __spreadValues({}, rest), children);
|
|
4210
|
-
}
|
|
4245
|
+
};
|
|
4211
4246
|
function useSpsLanguage(ns = "translation", options) {
|
|
4212
4247
|
return useTranslation([ns, "design-system"], options);
|
|
4213
4248
|
}
|
package/lib/useSpsLanguage.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useSpsLanguage(ns?: string, options?: any): import("react-i18next").UseTranslationResponse<string[]>;
|
|
1
|
+
export declare function useSpsLanguage(ns?: string, options?: any): import("react-i18next").UseTranslationResponse<string[], undefined>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/i18n",
|
|
3
3
|
"description": "SPS Design System React components",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.1.1",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/i18n",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"i18next": "^19.6.3",
|
|
20
20
|
"i18next-browser-languagedetector": "^5.0.1",
|
|
21
21
|
"i18next-http-backend": "^1.0.17",
|
|
22
|
-
"react-i18next": "^11.
|
|
22
|
+
"react-i18next": "^11.16.9"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^16.9.0"
|
|
@@ -36,5 +36,6 @@
|
|
|
36
36
|
"watch": "vite build --watch",
|
|
37
37
|
"clean": "git clean -fdX",
|
|
38
38
|
"pub": "pnpm pack && node ../../scripts/publish-package.js"
|
|
39
|
-
}
|
|
39
|
+
},
|
|
40
|
+
"readme": "[//]: # \"START_AUTOGENERATED\"\n\n## [@spscommerce/i18n](https://github.com/spscommerce/ui-angular/tree/master/packages/@spscommerce/i18n#readme)\n\n\n\n\n\nSPS Design System React components \n \n ### Installation \n \n ```shell\nnpm install --save @spscommerce/i18n\n```\n\n#### Peer Dependencies\n\n<div class=\"row\">\n <div class=\"col-5\"> \n <table class=\"sps-table\">\n <thead class=\"sps-table__head\">\n <tr class=\"sps-table__row\">\n <th class=\"sps-table__header\">\n <span class=\"sps-table__header-cell-body\"> \n Package\n </span>\n </th>\n <th class=\"sps-table__header text-right\">\n <span class=\"sps-table__header-cell-body\"> \n Version\n </span>\n </th>\n </tr>\n </thead>\n <tbody class=\"sps-table__body\">\n <tr class=\"sps-table__row\"><td class=\"sps-table__cell\"><a href=\"https://reactjs.org/\">react</a></td><td class=\"sps-table__cell text-right\">^16.9.0</td></tr>\n </tbody>\n </table>\n </div>\n <div class=\"col-7\">\n \n </div>\n</div>\n\n[//]: # \"END_AUTOGENERATED\"\n"
|
|
40
41
|
}
|
package/.pnpm-debug.log
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"0 debug pnpm:scope": {
|
|
3
|
-
"selected": 1,
|
|
4
|
-
"workspacePrefix": "/Users/mabuan/Documents/projects/design-system"
|
|
5
|
-
},
|
|
6
|
-
"1 error pnpm": {
|
|
7
|
-
"code": "ELIFECYCLE",
|
|
8
|
-
"errno": "ENOENT",
|
|
9
|
-
"syscall": "spawn",
|
|
10
|
-
"file": "sh",
|
|
11
|
-
"pkgid": "@spscommerce/i18n@5.16.1",
|
|
12
|
-
"stage": "build:js",
|
|
13
|
-
"script": "vite build",
|
|
14
|
-
"pkgname": "@spscommerce/i18n",
|
|
15
|
-
"err": {
|
|
16
|
-
"name": "pnpm",
|
|
17
|
-
"message": "@spscommerce/i18n@5.16.1 build:js: `vite build`\nspawn ENOENT",
|
|
18
|
-
"code": "ELIFECYCLE",
|
|
19
|
-
"stack": "pnpm: @spscommerce/i18n@5.16.1 build:js: `vite build`\nspawn ENOENT\n at ChildProcess.<anonymous> (/Users/mabuan/.nvm/versions/node/v12.22.7/lib/node_modules/pnpm/dist/pnpm.cjs:93846:22)\n at ChildProcess.emit (events.js:314:20)\n at maybeClose (internal/child_process.js:1022:16)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"2 warn pnpm:global": " Local package.json exists, but node_modules missing, did you mean to install?"
|
|
23
|
-
}
|