@dbp-topics/signature
Version:
[GitLab Repository](https://gitlab.tugraz.at/dbp/esign/signature) | [npmjs package](https://www.npmjs.com/package/@dbp-topics/signature) | [Unpkg CDN](https://unpkg.com/browse/@dbp-topics/signature/) | [Esign Bundle](https://gitlab.tugraz.at/dbp/esign/dbp
26 lines • 134 kB
JavaScript
let e,t,r,o,n,a,i,s,l,c,u,d,p,h,f,b=e=>e;function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},g.apply(this,arguments)}
/*!
* License: LGPL-2.1-or-later
* Dependencies:
*
* @webcomponents/scoped-custom-element-registry: BSD-3-Clause
* @dbp-toolkit/app-shell: LGPL-2.1-or-later
* @dbp-toolkit/language-select: LGPL-2.1-or-later
* @dbp-toolkit/common: LGPL-2.1-or-later
* @dbp-toolkit/auth: LGPL-2.1-or-later
* event-target-shim: MIT
* @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
* @tugraz/web-components: LGPL-2.1-or-later
* @babel/runtime: MIT
* i18next: MIT
* @lit/reactive-element: BSD-3-Clause
* lit-html: BSD-3-Clause
* lit-element: BSD-3-Clause
* @open-wc/dedupe-mixin: MIT
* @open-wc/scoped-elements: MIT
*/function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function k(e,t,r){return t&&y(e.prototype,t),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function S(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}function O(e,t){if(t&&("object"===v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return w(e)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function P(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},R=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.init(t,r)}return k(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||$,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,o){return o&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,j(j({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}(),N=new R,L=function(){function e(){m(this,e),this.observers={}}return k(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach((function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(this.observers[e]){var n=[].concat(this.observers[e]);n.forEach((function(e){e.apply(void 0,r)}))}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach((function(t){t.apply(t,[e].concat(r))}))}}}]),e}();function D(){var e,t,r=new Promise((function(r,o){e=r,t=o}));return r.resolve=e,r.reject=t,r}function F(e){return null==e?"":""+e}function T(e,t,r){e.forEach((function(e){t[e]&&(r[e]=t[e])}))}function I(e,t,r){function o(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function n(){return!e||"string"==typeof e}for(var a="string"!=typeof t?[].concat(t):t.split(".");a.length>1;){if(n())return{};var i=o(a.shift());!e[i]&&r&&(e[i]=new r),e=Object.prototype.hasOwnProperty.call(e,i)?e[i]:{}}return n()?{}:{obj:e,k:o(a.shift())}}function z(e,t,r){var o=I(e,t,Object);o.obj[o.k]=r}function U(e,t){var r=I(e,t),o=r.obj,n=r.k;if(o)return o[n]}function B(e,t,r){var o=U(e,r);return void 0!==o?o:U(t,r)}function M(e,t,r){for(var o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?"string"==typeof e[o]||e[o]instanceof String||"string"==typeof t[o]||t[o]instanceof String?r&&(e[o]=t[o]):M(e[o],t[o],r):e[o]=t[o]);return e}function H(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var V={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function K(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return V[e]})):e}var q="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,J=[" ",",","?","!",";"];function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=C(e);if(t){var n=C(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return O(this,r)}}function Z(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var o=t.split(r),n=e,a=0;a<o.length;++a){if(!n)return;if("string"==typeof n[o[a]]&&a+1<o.length)return;if(void 0===n[o[a]]){for(var i=2,s=o.slice(a,a+i).join(r),l=n[s];void 0===l&&o.length>a+i;)i++,l=n[s=o.slice(a,a+i).join(r)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var c=o.slice(a+i).join(r);return c?Z(l,c,r):void 0}n=n[o[a]]}return n}}var X=function(e){S(r,L);var t=W(r);function r(e){var o,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return m(this,r),o=t.call(this),q&&L.call(w(o)),o.data=e||{},o.options=n,void 0===o.options.keySeparator&&(o.options.keySeparator="."),void 0===o.options.ignoreJSONStructure&&(o.options.ignoreJSONStructure=!0),o}return k(r,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure,i=[e,t];r&&"string"!=typeof r&&(i=i.concat(r)),r&&"string"==typeof r&&(i=i.concat(n?r.split(n):r)),e.indexOf(".")>-1&&(i=e.split("."));var s=U(this.data,i);return s||!a||"string"!=typeof r?s:Z(this.data&&this.data[e]&&this.data[e][t],r,n)}},{key:"addResource",value:function(e,t,r,o){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},a=this.options.keySeparator;void 0===a&&(a=".");var i=[e,t];r&&(i=i.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(o=t,t=(i=e.split("."))[1]),this.addNamespaces(t),z(this.data,i,o),n.silent||this.emit("added",e,t,r,o)}},{key:"addResources",value:function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var n in r)"string"!=typeof r[n]&&"[object Array]"!==Object.prototype.toString.apply(r[n])||this.addResource(e,t,n,r[n],{silent:!0});o.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,o,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},i=[e,t];e.indexOf(".")>-1&&(o=r,r=t,t=(i=e.split("."))[1]),this.addNamespaces(t);var s=U(this.data,i)||{};o?M(s,r,n):s=Y(Y({},s),r),z(this.data,i,s),a.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Y(Y({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),r}(),Q={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,o,n){var a=this;return e.forEach((function(e){a.processors[e]&&(t=a.processors[e].process(t,r,o,n))})),t}};function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function re(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=C(e);if(t){var n=C(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return O(this,r)}}var oe={},ne=function(e){S(r,L);var t=re(r);function r(e){var o,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m(this,r),o=t.call(this),q&&L.call(w(o)),T(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,w(o)),o.options=n,void 0===o.options.keySeparator&&(o.options.keySeparator="."),o.logger=N.create("translator"),o}return k(r,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,n=t.ns||this.options.defaultNS||[],a=r&&e.indexOf(r)>-1,i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,r){t=t||"",r=r||"";var o=J.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(0===o.length)return!0;var n=new RegExp("(".concat(o.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),a=!n.test(e);if(!a){var i=e.indexOf(r);i>0&&!n.test(e.substring(0,i))&&(a=!0)}return a}(e,r,o));if(a&&!i){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:n};var l=e.split(r);(r!==o||r===o&&this.options.ns.indexOf(l[0])>-1)&&(n=l.shift()),e=l.join(o)}return"string"==typeof n&&(n=[n]),{key:e,namespaces:n}}},{key:"translate",value:function(e,t,o){var n=this;if("object"!==v(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var a=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,c=s.namespaces,u=c[c.length-1],d=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return a?(f.res="".concat(u).concat(h).concat(l),f):"".concat(u).concat(h).concat(l)}return a?(f.res=l,f):l}var f=this.resolve(e,t),b=f&&f.res,g=f&&f.usedKey||l,m=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(b),k=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,S="string"!=typeof b&&"boolean"!=typeof b&&"number"!=typeof b;if(x&&b&&S&&k.indexOf(y)<0&&("string"!=typeof w||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var O=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,b,te(te({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return a?(f.res=O,f):O}if(i){var C="[object Array]"===y,E=C?[]:{},A=C?m:g;for(var P in b)if(Object.prototype.hasOwnProperty.call(b,P)){var _="".concat(A).concat(i).concat(P);E[P]=this.translate(_,te(te({},t),{joinArrays:!1,ns:c})),E[P]===_&&(E[P]=b[P])}b=E}}else if(x&&"string"==typeof w&&"[object Array]"===y)(b=b.join(w))&&(b=this.extendTranslation(b,e,t,o));else{var j=!1,$=!1,R=void 0!==t.count&&"string"!=typeof t.count,N=r.hasDefaultValue(t),L=R?this.pluralResolver.getSuffix(d,t.count,t):"",D=t["defaultValue".concat(L)]||t.defaultValue;!this.isValidLookup(b)&&N&&(j=!0,b=D),this.isValidLookup(b)||($=!0,b=l);var F=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,T=F&&$?void 0:b,I=N&&D!==b&&this.options.updateMissing;if($||j||I){if(this.logger.log(I?"updateKey":"missingKey",d,u,l,I?D:b),i){var z=this.resolve(l,te(te({},t),{},{keySeparator:!1}));z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var U=[],B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&B&&B[0])for(var M=0;M<B.length;M++)U.push(B[M]);else"all"===this.options.saveMissingTo?U=this.languageUtils.toResolveHierarchy(t.lng||this.language):U.push(t.lng||this.language);var H=function(e,r,o){var a=N&&o!==b?o:T;n.options.missingKeyHandler?n.options.missingKeyHandler(e,u,r,a,I,t):n.backendConnector&&n.backendConnector.saveMissing&&n.backendConnector.saveMissing(e,u,r,a,I,t),n.emit("missingKey",e,u,r,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?U.forEach((function(e){n.pluralResolver.getSuffixes(e,t).forEach((function(r){H([e],l+r,t["defaultValue".concat(r)]||D)}))})):H(U,l,D))}b=this.extendTranslation(b,e,t,f,o),$&&b===l&&this.options.appendNamespaceToMissingKey&&(b="".concat(u,":").concat(l)),($||j)&&this.options.parseMissingKeyHandler&&(b="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,j?b:void 0):this.options.parseMissingKeyHandler(b))}return a?(f.res=b,f):b}},{key:"extendTranslation",value:function(e,t,r,o,n){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,te(te({},this.options.interpolation.defaultVariables),r),o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(te(te({},r),{interpolation:te(te({},this.options.interpolation),r.interpolation)}));var i,s="string"==typeof e&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var l=e.match(this.interpolator.nestingRegexp);i=l&&l.length}var c=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(c=te(te({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,r.lng||this.language,r),s){var u=e.match(this.interpolator.nestingRegexp);i<(u&&u.length)&&(r.nest=!1)}!1!==r.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];return n&&n[0]===o[0]&&!r.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(o[0]," in key: ").concat(t[0])),null):a.translate.apply(a,o.concat([t]))}),r)),r.interpolation&&this.interpolator.reset()}var d=r.postProcess||this.options.postProcess,p="string"==typeof d?[d]:d;return null!=e&&p&&p.length&&!1!==r.applyPostProcessor&&(e=Q.handle(p,e,t,this.options&&this.options.postProcessPassResolved?te({i18nResolved:o},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,o,n,a,i=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!i.isValidLookup(t)){var l=i.extractFromKey(e,s),c=l.key;r=c;var u=l.namespaces;i.options.fallbackNS&&(u=u.concat(i.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,p=d&&!s.ordinal&&0===s.count&&i.pluralResolver.shouldUseIntlApi(),h=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,f=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);u.forEach((function(e){i.isValidLookup(t)||(a=e,!oe["".concat(f[0],"-").concat(e)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(a)&&(oe["".concat(f[0],"-").concat(e)]=!0,i.logger.warn('key "'.concat(r,'" for languages "').concat(f.join(", "),'" won\'t get resolved as 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!!!")),f.forEach((function(r){if(!i.isValidLookup(t)){n=r;var a,l=[c];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(l,c,r,e,s);else{var u;d&&(u=i.pluralResolver.getSuffix(r,s.count,s));var f="".concat(i.options.pluralSeparator,"zero");if(d&&(l.push(c+u),p&&l.push(c+f)),h){var b="".concat(c).concat(i.options.contextSeparator).concat(s.context);l.push(b),d&&(l.push(b+u),p&&l.push(b+f))}}for(;a=l.pop();)i.isValidLookup(t)||(o=a,t=i.getResource(r,e,a,s))}})))}))}})),{res:t,usedKey:r,exactUsedKey:o,usedLng:n,usedNS:a}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,o):this.resourceStore.getResource(e,t,r,o)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}]),r}();function ae(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ie=function(){function e(t){m(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=N.create("languageUtils")}return k(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=ae(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=ae(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=ae(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,r=this;return e?(e.forEach((function(e){if(!t){var o=r.formatLanguageCode(e);r.options.supportedLngs&&!r.isSupportedCode(o)||(t=o)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var o=r.getLanguagePartFromCode(e);if(r.isSupportedCode(o))return t=o;t=r.options.supportedLngs.find((function(e){if(0===e.indexOf(o))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],a=function(e){e&&(r.isSupportedCode(e)?n.push(e):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(e))):"string"==typeof e&&a(this.formatLanguageCode(e)),o.forEach((function(e){n.indexOf(e)<0&&a(r.formatLanguageCode(e))})),n}}]),e}(),se=[{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","kk","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","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}],le={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},ce=["v1","v2","v3"],ue={zero:0,one:1,two:2,few:3,many:4,other:5};function de(){var e={};return se.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:le[t.fc]}}))})),e}var pe=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(this,e),this.languageUtils=t,this.options=r,this.logger=N.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=de()}return k(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,t);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,r).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.getRule(e,r);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort((function(e,t){return ue[e]-ue[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):o.numbers.map((function(o){return t.getSuffix(e,o,r)})):[]}},{key:"getSuffix",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.getRule(e,r);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(t)):this.getSuffixRetroCompatible(o,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var r=this,o=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),n=e.numbers[o];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===n?n="plural":1===n&&(n=""));var a=function(){return r.options.prepend&&n.toString()?r.options.prepend+n.toString():n.toString()};return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?"_plural_".concat(n.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!ce.includes(this.options.compatibilityJSON)}}]),e}();function he(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var be=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.logger=N.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return k(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:K,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?H(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?H(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?H(t.nestingPrefix):t.nestingPrefixEscaped||H("$t("),this.nestingSuffix=t.nestingSuffix?H(t.nestingSuffix):t.nestingSuffixEscaped||H(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,o){var n,a,i,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(s.formatSeparator)<0){var n=B(t,l,e);return s.alwaysFormat?s.format(n,void 0,r,fe(fe(fe({},o),t),{},{interpolationkey:e})):n}var a=e.split(s.formatSeparator),i=a.shift().trim(),c=a.join(s.formatSeparator).trim();return s.format(B(t,l,i),c,r,fe(fe(fe({},o),t),{},{interpolationkey:i}))};this.resetRegExp();var d=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,p=o&&o.interpolation&&void 0!==o.interpolation.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(i=0;n=t.regex.exec(e);){var r=n[1].trim();if(void 0===(a=u(r)))if("function"==typeof d){var l=d(e,n,o);a="string"==typeof l?l:""}else if(o&&o.hasOwnProperty(r))a="";else{if(p){a=n[0];continue}s.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),a=""}else"string"==typeof a||s.useRawValueToEscape||(a=F(a));var c=t.safeValue(a);if(e=e.replace(n[0],c),p?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=n[0].length):t.regex.lastIndex=0,++i>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var r,o,n=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=fe({},a);function s(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var o=e.split(new RegExp("".concat(r,"[ ]*{"))),n="{".concat(o[1]);e=o[0],n=(n=this.interpolate(n,i)).replace(/'/g,'"');try{i=JSON.parse(n),t&&(i=fe(fe({},t),i))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(r).concat(n)}return delete i.defaultValue,e}for(i.applyPostProcessor=!1,delete i.defaultValue;r=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){var u=r[1].split(this.formatSeparator).map((function(e){return e.trim()}));r[1]=u.shift(),l=u,c=!0}if((o=t(s.call(this,r[1].trim(),i),i))&&r[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=F(o)),o||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),o=""),c&&(o=l.reduce((function(e,t){return n.format(e,t,a.lng,fe(fe({},a),{},{interpolationkey:r[1].trim()}))}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}]),e}();function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var me=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.logger=N.create("formatter"),this.options=t,this.formats={number:function(e,t,r){return new Intl.NumberFormat(t,r).format(e)},currency:function(e,t,r){return new Intl.NumberFormat(t,ve(ve({},r),{},{style:"currency"})).format(e)},datetime:function(e,t,r){return new Intl.DateTimeFormat(t,ve({},r)).format(e)},relativetime:function(e,t,r){return new Intl.RelativeTimeFormat(t,ve({},r)).format(e,r.range||"day")},list:function(e,t,r){return new Intl.ListFormat(t,ve({},r)).format(e)}},this.init(t)}return k(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=t.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"format",value:function(e,t,r,o){var n=this,a=t.split(this.formatSeparator).reduce((function(e,t){var a=function(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var o=e.split("(");t=o[0].toLowerCase().trim();var n=o[1].substring(0,o[1].length-1);"currency"===t&&n.indexOf(":")<0?r.currency||(r.currency=n.trim()):"relativetime"===t&&n.indexOf(":")<0?r.range||(r.range=n.trim()):n.split(";").forEach((function(e){if(e){var t=P(e.split(":")),o=t[0],n=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");r[o.trim()]||(r[o.trim()]=n),"false"===n&&(r[o.trim()]=!1),"true"===n&&(r[o.trim()]=!0),isNaN(n)||(r[o.trim()]=parseInt(n,10))}}))}return{formatName:t,formatOptions:r}}(t),i=a.formatName,s=a.formatOptions;if(n.formats[i]){var l=e;try{var c=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},u=c.locale||c.lng||o.locale||o.lng||r;l=n.formats[i](e,u,ve(ve(ve({},s),o),c))}catch(e){n.logger.warn(e)}return l}return n.logger.warn("there was no format function for ".concat(i)),e}),e);return a}}]),e}();function ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function we(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=C(e);if(t){var n=C(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return O(this,r)}}var xe=function(e){S(r,L);var t=we(r);function r(e,o,n){var a,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return m(this,r),a=t.call(this),q&&L.call(w(a)),a.backend=e,a.store=o,a.services=n,a.languageUtils=n.languageUtils,a.options=i,a.logger=N.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=i.maxParallelReads||10,a.readingCalls=0,a.maxRetries=i.maxRetries>=0?i.maxRetries:5,a.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(n,i.backend,i),a}return k(r,[{key:"queueLoad",value:function(e,t,r,o){var n=this,a={},i={},s={},l={};return e.forEach((function(e){var o=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!r.reload&&n.store.hasResourceBundle(e,t)?n.state[s]=2:n.state[s]<0||(1===n.state[s]?void 0===i[s]&&(i[s]=!0):(n.state[s]=1,o=!1,void 0===i[s]&&(i[s]=!0),void 0===a[s]&&(a[s]=!0),void 0===l[t]&&(l[t]=!0)))})),o||(s[e]=!0)})),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,r){var o=e.split("|"),n=o[0],a=o[1];t&&this.emit("failedLoading",n,a,t),r&&this.store.addResourceBundle(n,a,r),this.state[e]=t?-1:2;var i={};this.queue.forEach((function(r){!function(e,t,r,o){var n=I(e,t,Object),a=n.obj,i=n.k;a[i]=a[i]||[],o&&(a[i]=a[i].concat(r)),o||a[i].push(r)}(r.loaded,[n],a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach((function(e){i[e]||(i[e]={});var t=r.loaded[e];t.length&&t.forEach((function(t){void 0===i[e][t]&&(i[e][t]=!0)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",i),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,r){var o=this,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:a,callback:i}):(this.readingCalls++,this.backend[r](e,t,(function(s,l){if(o.readingCalls--,o.waitingReads.length>0){var c=o.waitingReads.shift();o.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&l&&n<o.maxRetries?setTimeout((function(){o.read.call(o,e,t,r,n+1,2*a,i)}),a):i(s,l)}))):i(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=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."),n&&n();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var a=this.queueLoad(e,t,o,n);if(!a.toLoad.length)return a.pending.length||n(),null;a.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e.split("|"),n=o[0],a=o[1];this.read(n,a,"read",void 0,void 0,(function(o,i){o&&t.logger.warn("".concat(r,"loading namespace ").concat(a," for language ").concat(n," failed"),o),!o&&i&&t.logger.log("".concat(r,"loaded namespace ").concat(a," for language ").concat(n),i),t.loaded(e,o,i)}))}},{key:"saveMissing",value:function(e,t,r,o,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(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!!!"):null!=r&&""!==r&&(this.backend&&this.backend.create&&this.backend.create(e,t,r,o,null,ke(ke({},a),{},{isUpdate:n})),e&&e[0]&&this.store.addResource(e[0],t,r,o))}}]),r}();function Se(){return{debug:!1,initImmediate:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===v(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===v(e[2])||"object"===v(e[3])){var r=e[3]||e[2];Object.keys(r).forEach((function(e){t[e]=r[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,r,o){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Oe(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function Ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ae(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=C(e);if(t){var n=C(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return O(this,r)}}function Pe(){}function _e(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var je=function(e){S(r,L);var t=Ae(r);function r(){var e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(m(this,r),e=t.call(this),q&&L.call(w(e)),e.options=Oe(o),e.services={},e.logger=N,e.modules={external:[]},_e(w(e)),n&&!e.isInitialized&&!o.isClone){if(!e.options.initImmediate)return e.init(o,n),O(e,w(e));setTimeout((function(){e.init(o,n)}),0)}return e}return k(r,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(r=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var o=Se();function n(e){return e?"function"==typeof e?new e:e:null}if(this.options=Ee(Ee(Ee({},o),this.options),Oe(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Ee(Ee({},o.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var a;this.modules.logger?N.init(n(this.modules.logger),this.options):N.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"undefined"!=typeof Intl&&(a=me);var i=new ie(this.options);this.store=new X(this.options.resources,this.options);var s=this.services;s.logger=N,s.resourceStore=this.store,s.languageUtils=i,s.pluralResolver=new pe(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!a||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(s.formatter=n(a),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new be(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new xe(n(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];e.emit.apply(e,[t].concat(o))})),this.modules.languageDetector&&(s.languageDetector=n(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=n(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new ne(this.services,this.options),this.translator.on("*",(function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];e.emit.apply(e,[t].concat(o))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,r||(r=Pe),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(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(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments),e}}));var d=D(),p=function(){var t=function(t,o){e.isInitialized&&!e.initializedStoreOnce&&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),d.resolve(o),r(t,o)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.o