@akinon/akifilter 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -28,4 +28,4 @@ function print() { __p += __j.call(arguments, '') }
28
28
  }`;var M1=me(function(){return b1(v,e1+"return "+L).apply(r,g)});if(M1.source=L,i5(M1))throw M1;return M1}function Io(e){return S1(e).toLowerCase()}function Oo(e){return S1(e).toUpperCase()}function Po(e,t,i){if(e=S1(e),e&&(i||t===r))return O8(e);if(!e||!(t=b2(t)))return e;var l=U2(e),u=U2(t),v=P8(l,u),g=A8(l,u)+1;return y3(l,v,g).join("")}function Ao(e,t,i){if(e=S1(e),e&&(i||t===r))return e.slice(0,E8(e)+1);if(!e||!(t=b2(t)))return e;var l=U2(e),u=A8(l,U2(t))+1;return y3(l,0,u).join("")}function Co(e,t,i){if(e=S1(e),e&&(i||t===r))return e.replace(i4,"");if(!e||!(t=b2(t)))return e;var l=U2(e),u=P8(l,U2(t));return y3(l,u).join("")}function Eo(e,t){var i=v1,l=j;if(N1(t)){var u="separator"in t?t.separator:u;i="length"in t?g1(t.length):i,l="omission"in t?b2(t.omission):l}e=S1(e);var v=e.length;if(Y3(e)){var g=U2(e);v=g.length}if(i>=v)return e;var z=i-K3(l);if(z<1)return l;var b=g?y3(g,0,z).join(""):e.slice(0,z);if(u===r)return b+l;if(g&&(z+=b.length-z),c5(u)){if(e.slice(z).search(u)){var A,C=b;for(u.global||(u=_4(u.source,S1(q5.exec(u))+"g")),u.lastIndex=0;A=u.exec(C);)var L=A.index;b=b.slice(0,L===r?z:L)}}else if(e.indexOf(b2(u),z)!=z){var H=b.lastIndexOf(u);H>-1&&(b=b.slice(0,H))}return b+l}function ko(e){return e=S1(e),e&&Vt.test(e)?e.replace(Y5,ir):e}var Lo=e6(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()}),a5=z7("toUpperCase");function Me(e,t,i){return e=S1(e),t=i?r:t,t===r?er(e)?lr(e):H9(e):e.match(t)||[]}var me=m1(function(e,t){try{return x2(e,r,t)}catch(i){return i5(i)?i:new d1(i)}}),To=s3(function(e,t){return E2(t,function(i){i=J2(i),r3(e,i,n5(e[i],e))}),e});function Fo(e){var t=e==null?0:e.length,i=i1();return e=t?R1(e,function(l){if(typeof l[1]!="function")throw new k2(h);return[i(l[0]),l[1]]}):[],m1(function(l){for(var u=-1;++u<t;){var v=e[u];if(x2(v[0],this,l))return x2(v[1],this,l)}})}function $o(e){return cn(T2(e,x))}function u5(e){return function(){return e}}function Ro(e,t){return e==null||e!==e?t:e}var Do=x7(),No=x7(!0);function g2(e){return e}function h5(e){return Z8(typeof e=="function"?e:T2(e,x))}function Uo(e){return Q8(T2(e,x))}function Vo(e,t){return e7(e,T2(t,x))}var Wo=m1(function(e,t){return function(i){return w6(i,e,t)}}),Bo=m1(function(e,t){return function(i){return w6(e,i,t)}});function f5(e,t,i){var l=X1(t),u=f0(t,l);i==null&&!(N1(t)&&(u.length||!l.length))&&(i=t,t=e,e=this,u=f0(t,X1(t)));var v=!(N1(i)&&"chain"in i)||!!i.chain,g=c3(e);return E2(u,function(z){var b=t[z];e[z]=b,g&&(e.prototype[z]=function(){var A=this.__chain__;if(v||A){var C=e(this.__wrapped__),L=C.__actions__=d2(this.__actions__);return L.push({func:b,args:arguments,thisArg:e}),C.__chain__=A,C}return b.apply(e,v3([this.value()],arguments))})}),e}function jo(){return t2._===this&&(t2._=vr),this}function d5(){}function Ho(e){return e=g1(e),m1(function(t){return t7(t,e)})}var Yo=j4(R1),Ko=j4(_8),Go=j4(p4);function ze(e){return Z4(e)?g4(J2(e)):bn(e)}function qo(e){return function(t){return e==null?r:E3(e,t)}}var Jo=b7(),Zo=b7(!0);function v5(){return[]}function p5(){return!1}function Xo(){return{}}function Qo(){return""}function el(){return!0}function tl(e,t){if(e=g1(e),e<1||e>k)return[];var i=a1,l=i2(e,a1);t=i1(t),e-=a1;for(var u=z4(l,t);++i<e;)t(i);return u}function rl(e){return p1(e)?R1(e,J2):w2(e)?[e]:d2(N7(S1(e)))}function nl(e){var t=++fr;return S1(e)+t}var sl=m0(function(e,t){return e+t},0),il=H4("ceil"),cl=m0(function(e,t){return e/t},1),ol=H4("floor");function ll(e){return e&&e.length?h0(e,g2,C4):r}function al(e,t){return e&&e.length?h0(e,i1(t,2),C4):r}function ul(e){return S8(e,g2)}function hl(e,t){return S8(e,i1(t,2))}function fl(e){return e&&e.length?h0(e,g2,T4):r}function dl(e,t){return e&&e.length?h0(e,i1(t,2),T4):r}var vl=m0(function(e,t){return e*t},1),pl=H4("round"),gl=m0(function(e,t){return e-t},0);function Ml(e){return e&&e.length?m4(e,g2):0}function ml(e,t){return e&&e.length?m4(e,i1(t,2)):0}return f.after=Ni,f.ary=J7,f.assign=Ic,f.assignIn=ue,f.assignInWith=E0,f.assignWith=Oc,f.at=Pc,f.before=Z7,f.bind=n5,f.bindAll=To,f.bindKey=X7,f.castArray=Zi,f.chain=K7,f.chunk=cs,f.compact=os,f.concat=ls,f.cond=Fo,f.conforms=$o,f.constant=u5,f.countBy=gi,f.create=Ac,f.curry=Q7,f.curryRight=ee,f.debounce=te,f.defaults=Cc,f.defaultsDeep=Ec,f.defer=Ui,f.delay=Vi,f.difference=as,f.differenceBy=us,f.differenceWith=hs,f.drop=fs,f.dropRight=ds,f.dropRightWhile=vs,f.dropWhile=ps,f.fill=gs,f.filter=mi,f.flatMap=xi,f.flatMapDeep=_i,f.flatMapDepth=bi,f.flatten=B7,f.flattenDeep=Ms,f.flattenDepth=ms,f.flip=Wi,f.flow=Do,f.flowRight=No,f.fromPairs=zs,f.functions=Dc,f.functionsIn=Nc,f.groupBy=wi,f.initial=xs,f.intersection=_s,f.intersectionBy=bs,f.intersectionWith=ws,f.invert=Vc,f.invertBy=Wc,f.invokeMap=Ii,f.iteratee=h5,f.keyBy=Oi,f.keys=X1,f.keysIn=p2,f.map=S0,f.mapKeys=jc,f.mapValues=Hc,f.matches=Uo,f.matchesProperty=Vo,f.memoize=O0,f.merge=Yc,f.mergeWith=he,f.method=Wo,f.methodOf=Bo,f.mixin=f5,f.negate=P0,f.nthArg=Ho,f.omit=Kc,f.omitBy=Gc,f.once=Bi,f.orderBy=Pi,f.over=Yo,f.overArgs=ji,f.overEvery=Ko,f.overSome=Go,f.partial=s5,f.partialRight=re,f.partition=Ai,f.pick=qc,f.pickBy=fe,f.property=ze,f.propertyOf=qo,f.pull=Ps,f.pullAll=H7,f.pullAllBy=As,f.pullAllWith=Cs,f.pullAt=Es,f.range=Jo,f.rangeRight=Zo,f.rearg=Hi,f.reject=ki,f.remove=ks,f.rest=Yi,f.reverse=t5,f.sampleSize=Ti,f.set=Zc,f.setWith=Xc,f.shuffle=Fi,f.slice=Ls,f.sortBy=Di,f.sortedUniq=Us,f.sortedUniqBy=Vs,f.split=_o,f.spread=Ki,f.tail=Ws,f.take=Bs,f.takeRight=js,f.takeRightWhile=Hs,f.takeWhile=Ys,f.tap=oi,f.throttle=Gi,f.thru=w0,f.toArray=oe,f.toPairs=de,f.toPairsIn=ve,f.toPath=rl,f.toPlainObject=ae,f.transform=Qc,f.unary=qi,f.union=Ks,f.unionBy=Gs,f.unionWith=qs,f.uniq=Js,f.uniqBy=Zs,f.uniqWith=Xs,f.unset=eo,f.unzip=r5,f.unzipWith=Y7,f.update=to,f.updateWith=ro,f.values=n6,f.valuesIn=no,f.without=Qs,f.words=Me,f.wrap=Ji,f.xor=ei,f.xorBy=ti,f.xorWith=ri,f.zip=ni,f.zipObject=si,f.zipObjectDeep=ii,f.zipWith=ci,f.entries=de,f.entriesIn=ve,f.extend=ue,f.extendWith=E0,f5(f,f),f.add=sl,f.attempt=me,f.camelCase=oo,f.capitalize=pe,f.ceil=il,f.clamp=so,f.clone=Xi,f.cloneDeep=ec,f.cloneDeepWith=tc,f.cloneWith=Qi,f.conformsTo=rc,f.deburr=ge,f.defaultTo=Ro,f.divide=cl,f.endsWith=lo,f.eq=W2,f.escape=ao,f.escapeRegExp=uo,f.every=Mi,f.find=zi,f.findIndex=V7,f.findKey=kc,f.findLast=yi,f.findLastIndex=W7,f.findLastKey=Lc,f.floor=ol,f.forEach=G7,f.forEachRight=q7,f.forIn=Tc,f.forInRight=Fc,f.forOwn=$c,f.forOwnRight=Rc,f.get=o5,f.gt=nc,f.gte=sc,f.has=Uc,f.hasIn=l5,f.head=j7,f.identity=g2,f.includes=Si,f.indexOf=ys,f.inRange=io,f.invoke=Bc,f.isArguments=T3,f.isArray=p1,f.isArrayBuffer=ic,f.isArrayLike=v2,f.isArrayLikeObject=j1,f.isBoolean=cc,f.isBuffer=x3,f.isDate=oc,f.isElement=lc,f.isEmpty=ac,f.isEqual=uc,f.isEqualWith=hc,f.isError=i5,f.isFinite=fc,f.isFunction=c3,f.isInteger=ne,f.isLength=A0,f.isMap=se,f.isMatch=dc,f.isMatchWith=vc,f.isNaN=pc,f.isNative=gc,f.isNil=mc,f.isNull=Mc,f.isNumber=ie,f.isObject=N1,f.isObjectLike=V1,f.isPlainObject=C6,f.isRegExp=c5,f.isSafeInteger=zc,f.isSet=ce,f.isString=C0,f.isSymbol=w2,f.isTypedArray=r6,f.isUndefined=yc,f.isWeakMap=xc,f.isWeakSet=_c,f.join=Ss,f.kebabCase=ho,f.last=$2,f.lastIndexOf=Is,f.lowerCase=fo,f.lowerFirst=vo,f.lt=bc,f.lte=wc,f.max=ll,f.maxBy=al,f.mean=ul,f.meanBy=hl,f.min=fl,f.minBy=dl,f.stubArray=v5,f.stubFalse=p5,f.stubObject=Xo,f.stubString=Qo,f.stubTrue=el,f.multiply=vl,f.nth=Os,f.noConflict=jo,f.noop=d5,f.now=I0,f.pad=po,f.padEnd=go,f.padStart=Mo,f.parseInt=mo,f.random=co,f.reduce=Ci,f.reduceRight=Ei,f.repeat=zo,f.replace=yo,f.result=Jc,f.round=pl,f.runInContext=_,f.sample=Li,f.size=$i,f.snakeCase=xo,f.some=Ri,f.sortedIndex=Ts,f.sortedIndexBy=Fs,f.sortedIndexOf=$s,f.sortedLastIndex=Rs,f.sortedLastIndexBy=Ds,f.sortedLastIndexOf=Ns,f.startCase=bo,f.startsWith=wo,f.subtract=gl,f.sum=Ml,f.sumBy=ml,f.template=So,f.times=tl,f.toFinite=o3,f.toInteger=g1,f.toLength=le,f.toLower=Io,f.toNumber=R2,f.toSafeInteger=Sc,f.toString=S1,f.toUpper=Oo,f.trim=Po,f.trimEnd=Ao,f.trimStart=Co,f.truncate=Eo,f.unescape=ko,f.uniqueId=nl,f.upperCase=Lo,f.upperFirst=a5,f.each=G7,f.eachRight=q7,f.first=j7,f5(f,function(){var e={};return G2(f,function(t,i){O1.call(f.prototype,i)||(e[i]=t)}),e}(),{chain:!1}),f.VERSION=c,E2(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){f[e].placeholder=f}),E2(["drop","take"],function(e,t){y1.prototype[e]=function(i){i=i===r?1:G1(g1(i),0);var l=this.__filtered__&&!t?new y1(this):this.clone();return l.__filtered__?l.__takeCount__=i2(i,l.__takeCount__):l.__views__.push({size:i2(i,a1),type:e+(l.__dir__<0?"Right":"")}),l},y1.prototype[e+"Right"]=function(i){return this.reverse()[e](i).reverse()}}),E2(["filter","map","takeWhile"],function(e,t){var i=t+1,l=i==U||i==F;y1.prototype[e]=function(u){var v=this.clone();return v.__iteratees__.push({iteratee:i1(u,3),type:i}),v.__filtered__=v.__filtered__||l,v}}),E2(["head","last"],function(e,t){var i="take"+(t?"Right":"");y1.prototype[e]=function(){return this[i](1).value()[0]}}),E2(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");y1.prototype[e]=function(){return this.__filtered__?new y1(this):this[i](1)}}),y1.prototype.compact=function(){return this.filter(g2)},y1.prototype.find=function(e){return this.filter(e).head()},y1.prototype.findLast=function(e){return this.reverse().find(e)},y1.prototype.invokeMap=m1(function(e,t){return typeof e=="function"?new y1(this):this.map(function(i){return w6(i,e,t)})}),y1.prototype.reject=function(e){return this.filter(P0(i1(e)))},y1.prototype.slice=function(e,t){e=g1(e);var i=this;return i.__filtered__&&(e>0||t<0)?new y1(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==r&&(t=g1(t),i=t<0?i.dropRight(-t):i.take(t-e)),i)},y1.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},y1.prototype.toArray=function(){return this.take(a1)},G2(y1.prototype,function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),u=f[l?"take"+(t=="last"?"Right":""):t],v=l||/^find/.test(t);u&&(f.prototype[t]=function(){var g=this.__wrapped__,z=l?[1]:arguments,b=g instanceof y1,A=z[0],C=b||p1(g),L=function(z1){var x1=u.apply(f,v3([z1],z));return l&&H?x1[0]:x1};C&&i&&typeof A=="function"&&A.length!=1&&(b=C=!1);var H=this.__chain__,e1=!!this.__actions__.length,c1=v&&!H,M1=b&&!e1;if(!v&&C){g=M1?g:new y1(this);var o1=e.apply(g,z);return o1.__actions__.push({func:w0,args:[L],thisArg:r}),new L2(o1,H)}return c1&&M1?e.apply(this,z):(o1=this.thru(L),c1?l?o1.value()[0]:o1.value():o1)})}),E2(["pop","push","shift","sort","splice","unshift"],function(e){var t=J6[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);f.prototype[e]=function(){var u=arguments;if(l&&!this.__chain__){var v=this.value();return t.apply(p1(v)?v:[],u)}return this[i](function(g){return t.apply(p1(g)?g:[],u)})}}),G2(y1.prototype,function(e,t){var i=f[t];if(i){var l=i.name+"";O1.call(Z3,l)||(Z3[l]=[]),Z3[l].push({name:t,func:i})}}),Z3[M0(r,Z).name]=[{name:"wrapper",func:r}],y1.prototype.clone=Cr,y1.prototype.reverse=Er,y1.prototype.value=kr,f.prototype.at=li,f.prototype.chain=ai,f.prototype.commit=ui,f.prototype.next=hi,f.prototype.plant=di,f.prototype.reverse=vi,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=pi,f.prototype.first=f.prototype.head,M6&&(f.prototype[M6]=fi),f},G3=ar();I3?((I3.exports=G3)._=G3,h4._=G3):t2._=G3}).call(N2)})(D0,D0.exports);var Ie=D0.exports;const ea=s=>{const n=s.split("/");return{appLanguage:n[1],apiLanguage:n[2],rootPath:`/${n[3]}`,subPath:`/${n.slice(4).join("/")}`,mainPath:`/${n.slice(3).join("/")}`}},ht=h1.createContext(void 0),ta=({children:s,filterSchema:n,customMainPath:r,useAppliedFilters:c,conditionalFiltersSchema:o})=>{const{pathname:a}=zl.useLocation(),h=r||ea(a).mainPath;if(!h)throw new Error("mainPath is not defined");const d=JSON.parse(localStorage.getItem(`appliedFilters-${h}`)||"{}"),p=c[0],M=JSON.parse(localStorage.getItem(`shownFilters-${h}`)||"[]"),w={mainPath:h,appliedFilters:Object.keys(p).length>0?p:d,applicableFilters:n,shownFilters:M.length?M:n.map(R=>R.key).slice(0,8),recreateShownFiltersCount:0},[x,m]=Ql((R,$)=>{switch($.type){case"SET_APPLIED_FILTERS":R.appliedFilters=$.payload.appliedFilters;return;case"SET_APPLICABLE_FILTERS":R.applicableFilters=$.payload.applicableFilters;return;case"SET_SHOWN_FILTERS":R.shownFilters=$.payload.shownFilters,R.recreateShownFiltersCount=R.recreateShownFiltersCount+1;return}},w);return h1.useEffect(()=>{c[1](x.appliedFilters),localStorage.setItem(`appliedFilters-${h}`,JSON.stringify(x.appliedFilters))},[x.appliedFilters]),h1.useEffect(()=>{localStorage.setItem(`shownFilters-${h}`,JSON.stringify(x.shownFilters))},[x.shownFilters]),h1.useEffect(()=>{m({type:"SET_APPLICABLE_FILTERS",payload:{applicableFilters:n}})},[n]),K.jsx(ht.Provider,{value:{state:x,dispatch:m,conditionalFiltersSchema:o},children:s})};function U6(){const s=h1.useContext(ht);if(s===void 0)throw new Error("useFilterContext must be used within a FilterProvider");return s}const{Text:Oe}=w1.Typography,ra=({filterKeyValue:s})=>{const[n,r]=s,{state:{applicableFilters:c,appliedFilters:o},dispatch:a,conditionalFiltersSchema:h}=U6(),d=[...c,...h||[]].find(M=>M.key===n);if(!d)return console.warn(`filterItem with key ${n} not found`),null;const p=M=>{const w={...o,[M]:void 0};a({type:"SET_APPLIED_FILTERS",payload:{appliedFilters:w}})};return K.jsx(K.Fragment,{children:K.jsxs(w1.Space,{align:"center",className:"active-filter-item",children:[K.jsxs(Oe,{className:"active-filter-item__label",children:[d==null?void 0:d.placeholder,":"]}),K.jsx(Oe,{className:"active-filter-item__value",children:Ie.isBoolean(r)?r.toString():Ie.isArray(r)?r.join(", "):r}),K.jsx(L5,{icon:"close",size:20,className:"active-filter-item__remove-filter-icon",onClick:()=>p(n)})]},n)})},{Text:na}=w1.Typography,sa=()=>{var c;const{state:{appliedFilters:s},dispatch:n}=U6(),r=()=>{n({type:"SET_APPLIED_FILTERS",payload:{appliedFilters:{}}})};return K.jsxs(w1.Row,{align:"middle",className:"applied_filters",children:[K.jsx(w1.Col,{className:"applied_filters__list",children:K.jsxs(w1.Space,{children:[K.jsx(na,{className:"applied_filters__label",children:"Active filters:"}),K.jsx(w1.Space,{className:"applied_filters__items","data-testid":"appliedFilters",children:(c=Object.entries(s))==null?void 0:c.map(([o,a],h)=>a!==void 0&&K.jsx(ra,{filterKeyValue:[o,a]},h))})]})}),K.jsx(w1.Col,{className:"applied_filters__clear-filters",children:K.jsx(L5,{icon:"bin",size:35,className:"applied_filters__reset-filters-icon",onClick:r})})]})};var V6=s=>s.type==="checkbox",l6=s=>s instanceof Date,f2=s=>s==null;const ft=s=>typeof s=="object";var q1=s=>!f2(s)&&!Array.isArray(s)&&ft(s)&&!l6(s),dt=s=>q1(s)&&s.target?V6(s.target)?s.target.checked:s.target.value:s,ia=s=>s.substring(0,s.search(/\.\d+(\.|$)/))||s,vt=(s,n)=>s.has(ia(n)),ca=s=>{const n=s.constructor&&s.constructor.prototype;return q1(n)&&n.hasOwnProperty("isPrototypeOf")},$5=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function M2(s){let n;const r=Array.isArray(s);if(s instanceof Date)n=new Date(s);else if(s instanceof Set)n=new Set(s);else if(!($5&&(s instanceof Blob||s instanceof FileList))&&(r||q1(s)))if(n=r?[]:{},!r&&!ca(s))n=s;else for(const c in s)s.hasOwnProperty(c)&&(n[c]=M2(s[c]));else return s;return n}var W6=s=>Array.isArray(s)?s.filter(Boolean):[],W1=s=>s===void 0,Y=(s,n,r)=>{if(!n||!q1(s))return r;const c=W6(n.split(/[,[\].]+?/)).reduce((o,a)=>f2(o)?o:o[a],s);return W1(c)||c===s?W1(s[n])?r:s[n]:c},j2=s=>typeof s=="boolean";const N0={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},H2={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},a3={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},oa=h1.createContext(null),R5=()=>h1.useContext(oa);var pt=(s,n,r,c=!0)=>{const o={defaultValues:n._defaultValues};for(const a in s)Object.defineProperty(o,a,{get:()=>{const h=a;return n._proxyFormState[h]!==H2.all&&(n._proxyFormState[h]=!c||H2.all),r&&(r[h]=!0),s[h]}});return o},D2=s=>q1(s)&&!Object.keys(s).length,gt=(s,n,r,c)=>{r(s);const{name:o,...a}=s;return D2(a)||Object.keys(a).length>=Object.keys(n).length||Object.keys(a).find(h=>n[h]===(!c||H2.all))},T0=s=>Array.isArray(s)?s:[s],Mt=(s,n,r)=>!s||!n||s===n||T0(s).some(c=>c&&(r?c===n:c.startsWith(n)||n.startsWith(c)));function D5(s){const n=h1.useRef(s);n.current=s,h1.useEffect(()=>{const r=!s.disabled&&n.current.subject&&n.current.subject.subscribe({next:n.current.next});return()=>{r&&r.unsubscribe()}},[s.disabled])}function la(s){const n=R5(),{control:r=n.control,disabled:c,name:o,exact:a}=s||{},[h,d]=h1.useState(r._formState),p=h1.useRef(!0),M=h1.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),w=h1.useRef(o);return w.current=o,D5({disabled:c,next:x=>p.current&&Mt(w.current,x.name,a)&&gt(x,M.current,r._updateFormState)&&d({...r._formState,...x}),subject:r._subjects.state}),h1.useEffect(()=>(p.current=!0,M.current.isValid&&r._updateValid(!0),()=>{p.current=!1}),[r]),pt(h,r,M.current,!1)}var Z2=s=>typeof s=="string",mt=(s,n,r,c,o)=>Z2(s)?(c&&n.watch.add(s),Y(r,s,o)):Array.isArray(s)?s.map(a=>(c&&n.watch.add(a),Y(r,a))):(c&&(n.watchAll=!0),r);function zt(s){const n=R5(),{control:r=n.control,name:c,defaultValue:o,disabled:a,exact:h}=s||{},d=h1.useRef(c);d.current=c,D5({disabled:a,subject:r._subjects.values,next:w=>{Mt(d.current,w.name,h)&&M(M2(mt(d.current,r._names,w.values||r._formValues,!1,o)))}});const[p,M]=h1.useState(r._getWatch(c,o));return h1.useEffect(()=>r._removeUnmounted()),p}var N5=s=>/^\w*$/.test(s),yt=s=>W6(s.replace(/["|']|\]/g,"").split(/\.|\[/)),k1=(s,n,r)=>{let c=-1;const o=N5(n)?[n]:yt(n),a=o.length,h=a-1;for(;++c<a;){const d=o[c];let p=r;if(c!==h){const M=s[d];p=q1(M)||Array.isArray(M)?M:isNaN(+o[c+1])?{}:[]}s[d]=p,s=s[d]}return s};function aa(s){const n=R5(),{name:r,disabled:c,control:o=n.control,shouldUnregister:a}=s,h=vt(o._names.array,r),d=zt({control:o,name:r,defaultValue:Y(o._formValues,r,Y(o._defaultValues,r,s.defaultValue)),exact:!0}),p=la({control:o,name:r}),M=h1.useRef(o.register(r,{...s.rules,value:d,...j2(s.disabled)?{disabled:s.disabled}:{}}));return h1.useEffect(()=>{const w=o._options.shouldUnregister||a,x=(m,R)=>{const $=Y(o._fields,m);$&&($._f.mount=R)};if(x(r,!0),w){const m=M2(Y(o._options.defaultValues,r));k1(o._defaultValues,r,m),W1(Y(o._formValues,r))&&k1(o._formValues,r,m)}return()=>{(h?w&&!o._state.action:w)?o.unregister(r):x(r,!1)}},[r,o,h,a]),h1.useEffect(()=>{Y(o._fields,r)&&o._updateDisabledField({disabled:c,fields:o._fields,name:r,value:Y(o._fields,r)._f.value})},[c,r,o]),{field:{name:r,value:d,...j2(c)||p.disabled?{disabled:p.disabled||c}:{},onChange:h1.useCallback(w=>M.current.onChange({target:{value:dt(w),name:r},type:N0.CHANGE}),[r]),onBlur:h1.useCallback(()=>M.current.onBlur({target:{value:Y(o._formValues,r),name:r},type:N0.BLUR}),[r,o]),ref:w=>{const x=Y(o._fields,r);x&&w&&(x._f.ref={focus:()=>w.focus(),select:()=>w.select(),setCustomValidity:m=>w.setCustomValidity(m),reportValidity:()=>w.reportValidity()})}},formState:p,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Y(p.errors,r)},isDirty:{enumerable:!0,get:()=>!!Y(p.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Y(p.touchedFields,r)},error:{enumerable:!0,get:()=>Y(p.errors,r)}})}}var ua=(s,n,r,c,o)=>n?{...r[s],types:{...r[s]&&r[s].types?r[s].types:{},[c]:o||!0}}:{},Pe=s=>({isOnSubmit:!s||s===H2.onSubmit,isOnBlur:s===H2.onBlur,isOnChange:s===H2.onChange,isOnAll:s===H2.all,isOnTouch:s===H2.onTouched}),Ae=(s,n,r)=>!r&&(n.watchAll||n.watch.has(s)||[...n.watch].some(c=>s.startsWith(c)&&/^\.\w+/.test(s.slice(c.length))));const T6=(s,n,r,c)=>{for(const o of r||Object.keys(s)){const a=Y(s,o);if(a){const{_f:h,...d}=a;if(h){if(h.refs&&h.refs[0]&&n(h.refs[0],o)&&!c)break;if(h.ref&&n(h.ref,h.name)&&!c)break;T6(d,n)}else q1(d)&&T6(d,n)}}};var ha=(s,n,r)=>{const c=W6(Y(s,r));return k1(c,"root",n[r]),k1(s,r,c),s},U5=s=>s.type==="file",_3=s=>typeof s=="function",U0=s=>{if(!$5)return!1;const n=s?s.ownerDocument:0;return s instanceof(n&&n.defaultView?n.defaultView.HTMLElement:HTMLElement)},F0=s=>Z2(s),V5=s=>s.type==="radio",V0=s=>s instanceof RegExp;const Ce={value:!1,isValid:!1},Ee={value:!0,isValid:!0};var xt=s=>{if(Array.isArray(s)){if(s.length>1){const n=s.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}return s[0].checked&&!s[0].disabled?s[0].attributes&&!W1(s[0].attributes.value)?W1(s[0].value)||s[0].value===""?Ee:{value:s[0].value,isValid:!0}:Ee:Ce}return Ce};const ke={isValid:!1,value:null};var _t=s=>Array.isArray(s)?s.reduce((n,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:n,ke):ke;function Le(s,n,r="validate"){if(F0(s)||Array.isArray(s)&&s.every(F0)||j2(s)&&!s)return{type:r,message:F0(s)?s:"",ref:n}}var s6=s=>q1(s)&&!V0(s)?s:{value:s,message:""},Te=async(s,n,r,c,o)=>{const{ref:a,refs:h,required:d,maxLength:p,minLength:M,min:w,max:x,pattern:m,validate:R,name:$,valueAsNumber:E,mount:N,disabled:Z}=s._f,D=Y(n,$);if(!N||Z)return{};const l1=h?h[0]:a,r1=s1=>{c&&l1.reportValidity&&(l1.setCustomValidity(j2(s1)?"":s1||""),l1.reportValidity())},Q={},f1=V5(a),u1=V6(a),I1=f1||u1,_1=(E||U5(a))&&W1(a.value)&&W1(D)||U0(a)&&a.value===""||D===""||Array.isArray(D)&&!D.length,v1=ua.bind(null,$,r,Q),j=(s1,t1,U,T=a3.maxLength,F=a3.minLength)=>{const W=s1?t1:U;Q[$]={type:s1?T:F,message:W,ref:a,...v1(s1?T:F,W)}};if(o?!Array.isArray(D)||!D.length:d&&(!I1&&(_1||f2(D))||j2(D)&&!D||u1&&!xt(h).isValid||f1&&!_t(h).isValid)){const{value:s1,message:t1}=F0(d)?{value:!!d,message:d}:s6(d);if(s1&&(Q[$]={type:a3.required,message:t1,ref:l1,...v1(a3.required,t1)},!r))return r1(t1),Q}if(!_1&&(!f2(w)||!f2(x))){let s1,t1;const U=s6(x),T=s6(w);if(!f2(D)&&!isNaN(D)){const F=a.valueAsNumber||D&&+D;f2(U.value)||(s1=F>U.value),f2(T.value)||(t1=F<T.value)}else{const F=a.valueAsDate||new Date(D),W=X=>new Date(new Date().toDateString()+" "+X),k=a.type=="time",q=a.type=="week";Z2(U.value)&&D&&(s1=k?W(D)>W(U.value):q?D>U.value:F>new Date(U.value)),Z2(T.value)&&D&&(t1=k?W(D)<W(T.value):q?D<T.value:F<new Date(T.value))}if((s1||t1)&&(j(!!s1,U.message,T.message,a3.max,a3.min),!r))return r1(Q[$].message),Q}if((p||M)&&!_1&&(Z2(D)||o&&Array.isArray(D))){const s1=s6(p),t1=s6(M),U=!f2(s1.value)&&D.length>+s1.value,T=!f2(t1.value)&&D.length<+t1.value;if((U||T)&&(j(U,s1.message,t1.message),!r))return r1(Q[$].message),Q}if(m&&!_1&&Z2(D)){const{value:s1,message:t1}=s6(m);if(V0(s1)&&!D.match(s1)&&(Q[$]={type:a3.pattern,message:t1,ref:a,...v1(a3.pattern,t1)},!r))return r1(t1),Q}if(R){if(_3(R)){const s1=await R(D,n),t1=Le(s1,l1);if(t1&&(Q[$]={...t1,...v1(a3.validate,t1.message)},!r))return r1(t1.message),Q}else if(q1(R)){let s1={};for(const t1 in R){if(!D2(s1)&&!r)break;const U=Le(await R[t1](D,n),l1,t1);U&&(s1={...U,...v1(t1,U.message)},r1(U.message),r&&(Q[$]=s1))}if(!D2(s1)&&(Q[$]={ref:l1,...s1},!r))return Q}}return r1(!0),Q};function fa(s,n){const r=n.slice(0,-1).length;let c=0;for(;c<r;)s=W1(s)?c++:s[n[c++]];return s}function da(s){for(const n in s)if(s.hasOwnProperty(n)&&!W1(s[n]))return!1;return!0}function n2(s,n){const r=Array.isArray(n)?n:N5(n)?[n]:yt(n),c=r.length===1?s:fa(s,r),o=r.length-1,a=r[o];return c&&delete c[a],o!==0&&(q1(c)&&D2(c)||Array.isArray(c)&&da(c))&&n2(s,r.slice(0,-1)),s}var m5=()=>{let s=[];return{get observers(){return s},next:o=>{for(const a of s)a.next&&a.next(o)},subscribe:o=>(s.push(o),{unsubscribe:()=>{s=s.filter(a=>a!==o)}}),unsubscribe:()=>{s=[]}}},W0=s=>f2(s)||!ft(s);function $3(s,n){if(W0(s)||W0(n))return s===n;if(l6(s)&&l6(n))return s.getTime()===n.getTime();const r=Object.keys(s),c=Object.keys(n);if(r.length!==c.length)return!1;for(const o of r){const a=s[o];if(!c.includes(o))return!1;if(o!=="ref"){const h=n[o];if(l6(a)&&l6(h)||q1(a)&&q1(h)||Array.isArray(a)&&Array.isArray(h)?!$3(a,h):a!==h)return!1}}return!0}var bt=s=>s.type==="select-multiple",va=s=>V5(s)||V6(s),z5=s=>U0(s)&&s.isConnected,wt=s=>{for(const n in s)if(_3(s[n]))return!0;return!1};function B0(s,n={}){const r=Array.isArray(s);if(q1(s)||r)for(const c in s)Array.isArray(s[c])||q1(s[c])&&!wt(s[c])?(n[c]=Array.isArray(s[c])?[]:{},B0(s[c],n[c])):f2(s[c])||(n[c]=!0);return n}function St(s,n,r){const c=Array.isArray(s);if(q1(s)||c)for(const o in s)Array.isArray(s[o])||q1(s[o])&&!wt(s[o])?W1(n)||W0(r[o])?r[o]=Array.isArray(s[o])?B0(s[o],[]):{...B0(s[o])}:St(s[o],f2(n)?{}:n[o],r[o]):r[o]=!$3(s[o],n[o]);return r}var y5=(s,n)=>St(s,n,B0(n)),It=(s,{valueAsNumber:n,valueAsDate:r,setValueAs:c})=>W1(s)?s:n?s===""?NaN:s&&+s:r&&Z2(s)?new Date(s):c?c(s):s;function x5(s){const n=s.ref;if(!(s.refs?s.refs.every(r=>r.disabled):n.disabled))return U5(n)?n.files:V5(n)?_t(s.refs).value:bt(n)?[...n.selectedOptions].map(({value:r})=>r):V6(n)?xt(s.refs).value:It(W1(n.value)?s.ref.value:n.value,s)}var pa=(s,n,r,c)=>{const o={};for(const a of s){const h=Y(n,a);h&&k1(o,a,h._f)}return{criteriaMode:r,names:[...s],fields:o,shouldUseNativeValidation:c}},E6=s=>W1(s)?s:V0(s)?s.source:q1(s)?V0(s.value)?s.value.source:s.value:s,ga=s=>s.mount&&(s.required||s.min||s.max||s.maxLength||s.minLength||s.pattern||s.validate);function Fe(s,n,r){const c=Y(s,r);if(c||N5(r))return{error:c,name:r};const o=r.split(".");for(;o.length;){const a=o.join("."),h=Y(n,a),d=Y(s,a);if(h&&!Array.isArray(h)&&r!==a)return{name:r};if(d&&d.type)return{name:a,error:d};o.pop()}return{name:r}}var Ma=(s,n,r,c,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(n||s):(r?c.isOnBlur:o.isOnBlur)?!s:(r?c.isOnChange:o.isOnChange)?s:!0,ma=(s,n)=>!W6(Y(s,n)).length&&n2(s,n);const za={mode:H2.onSubmit,reValidateMode:H2.onChange,shouldFocusError:!0};function ya(s={},n){let r={...za,...s},c={submitCount:0,isDirty:!1,isLoading:_3(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},a=q1(r.defaultValues)||q1(r.values)?M2(r.defaultValues||r.values)||{}:{},h=r.shouldUnregister?{}:M2(a),d={action:!1,mount:!1,watch:!1},p={mount:new Set,unMount:new Set,array:new Set,watch:new Set},M,w=0;const x={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={values:m5(),array:m5(),state:m5()},R=Pe(r.mode),$=Pe(r.reValidateMode),E=r.criteriaMode===H2.all,N=y=>I=>{clearTimeout(w),w=setTimeout(y,I)},Z=async y=>{if(x.isValid||y){const I=r.resolver?D2((await _1()).errors):await j(o,!0);I!==c.isValid&&m.state.next({isValid:I})}},D=y=>x.isValidating&&m.state.next({isValidating:y}),l1=(y,I=[],O,G,B=!0,V=!0)=>{if(G&&O){if(d.action=!0,V&&Array.isArray(Y(o,y))){const n1=O(Y(o,y),G.argA,G.argB);B&&k1(o,y,n1)}if(V&&Array.isArray(Y(c.errors,y))){const n1=O(Y(c.errors,y),G.argA,G.argB);B&&k1(c.errors,y,n1),ma(c.errors,y)}if(x.touchedFields&&V&&Array.isArray(Y(c.touchedFields,y))){const n1=O(Y(c.touchedFields,y),G.argA,G.argB);B&&k1(c.touchedFields,y,n1)}x.dirtyFields&&(c.dirtyFields=y5(a,h)),m.state.next({name:y,isDirty:t1(y,I),dirtyFields:c.dirtyFields,errors:c.errors,isValid:c.isValid})}else k1(h,y,I)},r1=(y,I)=>{k1(c.errors,y,I),m.state.next({errors:c.errors})},Q=y=>{c.errors=y,m.state.next({errors:c.errors,isValid:!1})},f1=(y,I,O,G)=>{const B=Y(o,y);if(B){const V=Y(h,y,W1(O)?Y(a,y):O);W1(V)||G&&G.defaultChecked||I?k1(h,y,I?V:x5(B._f)):F(y,V),d.mount&&Z()}},u1=(y,I,O,G,B)=>{let V=!1,n1=!1;const A1={name:y},$1=!!(Y(o,y)&&Y(o,y)._f.disabled);if(!O||G){x.isDirty&&(n1=c.isDirty,c.isDirty=A1.isDirty=t1(),V=n1!==A1.isDirty);const e2=$1||$3(Y(a,y),I);n1=!!(!$1&&Y(c.dirtyFields,y)),e2||$1?n2(c.dirtyFields,y):k1(c.dirtyFields,y,!0),A1.dirtyFields=c.dirtyFields,V=V||x.dirtyFields&&n1!==!e2}if(O){const e2=Y(c.touchedFields,y);e2||(k1(c.touchedFields,y,O),A1.touchedFields=c.touchedFields,V=V||x.touchedFields&&e2!==O)}return V&&B&&m.state.next(A1),V?A1:{}},I1=(y,I,O,G)=>{const B=Y(c.errors,y),V=x.isValid&&j2(I)&&c.isValid!==I;if(s.delayError&&O?(M=N(()=>r1(y,O)),M(s.delayError)):(clearTimeout(w),M=null,O?k1(c.errors,y,O):n2(c.errors,y)),(O?!$3(B,O):B)||!D2(G)||V){const n1={...G,...V&&j2(I)?{isValid:I}:{},errors:c.errors,name:y};c={...c,...n1},m.state.next(n1)}D(!1)},_1=async y=>r.resolver(h,r.context,pa(y||p.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),v1=async y=>{const{errors:I}=await _1(y);if(y)for(const O of y){const G=Y(I,O);G?k1(c.errors,O,G):n2(c.errors,O)}else c.errors=I;return I},j=async(y,I,O={valid:!0})=>{for(const G in y){const B=y[G];if(B){const{_f:V,...n1}=B;if(V){const A1=p.array.has(V.name),$1=await Te(B,h,E,r.shouldUseNativeValidation&&!I,A1);if($1[V.name]&&(O.valid=!1,I))break;!I&&(Y($1,V.name)?A1?ha(c.errors,$1,V.name):k1(c.errors,V.name,$1[V.name]):n2(c.errors,V.name))}n1&&await j(n1,I,O)}}return O.valid},s1=()=>{for(const y of p.unMount){const I=Y(o,y);I&&(I._f.refs?I._f.refs.every(O=>!z5(O)):!z5(I._f.ref))&&s2(y)}p.unMount=new Set},t1=(y,I)=>(y&&I&&k1(h,y,I),!$3(P1(),a)),U=(y,I,O)=>mt(y,p,{...d.mount?h:W1(I)?a:Z2(y)?{[y]:I}:I},O,I),T=y=>W6(Y(d.mount?h:a,y,s.shouldUnregister?Y(a,y,[]):[])),F=(y,I,O={})=>{const G=Y(o,y);let B=I;if(G){const V=G._f;V&&(!V.disabled&&k1(h,y,It(I,V)),B=U0(V.ref)&&f2(I)?"":I,bt(V.ref)?[...V.ref.options].forEach(n1=>n1.selected=B.includes(n1.value)):V.refs?V6(V.ref)?V.refs.length>1?V.refs.forEach(n1=>(!n1.defaultChecked||!n1.disabled)&&(n1.checked=Array.isArray(B)?!!B.find(A1=>A1===n1.value):B===n1.value)):V.refs[0]&&(V.refs[0].checked=!!B):V.refs.forEach(n1=>n1.checked=n1.value===B):U5(V.ref)?V.ref.value="":(V.ref.value=B,V.ref.type||m.values.next({name:y,values:{...h}})))}(O.shouldDirty||O.shouldTouch)&&u1(y,B,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&a1(y)},W=(y,I,O)=>{for(const G in I){const B=I[G],V=`${y}.${G}`,n1=Y(o,V);(p.array.has(y)||!W0(B)||n1&&!n1._f)&&!l6(B)?W(V,B,O):F(V,B,O)}},k=(y,I,O={})=>{const G=Y(o,y),B=p.array.has(y),V=M2(I);k1(h,y,V),B?(m.array.next({name:y,values:{...h}}),(x.isDirty||x.dirtyFields)&&O.shouldDirty&&m.state.next({name:y,dirtyFields:y5(a,h),isDirty:t1(y,V)})):G&&!G._f&&!f2(V)?W(y,V,O):F(y,V,O),Ae(y,p)&&m.state.next({...c}),m.values.next({name:y,values:{...h}}),!d.mount&&n()},q=async y=>{const I=y.target;let O=I.name,G=!0;const B=Y(o,O),V=()=>I.type?x5(B._f):dt(y),n1=A1=>{G=Number.isNaN(A1)||A1===Y(h,O,A1)};if(B){let A1,$1;const e2=V(),K2=y.type===N0.BLUR||y.type===N0.FOCUS_OUT,d6=!ga(B._f)&&!r.resolver&&!Y(c.errors,O)&&!B._f.deps||Ma(K2,Y(c.touchedFields,O),c.isSubmitted,$,R),w3=Ae(O,p,K2);k1(h,O,e2),K2?(B._f.onBlur&&B._f.onBlur(y),M&&M(0)):B._f.onChange&&B._f.onChange(y);const S3=u1(O,e2,K2,!1),v6=!D2(S3)||w3;if(!K2&&m.values.next({name:O,type:y.type,values:{...h}}),d6)return x.isValid&&Z(),v6&&m.state.next({name:O,...w3?{}:S3});if(!K2&&w3&&m.state.next({...c}),D(!0),r.resolver){const{errors:W3}=await _1([O]);if(n1(e2),G){const p6=Fe(c.errors,o,O),B3=Fe(W3,o,p6.name||O);A1=B3.error,O=B3.name,$1=D2(W3)}}else A1=(await Te(B,h,E,r.shouldUseNativeValidation))[O],n1(e2),G&&(A1?$1=!1:x.isValid&&($1=await j(o,!0)));G&&(B._f.deps&&a1(B._f.deps),I1(O,$1,A1,S3))}},X=(y,I)=>{if(Y(c.errors,I)&&y.focus)return y.focus(),1},a1=async(y,I={})=>{let O,G;const B=T0(y);if(D(!0),r.resolver){const V=await v1(W1(y)?y:B);O=D2(V),G=y?!B.some(n1=>Y(V,n1)):O}else y?(G=(await Promise.all(B.map(async V=>{const n1=Y(o,V);return await j(n1&&n1._f?{[V]:n1}:n1)}))).every(Boolean),!(!G&&!c.isValid)&&Z()):G=O=await j(o);return m.state.next({...!Z2(y)||x.isValid&&O!==c.isValid?{}:{name:y},...r.resolver||!y?{isValid:O}:{},errors:c.errors,isValidating:!1}),I.shouldFocus&&!G&&T6(o,X,y?B:p.mount),G},P1=y=>{const I={...a,...d.mount?h:{}};return W1(y)?I:Z2(y)?Y(I,y):y.map(O=>Y(I,O))},L1=(y,I)=>({invalid:!!Y((I||c).errors,y),isDirty:!!Y((I||c).dirtyFields,y),isTouched:!!Y((I||c).touchedFields,y),error:Y((I||c).errors,y)}),U1=y=>{y&&T0(y).forEach(I=>n2(c.errors,I)),m.state.next({errors:y?c.errors:{}})},F1=(y,I,O)=>{const G=(Y(o,y,{_f:{}})._f||{}).ref;k1(c.errors,y,{...I,ref:G}),m.state.next({name:y,errors:c.errors,isValid:!1}),O&&O.shouldFocus&&G&&G.focus&&G.focus()},l2=(y,I)=>_3(y)?m.values.subscribe({next:O=>y(U(void 0,I),O)}):U(y,I,!0),s2=(y,I={})=>{for(const O of y?T0(y):p.mount)p.mount.delete(O),p.array.delete(O),I.keepValue||(n2(o,O),n2(h,O)),!I.keepError&&n2(c.errors,O),!I.keepDirty&&n2(c.dirtyFields,O),!I.keepTouched&&n2(c.touchedFields,O),!r.shouldUnregister&&!I.keepDefaultValue&&n2(a,O);m.values.next({values:{...h}}),m.state.next({...c,...I.keepDirty?{isDirty:t1()}:{}}),!I.keepIsValid&&Z()},J1=({disabled:y,name:I,field:O,fields:G,value:B})=>{if(j2(y)){const V=y?void 0:W1(B)?x5(O?O._f:Y(G,I)._f):B;k1(h,I,V),u1(I,V,!1,!1,!0)}},B1=(y,I={})=>{let O=Y(o,y);const G=j2(I.disabled);return k1(o,y,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:y}},name:y,mount:!0,...I}}),p.mount.add(y),O?J1({field:O,disabled:I.disabled,name:y,value:I.value}):f1(y,!0,I.value),{...G?{disabled:I.disabled}:{},...r.progressive?{required:!!I.required,min:E6(I.min),max:E6(I.max),minLength:E6(I.minLength),maxLength:E6(I.maxLength),pattern:E6(I.pattern)}:{},name:y,onChange:q,onBlur:q,ref:B=>{if(B){B1(y,I),O=Y(o,y);const V=W1(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,n1=va(V),A1=O._f.refs||[];if(n1?A1.find($1=>$1===V):V===O._f.ref)return;k1(o,y,{_f:{...O._f,...n1?{refs:[...A1.filter(z5),V,...Array.isArray(Y(a,y))?[{}]:[]],ref:{type:V.type,name:y}}:{ref:V}}}),f1(y,!1,void 0,V)}else O=Y(o,y,{}),O._f&&(O._f.mount=!1),(r.shouldUnregister||I.shouldUnregister)&&!(vt(p.array,y)&&d.action)&&p.unMount.add(y)}}},D1=()=>r.shouldFocusError&&T6(o,X,p.mount),Y1=y=>{j2(y)&&(m.state.next({disabled:y}),T6(o,(I,O)=>{let G=y;const B=Y(o,O);B&&j2(B._f.disabled)&&(G||(G=B._f.disabled)),I.disabled=G},0,!1))},Q1=(y,I)=>async O=>{O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let G=M2(h);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:B,values:V}=await _1();c.errors=B,G=V}else await j(o);n2(c.errors,"root"),D2(c.errors)?(m.state.next({errors:{}}),await y(G,O)):(I&&await I({...c.errors},O),D1(),setTimeout(D1)),m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:D2(c.errors),submitCount:c.submitCount+1,errors:c.errors})},y2=(y,I={})=>{Y(o,y)&&(W1(I.defaultValue)?k(y,M2(Y(a,y))):(k(y,I.defaultValue),k1(a,y,M2(I.defaultValue))),I.keepTouched||n2(c.touchedFields,y),I.keepDirty||(n2(c.dirtyFields,y),c.isDirty=I.defaultValue?t1(y,M2(Y(a,y))):t1()),I.keepError||(n2(c.errors,y),x.isValid&&Z()),m.state.next({...c}))},Z1=(y,I={})=>{const O=y?M2(y):a,G=M2(O),B=y&&!D2(y)?G:a;if(I.keepDefaultValues||(a=O),!I.keepValues){if(I.keepDirtyValues)for(const V of p.mount)Y(c.dirtyFields,V)?k1(B,V,Y(h,V)):k(V,Y(B,V));else{if($5&&W1(y))for(const V of p.mount){const n1=Y(o,V);if(n1&&n1._f){const A1=Array.isArray(n1._f.refs)?n1._f.refs[0]:n1._f.ref;if(U0(A1)){const $1=A1.closest("form");if($1){$1.reset();break}}}}o={}}h=s.shouldUnregister?I.keepDefaultValues?M2(a):{}:M2(B),m.array.next({values:{...B}}),m.values.next({values:{...B}})}p={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!d.mount&&n(),d.mount=!x.isValid||!!I.keepIsValid,d.watch=!!s.shouldUnregister,m.state.next({submitCount:I.keepSubmitCount?c.submitCount:0,isDirty:I.keepDirty?c.isDirty:!!(I.keepDefaultValues&&!$3(y,a)),isSubmitted:I.keepIsSubmitted?c.isSubmitted:!1,dirtyFields:I.keepDirtyValues?c.dirtyFields:I.keepDefaultValues&&y?y5(a,y):{},touchedFields:I.keepTouched?c.touchedFields:{},errors:I.keepErrors?c.errors:{},isSubmitSuccessful:I.keepIsSubmitSuccessful?c.isSubmitSuccessful:!1,isSubmitting:!1})},A2=(y,I)=>Z1(_3(y)?y(h):y,I);return{control:{register:B1,unregister:s2,getFieldState:L1,handleSubmit:Q1,setError:F1,_executeSchema:_1,_getWatch:U,_getDirty:t1,_updateValid:Z,_removeUnmounted:s1,_updateFieldArray:l1,_updateDisabledField:J1,_getFieldArray:T,_reset:Z1,_resetDefaultValues:()=>_3(r.defaultValues)&&r.defaultValues().then(y=>{A2(y,r.resetOptions),m.state.next({isLoading:!1})}),_updateFormState:y=>{c={...c,...y}},_disableForm:Y1,_subjects:m,_proxyFormState:x,_setErrors:Q,get _fields(){return o},get _formValues(){return h},get _state(){return d},set _state(y){d=y},get _defaultValues(){return a},get _names(){return p},set _names(y){p=y},get _formState(){return c},set _formState(y){c=y},get _options(){return r},set _options(y){r={...r,...y}}},trigger:a1,register:B1,handleSubmit:Q1,watch:l2,setValue:k,getValues:P1,reset:A2,resetField:y2,clearErrors:U1,unregister:s2,setError:F1,setFocus:(y,I={})=>{const O=Y(o,y),G=O&&O._f;if(G){const B=G.refs?G.refs[0]:G.ref;B.focus&&(B.focus(),I.shouldSelect&&B.select())}},getFieldState:L1}}function xa(s={}){const n=h1.useRef(),r=h1.useRef(),[c,o]=h1.useState({isDirty:!1,isValidating:!1,isLoading:_3(s.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:s.errors||{},disabled:s.disabled||!1,defaultValues:_3(s.defaultValues)?void 0:s.defaultValues});n.current||(n.current={...ya(s,()=>o(h=>({...h}))),formState:c});const a=n.current.control;return a._options=s,D5({subject:a._subjects.state,next:h=>{gt(h,a._proxyFormState,a._updateFormState,!0)&&o({...a._formState})}}),h1.useEffect(()=>a._disableForm(s.disabled),[a,s.disabled]),h1.useEffect(()=>{if(a._proxyFormState.isDirty){const h=a._getDirty();h!==c.isDirty&&a._subjects.state.next({isDirty:h})}},[a,c.isDirty]),h1.useEffect(()=>{s.values&&!$3(s.values,r.current)?(a._reset(s.values,a._options.resetOptions),r.current=s.values,o(h=>({...h}))):a._resetDefaultValues()},[s.values,a]),h1.useEffect(()=>{s.errors&&a._setErrors(s.errors)},[s.errors,a]),h1.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),n.current.formState=pt(c,a),n.current}const Q2=({children:s,...n})=>K.jsx("div",{children:K.jsx(w1.Form,{...n,children:s})});Q2.useForm=w1.Form.useForm;Q2.useFormInstance=w1.Form.useFormInstance;Q2.useWatch=w1.Form.useWatch;Q2.Item=w1.Form.Item;Q2.List=w1.Form.List;Q2.ErrorList=w1.Form.ErrorList;Q2.Provider=w1.Form.Provider;const k6=({children:s,control:n,name:r,disabled:c,help:o,valuePropName:a,...h})=>{var w;const{field:d,fieldState:p}=aa({name:r,control:n,disabled:c}),M=Q2.useFormInstance();return h1.useEffect(()=>{M.setFieldValue(r,d.value)},[d.value]),K.jsx(Q2.Item,{...h,name:r,initialValue:d.value,validateStatus:p.invalid?"error":void 0,help:((w=p.error)==null?void 0:w.message)??o,children:h1.Children.map(s,x=>h1.isValidElement(x)&&h1.cloneElement(x,{...d,onChange:(...m)=>{x.props.onChange&&x.props.onChange(...m),d.onChange(...m)},onBlur:()=>{x.props.onBlur&&x.props.onBlur(),d.onBlur()},...a&&{[a]:d.value}}))})};function V3(s){this._maxSize=s,this.clear()}V3.prototype.clear=function(){this._size=0,this._values=Object.create(null)};V3.prototype.get=function(s){return this._values[s]};V3.prototype.set=function(s,n){return this._size>=this._maxSize&&this.clear(),s in this._values||this._size++,this._values[s]=n};var _a=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ot=/^\d+$/,ba=/^\d/,wa=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Sa=/^\s*(['"]?)(.*?)(\1)\s*$/,W5=512,$e=new V3(W5),Re=new V3(W5),De=new V3(W5),Pt={Cache:V3,split:C5,normalizePath:_5,setter:function(s){var n=_5(s);return Re.get(s)||Re.set(s,function(c,o){for(var a=0,h=n.length,d=c;a<h-1;){var p=n[a];if(p==="__proto__"||p==="constructor"||p==="prototype")return c;d=d[n[a++]]}d[n[a]]=o})},getter:function(s,n){var r=_5(s);return De.get(s)||De.set(s,function(o){for(var a=0,h=r.length;a<h;)if(o!=null||!n)o=o[r[a++]];else return;return o})},join:function(s){return s.reduce(function(n,r){return n+(B5(r)||Ot.test(r)?"["+r+"]":(n?".":"")+r)},"")},forEach:function(s,n,r){Ia(Array.isArray(s)?s:C5(s),n,r)}};function _5(s){return $e.get(s)||$e.set(s,C5(s).map(function(n){return n.replace(Sa,"$2")}))}function C5(s){return s.match(_a)||[""]}function Ia(s,n,r){var c=s.length,o,a,h,d;for(a=0;a<c;a++)o=s[a],o&&(Aa(o)&&(o='"'+o+'"'),d=B5(o),h=!d&&/^\d+$/.test(o),n.call(r,o,d,h,a,s))}function B5(s){return typeof s=="string"&&s&&["'",'"'].indexOf(s.charAt(0))!==-1}function Oa(s){return s.match(ba)&&!s.match(Ot)}function Pa(s){return wa.test(s)}function Aa(s){return!B5(s)&&(Oa(s)||Pa(s))}var At={exports:{}};At.exports=function(s){return Ct(Ca(s),s)};At.exports.array=Ct;function Ct(s,n){var r=s.length,c=new Array(r),o={},a=r,h=Ea(n),d=ka(s);for(n.forEach(function(M){if(!d.has(M[0])||!d.has(M[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)o[a]||p(s[a],a,new Set);return c;function p(M,w,x){if(x.has(M)){var m;try{m=", node was:"+JSON.stringify(M)}catch{m=""}throw new Error("Cyclic dependency"+m)}if(!d.has(M))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(M));if(!o[w]){o[w]=!0;var R=h.get(M)||new Set;if(R=Array.from(R),w=R.length){x.add(M);do{var $=R[--w];p($,d.get($),x)}while(w);x.delete(M)}c[--r]=M}}}function Ca(s){for(var n=new Set,r=0,c=s.length;r<c;r++){var o=s[r];n.add(o[0]),n.add(o[1])}return Array.from(n)}function Ea(s){for(var n=new Map,r=0,c=s.length;r<c;r++){var o=s[r];n.has(o[0])||n.set(o[0],new Set),n.has(o[1])||n.set(o[1],new Set),n.get(o[0]).add(o[1])}return n}function ka(s){for(var n=new Map,r=0,c=s.length;r<c;r++)n.set(s[r],r);return n}const La=Object.prototype.toString,Ta=Error.prototype.toString,Fa=RegExp.prototype.toString,$a=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Ra=/^Symbol\((.*)\)(.*)$/;function Da(s){return s!=+s?"NaN":s===0&&1/s<0?"-0":""+s}function Ne(s,n=!1){if(s==null||s===!0||s===!1)return""+s;const r=typeof s;if(r==="number")return Da(s);if(r==="string")return n?`"${s}"`:s;if(r==="function")return"[Function "+(s.name||"anonymous")+"]";if(r==="symbol")return $a.call(s).replace(Ra,"Symbol($1)");const c=La.call(s).slice(8,-1);return c==="Date"?isNaN(s.getTime())?""+s:s.toISOString(s):c==="Error"||s instanceof Error?"["+Ta.call(s)+"]":c==="RegExp"?Fa.call(s):null}function b3(s,n){let r=Ne(s,n);return r!==null?r:JSON.stringify(s,function(c,o){let a=Ne(this[c],n);return a!==null?a:o},2)}function Et(s){return s==null?[]:[].concat(s)}let kt,Na=/\$\{\s*(\w+)\s*\}/g;kt=Symbol.toStringTag;class m2 extends Error{static formatError(n,r){const c=r.label||r.path||"this";return c!==r.path&&(r=Object.assign({},r,{path:c})),typeof n=="string"?n.replace(Na,(o,a)=>b3(r[a])):typeof n=="function"?n(r):n}static isError(n){return n&&n.name==="ValidationError"}constructor(n,r,c,o,a){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this[kt]="Error",this.name="ValidationError",this.value=r,this.path=c,this.type=o,this.errors=[],this.inner=[],Et(n).forEach(h=>{if(m2.isError(h)){this.errors.push(...h.errors);const d=h.inner.length?h.inner:[h];this.inner.push(...d)}else this.errors.push(h)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],!a&&Error.captureStackTrace&&Error.captureStackTrace(this,m2)}}let h3={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:s,type:n,value:r,originalValue:c})=>{const o=c!=null&&c!==r?` (cast from the value \`${b3(c,!0)}\`).`:".";return n!=="mixed"?`${s} must be a \`${n}\` type, but the final value was: \`${b3(r,!0)}\``+o:`${s} must match the configured type. The validated value was: \`${b3(r,!0)}\``+o}},Ua={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Va={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},E5={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Wa={isValue:"${path} field must be ${value}"},Ba={noUnknown:"${path} field has unspecified keys: ${unknown}"},ja={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Ha={notType:s=>{const{path:n,value:r,spec:c}=s,o=c.types.length;if(Array.isArray(r)){if(r.length<o)return`${n} tuple value has too few items, expected a length of ${o} but got ${r.length} for value: \`${b3(r,!0)}\``;if(r.length>o)return`${n} tuple value has too many items, expected a length of ${o} but got ${r.length} for value: \`${b3(r,!0)}\``}return m2.formatError(h3.notType,s)}};Object.assign(Object.create(null),{mixed:h3,string:Ua,number:Va,date:E5,object:Ba,array:ja,boolean:Wa,tuple:Ha});const Lt=s=>s&&s.__isYupSchema__;class j0{static fromOptions(n,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:c,then:o,otherwise:a}=r,h=typeof c=="function"?c:(...d)=>d.every(p=>p===c);return new j0(n,(d,p)=>{var M;let w=h(...d)?o:a;return(M=w==null?void 0:w(p))!=null?M:p})}constructor(n,r){this.fn=void 0,this.refs=n,this.refs=n,this.fn=r}resolve(n,r){let c=this.refs.map(a=>a.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),o=this.fn(c,n,r);if(o===void 0||o===n)return n;if(!Lt(o))throw new TypeError("conditions must return a schema object");return o.resolve(r)}}const k0={context:"$",value:"."};class B6{constructor(n,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof n!="string")throw new TypeError("ref must be a string, got: "+n);if(this.key=n.trim(),n==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===k0.context,this.isValue=this.key[0]===k0.value,this.isSibling=!this.isContext&&!this.isValue;let c=this.isContext?k0.context:this.isValue?k0.value:"";this.path=this.key.slice(c.length),this.getter=this.path&&Pt.getter(this.path,!0),this.map=r.map}getValue(n,r,c){let o=this.isContext?c:this.isValue?n:r;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(n,r){return this.getValue(n,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(n){return n&&n.__isYupRef}}B6.prototype.__isYupRef=!0;const Tt=s=>s==null;function i6(s){function n({value:r,path:c="",options:o,originalValue:a,schema:h},d,p){const{name:M,test:w,params:x,message:m,skipAbsent:R}=s;let{parent:$,context:E,abortEarly:N=h.spec.abortEarly,disableStackTrace:Z=h.spec.disableStackTrace}=o;function D(j){return B6.isRef(j)?j.getValue(r,$,E):j}function l1(j={}){var s1;const t1=Object.assign({value:r,originalValue:a,label:h.spec.label,path:j.path||c,spec:h.spec},x,j.params);for(const T of Object.keys(t1))t1[T]=D(t1[T]);const U=new m2(m2.formatError(j.message||m,t1),r,t1.path,j.type||M,(s1=j.disableStackTrace)!=null?s1:Z);return U.params=t1,U}const r1=N?d:p;let Q={path:c,parent:$,type:M,from:o.from,createError:l1,resolve:D,options:o,originalValue:a,schema:h};const f1=j=>{m2.isError(j)?r1(j):j?p(null):r1(l1())},u1=j=>{m2.isError(j)?r1(j):d(j)};if(R&&Tt(r))return f1(!0);let _1;try{var v1;if(_1=w.call(Q,r,Q),typeof((v1=_1)==null?void 0:v1.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${Q.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(_1).then(f1,u1)}}catch(j){u1(j);return}f1(_1)}return n.OPTIONS=s,n}function Ya(s,n,r,c=r){let o,a,h;return n?(Pt.forEach(n,(d,p,M)=>{let w=p?d.slice(1,d.length-1):d;s=s.resolve({context:c,parent:o,value:r});let x=s.type==="tuple",m=M?parseInt(w,10):0;if(s.innerType||x){if(x&&!M)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${h}" must contain an index to the tuple element, e.g. "${h}[0]"`);if(r&&m>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${d}, in the path: ${n}. because there is no value at that index. `);o=r,r=r&&r[m],s=x?s.spec.types[m]:s.innerType}if(!M){if(!s.fields||!s.fields[w])throw new Error(`The schema does not contain the path: ${n}. (failed at: ${h} which is a type: "${s.type}")`);o=r,r=r&&r[w],s=s.fields[w]}a=w,h=p?"["+d+"]":"."+d}),{schema:s,parent:o,parentPath:a}):{parent:o,parentPath:n,schema:s}}class H0 extends Set{describe(){const n=[];for(const r of this.values())n.push(B6.isRef(r)?r.describe():r);return n}resolveAll(n){let r=[];for(const c of this.values())r.push(n(c));return r}clone(){return new H0(this.values())}merge(n,r){const c=this.clone();return n.forEach(o=>c.add(o)),r.forEach(o=>c.delete(o)),c}}function a6(s,n=new Map){if(Lt(s)||!s||typeof s!="object")return s;if(n.has(s))return n.get(s);let r;if(s instanceof Date)r=new Date(s.getTime()),n.set(s,r);else if(s instanceof RegExp)r=new RegExp(s),n.set(s,r);else if(Array.isArray(s)){r=new Array(s.length),n.set(s,r);for(let c=0;c<s.length;c++)r[c]=a6(s[c],n)}else if(s instanceof Map){r=new Map,n.set(s,r);for(const[c,o]of s.entries())r.set(c,a6(o,n))}else if(s instanceof Set){r=new Set,n.set(s,r);for(const c of s)r.add(a6(c,n))}else if(s instanceof Object){r={},n.set(s,r);for(const[c,o]of Object.entries(s))r[c]=a6(o,n)}else throw Error(`Unable to clone ${s}`);return r}class N3{constructor(n){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new H0,this._blacklist=new H0,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(h3.notType)}),this.type=n.type,this._typeCheck=n.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},n==null?void 0:n.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(n){if(this._mutate)return n&&Object.assign(this.spec,n),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=a6(Object.assign({},this.spec,n)),r}label(n){let r=this.clone();return r.spec.label=n,r}meta(...n){if(n.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},n[0]),r}withMutation(n){let r=this._mutate;this._mutate=!0;let c=n(this);return this._mutate=r,c}concat(n){if(!n||n===this)return this;if(n.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${n.type}`);let r=this,c=n.clone();const o=Object.assign({},r.spec,c.spec);return c.spec=o,c.internalTests=Object.assign({},r.internalTests,c.internalTests),c._whitelist=r._whitelist.merge(n._whitelist,n._blacklist),c._blacklist=r._blacklist.merge(n._blacklist,n._whitelist),c.tests=r.tests,c.exclusiveTests=r.exclusiveTests,c.withMutation(a=>{n.tests.forEach(h=>{a.test(h.OPTIONS)})}),c.transforms=[...r.transforms,...c.transforms],c}isType(n){return n==null?!!(this.spec.nullable&&n===null||this.spec.optional&&n===void 0):this._typeCheck(n)}resolve(n){let r=this;if(r.conditions.length){let c=r.conditions;r=r.clone(),r.conditions=[],r=c.reduce((o,a)=>a.resolve(o,n),r),r=r.resolve(n)}return r}resolveOptions(n){var r,c,o,a;return Object.assign({},n,{from:n.from||[],strict:(r=n.strict)!=null?r:this.spec.strict,abortEarly:(c=n.abortEarly)!=null?c:this.spec.abortEarly,recursive:(o=n.recursive)!=null?o:this.spec.recursive,disableStackTrace:(a=n.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(n,r={}){let c=this.resolve(Object.assign({value:n},r)),o=r.assert==="ignore-optionality",a=c._cast(n,r);if(r.assert!==!1&&!c.isType(a)){if(o&&Tt(a))return a;let h=b3(n),d=b3(a);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${c.type}".
29
29
 
30
30
  attempted value: ${h}
31
- `+(d!==h?`result of cast: ${d}`:""))}return a}_cast(n,r){let c=n===void 0?n:this.transforms.reduce((o,a)=>a.call(this,o,n,this),n);return c===void 0&&(c=this.getDefault(r)),c}_validate(n,r={},c,o){let{path:a,originalValue:h=n,strict:d=this.spec.strict}=r,p=n;d||(p=this._cast(p,Object.assign({assert:!1},r)));let M=[];for(let w of Object.values(this.internalTests))w&&M.push(w);this.runTests({path:a,value:p,originalValue:h,options:r,tests:M},c,w=>{if(w.length)return o(w,p);this.runTests({path:a,value:p,originalValue:h,options:r,tests:this.tests},c,o)})}runTests(n,r,c){let o=!1,{tests:a,value:h,originalValue:d,path:p,options:M}=n,w=E=>{o||(o=!0,r(E,h))},x=E=>{o||(o=!0,c(E,h))},m=a.length,R=[];if(!m)return x([]);let $={value:h,originalValue:d,path:p,options:M,schema:this};for(let E=0;E<a.length;E++){const N=a[E];N($,w,function(D){D&&(Array.isArray(D)?R.push(...D):R.push(D)),--m<=0&&x(R)})}}asNestedTest({key:n,index:r,parent:c,parentPath:o,originalParent:a,options:h}){const d=n??r;if(d==null)throw TypeError("Must include `key` or `index` for nested validations");const p=typeof d=="number";let M=c[d];const w=Object.assign({},h,{strict:!0,parent:c,value:M,originalValue:a[d],key:void 0,[p?"index":"key"]:d,path:p||d.includes(".")?`${o||""}[${M?d:`"${d}"`}]`:(o?`${o}.`:"")+n});return(x,m,R)=>this.resolve(w)._validate(M,w,m,R)}validate(n,r){var c;let o=this.resolve(Object.assign({},r,{value:n})),a=(c=r==null?void 0:r.disableStackTrace)!=null?c:o.spec.disableStackTrace;return new Promise((h,d)=>o._validate(n,r,(p,M)=>{m2.isError(p)&&(p.value=M),d(p)},(p,M)=>{p.length?d(new m2(p,M,void 0,void 0,a)):h(M)}))}validateSync(n,r){var c;let o=this.resolve(Object.assign({},r,{value:n})),a,h=(c=r==null?void 0:r.disableStackTrace)!=null?c:o.spec.disableStackTrace;return o._validate(n,Object.assign({},r,{sync:!0}),(d,p)=>{throw m2.isError(d)&&(d.value=p),d},(d,p)=>{if(d.length)throw new m2(d,n,void 0,void 0,h);a=p}),a}isValid(n,r){return this.validate(n,r).then(()=>!0,c=>{if(m2.isError(c))return!1;throw c})}isValidSync(n,r){try{return this.validateSync(n,r),!0}catch(c){if(m2.isError(c))return!1;throw c}}_getDefault(n){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,n):a6(r)}getDefault(n){return this.resolve(n||{})._getDefault(n)}default(n){return arguments.length===0?this._getDefault():this.clone({default:n})}strict(n=!0){return this.clone({strict:n})}nullability(n,r){const c=this.clone({nullable:n});return c.internalTests.nullable=i6({message:r,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),c}optionality(n,r){const c=this.clone({optional:n});return c.internalTests.optionality=i6({message:r,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),c}optional(){return this.optionality(!0)}defined(n=h3.defined){return this.optionality(!1,n)}nullable(){return this.nullability(!0)}nonNullable(n=h3.notNull){return this.nullability(!1,n)}required(n=h3.required){return this.clone().withMutation(r=>r.nonNullable(n).defined(n))}notRequired(){return this.clone().withMutation(n=>n.nullable().optional())}transform(n){let r=this.clone();return r.transforms.push(n),r}test(...n){let r;if(n.length===1?typeof n[0]=="function"?r={test:n[0]}:r=n[0]:n.length===2?r={name:n[0],test:n[1]}:r={name:n[0],message:n[1],test:n[2]},r.message===void 0&&(r.message=h3.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let c=this.clone(),o=i6(r),a=r.exclusive||r.name&&c.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(c.exclusiveTests[r.name]=!!r.exclusive),c.tests=c.tests.filter(h=>!(h.OPTIONS.name===r.name&&(a||h.OPTIONS.test===o.OPTIONS.test))),c.tests.push(o),c}when(n,r){!Array.isArray(n)&&typeof n!="string"&&(r=n,n=".");let c=this.clone(),o=Et(n).map(a=>new B6(a));return o.forEach(a=>{a.isSibling&&c.deps.push(a.key)}),c.conditions.push(typeof r=="function"?new j0(o,r):j0.fromOptions(o,r)),c}typeError(n){let r=this.clone();return r.internalTests.typeError=i6({message:n,name:"typeError",skipAbsent:!0,test(c){return this.schema._typeCheck(c)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(n,r=h3.oneOf){let c=this.clone();return n.forEach(o=>{c._whitelist.add(o),c._blacklist.delete(o)}),c.internalTests.whiteList=i6({message:r,name:"oneOf",skipAbsent:!0,test(o){let a=this.schema._whitelist,h=a.resolveAll(this.resolve);return h.includes(o)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:h}})}}),c}notOneOf(n,r=h3.notOneOf){let c=this.clone();return n.forEach(o=>{c._blacklist.add(o),c._whitelist.delete(o)}),c.internalTests.blacklist=i6({message:r,name:"notOneOf",test(o){let a=this.schema._blacklist,h=a.resolveAll(this.resolve);return h.includes(o)?this.createError({params:{values:Array.from(a).join(", "),resolved:h}}):!0}}),c}strip(n=!0){let r=this.clone();return r.spec.strip=n,r}describe(n){const r=(n?this.resolve(n):this).clone(),{label:c,meta:o,optional:a,nullable:h}=r.spec;return{meta:o,label:c,optional:a,nullable:h,default:r.getDefault(n),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(p=>({name:p.OPTIONS.name,params:p.OPTIONS.params})).filter((p,M,w)=>w.findIndex(x=>x.name===p.name)===M)}}}N3.prototype.__isYupSchema__=!0;for(const s of["validate","validateSync"])N3.prototype[`${s}At`]=function(n,r,c={}){const{parent:o,parentPath:a,schema:h}=Ya(this,n,r,c.context);return h[s](o&&o[a],Object.assign({},c,{parent:o,path:n}))};for(const s of["equals","is"])N3.prototype[s]=N3.prototype.oneOf;for(const s of["not","nope"])N3.prototype[s]=N3.prototype.notOneOf;const Ka=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function u3(s,n=0){return Number(s)||n}function Ga(s){const n=Ka.exec(s);if(!n)return Date.parse?Date.parse(s):Number.NaN;const r={year:u3(n[1]),month:u3(n[2],1)-1,day:u3(n[3],1),hour:u3(n[4]),minute:u3(n[5]),second:u3(n[6]),millisecond:n[7]?u3(n[7].substring(0,3)):0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:u3(n[10]),minuteOffset:u3(n[11])};if(r.z===void 0&&r.plusMinus===void 0)return new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond).valueOf();let c=0;return r.z!=="Z"&&r.plusMinus!==void 0&&(c=r.hourOffset*60+r.minuteOffset,r.plusMinus==="+"&&(c=0-c)),Date.UTC(r.year,r.month,r.day,r.hour,r.minute+c,r.second,r.millisecond)}let qa=new Date(""),Ja=s=>Object.prototype.toString.call(s)==="[object Date]";class j5 extends N3{constructor(){super({type:"date",check(n){return Ja(n)&&!isNaN(n.getTime())}}),this.withMutation(()=>{this.transform((n,r,c)=>!c.spec.coerce||c.isType(n)||n===null?n:(n=Ga(n),isNaN(n)?j5.INVALID_DATE:new Date(n)))})}prepareParam(n,r){let c;if(B6.isRef(n))c=n;else{let o=this.cast(n);if(!this._typeCheck(o))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);c=o}return c}min(n,r=E5.min){let c=this.prepareParam(n,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:n},skipAbsent:!0,test(o){return o>=this.resolve(c)}})}max(n,r=E5.max){let c=this.prepareParam(n,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:n},skipAbsent:!0,test(o){return o<=this.resolve(c)}})}}j5.INVALID_DATE=qa;const Za=({children:s,...n})=>K.jsx(w1.Checkbox,{...n,children:s}),Xa=({...s})=>K.jsx(w1.DatePicker,{...s});const f6=s=>K.jsx(w1.Input,{...s});f6.Password=w1.Input.Password;f6.Search=w1.Input.Search;f6.Group=w1.Input.Group;f6.TextArea=w1.Input.TextArea;const Qa=({...s})=>K.jsx(w1.InputNumber,{...s}),Ue=({children:s,...n})=>K.jsx(w1.Select,{...n,children:s}),Ft=(s,n)=>{var r,c;switch(s.type){case"input":const o=s;return K.jsx(k6,{name:o.key,label:o.label,control:n,children:((r=o.props)==null?void 0:r.mode)!=="multiple"?K.jsx(f6,{placeholder:o.placeholder}):K.jsx(Ue,{mode:"tags",placeholder:o.placeholder})},o.key);case"number":const a=s;return K.jsx(k6,{name:a.key,label:a.label,control:n,children:K.jsx(Qa,{keyboard:!1,placeholder:a.placeholder})},a.key);case"select":const h=s;return K.jsx(k6,{name:h.key,label:h.label,control:n,children:K.jsx(Ue,{mode:(c=h.props)==null?void 0:c.mode,options:h.options,placeholder:h.placeholder})},h.key);case"checkbox":const d=s,{labelRightAligned:p}=d.props||{};return K.jsx(k6,{name:d.key,initialValue:d.value,control:n,valuePropName:"checked",label:p?"":d.label,children:K.jsx(Za,{children:p?d.label:""})},d.key);case"datepicker":const M=s;return K.jsx(k6,{name:M.key,label:M.label,control:n,children:K.jsx(Xa,{placeholder:M.placeholder})},M.key);case"field-array":if(s.config)return K.jsx(h1.Fragment,{children:s.config.fields.map(w=>Ft(w,n))},s.key);break;default:return"unsupported field type"}},H5=({builderFields:s,handleChange:n,isDebounced:r=!1})=>{const{control:c,setValue:o}=xa(),a=zt({control:c});return h1.useEffect(()=>{if(!Object.keys(a).length||s.every(p=>p.type==="datepicker"?(a[p.key]===null&&(a[p.key]=void 0),a[p.key]?p.value===f3(a[p.key]).format("YYYY-MM-DD"):p.value===a[p.key]):typeof a[p.key]=="object"?JSON.stringify(p.value)===JSON.stringify(a[p.key]):p.value===a[p.key]))return;if(!r){n(a);return}const d=setTimeout(()=>{n(a)},1e3);return()=>{clearTimeout(d)}},[a]),h1.useEffect(()=>{s.forEach(h=>{const{key:d,value:p,type:M}=h;if(M==="datepicker"&&p){o(d,f3(p));return}o(d,p)})},[s]),K.jsx(K.Fragment,{children:K.jsx("div",{className:"form-builder",children:K.jsx(Q2,{children:s.map(h=>Ft(h,c))})})})},eu=()=>{const{dispatch:s,state:n,conditionalFiltersSchema:r}=U6(),{appliedFilters:c}=n,[o,a]=h1.useState(0);h1.useEffect(()=>{a(o+1)},[r]);const h=d=>{s({type:"SET_APPLIED_FILTERS",payload:{appliedFilters:{...c,...d}}})};return r?K.jsxs(K.Fragment,{children:[K.jsx(Ze,{className:"akinon-filter__header",children:"COMMON PARAMETER FILTERS"}),K.jsx("div",{children:K.jsx(H5,{builderFields:r,handleChange:h,isDebounced:!0},o)})]}):null};const tu=({...s})=>K.jsx(w1.Pagination,{...s}),ru=()=>{const[s,n]=h1.useState(""),[r,c]=h1.useState({current:1,pageSize:60}),{state:o,dispatch:a}=U6(),{applicableFilters:h,shownFilters:d}=o,p=[];h.forEach(E=>{s&&!E.placeholder.toLowerCase().includes(s.toLowerCase())&&!E.label.toLowerCase().includes(s.toLowerCase())||p.push({key:E.key,label:E.placeholder||E.label||E.key,type:"checkbox",value:d.includes(E.key),props:{labelRightAligned:!0}})});const M=p.slice((r.current-1)*r.pageSize,r.current*r.pageSize),[w,x]=h1.useState(!1),m=()=>{x(!0)},R=()=>{x(!1)},$=E=>{const N=Object.keys(E).filter(Z=>E[Z]===!0);a({type:"SET_SHOWN_FILTERS",payload:{shownFilters:N}})};return K.jsxs(w1.Space,{className:"filter-options",children:[K.jsx("div",{className:"filter-options__item",onClick:m,children:K.jsx(L5,{icon:"filter"})}),K.jsxs(w1.Modal,{className:"filter-options__modal",onCancel:R,open:w,destroyOnClose:!0,footer:null,width:"80%","data-testid":"filter-options-modal",children:[K.jsxs("div",{className:"filter-options__modal-header",children:[K.jsx("div",{className:"filter-options__modal-header-banner"}),K.jsx("h1",{className:"filter-options__modal-header-title",children:"Select Shown Filters"})]}),K.jsx(w1.Divider,{className:"filter-options__modal-divider"}),K.jsxs("div",{className:"filter-options__modal-control",children:[K.jsx(f6,{placeholder:"Search",onChange:E=>n(E.target.value),className:"filter-options__modal-search"}),K.jsx("div",{className:"filter-options__modal-pagination",children:K.jsx(tu,{current:r.current,pageSize:r.pageSize,total:p.length,onChange:(E,N)=>{c({current:E,pageSize:N})},showSizeChanger:!1,simple:!0})})]}),K.jsx("div",{className:"filter-options__modal-form",children:K.jsx(H5,{builderFields:M,handleChange:$,isDebounced:!1})})]})]})},nu=()=>{const{state:s,dispatch:n}=U6(),{applicableFilters:r,shownFilters:c,appliedFilters:o,recreateShownFiltersCount:a}=s,d=r.filter(M=>c.includes(M.key)).map(M=>({...M,value:o[M.key],props:{...(M==null?void 0:M.props)||{},labelRightAligned:!0}}));d.forEach(M=>{M.type!=="checkbox"&&delete M.label});const p=M=>{Object.keys(M).forEach(w=>{M[w]&&typeof M[w].isValid=="function"&&typeof M[w].format=="function"&&(M[w]=f3(M[w]).format("YYYY-MM-DD"))}),n({type:"SET_APPLIED_FILTERS",payload:{appliedFilters:M}})};return K.jsxs("div",{className:"shown-filters","data-testid":"shown-filters",children:[K.jsx(Ze,{className:"akinon-filter__header",children:"MAIN FILTERS"}),K.jsx(H5,{builderFields:d,handleChange:p,isDebounced:!0},a)]})},su={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,n){console&&console[s]&&console[s].apply(console,n)}};class Y0{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(n,r)}init(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||su,this.options=r,this.debug=r.debug}log(){for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return this.forward(r,"log","",!0)}warn(){for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return this.forward(r,"warn","",!0)}error(){for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return this.forward(r,"error","")}deprecate(){for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(n,r,c,o){return o&&!this.debug?null:(typeof n[0]=="string"&&(n[0]=`${c}${this.prefix} ${n[0]}`),this.logger[r](n))}create(n){return new Y0(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new Y0(this.logger,n)}}var X2=new Y0;class e4{constructor(){this.observers={}}on(n,r){return n.split(" ").forEach(c=>{this.observers[c]||(this.observers[c]=new Map);const o=this.observers[c].get(r)||0;this.observers[c].set(r,o+1)}),this}off(n,r){if(this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n].delete(r)}}emit(n){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];this.observers[n]&&Array.from(this.observers[n].entries()).forEach(h=>{let[d,p]=h;for(let M=0;M<p;M++)d(...c)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(h=>{let[d,p]=h;for(let M=0;M<p;M++)d.apply(d,[n,...c])})}}function L6(){let s,n;const r=new Promise((c,o)=>{s=c,n=o});return r.resolve=s,r.reject=n,r}function Ve(s){return s==null?"":""+s}function iu(s,n,r){s.forEach(c=>{n[c]&&(r[c]=n[c])})}const cu=/###/g;function F6(s,n,r){function c(d){return d&&d.indexOf("###")>-1?d.replace(cu,"."):d}function o(){return!s||typeof s=="string"}const a=typeof n!="string"?n:n.split(".");let h=0;for(;h<a.length-1;){if(o())return{};const d=c(a[h]);!s[d]&&r&&(s[d]=new r),Object.prototype.hasOwnProperty.call(s,d)?s=s[d]:s={},++h}return o()?{}:{obj:s,k:c(a[h])}}function We(s,n,r){const{obj:c,k:o}=F6(s,n,Object);if(c!==void 0||n.length===1){c[o]=r;return}let a=n[n.length-1],h=n.slice(0,n.length-1),d=F6(s,h,Object);for(;d.obj===void 0&&h.length;)a=`${h[h.length-1]}.${a}`,h=h.slice(0,h.length-1),d=F6(s,h,Object),d&&d.obj&&typeof d.obj[`${d.k}.${a}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${a}`]=r}function ou(s,n,r,c){const{obj:o,k:a}=F6(s,n,Object);o[a]=o[a]||[],c&&(o[a]=o[a].concat(r)),c||o[a].push(r)}function K0(s,n){const{obj:r,k:c}=F6(s,n);if(r)return r[c]}function lu(s,n,r){const c=K0(s,r);return c!==void 0?c:K0(n,r)}function $t(s,n,r){for(const c in n)c!=="__proto__"&&c!=="constructor"&&(c in s?typeof s[c]=="string"||s[c]instanceof String||typeof n[c]=="string"||n[c]instanceof String?r&&(s[c]=n[c]):$t(s[c],n[c],r):s[c]=n[c]);return s}function c6(s){return s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var au={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function uu(s){return typeof s=="string"?s.replace(/[&<>"'\/]/g,n=>au[n]):s}class hu{constructor(n){this.capacity=n,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(n){const r=this.regExpMap.get(n);if(r!==void 0)return r;const c=new RegExp(n);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(n,c),this.regExpQueue.push(n),c}}const fu=[" ",",","?","!",";"],du=new hu(20);function vu(s,n,r){n=n||"",r=r||"";const c=fu.filter(h=>n.indexOf(h)<0&&r.indexOf(h)<0);if(c.length===0)return!0;const o=du.getRegExp(`(${c.map(h=>h==="?"?"\\?":h).join("|")})`);let a=!o.test(s);if(!a){const h=s.indexOf(r);h>0&&!o.test(s.substring(0,h))&&(a=!0)}return a}function k5(s,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!s)return;if(s[n])return s[n];const c=n.split(r);let o=s;for(let a=0;a<c.length;){if(!o||typeof o!="object")return;let h,d="";for(let p=a;p<c.length;++p)if(p!==a&&(d+=r),d+=c[p],h=o[d],h!==void 0){if(["string","number","boolean"].indexOf(typeof h)>-1&&p<c.length-1)continue;a+=p-a+1;break}o=h}return o}function G0(s){return s&&s.indexOf("_")>0?s.replace("_","-"):s}class Be extends e4{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=n||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}removeNamespaces(n){const r=this.options.ns.indexOf(n);r>-1&&this.options.ns.splice(r,1)}getResource(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,h=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;n.indexOf(".")>-1?d=n.split("."):(d=[n,r],c&&(Array.isArray(c)?d.push(...c):typeof c=="string"&&a?d.push(...c.split(a)):d.push(c)));const p=K0(this.data,d);return!p&&!r&&!c&&n.indexOf(".")>-1&&(n=d[0],r=d[1],c=d.slice(2).join(".")),p||!h||typeof c!="string"?p:k5(this.data&&this.data[n]&&this.data[n][r],c,a)}addResource(n,r,c,o){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const h=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let d=[n,r];c&&(d=d.concat(h?c.split(h):c)),n.indexOf(".")>-1&&(d=n.split("."),o=r,r=d[1]),this.addNamespaces(r),We(this.data,d,o),a.silent||this.emit("added",n,r,c,o)}addResources(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in c)(typeof c[a]=="string"||Object.prototype.toString.apply(c[a])==="[object Array]")&&this.addResource(n,r,a,c[a],{silent:!0});o.silent||this.emit("added",n,r,c)}addResourceBundle(n,r,c,o,a){let h=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},d=[n,r];n.indexOf(".")>-1&&(d=n.split("."),o=c,c=r,r=d[1]),this.addNamespaces(r);let p=K0(this.data,d)||{};h.skipCopy||(c=JSON.parse(JSON.stringify(c))),o?$t(p,c,a):p={...p,...c},We(this.data,d,p),h.silent||this.emit("added",n,r,c)}removeResourceBundle(n,r){this.hasResourceBundle(n,r)&&delete this.data[n][r],this.removeNamespaces(r),this.emit("removed",n,r)}hasResourceBundle(n,r){return this.getResource(n,r)!==void 0}getResourceBundle(n,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(n,r)}:this.getResource(n,r)}getDataByLanguage(n){return this.data[n]}hasLanguageSomeTranslations(n){const r=this.getDataByLanguage(n);return!!(r&&Object.keys(r)||[]).find(o=>r[o]&&Object.keys(r[o]).length>0)}toJSON(){return this.data}}var Rt={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,n,r,c,o){return s.forEach(a=>{this.processors[a]&&(n=this.processors[a].process(n,r,c,o))}),n}};const je={};class q0 extends e4{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),iu(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=X2.create("translator")}changeLanguage(n){n&&(this.language=n)}exists(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(n==null)return!1;const c=this.resolve(n,r);return c&&c.res!==void 0}extractFromKey(n,r){let c=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const h=c&&n.indexOf(c)>-1,d=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!vu(n,c,o);if(h&&!d){const p=n.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:n,namespaces:a};const M=n.split(c);(c!==o||c===o&&this.options.ns.indexOf(M[0])>-1)&&(a=M.shift()),n=M.join(o)}return typeof a=="string"&&(a=[a]),{key:n,namespaces:a}}translate(n,r,c){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),n==null)return"";Array.isArray(n)||(n=[String(n)]);const o=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:h,namespaces:d}=this.extractFromKey(n[n.length-1],r),p=d[d.length-1],M=r.lng||this.language,w=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(M&&M.toLowerCase()==="cimode"){if(w){const r1=r.nsSeparator||this.options.nsSeparator;return o?{res:`${p}${r1}${h}`,usedKey:h,exactUsedKey:h,usedLng:M,usedNS:p,usedParams:this.getUsedParamsDetails(r)}:`${p}${r1}${h}`}return o?{res:h,usedKey:h,exactUsedKey:h,usedLng:M,usedNS:p,usedParams:this.getUsedParamsDetails(r)}:h}const x=this.resolve(n,r);let m=x&&x.res;const R=x&&x.usedKey||h,$=x&&x.exactUsedKey||h,E=Object.prototype.toString.apply(m),N=["[object Number]","[object Function]","[object RegExp]"],Z=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject;if(D&&m&&(typeof m!="string"&&typeof m!="boolean"&&typeof m!="number")&&N.indexOf(E)<0&&!(typeof Z=="string"&&E==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const r1=this.options.returnedObjectHandler?this.options.returnedObjectHandler(R,m,{...r,ns:d}):`key '${h} (${this.language})' returned an object instead of string.`;return o?(x.res=r1,x.usedParams=this.getUsedParamsDetails(r),x):r1}if(a){const r1=E==="[object Array]",Q=r1?[]:{},f1=r1?$:R;for(const u1 in m)if(Object.prototype.hasOwnProperty.call(m,u1)){const I1=`${f1}${a}${u1}`;Q[u1]=this.translate(I1,{...r,joinArrays:!1,ns:d}),Q[u1]===I1&&(Q[u1]=m[u1])}m=Q}}else if(D&&typeof Z=="string"&&E==="[object Array]")m=m.join(Z),m&&(m=this.extendTranslation(m,n,r,c));else{let r1=!1,Q=!1;const f1=r.count!==void 0&&typeof r.count!="string",u1=q0.hasDefaultValue(r),I1=f1?this.pluralResolver.getSuffix(M,r.count,r):"",_1=r.ordinal&&f1?this.pluralResolver.getSuffix(M,r.count,{ordinal:!1}):"",v1=f1&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),j=v1&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${I1}`]||r[`defaultValue${_1}`]||r.defaultValue;!this.isValidLookup(m)&&u1&&(r1=!0,m=j),this.isValidLookup(m)||(Q=!0,m=h);const t1=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Q?void 0:m,U=u1&&j!==m&&this.options.updateMissing;if(Q||r1||U){if(this.logger.log(U?"updateKey":"missingKey",M,p,h,U?j:m),a){const k=this.resolve(h,{...r,keySeparator:!1});k&&k.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 T=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let k=0;k<F.length;k++)T.push(F[k]);else this.options.saveMissingTo==="all"?T=this.languageUtils.toResolveHierarchy(r.lng||this.language):T.push(r.lng||this.language);const W=(k,q,X)=>{const a1=u1&&X!==m?X:t1;this.options.missingKeyHandler?this.options.missingKeyHandler(k,p,q,a1,U,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(k,p,q,a1,U,r),this.emit("missingKey",k,p,q,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&f1?T.forEach(k=>{const q=this.pluralResolver.getSuffixes(k,r);v1&&r[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(X=>{W([k],h+X,r[`defaultValue${X}`]||j)})}):W(T,h,j))}m=this.extendTranslation(m,n,r,x,c),Q&&m===h&&this.options.appendNamespaceToMissingKey&&(m=`${p}:${h}`),(Q||r1)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}:${h}`:h,r1?m:void 0):m=this.options.parseMissingKeyHandler(m))}return o?(x.res=m,x.usedParams=this.getUsedParamsDetails(r),x):m}extendTranslation(n,r,c,o,a){var h=this;if(this.i18nFormat&&this.i18nFormat.parse)n=this.i18nFormat.parse(n,{...this.options.interpolation.defaultVariables,...c},c.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!c.skipInterpolation){c.interpolation&&this.interpolator.init({...c,interpolation:{...this.options.interpolation,...c.interpolation}});const M=typeof n=="string"&&(c&&c.interpolation&&c.interpolation.skipOnVariables!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let w;if(M){const m=n.match(this.interpolator.nestingRegexp);w=m&&m.length}let x=c.replace&&typeof c.replace!="string"?c.replace:c;if(this.options.interpolation.defaultVariables&&(x={...this.options.interpolation.defaultVariables,...x}),n=this.interpolator.interpolate(n,x,c.lng||this.language,c),M){const m=n.match(this.interpolator.nestingRegexp),R=m&&m.length;w<R&&(c.nest=!1)}!c.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(c.lng=o.usedLng),c.nest!==!1&&(n=this.interpolator.nest(n,function(){for(var m=arguments.length,R=new Array(m),$=0;$<m;$++)R[$]=arguments[$];return a&&a[0]===R[0]&&!c.context?(h.logger.warn(`It seems you are nesting recursively key: ${R[0]} in key: ${r[0]}`),null):h.translate(...R,r)},c)),c.interpolation&&this.interpolator.reset()}const d=c.postProcess||this.options.postProcess,p=typeof d=="string"?[d]:d;return n!=null&&p&&p.length&&c.applyPostProcessor!==!1&&(n=Rt.handle(p,n,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(c)},...c}:c,this)),n}resolve(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c,o,a,h,d;return typeof n=="string"&&(n=[n]),n.forEach(p=>{if(this.isValidLookup(c))return;const M=this.extractFromKey(p,r),w=M.key;o=w;let x=M.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const m=r.count!==void 0&&typeof r.count!="string",R=m&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),$=r.context!==void 0&&(typeof r.context=="string"||typeof r.context=="number")&&r.context!=="",E=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);x.forEach(N=>{this.isValidLookup(c)||(d=N,!je[`${E[0]}-${N}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(d)&&(je[`${E[0]}-${N}`]=!0,this.logger.warn(`key "${o}" for languages "${E.join(", ")}" won't get resolved as namespace "${d}" 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!!!")),E.forEach(Z=>{if(this.isValidLookup(c))return;h=Z;const D=[w];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(D,w,Z,N,r);else{let r1;m&&(r1=this.pluralResolver.getSuffix(Z,r.count,r));const Q=`${this.options.pluralSeparator}zero`,f1=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(D.push(w+r1),r.ordinal&&r1.indexOf(f1)===0&&D.push(w+r1.replace(f1,this.options.pluralSeparator)),R&&D.push(w+Q)),$){const u1=`${w}${this.options.contextSeparator}${r.context}`;D.push(u1),m&&(D.push(u1+r1),r.ordinal&&r1.indexOf(f1)===0&&D.push(u1+r1.replace(f1,this.options.pluralSeparator)),R&&D.push(u1+Q))}}let l1;for(;l1=D.pop();)this.isValidLookup(c)||(a=l1,c=this.getResource(Z,N,l1,r))}))})}),{res:c,usedKey:o,exactUsedKey:a,usedLng:h,usedNS:d}}isValidLookup(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}getResource(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(n,r,c,o):this.resourceStore.getResource(n,r,c,o)}getUsedParamsDetails(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],c=n.replace&&typeof n.replace!="string";let o=c?n.replace:n;if(c&&typeof n.count<"u"&&(o.count=n.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!c){o={...o};for(const a of r)delete o[a]}return o}static hasDefaultValue(n){const r="defaultValue";for(const c in n)if(Object.prototype.hasOwnProperty.call(n,c)&&r===c.substring(0,r.length)&&n[c]!==void 0)return!0;return!1}}function b5(s){return s.charAt(0).toUpperCase()+s.slice(1)}class He{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=X2.create("languageUtils")}getScriptPartFromCode(n){if(n=G0(n),!n||n.indexOf("-")<0)return null;const r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(n){if(n=G0(n),!n||n.indexOf("-")<0)return n;const r=n.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(n){if(typeof n=="string"&&n.indexOf("-")>-1){const r=["hans","hant","latn","cyrl","cans","mong","arab"];let c=n.split("-");return this.options.lowerCaseLng?c=c.map(o=>o.toLowerCase()):c.length===2?(c[0]=c[0].toLowerCase(),c[1]=c[1].toUpperCase(),r.indexOf(c[1].toLowerCase())>-1&&(c[1]=b5(c[1].toLowerCase()))):c.length===3&&(c[0]=c[0].toLowerCase(),c[1].length===2&&(c[1]=c[1].toUpperCase()),c[0]!=="sgn"&&c[2].length===2&&(c[2]=c[2].toUpperCase()),r.indexOf(c[1].toLowerCase())>-1&&(c[1]=b5(c[1].toLowerCase())),r.indexOf(c[2].toLowerCase())>-1&&(c[2]=b5(c[2].toLowerCase()))),c.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}isSupportedCode(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}getBestMatchFromCodes(n){if(!n)return null;let r;return n.forEach(c=>{if(r)return;const o=this.formatLanguageCode(c);(!this.options.supportedLngs||this.isSupportedCode(o))&&(r=o)}),!r&&this.options.supportedLngs&&n.forEach(c=>{if(r)return;const o=this.getLanguagePartFromCode(c);if(this.isSupportedCode(o))return r=o;r=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];let c=n[r];return c||(c=n[this.getScriptPartFromCode(r)]),c||(c=n[this.formatLanguageCode(r)]),c||(c=n[this.getLanguagePartFromCode(r)]),c||(c=n.default),c||[]}toResolveHierarchy(n,r){const c=this.getFallbackCodes(r||this.options.fallbackLng||[],n),o=[],a=h=>{h&&(this.isSupportedCode(h)?o.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return typeof n=="string"&&(n.indexOf("-")>-1||n.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),c.forEach(h=>{o.indexOf(h)<0&&a(this.formatLanguageCode(h))}),o}}let pu=[{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}],gu={1:function(s){return+(s>1)},2:function(s){return+(s!=1)},3:function(s){return 0},4:function(s){return s%10==1&&s%100!=11?0:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?1:2},5:function(s){return s==0?0:s==1?1:s==2?2:s%100>=3&&s%100<=10?3:s%100>=11?4:5},6:function(s){return s==1?0:s>=2&&s<=4?1:2},7:function(s){return s==1?0:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?1:2},8:function(s){return s==1?0:s==2?1:s!=8&&s!=11?2:3},9:function(s){return+(s>=2)},10:function(s){return s==1?0:s==2?1:s<7?2:s<11?3:4},11:function(s){return s==1||s==11?0:s==2||s==12?1:s>2&&s<20?2:3},12:function(s){return+(s%10!=1||s%100==11)},13:function(s){return+(s!==0)},14:function(s){return s==1?0:s==2?1:s==3?2:3},15:function(s){return s%10==1&&s%100!=11?0:s%10>=2&&(s%100<10||s%100>=20)?1:2},16:function(s){return s%10==1&&s%100!=11?0:s!==0?1:2},17:function(s){return s==1||s%10==1&&s%100!=11?0:1},18:function(s){return s==0?0:s==1?1:2},19:function(s){return s==1?0:s==0||s%100>1&&s%100<11?1:s%100>10&&s%100<20?2:3},20:function(s){return s==1?0:s==0||s%100>0&&s%100<20?1:2},21:function(s){return s%100==1?1:s%100==2?2:s%100==3||s%100==4?3:0},22:function(s){return s==1?0:s==2?1:(s<0||s>10)&&s%10==0?2:3}};const Mu=["v1","v2","v3"],mu=["v4"],Ye={zero:0,one:1,two:2,few:3,many:4,other:5};function zu(){const s={};return pu.forEach(n=>{n.lngs.forEach(r=>{s[r]={numbers:n.nr,plurals:gu[n.fc]}})}),s}class yu{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=n,this.options=r,this.logger=X2.create("pluralResolver"),(!this.options.compatibilityJSON||mu.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!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=zu()}addRule(n,r){this.rules[n]=r}getRule(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(G0(n==="dev"?"en":n),{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}needsPlural(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const c=this.getRule(n,r);return this.shouldUseIntlApi()?c&&c.resolvedOptions().pluralCategories.length>1:c&&c.numbers.length>1}getPluralFormsOfKey(n,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,c).map(o=>`${r}${o}`)}getSuffixes(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const c=this.getRule(n,r);return c?this.shouldUseIntlApi()?c.resolvedOptions().pluralCategories.sort((o,a)=>Ye[o]-Ye[a]).map(o=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o}`):c.numbers.map(o=>this.getSuffix(n,o,r)):[]}getSuffix(n,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(n,c);return o?this.shouldUseIntlApi()?`${this.options.prepend}${c.ordinal?`ordinal${this.options.prepend}`:""}${o.select(r)}`:this.getSuffixRetroCompatible(o,r):(this.logger.warn(`no plural rule found for: ${n}`),"")}getSuffixRetroCompatible(n,r){const c=n.noAbs?n.plurals(r):n.plurals(Math.abs(r));let o=n.numbers[c];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const a=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&c.toString()?this.options.prepend+c.toString():c.toString()}shouldUseIntlApi(){return!Mu.includes(this.options.compatibilityJSON)}}function Ke(s,n,r){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=lu(s,n,r);return!a&&o&&typeof r=="string"&&(a=k5(s,r,c),a===void 0&&(a=k5(n,r,c))),a}class xu{constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=X2.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||(r=>r),this.init(n)}init(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});const r=n.interpolation;this.escape=r.escape!==void 0?r.escape:uu,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?c6(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?c6(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?c6(r.nestingPrefix):r.nestingPrefixEscaped||c6("$t("),this.nestingSuffix=r.nestingSuffix?c6(r.nestingSuffix):r.nestingSuffixEscaped||c6(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const n=(r,c)=>r&&r.source===c?(r.lastIndex=0,r):new RegExp(c,"g");this.regexp=n(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=n(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=n(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(n,r,c,o){let a,h,d;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function M($){return $.replace(/\$/g,"$$$$")}const w=$=>{if($.indexOf(this.formatSeparator)<0){const D=Ke(r,p,$,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(D,void 0,c,{...o,...r,interpolationkey:$}):D}const E=$.split(this.formatSeparator),N=E.shift().trim(),Z=E.join(this.formatSeparator).trim();return this.format(Ke(r,p,N,this.options.keySeparator,this.options.ignoreJSONStructure),Z,c,{...o,...r,interpolationkey:N})};this.resetRegExp();const x=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,m=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:$=>M($)},{regex:this.regexp,safeValue:$=>this.escapeValue?M(this.escape($)):M($)}].forEach($=>{for(d=0;a=$.regex.exec(n);){const E=a[1].trim();if(h=w(E),h===void 0)if(typeof x=="function"){const Z=x(n,a,o);h=typeof Z=="string"?Z:""}else if(o&&Object.prototype.hasOwnProperty.call(o,E))h="";else if(m){h=a[0];continue}else this.logger.warn(`missed to pass in variable ${E} for interpolating ${n}`),h="";else typeof h!="string"&&!this.useRawValueToEscape&&(h=Ve(h));const N=$.safeValue(h);if(n=n.replace(a[0],N),m?($.regex.lastIndex+=h.length,$.regex.lastIndex-=a[0].length):$.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),n}nest(n,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,a,h;function d(p,M){const w=this.nestingOptionsSeparator;if(p.indexOf(w)<0)return p;const x=p.split(new RegExp(`${w}[ ]*{`));let m=`{${x[1]}`;p=x[0],m=this.interpolate(m,h);const R=m.match(/'/g),$=m.match(/"/g);(R&&R.length%2===0&&!$||$.length%2!==0)&&(m=m.replace(/'/g,'"'));try{h=JSON.parse(m),M&&(h={...M,...h})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,E),`${p}${w}${m}`}return h.defaultValue&&h.defaultValue.indexOf(this.prefix)>-1&&delete h.defaultValue,p}for(;o=this.nestingRegexp.exec(n);){let p=[];h={...c},h=h.replace&&typeof h.replace!="string"?h.replace:h,h.applyPostProcessor=!1,delete h.defaultValue;let M=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const w=o[1].split(this.formatSeparator).map(x=>x.trim());o[1]=w.shift(),p=w,M=!0}if(a=r(d.call(this,o[1].trim(),h),h),a&&o[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=Ve(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${n}`),a=""),M&&(a=p.reduce((w,x)=>this.format(w,x,c.lng,{...c,interpolationkey:o[1].trim()}),a.trim())),n=n.replace(o[0],a),this.regexp.lastIndex=0}return n}}function _u(s){let n=s.toLowerCase().trim();const r={};if(s.indexOf("(")>-1){const c=s.split("(");n=c[0].toLowerCase().trim();const o=c[1].substring(0,c[1].length-1);n==="currency"&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):n==="relativetime"&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach(h=>{if(!h)return;const[d,...p]=h.split(":"),M=p.join(":").trim().replace(/^'+|'+$/g,"");r[d.trim()]||(r[d.trim()]=M),M==="false"&&(r[d.trim()]=!1),M==="true"&&(r[d.trim()]=!0),isNaN(M)||(r[d.trim()]=parseInt(M,10))})}return{formatName:n,formatOptions:r}}function o6(s){const n={};return function(c,o,a){const h=o+JSON.stringify(a);let d=n[h];return d||(d=s(G0(o),a),n[h]=d),d(c)}}class bu{constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=X2.create("formatter"),this.options=n,this.formats={number:o6((r,c)=>{const o=new Intl.NumberFormat(r,{...c});return a=>o.format(a)}),currency:o6((r,c)=>{const o=new Intl.NumberFormat(r,{...c,style:"currency"});return a=>o.format(a)}),datetime:o6((r,c)=>{const o=new Intl.DateTimeFormat(r,{...c});return a=>o.format(a)}),relativetime:o6((r,c)=>{const o=new Intl.RelativeTimeFormat(r,{...c});return a=>o.format(a,c.range||"day")}),list:o6((r,c)=>{const o=new Intl.ListFormat(r,{...c});return a=>o.format(a)})},this.init(n)}init(n){const c=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=c.formatSeparator?c.formatSeparator:c.formatSeparator||","}add(n,r){this.formats[n.toLowerCase().trim()]=r}addCached(n,r){this.formats[n.toLowerCase().trim()]=o6(r)}format(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return r.split(this.formatSeparator).reduce((d,p)=>{const{formatName:M,formatOptions:w}=_u(p);if(this.formats[M]){let x=d;try{const m=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},R=m.locale||m.lng||o.locale||o.lng||c;x=this.formats[M](d,R,{...w,...o,...m})}catch(m){this.logger.warn(m)}return x}else this.logger.warn(`there was no format function for ${M}`);return d},n)}}function wu(s,n){s.pending[n]!==void 0&&(delete s.pending[n],s.pendingCount--)}class Su extends e4{constructor(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=n,this.store=r,this.services=c,this.languageUtils=c.languageUtils,this.options=o,this.logger=X2.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(c,o.backend,o)}queueLoad(n,r,c,o){const a={},h={},d={},p={};return n.forEach(M=>{let w=!0;r.forEach(x=>{const m=`${M}|${x}`;!c.reload&&this.store.hasResourceBundle(M,x)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?h[m]===void 0&&(h[m]=!0):(this.state[m]=1,w=!1,h[m]===void 0&&(h[m]=!0),a[m]===void 0&&(a[m]=!0),p[x]===void 0&&(p[x]=!0)))}),w||(d[M]=!0)}),(Object.keys(a).length||Object.keys(h).length)&&this.queue.push({pending:h,pendingCount:Object.keys(h).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(h),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(p)}}loaded(n,r,c){const o=n.split("|"),a=o[0],h=o[1];r&&this.emit("failedLoading",a,h,r),c&&this.store.addResourceBundle(a,h,c,void 0,void 0,{skipCopy:!0}),this.state[n]=r?-1:2;const d={};this.queue.forEach(p=>{ou(p.loaded,[a],h),wu(p,n),r&&p.errors.push(r),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(M=>{d[M]||(d[M]={});const w=p.loaded[M];w.length&&w.forEach(x=>{d[M][x]===void 0&&(d[M][x]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(p=>!p.done)}read(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,h=arguments.length>5?arguments[5]:void 0;if(!n.length)return h(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:r,fcName:c,tried:o,wait:a,callback:h});return}this.readingCalls++;const d=(M,w)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(M&&w&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,n,r,c,o+1,a*2,h)},a);return}h(M,w)},p=this.backend[c].bind(this.backend);if(p.length===2){try{const M=p(n,r);M&&typeof M.then=="function"?M.then(w=>d(null,w)).catch(d):d(null,M)}catch(M){d(M)}return}return p(n,r,d)}prepareLoading(n,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=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."),o&&o();typeof n=="string"&&(n=this.languageUtils.toResolveHierarchy(n)),typeof r=="string"&&(r=[r]);const a=this.queueLoad(n,r,c,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(h=>{this.loadOne(h)})}load(n,r,c){this.prepareLoading(n,r,{},c)}reload(n,r,c){this.prepareLoading(n,r,{reload:!0},c)}loadOne(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const c=n.split("|"),o=c[0],a=c[1];this.read(o,a,"read",void 0,void 0,(h,d)=>{h&&this.logger.warn(`${r}loading namespace ${a} for language ${o} failed`,h),!h&&d&&this.logger.log(`${r}loaded namespace ${a} for language ${o}`,d),this.loaded(n,h,d)})}saveMissing(n,r,c,o,a){let h=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${c}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(c==null||c==="")){if(this.backend&&this.backend.create){const p={...h,isUpdate:a},M=this.backend.create.bind(this.backend);if(M.length<6)try{let w;M.length===5?w=M(n,r,c,o,p):w=M(n,r,c,o),w&&typeof w.then=="function"?w.then(x=>d(null,x)).catch(d):d(null,w)}catch(w){d(w)}else M(n,r,c,o,d,p)}!n||!n[0]||this.store.addResource(n[0],r,c,o)}}}function Ge(){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:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(n){let r={};if(typeof n[1]=="object"&&(r=n[1]),typeof n[1]=="string"&&(r.defaultValue=n[1]),typeof n[2]=="string"&&(r.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const c=n[3]||n[2];Object.keys(c).forEach(o=>{r[o]=c[o]})}return r},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function qe(s){return typeof s.ns=="string"&&(s.ns=[s.ns]),typeof s.fallbackLng=="string"&&(s.fallbackLng=[s.fallbackLng]),typeof s.fallbackNS=="string"&&(s.fallbackNS=[s.fallbackNS]),s.supportedLngs&&s.supportedLngs.indexOf("cimode")<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),s}function L0(){}function Iu(s){Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(r=>{typeof s[r]=="function"&&(s[r]=s[r].bind(s))})}class N6 extends e4{constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=qe(n),this.services={},this.logger=X2,this.modules={external:[]},Iu(this),r&&!this.isInitialized&&!n.isClone){if(!this.options.initImmediate)return this.init(n,r),this;setTimeout(()=>{this.init(n,r)},0)}}init(){var n=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(c=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(typeof r.ns=="string"?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const o=Ge();this.options={...o,...this.options,...qe(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);function a(w){return w?typeof w=="function"?new w:w:null}if(!this.options.isClone){this.modules.logger?X2.init(a(this.modules.logger),this.options):X2.init(null,this.options);let w;this.modules.formatter?w=this.modules.formatter:typeof Intl<"u"&&(w=bu);const x=new He(this.options);this.store=new Be(this.options.resources,this.options);const m=this.services;m.logger=X2,m.resourceStore=this.store,m.languageUtils=x,m.pluralResolver=new yu(x,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),w&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(m.formatter=a(w),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new xu(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new Su(a(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(R){for(var $=arguments.length,E=new Array($>1?$-1:0),N=1;N<$;N++)E[N-1]=arguments[N];n.emit(R,...E)}),this.modules.languageDetector&&(m.languageDetector=a(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=a(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new q0(this.services,this.options),this.translator.on("*",function(R){for(var $=arguments.length,E=new Array($>1?$-1:0),N=1;N<$;N++)E[N-1]=arguments[N];n.emit(R,...E)}),this.modules.external.forEach(R=>{R.init&&R.init(this)})}if(this.format=this.options.interpolation.format,c||(c=L0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const w=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);w.length>0&&w[0]!=="dev"&&(this.options.lng=w[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(w=>{this[w]=function(){return n.store[w](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(w=>{this[w]=function(){return n.store[w](...arguments),n}});const p=L6(),M=()=>{const w=(x,m)=>{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),p.resolve(m),c(x,m)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return w(null,this.t.bind(this));this.changeLanguage(this.options.lng,w)};return this.options.resources||!this.options.initImmediate?M():setTimeout(M,0),p}loadResources(n){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L0;const o=typeof n=="string"?n:this.language;if(typeof n=="function"&&(c=n),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return c();const a=[],h=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(M=>{M!=="cimode"&&a.indexOf(M)<0&&a.push(M)})};o?h(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>h(p)),this.options.preload&&this.options.preload.forEach(d=>h(d)),this.services.backendConnector.load(a,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),c(d)})}else c(null)}reloadResources(n,r,c){const o=L6();return n||(n=this.languages),r||(r=this.options.ns),c||(c=L0),this.services.backendConnector.reload(n,r,a=>{o.resolve(),c(a)}),o}use(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&Rt.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}setResolvedLanguage(n){if(!(!n||!this.languages)&&!(["cimode","dev"].indexOf(n)>-1))for(let r=0;r<this.languages.length;r++){const c=this.languages[r];if(!(["cimode","dev"].indexOf(c)>-1)&&this.store.hasLanguageSomeTranslations(c)){this.resolvedLanguage=c;break}}}changeLanguage(n,r){var c=this;this.isLanguageChangingTo=n;const o=L6();this.emit("languageChanging",n);const a=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},h=(p,M)=>{M?(a(M),this.translator.changeLanguage(M),this.isLanguageChangingTo=void 0,this.emit("languageChanged",M),this.logger.log("languageChanged",M)):this.isLanguageChangingTo=void 0,o.resolve(function(){return c.t(...arguments)}),r&&r(p,function(){return c.t(...arguments)})},d=p=>{!n&&!p&&this.services.languageDetector&&(p=[]);const M=typeof p=="string"?p:this.services.languageUtils.getBestMatchFromCodes(p);M&&(this.language||a(M),this.translator.language||this.translator.changeLanguage(M),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(M)),this.loadResources(M,w=>{h(w,M)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(n),o}getFixedT(n,r,c){var o=this;const a=function(h,d){let p;if(typeof d!="object"){for(var M=arguments.length,w=new Array(M>2?M-2:0),x=2;x<M;x++)w[x-2]=arguments[x];p=o.options.overloadTranslationOptionHandler([h,d].concat(w))}else p={...d};p.lng=p.lng||a.lng,p.lngs=p.lngs||a.lngs,p.ns=p.ns||a.ns,p.keyPrefix=p.keyPrefix||c||a.keyPrefix;const m=o.options.keySeparator||".";let R;return p.keyPrefix&&Array.isArray(h)?R=h.map($=>`${p.keyPrefix}${m}${$}`):R=p.keyPrefix?`${p.keyPrefix}${m}${h}`:h,o.t(R,p)};return typeof n=="string"?a.lng=n:a.lngs=n,a.ns=r,a.keyPrefix=c,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(n){this.options.defaultNS=n}hasLoadedNamespace(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const c=r.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(c.toLowerCase()==="cimode")return!0;const h=(d,p)=>{const M=this.services.backendConnector.state[`${d}|${p}`];return M===-1||M===2};if(r.precheck){const d=r.precheck(this,h);if(d!==void 0)return d}return!!(this.hasResourceBundle(c,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||h(c,n)&&(!o||h(a,n)))}loadNamespaces(n,r){const c=L6();return this.options.ns?(typeof n=="string"&&(n=[n]),n.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{c.resolve(),r&&r(o)}),c):(r&&r(),Promise.resolve())}loadLanguages(n,r){const c=L6();typeof n=="string"&&(n=[n]);const o=this.options.preload||[],a=n.filter(h=>o.indexOf(h)<0);return a.length?(this.options.preload=o.concat(a),this.loadResources(h=>{c.resolve(),r&&r(h)}),c):(r&&r(),Promise.resolve())}dir(n){if(n||(n=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!n)return"rtl";const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],c=this.services&&this.services.languageUtils||new He(Ge());return r.indexOf(c.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new N6(n,r)}cloneInstance(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L0;const c=n.forkResourceStore;c&&delete n.forkResourceStore;const o={...this.options,...n,isClone:!0},a=new N6(o);return(n.debug!==void 0||n.prefix!==void 0)&&(a.logger=a.logger.clone(n)),["store","services","language"].forEach(d=>{a[d]=this[d]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},c&&(a.store=new Be(this.store.data,o),a.services.resourceStore=a.store),a.translator=new q0(a.services,o),a.translator.on("*",function(d){for(var p=arguments.length,M=new Array(p>1?p-1:0),w=1;w<p;w++)M[w-1]=arguments[w];a.emit(d,...M)}),a.init(o,r),a.translator.options=o,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const o2=N6.createInstance();o2.createInstance=N6.createInstance;o2.createInstance;o2.dir;o2.init;o2.loadResources;o2.reloadResources;o2.use;o2.changeLanguage;o2.getFixedT;o2.t;o2.exists;o2.setDefaultNamespace;o2.hasLoadedNamespace;o2.loadNamespaces;o2.loadLanguages;const Je="akiLocaleLanguage",Ou={createInstance:s=>{const{debug:n,fallbackLng:r,translations:c}=s,a=Object.keys(c).reduce((d,p)=>(d[p]={translation:c[p]},d),{}),h=o2.createInstance({debug:n,lng:localStorage.getItem(Je)||void 0,fallbackLng:r||"en",resources:a},()=>{});return{lng:h.language,t:h.t}},setLanguage:s=>{localStorage.setItem(Je,s)}},Pu={title:"Filters"},Au={title:"Filtreler"},Cu=Ou.createInstance({debug:!0,fallbackLng:"en",translations:{en:Pu,tr:Au}});f3.extend(Sl);f3.extend(bl);f3.extend(Al);f3.extend(Ol);f3.extend(El);f3.extend(Ll);const Eu=({filterSchema:s,useAppliedFilters:n,customMainPath:r,conditionalFiltersSchema:c})=>K.jsx("div",{className:"akinon-filter",children:K.jsxs(ta,{filterSchema:s,customMainPath:r,useAppliedFilters:n,conditionalFiltersSchema:c,children:[K.jsxs("div",{className:"akinon-filter__top",children:[K.jsx(yl,{className:"akinon-filter__title",level:4,children:Cu.t("title")}),K.jsx(ru,{})]}),K.jsx(sa,{}),K.jsx(nu,{}),K.jsx(eu,{})]})});exports.Akifilter=Eu;
31
+ `+(d!==h?`result of cast: ${d}`:""))}return a}_cast(n,r){let c=n===void 0?n:this.transforms.reduce((o,a)=>a.call(this,o,n,this),n);return c===void 0&&(c=this.getDefault(r)),c}_validate(n,r={},c,o){let{path:a,originalValue:h=n,strict:d=this.spec.strict}=r,p=n;d||(p=this._cast(p,Object.assign({assert:!1},r)));let M=[];for(let w of Object.values(this.internalTests))w&&M.push(w);this.runTests({path:a,value:p,originalValue:h,options:r,tests:M},c,w=>{if(w.length)return o(w,p);this.runTests({path:a,value:p,originalValue:h,options:r,tests:this.tests},c,o)})}runTests(n,r,c){let o=!1,{tests:a,value:h,originalValue:d,path:p,options:M}=n,w=E=>{o||(o=!0,r(E,h))},x=E=>{o||(o=!0,c(E,h))},m=a.length,R=[];if(!m)return x([]);let $={value:h,originalValue:d,path:p,options:M,schema:this};for(let E=0;E<a.length;E++){const N=a[E];N($,w,function(D){D&&(Array.isArray(D)?R.push(...D):R.push(D)),--m<=0&&x(R)})}}asNestedTest({key:n,index:r,parent:c,parentPath:o,originalParent:a,options:h}){const d=n??r;if(d==null)throw TypeError("Must include `key` or `index` for nested validations");const p=typeof d=="number";let M=c[d];const w=Object.assign({},h,{strict:!0,parent:c,value:M,originalValue:a[d],key:void 0,[p?"index":"key"]:d,path:p||d.includes(".")?`${o||""}[${M?d:`"${d}"`}]`:(o?`${o}.`:"")+n});return(x,m,R)=>this.resolve(w)._validate(M,w,m,R)}validate(n,r){var c;let o=this.resolve(Object.assign({},r,{value:n})),a=(c=r==null?void 0:r.disableStackTrace)!=null?c:o.spec.disableStackTrace;return new Promise((h,d)=>o._validate(n,r,(p,M)=>{m2.isError(p)&&(p.value=M),d(p)},(p,M)=>{p.length?d(new m2(p,M,void 0,void 0,a)):h(M)}))}validateSync(n,r){var c;let o=this.resolve(Object.assign({},r,{value:n})),a,h=(c=r==null?void 0:r.disableStackTrace)!=null?c:o.spec.disableStackTrace;return o._validate(n,Object.assign({},r,{sync:!0}),(d,p)=>{throw m2.isError(d)&&(d.value=p),d},(d,p)=>{if(d.length)throw new m2(d,n,void 0,void 0,h);a=p}),a}isValid(n,r){return this.validate(n,r).then(()=>!0,c=>{if(m2.isError(c))return!1;throw c})}isValidSync(n,r){try{return this.validateSync(n,r),!0}catch(c){if(m2.isError(c))return!1;throw c}}_getDefault(n){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,n):a6(r)}getDefault(n){return this.resolve(n||{})._getDefault(n)}default(n){return arguments.length===0?this._getDefault():this.clone({default:n})}strict(n=!0){return this.clone({strict:n})}nullability(n,r){const c=this.clone({nullable:n});return c.internalTests.nullable=i6({message:r,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),c}optionality(n,r){const c=this.clone({optional:n});return c.internalTests.optionality=i6({message:r,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),c}optional(){return this.optionality(!0)}defined(n=h3.defined){return this.optionality(!1,n)}nullable(){return this.nullability(!0)}nonNullable(n=h3.notNull){return this.nullability(!1,n)}required(n=h3.required){return this.clone().withMutation(r=>r.nonNullable(n).defined(n))}notRequired(){return this.clone().withMutation(n=>n.nullable().optional())}transform(n){let r=this.clone();return r.transforms.push(n),r}test(...n){let r;if(n.length===1?typeof n[0]=="function"?r={test:n[0]}:r=n[0]:n.length===2?r={name:n[0],test:n[1]}:r={name:n[0],message:n[1],test:n[2]},r.message===void 0&&(r.message=h3.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let c=this.clone(),o=i6(r),a=r.exclusive||r.name&&c.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(c.exclusiveTests[r.name]=!!r.exclusive),c.tests=c.tests.filter(h=>!(h.OPTIONS.name===r.name&&(a||h.OPTIONS.test===o.OPTIONS.test))),c.tests.push(o),c}when(n,r){!Array.isArray(n)&&typeof n!="string"&&(r=n,n=".");let c=this.clone(),o=Et(n).map(a=>new B6(a));return o.forEach(a=>{a.isSibling&&c.deps.push(a.key)}),c.conditions.push(typeof r=="function"?new j0(o,r):j0.fromOptions(o,r)),c}typeError(n){let r=this.clone();return r.internalTests.typeError=i6({message:n,name:"typeError",skipAbsent:!0,test(c){return this.schema._typeCheck(c)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(n,r=h3.oneOf){let c=this.clone();return n.forEach(o=>{c._whitelist.add(o),c._blacklist.delete(o)}),c.internalTests.whiteList=i6({message:r,name:"oneOf",skipAbsent:!0,test(o){let a=this.schema._whitelist,h=a.resolveAll(this.resolve);return h.includes(o)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:h}})}}),c}notOneOf(n,r=h3.notOneOf){let c=this.clone();return n.forEach(o=>{c._blacklist.add(o),c._whitelist.delete(o)}),c.internalTests.blacklist=i6({message:r,name:"notOneOf",test(o){let a=this.schema._blacklist,h=a.resolveAll(this.resolve);return h.includes(o)?this.createError({params:{values:Array.from(a).join(", "),resolved:h}}):!0}}),c}strip(n=!0){let r=this.clone();return r.spec.strip=n,r}describe(n){const r=(n?this.resolve(n):this).clone(),{label:c,meta:o,optional:a,nullable:h}=r.spec;return{meta:o,label:c,optional:a,nullable:h,default:r.getDefault(n),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(p=>({name:p.OPTIONS.name,params:p.OPTIONS.params})).filter((p,M,w)=>w.findIndex(x=>x.name===p.name)===M)}}}N3.prototype.__isYupSchema__=!0;for(const s of["validate","validateSync"])N3.prototype[`${s}At`]=function(n,r,c={}){const{parent:o,parentPath:a,schema:h}=Ya(this,n,r,c.context);return h[s](o&&o[a],Object.assign({},c,{parent:o,path:n}))};for(const s of["equals","is"])N3.prototype[s]=N3.prototype.oneOf;for(const s of["not","nope"])N3.prototype[s]=N3.prototype.notOneOf;const Ka=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function u3(s,n=0){return Number(s)||n}function Ga(s){const n=Ka.exec(s);if(!n)return Date.parse?Date.parse(s):Number.NaN;const r={year:u3(n[1]),month:u3(n[2],1)-1,day:u3(n[3],1),hour:u3(n[4]),minute:u3(n[5]),second:u3(n[6]),millisecond:n[7]?u3(n[7].substring(0,3)):0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:u3(n[10]),minuteOffset:u3(n[11])};if(r.z===void 0&&r.plusMinus===void 0)return new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond).valueOf();let c=0;return r.z!=="Z"&&r.plusMinus!==void 0&&(c=r.hourOffset*60+r.minuteOffset,r.plusMinus==="+"&&(c=0-c)),Date.UTC(r.year,r.month,r.day,r.hour,r.minute+c,r.second,r.millisecond)}let qa=new Date(""),Ja=s=>Object.prototype.toString.call(s)==="[object Date]";class j5 extends N3{constructor(){super({type:"date",check(n){return Ja(n)&&!isNaN(n.getTime())}}),this.withMutation(()=>{this.transform((n,r,c)=>!c.spec.coerce||c.isType(n)||n===null?n:(n=Ga(n),isNaN(n)?j5.INVALID_DATE:new Date(n)))})}prepareParam(n,r){let c;if(B6.isRef(n))c=n;else{let o=this.cast(n);if(!this._typeCheck(o))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);c=o}return c}min(n,r=E5.min){let c=this.prepareParam(n,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:n},skipAbsent:!0,test(o){return o>=this.resolve(c)}})}max(n,r=E5.max){let c=this.prepareParam(n,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:n},skipAbsent:!0,test(o){return o<=this.resolve(c)}})}}j5.INVALID_DATE=qa;const Za=({children:s,...n})=>K.jsx(w1.Checkbox,{...n,children:s}),Xa=({...s})=>K.jsx(w1.DatePicker,{...s});const f6=s=>K.jsx(w1.Input,{...s});f6.Password=w1.Input.Password;f6.Search=w1.Input.Search;f6.Group=w1.Input.Group;f6.TextArea=w1.Input.TextArea;const Qa=({...s})=>K.jsx(w1.InputNumber,{...s}),Ue=({children:s,...n})=>K.jsx(w1.Select,{...n,children:s}),Ft=(s,n)=>{var r,c;switch(s.type){case"input":const o=s;return K.jsx(k6,{name:o.key,label:o.label,control:n,children:((r=o.props)==null?void 0:r.mode)!=="multiple"?K.jsx(f6,{placeholder:o.placeholder}):K.jsx(Ue,{mode:"tags",placeholder:o.placeholder})},o.key);case"number":const a=s;return K.jsx(k6,{name:a.key,label:a.label,control:n,children:K.jsx(Qa,{keyboard:!1,placeholder:a.placeholder})},a.key);case"select":const h=s;return K.jsx(k6,{name:h.key,label:h.label,control:n,children:K.jsx(Ue,{mode:(c=h.props)==null?void 0:c.mode,options:h.options,placeholder:h.placeholder})},h.key);case"checkbox":const d=s,{labelRightAligned:p}=d.props||{};return K.jsx(k6,{name:d.key,initialValue:d.value,control:n,valuePropName:"checked",label:p?"":d.label,children:K.jsx(Za,{children:p?d.label:""})},d.key);case"datepicker":const M=s;return K.jsx(k6,{name:M.key,label:M.label,control:n,children:K.jsx(Xa,{placeholder:M.placeholder})},M.key);case"field-array":if(s.config)return K.jsx(h1.Fragment,{children:s.config.fields.map(w=>Ft(w,n))},s.key);break;default:return"unsupported field type"}},H5=({builderFields:s,handleChange:n,isDebounced:r=!1})=>{const{control:c,setValue:o}=xa(),a=zt({control:c});return h1.useEffect(()=>{if(!Object.keys(a).length||s.every(p=>p.type==="datepicker"?(a[p.key]===null&&(a[p.key]=void 0),a[p.key]?p.value===f3(a[p.key]).format("YYYY-MM-DD"):p.value===a[p.key]):typeof a[p.key]=="object"?JSON.stringify(p.value)===JSON.stringify(a[p.key]):p.value===a[p.key]))return;if(!r){n(a);return}const d=setTimeout(()=>{n(a)},1e3);return()=>{clearTimeout(d)}},[a]),h1.useEffect(()=>{s.forEach(h=>{const{key:d,value:p,type:M}=h;if(M==="datepicker"&&p){o(d,f3(p));return}o(d,p)})},[s]),K.jsx(K.Fragment,{children:K.jsx("div",{className:"form-builder",children:K.jsx(Q2,{children:s.map(h=>Ft(h,c))})})})},eu=()=>{const{dispatch:s,state:n,conditionalFiltersSchema:r}=U6(),{appliedFilters:c}=n,[o,a]=h1.useState(0);h1.useEffect(()=>{a(o+1)},[r]);const h=d=>{s({type:"SET_APPLIED_FILTERS",payload:{appliedFilters:{...c,...d}}})};return r?K.jsxs(K.Fragment,{children:[K.jsx(Ze,{className:"akinon-filter__header",children:"COMMON PARAMETER FILTERS"}),K.jsx("div",{children:K.jsx(H5,{builderFields:r,handleChange:h,isDebounced:!0},o)})]}):null};const tu=({...s})=>K.jsx(w1.Pagination,{...s}),ru=()=>{const[s,n]=h1.useState(""),[r,c]=h1.useState({current:1,pageSize:60}),{state:o,dispatch:a}=U6(),{applicableFilters:h,shownFilters:d}=o,p=[];h.forEach(E=>{s&&!E.placeholder.toLowerCase().includes(s.toLowerCase())&&!E.label.toLowerCase().includes(s.toLowerCase())||p.push({key:E.key,label:E.placeholder||E.label||E.key,type:"checkbox",value:d.includes(E.key),props:{labelRightAligned:!0}})});const M=p.slice((r.current-1)*r.pageSize,r.current*r.pageSize),[w,x]=h1.useState(!1),m=()=>{x(!0)},R=()=>{x(!1)},$=E=>{const N=Object.keys(E).filter(Z=>E[Z]===!0);a({type:"SET_SHOWN_FILTERS",payload:{shownFilters:N}})};return K.jsxs(w1.Space,{className:"filter-options",children:[K.jsx("div",{className:"filter-options__item",onClick:m,children:K.jsx(L5,{icon:"filter"})}),K.jsxs(w1.Modal,{className:"filter-options__modal",onCancel:R,open:w,destroyOnClose:!0,footer:null,width:"80%","data-testid":"filter-options-modal",children:[K.jsxs("div",{className:"filter-options__modal-header",children:[K.jsx("div",{className:"filter-options__modal-header-banner"}),K.jsx("h1",{className:"filter-options__modal-header-title",children:"Select Shown Filters"})]}),K.jsx(w1.Divider,{className:"filter-options__modal-divider"}),K.jsxs("div",{className:"filter-options__modal-control",children:[K.jsx(f6,{placeholder:"Search",onChange:E=>n(E.target.value),className:"filter-options__modal-search"}),K.jsx("div",{className:"filter-options__modal-pagination",children:K.jsx(tu,{current:r.current,pageSize:r.pageSize,total:p.length,onChange:(E,N)=>{c({current:E,pageSize:N})},showSizeChanger:!1,simple:!0})})]}),K.jsx("div",{className:"filter-options__modal-form",children:K.jsx(H5,{builderFields:M,handleChange:$,isDebounced:!1})})]})]})},nu=()=>{const{state:s,dispatch:n}=U6(),{applicableFilters:r,shownFilters:c,appliedFilters:o,recreateShownFiltersCount:a}=s,d=r.filter(M=>c.includes(M.key)).map(M=>({...M,value:o[M.key],props:{...(M==null?void 0:M.props)||{},labelRightAligned:!0}}));d.forEach(M=>{M.type!=="checkbox"&&delete M.label});const p=M=>{Object.keys(M).forEach(w=>{M[w]&&typeof M[w].isValid=="function"&&typeof M[w].format=="function"&&(M[w]=f3(M[w]).format("YYYY-MM-DD"))}),n({type:"SET_APPLIED_FILTERS",payload:{appliedFilters:M}})};return K.jsxs("div",{className:"shown-filters","data-testid":"shown-filters",children:[K.jsx(Ze,{className:"akinon-filter__header",children:"MAIN FILTERS"}),K.jsx(H5,{builderFields:d,handleChange:p,isDebounced:!0},a)]})},su={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,n){console&&console[s]&&console[s].apply(console,n)}};class Y0{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(n,r)}init(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||su,this.options=r,this.debug=r.debug}log(){for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return this.forward(r,"log","",!0)}warn(){for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return this.forward(r,"warn","",!0)}error(){for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return this.forward(r,"error","")}deprecate(){for(var n=arguments.length,r=new Array(n),c=0;c<n;c++)r[c]=arguments[c];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(n,r,c,o){return o&&!this.debug?null:(typeof n[0]=="string"&&(n[0]=`${c}${this.prefix} ${n[0]}`),this.logger[r](n))}create(n){return new Y0(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new Y0(this.logger,n)}}var X2=new Y0;class e4{constructor(){this.observers={}}on(n,r){return n.split(" ").forEach(c=>{this.observers[c]||(this.observers[c]=new Map);const o=this.observers[c].get(r)||0;this.observers[c].set(r,o+1)}),this}off(n,r){if(this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n].delete(r)}}emit(n){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];this.observers[n]&&Array.from(this.observers[n].entries()).forEach(h=>{let[d,p]=h;for(let M=0;M<p;M++)d(...c)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(h=>{let[d,p]=h;for(let M=0;M<p;M++)d.apply(d,[n,...c])})}}function L6(){let s,n;const r=new Promise((c,o)=>{s=c,n=o});return r.resolve=s,r.reject=n,r}function Ve(s){return s==null?"":""+s}function iu(s,n,r){s.forEach(c=>{n[c]&&(r[c]=n[c])})}const cu=/###/g;function F6(s,n,r){function c(d){return d&&d.indexOf("###")>-1?d.replace(cu,"."):d}function o(){return!s||typeof s=="string"}const a=typeof n!="string"?n:n.split(".");let h=0;for(;h<a.length-1;){if(o())return{};const d=c(a[h]);!s[d]&&r&&(s[d]=new r),Object.prototype.hasOwnProperty.call(s,d)?s=s[d]:s={},++h}return o()?{}:{obj:s,k:c(a[h])}}function We(s,n,r){const{obj:c,k:o}=F6(s,n,Object);if(c!==void 0||n.length===1){c[o]=r;return}let a=n[n.length-1],h=n.slice(0,n.length-1),d=F6(s,h,Object);for(;d.obj===void 0&&h.length;)a=`${h[h.length-1]}.${a}`,h=h.slice(0,h.length-1),d=F6(s,h,Object),d&&d.obj&&typeof d.obj[`${d.k}.${a}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${a}`]=r}function ou(s,n,r,c){const{obj:o,k:a}=F6(s,n,Object);o[a]=o[a]||[],c&&(o[a]=o[a].concat(r)),c||o[a].push(r)}function K0(s,n){const{obj:r,k:c}=F6(s,n);if(r)return r[c]}function lu(s,n,r){const c=K0(s,r);return c!==void 0?c:K0(n,r)}function $t(s,n,r){for(const c in n)c!=="__proto__"&&c!=="constructor"&&(c in s?typeof s[c]=="string"||s[c]instanceof String||typeof n[c]=="string"||n[c]instanceof String?r&&(s[c]=n[c]):$t(s[c],n[c],r):s[c]=n[c]);return s}function c6(s){return s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var au={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function uu(s){return typeof s=="string"?s.replace(/[&<>"'\/]/g,n=>au[n]):s}class hu{constructor(n){this.capacity=n,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(n){const r=this.regExpMap.get(n);if(r!==void 0)return r;const c=new RegExp(n);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(n,c),this.regExpQueue.push(n),c}}const fu=[" ",",","?","!",";"],du=new hu(20);function vu(s,n,r){n=n||"",r=r||"";const c=fu.filter(h=>n.indexOf(h)<0&&r.indexOf(h)<0);if(c.length===0)return!0;const o=du.getRegExp(`(${c.map(h=>h==="?"?"\\?":h).join("|")})`);let a=!o.test(s);if(!a){const h=s.indexOf(r);h>0&&!o.test(s.substring(0,h))&&(a=!0)}return a}function k5(s,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!s)return;if(s[n])return s[n];const c=n.split(r);let o=s;for(let a=0;a<c.length;){if(!o||typeof o!="object")return;let h,d="";for(let p=a;p<c.length;++p)if(p!==a&&(d+=r),d+=c[p],h=o[d],h!==void 0){if(["string","number","boolean"].indexOf(typeof h)>-1&&p<c.length-1)continue;a+=p-a+1;break}o=h}return o}function G0(s){return s&&s.indexOf("_")>0?s.replace("_","-"):s}class Be extends e4{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=n||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}removeNamespaces(n){const r=this.options.ns.indexOf(n);r>-1&&this.options.ns.splice(r,1)}getResource(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,h=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;n.indexOf(".")>-1?d=n.split("."):(d=[n,r],c&&(Array.isArray(c)?d.push(...c):typeof c=="string"&&a?d.push(...c.split(a)):d.push(c)));const p=K0(this.data,d);return!p&&!r&&!c&&n.indexOf(".")>-1&&(n=d[0],r=d[1],c=d.slice(2).join(".")),p||!h||typeof c!="string"?p:k5(this.data&&this.data[n]&&this.data[n][r],c,a)}addResource(n,r,c,o){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const h=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let d=[n,r];c&&(d=d.concat(h?c.split(h):c)),n.indexOf(".")>-1&&(d=n.split("."),o=r,r=d[1]),this.addNamespaces(r),We(this.data,d,o),a.silent||this.emit("added",n,r,c,o)}addResources(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in c)(typeof c[a]=="string"||Object.prototype.toString.apply(c[a])==="[object Array]")&&this.addResource(n,r,a,c[a],{silent:!0});o.silent||this.emit("added",n,r,c)}addResourceBundle(n,r,c,o,a){let h=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},d=[n,r];n.indexOf(".")>-1&&(d=n.split("."),o=c,c=r,r=d[1]),this.addNamespaces(r);let p=K0(this.data,d)||{};h.skipCopy||(c=JSON.parse(JSON.stringify(c))),o?$t(p,c,a):p={...p,...c},We(this.data,d,p),h.silent||this.emit("added",n,r,c)}removeResourceBundle(n,r){this.hasResourceBundle(n,r)&&delete this.data[n][r],this.removeNamespaces(r),this.emit("removed",n,r)}hasResourceBundle(n,r){return this.getResource(n,r)!==void 0}getResourceBundle(n,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(n,r)}:this.getResource(n,r)}getDataByLanguage(n){return this.data[n]}hasLanguageSomeTranslations(n){const r=this.getDataByLanguage(n);return!!(r&&Object.keys(r)||[]).find(o=>r[o]&&Object.keys(r[o]).length>0)}toJSON(){return this.data}}var Rt={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,n,r,c,o){return s.forEach(a=>{this.processors[a]&&(n=this.processors[a].process(n,r,c,o))}),n}};const je={};class q0 extends e4{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),iu(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=X2.create("translator")}changeLanguage(n){n&&(this.language=n)}exists(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(n==null)return!1;const c=this.resolve(n,r);return c&&c.res!==void 0}extractFromKey(n,r){let c=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const h=c&&n.indexOf(c)>-1,d=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!vu(n,c,o);if(h&&!d){const p=n.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:n,namespaces:a};const M=n.split(c);(c!==o||c===o&&this.options.ns.indexOf(M[0])>-1)&&(a=M.shift()),n=M.join(o)}return typeof a=="string"&&(a=[a]),{key:n,namespaces:a}}translate(n,r,c){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),n==null)return"";Array.isArray(n)||(n=[String(n)]);const o=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:h,namespaces:d}=this.extractFromKey(n[n.length-1],r),p=d[d.length-1],M=r.lng||this.language,w=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(M&&M.toLowerCase()==="cimode"){if(w){const r1=r.nsSeparator||this.options.nsSeparator;return o?{res:`${p}${r1}${h}`,usedKey:h,exactUsedKey:h,usedLng:M,usedNS:p,usedParams:this.getUsedParamsDetails(r)}:`${p}${r1}${h}`}return o?{res:h,usedKey:h,exactUsedKey:h,usedLng:M,usedNS:p,usedParams:this.getUsedParamsDetails(r)}:h}const x=this.resolve(n,r);let m=x&&x.res;const R=x&&x.usedKey||h,$=x&&x.exactUsedKey||h,E=Object.prototype.toString.apply(m),N=["[object Number]","[object Function]","[object RegExp]"],Z=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject;if(D&&m&&(typeof m!="string"&&typeof m!="boolean"&&typeof m!="number")&&N.indexOf(E)<0&&!(typeof Z=="string"&&E==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const r1=this.options.returnedObjectHandler?this.options.returnedObjectHandler(R,m,{...r,ns:d}):`key '${h} (${this.language})' returned an object instead of string.`;return o?(x.res=r1,x.usedParams=this.getUsedParamsDetails(r),x):r1}if(a){const r1=E==="[object Array]",Q=r1?[]:{},f1=r1?$:R;for(const u1 in m)if(Object.prototype.hasOwnProperty.call(m,u1)){const I1=`${f1}${a}${u1}`;Q[u1]=this.translate(I1,{...r,joinArrays:!1,ns:d}),Q[u1]===I1&&(Q[u1]=m[u1])}m=Q}}else if(D&&typeof Z=="string"&&E==="[object Array]")m=m.join(Z),m&&(m=this.extendTranslation(m,n,r,c));else{let r1=!1,Q=!1;const f1=r.count!==void 0&&typeof r.count!="string",u1=q0.hasDefaultValue(r),I1=f1?this.pluralResolver.getSuffix(M,r.count,r):"",_1=r.ordinal&&f1?this.pluralResolver.getSuffix(M,r.count,{ordinal:!1}):"",v1=f1&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),j=v1&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${I1}`]||r[`defaultValue${_1}`]||r.defaultValue;!this.isValidLookup(m)&&u1&&(r1=!0,m=j),this.isValidLookup(m)||(Q=!0,m=h);const t1=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Q?void 0:m,U=u1&&j!==m&&this.options.updateMissing;if(Q||r1||U){if(this.logger.log(U?"updateKey":"missingKey",M,p,h,U?j:m),a){const k=this.resolve(h,{...r,keySeparator:!1});k&&k.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 T=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let k=0;k<F.length;k++)T.push(F[k]);else this.options.saveMissingTo==="all"?T=this.languageUtils.toResolveHierarchy(r.lng||this.language):T.push(r.lng||this.language);const W=(k,q,X)=>{const a1=u1&&X!==m?X:t1;this.options.missingKeyHandler?this.options.missingKeyHandler(k,p,q,a1,U,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(k,p,q,a1,U,r),this.emit("missingKey",k,p,q,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&f1?T.forEach(k=>{const q=this.pluralResolver.getSuffixes(k,r);v1&&r[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(X=>{W([k],h+X,r[`defaultValue${X}`]||j)})}):W(T,h,j))}m=this.extendTranslation(m,n,r,x,c),Q&&m===h&&this.options.appendNamespaceToMissingKey&&(m=`${p}:${h}`),(Q||r1)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}:${h}`:h,r1?m:void 0):m=this.options.parseMissingKeyHandler(m))}return o?(x.res=m,x.usedParams=this.getUsedParamsDetails(r),x):m}extendTranslation(n,r,c,o,a){var h=this;if(this.i18nFormat&&this.i18nFormat.parse)n=this.i18nFormat.parse(n,{...this.options.interpolation.defaultVariables,...c},c.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!c.skipInterpolation){c.interpolation&&this.interpolator.init({...c,interpolation:{...this.options.interpolation,...c.interpolation}});const M=typeof n=="string"&&(c&&c.interpolation&&c.interpolation.skipOnVariables!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let w;if(M){const m=n.match(this.interpolator.nestingRegexp);w=m&&m.length}let x=c.replace&&typeof c.replace!="string"?c.replace:c;if(this.options.interpolation.defaultVariables&&(x={...this.options.interpolation.defaultVariables,...x}),n=this.interpolator.interpolate(n,x,c.lng||this.language,c),M){const m=n.match(this.interpolator.nestingRegexp),R=m&&m.length;w<R&&(c.nest=!1)}!c.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(c.lng=o.usedLng),c.nest!==!1&&(n=this.interpolator.nest(n,function(){for(var m=arguments.length,R=new Array(m),$=0;$<m;$++)R[$]=arguments[$];return a&&a[0]===R[0]&&!c.context?(h.logger.warn(`It seems you are nesting recursively key: ${R[0]} in key: ${r[0]}`),null):h.translate(...R,r)},c)),c.interpolation&&this.interpolator.reset()}const d=c.postProcess||this.options.postProcess,p=typeof d=="string"?[d]:d;return n!=null&&p&&p.length&&c.applyPostProcessor!==!1&&(n=Rt.handle(p,n,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(c)},...c}:c,this)),n}resolve(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c,o,a,h,d;return typeof n=="string"&&(n=[n]),n.forEach(p=>{if(this.isValidLookup(c))return;const M=this.extractFromKey(p,r),w=M.key;o=w;let x=M.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const m=r.count!==void 0&&typeof r.count!="string",R=m&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),$=r.context!==void 0&&(typeof r.context=="string"||typeof r.context=="number")&&r.context!=="",E=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);x.forEach(N=>{this.isValidLookup(c)||(d=N,!je[`${E[0]}-${N}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(d)&&(je[`${E[0]}-${N}`]=!0,this.logger.warn(`key "${o}" for languages "${E.join(", ")}" won't get resolved as namespace "${d}" 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!!!")),E.forEach(Z=>{if(this.isValidLookup(c))return;h=Z;const D=[w];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(D,w,Z,N,r);else{let r1;m&&(r1=this.pluralResolver.getSuffix(Z,r.count,r));const Q=`${this.options.pluralSeparator}zero`,f1=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(D.push(w+r1),r.ordinal&&r1.indexOf(f1)===0&&D.push(w+r1.replace(f1,this.options.pluralSeparator)),R&&D.push(w+Q)),$){const u1=`${w}${this.options.contextSeparator}${r.context}`;D.push(u1),m&&(D.push(u1+r1),r.ordinal&&r1.indexOf(f1)===0&&D.push(u1+r1.replace(f1,this.options.pluralSeparator)),R&&D.push(u1+Q))}}let l1;for(;l1=D.pop();)this.isValidLookup(c)||(a=l1,c=this.getResource(Z,N,l1,r))}))})}),{res:c,usedKey:o,exactUsedKey:a,usedLng:h,usedNS:d}}isValidLookup(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}getResource(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(n,r,c,o):this.resourceStore.getResource(n,r,c,o)}getUsedParamsDetails(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],c=n.replace&&typeof n.replace!="string";let o=c?n.replace:n;if(c&&typeof n.count<"u"&&(o.count=n.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!c){o={...o};for(const a of r)delete o[a]}return o}static hasDefaultValue(n){const r="defaultValue";for(const c in n)if(Object.prototype.hasOwnProperty.call(n,c)&&r===c.substring(0,r.length)&&n[c]!==void 0)return!0;return!1}}function b5(s){return s.charAt(0).toUpperCase()+s.slice(1)}class He{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=X2.create("languageUtils")}getScriptPartFromCode(n){if(n=G0(n),!n||n.indexOf("-")<0)return null;const r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(n){if(n=G0(n),!n||n.indexOf("-")<0)return n;const r=n.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(n){if(typeof n=="string"&&n.indexOf("-")>-1){const r=["hans","hant","latn","cyrl","cans","mong","arab"];let c=n.split("-");return this.options.lowerCaseLng?c=c.map(o=>o.toLowerCase()):c.length===2?(c[0]=c[0].toLowerCase(),c[1]=c[1].toUpperCase(),r.indexOf(c[1].toLowerCase())>-1&&(c[1]=b5(c[1].toLowerCase()))):c.length===3&&(c[0]=c[0].toLowerCase(),c[1].length===2&&(c[1]=c[1].toUpperCase()),c[0]!=="sgn"&&c[2].length===2&&(c[2]=c[2].toUpperCase()),r.indexOf(c[1].toLowerCase())>-1&&(c[1]=b5(c[1].toLowerCase())),r.indexOf(c[2].toLowerCase())>-1&&(c[2]=b5(c[2].toLowerCase()))),c.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}isSupportedCode(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}getBestMatchFromCodes(n){if(!n)return null;let r;return n.forEach(c=>{if(r)return;const o=this.formatLanguageCode(c);(!this.options.supportedLngs||this.isSupportedCode(o))&&(r=o)}),!r&&this.options.supportedLngs&&n.forEach(c=>{if(r)return;const o=this.getLanguagePartFromCode(c);if(this.isSupportedCode(o))return r=o;r=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];let c=n[r];return c||(c=n[this.getScriptPartFromCode(r)]),c||(c=n[this.formatLanguageCode(r)]),c||(c=n[this.getLanguagePartFromCode(r)]),c||(c=n.default),c||[]}toResolveHierarchy(n,r){const c=this.getFallbackCodes(r||this.options.fallbackLng||[],n),o=[],a=h=>{h&&(this.isSupportedCode(h)?o.push(h):this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`))};return typeof n=="string"&&(n.indexOf("-")>-1||n.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),c.forEach(h=>{o.indexOf(h)<0&&a(this.formatLanguageCode(h))}),o}}let pu=[{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}],gu={1:function(s){return+(s>1)},2:function(s){return+(s!=1)},3:function(s){return 0},4:function(s){return s%10==1&&s%100!=11?0:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?1:2},5:function(s){return s==0?0:s==1?1:s==2?2:s%100>=3&&s%100<=10?3:s%100>=11?4:5},6:function(s){return s==1?0:s>=2&&s<=4?1:2},7:function(s){return s==1?0:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?1:2},8:function(s){return s==1?0:s==2?1:s!=8&&s!=11?2:3},9:function(s){return+(s>=2)},10:function(s){return s==1?0:s==2?1:s<7?2:s<11?3:4},11:function(s){return s==1||s==11?0:s==2||s==12?1:s>2&&s<20?2:3},12:function(s){return+(s%10!=1||s%100==11)},13:function(s){return+(s!==0)},14:function(s){return s==1?0:s==2?1:s==3?2:3},15:function(s){return s%10==1&&s%100!=11?0:s%10>=2&&(s%100<10||s%100>=20)?1:2},16:function(s){return s%10==1&&s%100!=11?0:s!==0?1:2},17:function(s){return s==1||s%10==1&&s%100!=11?0:1},18:function(s){return s==0?0:s==1?1:2},19:function(s){return s==1?0:s==0||s%100>1&&s%100<11?1:s%100>10&&s%100<20?2:3},20:function(s){return s==1?0:s==0||s%100>0&&s%100<20?1:2},21:function(s){return s%100==1?1:s%100==2?2:s%100==3||s%100==4?3:0},22:function(s){return s==1?0:s==2?1:(s<0||s>10)&&s%10==0?2:3}};const Mu=["v1","v2","v3"],mu=["v4"],Ye={zero:0,one:1,two:2,few:3,many:4,other:5};function zu(){const s={};return pu.forEach(n=>{n.lngs.forEach(r=>{s[r]={numbers:n.nr,plurals:gu[n.fc]}})}),s}class yu{constructor(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=n,this.options=r,this.logger=X2.create("pluralResolver"),(!this.options.compatibilityJSON||mu.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!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=zu()}addRule(n,r){this.rules[n]=r}getRule(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(G0(n==="dev"?"en":n),{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}needsPlural(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const c=this.getRule(n,r);return this.shouldUseIntlApi()?c&&c.resolvedOptions().pluralCategories.length>1:c&&c.numbers.length>1}getPluralFormsOfKey(n,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,c).map(o=>`${r}${o}`)}getSuffixes(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const c=this.getRule(n,r);return c?this.shouldUseIntlApi()?c.resolvedOptions().pluralCategories.sort((o,a)=>Ye[o]-Ye[a]).map(o=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o}`):c.numbers.map(o=>this.getSuffix(n,o,r)):[]}getSuffix(n,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(n,c);return o?this.shouldUseIntlApi()?`${this.options.prepend}${c.ordinal?`ordinal${this.options.prepend}`:""}${o.select(r)}`:this.getSuffixRetroCompatible(o,r):(this.logger.warn(`no plural rule found for: ${n}`),"")}getSuffixRetroCompatible(n,r){const c=n.noAbs?n.plurals(r):n.plurals(Math.abs(r));let o=n.numbers[c];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const a=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&c.toString()?this.options.prepend+c.toString():c.toString()}shouldUseIntlApi(){return!Mu.includes(this.options.compatibilityJSON)}}function Ke(s,n,r){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=lu(s,n,r);return!a&&o&&typeof r=="string"&&(a=k5(s,r,c),a===void 0&&(a=k5(n,r,c))),a}class xu{constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=X2.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||(r=>r),this.init(n)}init(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});const r=n.interpolation;this.escape=r.escape!==void 0?r.escape:uu,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?c6(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?c6(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?c6(r.nestingPrefix):r.nestingPrefixEscaped||c6("$t("),this.nestingSuffix=r.nestingSuffix?c6(r.nestingSuffix):r.nestingSuffixEscaped||c6(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const n=(r,c)=>r&&r.source===c?(r.lastIndex=0,r):new RegExp(c,"g");this.regexp=n(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=n(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=n(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(n,r,c,o){let a,h,d;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function M($){return $.replace(/\$/g,"$$$$")}const w=$=>{if($.indexOf(this.formatSeparator)<0){const D=Ke(r,p,$,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(D,void 0,c,{...o,...r,interpolationkey:$}):D}const E=$.split(this.formatSeparator),N=E.shift().trim(),Z=E.join(this.formatSeparator).trim();return this.format(Ke(r,p,N,this.options.keySeparator,this.options.ignoreJSONStructure),Z,c,{...o,...r,interpolationkey:N})};this.resetRegExp();const x=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,m=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:$=>M($)},{regex:this.regexp,safeValue:$=>this.escapeValue?M(this.escape($)):M($)}].forEach($=>{for(d=0;a=$.regex.exec(n);){const E=a[1].trim();if(h=w(E),h===void 0)if(typeof x=="function"){const Z=x(n,a,o);h=typeof Z=="string"?Z:""}else if(o&&Object.prototype.hasOwnProperty.call(o,E))h="";else if(m){h=a[0];continue}else this.logger.warn(`missed to pass in variable ${E} for interpolating ${n}`),h="";else typeof h!="string"&&!this.useRawValueToEscape&&(h=Ve(h));const N=$.safeValue(h);if(n=n.replace(a[0],N),m?($.regex.lastIndex+=h.length,$.regex.lastIndex-=a[0].length):$.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),n}nest(n,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,a,h;function d(p,M){const w=this.nestingOptionsSeparator;if(p.indexOf(w)<0)return p;const x=p.split(new RegExp(`${w}[ ]*{`));let m=`{${x[1]}`;p=x[0],m=this.interpolate(m,h);const R=m.match(/'/g),$=m.match(/"/g);(R&&R.length%2===0&&!$||$.length%2!==0)&&(m=m.replace(/'/g,'"'));try{h=JSON.parse(m),M&&(h={...M,...h})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,E),`${p}${w}${m}`}return h.defaultValue&&h.defaultValue.indexOf(this.prefix)>-1&&delete h.defaultValue,p}for(;o=this.nestingRegexp.exec(n);){let p=[];h={...c},h=h.replace&&typeof h.replace!="string"?h.replace:h,h.applyPostProcessor=!1,delete h.defaultValue;let M=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const w=o[1].split(this.formatSeparator).map(x=>x.trim());o[1]=w.shift(),p=w,M=!0}if(a=r(d.call(this,o[1].trim(),h),h),a&&o[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=Ve(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${n}`),a=""),M&&(a=p.reduce((w,x)=>this.format(w,x,c.lng,{...c,interpolationkey:o[1].trim()}),a.trim())),n=n.replace(o[0],a),this.regexp.lastIndex=0}return n}}function _u(s){let n=s.toLowerCase().trim();const r={};if(s.indexOf("(")>-1){const c=s.split("(");n=c[0].toLowerCase().trim();const o=c[1].substring(0,c[1].length-1);n==="currency"&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):n==="relativetime"&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach(h=>{if(!h)return;const[d,...p]=h.split(":"),M=p.join(":").trim().replace(/^'+|'+$/g,"");r[d.trim()]||(r[d.trim()]=M),M==="false"&&(r[d.trim()]=!1),M==="true"&&(r[d.trim()]=!0),isNaN(M)||(r[d.trim()]=parseInt(M,10))})}return{formatName:n,formatOptions:r}}function o6(s){const n={};return function(c,o,a){const h=o+JSON.stringify(a);let d=n[h];return d||(d=s(G0(o),a),n[h]=d),d(c)}}class bu{constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=X2.create("formatter"),this.options=n,this.formats={number:o6((r,c)=>{const o=new Intl.NumberFormat(r,{...c});return a=>o.format(a)}),currency:o6((r,c)=>{const o=new Intl.NumberFormat(r,{...c,style:"currency"});return a=>o.format(a)}),datetime:o6((r,c)=>{const o=new Intl.DateTimeFormat(r,{...c});return a=>o.format(a)}),relativetime:o6((r,c)=>{const o=new Intl.RelativeTimeFormat(r,{...c});return a=>o.format(a,c.range||"day")}),list:o6((r,c)=>{const o=new Intl.ListFormat(r,{...c});return a=>o.format(a)})},this.init(n)}init(n){const c=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=c.formatSeparator?c.formatSeparator:c.formatSeparator||","}add(n,r){this.formats[n.toLowerCase().trim()]=r}addCached(n,r){this.formats[n.toLowerCase().trim()]=o6(r)}format(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return r.split(this.formatSeparator).reduce((d,p)=>{const{formatName:M,formatOptions:w}=_u(p);if(this.formats[M]){let x=d;try{const m=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},R=m.locale||m.lng||o.locale||o.lng||c;x=this.formats[M](d,R,{...w,...o,...m})}catch(m){this.logger.warn(m)}return x}else this.logger.warn(`there was no format function for ${M}`);return d},n)}}function wu(s,n){s.pending[n]!==void 0&&(delete s.pending[n],s.pendingCount--)}class Su extends e4{constructor(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=n,this.store=r,this.services=c,this.languageUtils=c.languageUtils,this.options=o,this.logger=X2.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(c,o.backend,o)}queueLoad(n,r,c,o){const a={},h={},d={},p={};return n.forEach(M=>{let w=!0;r.forEach(x=>{const m=`${M}|${x}`;!c.reload&&this.store.hasResourceBundle(M,x)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?h[m]===void 0&&(h[m]=!0):(this.state[m]=1,w=!1,h[m]===void 0&&(h[m]=!0),a[m]===void 0&&(a[m]=!0),p[x]===void 0&&(p[x]=!0)))}),w||(d[M]=!0)}),(Object.keys(a).length||Object.keys(h).length)&&this.queue.push({pending:h,pendingCount:Object.keys(h).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(h),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(p)}}loaded(n,r,c){const o=n.split("|"),a=o[0],h=o[1];r&&this.emit("failedLoading",a,h,r),c&&this.store.addResourceBundle(a,h,c,void 0,void 0,{skipCopy:!0}),this.state[n]=r?-1:2;const d={};this.queue.forEach(p=>{ou(p.loaded,[a],h),wu(p,n),r&&p.errors.push(r),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(M=>{d[M]||(d[M]={});const w=p.loaded[M];w.length&&w.forEach(x=>{d[M][x]===void 0&&(d[M][x]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(p=>!p.done)}read(n,r,c){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,h=arguments.length>5?arguments[5]:void 0;if(!n.length)return h(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:r,fcName:c,tried:o,wait:a,callback:h});return}this.readingCalls++;const d=(M,w)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(M&&w&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,n,r,c,o+1,a*2,h)},a);return}h(M,w)},p=this.backend[c].bind(this.backend);if(p.length===2){try{const M=p(n,r);M&&typeof M.then=="function"?M.then(w=>d(null,w)).catch(d):d(null,M)}catch(M){d(M)}return}return p(n,r,d)}prepareLoading(n,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=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."),o&&o();typeof n=="string"&&(n=this.languageUtils.toResolveHierarchy(n)),typeof r=="string"&&(r=[r]);const a=this.queueLoad(n,r,c,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(h=>{this.loadOne(h)})}load(n,r,c){this.prepareLoading(n,r,{},c)}reload(n,r,c){this.prepareLoading(n,r,{reload:!0},c)}loadOne(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const c=n.split("|"),o=c[0],a=c[1];this.read(o,a,"read",void 0,void 0,(h,d)=>{h&&this.logger.warn(`${r}loading namespace ${a} for language ${o} failed`,h),!h&&d&&this.logger.log(`${r}loaded namespace ${a} for language ${o}`,d),this.loaded(n,h,d)})}saveMissing(n,r,c,o,a){let h=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${c}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(c==null||c==="")){if(this.backend&&this.backend.create){const p={...h,isUpdate:a},M=this.backend.create.bind(this.backend);if(M.length<6)try{let w;M.length===5?w=M(n,r,c,o,p):w=M(n,r,c,o),w&&typeof w.then=="function"?w.then(x=>d(null,x)).catch(d):d(null,w)}catch(w){d(w)}else M(n,r,c,o,d,p)}!n||!n[0]||this.store.addResource(n[0],r,c,o)}}}function Ge(){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:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(n){let r={};if(typeof n[1]=="object"&&(r=n[1]),typeof n[1]=="string"&&(r.defaultValue=n[1]),typeof n[2]=="string"&&(r.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const c=n[3]||n[2];Object.keys(c).forEach(o=>{r[o]=c[o]})}return r},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function qe(s){return typeof s.ns=="string"&&(s.ns=[s.ns]),typeof s.fallbackLng=="string"&&(s.fallbackLng=[s.fallbackLng]),typeof s.fallbackNS=="string"&&(s.fallbackNS=[s.fallbackNS]),s.supportedLngs&&s.supportedLngs.indexOf("cimode")<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),s}function L0(){}function Iu(s){Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(r=>{typeof s[r]=="function"&&(s[r]=s[r].bind(s))})}class N6 extends e4{constructor(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=qe(n),this.services={},this.logger=X2,this.modules={external:[]},Iu(this),r&&!this.isInitialized&&!n.isClone){if(!this.options.initImmediate)return this.init(n,r),this;setTimeout(()=>{this.init(n,r)},0)}}init(){var n=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(c=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(typeof r.ns=="string"?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const o=Ge();this.options={...o,...this.options,...qe(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);function a(w){return w?typeof w=="function"?new w:w:null}if(!this.options.isClone){this.modules.logger?X2.init(a(this.modules.logger),this.options):X2.init(null,this.options);let w;this.modules.formatter?w=this.modules.formatter:typeof Intl<"u"&&(w=bu);const x=new He(this.options);this.store=new Be(this.options.resources,this.options);const m=this.services;m.logger=X2,m.resourceStore=this.store,m.languageUtils=x,m.pluralResolver=new yu(x,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),w&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(m.formatter=a(w),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new xu(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new Su(a(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(R){for(var $=arguments.length,E=new Array($>1?$-1:0),N=1;N<$;N++)E[N-1]=arguments[N];n.emit(R,...E)}),this.modules.languageDetector&&(m.languageDetector=a(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=a(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new q0(this.services,this.options),this.translator.on("*",function(R){for(var $=arguments.length,E=new Array($>1?$-1:0),N=1;N<$;N++)E[N-1]=arguments[N];n.emit(R,...E)}),this.modules.external.forEach(R=>{R.init&&R.init(this)})}if(this.format=this.options.interpolation.format,c||(c=L0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const w=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);w.length>0&&w[0]!=="dev"&&(this.options.lng=w[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(w=>{this[w]=function(){return n.store[w](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(w=>{this[w]=function(){return n.store[w](...arguments),n}});const p=L6(),M=()=>{const w=(x,m)=>{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),p.resolve(m),c(x,m)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return w(null,this.t.bind(this));this.changeLanguage(this.options.lng,w)};return this.options.resources||!this.options.initImmediate?M():setTimeout(M,0),p}loadResources(n){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L0;const o=typeof n=="string"?n:this.language;if(typeof n=="function"&&(c=n),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return c();const a=[],h=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(M=>{M!=="cimode"&&a.indexOf(M)<0&&a.push(M)})};o?h(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>h(p)),this.options.preload&&this.options.preload.forEach(d=>h(d)),this.services.backendConnector.load(a,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),c(d)})}else c(null)}reloadResources(n,r,c){const o=L6();return n||(n=this.languages),r||(r=this.options.ns),c||(c=L0),this.services.backendConnector.reload(n,r,a=>{o.resolve(),c(a)}),o}use(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&Rt.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}setResolvedLanguage(n){if(!(!n||!this.languages)&&!(["cimode","dev"].indexOf(n)>-1))for(let r=0;r<this.languages.length;r++){const c=this.languages[r];if(!(["cimode","dev"].indexOf(c)>-1)&&this.store.hasLanguageSomeTranslations(c)){this.resolvedLanguage=c;break}}}changeLanguage(n,r){var c=this;this.isLanguageChangingTo=n;const o=L6();this.emit("languageChanging",n);const a=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},h=(p,M)=>{M?(a(M),this.translator.changeLanguage(M),this.isLanguageChangingTo=void 0,this.emit("languageChanged",M),this.logger.log("languageChanged",M)):this.isLanguageChangingTo=void 0,o.resolve(function(){return c.t(...arguments)}),r&&r(p,function(){return c.t(...arguments)})},d=p=>{!n&&!p&&this.services.languageDetector&&(p=[]);const M=typeof p=="string"?p:this.services.languageUtils.getBestMatchFromCodes(p);M&&(this.language||a(M),this.translator.language||this.translator.changeLanguage(M),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(M)),this.loadResources(M,w=>{h(w,M)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(n),o}getFixedT(n,r,c){var o=this;const a=function(h,d){let p;if(typeof d!="object"){for(var M=arguments.length,w=new Array(M>2?M-2:0),x=2;x<M;x++)w[x-2]=arguments[x];p=o.options.overloadTranslationOptionHandler([h,d].concat(w))}else p={...d};p.lng=p.lng||a.lng,p.lngs=p.lngs||a.lngs,p.ns=p.ns||a.ns,p.keyPrefix=p.keyPrefix||c||a.keyPrefix;const m=o.options.keySeparator||".";let R;return p.keyPrefix&&Array.isArray(h)?R=h.map($=>`${p.keyPrefix}${m}${$}`):R=p.keyPrefix?`${p.keyPrefix}${m}${h}`:h,o.t(R,p)};return typeof n=="string"?a.lng=n:a.lngs=n,a.ns=r,a.keyPrefix=c,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(n){this.options.defaultNS=n}hasLoadedNamespace(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const c=r.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(c.toLowerCase()==="cimode")return!0;const h=(d,p)=>{const M=this.services.backendConnector.state[`${d}|${p}`];return M===-1||M===2};if(r.precheck){const d=r.precheck(this,h);if(d!==void 0)return d}return!!(this.hasResourceBundle(c,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||h(c,n)&&(!o||h(a,n)))}loadNamespaces(n,r){const c=L6();return this.options.ns?(typeof n=="string"&&(n=[n]),n.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{c.resolve(),r&&r(o)}),c):(r&&r(),Promise.resolve())}loadLanguages(n,r){const c=L6();typeof n=="string"&&(n=[n]);const o=this.options.preload||[],a=n.filter(h=>o.indexOf(h)<0);return a.length?(this.options.preload=o.concat(a),this.loadResources(h=>{c.resolve(),r&&r(h)}),c):(r&&r(),Promise.resolve())}dir(n){if(n||(n=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!n)return"rtl";const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],c=this.services&&this.services.languageUtils||new He(Ge());return r.indexOf(c.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new N6(n,r)}cloneInstance(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L0;const c=n.forkResourceStore;c&&delete n.forkResourceStore;const o={...this.options,...n,isClone:!0},a=new N6(o);return(n.debug!==void 0||n.prefix!==void 0)&&(a.logger=a.logger.clone(n)),["store","services","language"].forEach(d=>{a[d]=this[d]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},c&&(a.store=new Be(this.store.data,o),a.services.resourceStore=a.store),a.translator=new q0(a.services,o),a.translator.on("*",function(d){for(var p=arguments.length,M=new Array(p>1?p-1:0),w=1;w<p;w++)M[w-1]=arguments[w];a.emit(d,...M)}),a.init(o,r),a.translator.options=o,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const o2=N6.createInstance();o2.createInstance=N6.createInstance;o2.createInstance;o2.dir;o2.init;o2.loadResources;o2.reloadResources;o2.use;o2.changeLanguage;o2.getFixedT;o2.t;o2.exists;o2.setDefaultNamespace;o2.hasLoadedNamespace;o2.loadNamespaces;o2.loadLanguages;const Je="locale",Ou={createInstance:s=>{const{debug:n,fallbackLng:r,translations:c}=s,a=Object.keys(c).reduce((d,p)=>(d[p]={translation:c[p]},d),{}),h=o2.createInstance({debug:n,lng:localStorage.getItem(Je)||void 0,fallbackLng:r||"en",resources:a},()=>{});return{lng:h.language,t:h.t}},setLanguage:s=>{localStorage.setItem(Je,s)}},Pu={title:"Filters"},Au={title:"Filtreler"},Cu=Ou.createInstance({debug:!0,fallbackLng:"en",translations:{en:Pu,tr:Au}});f3.extend(Sl);f3.extend(bl);f3.extend(Al);f3.extend(Ol);f3.extend(El);f3.extend(Ll);const Eu=({filterSchema:s,useAppliedFilters:n,customMainPath:r,conditionalFiltersSchema:c})=>K.jsx("div",{className:"akinon-filter",children:K.jsxs(ta,{filterSchema:s,customMainPath:r,useAppliedFilters:n,conditionalFiltersSchema:c,children:[K.jsxs("div",{className:"akinon-filter__top",children:[K.jsx(yl,{className:"akinon-filter__title",level:4,children:Cu.t("title")}),K.jsx(ru,{})]}),K.jsx(sa,{}),K.jsx(nu,{}),K.jsx(eu,{})]})});exports.Akifilter=Eu;
package/dist/index.js CHANGED
@@ -16143,7 +16143,7 @@ c2.setDefaultNamespace;
16143
16143
  c2.hasLoadedNamespace;
16144
16144
  c2.loadNamespaces;
16145
16145
  c2.loadLanguages;
16146
- const st = "akiLocaleLanguage", Zu = {
16146
+ const st = "locale", Zu = {
16147
16147
  createInstance: (i) => {
16148
16148
  const { debug: n, fallbackLng: r, translations: c } = i, a = Object.keys(c).reduce((d, p) => (d[p] = {
16149
16149
  translation: c[p]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/akifilter",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "main": "dist/esm/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -15,12 +15,12 @@
15
15
  "react-hook-form": "7.48.2",
16
16
  "react-hook-form-antd": "1.0.1",
17
17
  "use-immer": "^0.9.0",
18
- "@akinon/icons": "^0.4.0",
19
18
  "@akinon/akiform-builder": "^0.4.0",
20
- "@akinon/ui-input": "0.4.0",
19
+ "@akinon/icons": "^0.4.0",
20
+ "@akinon/ui-typography": "0.3.0",
21
21
  "@akinon/ui-pagination": "0.3.0",
22
- "@akinon/akilocale": "^0.10.0",
23
- "@akinon/ui-typography": "0.3.0"
22
+ "@akinon/akilocale": "^0.10.1",
23
+ "@akinon/ui-input": "0.4.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "clean-package": "2.2.0",