@adyen/adyen-platform-experience-web
Version:

1 lines • 330 kB
JavaScript
"use strict";const L=require("classnames");var jt,D,bi,wn,Ge,as,vi,Ii,Si,yr,Xn,Jn,Ti,on={},an=[],rc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qt=Array.isArray;function Le(t,e){for(var n in e)t[n]=e[n];return t}function _r(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function qe(t,e,n){var r,s,i,o={};for(i in e)i=="key"?r=e[i]:i=="ref"?s=e[i]:o[i]=e[i];if(arguments.length>2&&(o.children=arguments.length>3?jt.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)o[i]===void 0&&(o[i]=t.defaultProps[i]);return xt(t,o,r,s,null)}function xt(t,e,n,r,s){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++bi,__i:-1,__u:0};return s==null&&D.vnode!=null&&D.vnode(i),i}function ae(t){return t.children}function Ue(t,e){this.props=t,this.context=e}function vt(t,e){if(e==null)return t.__?vt(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?vt(t):null}function sc(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,r=[],s=[],i=Le({},e);i.__v=e.__v+1,D.vnode&&D.vnode(i),br(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,r,n??vt(e),!!(32&e.__u),s),i.__v=e.__v,i.__.__k[i.__i]=i,Pi(r,i,s),e.__e=e.__=null,i.__e!=n&&wi(i)}}function wi(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),wi(t)}function Zn(t){(!t.__d&&(t.__d=!0)&&Ge.push(t)&&!cn.__r++||as!=D.debounceRendering)&&((as=D.debounceRendering)||vi)(cn)}function cn(){try{for(var t,e=1;Ge.length;)Ge.length>e&&Ge.sort(Ii),t=Ge.shift(),e=Ge.length,sc(t)}finally{Ge.length=cn.__r=0}}function Ei(t,e,n,r,s,i,o,a,l,c,u){var d,f,h,m,y,b,g,_=r&&r.__k||an,I=e.length;for(l=ic(n,e,_,l,I),d=0;d<I;d++)(h=n.__k[d])!=null&&(f=h.__i!=-1&&_[h.__i]||on,h.__i=d,b=br(t,h,f,s,i,o,a,l,c,u),m=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&vr(f.ref,null,h),u.push(h.ref,h.__c||m,h)),y==null&&m!=null&&(y=m),(g=!!(4&h.__u))||f.__k===h.__k?l=Ai(h,l,t,g):typeof h.type=="function"&&b!==void 0?l=b:m&&(l=m.nextSibling),h.__u&=-7);return n.__e=y,l}function ic(t,e,n,r,s){var i,o,a,l,c,u=n.length,d=u,f=0;for(t.__k=new Array(s),i=0;i<s;i++)(o=e[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[i]=xt(null,o,null,null,null):qt(o)?o=t.__k[i]=xt(ae,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[i]=xt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[i]=o,l=i+f,o.__=t,o.__b=t.__b+1,a=null,(c=o.__i=oc(o,n,l,d))!=-1&&(d--,(a=n[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(s>u?f--:s<u&&f++),typeof o.type!="function"&&(o.__u|=4)):c!=l&&(c==l-1?f--:c==l+1?f++:(c>l?f--:f++,o.__u|=4))):t.__k[i]=null;if(d)for(i=0;i<u;i++)(a=n[i])!=null&&(2&a.__u)==0&&(a.__e==r&&(r=vt(a)),Di(a,a));return r}function Ai(t,e,n,r){var s,i;if(typeof t.type=="function"){for(s=t.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=t,e=Ai(s[i],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=vt(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function It(t,e){return e=e||[],t==null||typeof t=="boolean"||(qt(t)?t.some(function(n){It(n,e)}):e.push(t)),e}function oc(t,e,n,r){var s,i,o,a=t.key,l=t.type,c=e[n],u=c!=null&&(2&c.__u)==0;if(c===null&&a==null||u&&a==c.key&&l==c.type)return n;if(r>(u?1:0)){for(s=n-1,i=n+1;s>=0||i<e.length;)if((c=e[o=s>=0?s--:i++])!=null&&(2&c.__u)==0&&a==c.key&&l==c.type)return o}return-1}function cs(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||rc.test(e)?n:n+"px"}function Yt(t,e,n,r,s){var i,o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||cs(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||cs(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(Si,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=yr,t.addEventListener(e,i?Jn:Xn,i)):t.removeEventListener(e,i?Jn:Xn,i);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ls(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=yr++;else if(e.t<n.u)return;return n(D.event?D.event(e):e)}}}function br(t,e,n,r,s,i,o,a,l,c){var u,d,f,h,m,y,b,g,_,I,w,E,k,A,F,S=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[a=e.__e=n.__e]),(u=D.__b)&&u(e);e:if(typeof S=="function")try{if(g=e.props,_=S.prototype&&S.prototype.render,I=(u=S.contextType)&&r[u.__c],w=u?I?I.props.value:u.__:r,n.__c?b=(d=e.__c=n.__c).__=d.__E:(_?e.__c=d=new S(g,w):(e.__c=d=new Ue(g,w),d.constructor=S,d.render=cc),I&&I.sub(d),d.state||(d.state={}),d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),_&&d.__s==null&&(d.__s=d.state),_&&S.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Le({},d.__s)),Le(d.__s,S.getDerivedStateFromProps(g,d.__s))),h=d.props,m=d.state,d.__v=e,f)_&&S.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),_&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(_&&S.getDerivedStateFromProps==null&&g!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(g,w),e.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(g,d.__s,w)===!1){e.__v!=n.__v&&(d.props=g,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(U){U&&(U.__=e)}),an.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(g,d.__s,w),_&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,m,y)})}if(d.context=w,d.props=g,d.__P=t,d.__e=!1,E=D.__r,k=0,_)d.state=d.__s,d.__d=!1,E&&E(e),u=d.render(d.props,d.state,d.context),an.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,E&&E(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++k<25);d.state=d.__s,d.getChildContext!=null&&(r=Le(Le({},r),d.getChildContext())),_&&!f&&d.getSnapshotBeforeUpdate!=null&&(y=d.getSnapshotBeforeUpdate(h,m)),A=u!=null&&u.type===ae&&u.key==null?Ni(u.props.children):u,a=Ei(t,qt(A)?A:[A],e,n,r,s,i,o,a,l,c),d.base=e.__e,e.__u&=-161,d.__h.length&&o.push(d),b&&(d.__E=d.__=null)}catch(U){if(e.__v=null,l||i!=null)if(U.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,e.__e=a}else{for(F=i.length;F--;)_r(i[F]);er(e)}else e.__e=n.__e,e.__k=n.__k,U.then||er(e);D.__e(U,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=ac(n.__e,e,n,r,s,i,o,l,c);return(u=D.diffed)&&u(e),128&e.__u?void 0:a}function er(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(er))}function Pi(t,e,n){for(var r=0;r<n.length;r++)vr(n[r],n[++r],n[++r]);D.__c&&D.__c(e,t),t.some(function(s){try{t=s.__h,s.__h=[],t.some(function(i){i.call(s)})}catch(i){D.__e(i,s.__v)}})}function Ni(t){return typeof t!="object"||t==null||t.__b>0?t:qt(t)?t.map(Ni):Le({},t)}function ac(t,e,n,r,s,i,o,a,l){var c,u,d,f,h,m,y,b=n.props||on,g=e.props,_=e.type;if(_=="svg"?s="http://www.w3.org/2000/svg":_=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((h=i[c])&&"setAttribute"in h==!!_&&(_?h.localName==_:h.nodeType==3)){t=h,i[c]=null;break}}if(t==null){if(_==null)return document.createTextNode(g);t=document.createElementNS(s,_,g.is&&g),a&&(D.__m&&D.__m(e,i),a=!1),i=null}if(_==null)b===g||a&&t.data==g||(t.data=g);else{if(i=i&&jt.call(t.childNodes),!a&&i!=null)for(b={},c=0;c<t.attributes.length;c++)b[(h=t.attributes[c]).name]=h.value;for(c in b)h=b[c],c=="dangerouslySetInnerHTML"?d=h:c=="children"||c in g||c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g||Yt(t,c,null,h,s);for(c in g)h=g[c],c=="children"?f=h:c=="dangerouslySetInnerHTML"?u=h:c=="value"?m=h:c=="checked"?y=h:a&&typeof h!="function"||b[c]===h||Yt(t,c,h,b[c],s);if(u)a||d&&(u.__html==d.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),Ei(e.type=="template"?t.content:t,qt(f)?f:[f],e,n,r,_=="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:n.__k&&vt(n,0),a,l),i!=null)for(c=i.length;c--;)_r(i[c]);a||(c="value",_=="progress"&&m==null?t.removeAttribute("value"):m!=null&&(m!==t[c]||_=="progress"&&!m||_=="option"&&m!=b[c])&&Yt(t,c,m,b[c],s),c="checked",y!=null&&y!=t[c]&&Yt(t,c,y,b[c],s))}return t}function vr(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(s){D.__e(s,n)}}function Di(t,e,n){var r,s;if(D.unmount&&D.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||vr(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){D.__e(i,e)}r.base=r.__P=null}if(r=t.__k)for(s=0;s<r.length;s++)r[s]&&Di(r[s],e,n||typeof t.type!="function");n||_r(t.__e),t.__c=t.__=t.__e=void 0}function cc(t,e,n){return this.constructor(t,n)}function En(t,e,n){var r,s,i,o;e==document&&(e=document.documentElement),D.__&&D.__(t,e),s=(r=typeof n=="function")?null:n&&n.__k||e.__k,i=[],o=[],br(e,t=(!r&&n||e).__k=qe(ae,null,[t]),s||on,on,e.namespaceURI,!r&&n?[n]:s?null:e.firstChild?jt.call(e.childNodes):null,i,!r&&n?n:s?s.__e:e.firstChild,r,o),Pi(i,t,o)}function Oi(t,e){En(t,e,Oi)}function Ir(t,e,n){var r,s,i,o,a=Le({},t.props);for(i in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)i=="key"?r=e[i]:i=="ref"?s=e[i]:a[i]=e[i]===void 0&&o!=null?o[i]:e[i];return arguments.length>2&&(a.children=arguments.length>3?jt.call(arguments,2):n),xt(t.type,a,r||t.key,s||t.ref,null)}function _e(t){function e(n){var r,s;return this.getChildContext||(r=new Set,(s={})[e.__c]=this,this.getChildContext=function(){return s},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&r.forEach(function(o){o.__e=!0,Zn(o)})},this.sub=function(i){r.add(i);var o=i.componentWillUnmount;i.componentWillUnmount=function(){r&&r.delete(i),o&&o.call(i)}}),n.children}return e.__c="__cC"+Ti++,e.__=t,e.Provider=e.__l=(e.Consumer=function(n,r){return n.children(r)}).contextType=e,e}jt=an.slice,D={__e:function(t,e,n,r){for(var s,i,o;e=e.__;)if((s=e.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(t)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(t,r||{}),o=s.__d),o)return s.__E=s}catch(a){t=a}throw t}},bi=0,wn=function(t){return t!=null&&t.constructor===void 0},Ue.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Le({},this.state),typeof t=="function"&&(t=t(Le({},n),this.props)),t&&Le(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Zn(this))},Ue.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Zn(this))},Ue.prototype.render=ae,Ge=[],vi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ii=function(t,e){return t.__v.__b-e.__v.__b},cn.__r=0,Si=/(PointerCapture)$|Capture$/i,yr=0,Xn=ls(!1),Jn=ls(!0),Ti=0;var lc=0;function p(t,e,n,r,s,i){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)a=="ref"?o=e[a]:l[a]=e[a];var c={type:t,props:l,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--lc,__i:-1,__u:0,__source:s,__self:i};if(typeof t=="function"&&(o=t.defaultProps))for(a in o)l[a]===void 0&&(l[a]=o[a]);return D.vnode&&D.vnode(c),c}var dt,Z,Vn,ds,Ut=0,ki=[],te=D,us=te.__b,hs=te.__r,fs=te.diffed,ps=te.__c,ms=te.unmount,gs=te.__;function Ht(t,e){te.__h&&te.__h(Z,t,Ut||e),Ut=0;var n=Z.__H||(Z.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function H(t){return Ut=1,An(Ri,t)}function An(t,e,n){var r=Ht(dt++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Ri(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,a);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.__f)){var s=function(a,l,c){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(f){return f.__c});if(u.every(function(f){return!f.__N}))return!i||i.call(this,a,l,c);var d=r.__c.props!==a;return u.some(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(d=!0)}}),i&&i.call(this,a,l,c)||d};Z.__f=!0;var i=Z.shouldComponentUpdate,o=Z.componentWillUpdate;Z.componentWillUpdate=function(a,l,c){if(this.__e){var u=i;i=void 0,s(a,l,c),i=u}o&&o.call(this,a,l,c)},Z.shouldComponentUpdate=s}return r.__N||r.__}function V(t,e){var n=Ht(dt++,3);!te.__s&&Sr(n.__H,e)&&(n.__=t,n.u=e,Z.__H.__h.push(n))}function Pn(t,e){var n=Ht(dt++,4);!te.__s&&Sr(n.__H,e)&&(n.__=t,n.u=e,Z.__h.push(n))}function we(t){return Ut=5,Y(function(){return{current:t}},[])}function Y(t,e){var n=Ht(dt++,7);return Sr(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function B(t,e){return Ut=8,Y(function(){return t},e)}function ve(t){var e=Z.context[t.__c],n=Ht(dt++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(Z)),e.props.value):t.__}function dc(){for(var t;t=ki.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(sn),e.__h.some(tr),e.__h=[]}catch(n){e.__h=[],te.__e(n,t.__v)}}}te.__b=function(t){Z=null,us&&us(t)},te.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),gs&&gs(t,e)},te.__r=function(t){hs&&hs(t),dt=0;var e=(Z=t.__c).__H;e&&(Vn===Z?(e.__h=[],Z.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(sn),e.__h.some(tr),e.__h=[],dt=0)),Vn=Z},te.diffed=function(t){fs&&fs(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ki.push(e)!==1&&ds===te.requestAnimationFrame||((ds=te.requestAnimationFrame)||uc)(dc)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Vn=Z=null},te.__c=function(t,e){e.some(function(n){try{n.__h.some(sn),n.__h=n.__h.filter(function(r){return!r.__||tr(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],te.__e(r,n.__v)}}),ps&&ps(t,e)},te.unmount=function(t){ms&&ms(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(r){try{sn(r)}catch(s){e=s}}),n.__H=void 0,e&&te.__e(e,n.__v))};var ys=typeof requestAnimationFrame=="function";function uc(t){var e,n=function(){clearTimeout(r),ys&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);ys&&(e=requestAnimationFrame(n))}function sn(t){var e=Z,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Z=e}function tr(t){var e=Z;t.__c=t.__(),Z=e}function Sr(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Ri(t,e){return typeof e=="function"?e(t):e}function ln(){return ln=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ln.apply(this,arguments)}function Ci(t,e){if(t==null)return{};var n,r,s={},i=Object.keys(t);for(r=0;r<i.length;r++)e.indexOf(n=i[r])>=0||(s[n]=t[n]);return s}var hc=["context","children"],fc=["useFragment"];function pc(t,e,n,r){function s(){var i,o=Reflect.construct(HTMLElement,[],s);return o._vdomComponent=t,r&&r.shadow?(o._root=o.attachShadow({mode:r.mode||"open",serializable:(i=r.serializable)!=null&&i}),r.adoptedStyleSheets&&(o._root.adoptedStyleSheets=r.adoptedStyleSheets)):o._root=o,o}return(s.prototype=Object.create(HTMLElement.prototype)).constructor=s,s.prototype.connectedCallback=function(){gc.call(this,r)},s.prototype.attributeChangedCallback=yc,s.prototype.disconnectedCallback=_c,n=n||t.observedAttributes||Object.keys(t.propTypes||{}),s.observedAttributes=n,t.formAssociated&&(s.formAssociated=!0),n.forEach(function(i){Object.defineProperty(s.prototype,i,{get:function(){return this._vdom?this._vdom.props[i]:this._props[i]},set:function(o){this._vdom?this.attributeChangedCallback(i,null,o):(this._props||(this._props={}),this._props[i]=o);var a=typeof o;o!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(i,o)}})}),customElements.define(e||t.tagName||t.displayName||t.name,s),s}function mc(t){this.getChildContext=function(){return t.context};var e=t.children,n=Ci(t,hc);return Ir(e,n)}function gc(t){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=qe(mc,ln({},this._props,{context:e.detail.context}),Mi(this,this._vdomComponent,t)),(this.hasAttribute("hydrate")?Oi:En)(this._vdom,this._root)}function xi(t){return t.replace(/-(\w)/g,function(e,n){return n?n.toUpperCase():""})}function yc(t,e,n){if(this._vdom){var r={};r[t]=n=n??void 0,r[xi(t)]=n,this._vdom=Ir(this._vdom,r),En(this._vdom,this._root)}}function _c(){En(this._vdom=null,this._root)}function _s(t,e){var n=this,r=t.useFragment,s=Ci(t,fc);return qe(r?ae:"slot",ln({},s,{ref:function(i){i?(n.ref=i,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=e},i.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function Mi(t,e,n){if(t.nodeType===3)return t.data;if(t.nodeType!==1)return null;var r=[],s={},i=0,o=t.attributes,a=t.childNodes;for(i=o.length;i--;)o[i].name!=="slot"&&(s[o[i].name]=o[i].value,s[xi(o[i].name)]=o[i].value);for(i=a.length;i--;){var l=Mi(a[i],null,n),c=a[i].slot;c?s[c]=qe(_s,{name:c},l):r[i]=l}var u=!(!n||!n.shadow),d=e?qe(_s,{useFragment:!u},r):r;return!u&&e&&(t.innerHTML=""),qe(e||t.nodeName.toLowerCase(),s,d)}const P=t=>typeof t=="string",Rt=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},bs=t=>t==null?"":""+t,bc=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},vc=/###/g,vs=t=>t&&t.indexOf("###")>-1?t.replace(vc,"."):t,Is=t=>!t||P(t),Mt=(t,e,n)=>{const r=P(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(Is(t))return{};const i=vs(r[s]);!t[i]&&n&&(t[i]=new n),Object.prototype.hasOwnProperty.call(t,i)?t=t[i]:t={},++s}return Is(t)?{}:{obj:t,k:vs(r[s])}},Ss=(t,e,n)=>{const{obj:r,k:s}=Mt(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let i=e[e.length-1],o=e.slice(0,e.length-1),a=Mt(t,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=Mt(t,o,Object),a?.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Ic=(t,e,n,r)=>{const{obj:s,k:i}=Mt(t,e,Object);s[i]=s[i]||[],s[i].push(n)},dn=(t,e)=>{const{obj:n,k:r}=Mt(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Sc=(t,e,n)=>{const r=dn(t,n);return r!==void 0?r:dn(e,n)},Li=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?P(t[r])||t[r]instanceof String||P(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):Li(t[r],e[r],n):t[r]=e[r]);return t},st=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Tc={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const wc=t=>P(t)?t.replace(/[&<>"'\/]/g,e=>Tc[e]):t;class Ec{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const Ac=[" ",",","?","!",";"],Pc=new Ec(20),Nc=(t,e,n)=>{e=e||"",n=n||"";const r=Ac.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const s=Pc.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(t);if(!i){const o=t.indexOf(n);o>0&&!s.test(t.substring(0,o))&&(i=!0)}return i},nr=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let s=t;for(let i=0;i<r.length;){if(!s||typeof s!="object")return;let o,a="";for(let l=i;l<r.length;++l)if(l!==i&&(a+=n),a+=r[l],o=s[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&l<r.length-1)continue;i+=l-i+1;break}s=o}return s},Bt=t=>t?.replace(/_/g,"-"),Dc={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class un{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||Dc,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,s){return s&&!this.debug?null:(P(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new un(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new un(this.logger,e)}}var Fe=new un;class Nn{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,i])=>{for(let o=0;o<i;o++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,i])=>{for(let o=0;o<i;o++)s.apply(s,[e,...n])})}}class Ts extends Nn{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r,s={}){const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,n],r&&(Array.isArray(r)?a.push(...r):P(r)&&i?a.push(...r.split(i)):a.push(r)));const l=dn(this.data,a);return!l&&!n&&!r&&e.indexOf(".")>-1&&(e=a[0],n=a[1],r=a.slice(2).join(".")),l||!o||!P(r)?l:nr(this.data?.[e]?.[n],r,i)}addResource(e,n,r,s,i={silent:!1}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,n];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),s=n,n=a[1]),this.addNamespaces(n),Ss(this.data,a,s),i.silent||this.emit("added",e,n,r,s)}addResources(e,n,r,s={silent:!1}){for(const i in r)(P(r[i])||Array.isArray(r[i]))&&this.addResource(e,n,i,r[i],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,i,o={silent:!1,skipCopy:!1}){let a=[e,n];e.indexOf(".")>-1&&(a=e.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let l=dn(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?Li(l,r,i):l={...l,...r},Ss(this.data,a,l),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var Fi={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(i=>{e=this.processors[i]?.process(e,n,r,s)??e}),e}};const Ui=Symbol("i18next/PATH_KEY");function Oc(){const t=[],e=Object.create(null);let n;return e.get=(r,s)=>(n?.revoke?.(),s===Ui?t:(t.push(s),n=Proxy.revocable(r,e),n.proxy)),Proxy.revocable(Object.create(null),e).proxy}function bt(t,e){const{[Ui]:n}=t(Oc()),r=e?.keySeparator??".",s=e?.nsSeparator??":";if(n.length>1&&s){const i=e?.ns,o=Array.isArray(i)?i:null;if(o&&o.length>1&&o.slice(1).includes(n[0]))return`${n[0]}${s}${n.slice(1).join(r)}`}return n.join(r)}const ws={},jn=t=>!P(t)&&typeof t!="boolean"&&typeof t!="number";class hn extends Nn{constructor(e,n={}){super(),bc(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Fe.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};if(e==null)return!1;const s=this.resolve(e,r);if(s?.res===void 0)return!1;const i=jn(s.res);return!(r.returnObjects===!1&&i)}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Nc(e,r,s);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:P(i)?[i]:i};const c=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(s)}return{key:e,namespaces:P(i)?[i]:i}}translate(e,n,r){let s=typeof n=="object"?{...n}:n;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),e==null)return"";typeof e=="function"&&(e=bt(e,{...this.options,...s})),Array.isArray(e)||(e=[String(e)]),e=e.map(j=>typeof j=="function"?bt(j,{...this.options,...s}):String(j));const i=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],s),c=l[l.length-1];let u=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const d=s.lng||this.language,f=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()==="cimode")return f?i?{res:`${c}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${u}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:a;const h=this.resolve(e,s);let m=h?.res;const y=h?.usedKey||a,b=h?.exactUsedKey||a,g=["[object Number]","[object Function]","[object RegExp]"],_=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,I=!this.i18nFormat||this.i18nFormat.handleAsObject,w=s.count!==void 0&&!P(s.count),E=hn.hasDefaultValue(s),k=w?this.pluralResolver.getSuffix(d,s.count,s):"",A=s.ordinal&&w?this.pluralResolver.getSuffix(d,s.count,{ordinal:!1}):"",F=w&&!s.ordinal&&s.count===0,S=F&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${k}`]||s[`defaultValue${A}`]||s.defaultValue;let U=m;I&&!m&&E&&(U=S);const Q=jn(U),W=Object.prototype.toString.apply(U);if(I&&U&&Q&&g.indexOf(W)<0&&!(P(_)&&Array.isArray(U))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const j=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,U,{...s,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=j,h.usedParams=this.getUsedParamsDetails(s),h):j}if(o){const j=Array.isArray(U),K=j?[]:{},N=j?b:y;for(const M in U)if(Object.prototype.hasOwnProperty.call(U,M)){const ee=`${N}${o}${M}`;E&&!m?K[M]=this.translate(ee,{...s,defaultValue:jn(S)?S[M]:void 0,joinArrays:!1,ns:l}):K[M]=this.translate(ee,{...s,joinArrays:!1,ns:l}),K[M]===ee&&(K[M]=U[M])}m=K}}else if(I&&P(_)&&Array.isArray(m))m=m.join(_),m&&(m=this.extendTranslation(m,e,s,r));else{let j=!1,K=!1;!this.isValidLookup(m)&&E&&(j=!0,m=S),this.isValidLookup(m)||(K=!0,m=a);const M=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&K?void 0:m,ee=E&&S!==m&&this.options.updateMissing;if(K||j||ee){if(this.logger.log(ee?"updateKey":"missingKey",d,c,a,ee?S:m),o){const ne=this.resolve(a,{...s,keySeparator:!1});ne&&ne.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 q=[];const Ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Ee&&Ee[0])for(let ne=0;ne<Ee.length;ne++)q.push(Ee[ne]);else this.options.saveMissingTo==="all"?q=this.languageUtils.toResolveHierarchy(s.lng||this.language):q.push(s.lng||this.language);const pe=(ne,Ae,Ve)=>{const We=E&&Ve!==m?Ve:M;this.options.missingKeyHandler?this.options.missingKeyHandler(ne,c,Ae,We,ee,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ne,c,Ae,We,ee,s),this.emit("missingKey",ne,c,Ae,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?q.forEach(ne=>{const Ae=this.pluralResolver.getSuffixes(ne,s);F&&s[`defaultValue${this.options.pluralSeparator}zero`]&&Ae.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ae.push(`${this.options.pluralSeparator}zero`),Ae.forEach(Ve=>{pe([ne],a+Ve,s[`defaultValue${Ve}`]||S)})}):pe(q,a,S))}m=this.extendTranslation(m,e,s,h,r),K&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${c}${u}${a}`),(K||j)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${a}`:a,j?m:void 0,s))}return i?(h.res=m,h.usedParams=this.getUsedParamsDetails(s),h):m}extendTranslation(e,n,r,s,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const l=P(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(l){const d=e.match(this.interpolator.nestingRegexp);c=d&&d.length}let u=r.replace&&!P(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,r.lng||this.language||s.usedLng,r),l){const d=e.match(this.interpolator.nestingRegexp),f=d&&d.length;c<f&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...d)=>i?.[0]===d[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${n[0]}`),null):this.translate(...d,n),r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,a=P(o)?[o]:o;return e!=null&&a?.length&&r.applyPostProcessor!==!1&&(e=Fi.handle(a,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,s,i,o,a;return P(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?bt(l,{...this.options,...n}):l)),e.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;s=u;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&!P(n.count),h=f&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(P(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(b=>{this.isValidLookup(r)||(a=b,!ws[`${y[0]}-${b}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(ws[`${y[0]}-${b}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(g=>{if(this.isValidLookup(r))return;o=g;const _=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(_,u,g,b,n);else{let w;f&&(w=this.pluralResolver.getSuffix(g,n.count,n));const E=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(n.ordinal&&w.indexOf(k)===0&&_.push(u+w.replace(k,this.options.pluralSeparator)),_.push(u+w),h&&_.push(u+E)),m){const A=`${u}${this.options.contextSeparator||"_"}${n.context}`;_.push(A),f&&(n.ordinal&&w.indexOf(k)===0&&_.push(A+w.replace(k,this.options.pluralSeparator)),_.push(A+w),h&&_.push(A+E))}}let I;for(;I=_.pop();)this.isValidLookup(r)||(i=I,r=this.getResource(g,b,I,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!P(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class Es{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fe.create("languageUtils")}getScriptPartFromCode(e){if(e=Bt(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Bt(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(P(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return n=s;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),P(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return P(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):P(e)&&i(this.formatLanguageCode(e)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}const As={zero:0,one:1,two:2,few:3,many:4,other:5},Ps={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class kc{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=Fe.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=Bt(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Ps;if(!e.match(/-|_/))return Ps;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,n)}return this.pluralRulesCache[i]=o,o}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,i)=>As[s]-As[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,n,r={}){const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const Ns=(t,e,n,r=".",s=!0)=>{let i=Sc(t,e,n);return!i&&s&&P(n)&&(i=nr(t,n,r),i===void 0&&(i=nr(e,n,r))),i},qn=t=>t.replace(/\$/g,"$$$$");class Ds{constructor(e={}){this.logger=Fe.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:y,nestingOptionsSeparator:b,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=n!==void 0?n:wc,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?st(i):o||"{{",this.suffix=a?st(a):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=f?st(f):h||st("$t("),this.nestingSuffix=m?st(m):y||st(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0?_:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,r,s){let i,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=h=>{if(h.indexOf(this.formatSeparator)<0){const g=Ns(n,l,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(g,void 0,r,{...s,...n,interpolationkey:h}):g}const m=h.split(this.formatSeparator),y=m.shift().trim(),b=m.join(this.formatSeparator).trim();return this.format(Ns(n,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...s,...n,interpolationkey:y})};this.resetRegExp();const u=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>qn(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?qn(this.escape(h)):qn(h)}].forEach(h=>{for(a=0;i=h.regex.exec(e);){const m=i[1].trim();if(o=c(m),o===void 0)if(typeof u=="function"){const b=u(e,i,s);o=P(b)?b:""}else if(s&&Object.prototype.hasOwnProperty.call(s,m))o="";else if(d){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else!P(o)&&!this.useRawValueToEscape&&(o=bs(o));const y=h.safeValue(o);if(e=e.replace(i[0],y),d?(h.regex.lastIndex+=o.length,h.regex.lastIndex-=i[0].length):h.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,n,r={}){let s,i,o;const a=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const d=l.split(new RegExp(`${st(u)}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,o);const h=f.match(/'/g),m=f.match(/"/g);((h?.length??0)%2===0&&!m||(m?.length??0)%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),c&&(o={...c,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${u}${f}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];o={...r},o=o.replace&&!P(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const c=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(c!==-1&&(l=s[1].slice(c).split(this.formatSeparator).map(u=>u.trim()).filter(Boolean),s[1]=s[1].slice(0,c)),i=n(a.call(this,s[1].trim(),o),o),i&&s[0]===e&&!P(i))return i;P(i)||(i=bs(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),l.length&&(i=l.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const Rc=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=a.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:e,formatOptions:n}},Os=t=>{const e={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=r+JSON.stringify(i);let a=e[o];return a||(a=t(Bt(r),s),e[o]=a),a(n)}},Cc=t=>(e,n,r)=>t(Bt(n),r)(e);class xc{constructor(e={}){this.logger=Fe.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Os:Cc;this.formats={number:r((s,i)=>{const o=new Intl.NumberFormat(s,{...i});return a=>o.format(a)}),currency:r((s,i)=>{const o=new Intl.NumberFormat(s,{...i,style:"currency"});return a=>o.format(a)}),datetime:r((s,i)=>{const o=new Intl.DateTimeFormat(s,{...i});return a=>o.format(a)}),relativetime:r((s,i)=>{const o=new Intl.RelativeTimeFormat(s,{...i});return a=>o.format(a,i.range||"day")}),list:r((s,i)=>{const o=new Intl.ListFormat(s,{...i});return a=>o.format(a)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Os(n)}format(e,n,r,s={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(l=>l.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,l)=>{const{formatName:c,formatOptions:u}=Rc(l);if(this.formats[c]){let d=a;try{const f=s?.formatParams?.[s.interpolationkey]||{},h=f.locale||f.lng||s.locale||s.lng||r;d=this.formats[c](a,h,{...u,...s,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${c}`);return a},e)}}const Mc=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Lc extends Nn{constructor(e,n,r,s={}){super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Fe.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,s.backend,s)}queueLoad(e,n,r,s){const i={},o={},a={},l={};return e.forEach(c=>{let u=!0;n.forEach(d=>{const f=`${c}|${d}`;!r.reload&&this.store.hasResourceBundle(c,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,u=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),l[d]===void 0&&(l[d]=!0)))}),u||(a[c]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const s=e.split("|"),i=s[0],o=s[1];n&&this.emit("failedLoading",i,o,n),!n&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const a={};this.queue.forEach(l=>{Ic(l.loaded,[i],o),Mc(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{a[c]||(a[c]={});const u=l.loaded[c];u.length&&u.forEach(d=>{a[c][d]===void 0&&(a[c][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r,s=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&u&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,s+1,i*2,o)},i);return}o(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(e,n);c&&typeof c.then=="function"?c.then(u=>a(null,u)).catch(a):a(null,c)}catch(c){a(c)}return}return l(e,n,a)}prepareLoading(e,n,r={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();P(e)&&(e=this.languageUtils.toResolveHierarchy(e)),P(n)&&(n=[n]);const i=this.queueLoad(e,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,a),this.loaded(e,o,a)})}saveMissing(e,n,r,s,i,o={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const l={...o,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(e,n,r,s,l):u=c(e,n,r,s),u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}else c(e,n,r,s,a,l)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const Hn=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),P(t[1])&&(e.defaultValue=t[1]),P(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ks=t=>(P(t.ns)&&(t.ns=[t.ns]),P(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),P(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),Qt=()=>{},Fc=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})},Bi="__i18next_supportNoticeShown",Uc=()=>!!(typeof globalThis<"u"&&globalThis[Bi]||typeof process<"u"&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||typeof process<"u"&&process.env&&process.env.NODE_ENV==="production"),Bc=()=>{typeof globalThis<"u"&&(globalThis[Bi]=!0)},$c=t=>!!(t?.modules?.backend?.name?.indexOf("Locize")>0||t?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||t?.options?.backend?.backends&&t.options.backend.backends.some(e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0)||t?.options?.backend?.projectId||t?.options?.backend?.backendOptions&&t.options.backend.backendOptions.some(e=>e?.projectId));class Lt ex