@digital-blueprint/nexus-app
Version:
[GitHub Repository](https://github.com/digital-blueprint/nexus-app) | [npmjs package](https://www.npmjs.com/package/@digital-blueprint/nexus-app) | [Unpkg CDN](https://unpkg.com/browse/@digital-blueprint/nexus-app/) |
42 lines • 149 kB
JavaScript
let e,t,o,r,i,n,s,a,l,d,c,u,h,p,g,b,f,m,v,y,x,k,w,S,$,_,E,C,A,O,P,L,N,R,D,j=e=>e;function T(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function M(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?T(Object(o),!0).forEach((function(t){F(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):T(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function F(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}
/*!
* License: LGPL-2.1-or-later
* Dependencies:
*
* @dbp-toolkit/app-shell: LGPL-2.1-or-later
* @dbp-toolkit/common: LGPL-2.1-or-later
* @dbp-toolkit/language-select: LGPL-2.1-or-later
* @dbp-toolkit/auth: LGPL-2.1-or-later
* @dbp-toolkit/notification: LGPL-2.1-or-later
* @dbp-toolkit/theme-switcher: LGPL-2.1-or-later
* path-to-regexp: MIT
* universal-router: MIT
* generateUrls: MIT
* @dbp-toolkit/matomo: LGPL-2.1-or-later
* lit-html: BSD-3-Clause
* instantsearch.js: MIT
* @algolia/events: MIT
* algoliasearch-helper: MIT
* qs: BSD-3-Clause
* typesense-instantsearch-adapter: Apache-2.0
* @babel/runtime: MIT
* typesense: Apache-2.0
* loglevel: MIT
* axios: MIT
* instantsearch-ui-components: MIT
* preact: MIT
* hogan.js: (Apache-2.0)
* htm: Apache-2.0
* preact-hooks: MIT
* i18next: MIT
* @lit/reactive-element: BSD-3-Clause
* lit-element: BSD-3-Clause
* @open-wc/dedupe-mixin: MIT
* @open-wc/scoped-elements: MIT
* dialog-polyfill: BSD
*/(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const U=e=>"string"==typeof e,z=()=>{let e,t;const o=new Promise(((o,r)=>{e=o,t=r}));return o.resolve=e,o.reject=t,o},I=e=>null==e?"":""+e,H=/###/g,V=e=>e&&e.indexOf("###")>-1?e.replace(H,"."):e,B=e=>!e||U(e),K=(e,t,o)=>{const r=U(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(B(e))return{};const t=V(r[i]);!e[t]&&o&&(e[t]=new o),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return B(e)?{}:{obj:e,k:V(r[i])}},q=(e,t,o)=>{const{obj:r,k:i}=K(e,t,Object);if(void 0!==r||1===t.length)return void(r[i]=o);let n=t[t.length-1],s=t.slice(0,t.length-1),a=K(e,s,Object);for(;void 0===a.obj&&s.length;){var l;n=`${s[s.length-1]}.${n}`,s=s.slice(0,s.length-1),a=K(e,s,Object),null!==(l=a)&&void 0!==l&&l.obj&&void 0!==a.obj[`${a.k}.${n}`]&&(a.obj=void 0)}a.obj[`${a.k}.${n}`]=o},Y=(e,t)=>{const{obj:o,k:r}=K(e,t);if(o&&Object.prototype.hasOwnProperty.call(o,r))return o[r]},J=(e,t,o)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?U(e[r])||e[r]instanceof String||U(t[r])||t[r]instanceof String?o&&(e[r]=t[r]):J(e[r],t[r],o):e[r]=t[r]);return e},W=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var G={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Z=e=>U(e)?e.replace(/[&<>"'\/]/g,(e=>G[e])):e;const X=[" ",",","?","!",";"],Q=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const o=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,o),this.regExpQueue.push(e),o}}(20),ee=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(o);let i=e;for(let e=0;e<r.length;){if(!i||"object"!=typeof i)return;let t,n="";for(let s=e;s<r.length;++s)if(s!==e&&(n+=o),n+=r[s],t=i[n],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&s<r.length-1)continue;e+=s-e+1;break}i=t}return i},te=e=>null==e?void 0:e.replace("_","-"),oe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var o,r;null===(o=console)||void 0===o||null===(o=o[e])||void 0===o||null===(r=o.apply)||void 0===r||r.call(o,console,t)}};var re=new class e{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||oe,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,o,r){return r&&!this.debug?null:(U(e[0])&&(e[0]=`${o}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,M(M({},{prefix:`${this.prefix}:${t}:`}),this.options))}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}};class ie{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const o=this.observers[e].get(t)||0;this.observers[e].set(t,o+1)})),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];if(this.observers[e]){Array.from(this.observers[e].entries()).forEach((e=>{let[t,r]=e;for(let e=0;e<r;e++)t(...o)}))}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach((t=>{let[r,i]=t;for(let t=0;t<i;t++)r.apply(r,[e,...o])}))}}}class ne extends ie{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,o){var r;let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],o&&(Array.isArray(o)?a.push(...o):U(o)&&n?a.push(...o.split(n)):a.push(o)));const l=Y(this.data,a);return!l&&!t&&!o&&e.indexOf(".")>-1&&(e=a[0],t=a[1],o=a.slice(2).join(".")),!l&&s&&U(o)?ee(null===(r=this.data)||void 0===r||null===(r=r[e])||void 0===r?void 0:r[t],o,n):l}addResource(e,t,o,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const n=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let s=[e,t];o&&(s=s.concat(n?o.split(n):o)),e.indexOf(".")>-1&&(s=e.split("."),r=t,t=s[1]),this.addNamespaces(t),q(this.data,s,r),i.silent||this.emit("added",e,t,o,r)}addResources(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const r in o)(U(o[r])||Array.isArray(o[r]))&&this.addResource(e,t,r,o[r],{silent:!0});r.silent||this.emit("added",e,t,o)}addResourceBundle(e,t,o,r,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),r=o,o=t,t=s[1]),this.addNamespaces(t);let a=Y(this.data,s)||{};n.skipCopy||(o=JSON.parse(JSON.stringify(o))),r?J(a,o,i):a=M(M({},a),o),q(this.data,s,a),n.silent||this.emit("added",e,t,o)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var se={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,o,r,i){return e.forEach((e=>{var n,s;t=null!==(n=null===(s=this.processors[e])||void 0===s?void 0:s.process(t,o,r,i))&&void 0!==n?n:t})),t}};const ae={},le=e=>!U(e)&&"boolean"!=typeof e&&"number"!=typeof e;class de extends ie{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((e,t,o)=>{e.forEach((e=>{t[e]&&(o[e]=t[e])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=re.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const o=this.resolve(e,t);return void 0!==(null==o?void 0:o.res)}extractFromKey(e,t){let o=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===o&&(o=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const n=o&&e.indexOf(o)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,o)=>{t=t||"",o=o||"";const r=X.filter((e=>t.indexOf(e)<0&&o.indexOf(e)<0));if(0===r.length)return!0;const i=Q.getRegExp(`(${r.map((e=>"?"===e?"\\?":e)).join("|")})`);let n=!i.test(e);if(!n){const t=e.indexOf(o);t>0&&!i.test(e.substring(0,t))&&(n=!0)}return n})(e,o,r));if(n&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:U(i)?[i]:i};const n=e.split(o);(o!==r||o===r&&this.options.ns.indexOf(n[0])>-1)&&(i=n.shift()),e=n.join(r)}return{key:e,namespaces:U(i)?[i]:i}}translate(e,t,o){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t=M({},t)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:n,namespaces:s}=this.extractFromKey(e[e.length-1],t),a=s[s.length-1],l=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===(null==l?void 0:l.toLowerCase())){if(d){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${a}${e}${n}`,usedKey:n,exactUsedKey:n,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:`${a}${e}${n}`}return r?{res:n,usedKey:n,exactUsedKey:n,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:n}const c=this.resolve(e,t);let u=null==c?void 0:c.res;const h=(null==c?void 0:c.usedKey)||n,p=(null==c?void 0:c.exactUsedKey)||n,g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,f=void 0!==t.count&&!U(t.count),m=de.hasDefaultValue(t),v=f?this.pluralResolver.getSuffix(l,t.count,t):"",y=t.ordinal&&f?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",x=f&&!t.ordinal&&0===t.count,k=x&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${v}`]||t[`defaultValue${y}`]||t.defaultValue;let w=u;b&&!u&&m&&(w=k);const S=le(w),$=Object.prototype.toString.apply(w);if(!(b&&w&&S&&["[object Number]","[object Function]","[object RegExp]"].indexOf($)<0)||U(g)&&Array.isArray(w))if(b&&U(g)&&Array.isArray(u))u=u.join(g),u&&(u=this.extendTranslation(u,e,t,o));else{let r=!1,s=!1;!this.isValidLookup(u)&&m&&(r=!0,u=k),this.isValidLookup(u)||(s=!0,u=n);const d=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:u,h=m&&k!==u&&this.options.updateMissing;if(s||r||h){if(this.logger.log(h?"updateKey":"missingKey",l,a,n,h?k:u),i){const e=this.resolve(n,M(M({},t),{},{keySeparator:!1}));e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const o=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&o&&o[0])for(let t=0;t<o.length;t++)e.push(o[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,o,r)=>{var i;const n=m&&r!==u?r:d;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,o,n,h,t):null!==(i=this.backendConnector)&&void 0!==i&&i.saveMissing&&this.backendConnector.saveMissing(e,a,o,n,h,t),this.emit("missingKey",e,a,o,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&f?e.forEach((e=>{const o=this.pluralResolver.getSuffixes(e,t);x&&t[`defaultValue${this.options.pluralSeparator}zero`]&&o.indexOf(`${this.options.pluralSeparator}zero`)<0&&o.push(`${this.options.pluralSeparator}zero`),o.forEach((o=>{r([e],n+o,t[`defaultValue${o}`]||k)}))})):r(e,n,k))}u=this.extendTranslation(u,e,t,c,o),s&&u===n&&this.options.appendNamespaceToMissingKey&&(u=`${a}:${n}`),(s||r)&&this.options.parseMissingKeyHandler&&(u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${n}`:n,r?u:void 0))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,w,M(M({},t),{},{ns:s})):`key '${n} (${this.language})' returned an object instead of string.`;return r?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(i){const e=Array.isArray(w),o=e?[]:{},r=e?p:h;for(const e in w)if(Object.prototype.hasOwnProperty.call(w,e)){const n=`${r}${i}${e}`;o[e]=m&&!u?this.translate(n,M(M({},t),{},{defaultValue:le(k)?k[e]:void 0},{joinArrays:!1,ns:s})):this.translate(n,M(M({},t),{joinArrays:!1,ns:s})),o[e]===n&&(o[e]=w[e])}u=o}}return r?(c.res=u,c.usedParams=this.getUsedParamsDetails(t),c):u}extendTranslation(e,t,o,r,i){var n,s=this;if(null!==(n=this.i18nFormat)&&void 0!==n&&n.parse)e=this.i18nFormat.parse(e,M(M({},this.options.interpolation.defaultVariables),o),o.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!o.skipInterpolation){var a;o.interpolation&&this.interpolator.init(M(M({},o),{interpolation:M(M({},this.options.interpolation),o.interpolation)}));const n=U(e)&&(void 0!==(null==o||null===(a=o.interpolation)||void 0===a?void 0:a.skipOnVariables)?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(n){const t=e.match(this.interpolator.nestingRegexp);l=t&&t.length}let d=o.replace&&!U(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(d=M(M({},this.options.interpolation.defaultVariables),d)),e=this.interpolator.interpolate(e,d,o.lng||this.language||r.usedLng,o),n){const t=e.match(this.interpolator.nestingRegexp);l<(t&&t.length)&&(o.nest=!1)}!o.lng&&r&&r.res&&(o.lng=this.language||r.usedLng),!1!==o.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(null==i?void 0:i[0])!==r[0]||o.context?s.translate(...r,t):(s.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null)}),o)),o.interpolation&&this.interpolator.reset()}const l=o.postProcess||this.options.postProcess,d=U(l)?[l]:l;return null!=e&&null!=d&&d.length&&!1!==o.applyPostProcessor&&(e=se.handle(d,e,t,this.options&&this.options.postProcessPassResolved?M({i18nResolved:M(M({},r),{},{usedParams:this.getUsedParamsDetails(o)})},o):o,this)),e}resolve(e){let t,o,r,i,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return U(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const a=this.extractFromKey(e,s),l=a.key;o=l;let d=a.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const c=void 0!==s.count&&!U(s.count),u=c&&!s.ordinal&&0===s.count,h=void 0!==s.context&&(U(s.context)||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);d.forEach((e=>{var a,d;this.isValidLookup(t)||(n=e,ae[`${p[0]}-${e}`]||null===(a=this.utils)||void 0===a||!a.hasLoadedNamespace||null!==(d=this.utils)&&void 0!==d&&d.hasLoadedNamespace(n)||(ae[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${p.join(", ")}" won't get resolved as namespace "${n}" 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!!!")),p.forEach((o=>{var n;if(this.isValidLookup(t))return;i=o;const a=[l];if(null!==(n=this.i18nFormat)&&void 0!==n&&n.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,o,e,s);else{let e;c&&(e=this.pluralResolver.getSuffix(o,s.count,s));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(a.push(l+e),s.ordinal&&0===e.indexOf(r)&&a.push(l+e.replace(r,this.options.pluralSeparator)),u&&a.push(l+t)),h){const o=`${l}${this.options.contextSeparator}${s.context}`;a.push(o),c&&(a.push(o+e),s.ordinal&&0===e.indexOf(r)&&a.push(o+e.replace(r,this.options.pluralSeparator)),u&&a.push(o+t))}}let d;for(;d=a.pop();)this.isValidLookup(t)||(r=d,t=this.getResource(o,e,d,s))})))}))})),{res:t,usedKey:o,exactUsedKey:r,usedLng:i,usedNS:n}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,o){var r;let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return null!==(r=this.i18nFormat)&&void 0!==r&&r.getResource?this.i18nFormat.getResource(e,t,o,i):this.resourceStore.getResource(e,t,o,i)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=e.replace&&!U(e.replace);let r=o?e.replace:e;if(o&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r=M(M({},this.options.interpolation.defaultVariables),r)),!o){r=M({},r);for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t===o.substring(0,12)&&void 0!==e[o])return!0;return!1}}class ce{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=re.create("languageUtils")}getScriptPartFromCode(e){if(!(e=te(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=te(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(U(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const o=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(o)||(t=o)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const o=this.getLanguagePartFromCode(e);if(this.isSupportedCode(o))return t=o;t=this.options.supportedLngs.find((e=>e===o?e:e.indexOf("-")<0&&o.indexOf("-")<0?void 0:e.indexOf("-")>0&&o.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===o||0===e.indexOf(o)&&o.length>1?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),U(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let o=e[t];return o||(o=e[this.getScriptPartFromCode(t)]),o||(o=e[this.formatLanguageCode(t)]),o||(o=e[this.getLanguagePartFromCode(t)]),o||(o=e.default),o||[]}toResolveHierarchy(e,t){const o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return U(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):U(e)&&i(this.formatLanguageCode(e)),o.forEach((e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))})),r}}const ue={zero:0,one:1,two:2,few:3,many:4,other:5},he={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class pe{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=re.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=te("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:o,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let n;try{n=new Intl.PluralRules(o,{type:r})}catch(o){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),he;if(!e.match(/-|_/))return he;const r=this.languageUtils.getLanguagePartFromCode(e);n=this.getRule(r,t)}return this.pluralRulesCache[i]=n,n}needsPlural(e){var t;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,o);return r||(r=this.getRule("dev",o)),(null===(t=r)||void 0===t?void 0:t.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,o).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.getRule(e,t);return o||(o=this.getRule("dev",t)),o?o.resolvedOptions().pluralCategories.sort(((e,t)=>ue[e]-ue[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,o);return r?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,o))}}const ge=function(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],n=((e,t,o)=>{const r=Y(e,o);return void 0!==r?r:Y(t,o)})(e,t,o);return!n&&i&&U(o)&&(n=ee(e,o,r),void 0===n&&(n=ee(t,o,r))),n},be=e=>e.replace(/\$/g,"$$$$");class fe{constructor(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=re.create("interpolator"),this.options=t,this.format=(null==t||null===(e=t.interpolation)||void 0===e?void 0:e.format)||(e=>e),this.init(t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:o,useRawValueToEscape:r,prefix:i,prefixEscaped:n,suffix:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:d,unescapePrefix:c,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:b,maxReplaces:f,alwaysFormat:m}=e.interpolation;this.escape=void 0!==t?t:Z,this.escapeValue=void 0===o||o,this.useRawValueToEscape=void 0!==r&&r,this.prefix=i?W(i):n||"{{",this.suffix=s?W(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=d?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=u?W(u):h||W("$t("),this.nestingSuffix=p?W(p):g||W(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=f||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>(null==e?void 0:e.source)===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,o,r){var i;let n,s,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=e=>{if(e.indexOf(this.formatSeparator)<0){const i=ge(t,l,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,o,M(M(M({},r),t),{},{interpolationkey:e})):i}const i=e.split(this.formatSeparator),n=i.shift().trim(),s=i.join(this.formatSeparator).trim();return this.format(ge(t,l,n,this.options.keySeparator,this.options.ignoreJSONStructure),s,o,M(M(M({},r),t),{},{interpolationkey:n}))};this.resetRegExp();const c=(null==r?void 0:r.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=void 0!==(null==r||null===(i=r.interpolation)||void 0===i?void 0:i.skipOnVariables)?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>be(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?be(this.escape(e)):be(e)}].forEach((t=>{for(a=0;n=t.regex.exec(e);){const o=n[1].trim();if(s=d(o),void 0===s)if("function"==typeof c){const t=c(e,n,r);s=U(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,o))s="";else{if(u){s=n[0];continue}this.logger.warn(`missed to pass in variable ${o} for interpolating ${e}`),s=""}else U(s)||this.useRawValueToEscape||(s=I(s));const i=t.safeValue(s);if(e=e.replace(n[0],i),u?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=n[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),e}nest(e,t){let o,r,i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=(e,t)=>{var o;const r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;const n=e.split(new RegExp(`${r}[ ]*{`));let s=`{${n[1]}`;e=n[0],s=this.interpolate(s,i);const a=s.match(/'/g),l=s.match(/"/g);((null!==(o=null==a?void 0:a.length)&&void 0!==o?o:0)%2==0&&!l||l.length%2!=0)&&(s=s.replace(/'/g,'"'));try{i=JSON.parse(s),t&&(i=M(M({},t),i))}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${r}${s}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let a=[];i=M({},n),i=i.replace&&!U(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(-1!==o[0].indexOf(this.formatSeparator)&&!/{.*}/.test(o[1])){const e=o[1].split(this.formatSeparator).map((e=>e.trim()));o[1]=e.shift(),a=e,l=!0}if(r=t(s.call(this,o[1].trim(),i),i),r&&o[0]===e&&!U(r))return r;U(r)||(r=I(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),r=""),l&&(r=a.reduce(((e,t)=>this.format(e,t,n.lng,M(M({},n),{},{interpolationkey:o[1].trim()}))),r.trim())),e=e.replace(o[0],r),this.regexp.lastIndex=0}return e}}const me=e=>{const t={};return(o,r,i)=>{let n=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(n=M(M({},n),{},{[i.interpolationkey]:void 0}));const s=r+JSON.stringify(n);let a=t[s];return a||(a=e(te(r),i),t[s]=a),a(o)}};class ve{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=re.create("formatter"),this.options=e,this.formats={number:me(((e,t)=>{const o=new Intl.NumberFormat(e,M({},t));return e=>o.format(e)})),currency:me(((e,t)=>{const o=new Intl.NumberFormat(e,M(M({},t),{},{style:"currency"}));return e=>o.format(e)})),datetime:me(((e,t)=>{const o=new Intl.DateTimeFormat(e,M({},t));return e=>o.format(e)})),relativetime:me(((e,t)=>{const o=new Intl.RelativeTimeFormat(e,M({},t));return e=>o.format(e,t.range||"day")})),list:me(((e,t)=>{const o=new Intl.ListFormat(e,M({},t));return e=>o.format(e)}))},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=me(t)}format(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find((e=>e.indexOf(")")>-1))){const e=i.findIndex((e=>e.indexOf(")")>-1));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}const n=i.reduce(((e,t)=>{const{formatName:i,formatOptions:n}=(e=>{let t=e.toLowerCase().trim();const o={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?o.currency||(o.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?o.range||(o.range=i.trim()):i.split(";").forEach((e=>{if(e){const[t,...r]=e.split(":"),i=r.join(":").trim().replace(/^'+|'+$/g,""),n=t.trim();o[n]||(o[n]=i),"false"===i&&(o[n]=!1),"true"===i&&(o[n]=!0),isNaN(i)||(o[n]=parseInt(i,10))}}))}return{formatName:t,formatOptions:o}})(t);if(this.formats[i]){let t=e;try{var s;const a=(null==r||null===(s=r.formatParams)||void 0===s?void 0:s[r.interpolationkey])||{},l=a.locale||a.lng||r.locale||r.lng||o;t=this.formats[i](e,l,M(M(M({},n),r),a))}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e);return n}}class ye extends ie{constructor(e,t,o){var r,i;let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=o,this.languageUtils=o.languageUtils,this.options=n,this.logger=re.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],null===(r=this.backend)||void 0===r||null===(i=r.init)||void 0===i||i.call(r,o,n.backend,n)}queueLoad(e,t,o,r){const i={},n={},s={},a={};return e.forEach((e=>{let r=!0;t.forEach((t=>{const s=`${e}|${t}`;!o.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===n[s]&&(n[s]=!0):(this.state[s]=1,r=!1,void 0===n[s]&&(n[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===a[t]&&(a[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(n).length)&&this.queue.push({pending:n,pendingCount:Object.keys(n).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(n),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,o){const r=e.split("|"),i=r[0],n=r[1];t&&this.emit("failedLoading",i,n,t),!t&&o&&this.store.addResourceBundle(i,n,o,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&o&&(this.state[e]=0);const s={};this.queue.forEach((o=>{((e,t,o)=>{const{obj:r,k:i}=K(e,t,Object);r[i]=r[i]||[],r[i].push(o)})(o.loaded,[i],n),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(o,e),t&&o.errors.push(t),0!==o.pendingCount||o.done||(Object.keys(o.loaded).forEach((e=>{s[e]||(s[e]={});const t=o.loaded[e];t.length&&t.forEach((t=>{void 0===s[e][t]&&(s[e][t]=!0)}))})),o.done=!0,o.errors.length?o.callback(o.errors):o.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((e=>!e.done))}read(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,n=arguments.length>5?arguments[5]:void 0;if(!e.length)return n(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:o,tried:r,wait:i,callback:n});this.readingCalls++;const s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&r<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,o,r+1,2*i,n)}),i):n(s,a)},a=this.backend[o].bind(this.backend);if(2!==a.length)return a(e,t,s);try{const o=a(e,t);o&&"function"==typeof o.then?o.then((e=>s(null,e))).catch(s):s(null,o)}catch(e){s(e)}}prepareLoading(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=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."),r&&r();U(e)&&(e=this.languageUtils.toResolveHierarchy(e)),U(t)&&(t=[t]);const i=this.queueLoad(e,t,o,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,o){this.prepareLoading(e,t,{},o)}reload(e,t,o){this.prepareLoading(e,t,{reload:!0},o)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=e.split("|"),r=o[0],i=o[1];this.read(r,i,"read",void 0,void 0,((o,n)=>{o&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,o),!o&&n&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,n),this.loaded(e,o,n)}))}saveMissing(e,t,o,r,i){var n,s,a;let l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(null===(n=this.services)||void 0===n||null===(n=n.utils)||void 0===n||!n.hasLoadedNamespace||null!==(s=this.services)&&void 0!==s&&null!==(s=s.utils)&&void 0!==s&&s.hasLoadedNamespace(t)){if(null!=o&&""!==o){if(null!==(a=this.backend)&&void 0!==a&&a.create){const n=M(M({},l),{},{isUpdate:i}),s=this.backend.create.bind(this.backend);if(s.length<6)try{let i;i=5===s.length?s(e,t,o,r,n):s(e,t,o,r),i&&"function"==typeof i.then?i.then((e=>d(null,e))).catch(d):d(null,i)}catch(e){d(e)}else s(e,t,o,r,d,n)}e&&e[0]&&this.store.addResource(e[0],t,o,r)}}else this.logger.warn(`did not save key "${o}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const xe=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),U(e[1])&&(t.defaultValue=e[1]),U(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const o=e[3]||e[2];Object.keys(o).forEach((e=>{t[e]=o[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),ke=e=>{var t,o;return U(e.ns)&&(e.ns=[e.ns]),U(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),U(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),(null===(t=e.supportedLngs)||void 0===t||null===(o=t.indexOf)||void 0===o?void 0:o.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e},we=()=>{};class Se extends ie{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var o;if(super(),this.options=ke(e),this.services={},this.logger=re,this.modules={external:[]},o=this,Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach((e=>{"function"==typeof o[e]&&(o[e]=o[e].bind(o))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(o=t,t={}),null==t.defaultNS&&t.ns&&(U(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=xe();this.options=M(M(M({},r),this.options),ke(t)),this.options.interpolation=M(M({},r.interpolation),this.options.interpolation),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?re.init(i(this.modules.logger),this.options):re.init(null,this.options),t=this.modules.formatter?this.modules.formatter:ve;const o=new ce(this.options);this.store=new ne(this.options.resources,this.options);const n=this.services;n.logger=re,n.resourceStore=this.store,n.languageUtils=o,n.pluralResolver=new pe(o,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(n.formatter=i(t),n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new fe(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new ye(i(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(function(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];e.emit(t,...r)})),this.modules.languageDetector&&(n.languageDetector=i(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=i(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new de(this.services,this.options),this.translator.on("*",(function(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];e.emit(t,...r)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,o||(o=we),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const n=z(),s=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),n.resolve(t),o(e,t)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),n}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:we;const o=U(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){var r,i;if("cimode"===(null==o?void 0:o.toLowerCase())&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],n=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(o)n(o);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>n(e)))}null===(r=this.options.preload)||void 0===r||null===(i=r.forEach)||void 0===i||i.call(r,(e=>n(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,o){const r=z();return"function"==typeof e&&(o=e,e=void 0),"function"==typeof t&&(o=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),o||(o=we),this.services.backendConnector.reload(e,t,(e=>{r.resolve(),o(e)})),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&se.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var o=this;this.isLanguageChangingTo=e;const r=z();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},n=(e,n)=>{n?(i(n),this.translator.changeLanguage(n),this.isLanguageChangingTo=void 0,this.emit("languageChanged",n),this.logger.log("languageChanged",n)):this.isLanguageChangingTo=void 0,r.resolve((function(){return o.t(...arguments)})),t&&t(e,(function(){return o.t(...arguments)}))},s=t=>{e||t||!this.services.languageDetector||(t=[]);const o=U(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);var r,s;o&&(this.language||i(o),this.translator.language||this.translator.changeLanguage(o),null===(r=this.services.languageDetector)||void 0===r||null===(s=r.cacheUserLanguage)||void 0===s||s.call(r,o));this.loadResources(o,(e=>{n(e,o)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),r}getFixedT(e,t,o){var r=this;const i=function e(t,i){let n;if("object"!=typeof i){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];n=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else n=M({},i);n.lng=n.lng||e.lng,n.lngs=n.lngs||e.lngs,n.ns=n.ns||e.ns,""!==n.keyPrefix&&(n.keyPrefix=n.keyPrefix||o||e.keyPrefix);const d=r.options.keySeparator||".";let c;return c=n.keyPrefix&&Array.isArray(t)?t.map((e=>`${n.keyPrefix}${d}${e}`)):n.keyPrefix?`${n.keyPrefix}${d}${t}`:t,r.t(c,n)};return U(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=o,i}t(){for(var e,t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return null===(e=this.translator)||void 0===e?void 0:e.translate(...o)}exists(){for(var e,t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return null===(e=this.translator)||void 0===e?void 0:e.exists(...o)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?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;const o=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;const n=(e,t)=>{const o=this.services.backendConnector.state[`${e}|${t}`];return-1===o||0===o||2===o};if(t.precheck){const e=t.precheck(this,n);if(void 0!==e)return e}return!!this.hasResourceBundle(o,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!n(o,e)||r&&!n(i,e)))}loadNamespaces(e,t){const o=z();return this.options.ns?(U(e)&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}loadLanguages(e,t){const o=z();U(e)&&(e=[e]);const r=this.options.preload||[],i=e.filter((e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e)));return i.length?(this.options.preload=r.concat(i),this.loadResources((e=>{o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}dir(e){var t,o;if(e||(e=this.resolvedLanguage||((null===(t=this.languages)||void 0===t?void 0:t.length)>0?this.languages[0]:this.language)),!e)return"rtl";const r=(null===(o=this.services)||void 0===o?void 0:o.languageUtils)||new ce(xe());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Se(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:we;const o=e.forkResourceStore;o&&delete e.forkResourceStore;const r=M(M(M({},this.options),e),{isClone:!0}),i=new Se(r);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));if(["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services=M({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},o){const e=Object.keys(this.store.data).reduce(((e,t)=>(e[t]=M({},this.store.data[t]),Object.keys(e[t]).reduce(((o,r)=>(o[r]=M({},e[t][r]),o)),{}))),{});i.store=new ne(e,r),i.services.resourceStore=i.store}return i.translator=new de(i.services,r),i.translator.on("*",(function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];i.emit(e,...o)})),i.init(r,t),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const $e=Se.createInstance();$e.createInstance=Se.createInstance,$e.createInstance,$e.dir,$e.init,$e.loadResources,$e.reloadResources,$e.use,$e.changeLanguage,$e.getFixedT,$e.t,$e.exists,$e.setDefaultNamespace,$e.hasLoadedNamespace,$e.loadNamespaces,$e.loadLanguages;const _e={};async function Ee(e,t){if(void 0===_e[t]){let o=async function(e,t){let o=await fetch(e+t+"/translation.json",{headers:{"Content-Type":"application/json"}});return await o.json()}(e,t);return _e[t]=o,o}return _e[t]}function Ce(e){return"--"+e+"-override"}function Ae(e,t,o,r){void 0===r&&(r="translation");let i=Ce(r);var n={lng:t,fallbackLng:[o,t,...Object.keys(e)],debug:!1,ns:[i,r],defaultNS:r,fallbackNS:r,initImmediate:!1,initAsync:!1,resources:{}};Object.keys(e).forEach((function(t){n.resources[t]={[r]:e[t]}}));var s=$e.createInstance();return s.init(n),console.assert(s.isInitialized),s}async function Oe(e,t){let o=(t.dataset&&t.dataset.tagName||t.tagName).toLowerCase(),r=e.options.fallbackNS,i=Ce(r),n=!1;for(let r of e.languages){if(Ee(t.langDir,r),_e[r]=await _e[r],e.removeResourceBundle(r,i),void 0===_e[r]||void 0===_e[r][o])continue;let s=_e[r][o];n=!0,e.addResourceBundle(r,i,s)}e.setDefaultNamespace(n?i:r),t.requestUpdate()}
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Pe=globalThis,Le=Pe.ShadowRoot&&(void 0===Pe.ShadyCSS||Pe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ne=Symbol(),Re=new WeakMap;let De=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==Ne)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Le&&void 0===e){const o=void 0!==t&&1===t.length;o&&(e=Re.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&Re.set(t,e))}return e}toString(){return this.cssText}};const je=e=>new De("string"==typeof e?e:e+"",void 0,Ne),Te=(e,...t)=>{const o=1===e.length?e[0]:t.reduce(((t,o,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+