@allurereport/web-awesome
Version:
The static files for Allure Awesome Report
2 lines • 2.67 MB
JavaScript
/*! For license information please see app-62171f5f51b5954a787c.js.LICENSE.txt */
!function(){var e,t,n={3175:function(e,t,n){"use strict";n.d(t,{EW:function(){return l.EW},HO:function(){return v},QZ:function(){return l.QZ},R0:function(){return T},Ul:function(){return m},vA:function(){return l.vA},vP:function(){return l.vP}});var r,a,o,i=n(841),s=n(4501),l=n(2719),c="undefined"!=typeof window&&!!window.__PREACT_SIGNALS_DEVTOOLS__,u=[],d=[];function p(e,t){i.fF[e]=t.bind(null,i.fF[e]||function(){})}function f(e){o&&o(),o=e&&e.S()}function h(e){var t=this,n=e.data,r=m(n);r.value=n;var a=(0,s.Kr)((function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var a=(0,l.EW)((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""})),o=(0,l.EW)((function(){return!Array.isArray(a.value)&&!(0,i.zO)(a.value)})),s=(0,l.QZ)((function(){if(this.N=A,o.value){var t=a.value;e.__v&&e.__v.__e&&3===e.__v.__e.nodeType&&(e.__v.__e.data=t)}})),c=t.__$u.d;return t.__$u.d=function(){s(),c.call(this)},[o,a]}),[]),o=a[0],c=a[1];return o.value?c.peek():c.value}function g(e,t,n,r){var a=t in e&&void 0===e.ownerSVGElement,o=(0,l.vP)(n);return{o:function(e,t){o.value=e,r=t},d:(0,l.QZ)((function(){this.N=A;var n=o.value.value;r[t]!==n&&(r[t]=n,a?e[t]=n:null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}))}}function m(e,t){return(0,s.J0)((function(){return(0,l.vP)(e,t)}))[0]}function v(e,t){var n=(0,s.li)(e);return n.current=e,a.__$f|=4,(0,s.Kr)((function(){return(0,l.EW)((function(){return n.current()}),t)}),[])}(0,l.QZ)((function(){r=this.N}))(),h.displayName="ReactiveTextNode",Object.defineProperties(l.HN.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:h},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),p("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var a in r)if("children"!==a){var o=r[a];o instanceof l.HN&&(n||(t.__np=n={}),n[a]=o,r[a]=o.peek())}}e(t)})),p("__r",(function(e,t){if(t.type!==i.FK){f();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(e,t){var n;return(0,l.QZ)((function(){n=this}),{name:t}),n.c=e,n}((function(){var e;c&&(null==(e=n.y)||e.call(n)),r.__$f|=1,r.setState({})}),"function"==typeof t.type?t.type.displayName||t.type.name:""))),a=r,f(n)}e(t)})),p("__e",(function(e,t,n,r){f(),a=void 0,e(t,n,r)})),p("diffed",(function(e,t){var n;if(f(),a=void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var i=n.U;if(i)for(var s in i){var l=i[s];void 0===l||s in r||(l.d(),i[s]=void 0)}else i={},n.U=i;for(var c in r){var u=i[c],d=r[c];void 0===u?(u=g(n,c,d,o),i[c]=u):u.o(d,o)}}}e(t)})),p("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var a in n.U=void 0,r){var o=r[a];o&&o.d()}}}else{var i=t.__c;if(i){var s=i.__$u;s&&(i.__$u=void 0,s.d())}}e(t)})),p("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),i.uA.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&void 0!==n.s;for(var a in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){var o=2&this.__$f;if(!(r||o||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(r||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var i in e)if("__source"!==i&&e[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};var y="undefined"==typeof requestAnimationFrame?setTimeout:function(e){var t=function(){clearTimeout(n),cancelAnimationFrame(r),e()},n=setTimeout(t,35),r=requestAnimationFrame(t)},b=function(e){queueMicrotask((function(){queueMicrotask(e)}))};function x(){(0,l.vA)((function(){for(var e;e=u.shift();)r.call(e)}))}function w(){1===u.push(this)&&(i.fF.requestAnimationFrame||y)(x)}function k(){(0,l.vA)((function(){for(var e;e=d.shift();)r.call(e)}))}function A(){1===d.push(this)&&(i.fF.requestAnimationFrame||b)(k)}function T(e,t){var n=(0,s.li)(e);n.current=e,(0,s.vJ)((function(){return(0,l.QZ)((function(){return this.N=w,n.current()}),t)}),[])}},7249:function(e,t,n){"use strict";n.d(t,{a:function(){return i}});n(3175);var r=n(841),a=n(4501),o=function(e){return"function"==typeof e.children?e.children(e.v,e.i):e.children};function i(e){var t=(0,a.Kr)((function(){return new Map}),[]),n=("function"==typeof e.each?e.each():e.each).value;if(!n.length)return e.fallback||null;var i=new Set(t.keys()),s=n.map((function(n,a){if(i.delete(n),!t.has(n)){var s=(0,r.n)(o,{v:n,i:a,children:e.children});return t.set(n,s),s}return t.get(n)}));return i.forEach((function(e){t.delete(e)})),(0,r.n)(r.FK,null,s)}o.displayName="Item",i.displayName="For"},6049:function(e,t,n){"use strict";n.d(t,{Charts:function(){return z}});var r=n(3191),a=n(1848),o=n(2636),i=n(3175),s=n(4501),l=n(3715),c=n(4080),u=n(3317),d=n(8046),p=n.n(d),f=n(9607),h=n.n(f),g=n(2797),m=n.n(g),v=n(4926),y=n.n(v),b=n(8362),x=n.n(b),w=n(719),k=n.n(w),A=n(2152),T={};T.styleTagTransform=k(),T.setAttributes=y(),T.insert=m().bind(null,"head"),T.domAPI=h(),T.insertStyleElement=x();p()(A.Ay,T),A.Ay&&A.Ay.locals&&A.Ay.locals;var C=n(1968);const S=(0,i.EW)((()=>a.nc.value.current)),z=()=>{const{t:e}=(0,u.s9)("charts"),{t:t}=(0,u.s9)("empty");return(0,s.vJ)((()=>{(0,l.gS)()}),[]),(0,C.Y)(o.NP,{theme:S.value,children:(0,C.Y)(o.x_,{source:l.fH,renderLoader:()=>(0,C.Y)(o.DP,{}),renderData:n=>{const a=c.hf.value?n.byEnv[c.hf.value]:n.general;if(!a)return null;const i=Object.entries(a).map((([n,a])=>{const i=((e,{t:t,empty:n})=>{switch(e.type){case r.NB.CurrentStatus:{const n=e.title??t("currentStatus.title");return(0,C.Y)(o.sv,{title:n,data:e.data,statuses:e.statuses,metric:e.metric,i18n:(e,n={})=>t(`currentStatus.${e}`,n)})}case r.NB.StatusDynamics:{const n=e.title??t("statusDynamics.title");return(0,C.Y)(o.JD,{title:n,data:e.data,limit:e.limit,statuses:e.statuses,i18n:(e,n={})=>t(`statusDynamics.${e}`,n)})}case r.NB.StatusTransitions:{const n=e.title??t("statusTransitions.title");return(0,C.Y)(o.rE,{title:n,data:e.data,i18n:(e,n={})=>t(`statusTransitions.${e}`,n)})}case r.NB.Durations:{const n=e.title??("none"===e.groupBy?t("durations.title_none"):t("durations.title",{groupBy:e.groupBy}));return(0,C.Y)(o.Yg,{title:n,data:e.data,groupBy:e.groupBy,keys:e.keys,i18n:(e,n={})=>t(`durations.${e}`,n)})}case r.NB.StabilityDistribution:{const n=e.title??t("stabilityDistribution.title");return(0,C.Y)(o.Cr,{title:n,data:e.data,keys:e.keys,i18n:(e,n={})=>t(`stabilityDistribution.${e}`,n),threshold:e.threshold})}case r.NB.TestBaseGrowthDynamics:{const n=e.title??t("testBaseGrowthDynamics.title");return(0,C.Y)(o.BD,{title:n,data:e.data,statuses:e.statuses,i18n:(e,n={})=>t(`testBaseGrowthDynamics.${e}`,n)})}case r.NB.StatusAgePyramid:{const n=e.title??t("statusAgePyramid.title");return(0,C.Y)(o.ij,{title:n,data:e.data,statuses:e.statuses,i18n:(e,n={})=>t(`statusAgePyramid.${e}`,n)})}case r.NB.TrSeverities:{const n=e.title??t("trSeverities.title");return(0,C.Y)(o.ch,{title:n,data:e.data,levels:e.levels,statuses:e.statuses,i18n:(e,n={})=>t(`trSeverities.${e}`,n)})}case r.NB.DurationDynamics:{const n=e.title??t("durationDynamics.title");return(0,C.Y)(o.ff,{title:n,data:e.data,i18n:(e,n={})=>t(`durationDynamics.${e}`,n)})}case r.NB.CoverageDiff:return(0,C.Y)(o.b6,{data:e.treeMap,chartType:r.NB.CoverageDiff,title:e.title,formatLegend:e.formatLegend,colors:e.colors,legendDomain:e.legendDomain,tooltipRows:e.tooltipRows,translations:{"no-results":n("no-results")}});case r.NB.SuccessRateDistribution:return(0,C.Y)(o.b6,{chartType:r.NB.SuccessRateDistribution,data:e.treeMap,title:e.title,formatLegend:e.formatLegend,colors:e.colors,legendDomain:e.legendDomain,tooltipRows:e.tooltipRows,translations:{"no-results":n("no-results")}});case r.NB.ProblemsDistribution:return(0,C.Y)(o.Ds,{title:e.title,data:e.data,translations:{"no-results":n("no-results")}});case r.NB.TestingPyramid:{const t=!e.data.some((e=>e.testCount>0));return(0,C.Y)(o.Hz,{title:e.title,data:t?[]:e.data,translations:{"no-results":n("no-results")}})}default:return null}})(a,{t:e,empty:t});return(0,C.Y)(o.Ei,{className:A.Zn,children:i},n)}));return(0,C.Y)("div",{className:A.M0,children:(0,C.Y)(o.xA,{kind:"swap",className:A.z$,children:i})})}})})}},3127:function(e,t,n){"use strict";n.d(t,{Timeline:function(){return D}});var r=n(2636),a=n(3175),o=n(4501),i=n(9254),s=n(4080),l=n(1848);const c=(0,a.vP)({loading:!0,error:void 0,data:void 0});var u=n(8046),d=n.n(u),p=n(9607),f=n.n(p),h=n(2797),g=n.n(h),m=n(4926),v=n.n(m),y=n(8362),b=n.n(y),x=n(719),w=n.n(x),k=n(3182),A={};A.styleTagTransform=w(),A.setAttributes=v(),A.insert=g().bind(null,"head"),A.domAPI=f(),A.insertStyleElement=b();d()(k.Ay,A),k.Ay&&k.Ay.locals&&k.Ay.locals;var T=n(1968);const C=e=>[...new Set(e.map((e=>e.host)))],S=(e,t)=>e.filter((e=>e.host===t)),z=(0,a.EW)((()=>{const e=c.value.data??[];if(!e.length)return[];if(s.hf.value){const t=e.filter((e=>((e,t)=>void 0!==e.environmentName?e.environment===t:e.environment===(0,s.J_)(t))(e,s.hf.value)));return C(t).map((e=>({data:S(t,e),host:e})))}return C(e).map((t=>({data:S(e,t),host:t})))})),D=()=>{const{t:e}=(0,i.s9)("timeline");(0,o.vJ)((()=>{(async()=>{c.value={...c.value,loading:!0,error:void 0};try{const e=await(0,l.tj)("widgets/timeline.json",{bustCache:!0});c.value={data:e,error:void 0,loading:!1}}catch(e){c.value={data:void 0,error:e.message,loading:!1}}})()}),[]);const t=(0,o.Kr)((()=>({empty:e("empty"),selected:t=>e("selected",{count:t.count,percentage:t.percentage,minDuration:t.minDuration,maxDuration:t.maxDuration})})),[e]);return(0,T.Y)(r.x_,{source:c,renderLoader:()=>(0,T.Y)(r.DP,{}),renderData:()=>0===z.value.length?(0,T.Y)("div",{className:k.M0,children:(0,T.Y)(r.xA,{kind:"swap",className:k.z$,children:(0,T.Y)(r.Ei,{className:k.Zn,children:(0,T.Y)(r.x0,{children:(0,T.Y)("div",{className:k.Ie,children:e("empty")})})})})}):(0,T.Y)("div",{className:k.M0,children:(0,T.Y)(r.xA,{kind:"swap",className:k.z$,children:z.value.map((({data:n,host:a})=>(0,T.Y)(r.Ei,{className:k.Zn,children:(0,T.FD)(r.x0,{title:e("host",{host:a}),children:[n.length>0&&(0,T.Y)(r.Kf,{data:n,dataId:a,width:100,translations:t}),0===n.length&&(0,T.Y)("div",{className:k.Ie,children:e("empty_host",{host:a})})]})},a)))})})})}},3715:function(e,t,n){"use strict";n.d(t,{fH:function(){return s},gS:function(){return l},h2:function(){return i},u0:function(){return o}});var r=n(1848),a=n(3175);const o=(0,a.vP)({loading:!0,error:void 0,data:void 0}),i=async e=>{o.value={...o.peek(),loading:!0,error:void 0};try{const t=await(0,r.tj)(e?`widgets/${e}/statistic.json`:"widgets/statistic.json",{bustCache:!0});o.value={data:(0,r.Dc)(t),error:void 0,loading:!1}}catch(e){o.value={error:e.message,loading:!1}}},s=(0,a.vP)({loading:!0,error:void 0,data:void 0}),l=async()=>{s.value={...s.peek(),loading:!0,error:void 0};try{const e=await(0,r.tj)("widgets/charts.json",{bustCache:!0});s.value={data:(0,r.q2)(e),error:void 0,loading:!1}}catch(e){s.value={data:void 0,error:e.message,loading:!1}}}},4080:function(e,t,n){"use strict";n.d(t,{F8:function(){return u},GQ:function(){return i},Ir:function(){return l},J_:function(){return d},Zo:function(){return s},hf:function(){return c},lY:function(){return p},xO:function(){return f}});var r=n(1848),a=n(3175),o=n(4512);const i=(0,a.vP)({loading:!1,error:void 0,data:[]}),s=(0,a.vP)({loading:!1,error:void 0,data:{}}),l=(0,a.vP)((0,o.t)("collapsedEnvironments",[])),c=(0,a.vP)((0,o.t)("currentEnvironment","")),u=e=>{c.value=e},d=e=>(0,r.J_)(i.peek().data,e),p=async()=>{i.value={...i.peek(),loading:!0,error:void 0};try{const e=await(0,r.tj)("widgets/environments.json",{bustCache:!0}),t=(0,r.Yq)(e);i.value={data:t,error:void 0,loading:!1},c.value=(0,r.S_)(c.value,t)}catch(e){i.value={...i.peek(),error:(0,r.qX)(e),loading:!1}}},f=async e=>{if(!s.peek().data[e]){s.value={...s.peek(),loading:!0,error:void 0};try{const t=await(0,r.tj)(`data/test-env-groups/${e}.json`);s.value={data:{...s.peek().data,[e]:t},error:void 0,loading:!1}}catch(e){s.value={...s.peek(),error:(0,r.qX)(e),loading:!1}}}};(0,a.QZ)((()=>{localStorage.setItem("currentEnvironment",JSON.stringify(c.value))})),(0,a.QZ)((()=>{localStorage.setItem("collapsedEnvironments",JSON.stringify([...l.value]))}))},9254:function(e,t,n){"use strict";n.d(t,{xs:function(){return c.xs},Tp:function(){return l},Mz:function(){return s},JK:function(){return c.JK},xD:function(){return o},JC:function(){return i},s9:function(){return c.s9},Yk:function(){return c.Yk}});var r=n(1848),a=n(3175);const o=(0,a.vP)({loading:!0,error:void 0,data:{total:0}}),i=(0,a.vP)({loading:!0,error:void 0,data:{}}),s=async()=>{o.value={...o.peek(),loading:!0,error:void 0};try{const e=await(0,r.tj)("widgets/statistic.json",{bustCache:!0});o.value={data:e,error:void 0,loading:!1}}catch(e){o.value={data:{total:0},error:(0,r.qX)(e),loading:!1}}},l=async e=>{const t=e.filter((e=>!i.peek().data?.[e]));if(0!==t.length){i.value={...i.peek(),loading:!0,error:void 0};try{const e=await Promise.all(t.map((e=>(0,r.tj)(`widgets/${e}/statistic.json`,{bustCache:!0})))),n=i.peek().data;i.value={data:t.reduce(((t,n,r)=>({...t,[n]:e[r]})),{...n}),loading:!1,error:void 0}}catch(e){i.value={...i.peek(),error:(0,r.qX)(e),loading:!1}}}};var c=n(3317)},3317:function(e,t,n){"use strict";n.d(t,{IJ:function(){return G},xs:function(){return U},JK:function(){return X},xS:function(){return J},s9:function(){return K},Yk:function(){return Z}});var r=n(4684),a=n(1848),o=n(3175);const i=e=>"string"==typeof e,s=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n},l=e=>null==e?"":""+e,c=/###/g,u=e=>e&&e.indexOf("###")>-1?e.replace(c,"."):e,d=e=>!e||i(e),p=(e,t,n)=>{const r=i(t)?t.split("."):t;let a=0;for(;a<r.length-1;){if(d(e))return{};const t=u(r[a]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++a}return d(e)?{}:{obj:e,k:u(r[a])}},f=(e,t,n)=>{const{obj:r,k:a}=p(e,t,Object);if(void 0!==r||1===t.length)return void(r[a]=n);let o=t[t.length-1],i=t.slice(0,t.length-1),s=p(e,i,Object);for(;void 0===s.obj&&i.length;)o=`${i[i.length-1]}.${o}`,i=i.slice(0,i.length-1),s=p(e,i,Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},h=(e,t)=>{const{obj:n,k:r}=p(e,t);if(n)return n[r]},g=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?i(e[r])||e[r]instanceof String||i(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):g(e[r],t[r],n):e[r]=t[r]);return e},m=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var v={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const y=e=>i(e)?e.replace(/[&<>"'\/]/g,(e=>v[e])):e;const b=[" ",",","?","!",";"],x=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 n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),w=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let a=e;for(let e=0;e<r.length;){if(!a||"object"!=typeof a)return;let t,o="";for(let i=e;i<r.length;++i)if(i!==e&&(o+=n),o+=r[i],t=a[o],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&i<r.length-1)continue;e+=i-e+1;break}a=t}return a},k=e=>e?.replace("_","-"),A={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class T{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||A,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(i(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new T(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new T(this.logger,e)}}var C=new T;class S{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+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,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[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(...n)}))}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach((t=>{let[r,a]=t;for(let t=0;t<a;t++)r.apply(r,[e,...n])}))}}}class z extends S{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,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):i(n)&&a?s.push(...n.split(a)):s.push(n)));const l=h(this.data,s);return!l&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!l&&o&&i(n)?w(this.data?.[e]?.[t],n,a):l}addResource(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const o=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator;let i=[e,t];n&&(i=i.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(i=e.split("."),r=t,t=i[1]),this.addNamespaces(t),f(this.data,i,r),a.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const r in n)(i(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,a){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),r=n,n=t,t=i[1]),this.addNamespaces(t);let s=h(this.data,i)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?g(s,n,a):s={...s,...n},f(this.data,i,s),o.silent||this.emit("added",e,t,n)}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 D={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach((e=>{t=this.processors[e]?.process(t,n,r,a)??t})),t}};const _={};class E extends S{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((e,t,n)=>{e.forEach((e=>{t[e]&&(n[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=C.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 n=this.resolve(e,t);return void 0!==n?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=b.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const a=x.getRegExp(`(${r.map((e=>"?"===e?"\\?":e)).join("|")})`);let o=!a.test(e);if(!o){const t=e.indexOf(n);t>0&&!a.test(e.substring(0,t))&&(o=!0)}return o})(e,n,r));if(o&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:i(a)?[a]:a};const o=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(o[0])>-1)&&(a=o.shift()),e=o.join(r)}return{key:e,namespaces:i(a)?[a]:a}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(e[e.length-1],t),l=s[s.length-1],c=t.lng||this.language,u=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===c?.toLowerCase()){if(u){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${l}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:`${l}${e}${o}`}return r?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:o}const d=this.resolve(e,t);let p=d?.res;const f=d?.usedKey||o,h=d?.exactUsedKey||o,g=Object.prototype.toString.apply(p),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=!i(p)&&"boolean"!=typeof p&&"number"!=typeof p;if(!(v&&p&&y&&["[object Number]","[object Function]","[object RegExp]"].indexOf(g)<0)||i(m)&&Array.isArray(p))if(v&&i(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,e,t,n));else{let r=!1,s=!1;const u=void 0!==t.count&&!i(t.count),f=E.hasDefaultValue(t),h=u?this.pluralResolver.getSuffix(c,t.count,t):"",g=t.ordinal&&u?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",m=u&&!t.ordinal&&0===t.count,v=m&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${h}`]||t[`defaultValue${g}`]||t.defaultValue;!this.isValidLookup(p)&&f&&(r=!0,p=v),this.isValidLookup(p)||(s=!0,p=o);const y=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:p,b=f&&v!==p&&this.options.updateMissing;if(s||r||b){if(this.logger.log(b?"updateKey":"missingKey",c,l,o,b?v:p),a){const e=this.resolve(o,{...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 n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,n,r)=>{const a=f&&r!==p?r:y;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,n,a,b,t):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,n,a,b,t),this.emit("missingKey",e,l,n,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?e.forEach((e=>{const n=this.pluralResolver.getSuffixes(e,t);m&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach((n=>{r([e],o+n,t[`defaultValue${n}`]||v)}))})):r(e,o,v))}p=this.extendTranslation(p,e,t,d,n),s&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${l}:${o}`),(s||r)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,r?p: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(f,p,{...t,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(d.res=e,d.usedParams=this.getUsedParamsDetails(t),d):e}if(a){const e=Array.isArray(p),n=e?[]:{},r=e?h:f;for(const e in p)if(Object.prototype.hasOwnProperty.call(p,e)){const o=`${r}${a}${e}`;n[e]=this.translate(o,{...t,joinArrays:!1,ns:s}),n[e]===o&&(n[e]=p[e])}p=n}}return r?(d.res=p,d.usedParams=this.getUsedParamsDetails(t),d):p}extendTranslation(e,t,n,r,a){var o=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const s=i(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(s){const t=e.match(this.interpolator.nestingRegexp);l=t&&t.length}let c=n.replace&&!i(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,n.lng||this.language||r.usedLng,n),s){const t=e.match(this.interpolator.nestingRegexp);l<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return a?.[0]!==r[0]||n.context?o.translate(...r,t):(o.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null)}),n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,l=i(s)?[s]:s;return null!=e&&l?.length&&!1!==n.applyPostProcessor&&(e=D.handle(l,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,r,a,o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i(e)&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const l=this.extractFromKey(e,s),c=l.key;n=c;let u=l.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const d=void 0!==s.count&&!i(s.count),p=d&&!s.ordinal&&0===s.count,f=void 0!==s.context&&(i(s.context)||"number"==typeof s.context)&&""!==s.context,h=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);u.forEach((e=>{this.isValidLookup(t)||(o=e,_[`${h[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(_[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${h.join(", ")}" won't get resolved as namespace "${o}" 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!!!")),h.forEach((n=>{if(this.isValidLookup(t))return;a=n;const o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,n,e,s);else{let e;d&&(e=this.pluralResolver.getSuffix(n,s.count,s));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(o.push(c+e),s.ordinal&&0===e.indexOf(r)&&o.push(c+e.replace(r,this.options.pluralSeparator)),p&&o.push(c+t)),f){const n=`${c}${this.options.contextSeparator}${s.context}`;o.push(n),d&&(o.push(n+e),s.ordinal&&0===e.indexOf(r)&&o.push(n+e.replace(r,this.options.pluralSeparator)),p&&o.push(n+t))}}let i;for(;i=o.pop();)this.isValidLookup(t)||(r=i,t=this.getResource(n,e,i,s))})))}))})),{res:t,usedKey:n,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}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"],n=e.replace&&!i(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class M{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=C.create("languageUtils")}getScriptPartFromCode(e){if(!(e=k(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=k(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(i(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 n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.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)),i(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],a=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return i(e)&&(e.indexOf("-")>-1||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))):i(e)&&a(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&a(this.formatLanguageCode(e))})),r}}const L={zero:0,one:1,two:2,few:3,many:4,other:5},N={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class R{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=C.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 n=k("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:r});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),N;if(!e.match(/-|_/))return N;const r=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(r,t)}return this.pluralRulesCache[a]=o,o}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort(((e,t)=>L[e]-L[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const P=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=((e,t,n)=>{const r=h(e,n);return void 0!==r?r:h(t,n)})(e,t,n);return!o&&a&&i(n)&&(o=w(e,n,r),void 0===o&&(o=w(t,n,r))),o},O=e=>e.replace(/\$/g,"$$$$");class F{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=C.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:a,prefixEscaped:o,suffix:i,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:f,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:y,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=a?m(a):o||"{{",this.suffix=i?m(i):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?m(d):p||m("$t("),this.nestingSuffix=f?m(f):h||m(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>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,n,r){let a,o,s;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(e.indexOf(this.formatSeparator)<0){const a=P(t,c,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(a,void 0,n,{...r,...t,interpolationkey:e}):a}const a=e.split(this.formatSeparator),o=a.shift().trim(),i=a.join(this.formatSeparator).trim();return this.format(P(t,c,o,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...r,...t,interpolationkey:o})};this.resetRegExp();const d=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>O(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?O(this.escape(e)):O(e)}].forEach((t=>{for(s=0;a=t.regex.exec(e);){const n=a[1].trim();if(o=u(n),void 0===o)if("function"==typeof d){const t=d(e,a,r);o=i(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))o="";else{if(p){o=a[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o=""}else i(o)||this.useRawValueToEscape||(o=l(o));const c=t.safeValue(o);if(e=e.replace(a[0],c),p?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=a[0].length):t.regex.lastIndex=0,s++,s>=this.maxReplaces)break}})),e}nest(e,t){let n,r,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let o=`{${r[1]}`;e=r[0],o=this.interpolate(o,a);const i=o.match(/'/g),s=o.match(/"/g);((i?.length??0)%2==0&&!s||s.length%2!=0)&&(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let c=[];a={...o},a=a.replace&&!i(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),c=e,u=!0}if(r=t(s.call(this,n[1].trim(),a),a),r&&n[0]===e&&!i(r))return r;i(r)||(r=l(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),u&&(r=c.reduce(((e,t)=>this.format(e,t,o.lng,{...o,interpolationkey:n[1].trim()})),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const I=e=>{const t={};return(n,r,a)=>{let o=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(o={...o,[a.interpolationkey]:void 0});const i=r+JSON.stringify(o);let s=t[i];return s||(s=e(k(r),a),t[i]=s),s(n)}};class j{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=C.create("formatter"),this.options=e,this.formats={number:I(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:I(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:I(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:I(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:I(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.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()]=I(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find((e=>e.indexOf(")")>-1))){const e=a.findIndex((e=>e.indexOf(")")>-1));a[0]=[a[0],...a.splice(1,e)].join(this.formatSeparator)}return a.reduce(((e,t)=>{const{formatName:a,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);"currency"===t&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):"relativetime"===t&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach((e=>{if(e){const[t,...r]=e.split(":"),a=r.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=a),"false"===a&&(n[o]=!1),"true"===a&&(n[o]=!0),isNaN(a)||(n[o]=parseInt(a,10))}}))}return{formatName:t,formatOptions:n}})(t);if(this.formats[a]){let t=e;try{const i=r?.formatParams?.[r.interpolationkey]||{},s=i.locale||i.lng||r.locale||r.lng||n;t=this.formats[a](e,s,{...o,...r,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${a}`),e}),e)}}class q extends S{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=C.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){const a={},o={},i={},s={};return e.forEach((e=>{let r=!0;t.forEach((t=>{const i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===o[i]&&(o[i]=!0):(this.state[i]=1,r=!1,void 0===o[i]&&(o[i]=!0),void 0===a[i]&&(a[i]=!0),void 0===s[t]&&(s[t]=!0)))})),r||(i[e]=!0)})),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),a=r[0],o=r[1];t&&this.emit("failedLoading",a,o,t),!t&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const i={};this.queue.forEach((n=>{((e,t,n)=>{const{obj:r,k:a}=p(e,t,Object);r[a]=r[a]||[],r[a].push(n)})(n.loaded,[a],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{i[e]||(i[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===i[e][t]&&(i[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",i),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:a,callback:o});this.readingCalls++;const i=(i,s)=>{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)}i&&s&&r<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,n,r+1,2*a,o)}),a):o(i,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,i);try{const n=s(e,t);n&&"function"==typeof n.then?n.then((e=>i(null,e))).catch(i):i(null,n)}catch(e){i(e)}}prepareLoading(e,t){let n=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();i(e)&&(e=this.languageUtils.toResolveHierarchy(e)),i(t)&&(t=[t]);const a=this.queueLoad(e,t,n,r);if(!a.toLoad.length)return a.pending.length||r(),null;a.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],a=n[1];this.read(r,a,"read",void 0,void 0,((n,o)=>{n&&this.logger.warn(`${t}loading namespace ${a} for language ${r} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${r}`,o),this.loaded(e,n,o)}))}saveMissing(e,t,n,r,a){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const s={...o,isUpdate:a},l=this.backend.create.bind(this.backend);if(l.length<6)try{let a;a=5===l.length?l(e,t,n,r,s):l(e,t,n,r),a&&"function"==typeof a.then?a.then((e=>i(null,e))).catch(i):i(null,a)}catch(e){i(e)}else l(e,t,n,r,i,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" 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 B=()=>({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]),i(e[1])&&(t.defaultValue=e[1]),i(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),W=e=>(i(e.ns)&&(e.ns=[e.ns]),i(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),i(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),H=()=>{};class V extends S{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=W(e),this.services={},this.logger=C,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),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]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(i(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=B();this.options={...r,...this.options,...W(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const a=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?C.init(a(this.modules.logger),this.options):C.init(null,this.options),t=this.modules.formatter?this.modules.formatter:j;const n=new M(this.options);this.store=new z(this.options.resources,this.options);const o=this.services;o.logger=C,o.resourceStore=this.store,o.languageUtils=n,o.pluralResolver=new R(n,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(o.formatter=a(t),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new F(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new q(a(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];e.emit(t,...r)})),this.modules.languageDetector&&(o.languageDetector=a(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=a(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new E(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];e.emit(t,...r)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=H),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 o=s(),l=()=>{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),o.resolve(t),n(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?l():setTimeout(l,0),o}loadResources(