diff --git a/assets/index-e3780f9c.js b/assets/index-811326dc.js similarity index 54% rename from assets/index-e3780f9c.js rename to assets/index-811326dc.js index 47524a3..2dabde9 100644 --- a/assets/index-e3780f9c.js +++ b/assets/index-811326dc.js @@ -1,4 +1,4 @@ -function TM(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var fo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function M6(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var D6={exports:{}},g0={},L6={exports:{}},Ue={};/** +function GM(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var ho=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function q6(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Y6={exports:{}},O0={},Z6={exports:{}},He={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function TM(e,t){for(var n=0;n0?kn(Mu,--Or):0,uu--,rn===10&&(uu=1,w0--),rn}function Br(){return rn=Or2||sf(rn)>3?"":" "}function cD(e,t){for(;--t&&Br()&&!(rn<48||rn>102||rn>57&&rn<65||rn>70&&rn<97););return Qf(e,Mh()+(t<6&&ii()==32&&Br()==32))}function cv(e){for(;Br();)switch(rn){case e:return Or;case 34:case 39:e!==34&&e!==39&&cv(rn);break;case 40:e===41&&cv(e);break;case 92:Br();break}return Or}function fD(e,t){for(;Br()&&e+rn!==47+10;)if(e+rn===42+42&&ii()===47)break;return"/*"+Qf(t,Or-1)+"*"+v0(e===47?e:Br())}function dD(e){for(;!sf(ii());)Br();return Qf(e,Or)}function hD(e){return q6(Lh("",null,null,null,[""],e=X6(e),0,[0],e))}function Lh(e,t,n,r,o,i,a,s,l){for(var u=0,c=0,f=a,d=0,h=0,p=0,m=1,_=1,b=1,g=0,E="",T=o,O=i,A=r,C=E;_;)switch(p=g,g=Br()){case 40:if(p!=108&&kn(C,f-1)==58){uv(C+=nt(Dh(g),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:C+=Dh(g);break;case 9:case 10:case 13:case 32:C+=uD(p);break;case 92:C+=cD(Mh()-1,7);continue;case 47:switch(ii()){case 42:case 47:Fd(pD(fD(Br(),Mh()),t,n),l);break;default:C+="/"}break;case 123*m:s[u++]=Yo(C)*b;case 125*m:case 59:case 0:switch(g){case 0:case 125:_=0;case 59+c:b==-1&&(C=nt(C,/\f/g,"")),h>0&&Yo(C)-f&&Fd(h>32?aE(C+";",r,n,f-1):aE(nt(C," ","")+";",r,n,f-2),l);break;case 59:C+=";";default:if(Fd(A=iE(C,t,n,u,c,o,s,E,T=[],O=[],f),i),g===123)if(c===0)Lh(C,t,A,A,T,i,f,s,O);else switch(d===99&&kn(C,3)===110?100:d){case 100:case 108:case 109:case 115:Lh(e,A,A,r&&Fd(iE(e,A,A,0,0,o,s,E,o,T=[],f),O),o,O,f,s,r?T:O);break;default:Lh(C,A,A,A,[""],O,0,s,O)}}u=c=h=0,m=b=1,E=C="",f=a;break;case 58:f=1+Yo(C),h=p;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&lD()==125)continue}switch(C+=v0(g),g*m){case 38:b=c>0?1:(C+="\f",-1);break;case 44:s[u++]=(Yo(C)-1)*b,b=1;break;case 64:ii()===45&&(C+=Dh(Br())),d=ii(),c=f=Yo(E=C+=dD(Mh())),g++;break;case 45:p===45&&Yo(C)==2&&(m=0)}}return i}function iE(e,t,n,r,o,i,a,s,l,u,c){for(var f=o-1,d=o===0?i:[""],h=Ww(d),p=0,m=0,_=0;p0?d[b]+" "+g:nt(g,/&\f/g,d[b])))&&(l[_++]=E);return b0(e,t,n,o===0?Vw:s,l,u,c)}function pD(e,t,n){return b0(e,t,n,H6,v0(sD()),af(e,2,-2),0)}function aE(e,t,n,r){return b0(e,t,n,Hw,af(e,0,r),af(e,r+1,-1),r)}function Hl(e,t){for(var n="",r=Ww(e),o=0;o6)switch(kn(e,t+1)){case 109:if(kn(e,t+4)!==45)break;case 102:return nt(e,/(.+:)(.+)-([^]+)/,"$1"+tt+"$2-$3$1"+yp+(kn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~uv(e,"stretch")?Z6(nt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(kn(e,t+1)!==115)break;case 6444:switch(kn(e,Yo(e)-3-(~uv(e,"!important")&&10))){case 107:return nt(e,":",":"+tt)+e;case 101:return nt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+tt+(kn(e,14)===45?"inline-":"")+"box$3$1"+tt+"$2$3$1"+zn+"$2box$3")+e}break;case 5936:switch(kn(e,t+11)){case 114:return tt+e+zn+nt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return tt+e+zn+nt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return tt+e+zn+nt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return tt+e+zn+e+e}return e}var ED=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case Hw:t.return=Z6(t.value,t.length);break;case W6:return Hl([qu(t,{value:nt(t.value,"@","@"+tt)})],o);case Vw:if(t.length)return aD(t.props,function(i){switch(iD(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Hl([qu(t,{props:[nt(i,/:(read-\w+)/,":"+yp+"$1")]})],o);case"::placeholder":return Hl([qu(t,{props:[nt(i,/:(plac\w+)/,":"+tt+"input-$1")]}),qu(t,{props:[nt(i,/:(plac\w+)/,":"+yp+"$1")]}),qu(t,{props:[nt(i,/:(plac\w+)/,zn+"input-$1")]})],o)}return""})}},CD=[ED],xD=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var _=m.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||CD,i={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var _=m.getAttribute("data-emotion").split(" "),b=1;b<_.length;b++)i[_[b]]=!0;s.push(m)});var l,u=[SD,_D];{var c,f=[mD,gD(function(m){c.insert(m)})],d=yD(u.concat(o,f)),h=function(_){return Hl(hD(_),d)};l=function(_,b,g,E){c=g,h(_?_+"{"+b.styles+"}":b.styles),E&&(p.inserted[b.name]=!0)}}var p={key:n,sheet:new JM({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:l};return p.sheet.hydrate(s),p};function ks(){return ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?kn(Lu,--kr):0,fu--,rn===10&&(fu=1,P0--),rn}function Hr(){return rn=kr2||lf(rn)>3?"":" "}function AD(e,t){for(;--t&&Hr()&&!(rn<48||rn>102||rn>57&&rn<65||rn>70&&rn<97););return Jf(e,Lh()+(t<6&&ai()==32&&Hr()==32))}function Sv(e){for(;Hr();)switch(rn){case e:return kr;case 34:case 39:e!==34&&e!==39&&Sv(rn);break;case 40:e===41&&Sv(e);break;case 92:Hr();break}return kr}function PD(e,t){for(;Hr()&&e+rn!==47+10;)if(e+rn===42+42&&ai()===47)break;return"/*"+Jf(t,kr-1)+"*"+A0(e===47?e:Hr())}function TD(e){for(;!lf(ai());)Hr();return Jf(e,kr)}function ID(e){return fO(Bh("",null,null,null,[""],e=cO(e),0,[0],e))}function Bh(e,t,n,r,o,i,a,s,l){for(var u=0,c=0,f=a,d=0,h=0,p=0,m=1,S=1,b=1,g=0,E="",T=o,O=i,A=r,C=E;S;)switch(p=g,g=Hr()){case 40:if(p!=108&&kn(C,f-1)==58){bv(C+=nt(Nh(g),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:C+=Nh(g);break;case 9:case 10:case 13:case 32:C+=OD(p);break;case 92:C+=AD(Lh()-1,7);continue;case 47:switch(ai()){case 42:case 47:zd(RD(PD(Hr(),Lh()),t,n),l);break;default:C+="/"}break;case 123*m:s[u++]=Qo(C)*b;case 125*m:case 59:case 0:switch(g){case 0:case 125:S=0;case 59+c:b==-1&&(C=nt(C,/\f/g,"")),h>0&&Qo(C)-f&&zd(h>32?mE(C+";",r,n,f-1):mE(nt(C," ","")+";",r,n,f-2),l);break;case 59:C+=";";default:if(zd(A=pE(C,t,n,u,c,o,s,E,T=[],O=[],f),i),g===123)if(c===0)Bh(C,t,A,A,T,i,f,s,O);else switch(d===99&&kn(C,3)===110?100:d){case 100:case 108:case 109:case 115:Bh(e,A,A,r&&zd(pE(e,A,A,0,0,o,s,E,o,T=[],f),O),o,O,f,s,r?T:O);break;default:Bh(C,A,A,A,[""],O,0,s,O)}}u=c=h=0,m=b=1,E=C="",f=a;break;case 58:f=1+Qo(C),h=p;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&xD()==125)continue}switch(C+=A0(g),g*m){case 38:b=c>0?1:(C+="\f",-1);break;case 44:s[u++]=(Qo(C)-1)*b,b=1;break;case 64:ai()===45&&(C+=Nh(Hr())),d=ai(),c=f=Qo(E=C+=TD(Lh())),g++;break;case 45:p===45&&Qo(C)==2&&(m=0)}}return i}function pE(e,t,n,r,o,i,a,s,l,u,c){for(var f=o-1,d=o===0?i:[""],h=rb(d),p=0,m=0,S=0;p0?d[b]+" "+g:nt(g,/&\f/g,d[b])))&&(l[S++]=E);return T0(e,t,n,o===0?tb:s,l,u,c)}function RD(e,t,n){return T0(e,t,n,aO,A0(CD()),sf(e,2,-2),0)}function mE(e,t,n,r){return T0(e,t,n,nb,sf(e,0,r),sf(e,r+1,-1),r)}function Gl(e,t){for(var n="",r=rb(e),o=0;o6)switch(kn(e,t+1)){case 109:if(kn(e,t+4)!==45)break;case 102:return nt(e,/(.+:)(.+)-([^]+)/,"$1"+tt+"$2-$3$1"+vp+(kn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~bv(e,"stretch")?hO(nt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(kn(e,t+1)!==115)break;case 6444:switch(kn(e,Qo(e)-3-(~bv(e,"!important")&&10))){case 107:return nt(e,":",":"+tt)+e;case 101:return nt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+tt+(kn(e,14)===45?"inline-":"")+"box$3$1"+tt+"$2$3$1"+Vn+"$2box$3")+e}break;case 5936:switch(kn(e,t+11)){case 114:return tt+e+Vn+nt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return tt+e+Vn+nt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return tt+e+Vn+nt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return tt+e+Vn+e+e}return e}var $D=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case nb:t.return=hO(t.value,t.length);break;case sO:return Gl([Yu(t,{value:nt(t.value,"@","@"+tt)})],o);case tb:if(t.length)return ED(t.props,function(i){switch(_D(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Gl([Yu(t,{props:[nt(i,/:(read-\w+)/,":"+vp+"$1")]})],o);case"::placeholder":return Gl([Yu(t,{props:[nt(i,/:(plac\w+)/,":"+tt+"input-$1")]}),Yu(t,{props:[nt(i,/:(plac\w+)/,":"+vp+"$1")]}),Yu(t,{props:[nt(i,/:(plac\w+)/,Vn+"input-$1")]})],o)}return""})}},zD=[$D],VD=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var S=m.getAttribute("data-emotion");S.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||zD,i={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var S=m.getAttribute("data-emotion").split(" "),b=1;b=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var BD={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},jD=/[A-Z]|^ms/g,FD=/_EMO_([^_]+?)_([^]*?)_EMO_/g,oO=function(t){return t.charCodeAt(1)===45},uE=function(t){return t!=null&&typeof t!="boolean"},Zm=Y6(function(e){return oO(e)?e:e.replace(jD,"-$&").toLowerCase()}),cE=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(FD,function(r,o,i){return Zo={name:o,styles:i,next:Zo},o})}return BD[t]!==1&&!oO(t)&&typeof n=="number"&&n!==0?n+"px":n};function lf(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Zo={name:n.name,styles:n.styles,next:Zo},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Zo={name:r.name,styles:r.styles,next:Zo},r=r.next;var o=n.styles+";";return o}return $D(e,t,n)}case"function":{if(e!==void 0){var i=Zo,a=n(e);return Zo=i,lf(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function $D(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var eL={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},tL=/[A-Z]|^ms/g,nL=/_EMO_([^_]+?)_([^]*?)_EMO_/g,bO=function(t){return t.charCodeAt(1)===45},vE=function(t){return t!=null&&typeof t!="boolean"},ly=dO(function(e){return bO(e)?e:e.replace(tL,"-$&").toLowerCase()}),wE=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(nL,function(r,o,i){return Jo={name:o,styles:i,next:Jo},o})}return eL[t]!==1&&!bO(t)&&typeof n=="number"&&n!==0?n+"px":n};function uf(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Jo={name:n.name,styles:n.styles,next:Jo},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Jo={name:r.name,styles:r.styles,next:Jo},r=r.next;var o=n.styles+";";return o}return rL(e,t,n)}case"function":{if(e!==void 0){var i=Jo,a=n(e);return Jo=i,uf(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function rL(e,t,n){var r="";if(Array.isArray(n))for(var o=0;ow.jsx(R0,{styles:uO}),XD=({scope:e=""})=>w.jsx(R0,{styles:lO` +`,cL=()=>w.jsx($0,{styles:xO}),fL=({scope:e=""})=>w.jsx($0,{styles:CO` html { line-height: 1.5; -webkit-text-size-adjust: 100%; @@ -299,8 +299,8 @@ function TM(e,t){for(var n=0;n>>1,U=L[B];if(0>>1;Bo(Q,F))Xo(J,Q)?(L[B]=J,L[X]=F,B=X):(L[B]=Q,L[W]=F,B=W);else if(Xo(J,F))L[B]=J,L[X]=F,B=X;else break e}}return j}function o(L,j){var F=L.sortIndex-j.sortIndex;return F!==0?F:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,d=3,h=!1,p=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(L){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=L)r(u),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(u)}}function T(L){if(m=!1,E(L),!p)if(n(l)!==null)p=!0,N(O);else{var j=n(u);j!==null&&D(T,j.startTime-L)}}function O(L,j){p=!1,m&&(m=!1,b(y),y=-1),h=!0;var F=d;try{for(E(j),f=n(l);f!==null&&(!(f.expirationTime>j)||L&&!x());){var B=f.callback;if(typeof B=="function"){f.callback=null,d=f.priorityLevel;var U=B(f.expirationTime<=j);j=e.unstable_now(),typeof U=="function"?f.callback=U:f===n(l)&&r(l),E(j)}else r(l);f=n(l)}if(f!==null)var K=!0;else{var W=n(u);W!==null&&D(T,W.startTime-j),K=!1}return K}finally{f=null,d=F,h=!1}}var A=!1,C=null,y=-1,S=5,v=-1;function x(){return!(e.unstable_now()-vL||125B?(L.sortIndex=F,t(u,L),n(l)===null&&L===n(u)&&(m?(b(y),y=-1):m=!0,D(T,F-B))):(L.sortIndex=U,t(l,L),p||h||(p=!0,N(O))),L},e.unstable_shouldYield=x,e.unstable_wrapCallback=function(L){var j=d;return function(){var F=d;d=j;try{return L.apply(this,arguments)}finally{d=F}}}})(hO);dO.exports=hO;var QD=dO.exports;/** + */(function(e){function t(L,j){var F=L.length;L.push(j);e:for(;0>>1,V=L[B];if(0>>1;Bo(Q,F))Xo(J,Q)?(L[B]=J,L[X]=F,B=X):(L[B]=Q,L[W]=F,B=W);else if(Xo(J,F))L[B]=J,L[X]=F,B=X;else break e}}return j}function o(L,j){var F=L.sortIndex-j.sortIndex;return F!==0?F:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,d=3,h=!1,p=!1,m=!1,S=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(L){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=L)r(u),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(u)}}function T(L){if(m=!1,E(L),!p)if(n(l)!==null)p=!0,N(O);else{var j=n(u);j!==null&&D(T,j.startTime-L)}}function O(L,j){p=!1,m&&(m=!1,b(y),y=-1),h=!0;var F=d;try{for(E(j),f=n(l);f!==null&&(!(f.expirationTime>j)||L&&!x());){var B=f.callback;if(typeof B=="function"){f.callback=null,d=f.priorityLevel;var V=B(f.expirationTime<=j);j=e.unstable_now(),typeof V=="function"?f.callback=V:f===n(l)&&r(l),E(j)}else r(l);f=n(l)}if(f!==null)var K=!0;else{var W=n(u);W!==null&&D(T,W.startTime-j),K=!1}return K}finally{f=null,d=F,h=!1}}var A=!1,C=null,y=-1,_=5,v=-1;function x(){return!(e.unstable_now()-v<_)}function I(){if(C!==null){var L=e.unstable_now();v=L;var j=!0;try{j=C(!0,L)}finally{j?R():(A=!1,C=null)}}else A=!1}var R;if(typeof g=="function")R=function(){g(I)};else if(typeof MessageChannel<"u"){var k=new MessageChannel,M=k.port2;k.port1.onmessage=I,R=function(){M.postMessage(null)}}else R=function(){S(I,0)};function N(L){C=L,A||(A=!0,R())}function D(L,j){y=S(function(){L(e.unstable_now())},j)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,N(O))},e.unstable_forceFrameRate=function(L){0>L||125B?(L.sortIndex=F,t(u,L),n(l)===null&&L===n(u)&&(m?(b(y),y=-1):m=!0,D(T,F-B))):(L.sortIndex=V,t(l,L),p||h||(p=!0,N(O))),L},e.unstable_shouldYield=x,e.unstable_wrapCallback=function(L){var j=d;return function(){var F=d;d=j;try{return L.apply(this,arguments)}finally{d=F}}}})(TO);PO.exports=TO;var mL=PO.exports;/** * @license React * react-dom.production.min.js * @@ -316,16 +316,16 @@ function TM(e,t){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fv=Object.prototype.hasOwnProperty,JD=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hE={},pE={};function eL(e){return fv.call(pE,e)?!0:fv.call(hE,e)?!1:JD.test(e)?pE[e]=!0:(hE[e]=!0,!1)}function tL(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nL(e,t,n,r){if(t===null||typeof t>"u"||tL(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ur(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var jn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jn[e]=new ur(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];jn[t]=new ur(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jn[e]=new ur(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jn[e]=new ur(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){jn[e]=new ur(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jn[e]=new ur(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jn[e]=new ur(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jn[e]=new ur(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jn[e]=new ur(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yw=/[\-:]([a-z])/g;function Zw(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Yw,Zw);jn[t]=new ur(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Yw,Zw);jn[t]=new ur(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Yw,Zw);jn[t]=new ur(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jn[e]=new ur(e,1,!1,e.toLowerCase(),null,!1,!1)});jn.xlinkHref=new ur("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jn[e]=new ur(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qw(e,t,n,r){var o=jn.hasOwnProperty(t)?jn[t]:null;(o!==null?o.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_v=Object.prototype.hasOwnProperty,yL=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,_E={},EE={};function gL(e){return _v.call(EE,e)?!0:_v.call(_E,e)?!1:yL.test(e)?EE[e]=!0:(_E[e]=!0,!1)}function vL(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function wL(e,t,n,r){if(t===null||typeof t>"u"||vL(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ur(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Fn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fn[e]=new ur(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fn[t]=new ur(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fn[e]=new ur(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fn[e]=new ur(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Fn[e]=new ur(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fn[e]=new ur(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fn[e]=new ur(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fn[e]=new ur(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fn[e]=new ur(e,5,!1,e.toLowerCase(),null,!1,!1)});var lb=/[\-:]([a-z])/g;function ub(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(lb,ub);Fn[t]=new ur(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(lb,ub);Fn[t]=new ur(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(lb,ub);Fn[t]=new ur(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fn[e]=new ur(e,1,!1,e.toLowerCase(),null,!1,!1)});Fn.xlinkHref=new ur("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fn[e]=new ur(e,1,!1,e.toLowerCase(),null,!0,!0)});function cb(e,t,n,r){var o=Fn.hasOwnProperty(t)?Fn[t]:null;(o!==null?o.type!==0:r||!(2s||o[a]!==i[s]){var l=` -`+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Jm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?mc(e):""}function rL(e){switch(e.tag){case 5:return mc(e.type);case 16:return mc("Lazy");case 13:return mc("Suspense");case 19:return mc("SuspenseList");case 0:case 2:case 15:return e=ey(e.type,!1),e;case 11:return e=ey(e.type.render,!1),e;case 1:return e=ey(e.type,!0),e;default:return""}}function mv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case vl:return"Fragment";case gl:return"Portal";case dv:return"Profiler";case Jw:return"StrictMode";case hv:return"Suspense";case pv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gO:return(e.displayName||"Context")+".Consumer";case yO:return(e._context.displayName||"Context")+".Provider";case eb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case tb:return t=e.displayName||null,t!==null?t:mv(e.type)||"Memo";case ra:t=e._payload,e=e._init;try{return mv(e(t))}catch{}}return null}function oL(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mv(t);case 8:return t===Jw?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Pa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wO(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iL(e){var t=wO(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zd(e){e._valueTracker||(e._valueTracker=iL(e))}function bO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=wO(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function gp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yv(e,t){var n=t.checked;return $t({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function yE(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Pa(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function SO(e,t){t=t.checked,t!=null&&Qw(e,"checked",t,!1)}function gv(e,t){SO(e,t);var n=Pa(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vv(e,t.type,n):t.hasOwnProperty("defaultValue")&&vv(e,t.type,Pa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gE(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function vv(e,t,n){(t!=="number"||gp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var yc=Array.isArray;function Wl(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ud.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ff(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},aL=["Webkit","ms","Moz","O"];Object.keys(Rc).forEach(function(e){aL.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Rc[t]=Rc[e]})});function xO(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Rc.hasOwnProperty(e)&&Rc[e]?(""+t).trim():t+"px"}function OO(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=xO(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var sL=$t({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Sv(e,t){if(t){if(sL[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function _v(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ev=null;function nb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cv=null,Gl=null,Kl=null;function bE(e){if(e=td(e)){if(typeof Cv!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=N0(t),Cv(e.stateNode,e.type,t))}}function AO(e){Gl?Kl?Kl.push(e):Kl=[e]:Gl=e}function PO(){if(Gl){var e=Gl,t=Kl;if(Kl=Gl=null,bE(e),t)for(e=0;e>>=0,e===0?32:31-(vL(e)/wL|0)|0}var Vd=64,Hd=4194304;function gc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sp(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~o;s!==0?r=gc(s):(i&=a,i!==0&&(r=gc(i)))}else a=n&~o,a!==0?r=gc(a):i!==0&&(r=gc(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Jf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-No(t),e[t]=n}function EL(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Mc),TE=String.fromCharCode(32),IE=!1;function XO(e,t){switch(e){case"keyup":return ZL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qO(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wl=!1;function JL(e,t){switch(e){case"compositionend":return qO(t);case"keypress":return t.which!==32?null:(IE=!0,TE);case"textInput":return e=t.data,e===TE&&IE?null:e;default:return null}}function eN(e,t){if(wl)return e==="compositionend"||!cb&&XO(e,t)?(e=GO(),Bh=sb=ca=null,wl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=DE(n)}}function JO(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?JO(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eA(){for(var e=window,t=gp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gp(e.document)}return t}function fb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function uN(e){var t=eA(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&JO(n.ownerDocument.documentElement,n)){if(r!==null&&fb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=LE(n,i);var a=LE(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,bl=null,Iv=null,Lc=null,Rv=!1;function NE(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rv||bl==null||bl!==gp(r)||(r=bl,"selectionStart"in r&&fb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Lc&&gf(Lc,r)||(Lc=r,r=Cp(Iv,"onSelect"),0El||(e.current=Bv[El],Bv[El]=null,El--)}function vt(e,t){El++,Bv[El]=e.current,e.current=t}var Ta={},Gn=La(Ta),wr=La(!1),Ms=Ta;function fu(e,t){var n=e.type.contextTypes;if(!n)return Ta;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function br(e){return e=e.childContextTypes,e!=null}function Op(){_t(wr),_t(Gn)}function VE(e,t,n){if(Gn.current!==Ta)throw Error(oe(168));vt(Gn,t),vt(wr,n)}function uA(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(oe(108,oL(e)||"Unknown",o));return $t({},n,r)}function Ap(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ta,Ms=Gn.current,vt(Gn,e),vt(wr,wr.current),!0}function HE(e,t,n){var r=e.stateNode;if(!r)throw Error(oe(169));n?(e=uA(e,t,Ms),r.__reactInternalMemoizedMergedChildContext=e,_t(wr),_t(Gn),vt(Gn,e)):_t(wr),vt(wr,n)}var wi=null,B0=!1,py=!1;function cA(e){wi===null?wi=[e]:wi.push(e)}function SN(e){B0=!0,cA(e)}function Na(){if(!py&&wi!==null){py=!0;var e=0,t=st;try{var n=wi;for(st=1;e>=a,o-=a,Ci=1<<32-No(t)+o|n<y?(S=C,C=null):S=C.sibling;var v=d(b,C,E[y],T);if(v===null){C===null&&(C=S);break}e&&C&&v.alternate===null&&t(b,C),g=i(v,g,y),A===null?O=v:A.sibling=v,A=v,C=S}if(y===E.length)return n(b,C),At&&Ja(b,y),O;if(C===null){for(;yy?(S=C,C=null):S=C.sibling;var x=d(b,C,v.value,T);if(x===null){C===null&&(C=S);break}e&&C&&x.alternate===null&&t(b,C),g=i(x,g,y),A===null?O=x:A.sibling=x,A=x,C=S}if(v.done)return n(b,C),At&&Ja(b,y),O;if(C===null){for(;!v.done;y++,v=E.next())v=f(b,v.value,T),v!==null&&(g=i(v,g,y),A===null?O=v:A.sibling=v,A=v);return At&&Ja(b,y),O}for(C=r(b,C);!v.done;y++,v=E.next())v=h(C,b,y,v.value,T),v!==null&&(e&&v.alternate!==null&&C.delete(v.key===null?y:v.key),g=i(v,g,y),A===null?O=v:A.sibling=v,A=v);return e&&C.forEach(function(I){return t(b,I)}),At&&Ja(b,y),O}function _(b,g,E,T){if(typeof E=="object"&&E!==null&&E.type===vl&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case $d:e:{for(var O=E.key,A=g;A!==null;){if(A.key===O){if(O=E.type,O===vl){if(A.tag===7){n(b,A.sibling),g=o(A,E.props.children),g.return=b,b=g;break e}}else if(A.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===ra&&ZE(O)===A.type){n(b,A.sibling),g=o(A,E.props),g.ref=tc(b,A,E),g.return=b,b=g;break e}n(b,A);break}else t(b,A);A=A.sibling}E.type===vl?(g=Ss(E.props.children,b.mode,T,E.key),g.return=b,b=g):(T=Wh(E.type,E.key,E.props,null,b.mode,T),T.ref=tc(b,g,E),T.return=b,b=T)}return a(b);case gl:e:{for(A=E.key;g!==null;){if(g.key===A)if(g.tag===4&&g.stateNode.containerInfo===E.containerInfo&&g.stateNode.implementation===E.implementation){n(b,g.sibling),g=o(g,E.children||[]),g.return=b,b=g;break e}else{n(b,g);break}else t(b,g);g=g.sibling}g=_y(E,b.mode,T),g.return=b,b=g}return a(b);case ra:return A=E._init,_(b,g,A(E._payload),T)}if(yc(E))return p(b,g,E,T);if(Yu(E))return m(b,g,E,T);Zd(b,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,g!==null&&g.tag===6?(n(b,g.sibling),g=o(g,E),g.return=b,b=g):(n(b,g),g=Sy(E,b.mode,T),g.return=b,b=g),a(b)):n(b,g)}return _}var hu=vA(!0),wA=vA(!1),nd={},li=La(nd),Sf=La(nd),_f=La(nd);function hs(e){if(e===nd)throw Error(oe(174));return e}function bb(e,t){switch(vt(_f,t),vt(Sf,e),vt(li,nd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:bv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=bv(t,e)}_t(li),vt(li,t)}function pu(){_t(li),_t(Sf),_t(_f)}function bA(e){hs(_f.current);var t=hs(li.current),n=bv(t,e.type);t!==n&&(vt(Sf,e),vt(li,n))}function Sb(e){Sf.current===e&&(_t(li),_t(Sf))}var Lt=La(0);function Mp(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var my=[];function _b(){for(var e=0;en?n:4,e(!0);var r=yy.transition;yy.transition={};try{e(!1),t()}finally{st=n,yy.transition=r}}function NA(){return bo().memoizedState}function xN(e,t,n){var r=Sa(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},BA(e))jA(t,n);else if(n=pA(e,t,n,r),n!==null){var o=or();Bo(n,e,r,o),FA(n,t,r)}}function ON(e,t,n){var r=Sa(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(BA(e))jA(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,$o(s,a)){var l=t.interleaved;l===null?(o.next=o,vb(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=pA(e,t,o,r),n!==null&&(o=or(),Bo(n,e,r,o),FA(n,t,r))}}function BA(e){var t=e.alternate;return e===Ft||t!==null&&t===Ft}function jA(e,t){Nc=Dp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function FA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ob(e,n)}}var Lp={readContext:wo,useCallback:Fn,useContext:Fn,useEffect:Fn,useImperativeHandle:Fn,useInsertionEffect:Fn,useLayoutEffect:Fn,useMemo:Fn,useReducer:Fn,useRef:Fn,useState:Fn,useDebugValue:Fn,useDeferredValue:Fn,useTransition:Fn,useMutableSource:Fn,useSyncExternalStore:Fn,useId:Fn,unstable_isNewReconciler:!1},AN={readContext:wo,useCallback:function(e,t){return Ko().memoizedState=[e,t===void 0?null:t],e},useContext:wo,useEffect:JE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zh(4194308,4,RA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zh(4194308,4,e,t)},useInsertionEffect:function(e,t){return zh(4,2,e,t)},useMemo:function(e,t){var n=Ko();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ko();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xN.bind(null,Ft,e),[r.memoizedState,e]},useRef:function(e){var t=Ko();return e={current:e},t.memoizedState=e},useState:QE,useDebugValue:Ab,useDeferredValue:function(e){return Ko().memoizedState=e},useTransition:function(){var e=QE(!1),t=e[0];return e=CN.bind(null,e[1]),Ko().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ft,o=Ko();if(At){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),_n===null)throw Error(oe(349));Ls&30||EA(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,JE(xA.bind(null,r,i,e),[e]),r.flags|=2048,xf(9,CA.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ko(),t=_n.identifierPrefix;if(At){var n=xi,r=Ci;n=(r&~(1<<32-No(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ef++,0")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{cy=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yc(e):""}function bL(e){switch(e.tag){case 5:return yc(e.type);case 16:return yc("Lazy");case 13:return yc("Suspense");case 19:return yc("SuspenseList");case 0:case 2:case 15:return e=fy(e.type,!1),e;case 11:return e=fy(e.type.render,!1),e;case 1:return e=fy(e.type,!0),e;default:return""}}function Ov(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case bl:return"Fragment";case wl:return"Portal";case Ev:return"Profiler";case fb:return"StrictMode";case Cv:return"Suspense";case xv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case MO:return(e.displayName||"Context")+".Consumer";case kO:return(e._context.displayName||"Context")+".Provider";case db:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case hb:return t=e.displayName||null,t!==null?t:Ov(e.type)||"Memo";case oa:t=e._payload,e=e._init;try{return Ov(e(t))}catch{}}return null}function SL(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ov(t);case 8:return t===fb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ia(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function LO(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _L(e){var t=LO(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ud(e){e._valueTracker||(e._valueTracker=_L(e))}function NO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=LO(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Av(e,t){var n=t.checked;return zt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xE(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ia(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function BO(e,t){t=t.checked,t!=null&&cb(e,"checked",t,!1)}function Pv(e,t){BO(e,t);var n=Ia(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Tv(e,t.type,n):t.hasOwnProperty("defaultValue")&&Tv(e,t.type,Ia(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function OE(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Tv(e,t,n){(t!=="number"||wp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var gc=Array.isArray;function Kl(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Hd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function df(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var kc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},EL=["Webkit","ms","Moz","O"];Object.keys(kc).forEach(function(e){EL.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),kc[t]=kc[e]})});function zO(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||kc.hasOwnProperty(e)&&kc[e]?(""+t).trim():t+"px"}function VO(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=zO(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var CL=zt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function kv(e,t){if(t){if(CL[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function Mv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Dv=null;function pb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Lv=null,Xl=null,ql=null;function TE(e){if(e=nd(e)){if(typeof Lv!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=W0(t),Lv(e.stateNode,e.type,t))}}function UO(e){Xl?ql?ql.push(e):ql=[e]:Xl=e}function HO(){if(Xl){var e=Xl,t=ql;if(ql=Xl=null,TE(e),t)for(e=0;e>>=0,e===0?32:31-(LL(e)/NL|0)|0}var Wd=64,Gd=4194304;function vc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ep(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~o;s!==0?r=vc(s):(i&=a,i!==0&&(r=vc(i)))}else a=n&~o,a!==0?r=vc(a):i!==0&&(r=vc(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ed(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Bo(t),e[t]=n}function $L(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Dc),jE=String.fromCharCode(32),FE=!1;function cA(e,t){switch(e){case"keyup":return pN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sl=!1;function yN(e,t){switch(e){case"compositionend":return fA(t);case"keypress":return t.which!==32?null:(FE=!0,jE);case"textInput":return e=t.data,e===jE&&FE?null:e;default:return null}}function gN(e,t){if(Sl)return e==="compositionend"||!_b&&cA(e,t)?(e=lA(),Fh=wb=fa=null,Sl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=UE(n)}}function mA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yA(){for(var e=window,t=wp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wp(e.document)}return t}function Eb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ON(e){var t=yA(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mA(n.ownerDocument.documentElement,n)){if(r!==null&&Eb(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=HE(n,i);var a=HE(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,_l=null,zv=null,Nc=null,Vv=!1;function WE(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vv||_l==null||_l!==wp(r)||(r=_l,"selectionStart"in r&&Eb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nc&&vf(Nc,r)||(Nc=r,r=Op(zv,"onSelect"),0xl||(e.current=Xv[xl],Xv[xl]=null,xl--)}function vt(e,t){xl++,Xv[xl]=e.current,e.current=t}var Ra={},Gn=Ba(Ra),wr=Ba(!1),Ls=Ra;function hu(e,t){var n=e.type.contextTypes;if(!n)return Ra;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function br(e){return e=e.childContextTypes,e!=null}function Pp(){_t(wr),_t(Gn)}function QE(e,t,n){if(Gn.current!==Ra)throw Error(oe(168));vt(Gn,t),vt(wr,n)}function xA(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(oe(108,SL(e)||"Unknown",o));return zt({},n,r)}function Tp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ra,Ls=Gn.current,vt(Gn,e),vt(wr,wr.current),!0}function JE(e,t,n){var r=e.stateNode;if(!r)throw Error(oe(169));n?(e=xA(e,t,Ls),r.__reactInternalMemoizedMergedChildContext=e,_t(wr),_t(Gn),vt(Gn,e)):_t(wr),vt(wr,n)}var bi=null,G0=!1,xy=!1;function OA(e){bi===null?bi=[e]:bi.push(e)}function jN(e){G0=!0,OA(e)}function ja(){if(!xy&&bi!==null){xy=!0;var e=0,t=st;try{var n=bi;for(st=1;e>=a,o-=a,xi=1<<32-Bo(t)+o|n<y?(_=C,C=null):_=C.sibling;var v=d(b,C,E[y],T);if(v===null){C===null&&(C=_);break}e&&C&&v.alternate===null&&t(b,C),g=i(v,g,y),A===null?O=v:A.sibling=v,A=v,C=_}if(y===E.length)return n(b,C),At&&ns(b,y),O;if(C===null){for(;yy?(_=C,C=null):_=C.sibling;var x=d(b,C,v.value,T);if(x===null){C===null&&(C=_);break}e&&C&&x.alternate===null&&t(b,C),g=i(x,g,y),A===null?O=x:A.sibling=x,A=x,C=_}if(v.done)return n(b,C),At&&ns(b,y),O;if(C===null){for(;!v.done;y++,v=E.next())v=f(b,v.value,T),v!==null&&(g=i(v,g,y),A===null?O=v:A.sibling=v,A=v);return At&&ns(b,y),O}for(C=r(b,C);!v.done;y++,v=E.next())v=h(C,b,y,v.value,T),v!==null&&(e&&v.alternate!==null&&C.delete(v.key===null?y:v.key),g=i(v,g,y),A===null?O=v:A.sibling=v,A=v);return e&&C.forEach(function(I){return t(b,I)}),At&&ns(b,y),O}function S(b,g,E,T){if(typeof E=="object"&&E!==null&&E.type===bl&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Vd:e:{for(var O=E.key,A=g;A!==null;){if(A.key===O){if(O=E.type,O===bl){if(A.tag===7){n(b,A.sibling),g=o(A,E.props.children),g.return=b,b=g;break e}}else if(A.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===oa&&aC(O)===A.type){n(b,A.sibling),g=o(A,E.props),g.ref=nc(b,A,E),g.return=b,b=g;break e}n(b,A);break}else t(b,A);A=A.sibling}E.type===bl?(g=Cs(E.props.children,b.mode,T,E.key),g.return=b,b=g):(T=Kh(E.type,E.key,E.props,null,b.mode,T),T.ref=nc(b,g,E),T.return=b,b=T)}return a(b);case wl:e:{for(A=E.key;g!==null;){if(g.key===A)if(g.tag===4&&g.stateNode.containerInfo===E.containerInfo&&g.stateNode.implementation===E.implementation){n(b,g.sibling),g=o(g,E.children||[]),g.return=b,b=g;break e}else{n(b,g);break}else t(b,g);g=g.sibling}g=My(E,b.mode,T),g.return=b,b=g}return a(b);case oa:return A=E._init,S(b,g,A(E._payload),T)}if(gc(E))return p(b,g,E,T);if(Zu(E))return m(b,g,E,T);Jd(b,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,g!==null&&g.tag===6?(n(b,g.sibling),g=o(g,E),g.return=b,b=g):(n(b,g),g=ky(E,b.mode,T),g.return=b,b=g),a(b)):n(b,g)}return S}var mu=DA(!0),LA=DA(!1),rd={},ui=Ba(rd),_f=Ba(rd),Ef=Ba(rd);function ys(e){if(e===rd)throw Error(oe(174));return e}function kb(e,t){switch(vt(Ef,t),vt(_f,e),vt(ui,rd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rv(t,e)}_t(ui),vt(ui,t)}function yu(){_t(ui),_t(_f),_t(Ef)}function NA(e){ys(Ef.current);var t=ys(ui.current),n=Rv(t,e.type);t!==n&&(vt(_f,e),vt(ui,n))}function Mb(e){_f.current===e&&(_t(ui),_t(_f))}var Nt=Ba(0);function Lp(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Oy=[];function Db(){for(var e=0;en?n:4,e(!0);var r=Ay.transition;Ay.transition={};try{e(!1),t()}finally{st=n,Ay.transition=r}}function QA(){return So().memoizedState}function VN(e,t,n){var r=_a(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},JA(e))eP(t,n);else if(n=IA(e,t,n,r),n!==null){var o=or();jo(n,e,r,o),tP(n,t,r)}}function UN(e,t,n){var r=_a(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(JA(e))eP(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,zo(s,a)){var l=t.interleaved;l===null?(o.next=o,Ib(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=IA(e,t,o,r),n!==null&&(o=or(),jo(n,e,r,o),tP(n,t,r))}}function JA(e){var t=e.alternate;return e===$t||t!==null&&t===$t}function eP(e,t){Bc=Np=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function tP(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yb(e,n)}}var Bp={readContext:bo,useCallback:$n,useContext:$n,useEffect:$n,useImperativeHandle:$n,useInsertionEffect:$n,useLayoutEffect:$n,useMemo:$n,useReducer:$n,useRef:$n,useState:$n,useDebugValue:$n,useDeferredValue:$n,useTransition:$n,useMutableSource:$n,useSyncExternalStore:$n,useId:$n,unstable_isNewReconciler:!1},HN={readContext:bo,useCallback:function(e,t){return qo().memoizedState=[e,t===void 0?null:t],e},useContext:bo,useEffect:lC,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Uh(4194308,4,KA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Uh(4194308,4,e,t)},useInsertionEffect:function(e,t){return Uh(4,2,e,t)},useMemo:function(e,t){var n=qo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=qo();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=VN.bind(null,$t,e),[r.memoizedState,e]},useRef:function(e){var t=qo();return e={current:e},t.memoizedState=e},useState:sC,useDebugValue:Fb,useDeferredValue:function(e){return qo().memoizedState=e},useTransition:function(){var e=sC(!1),t=e[0];return e=zN.bind(null,e[1]),qo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$t,o=qo();if(At){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),_n===null)throw Error(oe(349));Bs&30||FA(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,lC(zA.bind(null,r,i,e),[e]),r.flags|=2048,Of(9,$A.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=qo(),t=_n.identifierPrefix;if(At){var n=Oi,r=xi;n=(r&~(1<<32-Bo(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Cf++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[ei]=t,e[bf]=r,XA(e,t,!1,!1),t.stateNode=e;e:{switch(a=_v(n,r),n){case"dialog":bt("cancel",e),bt("close",e),o=r;break;case"iframe":case"object":case"embed":bt("load",e),o=r;break;case"video":case"audio":for(o=0;oyu&&(t.flags|=128,r=!0,nc(i,!1),t.lanes=4194304)}else{if(!r)if(e=Mp(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),nc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!At)return $n(t),null}else 2*Zt()-i.renderingStartTime>yu&&n!==1073741824&&(t.flags|=128,r=!0,nc(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Zt(),t.sibling=null,n=Lt.current,vt(Lt,r?n&1|2:n&1),t):($n(t),null);case 22:case 23:return Mb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Mr&1073741824&&($n(t),t.subtreeFlags&6&&(t.flags|=8192)):$n(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function LN(e,t){switch(hb(t),t.tag){case 1:return br(t.type)&&Op(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pu(),_t(wr),_t(Gn),_b(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sb(t),null;case 13:if(_t(Lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));du()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _t(Lt),null;case 4:return pu(),null;case 10:return gb(t.type._context),null;case 22:case 23:return Mb(),null;case 24:return null;default:return null}}var Jd=!1,Hn=!1,NN=typeof WeakSet=="function"?WeakSet:Set,pe=null;function Al(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Wt(e,t,r)}else n.current=null}function qv(e,t,n){try{n()}catch(r){Wt(e,t,r)}}var lC=!1;function BN(e,t){if(kv=_p,e=eA(),fb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(s=a+o),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++u===o&&(s=a),d===i&&++c===r&&(l=a),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Mv={focusedElem:e,selectionRange:n},_p=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,_=p.memoizedState,b=t.stateNode,g=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:To(t.type,m),_);b.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(T){Wt(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return p=lC,lC=!1,p}function Bc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&qv(t,n,i)}o=o.next}while(o!==r)}}function $0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Yv(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ZA(e){var t=e.alternate;t!==null&&(e.alternate=null,ZA(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ei],delete t[bf],delete t[Nv],delete t[wN],delete t[bN])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function QA(e){return e.tag===5||e.tag===3||e.tag===4}function uC(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||QA(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xp));else if(r!==4&&(e=e.child,e!==null))for(Zv(e,t,n),e=e.sibling;e!==null;)Zv(e,t,n),e=e.sibling}function Qv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Qv(e,t,n),e=e.sibling;e!==null;)Qv(e,t,n),e=e.sibling}var Tn=null,Io=!1;function Ki(e,t,n){for(n=n.child;n!==null;)JA(e,t,n),n=n.sibling}function JA(e,t,n){if(si&&typeof si.onCommitFiberUnmount=="function")try{si.onCommitFiberUnmount(k0,n)}catch{}switch(n.tag){case 5:Hn||Al(n,t);case 6:var r=Tn,o=Io;Tn=null,Ki(e,t,n),Tn=r,Io=o,Tn!==null&&(Io?(e=Tn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Tn.removeChild(n.stateNode));break;case 18:Tn!==null&&(Io?(e=Tn,n=n.stateNode,e.nodeType===8?hy(e.parentNode,n):e.nodeType===1&&hy(e,n),mf(e)):hy(Tn,n.stateNode));break;case 4:r=Tn,o=Io,Tn=n.stateNode.containerInfo,Io=!0,Ki(e,t,n),Tn=r,Io=o;break;case 0:case 11:case 14:case 15:if(!Hn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&qv(n,t,a),o=o.next}while(o!==r)}Ki(e,t,n);break;case 1:if(!Hn&&(Al(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Wt(n,t,s)}Ki(e,t,n);break;case 21:Ki(e,t,n);break;case 22:n.mode&1?(Hn=(r=Hn)||n.memoizedState!==null,Ki(e,t,n),Hn=r):Ki(e,t,n);break;default:Ki(e,t,n)}}function cC(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new NN),t.forEach(function(r){var o=GN.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function xo(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=Zt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*FN(r/1960))-r,10e?16:e,fa===null)var r=!1;else{if(e=fa,fa=null,jp=0,qe&6)throw Error(oe(331));var o=qe;for(qe|=4,pe=e.current;pe!==null;){var i=pe,a=i.child;if(pe.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lZt()-Rb?bs(e,0):Ib|=n),Sr(e,t)}function sP(e,t){t===0&&(e.mode&1?(t=Hd,Hd<<=1,!(Hd&130023424)&&(Hd=4194304)):t=1);var n=or();e=Di(e,t),e!==null&&(Jf(e,t,n),Sr(e,n))}function WN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sP(e,n)}function GN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(t),sP(e,n)}var lP;lP=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||wr.current)vr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return vr=!1,MN(e,t,n);vr=!!(e.flags&131072)}else vr=!1,At&&t.flags&1048576&&fA(t,Tp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Uh(e,t),e=t.pendingProps;var o=fu(t,Gn.current);ql(t,n),o=Cb(null,t,r,e,o,n);var i=xb();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,br(r)?(i=!0,Ap(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,wb(t),o.updater=j0,t.stateNode=o,o._reactInternals=t,Uv(t,r,e,n),t=Wv(null,t,r,!0,i,n)):(t.tag=0,At&&i&&db(t),tr(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Uh(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=XN(r),e=To(r,e),o){case 0:t=Hv(null,t,r,e,n);break e;case 1:t=iC(null,t,r,e,n);break e;case 11:t=rC(null,t,r,e,n);break e;case 14:t=oC(null,t,r,To(r.type,e),n);break e}throw Error(oe(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:To(r,o),Hv(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:To(r,o),iC(e,t,r,o,n);case 3:e:{if(WA(t),e===null)throw Error(oe(387));r=t.pendingProps,i=t.memoizedState,o=i.element,mA(e,t),kp(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=mu(Error(oe(423)),t),t=aC(e,t,r,n,o);break e}else if(r!==o){o=mu(Error(oe(424)),t),t=aC(e,t,r,n,o);break e}else for(Lr=va(t.stateNode.containerInfo.firstChild),jr=t,At=!0,Ro=null,n=wA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(du(),r===o){t=Li(e,t,n);break e}tr(e,t,r,n)}t=t.child}return t;case 5:return bA(t),e===null&&Fv(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Dv(r,o)?a=null:i!==null&&Dv(r,i)&&(t.flags|=32),HA(e,t),tr(e,t,a,n),t.child;case 6:return e===null&&Fv(t),null;case 13:return GA(e,t,n);case 4:return bb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hu(t,null,r,n):tr(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:To(r,o),rC(e,t,r,o,n);case 7:return tr(e,t,t.pendingProps,n),t.child;case 8:return tr(e,t,t.pendingProps.children,n),t.child;case 12:return tr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,vt(Ip,r._currentValue),r._currentValue=a,i!==null)if($o(i.value,a)){if(i.children===o.children&&!wr.current){t=Li(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Pi(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),$v(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(oe(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),$v(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}tr(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ql(t,n),o=wo(o),r=r(o),t.flags|=1,tr(e,t,r,n),t.child;case 14:return r=t.type,o=To(r,t.pendingProps),o=To(r.type,o),oC(e,t,r,o,n);case 15:return UA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:To(r,o),Uh(e,t),t.tag=1,br(r)?(e=!0,Ap(t)):e=!1,ql(t,n),gA(t,r,o),Uv(t,r,o,n),Wv(null,t,r,!0,e,n);case 19:return KA(e,t,n);case 22:return VA(e,t,n)}throw Error(oe(156,t.tag))};function uP(e,t){return LO(e,t)}function KN(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ho(e,t,n,r){return new KN(e,t,n,r)}function Lb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XN(e){if(typeof e=="function")return Lb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===eb)return 11;if(e===tb)return 14}return 2}function _a(e,t){var n=e.alternate;return n===null?(n=ho(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Wh(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")Lb(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case vl:return Ss(n.children,o,i,t);case Jw:a=8,o|=8;break;case dv:return e=ho(12,n,t,o|2),e.elementType=dv,e.lanes=i,e;case hv:return e=ho(13,n,t,o),e.elementType=hv,e.lanes=i,e;case pv:return e=ho(19,n,t,o),e.elementType=pv,e.lanes=i,e;case vO:return U0(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case yO:a=10;break e;case gO:a=9;break e;case eb:a=11;break e;case tb:a=14;break e;case ra:a=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=ho(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Ss(e,t,n,r){return e=ho(7,e,r,t),e.lanes=n,e}function U0(e,t,n,r){return e=ho(22,e,r,t),e.elementType=vO,e.lanes=n,e.stateNode={isHidden:!1},e}function Sy(e,t,n){return e=ho(6,e,null,t),e.lanes=n,e}function _y(e,t,n){return t=ho(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qN(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ny(0),this.expirationTimes=ny(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ny(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Nb(e,t,n,r,o,i,a,s,l){return e=new qN(e,t,n,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ho(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wb(i),e}function YN(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hP)}catch(e){console.error(e)}}hP(),fO.exports=Jr;var K0=fO.exports;const tB=Qe(K0);var[pP,nB]=tn({strict:!1,name:"PortalContext"}),$b="chakra-portal",rB=".chakra-portal",oB=e=>w.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),iB=e=>{const{appendToParentPortal:t,children:n}=e,[r,o]=P.useState(null),i=P.useRef(null),[,a]=P.useState({});P.useEffect(()=>a({}),[]);const s=nB(),l=ZD();ai(()=>{if(!r)return;const c=r.ownerDocument,f=t?s??c.body:c.body;if(!f)return;i.current=c.createElement("div"),i.current.className=$b,f.appendChild(i.current),a({});const d=i.current;return()=>{f.contains(d)&&f.removeChild(d)}},[r]);const u=l!=null&&l.zIndex?w.jsx(oB,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return i.current?K0.createPortal(w.jsx(pP,{value:i.current,children:u}),i.current):w.jsx("span",{ref:c=>{c&&o(c)}})},aB=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,o=n.current,i=o??(typeof window<"u"?document.body:void 0),a=P.useMemo(()=>{const l=o==null?void 0:o.ownerDocument.createElement("div");return l&&(l.className=$b),l},[o]),[,s]=P.useState({});return ai(()=>s({}),[]),ai(()=>{if(!(!a||!i))return i.appendChild(a),()=>{i.removeChild(a)}},[a,i]),i&&a?K0.createPortal(w.jsx(pP,{value:r?a:null,children:t}),a):null};function Nu(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?w.jsx(aB,{containerRef:n,...r}):w.jsx(iB,{...r})}Nu.className=$b;Nu.selector=rB;Nu.displayName="Portal";function rd(){const e=P.useContext(uf);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}var zb=P.createContext({});zb.displayName="ColorModeContext";function X0(){const e=P.useContext(zb);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var nh={light:"chakra-ui-light",dark:"chakra-ui-dark"};function sB(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const o=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,o==null||o()},setClassName(r){document.body.classList.add(r?nh.dark:nh.light),document.body.classList.remove(r?nh.light:nh.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var o;return((o=n.query().matches)!=null?o:r==="dark")?"dark":"light"},addListener(r){const o=n.query(),i=a=>{r(a.matches?"dark":"light")};return typeof o.addListener=="function"?o.addListener(i):o.addEventListener("change",i),()=>{typeof o.removeListener=="function"?o.removeListener(i):o.removeEventListener("change",i)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var lB="chakra-ui-color-mode";function uB(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var cB=uB(lB),vC=()=>{};function wC(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function mP(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:o,disableTransitionOnChange:i}={},colorModeManager:a=cB}=e,s=o==="dark"?"dark":"light",[l,u]=P.useState(()=>wC(a,s)),[c,f]=P.useState(()=>wC(a)),{getSystemTheme:d,setClassName:h,setDataset:p,addListener:m}=P.useMemo(()=>sB({preventTransition:i}),[i]),_=o==="system"&&!l?c:l,b=P.useCallback(T=>{const O=T==="system"?d():T;u(O),h(O==="dark"),p(O),a.set(O)},[a,d,h,p]);ai(()=>{o==="system"&&f(d())},[]),P.useEffect(()=>{const T=a.get();if(T){b(T);return}if(o==="system"){b("system");return}b(s)},[a,s,o,b]);const g=P.useCallback(()=>{b(_==="dark"?"light":"dark")},[_,b]);P.useEffect(()=>{if(r)return m(b)},[r,m,b]);const E=P.useMemo(()=>({colorMode:t??_,toggleColorMode:t?vC:g,setColorMode:t?vC:b,forced:t!==void 0}),[_,g,b,t]);return w.jsx(zb.Provider,{value:E,children:n})}mP.displayName="ColorModeProvider";var fB=new Set(["dark","light","system"]);function dB(e){let t=e;return fB.has(t)||(t="light"),t}function hB(e={}){const{initialColorMode:t="light",type:n="localStorage",storageKey:r="chakra-ui-color-mode"}=e,o=dB(t),i=n==="cookie",a=`(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="${o}",r="${r}",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})(); +`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Iy(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function e2(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var KN=typeof WeakMap=="function"?WeakMap:Map;function nP(e,t,n){n=Ti(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Fp||(Fp=!0,c2=r),e2(e,t)},n}function rP(e,t,n){n=Ti(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){e2(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){e2(e,t),typeof r!="function"&&(Sa===null?Sa=new Set([this]):Sa.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function uC(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new KN;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=sB.bind(null,e,t,n),t.then(e,e))}function cC(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function fC(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ti(-1,1),t.tag=2,ba(n,t,1))),n.lanes|=1),e)}var XN=Ui.ReactCurrentOwner,vr=!1;function tr(e,t,n,r){t.child=e===null?LA(t,null,n,r):mu(t,e.child,n,r)}function dC(e,t,n,r,o){n=n.render;var i=t.ref;return Zl(t,o),r=Nb(e,t,n,r,i,o),n=Bb(),e!==null&&!vr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Bi(e,t,o)):(At&&n&&Cb(t),t.flags|=1,tr(e,t,r,o),t.child)}function hC(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Kb(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,oP(e,t,i,r,o)):(e=Kh(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:vf,n(a,r)&&e.ref===t.ref)return Bi(e,t,o)}return t.flags|=1,e=Ea(i,r),e.ref=t.ref,e.return=t,t.child=e}function oP(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(vf(i,r)&&e.ref===t.ref)if(vr=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(vr=!0);else return t.lanes=e.lanes,Bi(e,t,o)}return t2(e,t,n,r,o)}function iP(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},vt(Il,Fr),Fr|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,vt(Il,Fr),Fr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,vt(Il,Fr),Fr|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,vt(Il,Fr),Fr|=r;return tr(e,t,o,n),t.child}function aP(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function t2(e,t,n,r,o){var i=br(n)?Ls:Gn.current;return i=hu(t,i),Zl(t,o),n=Nb(e,t,n,r,i,o),r=Bb(),e!==null&&!vr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Bi(e,t,o)):(At&&r&&Cb(t),t.flags|=1,tr(e,t,n,o),t.child)}function pC(e,t,n,r,o){if(br(n)){var i=!0;Tp(t)}else i=!1;if(Zl(t,o),t.stateNode===null)Hh(e,t),MA(t,n,r),Jv(t,n,r,o),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=bo(u):(u=br(n)?Ls:Gn.current,u=hu(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&iC(t,a,r,u),ia=!1;var d=t.memoizedState;a.state=d,Dp(t,r,a,o),l=t.memoizedState,s!==r||d!==l||wr.current||ia?(typeof c=="function"&&(Qv(t,n,c,r),l=t.memoizedState),(s=ia||oC(t,n,s,r,d,l,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,RA(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Io(t.type,s),a.props=u,f=t.pendingProps,d=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=bo(l):(l=br(n)?Ls:Gn.current,l=hu(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==f||d!==l)&&iC(t,a,r,l),ia=!1,d=t.memoizedState,a.state=d,Dp(t,r,a,o);var p=t.memoizedState;s!==f||d!==p||wr.current||ia?(typeof h=="function"&&(Qv(t,n,h,r),p=t.memoizedState),(u=ia||oC(t,n,u,r,d,p,l)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return n2(e,t,n,r,i,o)}function n2(e,t,n,r,o,i){aP(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&JE(t,n,!1),Bi(e,t,i);r=t.stateNode,XN.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=mu(t,e.child,null,i),t.child=mu(t,null,s,i)):tr(e,t,s,i),t.memoizedState=r.state,o&&JE(t,n,!0),t.child}function sP(e){var t=e.stateNode;t.pendingContext?QE(e,t.pendingContext,t.pendingContext!==t.context):t.context&&QE(e,t.context,!1),kb(e,t.containerInfo)}function mC(e,t,n,r,o){return pu(),Ob(o),t.flags|=256,tr(e,t,n,r),t.child}var r2={dehydrated:null,treeContext:null,retryLane:0};function o2(e){return{baseLanes:e,cachePool:null,transitions:null}}function lP(e,t,n){var r=t.pendingProps,o=Nt.current,i=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(o&2)!==0),s?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),vt(Nt,o&1),e===null)return Yv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Z0(a,r,0,null),e=Cs(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=o2(n),t.memoizedState=r2,e):$b(t,a));if(o=e.memoizedState,o!==null&&(s=o.dehydrated,s!==null))return qN(e,t,a,r,s,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,s=o.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Ea(o,l),r.subtreeFlags=o.subtreeFlags&14680064),s!==null?i=Ea(s,i):(i=Cs(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?o2(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=r2,r}return i=e.child,e=i.sibling,r=Ea(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function $b(e,t){return t=Z0({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function eh(e,t,n,r){return r!==null&&Ob(r),mu(t,e.child,null,n),e=$b(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qN(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Iy(Error(oe(422))),eh(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Z0({mode:"visible",children:r.children},o,0,null),i=Cs(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&mu(t,e.child,null,a),t.child.memoizedState=o2(a),t.memoizedState=r2,i);if(!(t.mode&1))return eh(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var s=r.dgst;return r=s,i=Error(oe(419)),r=Iy(i,r,void 0),eh(e,t,a,r)}if(s=(a&e.childLanes)!==0,vr||s){if(r=_n,r!==null){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Ni(e,o),jo(r,e,o,-1))}return Gb(),r=Iy(Error(oe(421))),eh(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=lB.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Vr=wa(o.nextSibling),Wr=t,At=!0,ko=null,e!==null&&(co[fo++]=xi,co[fo++]=Oi,co[fo++]=Ns,xi=e.id,Oi=e.overflow,Ns=t),t=$b(t,r.children),t.flags|=4096,t)}function yC(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zv(e.return,t,n)}function Ry(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function uP(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(tr(e,t,r.children,n),r=Nt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yC(e,n,t);else if(e.tag===19)yC(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(vt(Nt,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Lp(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ry(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Lp(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ry(t,!0,n,null,i);break;case"together":Ry(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Hh(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Bi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),js|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,n=Ea(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ea(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function YN(e,t,n){switch(t.tag){case 3:sP(t),pu();break;case 5:NA(t);break;case 1:br(t.type)&&Tp(t);break;case 4:kb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;vt(kp,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(vt(Nt,Nt.current&1),t.flags|=128,null):n&t.child.childLanes?lP(e,t,n):(vt(Nt,Nt.current&1),e=Bi(e,t,n),e!==null?e.sibling:null);vt(Nt,Nt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return uP(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),vt(Nt,Nt.current),r)break;return null;case 22:case 23:return t.lanes=0,iP(e,t,n)}return Bi(e,t,n)}var cP,i2,fP,dP;cP=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};i2=function(){};fP=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ys(ui.current);var i=null;switch(n){case"input":o=Av(e,o),r=Av(e,r),i=[];break;case"select":o=zt({},o,{value:void 0}),r=zt({},r,{value:void 0}),i=[];break;case"textarea":o=Iv(e,o),r=Iv(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ap)}kv(n,r);var a;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var s=o[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ff.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(s=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ff.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&bt("scroll",e),i||s===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};dP=function(e,t,n,r){n!==r&&(t.flags|=4)};function rc(e,t){if(!At)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ZN(e,t,n){var r=t.pendingProps;switch(xb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zn(t),null;case 1:return br(t.type)&&Pp(),zn(t),null;case 3:return r=t.stateNode,yu(),_t(wr),_t(Gn),Db(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Qd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ko!==null&&(h2(ko),ko=null))),i2(e,t),zn(t),null;case 5:Mb(t);var o=ys(Ef.current);if(n=t.type,e!==null&&t.stateNode!=null)fP(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(oe(166));return zn(t),null}if(e=ys(ui.current),Qd(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ti]=t,r[Sf]=i,e=(t.mode&1)!==0,n){case"dialog":bt("cancel",r),bt("close",r);break;case"iframe":case"object":case"embed":bt("load",r);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[ti]=t,e[Sf]=r,cP(e,t,!1,!1),t.stateNode=e;e:{switch(a=Mv(n,r),n){case"dialog":bt("cancel",e),bt("close",e),o=r;break;case"iframe":case"object":case"embed":bt("load",e),o=r;break;case"video":case"audio":for(o=0;ovu&&(t.flags|=128,r=!0,rc(i,!1),t.lanes=4194304)}else{if(!r)if(e=Lp(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),rc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!At)return zn(t),null}else 2*Zt()-i.renderingStartTime>vu&&n!==1073741824&&(t.flags|=128,r=!0,rc(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Zt(),t.sibling=null,n=Nt.current,vt(Nt,r?n&1|2:n&1),t):(zn(t),null);case 22:case 23:return Wb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Fr&1073741824&&(zn(t),t.subtreeFlags&6&&(t.flags|=8192)):zn(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function QN(e,t){switch(xb(t),t.tag){case 1:return br(t.type)&&Pp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yu(),_t(wr),_t(Gn),Db(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Mb(t),null;case 13:if(_t(Nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));pu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _t(Nt),null;case 4:return yu(),null;case 10:return Tb(t.type._context),null;case 22:case 23:return Wb(),null;case 24:return null;default:return null}}var th=!1,Wn=!1,JN=typeof WeakSet=="function"?WeakSet:Set,me=null;function Tl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Wt(e,t,r)}else n.current=null}function a2(e,t,n){try{n()}catch(r){Wt(e,t,r)}}var gC=!1;function eB(e,t){if(Uv=Cp,e=yA(),Eb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(s=a+o),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++u===o&&(s=a),d===i&&++c===r&&(l=a),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Hv={focusedElem:e,selectionRange:n},Cp=!1,me=t;me!==null;)if(t=me,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,me=e;else for(;me!==null;){t=me;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,S=p.memoizedState,b=t.stateNode,g=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Io(t.type,m),S);b.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(T){Wt(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,me=e;break}me=t.return}return p=gC,gC=!1,p}function jc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&a2(t,n,i)}o=o.next}while(o!==r)}}function q0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function s2(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function hP(e){var t=e.alternate;t!==null&&(e.alternate=null,hP(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ti],delete t[Sf],delete t[Kv],delete t[NN],delete t[BN])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function pP(e){return e.tag===5||e.tag===3||e.tag===4}function vC(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pP(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function l2(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ap));else if(r!==4&&(e=e.child,e!==null))for(l2(e,t,n),e=e.sibling;e!==null;)l2(e,t,n),e=e.sibling}function u2(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(u2(e,t,n),e=e.sibling;e!==null;)u2(e,t,n),e=e.sibling}var Tn=null,Ro=!1;function Xi(e,t,n){for(n=n.child;n!==null;)mP(e,t,n),n=n.sibling}function mP(e,t,n){if(li&&typeof li.onCommitFiberUnmount=="function")try{li.onCommitFiberUnmount(z0,n)}catch{}switch(n.tag){case 5:Wn||Tl(n,t);case 6:var r=Tn,o=Ro;Tn=null,Xi(e,t,n),Tn=r,Ro=o,Tn!==null&&(Ro?(e=Tn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Tn.removeChild(n.stateNode));break;case 18:Tn!==null&&(Ro?(e=Tn,n=n.stateNode,e.nodeType===8?Cy(e.parentNode,n):e.nodeType===1&&Cy(e,n),yf(e)):Cy(Tn,n.stateNode));break;case 4:r=Tn,o=Ro,Tn=n.stateNode.containerInfo,Ro=!0,Xi(e,t,n),Tn=r,Ro=o;break;case 0:case 11:case 14:case 15:if(!Wn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&a2(n,t,a),o=o.next}while(o!==r)}Xi(e,t,n);break;case 1:if(!Wn&&(Tl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Wt(n,t,s)}Xi(e,t,n);break;case 21:Xi(e,t,n);break;case 22:n.mode&1?(Wn=(r=Wn)||n.memoizedState!==null,Xi(e,t,n),Wn=r):Xi(e,t,n);break;default:Xi(e,t,n)}}function wC(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new JN),t.forEach(function(r){var o=uB.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Oo(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=Zt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nB(r/1960))-r,10e?16:e,da===null)var r=!1;else{if(e=da,da=null,$p=0,Ye&6)throw Error(oe(331));var o=Ye;for(Ye|=4,me=e.current;me!==null;){var i=me,a=i.child;if(me.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lZt()-Ub?Es(e,0):Vb|=n),Sr(e,t)}function EP(e,t){t===0&&(e.mode&1?(t=Gd,Gd<<=1,!(Gd&130023424)&&(Gd=4194304)):t=1);var n=or();e=Ni(e,t),e!==null&&(ed(e,t,n),Sr(e,n))}function lB(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),EP(e,n)}function uB(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(t),EP(e,n)}var CP;CP=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||wr.current)vr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return vr=!1,YN(e,t,n);vr=!!(e.flags&131072)}else vr=!1,At&&t.flags&1048576&&AA(t,Rp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hh(e,t),e=t.pendingProps;var o=hu(t,Gn.current);Zl(t,n),o=Nb(null,t,r,e,o,n);var i=Bb();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,br(r)?(i=!0,Tp(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Rb(t),o.updater=K0,t.stateNode=o,o._reactInternals=t,Jv(t,r,e,n),t=n2(null,t,r,!0,i,n)):(t.tag=0,At&&i&&Cb(t),tr(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hh(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=fB(r),e=Io(r,e),o){case 0:t=t2(null,t,r,e,n);break e;case 1:t=pC(null,t,r,e,n);break e;case 11:t=dC(null,t,r,e,n);break e;case 14:t=hC(null,t,r,Io(r.type,e),n);break e}throw Error(oe(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Io(r,o),t2(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Io(r,o),pC(e,t,r,o,n);case 3:e:{if(sP(t),e===null)throw Error(oe(387));r=t.pendingProps,i=t.memoizedState,o=i.element,RA(e,t),Dp(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=gu(Error(oe(423)),t),t=mC(e,t,r,n,o);break e}else if(r!==o){o=gu(Error(oe(424)),t),t=mC(e,t,r,n,o);break e}else for(Vr=wa(t.stateNode.containerInfo.firstChild),Wr=t,At=!0,ko=null,n=LA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pu(),r===o){t=Bi(e,t,n);break e}tr(e,t,r,n)}t=t.child}return t;case 5:return NA(t),e===null&&Yv(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Wv(r,o)?a=null:i!==null&&Wv(r,i)&&(t.flags|=32),aP(e,t),tr(e,t,a,n),t.child;case 6:return e===null&&Yv(t),null;case 13:return lP(e,t,n);case 4:return kb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mu(t,null,r,n):tr(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Io(r,o),dC(e,t,r,o,n);case 7:return tr(e,t,t.pendingProps,n),t.child;case 8:return tr(e,t,t.pendingProps.children,n),t.child;case 12:return tr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,vt(kp,r._currentValue),r._currentValue=a,i!==null)if(zo(i.value,a)){if(i.children===o.children&&!wr.current){t=Bi(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Ti(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Zv(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(oe(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Zv(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}tr(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Zl(t,n),o=bo(o),r=r(o),t.flags|=1,tr(e,t,r,n),t.child;case 14:return r=t.type,o=Io(r,t.pendingProps),o=Io(r.type,o),hC(e,t,r,o,n);case 15:return oP(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Io(r,o),Hh(e,t),t.tag=1,br(r)?(e=!0,Tp(t)):e=!1,Zl(t,n),MA(t,r,o),Jv(t,r,o,n),n2(null,t,r,!0,e,n);case 19:return uP(e,t,n);case 22:return iP(e,t,n)}throw Error(oe(156,t.tag))};function xP(e,t){return ZO(e,t)}function cB(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function po(e,t,n,r){return new cB(e,t,n,r)}function Kb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fB(e){if(typeof e=="function")return Kb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===db)return 11;if(e===hb)return 14}return 2}function Ea(e,t){var n=e.alternate;return n===null?(n=po(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Kh(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")Kb(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case bl:return Cs(n.children,o,i,t);case fb:a=8,o|=8;break;case Ev:return e=po(12,n,t,o|2),e.elementType=Ev,e.lanes=i,e;case Cv:return e=po(13,n,t,o),e.elementType=Cv,e.lanes=i,e;case xv:return e=po(19,n,t,o),e.elementType=xv,e.lanes=i,e;case DO:return Z0(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kO:a=10;break e;case MO:a=9;break e;case db:a=11;break e;case hb:a=14;break e;case oa:a=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=po(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Cs(e,t,n,r){return e=po(7,e,r,t),e.lanes=n,e}function Z0(e,t,n,r){return e=po(22,e,r,t),e.elementType=DO,e.lanes=n,e.stateNode={isHidden:!1},e}function ky(e,t,n){return e=po(6,e,null,t),e.lanes=n,e}function My(e,t,n){return t=po(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dB(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hy(0),this.expirationTimes=hy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hy(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Xb(e,t,n,r,o,i,a,s,l){return e=new dB(e,t,n,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=po(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rb(i),e}function hB(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(TP)}catch(e){console.error(e)}}TP(),AO.exports=eo;var nm=AO.exports;const vB=Fe(nm);var[IP,wB]=tn({strict:!1,name:"PortalContext"}),Qb="chakra-portal",bB=".chakra-portal",SB=e=>w.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),_B=e=>{const{appendToParentPortal:t,children:n}=e,[r,o]=P.useState(null),i=P.useRef(null),[,a]=P.useState({});P.useEffect(()=>a({}),[]);const s=wB(),l=pL();si(()=>{if(!r)return;const c=r.ownerDocument,f=t?s??c.body:c.body;if(!f)return;i.current=c.createElement("div"),i.current.className=Qb,f.appendChild(i.current),a({});const d=i.current;return()=>{f.contains(d)&&f.removeChild(d)}},[r]);const u=l!=null&&l.zIndex?w.jsx(SB,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return i.current?nm.createPortal(w.jsx(IP,{value:i.current,children:u}),i.current):w.jsx("span",{ref:c=>{c&&o(c)}})},EB=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,o=n.current,i=o??(typeof window<"u"?document.body:void 0),a=P.useMemo(()=>{const l=o==null?void 0:o.ownerDocument.createElement("div");return l&&(l.className=Qb),l},[o]),[,s]=P.useState({});return si(()=>s({}),[]),si(()=>{if(!(!a||!i))return i.appendChild(a),()=>{i.removeChild(a)}},[a,i]),i&&a?nm.createPortal(w.jsx(IP,{value:r?a:null,children:t}),a):null};function ju(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?w.jsx(EB,{containerRef:n,...r}):w.jsx(_B,{...r})}ju.className=Qb;ju.selector=bB;ju.displayName="Portal";function od(){const e=P.useContext(cf);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}var Jb=P.createContext({});Jb.displayName="ColorModeContext";function rm(){const e=P.useContext(Jb);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var oh={light:"chakra-ui-light",dark:"chakra-ui-dark"};function CB(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const o=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,o==null||o()},setClassName(r){document.body.classList.add(r?oh.dark:oh.light),document.body.classList.remove(r?oh.light:oh.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var o;return((o=n.query().matches)!=null?o:r==="dark")?"dark":"light"},addListener(r){const o=n.query(),i=a=>{r(a.matches?"dark":"light")};return typeof o.addListener=="function"?o.addListener(i):o.addEventListener("change",i),()=>{typeof o.removeListener=="function"?o.removeListener(i):o.removeEventListener("change",i)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var xB="chakra-ui-color-mode";function OB(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var AB=OB(xB),AC=()=>{};function PC(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function RP(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:o,disableTransitionOnChange:i}={},colorModeManager:a=AB}=e,s=o==="dark"?"dark":"light",[l,u]=P.useState(()=>PC(a,s)),[c,f]=P.useState(()=>PC(a)),{getSystemTheme:d,setClassName:h,setDataset:p,addListener:m}=P.useMemo(()=>CB({preventTransition:i}),[i]),S=o==="system"&&!l?c:l,b=P.useCallback(T=>{const O=T==="system"?d():T;u(O),h(O==="dark"),p(O),a.set(O)},[a,d,h,p]);si(()=>{o==="system"&&f(d())},[]),P.useEffect(()=>{const T=a.get();if(T){b(T);return}if(o==="system"){b("system");return}b(s)},[a,s,o,b]);const g=P.useCallback(()=>{b(S==="dark"?"light":"dark")},[S,b]);P.useEffect(()=>{if(r)return m(b)},[r,m,b]);const E=P.useMemo(()=>({colorMode:t??S,toggleColorMode:t?AC:g,setColorMode:t?AC:b,forced:t!==void 0}),[S,g,b,t]);return w.jsx(Jb.Provider,{value:E,children:n})}RP.displayName="ColorModeProvider";var PB=new Set(["dark","light","system"]);function TB(e){let t=e;return PB.has(t)||(t="light"),t}function IB(e={}){const{initialColorMode:t="light",type:n="localStorage",storageKey:r="chakra-ui-color-mode"}=e,o=TB(t),i=n==="cookie",a=`(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="${o}",r="${r}",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})(); `,s=`(function(){try{var a=function(c){var v="(prefers-color-scheme: dark)",h=window.matchMedia(v).matches?"dark":"light",r=c==="system"?h:c,o=document.documentElement,s=document.body,l="chakra-ui-light",d="chakra-ui-dark",i=r==="dark";return s.classList.add(i?d:l),s.classList.remove(i?l:d),o.style.colorScheme=r,o.dataset.theme=r,r},n=a,m="${o}",e="${r}",t=localStorage.getItem(e);t?a(t):localStorage.setItem(e,a(m))}catch(a){}})(); - `;return`!${i?a:s}`.trim()}function pB(e={}){const{nonce:t}=e;return w.jsx("script",{id:"chakra-script",nonce:t,dangerouslySetInnerHTML:{__html:hB(e)}})}function yP(){const e=X0(),t=rd();return{...e,theme:t}}function mB(e,t,n){var r,o;if(t==null)return t;const i=a=>{var s,l;return(l=(s=e.__breakpoints)==null?void 0:s.asArray)==null?void 0:l[a]};return(o=(r=i(t))!=null?r:i(n))!=null?o:n}function yB(e,t,n){var r,o;if(t==null)return t;const i=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.value};return(o=(r=i(t))!=null?r:i(n))!=null?o:n}function gB(e,t,n){const r=rd();return vB(e,t,n)(r)}function vB(e,t,n){const r=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n];return i=>{const a=o.filter(Boolean),s=r.map((l,u)=>{var c,f;if(e==="breakpoints")return mB(i,l,(c=a[u])!=null?c:l);const d=`${e}.${l}`;return yB(i,d,(f=a[u])!=null?f:l)});return Array.isArray(t)?s:s[0]}}var _e=(...e)=>e.filter(Boolean).join(" ");function _r(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function po(e,...t){return wB(e)?e(...t):e}var wB=e=>typeof e=="function",Re=e=>e?"":void 0,Zl=e=>e?!0:void 0;function ke(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function q0(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var zp={exports:{}};zp.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",_="[object Number]",b="[object Null]",g="[object Object]",E="[object Proxy]",T="[object RegExp]",O="[object Set]",A="[object String]",C="[object Undefined]",y="[object WeakMap]",S="[object ArrayBuffer]",v="[object DataView]",x="[object Float32Array]",I="[object Float64Array]",R="[object Int8Array]",k="[object Int16Array]",M="[object Int32Array]",N="[object Uint8Array]",D="[object Uint8ClampedArray]",L="[object Uint16Array]",j="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,B=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,K={};K[x]=K[I]=K[R]=K[k]=K[M]=K[N]=K[D]=K[L]=K[j]=!0,K[s]=K[l]=K[S]=K[c]=K[v]=K[f]=K[d]=K[h]=K[m]=K[_]=K[g]=K[T]=K[O]=K[A]=K[y]=!1;var W=typeof fo=="object"&&fo&&fo.Object===Object&&fo,Q=typeof self=="object"&&self&&self.Object===Object&&self,X=W||Q||Function("return this")(),J=t&&!t.nodeType&&t,te=J&&!0&&e&&!e.nodeType&&e,le=te&&te.exports===J,ge=le&&W.process,se=function(){try{var z=te&&te.require&&te.require("util").types;return z||ge&&ge.binding&&ge.binding("util")}catch{}}(),ue=se&&se.isTypedArray;function Ie(z,V,q){switch(q.length){case 0:return z.call(V);case 1:return z.call(V,q[0]);case 2:return z.call(V,q[0],q[1]);case 3:return z.call(V,q[0],q[1],q[2])}return z.apply(V,q)}function gt(z,V){for(var q=-1,he=Array(z);++q-1}function F9(z,V){var q=this.__data__,he=Dd(q,z);return he<0?(++this.size,q.push([z,V])):q[he][1]=V,this}yi.prototype.clear=L9,yi.prototype.delete=N9,yi.prototype.get=B9,yi.prototype.has=j9,yi.prototype.set=F9;function nl(z){var V=-1,q=z==null?0:z.length;for(this.clear();++V1?q[He-1]:void 0,Ct=He>2?q[2]:void 0;for(ht=z.length>3&&typeof ht=="function"?(He--,ht):void 0,Ct&&pM(q[0],q[1],Ct)&&(ht=He<3?void 0:ht,He=1),V=Object(V);++he-1&&z%1==0&&z0){if(++V>=o)return arguments[0]}else V=0;return z.apply(void 0,arguments)}}function _M(z){if(z!=null){try{return xn.call(z)}catch{}try{return z+""}catch{}}return""}function Bd(z,V){return z===V||z!==z&&V!==V}var Hm=G_(function(){return arguments}())?G_:function(z){return Ku(z)&&zt.call(z,"callee")&&!x9.call(z,"callee")},Wm=Array.isArray;function Gm(z){return z!=null&&Z_(z.length)&&!Km(z)}function EM(z){return Ku(z)&&Gm(z)}var Y_=A9||PM;function Km(z){if(!Xa(z))return!1;var V=Ld(z);return V==h||V==p||V==u||V==E}function Z_(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=a}function Xa(z){var V=typeof z;return z!=null&&(V=="object"||V=="function")}function Ku(z){return z!=null&&typeof z=="object"}function CM(z){if(!Ku(z)||Ld(z)!=g)return!1;var V=U_(z);if(V===null)return!0;var q=zt.call(V,"constructor")&&V.constructor;return typeof q=="function"&&q instanceof q&&xn.call(q)==Ha}var Q_=ue?ie(ue):eM;function xM(z){return uM(z,J_(z))}function J_(z){return Gm(z)?Y9(z,!0):tM(z)}var OM=cM(function(z,V,q,he){K_(z,V,q,he)});function AM(z){return function(){return z}}function eE(z){return z}function PM(){return!1}e.exports=OM})(zp,zp.exports);var bB=zp.exports;const mo=Qe(bB);var SB=e=>/!(important)?$/.test(e),bC=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,_B=(e,t)=>n=>{const r=String(t),o=SB(r),i=bC(r),a=e?`${e}.${i}`:i;let s=_r(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=bC(s),o?`${s} !important`:s};function Ub(e){const{scale:t,transform:n,compose:r}=e;return(i,a)=>{var s;const l=_B(t,i)(a);let u=(s=n==null?void 0:n(l,a))!=null?s:l;return r&&(u=r(u,a)),u}}var rh=(...e)=>t=>e.reduce((n,r)=>r(n),t);function no(e,t){return n=>{const r={property:n,scale:e};return r.transform=Ub({scale:e,transform:t}),r}}var EB=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function CB(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:EB(t),transform:n?Ub({scale:n,compose:r}):r}}var gP=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function xB(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...gP].join(" ")}function OB(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...gP].join(" ")}var AB={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},PB={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function TB(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var IB={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},r2={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},RB=new Set(Object.values(r2)),o2=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),kB=e=>e.trim();function MB(e,t){if(e==null||o2.has(e))return e;if(!(i2(e)||o2.has(e)))return`url('${e}')`;const o=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=o==null?void 0:o[1],a=o==null?void 0:o[2];if(!i||!a)return e;const s=i.includes("-gradient")?i:`${i}-gradient`,[l,...u]=a.split(",").map(kB).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in r2?r2[l]:l;u.unshift(c);const f=u.map(d=>{if(RB.has(d))return d;const h=d.indexOf(" "),[p,m]=h!==-1?[d.substr(0,h),d.substr(h+1)]:[d],_=i2(m)?m:m&&m.split(" "),b=`colors.${p}`,g=b in t.__cssMap?t.__cssMap[b].varRef:p;return _?[g,...Array.isArray(_)?_:[_]].join(" "):g});return`${s}(${f.join(", ")})`}var i2=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),DB=(e,t)=>MB(e,t??{});function LB(e){return/^var\(--.+\)$/.test(e)}var NB=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Wo=e=>t=>`${e}(${t})`,Ye={filter(e){return e!=="auto"?e:AB},backdropFilter(e){return e!=="auto"?e:PB},ring(e){return TB(Ye.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?xB():e==="auto-gpu"?OB():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=NB(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(LB(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:DB,blur:Wo("blur"),opacity:Wo("opacity"),brightness:Wo("brightness"),contrast:Wo("contrast"),dropShadow:Wo("drop-shadow"),grayscale:Wo("grayscale"),hueRotate:Wo("hue-rotate"),invert:Wo("invert"),saturate:Wo("saturate"),sepia:Wo("sepia"),bgImage(e){return e==null||i2(e)||o2.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=IB[e])!=null?t:{},o={flexDirection:e};return n&&(o[n]=1),r&&(o[r]=1),o}},H={borderWidths:no("borderWidths"),borderStyles:no("borderStyles"),colors:no("colors"),borders:no("borders"),gradients:no("gradients",Ye.gradient),radii:no("radii",Ye.px),space:no("space",rh(Ye.vh,Ye.px)),spaceT:no("space",rh(Ye.vh,Ye.px)),degreeT(e){return{property:e,transform:Ye.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:Ub({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:no("sizes",rh(Ye.vh,Ye.px)),sizesT:no("sizes",rh(Ye.vh,Ye.fraction)),shadows:no("shadows"),logical:CB,blur:no("blur",Ye.blur)},Gh={background:H.colors("background"),backgroundColor:H.colors("backgroundColor"),backgroundImage:H.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Ye.bgClip},bgSize:H.prop("backgroundSize"),bgPosition:H.prop("backgroundPosition"),bg:H.colors("background"),bgColor:H.colors("backgroundColor"),bgPos:H.prop("backgroundPosition"),bgRepeat:H.prop("backgroundRepeat"),bgAttachment:H.prop("backgroundAttachment"),bgGradient:H.gradients("backgroundImage"),bgClip:{transform:Ye.bgClip}};Object.assign(Gh,{bgImage:Gh.backgroundImage,bgImg:Gh.backgroundImage});var et={border:H.borders("border"),borderWidth:H.borderWidths("borderWidth"),borderStyle:H.borderStyles("borderStyle"),borderColor:H.colors("borderColor"),borderRadius:H.radii("borderRadius"),borderTop:H.borders("borderTop"),borderBlockStart:H.borders("borderBlockStart"),borderTopLeftRadius:H.radii("borderTopLeftRadius"),borderStartStartRadius:H.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:H.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:H.radii("borderTopRightRadius"),borderStartEndRadius:H.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:H.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:H.borders("borderRight"),borderInlineEnd:H.borders("borderInlineEnd"),borderBottom:H.borders("borderBottom"),borderBlockEnd:H.borders("borderBlockEnd"),borderBottomLeftRadius:H.radii("borderBottomLeftRadius"),borderBottomRightRadius:H.radii("borderBottomRightRadius"),borderLeft:H.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:H.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:H.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:H.borders(["borderLeft","borderRight"]),borderInline:H.borders("borderInline"),borderY:H.borders(["borderTop","borderBottom"]),borderBlock:H.borders("borderBlock"),borderTopWidth:H.borderWidths("borderTopWidth"),borderBlockStartWidth:H.borderWidths("borderBlockStartWidth"),borderTopColor:H.colors("borderTopColor"),borderBlockStartColor:H.colors("borderBlockStartColor"),borderTopStyle:H.borderStyles("borderTopStyle"),borderBlockStartStyle:H.borderStyles("borderBlockStartStyle"),borderBottomWidth:H.borderWidths("borderBottomWidth"),borderBlockEndWidth:H.borderWidths("borderBlockEndWidth"),borderBottomColor:H.colors("borderBottomColor"),borderBlockEndColor:H.colors("borderBlockEndColor"),borderBottomStyle:H.borderStyles("borderBottomStyle"),borderBlockEndStyle:H.borderStyles("borderBlockEndStyle"),borderLeftWidth:H.borderWidths("borderLeftWidth"),borderInlineStartWidth:H.borderWidths("borderInlineStartWidth"),borderLeftColor:H.colors("borderLeftColor"),borderInlineStartColor:H.colors("borderInlineStartColor"),borderLeftStyle:H.borderStyles("borderLeftStyle"),borderInlineStartStyle:H.borderStyles("borderInlineStartStyle"),borderRightWidth:H.borderWidths("borderRightWidth"),borderInlineEndWidth:H.borderWidths("borderInlineEndWidth"),borderRightColor:H.colors("borderRightColor"),borderInlineEndColor:H.colors("borderInlineEndColor"),borderRightStyle:H.borderStyles("borderRightStyle"),borderInlineEndStyle:H.borderStyles("borderInlineEndStyle"),borderTopRadius:H.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:H.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:H.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:H.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(et,{rounded:et.borderRadius,roundedTop:et.borderTopRadius,roundedTopLeft:et.borderTopLeftRadius,roundedTopRight:et.borderTopRightRadius,roundedTopStart:et.borderStartStartRadius,roundedTopEnd:et.borderStartEndRadius,roundedBottom:et.borderBottomRadius,roundedBottomLeft:et.borderBottomLeftRadius,roundedBottomRight:et.borderBottomRightRadius,roundedBottomStart:et.borderEndStartRadius,roundedBottomEnd:et.borderEndEndRadius,roundedLeft:et.borderLeftRadius,roundedRight:et.borderRightRadius,roundedStart:et.borderInlineStartRadius,roundedEnd:et.borderInlineEndRadius,borderStart:et.borderInlineStart,borderEnd:et.borderInlineEnd,borderTopStartRadius:et.borderStartStartRadius,borderTopEndRadius:et.borderStartEndRadius,borderBottomStartRadius:et.borderEndStartRadius,borderBottomEndRadius:et.borderEndEndRadius,borderStartRadius:et.borderInlineStartRadius,borderEndRadius:et.borderInlineEndRadius,borderStartWidth:et.borderInlineStartWidth,borderEndWidth:et.borderInlineEndWidth,borderStartColor:et.borderInlineStartColor,borderEndColor:et.borderInlineEndColor,borderStartStyle:et.borderInlineStartStyle,borderEndStyle:et.borderInlineEndStyle});var BB={color:H.colors("color"),textColor:H.colors("color"),fill:H.colors("fill"),stroke:H.colors("stroke")},a2={boxShadow:H.shadows("boxShadow"),mixBlendMode:!0,blendMode:H.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:H.prop("backgroundBlendMode"),opacity:!0};Object.assign(a2,{shadow:a2.boxShadow});var jB={filter:{transform:Ye.filter},blur:H.blur("--chakra-blur"),brightness:H.propT("--chakra-brightness",Ye.brightness),contrast:H.propT("--chakra-contrast",Ye.contrast),hueRotate:H.degreeT("--chakra-hue-rotate"),invert:H.propT("--chakra-invert",Ye.invert),saturate:H.propT("--chakra-saturate",Ye.saturate),dropShadow:H.propT("--chakra-drop-shadow",Ye.dropShadow),backdropFilter:{transform:Ye.backdropFilter},backdropBlur:H.blur("--chakra-backdrop-blur"),backdropBrightness:H.propT("--chakra-backdrop-brightness",Ye.brightness),backdropContrast:H.propT("--chakra-backdrop-contrast",Ye.contrast),backdropHueRotate:H.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:H.propT("--chakra-backdrop-invert",Ye.invert),backdropSaturate:H.propT("--chakra-backdrop-saturate",Ye.saturate)},Up={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Ye.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:H.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:H.space("gap"),rowGap:H.space("rowGap"),columnGap:H.space("columnGap")};Object.assign(Up,{flexDir:Up.flexDirection});var vP={gridGap:H.space("gridGap"),gridColumnGap:H.space("gridColumnGap"),gridRowGap:H.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},FB={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Ye.outline},outlineOffset:!0,outlineColor:H.colors("outlineColor")},ao={width:H.sizesT("width"),inlineSize:H.sizesT("inlineSize"),height:H.sizes("height"),blockSize:H.sizes("blockSize"),boxSize:H.sizes(["width","height"]),minWidth:H.sizes("minWidth"),minInlineSize:H.sizes("minInlineSize"),minHeight:H.sizes("minHeight"),minBlockSize:H.sizes("minBlockSize"),maxWidth:H.sizes("maxWidth"),maxInlineSize:H.sizes("maxInlineSize"),maxHeight:H.sizes("maxHeight"),maxBlockSize:H.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (min-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?o:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (max-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?o:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:H.propT("float",Ye.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(ao,{w:ao.width,h:ao.height,minW:ao.minWidth,maxW:ao.maxWidth,minH:ao.minHeight,maxH:ao.maxHeight,overscroll:ao.overscrollBehavior,overscrollX:ao.overscrollBehaviorX,overscrollY:ao.overscrollBehaviorY});var $B={listStyleType:!0,listStylePosition:!0,listStylePos:H.prop("listStylePosition"),listStyleImage:!0,listStyleImg:H.prop("listStyleImage")};function zB(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,a)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(o))return s.get(o);const l=e(r,o,i,a);return s.set(o,l),l}},VB=UB(zB),HB={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},WB={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Ey=(e,t,n)=>{const r={},o=VB(e,t,{});for(const i in o)i in n&&n[i]!=null||(r[i]=o[i]);return r},GB={srOnly:{transform(e){return e===!0?HB:e==="focusable"?WB:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Ey(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Ey(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Ey(t,e,n)}},$c={position:!0,pos:H.prop("position"),zIndex:H.prop("zIndex","zIndices"),inset:H.spaceT("inset"),insetX:H.spaceT(["left","right"]),insetInline:H.spaceT("insetInline"),insetY:H.spaceT(["top","bottom"]),insetBlock:H.spaceT("insetBlock"),top:H.spaceT("top"),insetBlockStart:H.spaceT("insetBlockStart"),bottom:H.spaceT("bottom"),insetBlockEnd:H.spaceT("insetBlockEnd"),left:H.spaceT("left"),insetInlineStart:H.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:H.spaceT("right"),insetInlineEnd:H.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign($c,{insetStart:$c.insetInlineStart,insetEnd:$c.insetInlineEnd});var KB={ring:{transform:Ye.ring},ringColor:H.colors("--chakra-ring-color"),ringOffset:H.prop("--chakra-ring-offset-width"),ringOffsetColor:H.colors("--chakra-ring-offset-color"),ringInset:H.prop("--chakra-ring-inset")},St={margin:H.spaceT("margin"),marginTop:H.spaceT("marginTop"),marginBlockStart:H.spaceT("marginBlockStart"),marginRight:H.spaceT("marginRight"),marginInlineEnd:H.spaceT("marginInlineEnd"),marginBottom:H.spaceT("marginBottom"),marginBlockEnd:H.spaceT("marginBlockEnd"),marginLeft:H.spaceT("marginLeft"),marginInlineStart:H.spaceT("marginInlineStart"),marginX:H.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:H.spaceT("marginInline"),marginY:H.spaceT(["marginTop","marginBottom"]),marginBlock:H.spaceT("marginBlock"),padding:H.space("padding"),paddingTop:H.space("paddingTop"),paddingBlockStart:H.space("paddingBlockStart"),paddingRight:H.space("paddingRight"),paddingBottom:H.space("paddingBottom"),paddingBlockEnd:H.space("paddingBlockEnd"),paddingLeft:H.space("paddingLeft"),paddingInlineStart:H.space("paddingInlineStart"),paddingInlineEnd:H.space("paddingInlineEnd"),paddingX:H.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:H.space("paddingInline"),paddingY:H.space(["paddingTop","paddingBottom"]),paddingBlock:H.space("paddingBlock")};Object.assign(St,{m:St.margin,mt:St.marginTop,mr:St.marginRight,me:St.marginInlineEnd,marginEnd:St.marginInlineEnd,mb:St.marginBottom,ml:St.marginLeft,ms:St.marginInlineStart,marginStart:St.marginInlineStart,mx:St.marginX,my:St.marginY,p:St.padding,pt:St.paddingTop,py:St.paddingY,px:St.paddingX,pb:St.paddingBottom,pl:St.paddingLeft,ps:St.paddingInlineStart,paddingStart:St.paddingInlineStart,pr:St.paddingRight,pe:St.paddingInlineEnd,paddingEnd:St.paddingInlineEnd});var XB={textDecorationColor:H.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:H.shadows("textShadow")},qB={clipPath:!0,transform:H.propT("transform",Ye.transform),transformOrigin:!0,translateX:H.spaceT("--chakra-translate-x"),translateY:H.spaceT("--chakra-translate-y"),skewX:H.degreeT("--chakra-skew-x"),skewY:H.degreeT("--chakra-skew-y"),scaleX:H.prop("--chakra-scale-x"),scaleY:H.prop("--chakra-scale-y"),scale:H.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:H.degreeT("--chakra-rotate")},YB={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:H.prop("transitionDuration","transition.duration"),transitionProperty:H.prop("transitionProperty","transition.property"),transitionTimingFunction:H.prop("transitionTimingFunction","transition.easing")},ZB={fontFamily:H.prop("fontFamily","fonts"),fontSize:H.prop("fontSize","fontSizes",Ye.px),fontWeight:H.prop("fontWeight","fontWeights"),lineHeight:H.prop("lineHeight","lineHeights"),letterSpacing:H.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},QB={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:H.spaceT("scrollMargin"),scrollMarginTop:H.spaceT("scrollMarginTop"),scrollMarginBottom:H.spaceT("scrollMarginBottom"),scrollMarginLeft:H.spaceT("scrollMarginLeft"),scrollMarginRight:H.spaceT("scrollMarginRight"),scrollMarginX:H.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:H.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:H.spaceT("scrollPadding"),scrollPaddingTop:H.spaceT("scrollPaddingTop"),scrollPaddingBottom:H.spaceT("scrollPaddingBottom"),scrollPaddingLeft:H.spaceT("scrollPaddingLeft"),scrollPaddingRight:H.spaceT("scrollPaddingRight"),scrollPaddingX:H.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:H.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function wP(e){return _r(e)&&e.reference?e.reference:String(e)}var Y0=(e,...t)=>t.map(wP).join(` ${e} `).replace(/calc/g,""),SC=(...e)=>`calc(${Y0("+",...e)})`,_C=(...e)=>`calc(${Y0("-",...e)})`,s2=(...e)=>`calc(${Y0("*",...e)})`,EC=(...e)=>`calc(${Y0("/",...e)})`,CC=e=>{const t=wP(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:s2(t,-1)},is=Object.assign(e=>({add:(...t)=>is(SC(e,...t)),subtract:(...t)=>is(_C(e,...t)),multiply:(...t)=>is(s2(e,...t)),divide:(...t)=>is(EC(e,...t)),negate:()=>is(CC(e)),toString:()=>e.toString()}),{add:SC,subtract:_C,multiply:s2,divide:EC,negate:CC});function JB(e,t="-"){return e.replace(/\s+/g,t)}function ej(e){const t=JB(e.toString());return nj(tj(t))}function tj(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function nj(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function rj(e,t=""){return[t,e].filter(Boolean).join("-")}function oj(e,t){return`var(${e}${t?`, ${t}`:""})`}function ij(e,t=""){return ej(`--${rj(e,t)}`)}function Ee(e,t,n){const r=ij(e,n);return{variable:r,reference:oj(r,t)}}function aj(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[o,i]=r;n[o]=Ee(`${e}-${o}`,i);continue}n[r]=Ee(`${e}-${r}`)}return n}function sj(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function lj(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function l2(e){if(e==null)return e;const{unitless:t}=lj(e);return t||typeof e=="number"?`${e}px`:e}var bP=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,Vb=e=>Object.fromEntries(Object.entries(e).sort(bP));function xC(e){const t=Vb(e);return Object.assign(Object.values(t),t)}function uj(e){const t=Object.keys(Vb(e));return new Set(t)}function OC(e){var t;if(!e)return e;e=(t=l2(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function wc(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${l2(e)})`),t&&n.push("and",`(max-width: ${l2(t)})`),n.join(" ")}function cj(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=xC(e),r=Object.entries(e).sort(bP).map(([a,s],l,u)=>{var c;let[,f]=(c=u[l+1])!=null?c:[];return f=parseFloat(f)>0?OC(f):void 0,{_minW:OC(s),breakpoint:a,minW:s,maxW:f,maxWQuery:wc(null,f),minWQuery:wc(s),minMaxQuery:wc(s,f)}}),o=uj(e),i=Array.from(o.values());return{keys:o,normalized:n,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>o.has(l))},asObject:Vb(e),asArray:xC(e),details:r,get(a){return r.find(s=>s.breakpoint===a)},media:[null,...n.map(a=>wc(a)).slice(1)],toArrayValue(a){if(!_r(a))throw new Error("toArrayValue: value must be an object");const s=i.map(l=>{var u;return(u=a[l])!=null?u:null});for(;sj(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const c=i[u];return c!=null&&l!=null&&(s[c]=l),s},{})}}}var On={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},Xi=e=>SP(t=>e(t,"&"),"[role=group]","[data-group]",".group"),gi=e=>SP(t=>e(t,"~ &"),"[data-peer]",".peer"),SP=(e,...t)=>t.map(e).join(", "),Z0={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:Xi(On.hover),_peerHover:gi(On.hover),_groupFocus:Xi(On.focus),_peerFocus:gi(On.focus),_groupFocusVisible:Xi(On.focusVisible),_peerFocusVisible:gi(On.focusVisible),_groupActive:Xi(On.active),_peerActive:gi(On.active),_groupDisabled:Xi(On.disabled),_peerDisabled:gi(On.disabled),_groupInvalid:Xi(On.invalid),_peerInvalid:gi(On.invalid),_groupChecked:Xi(On.checked),_peerChecked:gi(On.checked),_groupFocusWithin:Xi(On.focusWithin),_peerFocusWithin:gi(On.focusWithin),_peerPlaceholderShown:gi(On.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},_P=Object.keys(Z0);function AC(e,t){return Ee(String(e).replace(/\./g,"-"),void 0,t)}function fj(e,t){let n={};const r={};for(const[o,i]of Object.entries(e)){const{isSemantic:a,value:s}=i,{variable:l,reference:u}=AC(o,t==null?void 0:t.cssVarPrefix);if(!a){if(o.startsWith("space")){const d=o.split("."),[h,...p]=d,m=`${h}.-${p.join(".")}`,_=is.negate(s),b=is.negate(u);r[m]={value:_,var:l,varRef:b}}n[l]=s,r[o]={value:s,var:l,varRef:u};continue}const c=d=>{const p=[String(o).split(".")[0],d].join(".");if(!e[p])return d;const{reference:_}=AC(p,t==null?void 0:t.cssVarPrefix);return _},f=_r(s)?s:{default:s};n=mo(n,Object.entries(f).reduce((d,[h,p])=>{var m,_;if(!p)return d;const b=c(`${p}`);if(h==="default")return d[l]=b,d;const g=(_=(m=Z0)==null?void 0:m[h])!=null?_:h;return d[g]={[l]:b},d},{})),r[o]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function dj(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function hj(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function pj(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function PC(e,t,n={}){const{stop:r,getKey:o}=n;function i(a,s=[]){var l;if(pj(a)||Array.isArray(a)){const u={};for(const[c,f]of Object.entries(a)){const d=(l=o==null?void 0:o(c))!=null?l:c,h=[...s,d];if(r!=null&&r(a,h))return t(a,s);u[d]=i(f,h)}return u}return t(a,s)}return i(e)}var mj=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function yj(e){return hj(e,mj)}function gj(e){return e.semanticTokens}function vj(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...o}=e;return o}var wj=e=>_P.includes(e)||e==="default";function bj({tokens:e,semanticTokens:t}){const n={};return PC(e,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!1,value:r})}),PC(t,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(wj)}),n}function Sj(e){var t;const n=vj(e),r=yj(n),o=gj(n),i=bj({tokens:r,semanticTokens:o}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=fj(i,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:cj(n.breakpoints)}),n}var Hb=mo({},Gh,et,BB,Up,ao,jB,KB,FB,vP,GB,$c,a2,St,QB,ZB,XB,qB,$B,YB),_j=Object.assign({},St,ao,Up,vP,$c),Ej=Object.keys(_j),Cj=[...Object.keys(Hb),..._P],xj={...Hb,...Z0},Oj=e=>e in xj,Aj=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:o}=t.__breakpoints,i={};for(const a in e){let s=po(e[a],t);if(s==null)continue;if(s=_r(s)&&n(s)?r(s):s,!Array.isArray(s)){i[a]=s;continue}const l=s.slice(0,o.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!Tj(t),Rj=(e,t)=>{var n,r;if(t==null)return t;const o=l=>{var u,c;return(c=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:c.varRef},i=l=>{var u;return(u=o(l))!=null?u:l},[a,s]=Pj(t);return t=(r=(n=o(a))!=null?n:i(s))!=null?r:i(t),t};function kj(e){const{configs:t={},pseudos:n={},theme:r}=e,o=(i,a=!1)=>{var s,l,u;const c=po(i,r),f=Aj(c)(r);let d={};for(let h in f){const p=f[h];let m=po(p,r);h in n&&(h=n[h]),Ij(h,m)&&(m=Rj(r,m));let _=t[h];if(_===!0&&(_={property:h}),_r(m)){d[h]=(s=d[h])!=null?s:{},d[h]=mo({},d[h],o(m,!0));continue}let b=(u=(l=_==null?void 0:_.transform)==null?void 0:l.call(_,m,r,c))!=null?u:m;b=_!=null&&_.processResult?o(b,!0):b;const g=po(_==null?void 0:_.property,r);if(!a&&(_!=null&&_.static)){const E=po(_.static,r);d=mo({},d,E)}if(g&&Array.isArray(g)){for(const E of g)d[E]=b;continue}if(g){g==="&"&&_r(b)?d=mo({},d,b):d[g]=b;continue}if(_r(b)){d=mo({},d,b);continue}d[h]=b}return d};return o}var EP=e=>t=>kj({theme:t,pseudos:Z0,configs:Hb})(e);function wt(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function Mj(e,t){if(Array.isArray(e))return e;if(_r(e))return t(e);if(e!=null)return[e]}function Dj(e,t){for(let n=t+1;n{mo(u,{[E]:d?g[E]:{[b]:g[E]}})});continue}if(!h){d?mo(u,g):u[b]=g;continue}u[b]=g}}return u}}function Nj(e){return t=>{var n;const{variant:r,size:o,theme:i}=t,a=Lj(i);return mo({},po((n=e.baseStyle)!=null?n:{},t),a(e,"sizes",o,t),a(e,"variants",r,t))}}function Bj(e,t,n){var r,o,i;return(i=(o=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:o.varRef)!=null?i:n}function Rt(e){return dj(e,["styleConfig","size","variant","colorScheme"])}var jj=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function Fj(e){return _r(e)?jj.every(t=>Object.prototype.hasOwnProperty.call(e,t)):!1}var $j={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},zj={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},Uj={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Vj={property:$j,easing:zj,duration:Uj},Hj=Vj,Wj={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Gj=Wj,Kj={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Xj=Kj,qj={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Yj=qj,Zj={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},Qj=Zj,Jj={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},eF=Jj,tF={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},nF=tF,rF={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},oF=rF,iF={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},CP=iF,xP={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},aF={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},sF={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},lF={...xP,...aF,container:sF},OP=lF,uF={breakpoints:Yj,zIndices:Gj,radii:eF,blur:oF,colors:Qj,...CP,sizes:OP,shadows:nF,space:xP,borders:Xj,transition:Hj},{defineMultiStyleConfig:cF,definePartsStyle:bc}=wt(["stepper","step","title","description","indicator","separator","icon","number"]),Si=Ee("stepper-indicator-size"),Tl=Ee("stepper-icon-size"),Il=Ee("stepper-title-font-size"),Sc=Ee("stepper-description-font-size"),oc=Ee("stepper-accent-color"),fF=bc(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[oc.variable]:`colors.${e}.500`,_dark:{[oc.variable]:`colors.${e}.200`}},title:{fontSize:Il.reference,fontWeight:"medium"},description:{fontSize:Sc.reference,color:"chakra-subtle-text"},number:{fontSize:Il.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:Tl.reference,height:Tl.reference},indicator:{flexShrink:0,borderRadius:"full",width:Si.reference,height:Si.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:oc.reference},"&[data-status=complete]":{bg:oc.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:oc.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${Si.reference} - 8px)`,top:`calc(${Si.reference} + 4px)`,insetStart:`calc(${Si.reference} / 2 - 1px)`}}})),dF=cF({baseStyle:fF,sizes:{xs:bc({stepper:{[Si.variable]:"sizes.4",[Tl.variable]:"sizes.3",[Il.variable]:"fontSizes.xs",[Sc.variable]:"fontSizes.xs"}}),sm:bc({stepper:{[Si.variable]:"sizes.6",[Tl.variable]:"sizes.4",[Il.variable]:"fontSizes.sm",[Sc.variable]:"fontSizes.xs"}}),md:bc({stepper:{[Si.variable]:"sizes.8",[Tl.variable]:"sizes.5",[Il.variable]:"fontSizes.md",[Sc.variable]:"fontSizes.sm"}}),lg:bc({stepper:{[Si.variable]:"sizes.10",[Tl.variable]:"sizes.6",[Il.variable]:"fontSizes.lg",[Sc.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function it(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function o(...c){r();for(const f of c)t[f]=l(f);return it(e,t)}function i(...c){for(const f of c)f in t||(t[f]=l(f));return it(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([f,d])=>[f,d.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([f,d])=>[f,d.className]))}function l(c){const h=`chakra-${(["container","root"].includes(c??"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:h,selector:`.${h}`,toString:()=>c}}return{parts:o,toPart:l,extend:i,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var hF=it("accordion").parts("root","container","button","panel").extend("icon"),pF=it("alert").parts("title","description","container").extend("icon","spinner"),mF=it("avatar").parts("label","badge","container").extend("excessLabel","group"),yF=it("breadcrumb").parts("link","item","container").extend("separator");it("button").parts();var gF=it("checkbox").parts("control","icon","container").extend("label");it("progress").parts("track","filledTrack").extend("label");var vF=it("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),wF=it("editable").parts("preview","input","textarea"),bF=it("form").parts("container","requiredIndicator","helperText"),SF=it("formError").parts("text","icon"),_F=it("input").parts("addon","field","element","group"),EF=it("list").parts("container","item","icon"),CF=it("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),xF=it("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),OF=it("numberinput").parts("root","field","stepperGroup","stepper");it("pininput").parts("field");var AF=it("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),PF=it("progress").parts("label","filledTrack","track"),TF=it("radio").parts("container","control","label"),IF=it("select").parts("field","icon"),RF=it("slider").parts("container","track","thumb","filledTrack","mark"),kF=it("stat").parts("container","label","helpText","number","icon"),MF=it("switch").parts("container","track","thumb"),DF=it("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),LF=it("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),NF=it("tag").parts("container","label","closeButton"),BF=it("card").parts("container","header","body","footer");function ps(e,t,n){return Math.min(Math.max(e,n),t)}class jF extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var _c=jF;function Wb(e){if(typeof e!="string")throw new _c(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=GF.test(e)?zF(e):e;const n=UF.exec(t);if(n){const a=Array.from(n).slice(1);return[...a.slice(0,3).map(s=>parseInt(Af(s,2),16)),parseInt(Af(a[3]||"f",2),16)/255]}const r=VF.exec(t);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,16)),parseInt(a[3]||"ff",16)/255]}const o=HF.exec(t);if(o){const a=Array.from(o).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,10)),parseFloat(a[3]||"1")]}const i=WF.exec(t);if(i){const[a,s,l,u]=Array.from(i).slice(1).map(parseFloat);if(ps(0,100,s)!==s)throw new _c(e);if(ps(0,100,l)!==l)throw new _c(e);return[...KF(a,s,l),Number.isNaN(u)?1:u]}throw new _c(e)}function FF(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const TC=e=>parseInt(e.replace(/_/g,""),36),$F="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=TC(t.substring(0,3)),r=TC(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function zF(e){const t=e.toLowerCase().trim(),n=$F[FF(t)];if(!n)throw new _c(e);return`#${n}`}const Af=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),UF=new RegExp(`^#${Af("([a-f0-9])",3)}([a-f0-9])?$`,"i"),VF=new RegExp(`^#${Af("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),HF=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Af(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),WF=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,GF=/^[a-z]+$/i,IC=e=>Math.round(e*255),KF=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(IC);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),a=i*(1-Math.abs(o%2-1));let s=0,l=0,u=0;o>=0&&o<1?(s=i,l=a):o>=1&&o<2?(s=a,l=i):o>=2&&o<3?(l=i,u=a):o>=3&&o<4?(l=a,u=i):o>=4&&o<5?(s=a,u=i):o>=5&&o<6&&(s=i,u=a);const c=r-i/2,f=s+c,d=l+c,h=u+c;return[f,d,h].map(IC)};function XF(e,t,n,r){return`rgba(${ps(0,255,e).toFixed()}, ${ps(0,255,t).toFixed()}, ${ps(0,255,n).toFixed()}, ${parseFloat(ps(0,1,r).toFixed(3))})`}function qF(e,t){const[n,r,o,i]=Wb(e);return XF(n,r,o,i-t)}function YF(e){const[t,n,r,o]=Wb(e);let i=a=>{const s=ps(0,255,a).toString(16);return s.length===1?`0${s}`:s};return`#${i(t)}${i(n)}${i(r)}${o<1?i(Math.round(o*255)):""}`}function ZF(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,nr=(e,t,n)=>{const r=ZF(e,`colors.${t}`,t);try{return YF(r),r}catch{return n??"#000000"}},JF=e=>{const[t,n,r]=Wb(e);return(t*299+n*587+r*114)/1e3},e$=e=>t=>{const n=nr(t,e);return JF(n)<128?"dark":"light"},t$=e=>t=>e$(e)(t)==="dark",gu=(e,t)=>n=>{const r=nr(n,e);return qF(r,1-t)};function RC(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + `;return`!${i?a:s}`.trim()}function RB(e={}){const{nonce:t}=e;return w.jsx("script",{id:"chakra-script",nonce:t,dangerouslySetInnerHTML:{__html:IB(e)}})}function kP(){const e=rm(),t=od();return{...e,theme:t}}function kB(e,t,n){var r,o;if(t==null)return t;const i=a=>{var s,l;return(l=(s=e.__breakpoints)==null?void 0:s.asArray)==null?void 0:l[a]};return(o=(r=i(t))!=null?r:i(n))!=null?o:n}function MB(e,t,n){var r,o;if(t==null)return t;const i=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.value};return(o=(r=i(t))!=null?r:i(n))!=null?o:n}function DB(e,t,n){const r=od();return LB(e,t,n)(r)}function LB(e,t,n){const r=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n];return i=>{const a=o.filter(Boolean),s=r.map((l,u)=>{var c,f;if(e==="breakpoints")return kB(i,l,(c=a[u])!=null?c:l);const d=`${e}.${l}`;return MB(i,d,(f=a[u])!=null?f:l)});return Array.isArray(t)?s:s[0]}}var _e=(...e)=>e.filter(Boolean).join(" ");function _r(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function mo(e,...t){return NB(e)?e(...t):e}var NB=e=>typeof e=="function",Re=e=>e?"":void 0,Jl=e=>e?!0:void 0;function ke(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function om(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var Up={exports:{}};Up.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",S="[object Number]",b="[object Null]",g="[object Object]",E="[object Proxy]",T="[object RegExp]",O="[object Set]",A="[object String]",C="[object Undefined]",y="[object WeakMap]",_="[object ArrayBuffer]",v="[object DataView]",x="[object Float32Array]",I="[object Float64Array]",R="[object Int8Array]",k="[object Int16Array]",M="[object Int32Array]",N="[object Uint8Array]",D="[object Uint8ClampedArray]",L="[object Uint16Array]",j="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,B=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,K={};K[x]=K[I]=K[R]=K[k]=K[M]=K[N]=K[D]=K[L]=K[j]=!0,K[s]=K[l]=K[_]=K[c]=K[v]=K[f]=K[d]=K[h]=K[m]=K[S]=K[g]=K[T]=K[O]=K[A]=K[y]=!1;var W=typeof ho=="object"&&ho&&ho.Object===Object&&ho,Q=typeof self=="object"&&self&&self.Object===Object&&self,X=W||Q||Function("return this")(),J=t&&!t.nodeType&&t,te=J&&!0&&e&&!e.nodeType&&e,le=te&&te.exports===J,ge=le&&W.process,se=function(){try{var z=te&&te.require&&te.require("util").types;return z||ge&&ge.binding&&ge.binding("util")}catch{}}(),ue=se&&se.isTypedArray;function Ie(z,U,q){switch(q.length){case 0:return z.call(U);case 1:return z.call(U,q[0]);case 2:return z.call(U,q[0],q[1]);case 3:return z.call(U,q[0],q[1],q[2])}return z.apply(U,q)}function gt(z,U){for(var q=-1,he=Array(z);++q-1}function nM(z,U){var q=this.__data__,he=Nd(q,z);return he<0?(++this.size,q.push([z,U])):q[he][1]=U,this}gi.prototype.clear=Q9,gi.prototype.delete=J9,gi.prototype.get=eM,gi.prototype.has=tM,gi.prototype.set=nM;function ol(z){var U=-1,q=z==null?0:z.length;for(this.clear();++U1?q[Ge-1]:void 0,Ct=Ge>2?q[2]:void 0;for(pt=z.length>3&&typeof pt=="function"?(Ge--,pt):void 0,Ct&&RM(q[0],q[1],Ct)&&(pt=Ge<3?void 0:pt,Ge=1),U=Object(U);++he-1&&z%1==0&&z0){if(++U>=o)return arguments[0]}else U=0;return z.apply(void 0,arguments)}}function FM(z){if(z!=null){try{return xn.call(z)}catch{}try{return z+""}catch{}}return""}function Fd(z,U){return z===U||z!==z&&U!==U}var ty=tE(function(){return arguments}())?tE:function(z){return Xu(z)&&Vt.call(z,"callee")&&!V9.call(z,"callee")},ny=Array.isArray;function ry(z){return z!=null&&aE(z.length)&&!oy(z)}function $M(z){return Xu(z)&&ry(z)}var iE=H9||WM;function oy(z){if(!Za(z))return!1;var U=Bd(z);return U==h||U==p||U==u||U==E}function aE(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=a}function Za(z){var U=typeof z;return z!=null&&(U=="object"||U=="function")}function Xu(z){return z!=null&&typeof z=="object"}function zM(z){if(!Xu(z)||Bd(z)!=g)return!1;var U=Z_(z);if(U===null)return!0;var q=Vt.call(U,"constructor")&&U.constructor;return typeof q=="function"&&q instanceof q&&xn.call(q)==Ka}var sE=ue?ie(ue):gM;function VM(z){return OM(z,lE(z))}function lE(z){return ry(z)?hM(z,!0):vM(z)}var UM=AM(function(z,U,q,he){nE(z,U,q,he)});function HM(z){return function(){return z}}function uE(z){return z}function WM(){return!1}e.exports=UM})(Up,Up.exports);var BB=Up.exports;const yo=Fe(BB);var jB=e=>/!(important)?$/.test(e),TC=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,FB=(e,t)=>n=>{const r=String(t),o=jB(r),i=TC(r),a=e?`${e}.${i}`:i;let s=_r(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=TC(s),o?`${s} !important`:s};function eS(e){const{scale:t,transform:n,compose:r}=e;return(i,a)=>{var s;const l=FB(t,i)(a);let u=(s=n==null?void 0:n(l,a))!=null?s:l;return r&&(u=r(u,a)),u}}var ih=(...e)=>t=>e.reduce((n,r)=>r(n),t);function ro(e,t){return n=>{const r={property:n,scale:e};return r.transform=eS({scale:e,transform:t}),r}}var $B=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function zB(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:$B(t),transform:n?eS({scale:n,compose:r}):r}}var MP=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function VB(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...MP].join(" ")}function UB(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...MP].join(" ")}var HB={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},WB={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function GB(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var KB={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},p2={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},XB=new Set(Object.values(p2)),m2=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),qB=e=>e.trim();function YB(e,t){if(e==null||m2.has(e))return e;if(!(y2(e)||m2.has(e)))return`url('${e}')`;const o=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=o==null?void 0:o[1],a=o==null?void 0:o[2];if(!i||!a)return e;const s=i.includes("-gradient")?i:`${i}-gradient`,[l,...u]=a.split(",").map(qB).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in p2?p2[l]:l;u.unshift(c);const f=u.map(d=>{if(XB.has(d))return d;const h=d.indexOf(" "),[p,m]=h!==-1?[d.substr(0,h),d.substr(h+1)]:[d],S=y2(m)?m:m&&m.split(" "),b=`colors.${p}`,g=b in t.__cssMap?t.__cssMap[b].varRef:p;return S?[g,...Array.isArray(S)?S:[S]].join(" "):g});return`${s}(${f.join(", ")})`}var y2=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),ZB=(e,t)=>YB(e,t??{});function QB(e){return/^var\(--.+\)$/.test(e)}var JB=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Ko=e=>t=>`${e}(${t})`,Ze={filter(e){return e!=="auto"?e:HB},backdropFilter(e){return e!=="auto"?e:WB},ring(e){return GB(Ze.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?VB():e==="auto-gpu"?UB():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=JB(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(QB(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:ZB,blur:Ko("blur"),opacity:Ko("opacity"),brightness:Ko("brightness"),contrast:Ko("contrast"),dropShadow:Ko("drop-shadow"),grayscale:Ko("grayscale"),hueRotate:Ko("hue-rotate"),invert:Ko("invert"),saturate:Ko("saturate"),sepia:Ko("sepia"),bgImage(e){return e==null||y2(e)||m2.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=KB[e])!=null?t:{},o={flexDirection:e};return n&&(o[n]=1),r&&(o[r]=1),o}},H={borderWidths:ro("borderWidths"),borderStyles:ro("borderStyles"),colors:ro("colors"),borders:ro("borders"),gradients:ro("gradients",Ze.gradient),radii:ro("radii",Ze.px),space:ro("space",ih(Ze.vh,Ze.px)),spaceT:ro("space",ih(Ze.vh,Ze.px)),degreeT(e){return{property:e,transform:Ze.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:eS({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:ro("sizes",ih(Ze.vh,Ze.px)),sizesT:ro("sizes",ih(Ze.vh,Ze.fraction)),shadows:ro("shadows"),logical:zB,blur:ro("blur",Ze.blur)},Xh={background:H.colors("background"),backgroundColor:H.colors("backgroundColor"),backgroundImage:H.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Ze.bgClip},bgSize:H.prop("backgroundSize"),bgPosition:H.prop("backgroundPosition"),bg:H.colors("background"),bgColor:H.colors("backgroundColor"),bgPos:H.prop("backgroundPosition"),bgRepeat:H.prop("backgroundRepeat"),bgAttachment:H.prop("backgroundAttachment"),bgGradient:H.gradients("backgroundImage"),bgClip:{transform:Ze.bgClip}};Object.assign(Xh,{bgImage:Xh.backgroundImage,bgImg:Xh.backgroundImage});var et={border:H.borders("border"),borderWidth:H.borderWidths("borderWidth"),borderStyle:H.borderStyles("borderStyle"),borderColor:H.colors("borderColor"),borderRadius:H.radii("borderRadius"),borderTop:H.borders("borderTop"),borderBlockStart:H.borders("borderBlockStart"),borderTopLeftRadius:H.radii("borderTopLeftRadius"),borderStartStartRadius:H.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:H.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:H.radii("borderTopRightRadius"),borderStartEndRadius:H.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:H.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:H.borders("borderRight"),borderInlineEnd:H.borders("borderInlineEnd"),borderBottom:H.borders("borderBottom"),borderBlockEnd:H.borders("borderBlockEnd"),borderBottomLeftRadius:H.radii("borderBottomLeftRadius"),borderBottomRightRadius:H.radii("borderBottomRightRadius"),borderLeft:H.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:H.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:H.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:H.borders(["borderLeft","borderRight"]),borderInline:H.borders("borderInline"),borderY:H.borders(["borderTop","borderBottom"]),borderBlock:H.borders("borderBlock"),borderTopWidth:H.borderWidths("borderTopWidth"),borderBlockStartWidth:H.borderWidths("borderBlockStartWidth"),borderTopColor:H.colors("borderTopColor"),borderBlockStartColor:H.colors("borderBlockStartColor"),borderTopStyle:H.borderStyles("borderTopStyle"),borderBlockStartStyle:H.borderStyles("borderBlockStartStyle"),borderBottomWidth:H.borderWidths("borderBottomWidth"),borderBlockEndWidth:H.borderWidths("borderBlockEndWidth"),borderBottomColor:H.colors("borderBottomColor"),borderBlockEndColor:H.colors("borderBlockEndColor"),borderBottomStyle:H.borderStyles("borderBottomStyle"),borderBlockEndStyle:H.borderStyles("borderBlockEndStyle"),borderLeftWidth:H.borderWidths("borderLeftWidth"),borderInlineStartWidth:H.borderWidths("borderInlineStartWidth"),borderLeftColor:H.colors("borderLeftColor"),borderInlineStartColor:H.colors("borderInlineStartColor"),borderLeftStyle:H.borderStyles("borderLeftStyle"),borderInlineStartStyle:H.borderStyles("borderInlineStartStyle"),borderRightWidth:H.borderWidths("borderRightWidth"),borderInlineEndWidth:H.borderWidths("borderInlineEndWidth"),borderRightColor:H.colors("borderRightColor"),borderInlineEndColor:H.colors("borderInlineEndColor"),borderRightStyle:H.borderStyles("borderRightStyle"),borderInlineEndStyle:H.borderStyles("borderInlineEndStyle"),borderTopRadius:H.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:H.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:H.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:H.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(et,{rounded:et.borderRadius,roundedTop:et.borderTopRadius,roundedTopLeft:et.borderTopLeftRadius,roundedTopRight:et.borderTopRightRadius,roundedTopStart:et.borderStartStartRadius,roundedTopEnd:et.borderStartEndRadius,roundedBottom:et.borderBottomRadius,roundedBottomLeft:et.borderBottomLeftRadius,roundedBottomRight:et.borderBottomRightRadius,roundedBottomStart:et.borderEndStartRadius,roundedBottomEnd:et.borderEndEndRadius,roundedLeft:et.borderLeftRadius,roundedRight:et.borderRightRadius,roundedStart:et.borderInlineStartRadius,roundedEnd:et.borderInlineEndRadius,borderStart:et.borderInlineStart,borderEnd:et.borderInlineEnd,borderTopStartRadius:et.borderStartStartRadius,borderTopEndRadius:et.borderStartEndRadius,borderBottomStartRadius:et.borderEndStartRadius,borderBottomEndRadius:et.borderEndEndRadius,borderStartRadius:et.borderInlineStartRadius,borderEndRadius:et.borderInlineEndRadius,borderStartWidth:et.borderInlineStartWidth,borderEndWidth:et.borderInlineEndWidth,borderStartColor:et.borderInlineStartColor,borderEndColor:et.borderInlineEndColor,borderStartStyle:et.borderInlineStartStyle,borderEndStyle:et.borderInlineEndStyle});var ej={color:H.colors("color"),textColor:H.colors("color"),fill:H.colors("fill"),stroke:H.colors("stroke")},g2={boxShadow:H.shadows("boxShadow"),mixBlendMode:!0,blendMode:H.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:H.prop("backgroundBlendMode"),opacity:!0};Object.assign(g2,{shadow:g2.boxShadow});var tj={filter:{transform:Ze.filter},blur:H.blur("--chakra-blur"),brightness:H.propT("--chakra-brightness",Ze.brightness),contrast:H.propT("--chakra-contrast",Ze.contrast),hueRotate:H.degreeT("--chakra-hue-rotate"),invert:H.propT("--chakra-invert",Ze.invert),saturate:H.propT("--chakra-saturate",Ze.saturate),dropShadow:H.propT("--chakra-drop-shadow",Ze.dropShadow),backdropFilter:{transform:Ze.backdropFilter},backdropBlur:H.blur("--chakra-backdrop-blur"),backdropBrightness:H.propT("--chakra-backdrop-brightness",Ze.brightness),backdropContrast:H.propT("--chakra-backdrop-contrast",Ze.contrast),backdropHueRotate:H.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:H.propT("--chakra-backdrop-invert",Ze.invert),backdropSaturate:H.propT("--chakra-backdrop-saturate",Ze.saturate)},Hp={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Ze.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:H.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:H.space("gap"),rowGap:H.space("rowGap"),columnGap:H.space("columnGap")};Object.assign(Hp,{flexDir:Hp.flexDirection});var DP={gridGap:H.space("gridGap"),gridColumnGap:H.space("gridColumnGap"),gridRowGap:H.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},nj={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Ze.outline},outlineOffset:!0,outlineColor:H.colors("outlineColor")},so={width:H.sizesT("width"),inlineSize:H.sizesT("inlineSize"),height:H.sizes("height"),blockSize:H.sizes("blockSize"),boxSize:H.sizes(["width","height"]),minWidth:H.sizes("minWidth"),minInlineSize:H.sizes("minInlineSize"),minHeight:H.sizes("minHeight"),minBlockSize:H.sizes("minBlockSize"),maxWidth:H.sizes("maxWidth"),maxInlineSize:H.sizes("maxInlineSize"),maxHeight:H.sizes("maxHeight"),maxBlockSize:H.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (min-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?o:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,o;return{[`@media screen and (max-width: ${(o=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?o:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:H.propT("float",Ze.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(so,{w:so.width,h:so.height,minW:so.minWidth,maxW:so.maxWidth,minH:so.minHeight,maxH:so.maxHeight,overscroll:so.overscrollBehavior,overscrollX:so.overscrollBehaviorX,overscrollY:so.overscrollBehaviorY});var rj={listStyleType:!0,listStylePosition:!0,listStylePos:H.prop("listStylePosition"),listStyleImage:!0,listStyleImg:H.prop("listStyleImage")};function oj(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,a)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(o))return s.get(o);const l=e(r,o,i,a);return s.set(o,l),l}},aj=ij(oj),sj={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},lj={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Dy=(e,t,n)=>{const r={},o=aj(e,t,{});for(const i in o)i in n&&n[i]!=null||(r[i]=o[i]);return r},uj={srOnly:{transform(e){return e===!0?sj:e==="focusable"?lj:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Dy(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Dy(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Dy(t,e,n)}},zc={position:!0,pos:H.prop("position"),zIndex:H.prop("zIndex","zIndices"),inset:H.spaceT("inset"),insetX:H.spaceT(["left","right"]),insetInline:H.spaceT("insetInline"),insetY:H.spaceT(["top","bottom"]),insetBlock:H.spaceT("insetBlock"),top:H.spaceT("top"),insetBlockStart:H.spaceT("insetBlockStart"),bottom:H.spaceT("bottom"),insetBlockEnd:H.spaceT("insetBlockEnd"),left:H.spaceT("left"),insetInlineStart:H.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:H.spaceT("right"),insetInlineEnd:H.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(zc,{insetStart:zc.insetInlineStart,insetEnd:zc.insetInlineEnd});var cj={ring:{transform:Ze.ring},ringColor:H.colors("--chakra-ring-color"),ringOffset:H.prop("--chakra-ring-offset-width"),ringOffsetColor:H.colors("--chakra-ring-offset-color"),ringInset:H.prop("--chakra-ring-inset")},St={margin:H.spaceT("margin"),marginTop:H.spaceT("marginTop"),marginBlockStart:H.spaceT("marginBlockStart"),marginRight:H.spaceT("marginRight"),marginInlineEnd:H.spaceT("marginInlineEnd"),marginBottom:H.spaceT("marginBottom"),marginBlockEnd:H.spaceT("marginBlockEnd"),marginLeft:H.spaceT("marginLeft"),marginInlineStart:H.spaceT("marginInlineStart"),marginX:H.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:H.spaceT("marginInline"),marginY:H.spaceT(["marginTop","marginBottom"]),marginBlock:H.spaceT("marginBlock"),padding:H.space("padding"),paddingTop:H.space("paddingTop"),paddingBlockStart:H.space("paddingBlockStart"),paddingRight:H.space("paddingRight"),paddingBottom:H.space("paddingBottom"),paddingBlockEnd:H.space("paddingBlockEnd"),paddingLeft:H.space("paddingLeft"),paddingInlineStart:H.space("paddingInlineStart"),paddingInlineEnd:H.space("paddingInlineEnd"),paddingX:H.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:H.space("paddingInline"),paddingY:H.space(["paddingTop","paddingBottom"]),paddingBlock:H.space("paddingBlock")};Object.assign(St,{m:St.margin,mt:St.marginTop,mr:St.marginRight,me:St.marginInlineEnd,marginEnd:St.marginInlineEnd,mb:St.marginBottom,ml:St.marginLeft,ms:St.marginInlineStart,marginStart:St.marginInlineStart,mx:St.marginX,my:St.marginY,p:St.padding,pt:St.paddingTop,py:St.paddingY,px:St.paddingX,pb:St.paddingBottom,pl:St.paddingLeft,ps:St.paddingInlineStart,paddingStart:St.paddingInlineStart,pr:St.paddingRight,pe:St.paddingInlineEnd,paddingEnd:St.paddingInlineEnd});var fj={textDecorationColor:H.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:H.shadows("textShadow")},dj={clipPath:!0,transform:H.propT("transform",Ze.transform),transformOrigin:!0,translateX:H.spaceT("--chakra-translate-x"),translateY:H.spaceT("--chakra-translate-y"),skewX:H.degreeT("--chakra-skew-x"),skewY:H.degreeT("--chakra-skew-y"),scaleX:H.prop("--chakra-scale-x"),scaleY:H.prop("--chakra-scale-y"),scale:H.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:H.degreeT("--chakra-rotate")},hj={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:H.prop("transitionDuration","transition.duration"),transitionProperty:H.prop("transitionProperty","transition.property"),transitionTimingFunction:H.prop("transitionTimingFunction","transition.easing")},pj={fontFamily:H.prop("fontFamily","fonts"),fontSize:H.prop("fontSize","fontSizes",Ze.px),fontWeight:H.prop("fontWeight","fontWeights"),lineHeight:H.prop("lineHeight","lineHeights"),letterSpacing:H.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},mj={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:H.spaceT("scrollMargin"),scrollMarginTop:H.spaceT("scrollMarginTop"),scrollMarginBottom:H.spaceT("scrollMarginBottom"),scrollMarginLeft:H.spaceT("scrollMarginLeft"),scrollMarginRight:H.spaceT("scrollMarginRight"),scrollMarginX:H.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:H.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:H.spaceT("scrollPadding"),scrollPaddingTop:H.spaceT("scrollPaddingTop"),scrollPaddingBottom:H.spaceT("scrollPaddingBottom"),scrollPaddingLeft:H.spaceT("scrollPaddingLeft"),scrollPaddingRight:H.spaceT("scrollPaddingRight"),scrollPaddingX:H.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:H.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function LP(e){return _r(e)&&e.reference?e.reference:String(e)}var im=(e,...t)=>t.map(LP).join(` ${e} `).replace(/calc/g,""),IC=(...e)=>`calc(${im("+",...e)})`,RC=(...e)=>`calc(${im("-",...e)})`,v2=(...e)=>`calc(${im("*",...e)})`,kC=(...e)=>`calc(${im("/",...e)})`,MC=e=>{const t=LP(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:v2(t,-1)},ls=Object.assign(e=>({add:(...t)=>ls(IC(e,...t)),subtract:(...t)=>ls(RC(e,...t)),multiply:(...t)=>ls(v2(e,...t)),divide:(...t)=>ls(kC(e,...t)),negate:()=>ls(MC(e)),toString:()=>e.toString()}),{add:IC,subtract:RC,multiply:v2,divide:kC,negate:MC});function yj(e,t="-"){return e.replace(/\s+/g,t)}function gj(e){const t=yj(e.toString());return wj(vj(t))}function vj(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function wj(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function bj(e,t=""){return[t,e].filter(Boolean).join("-")}function Sj(e,t){return`var(${e}${t?`, ${t}`:""})`}function _j(e,t=""){return gj(`--${bj(e,t)}`)}function Ee(e,t,n){const r=_j(e,n);return{variable:r,reference:Sj(r,t)}}function Ej(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[o,i]=r;n[o]=Ee(`${e}-${o}`,i);continue}n[r]=Ee(`${e}-${r}`)}return n}function Cj(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function xj(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function w2(e){if(e==null)return e;const{unitless:t}=xj(e);return t||typeof e=="number"?`${e}px`:e}var NP=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,tS=e=>Object.fromEntries(Object.entries(e).sort(NP));function DC(e){const t=tS(e);return Object.assign(Object.values(t),t)}function Oj(e){const t=Object.keys(tS(e));return new Set(t)}function LC(e){var t;if(!e)return e;e=(t=w2(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function bc(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${w2(e)})`),t&&n.push("and",`(max-width: ${w2(t)})`),n.join(" ")}function Aj(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=DC(e),r=Object.entries(e).sort(NP).map(([a,s],l,u)=>{var c;let[,f]=(c=u[l+1])!=null?c:[];return f=parseFloat(f)>0?LC(f):void 0,{_minW:LC(s),breakpoint:a,minW:s,maxW:f,maxWQuery:bc(null,f),minWQuery:bc(s),minMaxQuery:bc(s,f)}}),o=Oj(e),i=Array.from(o.values());return{keys:o,normalized:n,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>o.has(l))},asObject:tS(e),asArray:DC(e),details:r,get(a){return r.find(s=>s.breakpoint===a)},media:[null,...n.map(a=>bc(a)).slice(1)],toArrayValue(a){if(!_r(a))throw new Error("toArrayValue: value must be an object");const s=i.map(l=>{var u;return(u=a[l])!=null?u:null});for(;Cj(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const c=i[u];return c!=null&&l!=null&&(s[c]=l),s},{})}}}var On={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},qi=e=>BP(t=>e(t,"&"),"[role=group]","[data-group]",".group"),vi=e=>BP(t=>e(t,"~ &"),"[data-peer]",".peer"),BP=(e,...t)=>t.map(e).join(", "),am={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:qi(On.hover),_peerHover:vi(On.hover),_groupFocus:qi(On.focus),_peerFocus:vi(On.focus),_groupFocusVisible:qi(On.focusVisible),_peerFocusVisible:vi(On.focusVisible),_groupActive:qi(On.active),_peerActive:vi(On.active),_groupDisabled:qi(On.disabled),_peerDisabled:vi(On.disabled),_groupInvalid:qi(On.invalid),_peerInvalid:vi(On.invalid),_groupChecked:qi(On.checked),_peerChecked:vi(On.checked),_groupFocusWithin:qi(On.focusWithin),_peerFocusWithin:vi(On.focusWithin),_peerPlaceholderShown:vi(On.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},jP=Object.keys(am);function NC(e,t){return Ee(String(e).replace(/\./g,"-"),void 0,t)}function Pj(e,t){let n={};const r={};for(const[o,i]of Object.entries(e)){const{isSemantic:a,value:s}=i,{variable:l,reference:u}=NC(o,t==null?void 0:t.cssVarPrefix);if(!a){if(o.startsWith("space")){const d=o.split("."),[h,...p]=d,m=`${h}.-${p.join(".")}`,S=ls.negate(s),b=ls.negate(u);r[m]={value:S,var:l,varRef:b}}n[l]=s,r[o]={value:s,var:l,varRef:u};continue}const c=d=>{const p=[String(o).split(".")[0],d].join(".");if(!e[p])return d;const{reference:S}=NC(p,t==null?void 0:t.cssVarPrefix);return S},f=_r(s)?s:{default:s};n=yo(n,Object.entries(f).reduce((d,[h,p])=>{var m,S;if(!p)return d;const b=c(`${p}`);if(h==="default")return d[l]=b,d;const g=(S=(m=am)==null?void 0:m[h])!=null?S:h;return d[g]={[l]:b},d},{})),r[o]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function Tj(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Ij(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Rj(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function BC(e,t,n={}){const{stop:r,getKey:o}=n;function i(a,s=[]){var l;if(Rj(a)||Array.isArray(a)){const u={};for(const[c,f]of Object.entries(a)){const d=(l=o==null?void 0:o(c))!=null?l:c,h=[...s,d];if(r!=null&&r(a,h))return t(a,s);u[d]=i(f,h)}return u}return t(a,s)}return i(e)}var kj=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function Mj(e){return Ij(e,kj)}function Dj(e){return e.semanticTokens}function Lj(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...o}=e;return o}var Nj=e=>jP.includes(e)||e==="default";function Bj({tokens:e,semanticTokens:t}){const n={};return BC(e,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!1,value:r})}),BC(t,(r,o)=>{r!=null&&(n[o.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(Nj)}),n}function jj(e){var t;const n=Lj(e),r=Mj(n),o=Dj(n),i=Bj({tokens:r,semanticTokens:o}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=Pj(i,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:Aj(n.breakpoints)}),n}var nS=yo({},Xh,et,ej,Hp,so,tj,cj,nj,DP,uj,zc,g2,St,mj,pj,fj,dj,rj,hj),Fj=Object.assign({},St,so,Hp,DP,zc),$j=Object.keys(Fj),zj=[...Object.keys(nS),...jP],Vj={...nS,...am},Uj=e=>e in Vj,Hj=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:o}=t.__breakpoints,i={};for(const a in e){let s=mo(e[a],t);if(s==null)continue;if(s=_r(s)&&n(s)?r(s):s,!Array.isArray(s)){i[a]=s;continue}const l=s.slice(0,o.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!Gj(t),Xj=(e,t)=>{var n,r;if(t==null)return t;const o=l=>{var u,c;return(c=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:c.varRef},i=l=>{var u;return(u=o(l))!=null?u:l},[a,s]=Wj(t);return t=(r=(n=o(a))!=null?n:i(s))!=null?r:i(t),t};function qj(e){const{configs:t={},pseudos:n={},theme:r}=e,o=(i,a=!1)=>{var s,l,u;const c=mo(i,r),f=Hj(c)(r);let d={};for(let h in f){const p=f[h];let m=mo(p,r);h in n&&(h=n[h]),Kj(h,m)&&(m=Xj(r,m));let S=t[h];if(S===!0&&(S={property:h}),_r(m)){d[h]=(s=d[h])!=null?s:{},d[h]=yo({},d[h],o(m,!0));continue}let b=(u=(l=S==null?void 0:S.transform)==null?void 0:l.call(S,m,r,c))!=null?u:m;b=S!=null&&S.processResult?o(b,!0):b;const g=mo(S==null?void 0:S.property,r);if(!a&&(S!=null&&S.static)){const E=mo(S.static,r);d=yo({},d,E)}if(g&&Array.isArray(g)){for(const E of g)d[E]=b;continue}if(g){g==="&"&&_r(b)?d=yo({},d,b):d[g]=b;continue}if(_r(b)){d=yo({},d,b);continue}d[h]=b}return d};return o}var FP=e=>t=>qj({theme:t,pseudos:am,configs:nS})(e);function wt(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function Yj(e,t){if(Array.isArray(e))return e;if(_r(e))return t(e);if(e!=null)return[e]}function Zj(e,t){for(let n=t+1;n{yo(u,{[E]:d?g[E]:{[b]:g[E]}})});continue}if(!h){d?yo(u,g):u[b]=g;continue}u[b]=g}}return u}}function Jj(e){return t=>{var n;const{variant:r,size:o,theme:i}=t,a=Qj(i);return yo({},mo((n=e.baseStyle)!=null?n:{},t),a(e,"sizes",o,t),a(e,"variants",r,t))}}function eF(e,t,n){var r,o,i;return(i=(o=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:o.varRef)!=null?i:n}function Rt(e){return Tj(e,["styleConfig","size","variant","colorScheme"])}var tF=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function nF(e){return _r(e)?tF.every(t=>Object.prototype.hasOwnProperty.call(e,t)):!1}var rF={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},oF={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},iF={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},aF={property:rF,easing:oF,duration:iF},sF=aF,lF={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},uF=lF,cF={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},fF=cF,dF={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},hF=dF,pF={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},mF=pF,yF={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},gF=yF,vF={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},wF=vF,bF={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},SF=bF,_F={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},$P=_F,zP={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},EF={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},CF={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},xF={...zP,...EF,container:CF},VP=xF,OF={breakpoints:hF,zIndices:uF,radii:gF,blur:SF,colors:mF,...$P,sizes:VP,shadows:wF,space:zP,borders:fF,transition:sF},{defineMultiStyleConfig:AF,definePartsStyle:Sc}=wt(["stepper","step","title","description","indicator","separator","icon","number"]),_i=Ee("stepper-indicator-size"),Rl=Ee("stepper-icon-size"),kl=Ee("stepper-title-font-size"),_c=Ee("stepper-description-font-size"),ic=Ee("stepper-accent-color"),PF=Sc(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[ic.variable]:`colors.${e}.500`,_dark:{[ic.variable]:`colors.${e}.200`}},title:{fontSize:kl.reference,fontWeight:"medium"},description:{fontSize:_c.reference,color:"chakra-subtle-text"},number:{fontSize:kl.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:Rl.reference,height:Rl.reference},indicator:{flexShrink:0,borderRadius:"full",width:_i.reference,height:_i.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:ic.reference},"&[data-status=complete]":{bg:ic.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:ic.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${_i.reference} - 8px)`,top:`calc(${_i.reference} + 4px)`,insetStart:`calc(${_i.reference} / 2 - 1px)`}}})),TF=AF({baseStyle:PF,sizes:{xs:Sc({stepper:{[_i.variable]:"sizes.4",[Rl.variable]:"sizes.3",[kl.variable]:"fontSizes.xs",[_c.variable]:"fontSizes.xs"}}),sm:Sc({stepper:{[_i.variable]:"sizes.6",[Rl.variable]:"sizes.4",[kl.variable]:"fontSizes.sm",[_c.variable]:"fontSizes.xs"}}),md:Sc({stepper:{[_i.variable]:"sizes.8",[Rl.variable]:"sizes.5",[kl.variable]:"fontSizes.md",[_c.variable]:"fontSizes.sm"}}),lg:Sc({stepper:{[_i.variable]:"sizes.10",[Rl.variable]:"sizes.6",[kl.variable]:"fontSizes.lg",[_c.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function it(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function o(...c){r();for(const f of c)t[f]=l(f);return it(e,t)}function i(...c){for(const f of c)f in t||(t[f]=l(f));return it(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([f,d])=>[f,d.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([f,d])=>[f,d.className]))}function l(c){const h=`chakra-${(["container","root"].includes(c??"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:h,selector:`.${h}`,toString:()=>c}}return{parts:o,toPart:l,extend:i,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var IF=it("accordion").parts("root","container","button","panel").extend("icon"),RF=it("alert").parts("title","description","container").extend("icon","spinner"),kF=it("avatar").parts("label","badge","container").extend("excessLabel","group"),MF=it("breadcrumb").parts("link","item","container").extend("separator");it("button").parts();var DF=it("checkbox").parts("control","icon","container").extend("label");it("progress").parts("track","filledTrack").extend("label");var LF=it("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),NF=it("editable").parts("preview","input","textarea"),BF=it("form").parts("container","requiredIndicator","helperText"),jF=it("formError").parts("text","icon"),FF=it("input").parts("addon","field","element","group"),$F=it("list").parts("container","item","icon"),zF=it("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),VF=it("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),UF=it("numberinput").parts("root","field","stepperGroup","stepper");it("pininput").parts("field");var HF=it("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),WF=it("progress").parts("label","filledTrack","track"),GF=it("radio").parts("container","control","label"),KF=it("select").parts("field","icon"),XF=it("slider").parts("container","track","thumb","filledTrack","mark"),qF=it("stat").parts("container","label","helpText","number","icon"),YF=it("switch").parts("container","track","thumb"),ZF=it("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),QF=it("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),JF=it("tag").parts("container","label","closeButton"),e$=it("card").parts("container","header","body","footer");function gs(e,t,n){return Math.min(Math.max(e,n),t)}class t$ extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Ec=t$;function rS(e){if(typeof e!="string")throw new Ec(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=u$.test(e)?o$(e):e;const n=i$.exec(t);if(n){const a=Array.from(n).slice(1);return[...a.slice(0,3).map(s=>parseInt(Pf(s,2),16)),parseInt(Pf(a[3]||"f",2),16)/255]}const r=a$.exec(t);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,16)),parseInt(a[3]||"ff",16)/255]}const o=s$.exec(t);if(o){const a=Array.from(o).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,10)),parseFloat(a[3]||"1")]}const i=l$.exec(t);if(i){const[a,s,l,u]=Array.from(i).slice(1).map(parseFloat);if(gs(0,100,s)!==s)throw new Ec(e);if(gs(0,100,l)!==l)throw new Ec(e);return[...c$(a,s,l),Number.isNaN(u)?1:u]}throw new Ec(e)}function n$(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const jC=e=>parseInt(e.replace(/_/g,""),36),r$="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=jC(t.substring(0,3)),r=jC(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function o$(e){const t=e.toLowerCase().trim(),n=r$[n$(t)];if(!n)throw new Ec(e);return`#${n}`}const Pf=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),i$=new RegExp(`^#${Pf("([a-f0-9])",3)}([a-f0-9])?$`,"i"),a$=new RegExp(`^#${Pf("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),s$=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Pf(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),l$=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,u$=/^[a-z]+$/i,FC=e=>Math.round(e*255),c$=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(FC);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),a=i*(1-Math.abs(o%2-1));let s=0,l=0,u=0;o>=0&&o<1?(s=i,l=a):o>=1&&o<2?(s=a,l=i):o>=2&&o<3?(l=i,u=a):o>=3&&o<4?(l=a,u=i):o>=4&&o<5?(s=a,u=i):o>=5&&o<6&&(s=i,u=a);const c=r-i/2,f=s+c,d=l+c,h=u+c;return[f,d,h].map(FC)};function f$(e,t,n,r){return`rgba(${gs(0,255,e).toFixed()}, ${gs(0,255,t).toFixed()}, ${gs(0,255,n).toFixed()}, ${parseFloat(gs(0,1,r).toFixed(3))})`}function d$(e,t){const[n,r,o,i]=rS(e);return f$(n,r,o,i-t)}function h$(e){const[t,n,r,o]=rS(e);let i=a=>{const s=gs(0,255,a).toString(16);return s.length===1?`0${s}`:s};return`#${i(t)}${i(n)}${i(r)}${o<1?i(Math.round(o*255)):""}`}function p$(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,nr=(e,t,n)=>{const r=p$(e,`colors.${t}`,t);try{return h$(r),r}catch{return n??"#000000"}},y$=e=>{const[t,n,r]=rS(e);return(t*299+n*587+r*114)/1e3},g$=e=>t=>{const n=nr(t,e);return y$(n)<128?"dark":"light"},v$=e=>t=>g$(e)(t)==="dark",wu=(e,t)=>n=>{const r=nr(n,e);return d$(r,1-t)};function $C(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( 45deg, ${t} 25%, transparent 25%, @@ -334,12 +334,12 @@ Error generating stack: `+i.message+` ${t} 75%, transparent 75%, transparent - )`,backgroundSize:`${e} ${e}`}}var n$=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function r$(e){const t=n$();return!e||QF(e)?t:e.string&&e.colors?i$(e.string,e.colors):e.string&&!e.colors?o$(e.string):e.colors&&!e.string?a$(e.colors):t}function o$(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${o.toString(16)}`.substr(-2)}return n}function i$(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function Gb(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function AP(e){return _r(e)&&e.reference?e.reference:String(e)}var Q0=(e,...t)=>t.map(AP).join(` ${e} `).replace(/calc/g,""),kC=(...e)=>`calc(${Q0("+",...e)})`,MC=(...e)=>`calc(${Q0("-",...e)})`,u2=(...e)=>`calc(${Q0("*",...e)})`,DC=(...e)=>`calc(${Q0("/",...e)})`,LC=e=>{const t=AP(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:u2(t,-1)},_i=Object.assign(e=>({add:(...t)=>_i(kC(e,...t)),subtract:(...t)=>_i(MC(e,...t)),multiply:(...t)=>_i(u2(e,...t)),divide:(...t)=>_i(DC(e,...t)),negate:()=>_i(LC(e)),toString:()=>e.toString()}),{add:kC,subtract:MC,multiply:u2,divide:DC,negate:LC});function s$(e){return!Number.isInteger(parseFloat(e.toString()))}function l$(e,t="-"){return e.replace(/\s+/g,t)}function PP(e){const t=l$(e.toString());return t.includes("\\.")?e:s$(e)?t.replace(".","\\."):e}function u$(e,t=""){return[t,PP(e)].filter(Boolean).join("-")}function c$(e,t){return`var(${PP(e)}${t?`, ${t}`:""})`}function f$(e,t=""){return`--${u$(e,t)}`}function mn(e,t){const n=f$(e,t==null?void 0:t.prefix);return{variable:n,reference:c$(n,d$(t==null?void 0:t.fallback))}}function d$(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:h$,definePartsStyle:Kh}=wt(MF.keys),zc=mn("switch-track-width"),_s=mn("switch-track-height"),Cy=mn("switch-track-diff"),p$=_i.subtract(zc,_s),c2=mn("switch-thumb-x"),ic=mn("switch-bg"),m$=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[zc.reference],height:[_s.reference],transitionProperty:"common",transitionDuration:"fast",[ic.variable]:"colors.gray.300",_dark:{[ic.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[ic.variable]:`colors.${t}.500`,_dark:{[ic.variable]:`colors.${t}.200`}},bg:ic.reference}},y$={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[_s.reference],height:[_s.reference],_checked:{transform:`translateX(${c2.reference})`}},g$=Kh(e=>({container:{[Cy.variable]:p$,[c2.variable]:Cy.reference,_rtl:{[c2.variable]:_i(Cy).negate().toString()}},track:m$(e),thumb:y$})),v$={sm:Kh({container:{[zc.variable]:"1.375rem",[_s.variable]:"sizes.3"}}),md:Kh({container:{[zc.variable]:"1.875rem",[_s.variable]:"sizes.4"}}),lg:Kh({container:{[zc.variable]:"2.875rem",[_s.variable]:"sizes.6"}})},w$=h$({baseStyle:g$,sizes:v$,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:b$,definePartsStyle:Ql}=wt(DF.keys),S$=Ql({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Vp={"&[data-is-numeric=true]":{textAlign:"end"}},_$=Ql(e=>{const{colorScheme:t}=e;return{th:{color:Oe("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Vp},td:{borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Vp},caption:{color:Oe("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),E$=Ql(e=>{const{colorScheme:t}=e;return{th:{color:Oe("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Vp},td:{borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Vp},caption:{color:Oe("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e)},td:{background:Oe(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),C$={simple:_$,striped:E$,unstyled:{}},x$={sm:Ql({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:Ql({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:Ql({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},O$=b$({baseStyle:S$,variants:C$,sizes:x$,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),yr=Ee("tabs-color"),ko=Ee("tabs-bg"),oh=Ee("tabs-border-color"),{defineMultiStyleConfig:A$,definePartsStyle:ui}=wt(LF.keys),P$=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},T$=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},I$=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},R$={p:4},k$=ui(e=>({root:P$(e),tab:T$(e),tablist:I$(e),tabpanel:R$})),M$={sm:ui({tab:{py:1,px:4,fontSize:"sm"}}),md:ui({tab:{fontSize:"md",py:2,px:4}}),lg:ui({tab:{fontSize:"lg",py:3,px:4}})},D$=ui(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",o=r?"borderStart":"borderBottom",i=r?"marginStart":"marginBottom";return{tablist:{[o]:"2px solid",borderColor:"inherit"},tab:{[o]:"2px solid",borderColor:"transparent",[i]:"-2px",_selected:{[yr.variable]:`colors.${t}.600`,_dark:{[yr.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[ko.variable]:"colors.gray.200",_dark:{[ko.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:yr.reference,bg:ko.reference}}}),L$=ui(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[oh.variable]:"transparent",_selected:{[yr.variable]:`colors.${t}.600`,[oh.variable]:"colors.white",_dark:{[yr.variable]:`colors.${t}.300`,[oh.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:oh.reference},color:yr.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),N$=ui(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[ko.variable]:"colors.gray.50",_dark:{[ko.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[ko.variable]:"colors.white",[yr.variable]:`colors.${t}.600`,_dark:{[ko.variable]:"colors.gray.800",[yr.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:yr.reference,bg:ko.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),B$=ui(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:nr(n,`${t}.700`),bg:nr(n,`${t}.100`)}}}}),j$=ui(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[yr.variable]:"colors.gray.600",_dark:{[yr.variable]:"inherit"},_selected:{[yr.variable]:"colors.white",[ko.variable]:`colors.${t}.600`,_dark:{[yr.variable]:"colors.gray.800",[ko.variable]:`colors.${t}.300`}},color:yr.reference,bg:ko.reference}}}),F$=ui({}),$$={line:D$,enclosed:L$,"enclosed-colored":N$,"soft-rounded":B$,"solid-rounded":j$,unstyled:F$},z$=A$({baseStyle:k$,sizes:M$,variants:$$,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),en=aj("badge",["bg","color","shadow"]),U$={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:en.bg.reference,color:en.color.reference,boxShadow:en.shadow.reference},V$=e=>{const{colorScheme:t,theme:n}=e,r=gu(`${t}.500`,.6)(n);return{[en.bg.variable]:`colors.${t}.500`,[en.color.variable]:"colors.white",_dark:{[en.bg.variable]:r,[en.color.variable]:"colors.whiteAlpha.800"}}},H$=e=>{const{colorScheme:t,theme:n}=e,r=gu(`${t}.200`,.16)(n);return{[en.bg.variable]:`colors.${t}.100`,[en.color.variable]:`colors.${t}.800`,_dark:{[en.bg.variable]:r,[en.color.variable]:`colors.${t}.200`}}},W$=e=>{const{colorScheme:t,theme:n}=e,r=gu(`${t}.200`,.8)(n);return{[en.color.variable]:`colors.${t}.500`,_dark:{[en.color.variable]:r},[en.shadow.variable]:`inset 0 0 0px 1px ${en.color.reference}`}},G$={solid:V$,subtle:H$,outline:W$},Uc={baseStyle:U$,variants:G$,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:K$,definePartsStyle:Es}=wt(NF.keys),NC=Ee("tag-bg"),BC=Ee("tag-color"),xy=Ee("tag-shadow"),Xh=Ee("tag-min-height"),qh=Ee("tag-min-width"),Yh=Ee("tag-font-size"),Zh=Ee("tag-padding-inline"),X$={fontWeight:"medium",lineHeight:1.2,outline:0,[BC.variable]:en.color.reference,[NC.variable]:en.bg.reference,[xy.variable]:en.shadow.reference,color:BC.reference,bg:NC.reference,boxShadow:xy.reference,borderRadius:"md",minH:Xh.reference,minW:qh.reference,fontSize:Yh.reference,px:Zh.reference,_focusVisible:{[xy.variable]:"shadows.outline"}},q$={lineHeight:1.2,overflow:"visible"},Y$={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},Z$=Es({container:X$,label:q$,closeButton:Y$}),Q$={sm:Es({container:{[Xh.variable]:"sizes.5",[qh.variable]:"sizes.5",[Yh.variable]:"fontSizes.xs",[Zh.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Es({container:{[Xh.variable]:"sizes.6",[qh.variable]:"sizes.6",[Yh.variable]:"fontSizes.sm",[Zh.variable]:"space.2"}}),lg:Es({container:{[Xh.variable]:"sizes.8",[qh.variable]:"sizes.8",[Yh.variable]:"fontSizes.md",[Zh.variable]:"space.3"}})},J$={subtle:Es(e=>{var t;return{container:(t=Uc.variants)==null?void 0:t.subtle(e)}}),solid:Es(e=>{var t;return{container:(t=Uc.variants)==null?void 0:t.solid(e)}}),outline:Es(e=>{var t;return{container:(t=Uc.variants)==null?void 0:t.outline(e)}})},ez=K$({variants:J$,baseStyle:Z$,sizes:Q$,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Oi,defineMultiStyleConfig:tz}=wt(_F.keys),Rl=Ee("input-height"),kl=Ee("input-font-size"),Ml=Ee("input-padding"),Dl=Ee("input-border-radius"),nz=Oi({addon:{height:Rl.reference,fontSize:kl.reference,px:Ml.reference,borderRadius:Dl.reference},field:{width:"100%",height:Rl.reference,fontSize:kl.reference,px:Ml.reference,borderRadius:Dl.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),qi={lg:{[kl.variable]:"fontSizes.lg",[Ml.variable]:"space.4",[Dl.variable]:"radii.md",[Rl.variable]:"sizes.12"},md:{[kl.variable]:"fontSizes.md",[Ml.variable]:"space.4",[Dl.variable]:"radii.md",[Rl.variable]:"sizes.10"},sm:{[kl.variable]:"fontSizes.sm",[Ml.variable]:"space.3",[Dl.variable]:"radii.sm",[Rl.variable]:"sizes.8"},xs:{[kl.variable]:"fontSizes.xs",[Ml.variable]:"space.2",[Dl.variable]:"radii.sm",[Rl.variable]:"sizes.6"}},rz={lg:Oi({field:qi.lg,group:qi.lg}),md:Oi({field:qi.md,group:qi.md}),sm:Oi({field:qi.sm,group:qi.sm}),xs:Oi({field:qi.xs,group:qi.xs})};function Kb(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Oe("blue.500","blue.300")(e),errorBorderColor:n||Oe("red.500","red.300")(e)}}var oz=Oi(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Kb(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Oe("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:nr(t,r),boxShadow:`0 0 0 1px ${nr(t,r)}`},_focusVisible:{zIndex:1,borderColor:nr(t,n),boxShadow:`0 0 0 1px ${nr(t,n)}`}},addon:{border:"1px solid",borderColor:Oe("inherit","whiteAlpha.50")(e),bg:Oe("gray.100","whiteAlpha.300")(e)}}}),iz=Oi(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Kb(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Oe("gray.100","whiteAlpha.50")(e),_hover:{bg:Oe("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:nr(t,r)},_focusVisible:{bg:"transparent",borderColor:nr(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Oe("gray.100","whiteAlpha.50")(e)}}}),az=Oi(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=Kb(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:nr(t,r),boxShadow:`0px 1px 0px 0px ${nr(t,r)}`},_focusVisible:{borderColor:nr(t,n),boxShadow:`0px 1px 0px 0px ${nr(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),sz=Oi({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),lz={outline:oz,filled:iz,flushed:az,unstyled:sz},rt=tz({baseStyle:nz,sizes:rz,variants:lz,defaultProps:{size:"md",variant:"outline"}}),jC,uz={...(jC=rt.baseStyle)==null?void 0:jC.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},FC,$C,cz={outline:e=>{var t,n;return(n=(t=rt.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=rt.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=rt.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:($C=(FC=rt.variants)==null?void 0:FC.unstyled.field)!=null?$C:{}},zC,UC,VC,HC,WC,GC,KC,XC,fz={xs:(UC=(zC=rt.sizes)==null?void 0:zC.xs.field)!=null?UC:{},sm:(HC=(VC=rt.sizes)==null?void 0:VC.sm.field)!=null?HC:{},md:(GC=(WC=rt.sizes)==null?void 0:WC.md.field)!=null?GC:{},lg:(XC=(KC=rt.sizes)==null?void 0:KC.lg.field)!=null?XC:{}},dz={baseStyle:uz,sizes:fz,variants:cz,defaultProps:{size:"md",variant:"outline"}},ih=mn("tooltip-bg"),Oy=mn("tooltip-fg"),hz=mn("popper-arrow-bg"),pz={bg:ih.reference,color:Oy.reference,[ih.variable]:"colors.gray.700",[Oy.variable]:"colors.whiteAlpha.900",_dark:{[ih.variable]:"colors.gray.300",[Oy.variable]:"colors.gray.900"},[hz.variable]:ih.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},mz={baseStyle:pz},{defineMultiStyleConfig:yz,definePartsStyle:Ec}=wt(PF.keys),gz=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:o}=e,i=Oe(RC(),RC("1rem","rgba(0,0,0,0.1)"))(e),a=Oe(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( + )`,backgroundSize:`${e} ${e}`}}var w$=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function b$(e){const t=w$();return!e||m$(e)?t:e.string&&e.colors?_$(e.string,e.colors):e.string&&!e.colors?S$(e.string):e.colors&&!e.string?E$(e.colors):t}function S$(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${o.toString(16)}`.substr(-2)}return n}function _$(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function oS(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function UP(e){return _r(e)&&e.reference?e.reference:String(e)}var sm=(e,...t)=>t.map(UP).join(` ${e} `).replace(/calc/g,""),zC=(...e)=>`calc(${sm("+",...e)})`,VC=(...e)=>`calc(${sm("-",...e)})`,b2=(...e)=>`calc(${sm("*",...e)})`,UC=(...e)=>`calc(${sm("/",...e)})`,HC=e=>{const t=UP(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:b2(t,-1)},Ei=Object.assign(e=>({add:(...t)=>Ei(zC(e,...t)),subtract:(...t)=>Ei(VC(e,...t)),multiply:(...t)=>Ei(b2(e,...t)),divide:(...t)=>Ei(UC(e,...t)),negate:()=>Ei(HC(e)),toString:()=>e.toString()}),{add:zC,subtract:VC,multiply:b2,divide:UC,negate:HC});function C$(e){return!Number.isInteger(parseFloat(e.toString()))}function x$(e,t="-"){return e.replace(/\s+/g,t)}function HP(e){const t=x$(e.toString());return t.includes("\\.")?e:C$(e)?t.replace(".","\\."):e}function O$(e,t=""){return[t,HP(e)].filter(Boolean).join("-")}function A$(e,t){return`var(${HP(e)}${t?`, ${t}`:""})`}function P$(e,t=""){return`--${O$(e,t)}`}function mn(e,t){const n=P$(e,t==null?void 0:t.prefix);return{variable:n,reference:A$(n,T$(t==null?void 0:t.fallback))}}function T$(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:I$,definePartsStyle:qh}=wt(YF.keys),Vc=mn("switch-track-width"),xs=mn("switch-track-height"),Ly=mn("switch-track-diff"),R$=Ei.subtract(Vc,xs),S2=mn("switch-thumb-x"),ac=mn("switch-bg"),k$=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Vc.reference],height:[xs.reference],transitionProperty:"common",transitionDuration:"fast",[ac.variable]:"colors.gray.300",_dark:{[ac.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[ac.variable]:`colors.${t}.500`,_dark:{[ac.variable]:`colors.${t}.200`}},bg:ac.reference}},M$={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[xs.reference],height:[xs.reference],_checked:{transform:`translateX(${S2.reference})`}},D$=qh(e=>({container:{[Ly.variable]:R$,[S2.variable]:Ly.reference,_rtl:{[S2.variable]:Ei(Ly).negate().toString()}},track:k$(e),thumb:M$})),L$={sm:qh({container:{[Vc.variable]:"1.375rem",[xs.variable]:"sizes.3"}}),md:qh({container:{[Vc.variable]:"1.875rem",[xs.variable]:"sizes.4"}}),lg:qh({container:{[Vc.variable]:"2.875rem",[xs.variable]:"sizes.6"}})},N$=I$({baseStyle:D$,sizes:L$,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:B$,definePartsStyle:eu}=wt(ZF.keys),j$=eu({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Wp={"&[data-is-numeric=true]":{textAlign:"end"}},F$=eu(e=>{const{colorScheme:t}=e;return{th:{color:Oe("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Wp},td:{borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Wp},caption:{color:Oe("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),$$=eu(e=>{const{colorScheme:t}=e;return{th:{color:Oe("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Wp},td:{borderBottom:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e),...Wp},caption:{color:Oe("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Oe(`${t}.100`,`${t}.700`)(e)},td:{background:Oe(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),z$={simple:F$,striped:$$,unstyled:{}},V$={sm:eu({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:eu({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:eu({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},U$=B$({baseStyle:j$,variants:z$,sizes:V$,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),yr=Ee("tabs-color"),Mo=Ee("tabs-bg"),ah=Ee("tabs-border-color"),{defineMultiStyleConfig:H$,definePartsStyle:ci}=wt(QF.keys),W$=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},G$=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},K$=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},X$={p:4},q$=ci(e=>({root:W$(e),tab:G$(e),tablist:K$(e),tabpanel:X$})),Y$={sm:ci({tab:{py:1,px:4,fontSize:"sm"}}),md:ci({tab:{fontSize:"md",py:2,px:4}}),lg:ci({tab:{fontSize:"lg",py:3,px:4}})},Z$=ci(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",o=r?"borderStart":"borderBottom",i=r?"marginStart":"marginBottom";return{tablist:{[o]:"2px solid",borderColor:"inherit"},tab:{[o]:"2px solid",borderColor:"transparent",[i]:"-2px",_selected:{[yr.variable]:`colors.${t}.600`,_dark:{[yr.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Mo.variable]:"colors.gray.200",_dark:{[Mo.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:yr.reference,bg:Mo.reference}}}),Q$=ci(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[ah.variable]:"transparent",_selected:{[yr.variable]:`colors.${t}.600`,[ah.variable]:"colors.white",_dark:{[yr.variable]:`colors.${t}.300`,[ah.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:ah.reference},color:yr.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),J$=ci(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Mo.variable]:"colors.gray.50",_dark:{[Mo.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Mo.variable]:"colors.white",[yr.variable]:`colors.${t}.600`,_dark:{[Mo.variable]:"colors.gray.800",[yr.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:yr.reference,bg:Mo.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),ez=ci(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:nr(n,`${t}.700`),bg:nr(n,`${t}.100`)}}}}),tz=ci(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[yr.variable]:"colors.gray.600",_dark:{[yr.variable]:"inherit"},_selected:{[yr.variable]:"colors.white",[Mo.variable]:`colors.${t}.600`,_dark:{[yr.variable]:"colors.gray.800",[Mo.variable]:`colors.${t}.300`}},color:yr.reference,bg:Mo.reference}}}),nz=ci({}),rz={line:Z$,enclosed:Q$,"enclosed-colored":J$,"soft-rounded":ez,"solid-rounded":tz,unstyled:nz},oz=H$({baseStyle:q$,sizes:Y$,variants:rz,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),en=Ej("badge",["bg","color","shadow"]),iz={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:en.bg.reference,color:en.color.reference,boxShadow:en.shadow.reference},az=e=>{const{colorScheme:t,theme:n}=e,r=wu(`${t}.500`,.6)(n);return{[en.bg.variable]:`colors.${t}.500`,[en.color.variable]:"colors.white",_dark:{[en.bg.variable]:r,[en.color.variable]:"colors.whiteAlpha.800"}}},sz=e=>{const{colorScheme:t,theme:n}=e,r=wu(`${t}.200`,.16)(n);return{[en.bg.variable]:`colors.${t}.100`,[en.color.variable]:`colors.${t}.800`,_dark:{[en.bg.variable]:r,[en.color.variable]:`colors.${t}.200`}}},lz=e=>{const{colorScheme:t,theme:n}=e,r=wu(`${t}.200`,.8)(n);return{[en.color.variable]:`colors.${t}.500`,_dark:{[en.color.variable]:r},[en.shadow.variable]:`inset 0 0 0px 1px ${en.color.reference}`}},uz={solid:az,subtle:sz,outline:lz},Uc={baseStyle:iz,variants:uz,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:cz,definePartsStyle:Os}=wt(JF.keys),WC=Ee("tag-bg"),GC=Ee("tag-color"),Ny=Ee("tag-shadow"),Yh=Ee("tag-min-height"),Zh=Ee("tag-min-width"),Qh=Ee("tag-font-size"),Jh=Ee("tag-padding-inline"),fz={fontWeight:"medium",lineHeight:1.2,outline:0,[GC.variable]:en.color.reference,[WC.variable]:en.bg.reference,[Ny.variable]:en.shadow.reference,color:GC.reference,bg:WC.reference,boxShadow:Ny.reference,borderRadius:"md",minH:Yh.reference,minW:Zh.reference,fontSize:Qh.reference,px:Jh.reference,_focusVisible:{[Ny.variable]:"shadows.outline"}},dz={lineHeight:1.2,overflow:"visible"},hz={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},pz=Os({container:fz,label:dz,closeButton:hz}),mz={sm:Os({container:{[Yh.variable]:"sizes.5",[Zh.variable]:"sizes.5",[Qh.variable]:"fontSizes.xs",[Jh.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Os({container:{[Yh.variable]:"sizes.6",[Zh.variable]:"sizes.6",[Qh.variable]:"fontSizes.sm",[Jh.variable]:"space.2"}}),lg:Os({container:{[Yh.variable]:"sizes.8",[Zh.variable]:"sizes.8",[Qh.variable]:"fontSizes.md",[Jh.variable]:"space.3"}})},yz={subtle:Os(e=>{var t;return{container:(t=Uc.variants)==null?void 0:t.subtle(e)}}),solid:Os(e=>{var t;return{container:(t=Uc.variants)==null?void 0:t.solid(e)}}),outline:Os(e=>{var t;return{container:(t=Uc.variants)==null?void 0:t.outline(e)}})},gz=cz({variants:yz,baseStyle:pz,sizes:mz,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Ai,defineMultiStyleConfig:vz}=wt(FF.keys),Ml=Ee("input-height"),Dl=Ee("input-font-size"),Ll=Ee("input-padding"),Nl=Ee("input-border-radius"),wz=Ai({addon:{height:Ml.reference,fontSize:Dl.reference,px:Ll.reference,borderRadius:Nl.reference},field:{width:"100%",height:Ml.reference,fontSize:Dl.reference,px:Ll.reference,borderRadius:Nl.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Yi={lg:{[Dl.variable]:"fontSizes.lg",[Ll.variable]:"space.4",[Nl.variable]:"radii.md",[Ml.variable]:"sizes.12"},md:{[Dl.variable]:"fontSizes.md",[Ll.variable]:"space.4",[Nl.variable]:"radii.md",[Ml.variable]:"sizes.10"},sm:{[Dl.variable]:"fontSizes.sm",[Ll.variable]:"space.3",[Nl.variable]:"radii.sm",[Ml.variable]:"sizes.8"},xs:{[Dl.variable]:"fontSizes.xs",[Ll.variable]:"space.2",[Nl.variable]:"radii.sm",[Ml.variable]:"sizes.6"}},bz={lg:Ai({field:Yi.lg,group:Yi.lg}),md:Ai({field:Yi.md,group:Yi.md}),sm:Ai({field:Yi.sm,group:Yi.sm}),xs:Ai({field:Yi.xs,group:Yi.xs})};function iS(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Oe("blue.500","blue.300")(e),errorBorderColor:n||Oe("red.500","red.300")(e)}}var Sz=Ai(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=iS(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Oe("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:nr(t,r),boxShadow:`0 0 0 1px ${nr(t,r)}`},_focusVisible:{zIndex:1,borderColor:nr(t,n),boxShadow:`0 0 0 1px ${nr(t,n)}`}},addon:{border:"1px solid",borderColor:Oe("inherit","whiteAlpha.50")(e),bg:Oe("gray.100","whiteAlpha.300")(e)}}}),_z=Ai(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=iS(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Oe("gray.100","whiteAlpha.50")(e),_hover:{bg:Oe("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:nr(t,r)},_focusVisible:{bg:"transparent",borderColor:nr(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Oe("gray.100","whiteAlpha.50")(e)}}}),Ez=Ai(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=iS(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:nr(t,r),boxShadow:`0px 1px 0px 0px ${nr(t,r)}`},_focusVisible:{borderColor:nr(t,n),boxShadow:`0px 1px 0px 0px ${nr(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),Cz=Ai({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),xz={outline:Sz,filled:_z,flushed:Ez,unstyled:Cz},rt=vz({baseStyle:wz,sizes:bz,variants:xz,defaultProps:{size:"md",variant:"outline"}}),KC,Oz={...(KC=rt.baseStyle)==null?void 0:KC.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},XC,qC,Az={outline:e=>{var t,n;return(n=(t=rt.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=rt.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=rt.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(qC=(XC=rt.variants)==null?void 0:XC.unstyled.field)!=null?qC:{}},YC,ZC,QC,JC,e3,t3,n3,r3,Pz={xs:(ZC=(YC=rt.sizes)==null?void 0:YC.xs.field)!=null?ZC:{},sm:(JC=(QC=rt.sizes)==null?void 0:QC.sm.field)!=null?JC:{},md:(t3=(e3=rt.sizes)==null?void 0:e3.md.field)!=null?t3:{},lg:(r3=(n3=rt.sizes)==null?void 0:n3.lg.field)!=null?r3:{}},Tz={baseStyle:Oz,sizes:Pz,variants:Az,defaultProps:{size:"md",variant:"outline"}},sh=mn("tooltip-bg"),By=mn("tooltip-fg"),Iz=mn("popper-arrow-bg"),Rz={bg:sh.reference,color:By.reference,[sh.variable]:"colors.gray.700",[By.variable]:"colors.whiteAlpha.900",_dark:{[sh.variable]:"colors.gray.300",[By.variable]:"colors.gray.900"},[Iz.variable]:sh.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},kz={baseStyle:Rz},{defineMultiStyleConfig:Mz,definePartsStyle:Cc}=wt(WF.keys),Dz=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:o}=e,i=Oe($C(),$C("1rem","rgba(0,0,0,0.1)"))(e),a=Oe(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( to right, transparent 0%, ${nr(n,a)} 50%, transparent 100% - )`;return{...!r&&o&&i,...r?{bgImage:s}:{bgColor:a}}},vz={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},wz=e=>({bg:Oe("gray.100","whiteAlpha.300")(e)}),bz=e=>({transitionProperty:"common",transitionDuration:"slow",...gz(e)}),Sz=Ec(e=>({label:vz,filledTrack:bz(e),track:wz(e)})),_z={xs:Ec({track:{h:"1"}}),sm:Ec({track:{h:"2"}}),md:Ec({track:{h:"3"}}),lg:Ec({track:{h:"4"}})},Ez=yz({sizes:_z,baseStyle:Sz,defaultProps:{size:"md",colorScheme:"blue"}}),Cz=e=>typeof e=="function";function ir(e,...t){return Cz(e)?e(...t):e}var{definePartsStyle:Qh,defineMultiStyleConfig:xz}=wt(gF.keys),Vc=Ee("checkbox-size"),Oz=e=>{const{colorScheme:t}=e;return{w:Vc.reference,h:Vc.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Oe(`${t}.500`,`${t}.200`)(e),borderColor:Oe(`${t}.500`,`${t}.200`)(e),color:Oe("white","gray.900")(e),_hover:{bg:Oe(`${t}.600`,`${t}.300`)(e),borderColor:Oe(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Oe("gray.200","transparent")(e),bg:Oe("gray.200","whiteAlpha.300")(e),color:Oe("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Oe(`${t}.500`,`${t}.200`)(e),borderColor:Oe(`${t}.500`,`${t}.200`)(e),color:Oe("white","gray.900")(e)},_disabled:{bg:Oe("gray.100","whiteAlpha.100")(e),borderColor:Oe("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Oe("red.500","red.300")(e)}}},Az={_disabled:{cursor:"not-allowed"}},Pz={userSelect:"none",_disabled:{opacity:.4}},Tz={transitionProperty:"transform",transitionDuration:"normal"},Iz=Qh(e=>({icon:Tz,container:Az,control:ir(Oz,e),label:Pz})),Rz={sm:Qh({control:{[Vc.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:Qh({control:{[Vc.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:Qh({control:{[Vc.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},Hp=xz({baseStyle:Iz,sizes:Rz,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:kz,definePartsStyle:Jh}=wt(TF.keys),Mz=e=>{var t;const n=(t=ir(Hp.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Dz=Jh(e=>{var t,n,r,o;return{label:(n=(t=Hp).baseStyle)==null?void 0:n.call(t,e).label,container:(o=(r=Hp).baseStyle)==null?void 0:o.call(r,e).container,control:Mz(e)}}),Lz={md:Jh({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:Jh({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:Jh({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},Nz=kz({baseStyle:Dz,sizes:Lz,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Bz,definePartsStyle:jz}=wt(IF.keys),ah=Ee("select-bg"),qC,Fz={...(qC=rt.baseStyle)==null?void 0:qC.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:ah.reference,[ah.variable]:"colors.white",_dark:{[ah.variable]:"colors.gray.700"},"> option, > optgroup":{bg:ah.reference}},$z={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},zz=jz({field:Fz,icon:$z}),sh={paddingInlineEnd:"8"},YC,ZC,QC,JC,e3,t3,n3,r3,Uz={lg:{...(YC=rt.sizes)==null?void 0:YC.lg,field:{...(ZC=rt.sizes)==null?void 0:ZC.lg.field,...sh}},md:{...(QC=rt.sizes)==null?void 0:QC.md,field:{...(JC=rt.sizes)==null?void 0:JC.md.field,...sh}},sm:{...(e3=rt.sizes)==null?void 0:e3.sm,field:{...(t3=rt.sizes)==null?void 0:t3.sm.field,...sh}},xs:{...(n3=rt.sizes)==null?void 0:n3.xs,field:{...(r3=rt.sizes)==null?void 0:r3.xs.field,...sh},icon:{insetEnd:"1"}}},Vz=Bz({baseStyle:zz,sizes:Uz,variants:rt.variants,defaultProps:rt.defaultProps}),Ay=Ee("skeleton-start-color"),Py=Ee("skeleton-end-color"),Hz={[Ay.variable]:"colors.gray.100",[Py.variable]:"colors.gray.400",_dark:{[Ay.variable]:"colors.gray.800",[Py.variable]:"colors.gray.600"},background:Ay.reference,borderColor:Py.reference,opacity:.7,borderRadius:"sm"},Wz={baseStyle:Hz},Ty=Ee("skip-link-bg"),Gz={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[Ty.variable]:"colors.white",_dark:{[Ty.variable]:"colors.gray.700"},bg:Ty.reference}},Kz={baseStyle:Gz},{defineMultiStyleConfig:Xz,definePartsStyle:J0}=wt(RF.keys),Pf=Ee("slider-thumb-size"),Tf=Ee("slider-track-size"),ua=Ee("slider-bg"),qz=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...Gb({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},Yz=e=>({...Gb({orientation:e.orientation,horizontal:{h:Tf.reference},vertical:{w:Tf.reference}}),overflow:"hidden",borderRadius:"sm",[ua.variable]:"colors.gray.200",_dark:{[ua.variable]:"colors.whiteAlpha.200"},_disabled:{[ua.variable]:"colors.gray.300",_dark:{[ua.variable]:"colors.whiteAlpha.300"}},bg:ua.reference}),Zz=e=>{const{orientation:t}=e;return{...Gb({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:Pf.reference,h:Pf.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},Qz=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[ua.variable]:`colors.${t}.500`,_dark:{[ua.variable]:`colors.${t}.200`},bg:ua.reference}},Jz=J0(e=>({container:qz(e),track:Yz(e),thumb:Zz(e),filledTrack:Qz(e)})),eU=J0({container:{[Pf.variable]:"sizes.4",[Tf.variable]:"sizes.1"}}),tU=J0({container:{[Pf.variable]:"sizes.3.5",[Tf.variable]:"sizes.1"}}),nU=J0({container:{[Pf.variable]:"sizes.2.5",[Tf.variable]:"sizes.0.5"}}),rU={lg:eU,md:tU,sm:nU},oU=Xz({baseStyle:Jz,sizes:rU,defaultProps:{size:"md",colorScheme:"blue"}}),as=mn("spinner-size"),iU={width:[as.reference],height:[as.reference]},aU={xs:{[as.variable]:"sizes.3"},sm:{[as.variable]:"sizes.4"},md:{[as.variable]:"sizes.6"},lg:{[as.variable]:"sizes.8"},xl:{[as.variable]:"sizes.12"}},sU={baseStyle:iU,sizes:aU,defaultProps:{size:"md"}},{defineMultiStyleConfig:lU,definePartsStyle:TP}=wt(kF.keys),uU={fontWeight:"medium"},cU={opacity:.8,marginBottom:"2"},fU={verticalAlign:"baseline",fontWeight:"semibold"},dU={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},hU=TP({container:{},label:uU,helpText:cU,number:fU,icon:dU}),pU={md:TP({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},mU=lU({baseStyle:hU,sizes:pU,defaultProps:{size:"md"}}),Iy=Ee("kbd-bg"),yU={[Iy.variable]:"colors.gray.100",_dark:{[Iy.variable]:"colors.whiteAlpha.100"},bg:Iy.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},gU={baseStyle:yU},vU={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},wU={baseStyle:vU},{defineMultiStyleConfig:bU,definePartsStyle:SU}=wt(EF.keys),_U={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},EU=SU({icon:_U}),CU=bU({baseStyle:EU}),{defineMultiStyleConfig:xU,definePartsStyle:OU}=wt(CF.keys),qo=Ee("menu-bg"),Ry=Ee("menu-shadow"),AU={[qo.variable]:"#fff",[Ry.variable]:"shadows.sm",_dark:{[qo.variable]:"colors.gray.700",[Ry.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:qo.reference,boxShadow:Ry.reference},PU={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[qo.variable]:"colors.gray.100",_dark:{[qo.variable]:"colors.whiteAlpha.100"}},_active:{[qo.variable]:"colors.gray.200",_dark:{[qo.variable]:"colors.whiteAlpha.200"}},_expanded:{[qo.variable]:"colors.gray.100",_dark:{[qo.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:qo.reference},TU={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},IU={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},RU={opacity:.6},kU={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},MU={transitionProperty:"common",transitionDuration:"normal"},DU=OU({button:MU,list:AU,item:PU,groupTitle:TU,icon:IU,command:RU,divider:kU}),LU=xU({baseStyle:DU}),{defineMultiStyleConfig:NU,definePartsStyle:f2}=wt(xF.keys),ky=Ee("modal-bg"),My=Ee("modal-shadow"),BU={bg:"blackAlpha.600",zIndex:"modal"},jU=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},FU=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[ky.variable]:"colors.white",[My.variable]:"shadows.lg",_dark:{[ky.variable]:"colors.gray.700",[My.variable]:"shadows.dark-lg"},bg:ky.reference,boxShadow:My.reference}},$U={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},zU={position:"absolute",top:"2",insetEnd:"3"},UU=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},VU={px:"6",py:"4"},HU=f2(e=>({overlay:BU,dialogContainer:ir(jU,e),dialog:ir(FU,e),header:$U,closeButton:zU,body:ir(UU,e),footer:VU}));function Oo(e){return f2(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var WU={xs:Oo("xs"),sm:Oo("sm"),md:Oo("md"),lg:Oo("lg"),xl:Oo("xl"),"2xl":Oo("2xl"),"3xl":Oo("3xl"),"4xl":Oo("4xl"),"5xl":Oo("5xl"),"6xl":Oo("6xl"),full:Oo("full")},GU=NU({baseStyle:HU,sizes:WU,defaultProps:{size:"md"}}),{defineMultiStyleConfig:KU,definePartsStyle:IP}=wt(OF.keys),Xb=mn("number-input-stepper-width"),RP=mn("number-input-input-padding"),XU=_i(Xb).add("0.5rem").toString(),Dy=mn("number-input-bg"),Ly=mn("number-input-color"),Ny=mn("number-input-border-color"),qU={[Xb.variable]:"sizes.6",[RP.variable]:XU},YU=e=>{var t,n;return(n=(t=ir(rt.baseStyle,e))==null?void 0:t.field)!=null?n:{}},ZU={width:Xb.reference},QU={borderStart:"1px solid",borderStartColor:Ny.reference,color:Ly.reference,bg:Dy.reference,[Ly.variable]:"colors.chakra-body-text",[Ny.variable]:"colors.chakra-border-color",_dark:{[Ly.variable]:"colors.whiteAlpha.800",[Ny.variable]:"colors.whiteAlpha.300"},_active:{[Dy.variable]:"colors.gray.200",_dark:{[Dy.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},JU=IP(e=>{var t;return{root:qU,field:(t=ir(YU,e))!=null?t:{},stepperGroup:ZU,stepper:QU}});function lh(e){var t,n,r;const o=(t=rt.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},a=(r=(n=o.field)==null?void 0:n.fontSize)!=null?r:"md",s=CP.fontSizes[a];return IP({field:{...o.field,paddingInlineEnd:RP.reference,verticalAlign:"top"},stepper:{fontSize:_i(s).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var eV={xs:lh("xs"),sm:lh("sm"),md:lh("md"),lg:lh("lg")},tV=KU({baseStyle:JU,sizes:eV,variants:rt.variants,defaultProps:rt.defaultProps}),o3,nV={...(o3=rt.baseStyle)==null?void 0:o3.field,textAlign:"center"},rV={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},i3,a3,oV={outline:e=>{var t,n,r;return(r=(n=ir((t=rt.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=ir((t=rt.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=ir((t=rt.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(a3=(i3=rt.variants)==null?void 0:i3.unstyled.field)!=null?a3:{}},iV={baseStyle:nV,sizes:rV,variants:oV,defaultProps:rt.defaultProps},{defineMultiStyleConfig:aV,definePartsStyle:sV}=wt(AF.keys),uh=mn("popper-bg"),lV=mn("popper-arrow-bg"),s3=mn("popper-arrow-shadow-color"),uV={zIndex:10},cV={[uh.variable]:"colors.white",bg:uh.reference,[lV.variable]:uh.reference,[s3.variable]:"colors.gray.200",_dark:{[uh.variable]:"colors.gray.700",[s3.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},fV={px:3,py:2,borderBottomWidth:"1px"},dV={px:3,py:2},hV={px:3,py:2,borderTopWidth:"1px"},pV={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},mV=sV({popper:uV,content:cV,header:fV,body:dV,footer:hV,closeButton:pV}),yV=aV({baseStyle:mV}),{definePartsStyle:d2,defineMultiStyleConfig:gV}=wt(vF.keys),By=Ee("drawer-bg"),jy=Ee("drawer-box-shadow");function il(e){return d2(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var vV={bg:"blackAlpha.600",zIndex:"overlay"},wV={display:"flex",zIndex:"modal",justifyContent:"center"},bV=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[By.variable]:"colors.white",[jy.variable]:"shadows.lg",_dark:{[By.variable]:"colors.gray.700",[jy.variable]:"shadows.dark-lg"},bg:By.reference,boxShadow:jy.reference}},SV={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},_V={position:"absolute",top:"2",insetEnd:"3"},EV={px:"6",py:"2",flex:"1",overflow:"auto"},CV={px:"6",py:"4"},xV=d2(e=>({overlay:vV,dialogContainer:wV,dialog:ir(bV,e),header:SV,closeButton:_V,body:EV,footer:CV})),OV={xs:il("xs"),sm:il("md"),md:il("lg"),lg:il("2xl"),xl:il("4xl"),full:il("full")},AV=gV({baseStyle:xV,sizes:OV,defaultProps:{size:"xs"}}),{definePartsStyle:PV,defineMultiStyleConfig:TV}=wt(wF.keys),IV={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},RV={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},kV={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},MV=PV({preview:IV,input:RV,textarea:kV}),DV=TV({baseStyle:MV}),{definePartsStyle:LV,defineMultiStyleConfig:NV}=wt(bF.keys),Jl=Ee("form-control-color"),BV={marginStart:"1",[Jl.variable]:"colors.red.500",_dark:{[Jl.variable]:"colors.red.300"},color:Jl.reference},jV={mt:"2",[Jl.variable]:"colors.gray.600",_dark:{[Jl.variable]:"colors.whiteAlpha.600"},color:Jl.reference,lineHeight:"normal",fontSize:"sm"},FV=LV({container:{width:"100%",position:"relative"},requiredIndicator:BV,helperText:jV}),$V=NV({baseStyle:FV}),{definePartsStyle:zV,defineMultiStyleConfig:UV}=wt(SF.keys),eu=Ee("form-error-color"),VV={[eu.variable]:"colors.red.500",_dark:{[eu.variable]:"colors.red.300"},color:eu.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},HV={marginEnd:"0.5em",[eu.variable]:"colors.red.500",_dark:{[eu.variable]:"colors.red.300"},color:eu.reference},WV=zV({text:VV,icon:HV}),GV=UV({baseStyle:WV}),KV={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},XV={baseStyle:KV},qV={fontFamily:"heading",fontWeight:"bold"},YV={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},ZV={baseStyle:qV,sizes:YV,defaultProps:{size:"xl"}},{defineMultiStyleConfig:QV,definePartsStyle:JV}=wt(yF.keys),Fy=Ee("breadcrumb-link-decor"),eH={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:Fy.reference,[Fy.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[Fy.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},tH=JV({link:eH}),nH=QV({baseStyle:tH}),rH={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},kP=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Oe("gray.800","whiteAlpha.900")(e),_hover:{bg:Oe("gray.100","whiteAlpha.200")(e)},_active:{bg:Oe("gray.200","whiteAlpha.300")(e)}};const r=gu(`${t}.200`,.12)(n),o=gu(`${t}.200`,.24)(n);return{color:Oe(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Oe(`${t}.50`,r)(e)},_active:{bg:Oe(`${t}.100`,o)(e)}}},oH=e=>{const{colorScheme:t}=e,n=Oe("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...ir(kP,e)}},iH={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},aH=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=Oe("gray.100","whiteAlpha.200")(e);return{bg:l,color:Oe("gray.800","whiteAlpha.900")(e),_hover:{bg:Oe("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:Oe("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:o="white",hoverBg:i=`${n}.600`,activeBg:a=`${n}.700`}=(t=iH[n])!=null?t:{},s=Oe(r,`${n}.200`)(e);return{bg:s,color:Oe(o,"gray.800")(e),_hover:{bg:Oe(i,`${n}.300`)(e),_disabled:{bg:s}},_active:{bg:Oe(a,`${n}.400`)(e)}}},sH=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Oe(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Oe(`${t}.700`,`${t}.500`)(e)}}},lH={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},uH={ghost:kP,outline:oH,solid:aH,link:sH,unstyled:lH},cH={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},fH={baseStyle:rH,variants:uH,sizes:cH,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Cs,defineMultiStyleConfig:dH}=wt(BF.keys),Wp=Ee("card-bg"),Ti=Ee("card-padding"),MP=Ee("card-shadow"),ep=Ee("card-radius"),DP=Ee("card-border-width","0"),LP=Ee("card-border-color"),hH=Cs({container:{[Wp.variable]:"colors.chakra-body-bg",backgroundColor:Wp.reference,boxShadow:MP.reference,borderRadius:ep.reference,color:"chakra-body-text",borderWidth:DP.reference,borderColor:LP.reference},body:{padding:Ti.reference,flex:"1 1 0%"},header:{padding:Ti.reference},footer:{padding:Ti.reference}}),pH={sm:Cs({container:{[ep.variable]:"radii.base",[Ti.variable]:"space.3"}}),md:Cs({container:{[ep.variable]:"radii.md",[Ti.variable]:"space.5"}}),lg:Cs({container:{[ep.variable]:"radii.xl",[Ti.variable]:"space.7"}})},mH={elevated:Cs({container:{[MP.variable]:"shadows.base",_dark:{[Wp.variable]:"colors.gray.700"}}}),outline:Cs({container:{[DP.variable]:"1px",[LP.variable]:"colors.chakra-border-color"}}),filled:Cs({container:{[Wp.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[Ti.variable]:0},header:{[Ti.variable]:0},footer:{[Ti.variable]:0}}},yH=dH({baseStyle:hH,variants:mH,sizes:pH,defaultProps:{variant:"elevated",size:"md"}}),Hc=mn("close-button-size"),ac=mn("close-button-bg"),gH={w:[Hc.reference],h:[Hc.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[ac.variable]:"colors.blackAlpha.100",_dark:{[ac.variable]:"colors.whiteAlpha.100"}},_active:{[ac.variable]:"colors.blackAlpha.200",_dark:{[ac.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:ac.reference},vH={lg:{[Hc.variable]:"sizes.10",fontSize:"md"},md:{[Hc.variable]:"sizes.8",fontSize:"xs"},sm:{[Hc.variable]:"sizes.6",fontSize:"2xs"}},wH={baseStyle:gH,sizes:vH,defaultProps:{size:"md"}},{variants:bH,defaultProps:SH}=Uc,_H={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:en.bg.reference,color:en.color.reference,boxShadow:en.shadow.reference},EH={baseStyle:_H,variants:bH,defaultProps:SH},CH={w:"100%",mx:"auto",maxW:"prose",px:"4"},xH={baseStyle:CH},OH={opacity:.6,borderColor:"inherit"},AH={borderStyle:"solid"},PH={borderStyle:"dashed"},TH={solid:AH,dashed:PH},IH={baseStyle:OH,variants:TH,defaultProps:{variant:"solid"}},{definePartsStyle:RH,defineMultiStyleConfig:kH}=wt(hF.keys),MH={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},DH={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},LH={pt:"2",px:"4",pb:"5"},NH={fontSize:"1.25em"},BH=RH({container:MH,button:DH,panel:LH,icon:NH}),jH=kH({baseStyle:BH}),{definePartsStyle:od,defineMultiStyleConfig:FH}=wt(pF.keys),Fr=Ee("alert-fg"),Ni=Ee("alert-bg"),$H=od({container:{bg:Ni.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Fr.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Fr.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function qb(e){const{theme:t,colorScheme:n}=e,r=gu(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var zH=od(e=>{const{colorScheme:t}=e,n=qb(e);return{container:{[Fr.variable]:`colors.${t}.500`,[Ni.variable]:n.light,_dark:{[Fr.variable]:`colors.${t}.200`,[Ni.variable]:n.dark}}}}),UH=od(e=>{const{colorScheme:t}=e,n=qb(e);return{container:{[Fr.variable]:`colors.${t}.500`,[Ni.variable]:n.light,_dark:{[Fr.variable]:`colors.${t}.200`,[Ni.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:Fr.reference}}}),VH=od(e=>{const{colorScheme:t}=e,n=qb(e);return{container:{[Fr.variable]:`colors.${t}.500`,[Ni.variable]:n.light,_dark:{[Fr.variable]:`colors.${t}.200`,[Ni.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:Fr.reference}}}),HH=od(e=>{const{colorScheme:t}=e;return{container:{[Fr.variable]:"colors.white",[Ni.variable]:`colors.${t}.500`,_dark:{[Fr.variable]:"colors.gray.900",[Ni.variable]:`colors.${t}.200`},color:Fr.reference}}}),WH={subtle:zH,"left-accent":UH,"top-accent":VH,solid:HH},GH=FH({baseStyle:$H,variants:WH,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:NP,defineMultiStyleConfig:KH}=wt(mF.keys),tu=Ee("avatar-border-color"),Wc=Ee("avatar-bg"),If=Ee("avatar-font-size"),vu=Ee("avatar-size"),XH={borderRadius:"full",border:"0.2em solid",borderColor:tu.reference,[tu.variable]:"white",_dark:{[tu.variable]:"colors.gray.800"}},qH={bg:Wc.reference,fontSize:If.reference,width:vu.reference,height:vu.reference,lineHeight:"1",[Wc.variable]:"colors.gray.200",_dark:{[Wc.variable]:"colors.whiteAlpha.400"}},YH=e=>{const{name:t,theme:n}=e,r=t?r$({string:t}):"colors.gray.400",o=t$(r)(n);let i="white";return o||(i="gray.800"),{bg:Wc.reference,fontSize:If.reference,color:i,borderColor:tu.reference,verticalAlign:"top",width:vu.reference,height:vu.reference,"&:not([data-loaded])":{[Wc.variable]:r},[tu.variable]:"colors.white",_dark:{[tu.variable]:"colors.gray.800"}}},ZH={fontSize:If.reference,lineHeight:"1"},QH=NP(e=>({badge:ir(XH,e),excessLabel:ir(qH,e),container:ir(YH,e),label:ZH}));function Yi(e){const t=e!=="100%"?OP[e]:void 0;return NP({container:{[vu.variable]:t??e,[If.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[vu.variable]:t??e,[If.variable]:`calc(${t??e} / 2.5)`}})}var JH={"2xs":Yi(4),xs:Yi(6),sm:Yi(8),md:Yi(12),lg:Yi(16),xl:Yi(24),"2xl":Yi(32),full:Yi("100%")},eW=KH({baseStyle:QH,sizes:JH,defaultProps:{size:"md"}}),tW={Accordion:jH,Alert:GH,Avatar:eW,Badge:Uc,Breadcrumb:nH,Button:fH,Checkbox:Hp,CloseButton:wH,Code:EH,Container:xH,Divider:IH,Drawer:AV,Editable:DV,Form:$V,FormError:GV,FormLabel:XV,Heading:ZV,Input:rt,Kbd:gU,Link:wU,List:CU,Menu:LU,Modal:GU,NumberInput:tV,PinInput:iV,Popover:yV,Progress:Ez,Radio:Nz,Select:Vz,Skeleton:Wz,SkipLink:Kz,Slider:oU,Spinner:sU,Stat:mU,Switch:w$,Table:O$,Tabs:z$,Tag:ez,Textarea:dz,Tooltip:mz,Card:yH,Stepper:dF},nW={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},rW={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},oW="ltr",iW={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},BP={semanticTokens:nW,direction:oW,...uF,components:tW,styles:rW,config:iW};function Cc(e){return typeof e=="function"}function aW(...e){return t=>e.reduce((n,r)=>r(n),t)}var sW=e=>function(...n){let r=[...n],o=n[n.length-1];return Fj(o)&&r.length>1?r=r.slice(0,r.length-1):o=e,aW(...r.map(i=>a=>Cc(i)?i(a):uW(a,i)))(o)},lW=sW(BP);function uW(...e){return mo({},...e,jP)}function jP(e,t,n,r){if((Cc(e)||Cc(t))&&Object.prototype.hasOwnProperty.call(r,n))return(...o)=>{const i=Cc(e)?e(...o):e,a=Cc(t)?t(...o):t;return mo({},i,a,jP)}}function cW(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var fW=cW();function dW(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function hW(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,a)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(o))return s.get(o);const l=e(r,o,i,a);return s.set(o,l),l}},FP=pW(hW);function $P(e,t){const n={};return Object.keys(e).forEach(r=>{const o=e[r];t(o,r,e)&&(n[r]=o)}),n}var zP=e=>$P(e,t=>t!=null);function mW(e){return typeof e=="function"}function UP(e,...t){return mW(e)?e(...t):e}function yW(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var gW=typeof Element<"u",vW=typeof Map=="function",wW=typeof Set=="function",bW=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function tp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!tp(e[r],t[r]))return!1;return!0}var i;if(vW&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!tp(r.value[1],t.get(r.value[0])))return!1;return!0}if(wW&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(bW&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(gW&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&e.$$typeof)&&!tp(e[o[r]],t[o[r]]))return!1;return!0}return e!==e&&t!==t}var Yb=function(t,n){try{return tp(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const SW=Qe(Yb);function VP(e,t={}){var n;const{styleConfig:r,...o}=t,{theme:i,colorMode:a}=yP(),s=e?FP(i,`components.${e}`):void 0,l=r||s,u=mo({theme:i,colorMode:a},(n=l==null?void 0:l.defaultProps)!=null?n:{},zP(dW(o,["children"]))),c=P.useRef({});if(l){const d=Nj(l)(u);SW(c.current,d)||(c.current=d)}return c.current}function Eo(e,t={}){return VP(e,t)}function Pr(e,t={}){return VP(e,t)}var _W=new Set([...Cj,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),EW=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function CW(e){return EW.has(e)||!_W.has(e)}function xW(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(o in n&&delete n[o],n[o]=r[o]);return n}function HP(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var OW=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,AW=Y6(function(e){return OW.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),PW=AW,TW=function(t){return t!=="theme"},l3=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?PW:TW},u3=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(a){return t.__emotion_forwardProp(a)&&i(a)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},IW=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return nO(n,r,o),UD(function(){return rO(n,r,o)}),null},RW=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,a;n!==void 0&&(i=n.label,a=n.target);var s=u3(t,n,r),l=s||l3(o),u=!l("as");return function(){var c=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&f.push("label:"+i+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{f.push(c[0][0]);for(var d=c.length,h=1;ht=>{const{theme:n,css:r,__css:o,sx:i,...a}=t,s=$P(a,(f,d)=>Oj(d)),l=UP(e,t),u=xW({},o,l,zP(s),i),c=EP(u)(t.theme);return r?[c,r]:c};function $y(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=CW);const o=DW({baseStyle:n}),i=MW(e,r)(o);return ee.forwardRef(function(l,u){const{colorMode:c,forced:f}=X0();return ee.createElement(i,{ref:u,"data-theme":f?c:void 0,...l})})}function LW(){const e=new Map;return new Proxy($y,{apply(t,n,r){return $y(...r)},get(t,n){return e.has(n)||e.set(n,$y(n)),e.get(n)}})}var ne=LW();function de(e){return P.forwardRef(e)}function WP(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,o=P.createContext(void 0);o.displayName=r;function i(){var a;const s=P.useContext(o);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,i),l}return s}return[o.Provider,i,o]}function NW(e){const{cssVarsRoot:t,theme:n,children:r}=e,o=P.useMemo(()=>Sj(n),[n]);return w.jsxs(WD,{theme:o,children:[w.jsx(BW,{root:t}),r]})}function BW({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return w.jsx(R0,{styles:n=>({[t]:n.__cssVars})})}WP({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function jW(e){return WP({name:`${e}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${e} />" `})}function FW(){const{colorMode:e}=X0();return w.jsx(R0,{styles:t=>{const n=FP(t,"styles.global"),r=UP(n,{theme:t,colorMode:e});return r?EP(r)(t):void 0}})}var Zb=P.createContext({getDocument(){return document},getWindow(){return window}});Zb.displayName="EnvironmentContext";function $W({defer:e}={}){const[,t]=P.useReducer(n=>n+1,0);return ai(()=>{e&&t()},[e]),P.useContext(Zb)}function GP(e){const{children:t,environment:n,disabled:r}=e,o=P.useRef(null),i=P.useMemo(()=>n||{getDocument:()=>{var s,l;return(l=(s=o.current)==null?void 0:s.ownerDocument)!=null?l:document},getWindow:()=>{var s,l;return(l=(s=o.current)==null?void 0:s.ownerDocument.defaultView)!=null?l:window}},[n]),a=!r||!n;return w.jsxs(Zb.Provider,{value:i,children:[t,a&&w.jsx("span",{id:"__chakra_env",hidden:!0,ref:o})]})}GP.displayName="EnvironmentProvider";var zW=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetScope:o,resetCSS:i=!0,theme:a={},environment:s,cssVarsRoot:l,disableEnvironment:u,disableGlobalStyle:c}=e,f=w.jsx(GP,{environment:s,disabled:u,children:t});return w.jsx(NW,{theme:a,cssVarsRoot:l,children:w.jsxs(mP,{colorModeManager:n,options:a.config,children:[i?w.jsx(XD,{scope:o}):w.jsx(KD,{}),!c&&w.jsx(FW,{}),r?w.jsx(cO,{zIndex:r,children:f}):f]})})},UW=(e,t)=>e.find(n=>n.id===t);function f3(e,t){const n=KP(e,t),r=n?e[n].findIndex(o=>o.id===t):-1;return{position:n,index:r}}function KP(e,t){for(const[n,r]of Object.entries(e))if(UW(r,t))return n}function VW(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function HW(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,o=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,i=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:o,right:i,left:a}}function Ea(e,t=[]){const n=P.useRef(e);return P.useEffect(()=>{n.current=e}),P.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function WW(e,t){const n=Ea(e);P.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function js(e,t){const n=P.useRef(!1),r=P.useRef(!1);P.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),P.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const XP=P.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),em=P.createContext({}),id=P.createContext(null),tm=typeof document<"u",Kp=tm?P.useLayoutEffect:P.useEffect,qP=P.createContext({strict:!1});function GW(e,t,n,r){const{visualElement:o}=P.useContext(em),i=P.useContext(qP),a=P.useContext(id),s=P.useContext(XP).reducedMotion,l=P.useRef();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return P.useInsertionEffect(()=>{u&&u.update(n,a)}),Kp(()=>{u&&u.render()}),P.useEffect(()=>{u&&u.updateFeatures()}),(window.HandoffAppearAnimations?Kp:P.useEffect)(()=>{u&&u.animationState&&u.animationState.animateChanges()}),u}function Ll(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function KW(e,t,n){return P.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ll(n)&&(n.current=r))},[t])}function Rf(e){return typeof e=="string"||Array.isArray(e)}function nm(e){return typeof e=="object"&&typeof e.start=="function"}const Qb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Jb=["initial",...Qb];function rm(e){return nm(e.animate)||Jb.some(t=>Rf(e[t]))}function YP(e){return!!(rm(e)||e.variants)}function XW(e,t){if(rm(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Rf(n)?n:void 0,animate:Rf(r)?r:void 0}}return e.inherit!==!1?t:{}}function qW(e){const{initial:t,animate:n}=XW(e,P.useContext(em));return P.useMemo(()=>({initial:t,animate:n}),[d3(t),d3(n)])}function d3(e){return Array.isArray(e)?e.join(" "):e}const h3={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},kf={};for(const e in h3)kf[e]={isEnabled:t=>h3[e].some(n=>!!t[n])};function YW(e){for(const t in e)kf[t]={...kf[t],...e[t]}}const eS=P.createContext({}),ZP=P.createContext({}),ZW=Symbol.for("motionComponentSymbol");function QW({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&YW(e);function i(s,l){let u;const c={...P.useContext(XP),...s,layoutId:JW(s)},{isStatic:f}=c,d=qW(s),h=r(s,f);if(!f&&tm){d.visualElement=GW(o,h,c,t);const p=P.useContext(ZP),m=P.useContext(qP).strict;d.visualElement&&(u=d.visualElement.loadFeatures(c,m,e,p))}return P.createElement(em.Provider,{value:d},u&&d.visualElement?P.createElement(u,{visualElement:d.visualElement,...c}):null,n(o,s,KW(h,d.visualElement,l),h,f,d.visualElement))}const a=P.forwardRef(i);return a[ZW]=o,a}function JW({layoutId:e}){const t=P.useContext(eS).id;return t&&e!==void 0?t+"-"+e:e}function eG(e){function t(r,o={}){return QW(e(r,o))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,o)=>(n.has(o)||n.set(o,t(o)),n.get(o))})}const tG=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function tS(e){return typeof e!="string"||e.includes("-")?!1:!!(tG.indexOf(e)>-1||/[A-Z]/.test(e))}const Xp={};function nG(e){Object.assign(Xp,e)}const ad=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ks=new Set(ad);function QP(e,{layout:t,layoutId:n}){return Ks.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Xp[e]||e==="opacity")}const Ar=e=>!!(e&&e.getVelocity),rG={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},oG=ad.length;function iG(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let i="";for(let a=0;at=>typeof t=="string"&&t.startsWith(e),eT=JP("--"),h2=JP("var(--"),aG=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,sG=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ia=(e,t,n)=>Math.min(Math.max(n,e),t),Xs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Gc={...Xs,transform:e=>Ia(0,1,e)},ch={...Xs,default:1},Kc=e=>Math.round(e*1e5)/1e5,om=/(-)?([\d]*\.?[\d])+/g,tT=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,lG=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function sd(e){return typeof e=="string"}const ld=e=>({test:t=>sd(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),na=ld("deg"),ci=ld("%"),Pe=ld("px"),uG=ld("vh"),cG=ld("vw"),p3={...ci,parse:e=>ci.parse(e)/100,transform:e=>ci.transform(e*100)},m3={...Xs,transform:Math.round},nT={borderWidth:Pe,borderTopWidth:Pe,borderRightWidth:Pe,borderBottomWidth:Pe,borderLeftWidth:Pe,borderRadius:Pe,radius:Pe,borderTopLeftRadius:Pe,borderTopRightRadius:Pe,borderBottomRightRadius:Pe,borderBottomLeftRadius:Pe,width:Pe,maxWidth:Pe,height:Pe,maxHeight:Pe,size:Pe,top:Pe,right:Pe,bottom:Pe,left:Pe,padding:Pe,paddingTop:Pe,paddingRight:Pe,paddingBottom:Pe,paddingLeft:Pe,margin:Pe,marginTop:Pe,marginRight:Pe,marginBottom:Pe,marginLeft:Pe,rotate:na,rotateX:na,rotateY:na,rotateZ:na,scale:ch,scaleX:ch,scaleY:ch,scaleZ:ch,skew:na,skewX:na,skewY:na,distance:Pe,translateX:Pe,translateY:Pe,translateZ:Pe,x:Pe,y:Pe,z:Pe,perspective:Pe,transformPerspective:Pe,opacity:Gc,originX:p3,originY:p3,originZ:Pe,zIndex:m3,fillOpacity:Gc,strokeOpacity:Gc,numOctaves:m3};function nS(e,t,n,r){const{style:o,vars:i,transform:a,transformOrigin:s}=e;let l=!1,u=!1,c=!0;for(const f in t){const d=t[f];if(eT(f)){i[f]=d;continue}const h=nT[f],p=sG(d,h);if(Ks.has(f)){if(l=!0,a[f]=p,!c)continue;d!==(h.default||0)&&(c=!1)}else f.startsWith("origin")?(u=!0,s[f]=p):o[f]=p}if(t.transform||(l||r?o.transform=iG(e.transform,n,c,r):o.transform&&(o.transform="none")),u){const{originX:f="50%",originY:d="50%",originZ:h=0}=s;o.transformOrigin=`${f} ${d} ${h}`}}const rS=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rT(e,t,n){for(const r in t)!Ar(t[r])&&!QP(r,n)&&(e[r]=t[r])}function fG({transformTemplate:e},t,n){return P.useMemo(()=>{const r=rS();return nS(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function dG(e,t,n){const r=e.style||{},o={};return rT(o,r,e),Object.assign(o,fG(e,t,n)),e.transformValues?e.transformValues(o):o}function hG(e,t,n){const r={},o=dG(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const pG=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function qp(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||pG.has(e)}let oT=e=>!qp(e);function mG(e){e&&(oT=t=>t.startsWith("on")?!qp(t):e(t))}try{mG(require("@emotion/is-prop-valid").default)}catch{}function yG(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(oT(o)||n===!0&&qp(o)||!t&&!qp(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function y3(e,t,n){return typeof e=="string"?e:Pe.transform(t+n*e)}function gG(e,t,n){const r=y3(t,e.x,e.width),o=y3(n,e.y,e.height);return`${r} ${o}`}const vG={offset:"stroke-dashoffset",array:"stroke-dasharray"},wG={offset:"strokeDashoffset",array:"strokeDasharray"};function bG(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?vG:wG;e[i.offset]=Pe.transform(-r);const a=Pe.transform(t),s=Pe.transform(n);e[i.array]=`${a} ${s}`}function oS(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...u},c,f,d){if(nS(e,u,c,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:m}=e;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(o!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=gG(m,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),a!==void 0&&bG(h,a,s,l,!1)}const iT=()=>({...rS(),attrs:{}}),iS=e=>typeof e=="string"&&e.toLowerCase()==="svg";function SG(e,t,n,r){const o=P.useMemo(()=>{const i=iT();return oS(i,t,{enableHardwareAcceleration:!1},iS(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};rT(i,e.style,e),o.style={...i,...o.style}}return o}function _G(e=!1){return(n,r,o,{latestValues:i},a)=>{const l=(tS(n)?SG:hG)(r,i,a,n),c={...yG(r,typeof n=="string",e),...l,ref:o},{children:f}=r,d=P.useMemo(()=>Ar(f)?f.get():f,[f]);return P.createElement(n,{...c,children:d})}}const aS=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function aT(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const sT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function lT(e,t,n,r){aT(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(sT.has(o)?o:aS(o),t.attrs[o])}function sS(e,t){const{style:n}=e,r={};for(const o in n)(Ar(n[o])||t.style&&Ar(t.style[o])||QP(o,e))&&(r[o]=n[o]);return r}function uT(e,t){const n=sS(e,t);for(const r in e)if(Ar(e[r])||Ar(t[r])){const o=ad.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[o]=e[r]}return n}function lS(e,t,n,r={},o={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),t}function cT(e){const t=P.useRef(null);return t.current===null&&(t.current=e()),t.current}const Yp=e=>Array.isArray(e),EG=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),CG=e=>Yp(e)?e[e.length-1]||0:e;function np(e){const t=Ar(e)?e.get():e;return EG(t)?t.toValue():t}function xG({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const a={latestValues:OG(r,o,i,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const fT=e=>(t,n)=>{const r=P.useContext(em),o=P.useContext(id),i=()=>xG(e,t,r,o);return n?i():cT(i)};function OG(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=np(i[d]);let{initial:a,animate:s}=e;const l=rm(e),u=YP(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=n?n.initial===!1:!1;c=c||a===!1;const f=c?s:a;return f&&typeof f!="boolean"&&!nm(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=lS(e,h);if(!p)return;const{transitionEnd:m,transition:_,...b}=p;for(const g in b){let E=b[g];if(Array.isArray(E)){const T=c?E.length-1:0;E=E[T]}E!==null&&(o[g]=E)}for(const g in m)o[g]=m[g]}),o}const AG={useVisualState:fT({scrapeMotionValuesFromProps:uT,createRenderState:iT,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}oS(n,r,{enableHardwareAcceleration:!1},iS(t.tagName),e.transformTemplate),lT(t,n)}})},PG={useVisualState:fT({scrapeMotionValuesFromProps:sS,createRenderState:rS})};function TG(e,{forwardMotionProps:t=!1},n,r){return{...tS(e)?AG:PG,preloadedFeatures:n,useRender:_G(t),createVisualElement:r,Component:e}}function Ai(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const dT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function im(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const IG=e=>t=>dT(t)&&e(t,im(t));function Ii(e,t,n,r){return Ai(e,t,IG(n),r)}const RG=(e,t)=>n=>t(e(n)),Ca=(...e)=>e.reduce(RG);function hT(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const g3=hT("dragHorizontal"),v3=hT("dragVertical");function pT(e){let t=!1;if(e==="y")t=v3();else if(e==="x")t=g3();else{const n=g3(),r=v3();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function mT(){const e=pT(!0);return e?(e(),!1):!0}class Ba{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Gt=e=>e;function kG(e){let t=[],n=[],r=0,o=!1,i=!1;const a=new WeakSet,s={schedule:(l,u=!1,c=!1)=>{const f=c&&o,d=f?t:n;return u&&a.add(l),d.indexOf(l)===-1&&(d.push(l),f&&o&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(o){i=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(f[d]=kG(()=>n=!0),f),{}),a=f=>i[f].process(o),s=f=>{n=!1,o.delta=r?1e3/60:Math.max(Math.min(f-o.timestamp,MG),1),o.timestamp=f,o.isProcessing=!0,fh.forEach(a),o.isProcessing=!1,n&&t&&(r=!1,e(s))},l=()=>{n=!0,r=!0,o.isProcessing||e(s)};return{schedule:fh.reduce((f,d)=>{const h=i[d];return f[d]=(p,m=!1,_=!1)=>(n||l(),h.schedule(p,m,_)),f},{}),cancel:f=>fh.forEach(d=>i[d].cancel(f)),state:o,steps:i}}const{schedule:Tt,cancel:Bi,state:Vn,steps:zy}=DG(typeof requestAnimationFrame<"u"?requestAnimationFrame:Gt,!0);function w3(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),o=(i,a)=>{if(i.type==="touch"||mT())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t),s[r]&&Tt.update(()=>s[r](i,a))};return Ii(e.current,n,o,{passive:!e.getProps()[r]})}class LG extends Ba{mount(){this.unmount=Ca(w3(this.node,!0),w3(this.node,!1))}unmount(){}}class NG extends Ba{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ca(Ai(this.node.current,"focus",()=>this.onFocus()),Ai(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const yT=(e,t)=>t?e===t?!0:yT(e,t.parentElement):!1;function Uy(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,im(n))}class BG extends Ba{constructor(){super(...arguments),this.removeStartListeners=Gt,this.removeEndListeners=Gt,this.removeAccessibleListeners=Gt,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),i=Ii(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();Tt.update(()=>{yT(this.node.current,s.target)?u&&u(s,l):c&&c(s,l)})},{passive:!(r.onTap||r.onPointerUp)}),a=Ii(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=Ca(i,a),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=i=>{if(i.key!=="Enter"||this.isPressing)return;const a=s=>{s.key!=="Enter"||!this.checkPressEnd()||Uy("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Tt.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Ai(this.node.current,"keyup",a),Uy("down",(s,l)=>{this.startPress(s,l)})},n=Ai(this.node.current,"keydown",t),r=()=>{this.isPressing&&Uy("cancel",(i,a)=>this.cancelPress(i,a))},o=Ai(this.node.current,"blur",r);this.removeAccessibleListeners=Ca(n,o)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Tt.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!mT()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Tt.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Ii(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Ai(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ca(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const p2=new WeakMap,Vy=new WeakMap,jG=e=>{const t=p2.get(e.target);t&&t(e)},FG=e=>{e.forEach(jG)};function $G({root:e,...t}){const n=e||document;Vy.has(n)||Vy.set(n,{});const r=Vy.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(FG,{root:e,...t})),r[o]}function zG(e,t,n){const r=$G(t);return p2.set(e,n),r.observe(e),()=>{p2.delete(e),r.unobserve(e)}}const UG={some:0,all:1};class VG extends Ba{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:UG[o]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),d=u?c:f;d&&d(l)};return zG(this.node.current,a,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(HG(t,n))&&this.startObserver()}unmount(){}}function HG({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const WG={inView:{Feature:VG},tap:{Feature:BG},focus:{Feature:NG},hover:{Feature:LG}};function gT(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rt[r]=n.get()),t}function KG(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function am(e,t,n){const r=e.getProps();return lS(r,t,n!==void 0?n:r.custom,GG(e),KG(e))}const XG="framerAppearId",qG="data-"+aS(XG);let YG=Gt,uS=Gt;const xa=e=>e*1e3,Ri=e=>e/1e3,ZG={current:!1},vT=e=>Array.isArray(e)&&typeof e[0]=="number";function wT(e){return!!(!e||typeof e=="string"&&bT[e]||vT(e)||Array.isArray(e)&&e.every(wT))}const xc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xc([0,.65,.55,1]),circOut:xc([.55,0,1,.45]),backIn:xc([.31,.01,.66,-.59]),backOut:xc([.33,1.53,.69,.99])};function ST(e){if(e)return vT(e)?xc(e):Array.isArray(e)?e.map(ST):bT[e]}function QG(e,t,n,{delay:r=0,duration:o,repeat:i=0,repeatType:a="loop",ease:s,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=ST(s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:o,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"})}function JG(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const _T=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,eK=1e-7,tK=12;function nK(e,t,n,r,o){let i,a,s=0;do a=t+(n-t)/2,i=_T(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>eK&&++snK(i,0,1,e,n);return i=>i===0||i===1?i:_T(o(i),t,r)}const rK=ud(.42,0,1,1),oK=ud(0,0,.58,1),ET=ud(.42,0,.58,1),iK=e=>Array.isArray(e)&&typeof e[0]!="number",CT=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xT=e=>t=>1-e(1-t),OT=e=>1-Math.sin(Math.acos(e)),cS=xT(OT),aK=CT(cS),AT=ud(.33,1.53,.69,.99),fS=xT(AT),sK=CT(fS),lK=e=>(e*=2)<1?.5*fS(e):.5*(2-Math.pow(2,-10*(e-1))),uK={linear:Gt,easeIn:rK,easeInOut:ET,easeOut:oK,circIn:OT,circInOut:aK,circOut:cS,backIn:fS,backInOut:sK,backOut:AT,anticipate:lK},b3=e=>{if(Array.isArray(e)){uS(e.length===4);const[t,n,r,o]=e;return ud(t,n,r,o)}else if(typeof e=="string")return uK[e];return e},dS=(e,t)=>n=>!!(sd(n)&&lG.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),PT=(e,t,n)=>r=>{if(!sd(r))return r;const[o,i,a,s]=r.match(om);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},cK=e=>Ia(0,255,e),Hy={...Xs,transform:e=>Math.round(cK(e))},ms={test:dS("rgb","red"),parse:PT("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Hy.transform(e)+", "+Hy.transform(t)+", "+Hy.transform(n)+", "+Kc(Gc.transform(r))+")"};function fK(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const m2={test:dS("#"),parse:fK,transform:ms.transform},Nl={test:dS("hsl","hue"),parse:PT("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ci.transform(Kc(t))+", "+ci.transform(Kc(n))+", "+Kc(Gc.transform(r))+")"},er={test:e=>ms.test(e)||m2.test(e)||Nl.test(e),parse:e=>ms.test(e)?ms.parse(e):Nl.test(e)?Nl.parse(e):m2.parse(e),transform:e=>sd(e)?e:e.hasOwnProperty("red")?ms.transform(e):Nl.transform(e)},jt=(e,t,n)=>-n*e+n*t+e;function Wy(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function dK({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,a=0;if(!t)o=i=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=Wy(l,s,e+1/3),i=Wy(l,s,e),a=Wy(l,s,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}const Gy=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},hK=[m2,ms,Nl],pK=e=>hK.find(t=>t.test(e));function S3(e){const t=pK(e);let n=t.parse(e);return t===Nl&&(n=dK(n)),n}const TT=(e,t)=>{const n=S3(e),r=S3(t),o={...n};return i=>(o.red=Gy(n.red,r.red,i),o.green=Gy(n.green,r.green,i),o.blue=Gy(n.blue,r.blue,i),o.alpha=jt(n.alpha,r.alpha,i),ms.transform(o))};function mK(e){var t,n;return isNaN(e)&&sd(e)&&(((t=e.match(om))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(tT))===null||n===void 0?void 0:n.length)||0)>0}const IT={regex:aG,countKey:"Vars",token:"${v}",parse:Gt},RT={regex:tT,countKey:"Colors",token:"${c}",parse:er.parse},kT={regex:om,countKey:"Numbers",token:"${n}",parse:Xs.parse};function Ky(e,{regex:t,countKey:n,token:r,parse:o}){const i=e.tokenised.match(t);i&&(e["num"+n]=i.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...i.map(o)))}function Zp(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Ky(n,IT),Ky(n,RT),Ky(n,kT),n}function MT(e){return Zp(e).values}function DT(e){const{values:t,numColors:n,numVars:r,tokenised:o}=Zp(e),i=t.length;return a=>{let s=o;for(let l=0;ltypeof e=="number"?0:e;function gK(e){const t=MT(e);return DT(e)(t.map(yK))}const Ra={test:mK,parse:MT,createTransformer:DT,getAnimatableNone:gK},LT=(e,t)=>n=>`${n>0?t:e}`;function NT(e,t){return typeof e=="number"?n=>jt(e,t,n):er.test(e)?TT(e,t):e.startsWith("var(")?LT(e,t):jT(e,t)}const BT=(e,t)=>{const n=[...e],r=n.length,o=e.map((i,a)=>NT(i,t[a]));return i=>{for(let a=0;a{const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=NT(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}},jT=(e,t)=>{const n=Ra.createTransformer(t),r=Zp(e),o=Zp(t);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?Ca(BT(r.values,o.values),n):LT(e,t)},Mf=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},_3=(e,t)=>n=>jt(e,t,n);function wK(e){return typeof e=="number"?_3:typeof e=="string"?er.test(e)?TT:jT:Array.isArray(e)?BT:typeof e=="object"?vK:_3}function bK(e,t,n){const r=[],o=n||wK(e[0]),i=e.length-1;for(let a=0;at[0];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=bK(t,r,o),s=a.length,l=u=>{let c=0;if(s>1)for(;cl(Ia(e[0],e[i-1],u)):l}function SK(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Mf(0,t,r);e.push(jt(n,1,o))}}function _K(e){const t=[0];return SK(t,e.length-1),t}function EK(e,t){return e.map(n=>n*t)}function CK(e,t){return e.map(()=>t||ET).splice(0,e.length-1)}function Qp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=iK(r)?r.map(b3):b3(r),i={done:!1,value:t[0]},a=EK(n&&n.length===t.length?n:_K(t),e),s=FT(a,t,{ease:Array.isArray(o)?o:CK(t,o)});return{calculatedDuration:e,next:l=>(i.value=s(l),i.done=l>=e,i)}}function $T(e,t){return t?e*(1e3/t):0}const xK=5;function zT(e,t,n){const r=Math.max(t-xK,0);return $T(n-e(r),t-r)}const Xy=.001,OK=.01,E3=10,AK=.05,PK=1;function TK({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;YG(e<=xa(E3));let a=1-t;a=Ia(AK,PK,a),e=Ia(OK,E3,Ri(e)),a<1?(o=u=>{const c=u*a,f=c*e,d=c-n,h=y2(u,a),p=Math.exp(-f);return Xy-d/h*p},i=u=>{const f=u*a*e,d=f*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-f),m=y2(Math.pow(u,2),a);return(-o(u)+Xy>0?-1:1)*((d-h)*p)/m}):(o=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-Xy+c*f},i=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const s=5/e,l=RK(o,i,s);if(e=xa(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const IK=12;function RK(e,t,n){let r=n;for(let o=1;oe[n]!==void 0)}function DK(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!C3(e,MK)&&C3(e,kK)){const n=TK(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function UT({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],a={done:!1,value:o},{stiffness:s,damping:l,mass:u,velocity:c,duration:f,isResolvedFromDuration:d}=DK(r),h=c?-Ri(c):0,p=l/(2*Math.sqrt(s*u)),m=i-o,_=Ri(Math.sqrt(s/u)),b=Math.abs(m)<5;n||(n=b?.01:2),t||(t=b?.005:.5);let g;if(p<1){const E=y2(_,p);g=T=>{const O=Math.exp(-p*_*T);return i-O*((h+p*_*m)/E*Math.sin(E*T)+m*Math.cos(E*T))}}else if(p===1)g=E=>i-Math.exp(-_*E)*(m+(h+_*m)*E);else{const E=_*Math.sqrt(p*p-1);g=T=>{const O=Math.exp(-p*_*T),A=Math.min(E*T,300);return i-O*((h+p*_*m)*Math.sinh(A)+E*m*Math.cosh(A))/E}}return{calculatedDuration:d&&f||null,next:E=>{const T=g(E);if(d)a.done=E>=f;else{let O=h;E!==0&&(p<1?O=zT(g,E,T):O=0);const A=Math.abs(O)<=n,C=Math.abs(i-T)<=t;a.done=A&&C}return a.value=a.done?i:T,a}}}function x3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],d={done:!1,value:f},h=y=>s!==void 0&&yl,p=y=>s===void 0?l:l===void 0||Math.abs(s-y)-m*Math.exp(-y/r),E=y=>b+g(y),T=y=>{const S=g(y),v=E(y);d.done=Math.abs(S)<=u,d.value=d.done?b:v};let O,A;const C=y=>{h(d.value)&&(O=y,A=UT({keyframes:[d.value,p(d.value)],velocity:zT(E,y,d.value),damping:o,stiffness:i,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:y=>{let S=!1;return!A&&O===void 0&&(S=!0,T(y),C(y)),O!==void 0&&y>O?A.next(y-O):(!S&&T(y),d)}}}const LK=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Tt.update(t,!0),stop:()=>Bi(t),now:()=>Vn.isProcessing?Vn.timestamp:performance.now()}},O3=2e4;function A3(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=O3?1/0:t}const NK={decay:x3,inertia:x3,tween:Qp,keyframes:Qp,spring:UT};function Jp({autoplay:e=!0,delay:t=0,driver:n=LK,keyframes:r,type:o="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:f,...d}){let h=1,p=!1,m,_;const b=()=>{_=new Promise(B=>{m=B})};b();let g;const E=NK[o]||Qp;let T;E!==Qp&&typeof r[0]!="number"&&(T=FT([0,100],r,{clamp:!1}),r=[0,100]);const O=E({...d,keyframes:r});let A;s==="mirror"&&(A=E({...d,keyframes:[...r].reverse(),velocity:-(d.velocity||0)}));let C="idle",y=null,S=null,v=null;O.calculatedDuration===null&&i&&(O.calculatedDuration=A3(O));const{calculatedDuration:x}=O;let I=1/0,R=1/0;x!==null&&(I=x+a,R=I*(i+1)-a);let k=0;const M=B=>{if(S===null)return;h>0&&(S=Math.min(S,B)),h<0&&(S=Math.min(B-R/h,S)),y!==null?k=y:k=Math.round(B-S)*h;const U=k-t*(h>=0?1:-1),K=h>=0?U<0:U>R;k=Math.max(U,0),C==="finished"&&y===null&&(k=R);let W=k,Q=O;if(i){const le=k/I;let ge=Math.floor(le),se=le%1;!se&&le>=1&&(se=1),se===1&&ge--,ge=Math.min(ge,i+1);const ue=!!(ge%2);ue&&(s==="reverse"?(se=1-se,a&&(se-=a/I)):s==="mirror"&&(Q=A));let Ie=Ia(0,1,se);k>R&&(Ie=s==="reverse"&&ue?1:0),W=Ie*I}const X=K?{done:!1,value:r[0]}:Q.next(W);T&&(X.value=T(X.value));let{done:J}=X;!K&&x!==null&&(J=h>=0?k>=R:k<=0);const te=y===null&&(C==="finished"||C==="running"&&J);return f&&f(X.value),te&&L(),X},N=()=>{g&&g.stop(),g=void 0},D=()=>{C="idle",N(),m(),b(),S=v=null},L=()=>{C="finished",c&&c(),N(),m()},j=()=>{if(p)return;g||(g=n(M));const B=g.now();l&&l(),y!==null?S=B-y:(!S||C==="finished")&&(S=B),C==="finished"&&b(),v=S,y=null,C="running",g.start()};e&&j();const F={then(B,U){return _.then(B,U)},get time(){return Ri(k)},set time(B){B=xa(B),k=B,y!==null||!g||h===0?y=B:S=g.now()-B/h},get duration(){const B=O.calculatedDuration===null?A3(O):O.calculatedDuration;return Ri(B)},get speed(){return h},set speed(B){B===h||!g||(h=B,F.time=Ri(k))},get state(){return C},play:j,pause:()=>{C="paused",y=k},stop:()=>{p=!0,C!=="idle"&&(C="idle",u&&u(),D())},cancel:()=>{v!==null&&M(v),D()},complete:()=>{C="finished"},sample:B=>(S=0,M(B))};return F}function BK(e){let t;return()=>(t===void 0&&(t=e()),t)}const jK=BK(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),FK=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),dh=10,$K=2e4,zK=(e,t)=>t.type==="spring"||e==="backgroundColor"||!wT(t.ease);function UK(e,t,{onUpdate:n,onComplete:r,...o}){if(!(jK()&&FK.has(t)&&!o.repeatDelay&&o.repeatType!=="mirror"&&o.damping!==0&&o.type!=="inertia"))return!1;let a=!1,s,l;const u=()=>{l=new Promise(g=>{s=g})};u();let{keyframes:c,duration:f=300,ease:d,times:h}=o;if(zK(t,o)){const g=Jp({...o,repeat:0,delay:0});let E={done:!1,value:c[0]};const T=[];let O=0;for(;!E.done&&O<$K;)E=g.sample(O),T.push(E.value),O+=dh;h=void 0,c=T,f=O-dh,d="linear"}const p=QG(e.owner.current,t,c,{...o,duration:f,ease:d,times:h}),m=()=>p.cancel(),_=()=>{Tt.update(m),s(),u()};return p.onfinish=()=>{e.set(JG(c,o)),r&&r(),_()},{then(g,E){return l.then(g,E)},attachTimeline(g){return p.timeline=g,p.onfinish=null,Gt},get time(){return Ri(p.currentTime||0)},set time(g){p.currentTime=xa(g)},get speed(){return p.playbackRate},set speed(g){p.playbackRate=g},get duration(){return Ri(f)},play:()=>{a||(p.play(),Bi(m))},pause:()=>p.pause(),stop:()=>{if(a=!0,p.playState==="idle")return;const{currentTime:g}=p;if(g){const E=Jp({...o,autoplay:!1});e.setWithVelocity(E.sample(g-dh).value,E.sample(g).value,dh)}_()},complete:()=>p.finish(),cancel:_}}function VK({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Gt,pause:Gt,stop:Gt,then:i=>(i(),Promise.resolve()),cancel:Gt,complete:Gt});return t?Jp({keyframes:[0,1],duration:0,delay:t,onComplete:o}):o()}const HK={type:"spring",stiffness:500,damping:25,restSpeed:10},WK=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),GK={type:"keyframes",duration:.8},KK={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},XK=(e,{keyframes:t})=>t.length>2?GK:Ks.has(e)?e.startsWith("scale")?WK(t[1]):HK:KK,g2=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ra.test(t)||t==="0")&&!t.startsWith("url(")),qK=new Set(["brightness","contrast","saturate","opacity"]);function YK(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(om)||[];if(!r)return e;const o=n.replace(r,"");let i=qK.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const ZK=/([a-z-]*)\(.*?\)/g,v2={...Ra,getAnimatableNone:e=>{const t=e.match(ZK);return t?t.map(YK).join(" "):e}},QK={...nT,color:er,backgroundColor:er,outlineColor:er,fill:er,stroke:er,borderColor:er,borderTopColor:er,borderRightColor:er,borderBottomColor:er,borderLeftColor:er,filter:v2,WebkitFilter:v2},hS=e=>QK[e];function VT(e,t){let n=hS(e);return n!==v2&&(n=Ra),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const HT=e=>/^0[^.\s]+$/.test(e);function JK(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||HT(e)}function eX(e,t,n,r){const o=g2(t,n);let i;Array.isArray(n)?i=[...n]:i=[null,n];const a=r.from!==void 0?r.from:e.get();let s;const l=[];for(let u=0;uo=>{const i=WT(r,e)||{},a=i.delay||r.delay||0;let{elapsed:s=0}=r;s=s-xa(a);const l=eX(t,e,n,i),u=l[0],c=l[l.length-1],f=g2(e,u),d=g2(e,c);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...i,delay:-s,onUpdate:p=>{t.set(p),i.onUpdate&&i.onUpdate(p)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(tX(i)||(h={...h,...XK(e,h)}),h.duration&&(h.duration=xa(h.duration)),h.repeatDelay&&(h.repeatDelay=xa(h.repeatDelay)),!f||!d||ZG.current||i.type===!1)return VK(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=UK(t,e,h);if(p)return p}return Jp(h)};function e1(e){return!!(Ar(e)&&e.add)}const nX=e=>/^\-?\d*\.?\d+$/.test(e);function mS(e,t){e.indexOf(t)===-1&&e.push(t)}function yS(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class gS{constructor(){this.subscriptions=[]}add(t){return mS(this.subscriptions,t),()=>yS(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class oX{constructor(t,n={}){this.version="10.15.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,o=!0)=>{this.prev=this.current,this.current=r;const{delta:i,timestamp:a}=Vn;this.lastUpdated!==a&&(this.timeDelta=i,this.lastUpdated=a,Tt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Tt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=rX(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new gS);const r=this.events[t].add(n);return t==="change"?()=>{r(),Tt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$T(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wu(e,t){return new oX(e,t)}const GT=e=>t=>t.test(e),iX={test:e=>e==="auto",parse:e=>e},KT=[Xs,Pe,ci,na,cG,uG,iX],sc=e=>KT.find(GT(e)),aX=[...KT,er,Ra],sX=e=>aX.find(GT(e));function lX(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,wu(n))}function uX(e,t){const n=am(e,t);let{transitionEnd:r={},transition:o={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const a in i){const s=CG(i[a]);lX(e,a,s)}}function cX(e,t,n){var r,o;const i=Object.keys(t).filter(s=>!e.hasValue(s)),a=i.length;if(a)for(let s=0;sl.remove(f))),u.push(m)}return a&&Promise.all(u).then(()=>{a&&uX(e,a)}),u}function w2(e,t,n={}){const r=am(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(XT(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:f}=o;return pX(e,t,u+l,c,f,n)}:()=>Promise.resolve(),{when:s}=o;if(s){const[l,u]=s==="beforeChildren"?[i,a]:[a,i];return l().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function pX(e,t,n=0,r=0,o=1,i){const a=[],s=(e.variantChildren.size-1)*r,l=o===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(mX).forEach((u,c)=>{u.notify("AnimationStart",t),a.push(w2(u,t,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function mX(e,t){return e.sortNodePosition(t)}function yX(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>w2(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=w2(e,t,n);else{const o=typeof t=="function"?am(e,t,n.custom):t;r=Promise.all(XT(e,o,n))}return r.then(()=>e.notify("AnimationComplete",t))}const gX=[...Qb].reverse(),vX=Qb.length;function wX(e){return t=>Promise.all(t.map(({animation:n,options:r})=>yX(e,n,r)))}function bX(e){let t=wX(e);const n=_X();let r=!0;const o=(l,u)=>{const c=am(e,u);if(c){const{transition:f,transitionEnd:d,...h}=c;l={...l,...h,...d}}return l};function i(l){t=l(e)}function a(l,u){const c=e.getProps(),f=e.getVariantContext(!0)||{},d=[],h=new Set;let p={},m=1/0;for(let b=0;bm&&O;const v=Array.isArray(T)?T:[T];let x=v.reduce(o,{});A===!1&&(x={});const{prevResolvedValues:I={}}=E,R={...I,...x},k=M=>{S=!0,h.delete(M),E.needsAnimating[M]=!0};for(const M in R){const N=x[M],D=I[M];p.hasOwnProperty(M)||(N!==D?Yp(N)&&Yp(D)?!gT(N,D)||y?k(M):E.protectedKeys[M]=!0:N!==void 0?k(M):h.add(M):N!==void 0&&h.has(M)?k(M):E.protectedKeys[M]=!0)}E.prevProp=T,E.prevResolvedValues=x,E.isActive&&(p={...p,...x}),r&&e.blockInitialAnimation&&(S=!1),S&&!C&&d.push(...v.map(M=>({animation:M,options:{type:g,...l}})))}if(h.size){const b={};h.forEach(g=>{const E=e.getBaseTarget(g);E!==void 0&&(b[g]=E)}),d.push({animation:b})}let _=!!d.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,_?t(d):Promise.resolve()}function s(l,u,c){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=a(c,l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:a,setActive:s,setAnimateFunction:i,getState:()=>n}}function SX(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gT(t,e):!1}function qa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _X(){return{animate:qa(!0),whileInView:qa(),whileHover:qa(),whileTap:qa(),whileDrag:qa(),whileFocus:qa(),exit:qa()}}class EX extends Ba{constructor(t){super(t),t.animationState||(t.animationState=bX(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),nm(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let CX=0;class xX extends Ba{constructor(){super(...arguments),this.id=CX++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const i=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const OX={animation:{Feature:EX},exit:{Feature:xX}},P3=(e,t)=>Math.abs(e-t);function AX(e,t){const n=P3(e.x,t.x),r=P3(e.y,t.y);return Math.sqrt(n**2+r**2)}class qT{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=Yy(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,f=AX(u.offset,{x:0,y:0})>=3;if(!c&&!f)return;const{point:d}=u,{timestamp:h}=Vn;this.history.push({...d,timestamp:h});const{onStart:p,onMove:m}=this.handlers;c||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=qy(c,this.transformPagePoint),Tt.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,h=Yy(u.type==="pointercancel"?this.lastMoveEventInfo:qy(c,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,h),d&&d(u,h)},!dT(t))return;this.handlers=n,this.transformPagePoint=r;const o=im(t),i=qy(o,this.transformPagePoint),{point:a}=i,{timestamp:s}=Vn;this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,Yy(i,this.history)),this.removeListeners=Ca(Ii(window,"pointermove",this.handlePointerMove),Ii(window,"pointerup",this.handlePointerUp),Ii(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Bi(this.updatePoint)}}function qy(e,t){return t?{point:t(e.point)}:e}function T3(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Yy({point:e},t){return{point:e,delta:T3(e,YT(t)),offset:T3(e,PX(t)),velocity:TX(t,.1)}}function PX(e){return e[0]}function YT(e){return e[e.length-1]}function TX(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=YT(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>xa(t)));)n--;if(!r)return{x:0,y:0};const i=Ri(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Yr(e){return e.max-e.min}function b2(e,t=0,n=.01){return Math.abs(e-t)<=n}function I3(e,t,n,r=.5){e.origin=r,e.originPoint=jt(t.min,t.max,e.origin),e.scale=Yr(n)/Yr(t),(b2(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=jt(n.min,n.max,e.origin)-e.originPoint,(b2(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Xc(e,t,n,r){I3(e.x,t.x,n.x,r?r.originX:void 0),I3(e.y,t.y,n.y,r?r.originY:void 0)}function R3(e,t,n){e.min=n.min+t.min,e.max=e.min+Yr(t)}function IX(e,t,n){R3(e.x,t.x,n.x),R3(e.y,t.y,n.y)}function k3(e,t,n){e.min=t.min-n.min,e.max=e.min+Yr(t)}function qc(e,t,n){k3(e.x,t.x,n.x),k3(e.y,t.y,n.y)}function RX(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?jt(n,e,r.max):Math.min(e,n)),e}function M3(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function kX(e,{top:t,left:n,bottom:r,right:o}){return{x:M3(e.x,n,o),y:M3(e.y,t,r)}}function D3(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Mf(t.min,t.max-r,e.min):r>o&&(n=Mf(e.min,e.max-o,t.min)),Ia(0,1,n)}function LX(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const S2=.35;function NX(e=S2){return e===!1?e=0:e===!0&&(e=S2),{x:L3(e,"left","right"),y:L3(e,"top","bottom")}}function L3(e,t,n){return{min:N3(e,t),max:N3(e,n)}}function N3(e,t){return typeof e=="number"?e:e[t]||0}const B3=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bl=()=>({x:B3(),y:B3()}),j3=()=>({min:0,max:0}),nn=()=>({x:j3(),y:j3()});function Xo(e){return[e("x"),e("y")]}function ZT({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function BX({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function jX(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Zy(e){return e===void 0||e===1}function _2({scale:e,scaleX:t,scaleY:n}){return!Zy(e)||!Zy(t)||!Zy(n)}function ts(e){return _2(e)||QT(e)||e.z||e.rotate||e.rotateX||e.rotateY}function QT(e){return F3(e.x)||F3(e.y)}function F3(e){return e&&e!=="0%"}function t1(e,t,n){const r=e-n,o=t*r;return n+o}function $3(e,t,n,r,o){return o!==void 0&&(e=t1(e,o,r)),t1(e,n,r)+t}function E2(e,t=0,n=1,r,o){e.min=$3(e.min,t,n,r,o),e.max=$3(e.max,t,n,r,o)}function JT(e,{x:t,y:n}){E2(e.x,t.translate,t.scale,t.originPoint),E2(e.y,n.translate,n.scale,n.originPoint)}function FX(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,a;for(let s=0;s1.0000000000001||e<.999999999999?e:1}function ia(e,t){e.min=e.min+t,e.max=e.max+t}function U3(e,t,[n,r,o]){const i=t[o]!==void 0?t[o]:.5,a=jt(e.min,e.max,i);E2(e,t[n],t[r],a,t.scale)}const $X=["x","scaleX","originX"],zX=["y","scaleY","originY"];function jl(e,t){U3(e.x,t,$X),U3(e.y,t,zX)}function eI(e,t){return ZT(jX(e.getBoundingClientRect(),t))}function UX(e,t,n){const r=eI(e,n),{scroll:o}=t;return o&&(ia(r.x,o.offset.x),ia(r.y,o.offset.y)),r}const VX=new WeakMap;class HX{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=nn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=l=>{this.stopAnimation(),n&&this.snapToCursor(im(l,"page").point)},i=(l,u)=>{const{drag:c,dragPropagation:f,onDragStart:d}=this.getProps();if(c&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=pT(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Xo(p=>{let m=this.getAxisMotionValue(p).get()||0;if(ci.test(m)){const{projection:_}=this.visualElement;if(_&&_.layout){const b=_.layout.layoutBox[p];b&&(m=Yr(b)*(parseFloat(m)/100))}}this.originPoint[p]=m}),d&&Tt.update(()=>d(l,u),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},a=(l,u)=>{const{dragPropagation:c,dragDirectionLock:f,onDirectionLock:d,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(f&&this.currentDirection===null){this.currentDirection=WX(p),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},s=(l,u)=>this.stop(l,u);this.panSession=new qT(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:s},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&Tt.update(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!hh(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=RX(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},o=this.constraints;t&&Ll(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=kX(r.layoutBox,t):this.constraints=!1,this.elastic=NX(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Xo(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=LX(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ll(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=UX(r,o.root,this.visualElement.getTransformPagePoint());let a=MX(o.layout.layoutBox,i);if(n){const s=n(BX(a));this.hasMutatedConstraints=!!s,s&&(a=ZT(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Xo(c=>{if(!hh(c,n,this.currentDirection))return;let f=l&&l[c]||{};a&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(pS(t,r,0,n))}stopAnimation(){Xo(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Xo(n=>{const{drag:r}=this.getProps();if(!hh(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:s}=o.layout.layoutBox[n];i.set(t[n]-jt(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ll(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Xo(a=>{const s=this.getAxisMotionValue(a);if(s){const l=s.get();o[a]=DX({min:l,max:l},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Xo(a=>{if(!hh(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(jt(l,u,o[a]))})}addListeners(){if(!this.visualElement.current)return;VX.set(this.visualElement,this);const t=this.visualElement.current,n=Ii(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ll(l)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),r();const a=Ai(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Xo(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:a=S2,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:a,dragMomentum:s}}}function hh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function WX(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class GX extends Ba{constructor(t){super(t),this.removeGroupControls=Gt,this.removeListeners=Gt,this.controls=new HX(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Gt}unmount(){this.removeGroupControls(),this.removeListeners()}}const V3=e=>(t,n)=>{e&&Tt.update(()=>e(t,n))};class KX extends Ba{constructor(){super(...arguments),this.removePointerDownListener=Gt}onPointerDown(t){this.session=new qT(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:V3(t),onStart:V3(n),onMove:r,onEnd:(i,a)=>{delete this.session,o&&Tt.update(()=>o(i,a))}}}mount(){this.removePointerDownListener=Ii(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function tI(){const e=P.useContext(id);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=P.useId();return P.useEffect(()=>r(o),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}function XX(){return qX(P.useContext(id))}function qX(e){return e===null?!0:e.isPresent}const rp={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function H3(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const lc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Pe.test(e))e=parseFloat(e);else return e;const n=H3(e,t.target.x),r=H3(e,t.target.y);return`${n}% ${r}%`}},YX={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ra.parse(e);if(o.length>5)return r;const i=Ra.createTransformer(e),a=typeof o[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;o[0+a]/=s,o[1+a]/=l;const u=jt(s,l,.5);return typeof o[2+a]=="number"&&(o[2+a]/=u),typeof o[3+a]=="number"&&(o[3+a]/=u),i(o)}};class ZX extends ee.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;nG(QX),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),rp.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,o||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||Tt.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nI(e){const[t,n]=tI(),r=P.useContext(eS);return ee.createElement(ZX,{...e,layoutGroup:r,switchLayoutGroup:P.useContext(ZP),isPresent:t,safeToRemove:n})}const QX={borderRadius:{...lc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lc,borderTopRightRadius:lc,borderBottomLeftRadius:lc,borderBottomRightRadius:lc,boxShadow:YX},rI=["TopLeft","TopRight","BottomLeft","BottomRight"],JX=rI.length,W3=e=>typeof e=="string"?parseFloat(e):e,G3=e=>typeof e=="number"||Pe.test(e);function eq(e,t,n,r,o,i){o?(e.opacity=jt(0,n.opacity!==void 0?n.opacity:1,tq(r)),e.opacityExit=jt(t.opacity!==void 0?t.opacity:1,0,nq(r))):i&&(e.opacity=jt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(Mf(e,t,r))}function X3(e,t){e.min=t.min,e.max=t.max}function ro(e,t){X3(e.x,t.x),X3(e.y,t.y)}function q3(e,t,n,r,o){return e-=t,e=t1(e,1/n,r),o!==void 0&&(e=t1(e,1/o,r)),e}function rq(e,t=0,n=1,r=.5,o,i=e,a=e){if(ci.test(t)&&(t=parseFloat(t),t=jt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=jt(i.min,i.max,r);e===i&&(s-=t),e.min=q3(e.min,t,n,s,o),e.max=q3(e.max,t,n,s,o)}function Y3(e,t,[n,r,o],i,a){rq(e,t[n],t[r],t[o],t.scale,i,a)}const oq=["x","scaleX","originX"],iq=["y","scaleY","originY"];function Z3(e,t,n,r){Y3(e.x,t,oq,n?n.x:void 0,r?r.x:void 0),Y3(e.y,t,iq,n?n.y:void 0,r?r.y:void 0)}function Q3(e){return e.translate===0&&e.scale===1}function iI(e){return Q3(e.x)&&Q3(e.y)}function aq(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function aI(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function J3(e){return Yr(e.x)/Yr(e.y)}class sq{constructor(){this.members=[]}add(t){mS(this.members,t),t.scheduleRender()}remove(t){if(yS(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ex(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r=`translate3d(${o}px, ${i}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const lq=(e,t)=>e.depth-t.depth;class uq{constructor(){this.children=[],this.isDirty=!1}add(t){mS(this.children,t),this.isDirty=!0}remove(t){yS(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lq),this.isDirty=!1,this.children.forEach(t)}}function cq(e,t){const n=performance.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Bi(r),e(i-t))};return Tt.read(r,!0),()=>Bi(r)}function fq(e){window.MotionDebug&&window.MotionDebug.record(e)}function dq(e){return e instanceof SVGElement&&e.tagName!=="svg"}function hq(e,t,n){const r=Ar(e)?e:wu(e);return r.start(pS("",r,t,n)),r.animation}const tx=["","X","Y","Z"],nx=1e3;let pq=0;const ns={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function sI({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},s=t==null?void 0:t()){this.id=pq++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{ns.totalNodes=ns.resolvedTargetDeltas=ns.recalculatedProjection=0,this.nodes.forEach(gq),this.nodes.forEach(_q),this.nodes.forEach(Eq),this.nodes.forEach(vq),fq(ns)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=cq(d,250),rp.hasAnimatedSinceResize&&(rp.hasAnimatedSinceResize=!1,this.nodes.forEach(ox))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:d,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Pq,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=c.getProps(),g=!this.targetLayout||!aI(this.targetLayout,p)||h,E=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||E||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,E);const T={...WT(m,"layout"),onPlay:_,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else d||ox(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Bi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Cq),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;cthis.update()))}clearAllSnapshots(){this.nodes.forEach(wq),this.sharedNodes.forEach(xq)}scheduleUpdateProjection(){Tt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Tt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const O=T/1e3;ix(f.x,a.x,O),ix(f.y,a.y,O),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qc(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Oq(this.relativeTarget,this.relativeTargetOrigin,d,O),E&&aq(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=nn()),ro(E,this.relativeTarget)),m&&(this.animationValues=c,eq(c,u,this.latestValues,O,g,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Bi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tt.update(()=>{rp.hasAnimatedSinceResize=!0,this.currentAnimation=hq(0,nx,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(nx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&lI(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||nn();const f=Yr(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const d=Yr(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+d}ro(s,l),jl(s,c),Xc(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new sq),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let c=0;c{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(rx),this.root.sharedNodes.clear()}}}function mq(e){e.updateLayout()}function yq(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,a=n.source!==e.layout.source;i==="size"?Xo(f=>{const d=a?n.measuredBox[f]:n.layoutBox[f],h=Yr(d);d.min=r[f].min,d.max=d.min+h}):lI(i,n.layoutBox,r)&&Xo(f=>{const d=a?n.measuredBox[f]:n.layoutBox[f],h=Yr(r[f]);d.max=d.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const s=Bl();Xc(s,r,n.layoutBox);const l=Bl();a?Xc(l,e.applyTransform(o,!0),n.measuredBox):Xc(l,r,n.layoutBox);const u=!iI(s);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=nn();qc(p,n.layoutBox,d.layoutBox);const m=nn();qc(m,r,h.layoutBox),aI(p,m)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function gq(e){ns.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function vq(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function wq(e){e.clearSnapshot()}function rx(e){e.clearMeasurements()}function bq(e){e.isLayoutDirty=!1}function Sq(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ox(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function _q(e){e.resolveTargetDelta()}function Eq(e){e.calcProjection()}function Cq(e){e.resetRotation()}function xq(e){e.removeLeadSnapshot()}function ix(e,t,n){e.translate=jt(t.translate,0,n),e.scale=jt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ax(e,t,n,r){e.min=jt(t.min,n.min,r),e.max=jt(t.max,n.max,r)}function Oq(e,t,n,r){ax(e.x,t.x,n.x,r),ax(e.y,t.y,n.y,r)}function Aq(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Pq={duration:.45,ease:[.4,0,.1,1]},sx=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),lx=sx("applewebkit/")&&!sx("chrome/")?Math.round:Gt;function ux(e){e.min=lx(e.min),e.max=lx(e.max)}function Tq(e){ux(e.x),ux(e.y)}function lI(e,t,n){return e==="position"||e==="preserve-aspect"&&!b2(J3(t),J3(n),.2)}const Iq=sI({attachResizeListener:(e,t)=>Ai(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Qy={current:void 0},uI=sI({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Qy.current){const e=new Iq({});e.mount(window),e.setOptions({layoutScroll:!0}),Qy.current=e}return Qy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Rq={pan:{Feature:KX},drag:{Feature:GX,ProjectionNode:uI,MeasureLayout:nI}},kq=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Mq(e){const t=kq.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function C2(e,t,n=1){const[r,o]=Mq(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);return i?i.trim():h2(o)?C2(o,t,n+1):o}function Dq(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(o=>{const i=o.get();if(!h2(i))return;const a=C2(i,r);a&&o.set(a)});for(const o in t){const i=t[o];if(!h2(i))continue;const a=C2(i,r);a&&(t[o]=a,n||(n={}),n[o]===void 0&&(n[o]=i))}return{target:t,transitionEnd:n}}const Lq=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),cI=e=>Lq.has(e),Nq=e=>Object.keys(e).some(cI),cx=e=>e===Xs||e===Pe,fx=(e,t)=>parseFloat(e.split(", ")[t]),dx=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return fx(o[1],t);{const i=r.match(/^matrix\((.+)\)$/);return i?fx(i[1],e):0}},Bq=new Set(["x","y","z"]),jq=ad.filter(e=>!Bq.has(e));function Fq(e){const t=[];return jq.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const bu={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:dx(4,13),y:dx(5,14)};bu.translateX=bu.x;bu.translateY=bu.y;const $q=(e,t,n)=>{const r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),{display:a}=i,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=bu[u](r,i)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(s[u]),e[u]=bu[u](l,i)}),e},zq=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(cI);let i=[],a=!1;const s=[];if(o.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],f=sc(c);const d=t[l];let h;if(Yp(d)){const p=d.length,m=d[0]===null?1:0;c=d[m],f=sc(c);for(let _=m;_=0?window.pageYOffset:null,u=$q(t,e,s);return i.length&&i.forEach(([c,f])=>{e.getValue(c).set(f)}),e.render(),tm&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function Uq(e,t,n,r){return Nq(t)?zq(e,t,n,r):{target:t,transitionEnd:r}}const Vq=(e,t,n,r)=>{const o=Dq(e,t,r);return t=o.target,r=o.transitionEnd,Uq(e,t,n,r)},x2={current:null},fI={current:!1};function Hq(){if(fI.current=!0,!!tm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>x2.current=e.matches;e.addListener(t),t()}else x2.current=!1}function Wq(e,t,n){const{willChange:r}=t;for(const o in t){const i=t[o],a=n[o];if(Ar(i))e.addValue(o,i),e1(r)&&r.add(o);else if(Ar(a))e.addValue(o,wu(i,{owner:e})),e1(r)&&r.remove(o);else if(a!==i)if(e.hasValue(o)){const s=e.getValue(o);!s.hasAnimated&&s.set(i)}else{const s=e.getStaticValue(o);e.addValue(o,wu(s!==void 0?s:i,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const hx=new WeakMap,dI=Object.keys(kf),Gq=dI.length,px=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Kq=Jb.length;class Xq{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Tt.render(this.render,!1,!0);const{latestValues:s,renderState:l}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=n.initial?{...s}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.isControllingVariants=rm(n),this.isVariantNode=YP(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const f in c){const d=c[f];s[f]!==void 0&&Ar(d)&&(d.set(s[f],!1),e1(u)&&u.add(f))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,hx.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),fI.current||Hq(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:x2.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){hx.delete(this.current),this.projection&&this.projection.unmount(),Bi(this.notifyUpdate),Bi(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=Ks.has(t),o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Tt.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,o,i){let a,s;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:i,layoutScroll:d,layoutRoot:h})}return s}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):nn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=wu(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,o=typeof r=="string"||typeof r=="object"?(n=lS(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&o!==void 0)return o;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ar(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new gS),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class hI extends Xq{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:o},i){let a=dX(r,t||{},this);if(o&&(n&&(n=o(n)),r&&(r=o(r)),a&&(a=o(a))),i){cX(this,r,a);const s=Vq(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function qq(e){return window.getComputedStyle(e)}class Yq extends hI{readValueFromInstance(t,n){if(Ks.has(n)){const r=hS(n);return r&&r.default||0}else{const r=qq(t),o=(eT(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return eI(t,n)}build(t,n,r,o){nS(t,n,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,n){return sS(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ar(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,o){aT(t,n,r,o)}}class Zq extends hI{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ks.has(n)){const r=hS(n);return r&&r.default||0}return n=sT.has(n)?n:aS(n),t.getAttribute(n)}measureInstanceViewportBox(){return nn()}scrapeMotionValuesFromProps(t,n){return uT(t,n)}build(t,n,r,o){oS(t,n,r,this.isSVGTag,o.transformTemplate)}renderInstance(t,n,r,o){lT(t,n,r,o)}mount(t){this.isSVGTag=iS(t.tagName),super.mount(t)}}const Qq=(e,t)=>tS(e)?new Zq(t,{enableHardwareAcceleration:!1}):new Yq(t,{enableHardwareAcceleration:!0}),Jq={layout:{ProjectionNode:uI,MeasureLayout:nI}},eY={...OX,...WG,...Rq,...Jq},Ui=eG((e,t)=>TG(e,t,eY,Qq));function pI(){const e=P.useRef(!1);return Kp(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function tY(){const e=pI(),[t,n]=P.useState(0),r=P.useCallback(()=>{e.current&&n(t+1)},[t]);return[P.useCallback(()=>Tt.postRender(r),[r]),t]}class nY extends P.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function rY({children:e,isPresent:t}){const n=P.useId(),r=P.useRef(null),o=P.useRef({width:0,height:0,top:0,left:0});return P.useInsertionEffect(()=>{const{width:i,height:a,top:s,left:l}=o.current;if(t||!r.current||!i||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` + )`;return{...!r&&o&&i,...r?{bgImage:s}:{bgColor:a}}},Lz={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Nz=e=>({bg:Oe("gray.100","whiteAlpha.300")(e)}),Bz=e=>({transitionProperty:"common",transitionDuration:"slow",...Dz(e)}),jz=Cc(e=>({label:Lz,filledTrack:Bz(e),track:Nz(e)})),Fz={xs:Cc({track:{h:"1"}}),sm:Cc({track:{h:"2"}}),md:Cc({track:{h:"3"}}),lg:Cc({track:{h:"4"}})},$z=Mz({sizes:Fz,baseStyle:jz,defaultProps:{size:"md",colorScheme:"blue"}}),zz=e=>typeof e=="function";function ir(e,...t){return zz(e)?e(...t):e}var{definePartsStyle:ep,defineMultiStyleConfig:Vz}=wt(DF.keys),Hc=Ee("checkbox-size"),Uz=e=>{const{colorScheme:t}=e;return{w:Hc.reference,h:Hc.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Oe(`${t}.500`,`${t}.200`)(e),borderColor:Oe(`${t}.500`,`${t}.200`)(e),color:Oe("white","gray.900")(e),_hover:{bg:Oe(`${t}.600`,`${t}.300`)(e),borderColor:Oe(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Oe("gray.200","transparent")(e),bg:Oe("gray.200","whiteAlpha.300")(e),color:Oe("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Oe(`${t}.500`,`${t}.200`)(e),borderColor:Oe(`${t}.500`,`${t}.200`)(e),color:Oe("white","gray.900")(e)},_disabled:{bg:Oe("gray.100","whiteAlpha.100")(e),borderColor:Oe("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Oe("red.500","red.300")(e)}}},Hz={_disabled:{cursor:"not-allowed"}},Wz={userSelect:"none",_disabled:{opacity:.4}},Gz={transitionProperty:"transform",transitionDuration:"normal"},Kz=ep(e=>({icon:Gz,container:Hz,control:ir(Uz,e),label:Wz})),Xz={sm:ep({control:{[Hc.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:ep({control:{[Hc.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:ep({control:{[Hc.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},Gp=Vz({baseStyle:Kz,sizes:Xz,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:qz,definePartsStyle:tp}=wt(GF.keys),Yz=e=>{var t;const n=(t=ir(Gp.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Zz=tp(e=>{var t,n,r,o;return{label:(n=(t=Gp).baseStyle)==null?void 0:n.call(t,e).label,container:(o=(r=Gp).baseStyle)==null?void 0:o.call(r,e).container,control:Yz(e)}}),Qz={md:tp({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:tp({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:tp({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},Jz=qz({baseStyle:Zz,sizes:Qz,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:eV,definePartsStyle:tV}=wt(KF.keys),lh=Ee("select-bg"),o3,nV={...(o3=rt.baseStyle)==null?void 0:o3.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:lh.reference,[lh.variable]:"colors.white",_dark:{[lh.variable]:"colors.gray.700"},"> option, > optgroup":{bg:lh.reference}},rV={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},oV=tV({field:nV,icon:rV}),uh={paddingInlineEnd:"8"},i3,a3,s3,l3,u3,c3,f3,d3,iV={lg:{...(i3=rt.sizes)==null?void 0:i3.lg,field:{...(a3=rt.sizes)==null?void 0:a3.lg.field,...uh}},md:{...(s3=rt.sizes)==null?void 0:s3.md,field:{...(l3=rt.sizes)==null?void 0:l3.md.field,...uh}},sm:{...(u3=rt.sizes)==null?void 0:u3.sm,field:{...(c3=rt.sizes)==null?void 0:c3.sm.field,...uh}},xs:{...(f3=rt.sizes)==null?void 0:f3.xs,field:{...(d3=rt.sizes)==null?void 0:d3.xs.field,...uh},icon:{insetEnd:"1"}}},aV=eV({baseStyle:oV,sizes:iV,variants:rt.variants,defaultProps:rt.defaultProps}),jy=Ee("skeleton-start-color"),Fy=Ee("skeleton-end-color"),sV={[jy.variable]:"colors.gray.100",[Fy.variable]:"colors.gray.400",_dark:{[jy.variable]:"colors.gray.800",[Fy.variable]:"colors.gray.600"},background:jy.reference,borderColor:Fy.reference,opacity:.7,borderRadius:"sm"},lV={baseStyle:sV},$y=Ee("skip-link-bg"),uV={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[$y.variable]:"colors.white",_dark:{[$y.variable]:"colors.gray.700"},bg:$y.reference}},cV={baseStyle:uV},{defineMultiStyleConfig:fV,definePartsStyle:lm}=wt(XF.keys),Tf=Ee("slider-thumb-size"),If=Ee("slider-track-size"),ca=Ee("slider-bg"),dV=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...oS({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},hV=e=>({...oS({orientation:e.orientation,horizontal:{h:If.reference},vertical:{w:If.reference}}),overflow:"hidden",borderRadius:"sm",[ca.variable]:"colors.gray.200",_dark:{[ca.variable]:"colors.whiteAlpha.200"},_disabled:{[ca.variable]:"colors.gray.300",_dark:{[ca.variable]:"colors.whiteAlpha.300"}},bg:ca.reference}),pV=e=>{const{orientation:t}=e;return{...oS({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:Tf.reference,h:Tf.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},mV=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[ca.variable]:`colors.${t}.500`,_dark:{[ca.variable]:`colors.${t}.200`},bg:ca.reference}},yV=lm(e=>({container:dV(e),track:hV(e),thumb:pV(e),filledTrack:mV(e)})),gV=lm({container:{[Tf.variable]:"sizes.4",[If.variable]:"sizes.1"}}),vV=lm({container:{[Tf.variable]:"sizes.3.5",[If.variable]:"sizes.1"}}),wV=lm({container:{[Tf.variable]:"sizes.2.5",[If.variable]:"sizes.0.5"}}),bV={lg:gV,md:vV,sm:wV},SV=fV({baseStyle:yV,sizes:bV,defaultProps:{size:"md",colorScheme:"blue"}}),us=mn("spinner-size"),_V={width:[us.reference],height:[us.reference]},EV={xs:{[us.variable]:"sizes.3"},sm:{[us.variable]:"sizes.4"},md:{[us.variable]:"sizes.6"},lg:{[us.variable]:"sizes.8"},xl:{[us.variable]:"sizes.12"}},CV={baseStyle:_V,sizes:EV,defaultProps:{size:"md"}},{defineMultiStyleConfig:xV,definePartsStyle:WP}=wt(qF.keys),OV={fontWeight:"medium"},AV={opacity:.8,marginBottom:"2"},PV={verticalAlign:"baseline",fontWeight:"semibold"},TV={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},IV=WP({container:{},label:OV,helpText:AV,number:PV,icon:TV}),RV={md:WP({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},kV=xV({baseStyle:IV,sizes:RV,defaultProps:{size:"md"}}),zy=Ee("kbd-bg"),MV={[zy.variable]:"colors.gray.100",_dark:{[zy.variable]:"colors.whiteAlpha.100"},bg:zy.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},DV={baseStyle:MV},LV={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},NV={baseStyle:LV},{defineMultiStyleConfig:BV,definePartsStyle:jV}=wt($F.keys),FV={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},$V=jV({icon:FV}),zV=BV({baseStyle:$V}),{defineMultiStyleConfig:VV,definePartsStyle:UV}=wt(zF.keys),Zo=Ee("menu-bg"),Vy=Ee("menu-shadow"),HV={[Zo.variable]:"#fff",[Vy.variable]:"shadows.sm",_dark:{[Zo.variable]:"colors.gray.700",[Vy.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Zo.reference,boxShadow:Vy.reference},WV={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Zo.variable]:"colors.gray.100",_dark:{[Zo.variable]:"colors.whiteAlpha.100"}},_active:{[Zo.variable]:"colors.gray.200",_dark:{[Zo.variable]:"colors.whiteAlpha.200"}},_expanded:{[Zo.variable]:"colors.gray.100",_dark:{[Zo.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Zo.reference},GV={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},KV={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},XV={opacity:.6},qV={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},YV={transitionProperty:"common",transitionDuration:"normal"},ZV=UV({button:YV,list:HV,item:WV,groupTitle:GV,icon:KV,command:XV,divider:qV}),QV=VV({baseStyle:ZV}),{defineMultiStyleConfig:JV,definePartsStyle:_2}=wt(VF.keys),Uy=Ee("modal-bg"),Hy=Ee("modal-shadow"),eU={bg:"blackAlpha.600",zIndex:"modal"},tU=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},nU=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[Uy.variable]:"colors.white",[Hy.variable]:"shadows.lg",_dark:{[Uy.variable]:"colors.gray.700",[Hy.variable]:"shadows.dark-lg"},bg:Uy.reference,boxShadow:Hy.reference}},rU={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},oU={position:"absolute",top:"2",insetEnd:"3"},iU=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},aU={px:"6",py:"4"},sU=_2(e=>({overlay:eU,dialogContainer:ir(tU,e),dialog:ir(nU,e),header:rU,closeButton:oU,body:ir(iU,e),footer:aU}));function Ao(e){return _2(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var lU={xs:Ao("xs"),sm:Ao("sm"),md:Ao("md"),lg:Ao("lg"),xl:Ao("xl"),"2xl":Ao("2xl"),"3xl":Ao("3xl"),"4xl":Ao("4xl"),"5xl":Ao("5xl"),"6xl":Ao("6xl"),full:Ao("full")},uU=JV({baseStyle:sU,sizes:lU,defaultProps:{size:"md"}}),{defineMultiStyleConfig:cU,definePartsStyle:GP}=wt(UF.keys),aS=mn("number-input-stepper-width"),KP=mn("number-input-input-padding"),fU=Ei(aS).add("0.5rem").toString(),Wy=mn("number-input-bg"),Gy=mn("number-input-color"),Ky=mn("number-input-border-color"),dU={[aS.variable]:"sizes.6",[KP.variable]:fU},hU=e=>{var t,n;return(n=(t=ir(rt.baseStyle,e))==null?void 0:t.field)!=null?n:{}},pU={width:aS.reference},mU={borderStart:"1px solid",borderStartColor:Ky.reference,color:Gy.reference,bg:Wy.reference,[Gy.variable]:"colors.chakra-body-text",[Ky.variable]:"colors.chakra-border-color",_dark:{[Gy.variable]:"colors.whiteAlpha.800",[Ky.variable]:"colors.whiteAlpha.300"},_active:{[Wy.variable]:"colors.gray.200",_dark:{[Wy.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},yU=GP(e=>{var t;return{root:dU,field:(t=ir(hU,e))!=null?t:{},stepperGroup:pU,stepper:mU}});function ch(e){var t,n,r;const o=(t=rt.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},a=(r=(n=o.field)==null?void 0:n.fontSize)!=null?r:"md",s=$P.fontSizes[a];return GP({field:{...o.field,paddingInlineEnd:KP.reference,verticalAlign:"top"},stepper:{fontSize:Ei(s).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var gU={xs:ch("xs"),sm:ch("sm"),md:ch("md"),lg:ch("lg")},vU=cU({baseStyle:yU,sizes:gU,variants:rt.variants,defaultProps:rt.defaultProps}),h3,wU={...(h3=rt.baseStyle)==null?void 0:h3.field,textAlign:"center"},bU={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},p3,m3,SU={outline:e=>{var t,n,r;return(r=(n=ir((t=rt.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=ir((t=rt.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=ir((t=rt.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(m3=(p3=rt.variants)==null?void 0:p3.unstyled.field)!=null?m3:{}},_U={baseStyle:wU,sizes:bU,variants:SU,defaultProps:rt.defaultProps},{defineMultiStyleConfig:EU,definePartsStyle:CU}=wt(HF.keys),fh=mn("popper-bg"),xU=mn("popper-arrow-bg"),y3=mn("popper-arrow-shadow-color"),OU={zIndex:10},AU={[fh.variable]:"colors.white",bg:fh.reference,[xU.variable]:fh.reference,[y3.variable]:"colors.gray.200",_dark:{[fh.variable]:"colors.gray.700",[y3.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},PU={px:3,py:2,borderBottomWidth:"1px"},TU={px:3,py:2},IU={px:3,py:2,borderTopWidth:"1px"},RU={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},kU=CU({popper:OU,content:AU,header:PU,body:TU,footer:IU,closeButton:RU}),MU=EU({baseStyle:kU}),{definePartsStyle:E2,defineMultiStyleConfig:DU}=wt(LF.keys),Xy=Ee("drawer-bg"),qy=Ee("drawer-box-shadow");function sl(e){return E2(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var LU={bg:"blackAlpha.600",zIndex:"overlay"},NU={display:"flex",zIndex:"modal",justifyContent:"center"},BU=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[Xy.variable]:"colors.white",[qy.variable]:"shadows.lg",_dark:{[Xy.variable]:"colors.gray.700",[qy.variable]:"shadows.dark-lg"},bg:Xy.reference,boxShadow:qy.reference}},jU={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},FU={position:"absolute",top:"2",insetEnd:"3"},$U={px:"6",py:"2",flex:"1",overflow:"auto"},zU={px:"6",py:"4"},VU=E2(e=>({overlay:LU,dialogContainer:NU,dialog:ir(BU,e),header:jU,closeButton:FU,body:$U,footer:zU})),UU={xs:sl("xs"),sm:sl("md"),md:sl("lg"),lg:sl("2xl"),xl:sl("4xl"),full:sl("full")},HU=DU({baseStyle:VU,sizes:UU,defaultProps:{size:"xs"}}),{definePartsStyle:WU,defineMultiStyleConfig:GU}=wt(NF.keys),KU={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},XU={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},qU={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},YU=WU({preview:KU,input:XU,textarea:qU}),ZU=GU({baseStyle:YU}),{definePartsStyle:QU,defineMultiStyleConfig:JU}=wt(BF.keys),tu=Ee("form-control-color"),eH={marginStart:"1",[tu.variable]:"colors.red.500",_dark:{[tu.variable]:"colors.red.300"},color:tu.reference},tH={mt:"2",[tu.variable]:"colors.gray.600",_dark:{[tu.variable]:"colors.whiteAlpha.600"},color:tu.reference,lineHeight:"normal",fontSize:"sm"},nH=QU({container:{width:"100%",position:"relative"},requiredIndicator:eH,helperText:tH}),rH=JU({baseStyle:nH}),{definePartsStyle:oH,defineMultiStyleConfig:iH}=wt(jF.keys),nu=Ee("form-error-color"),aH={[nu.variable]:"colors.red.500",_dark:{[nu.variable]:"colors.red.300"},color:nu.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},sH={marginEnd:"0.5em",[nu.variable]:"colors.red.500",_dark:{[nu.variable]:"colors.red.300"},color:nu.reference},lH=oH({text:aH,icon:sH}),uH=iH({baseStyle:lH}),cH={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},fH={baseStyle:cH},dH={fontFamily:"heading",fontWeight:"bold"},hH={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},pH={baseStyle:dH,sizes:hH,defaultProps:{size:"xl"}},{defineMultiStyleConfig:mH,definePartsStyle:yH}=wt(MF.keys),Yy=Ee("breadcrumb-link-decor"),gH={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:Yy.reference,[Yy.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[Yy.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},vH=yH({link:gH}),wH=mH({baseStyle:vH}),bH={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},XP=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Oe("gray.800","whiteAlpha.900")(e),_hover:{bg:Oe("gray.100","whiteAlpha.200")(e)},_active:{bg:Oe("gray.200","whiteAlpha.300")(e)}};const r=wu(`${t}.200`,.12)(n),o=wu(`${t}.200`,.24)(n);return{color:Oe(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Oe(`${t}.50`,r)(e)},_active:{bg:Oe(`${t}.100`,o)(e)}}},SH=e=>{const{colorScheme:t}=e,n=Oe("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...ir(XP,e)}},_H={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},EH=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=Oe("gray.100","whiteAlpha.200")(e);return{bg:l,color:Oe("gray.800","whiteAlpha.900")(e),_hover:{bg:Oe("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:Oe("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:o="white",hoverBg:i=`${n}.600`,activeBg:a=`${n}.700`}=(t=_H[n])!=null?t:{},s=Oe(r,`${n}.200`)(e);return{bg:s,color:Oe(o,"gray.800")(e),_hover:{bg:Oe(i,`${n}.300`)(e),_disabled:{bg:s}},_active:{bg:Oe(a,`${n}.400`)(e)}}},CH=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Oe(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Oe(`${t}.700`,`${t}.500`)(e)}}},xH={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},OH={ghost:XP,outline:SH,solid:EH,link:CH,unstyled:xH},AH={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},PH={baseStyle:bH,variants:OH,sizes:AH,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:As,defineMultiStyleConfig:TH}=wt(e$.keys),Kp=Ee("card-bg"),Ii=Ee("card-padding"),qP=Ee("card-shadow"),np=Ee("card-radius"),YP=Ee("card-border-width","0"),ZP=Ee("card-border-color"),IH=As({container:{[Kp.variable]:"colors.chakra-body-bg",backgroundColor:Kp.reference,boxShadow:qP.reference,borderRadius:np.reference,color:"chakra-body-text",borderWidth:YP.reference,borderColor:ZP.reference},body:{padding:Ii.reference,flex:"1 1 0%"},header:{padding:Ii.reference},footer:{padding:Ii.reference}}),RH={sm:As({container:{[np.variable]:"radii.base",[Ii.variable]:"space.3"}}),md:As({container:{[np.variable]:"radii.md",[Ii.variable]:"space.5"}}),lg:As({container:{[np.variable]:"radii.xl",[Ii.variable]:"space.7"}})},kH={elevated:As({container:{[qP.variable]:"shadows.base",_dark:{[Kp.variable]:"colors.gray.700"}}}),outline:As({container:{[YP.variable]:"1px",[ZP.variable]:"colors.chakra-border-color"}}),filled:As({container:{[Kp.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[Ii.variable]:0},header:{[Ii.variable]:0},footer:{[Ii.variable]:0}}},MH=TH({baseStyle:IH,variants:kH,sizes:RH,defaultProps:{variant:"elevated",size:"md"}}),Wc=mn("close-button-size"),sc=mn("close-button-bg"),DH={w:[Wc.reference],h:[Wc.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[sc.variable]:"colors.blackAlpha.100",_dark:{[sc.variable]:"colors.whiteAlpha.100"}},_active:{[sc.variable]:"colors.blackAlpha.200",_dark:{[sc.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:sc.reference},LH={lg:{[Wc.variable]:"sizes.10",fontSize:"md"},md:{[Wc.variable]:"sizes.8",fontSize:"xs"},sm:{[Wc.variable]:"sizes.6",fontSize:"2xs"}},NH={baseStyle:DH,sizes:LH,defaultProps:{size:"md"}},{variants:BH,defaultProps:jH}=Uc,FH={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:en.bg.reference,color:en.color.reference,boxShadow:en.shadow.reference},$H={baseStyle:FH,variants:BH,defaultProps:jH},zH={w:"100%",mx:"auto",maxW:"prose",px:"4"},VH={baseStyle:zH},UH={opacity:.6,borderColor:"inherit"},HH={borderStyle:"solid"},WH={borderStyle:"dashed"},GH={solid:HH,dashed:WH},KH={baseStyle:UH,variants:GH,defaultProps:{variant:"solid"}},{definePartsStyle:XH,defineMultiStyleConfig:qH}=wt(IF.keys),YH={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},ZH={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},QH={pt:"2",px:"4",pb:"5"},JH={fontSize:"1.25em"},eW=XH({container:YH,button:ZH,panel:QH,icon:JH}),tW=qH({baseStyle:eW}),{definePartsStyle:id,defineMultiStyleConfig:nW}=wt(RF.keys),Gr=Ee("alert-fg"),ji=Ee("alert-bg"),rW=id({container:{bg:ji.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Gr.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Gr.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function sS(e){const{theme:t,colorScheme:n}=e,r=wu(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var oW=id(e=>{const{colorScheme:t}=e,n=sS(e);return{container:{[Gr.variable]:`colors.${t}.500`,[ji.variable]:n.light,_dark:{[Gr.variable]:`colors.${t}.200`,[ji.variable]:n.dark}}}}),iW=id(e=>{const{colorScheme:t}=e,n=sS(e);return{container:{[Gr.variable]:`colors.${t}.500`,[ji.variable]:n.light,_dark:{[Gr.variable]:`colors.${t}.200`,[ji.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:Gr.reference}}}),aW=id(e=>{const{colorScheme:t}=e,n=sS(e);return{container:{[Gr.variable]:`colors.${t}.500`,[ji.variable]:n.light,_dark:{[Gr.variable]:`colors.${t}.200`,[ji.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:Gr.reference}}}),sW=id(e=>{const{colorScheme:t}=e;return{container:{[Gr.variable]:"colors.white",[ji.variable]:`colors.${t}.500`,_dark:{[Gr.variable]:"colors.gray.900",[ji.variable]:`colors.${t}.200`},color:Gr.reference}}}),lW={subtle:oW,"left-accent":iW,"top-accent":aW,solid:sW},uW=nW({baseStyle:rW,variants:lW,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:QP,defineMultiStyleConfig:cW}=wt(kF.keys),ru=Ee("avatar-border-color"),Gc=Ee("avatar-bg"),Rf=Ee("avatar-font-size"),bu=Ee("avatar-size"),fW={borderRadius:"full",border:"0.2em solid",borderColor:ru.reference,[ru.variable]:"white",_dark:{[ru.variable]:"colors.gray.800"}},dW={bg:Gc.reference,fontSize:Rf.reference,width:bu.reference,height:bu.reference,lineHeight:"1",[Gc.variable]:"colors.gray.200",_dark:{[Gc.variable]:"colors.whiteAlpha.400"}},hW=e=>{const{name:t,theme:n}=e,r=t?b$({string:t}):"colors.gray.400",o=v$(r)(n);let i="white";return o||(i="gray.800"),{bg:Gc.reference,fontSize:Rf.reference,color:i,borderColor:ru.reference,verticalAlign:"top",width:bu.reference,height:bu.reference,"&:not([data-loaded])":{[Gc.variable]:r},[ru.variable]:"colors.white",_dark:{[ru.variable]:"colors.gray.800"}}},pW={fontSize:Rf.reference,lineHeight:"1"},mW=QP(e=>({badge:ir(fW,e),excessLabel:ir(dW,e),container:ir(hW,e),label:pW}));function Zi(e){const t=e!=="100%"?VP[e]:void 0;return QP({container:{[bu.variable]:t??e,[Rf.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[bu.variable]:t??e,[Rf.variable]:`calc(${t??e} / 2.5)`}})}var yW={"2xs":Zi(4),xs:Zi(6),sm:Zi(8),md:Zi(12),lg:Zi(16),xl:Zi(24),"2xl":Zi(32),full:Zi("100%")},gW=cW({baseStyle:mW,sizes:yW,defaultProps:{size:"md"}}),vW={Accordion:tW,Alert:uW,Avatar:gW,Badge:Uc,Breadcrumb:wH,Button:PH,Checkbox:Gp,CloseButton:NH,Code:$H,Container:VH,Divider:KH,Drawer:HU,Editable:ZU,Form:rH,FormError:uH,FormLabel:fH,Heading:pH,Input:rt,Kbd:DV,Link:NV,List:zV,Menu:QV,Modal:uU,NumberInput:vU,PinInput:_U,Popover:MU,Progress:$z,Radio:Jz,Select:aV,Skeleton:lV,SkipLink:cV,Slider:SV,Spinner:CV,Stat:kV,Switch:N$,Table:U$,Tabs:oz,Tag:gz,Textarea:Tz,Tooltip:kz,Card:MH,Stepper:TF},wW={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},bW={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},SW="ltr",_W={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},JP={semanticTokens:wW,direction:SW,...OF,components:vW,styles:bW,config:_W};function xc(e){return typeof e=="function"}function EW(...e){return t=>e.reduce((n,r)=>r(n),t)}var CW=e=>function(...n){let r=[...n],o=n[n.length-1];return nF(o)&&r.length>1?r=r.slice(0,r.length-1):o=e,EW(...r.map(i=>a=>xc(i)?i(a):OW(a,i)))(o)},xW=CW(JP);function OW(...e){return yo({},...e,eT)}function eT(e,t,n,r){if((xc(e)||xc(t))&&Object.prototype.hasOwnProperty.call(r,n))return(...o)=>{const i=xc(e)?e(...o):e,a=xc(t)?t(...o):t;return yo({},i,a,eT)}}function AW(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var PW=AW();function TW(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function IW(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,a)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(o))return s.get(o);const l=e(r,o,i,a);return s.set(o,l),l}},tT=RW(IW);function nT(e,t){const n={};return Object.keys(e).forEach(r=>{const o=e[r];t(o,r,e)&&(n[r]=o)}),n}var rT=e=>nT(e,t=>t!=null);function kW(e){return typeof e=="function"}function oT(e,...t){return kW(e)?e(...t):e}function MW(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var DW=typeof Element<"u",LW=typeof Map=="function",NW=typeof Set=="function",BW=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function rp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!rp(e[r],t[r]))return!1;return!0}var i;if(LW&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!rp(r.value[1],t.get(r.value[0])))return!1;return!0}if(NW&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(BW&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(DW&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&e.$$typeof)&&!rp(e[o[r]],t[o[r]]))return!1;return!0}return e!==e&&t!==t}var lS=function(t,n){try{return rp(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const jW=Fe(lS);function iT(e,t={}){var n;const{styleConfig:r,...o}=t,{theme:i,colorMode:a}=kP(),s=e?tT(i,`components.${e}`):void 0,l=r||s,u=yo({theme:i,colorMode:a},(n=l==null?void 0:l.defaultProps)!=null?n:{},rT(TW(o,["children"]))),c=P.useRef({});if(l){const d=Jj(l)(u);jW(c.current,d)||(c.current=d)}return c.current}function Co(e,t={}){return iT(e,t)}function Dr(e,t={}){return iT(e,t)}var FW=new Set([...zj,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),$W=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function zW(e){return $W.has(e)||!FW.has(e)}function VW(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(o in n&&delete n[o],n[o]=r[o]);return n}function aT(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var UW=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,HW=dO(function(e){return UW.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),WW=HW,GW=function(t){return t!=="theme"},g3=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?WW:GW},v3=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(a){return t.__emotion_forwardProp(a)&&i(a)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},KW=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return vO(n,r,o),iL(function(){return wO(n,r,o)}),null},XW=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,a;n!==void 0&&(i=n.label,a=n.target);var s=v3(t,n,r),l=s||g3(o),u=!l("as");return function(){var c=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&f.push("label:"+i+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{f.push(c[0][0]);for(var d=c.length,h=1;ht=>{const{theme:n,css:r,__css:o,sx:i,...a}=t,s=nT(a,(f,d)=>Uj(d)),l=oT(e,t),u=VW({},o,l,rT(s),i),c=FP(u)(t.theme);return r?[c,r]:c};function Zy(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=zW);const o=ZW({baseStyle:n}),i=YW(e,r)(o);return ee.forwardRef(function(l,u){const{colorMode:c,forced:f}=rm();return ee.createElement(i,{ref:u,"data-theme":f?c:void 0,...l})})}function QW(){const e=new Map;return new Proxy(Zy,{apply(t,n,r){return Zy(...r)},get(t,n){return e.has(n)||e.set(n,Zy(n)),e.get(n)}})}var ne=QW();function de(e){return P.forwardRef(e)}function sT(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,o=P.createContext(void 0);o.displayName=r;function i(){var a;const s=P.useContext(o);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,i),l}return s}return[o.Provider,i,o]}function JW(e){const{cssVarsRoot:t,theme:n,children:r}=e,o=P.useMemo(()=>jj(n),[n]);return w.jsxs(lL,{theme:o,children:[w.jsx(eG,{root:t}),r]})}function eG({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return w.jsx($0,{styles:n=>({[t]:n.__cssVars})})}sT({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function tG(e){return sT({name:`${e}StylesContext`,errorMessage:`useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${e} />" `})}function nG(){const{colorMode:e}=rm();return w.jsx($0,{styles:t=>{const n=tT(t,"styles.global"),r=oT(n,{theme:t,colorMode:e});return r?FP(r)(t):void 0}})}var uS=P.createContext({getDocument(){return document},getWindow(){return window}});uS.displayName="EnvironmentContext";function rG({defer:e}={}){const[,t]=P.useReducer(n=>n+1,0);return si(()=>{e&&t()},[e]),P.useContext(uS)}function lT(e){const{children:t,environment:n,disabled:r}=e,o=P.useRef(null),i=P.useMemo(()=>n||{getDocument:()=>{var s,l;return(l=(s=o.current)==null?void 0:s.ownerDocument)!=null?l:document},getWindow:()=>{var s,l;return(l=(s=o.current)==null?void 0:s.ownerDocument.defaultView)!=null?l:window}},[n]),a=!r||!n;return w.jsxs(uS.Provider,{value:i,children:[t,a&&w.jsx("span",{id:"__chakra_env",hidden:!0,ref:o})]})}lT.displayName="EnvironmentProvider";var oG=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetScope:o,resetCSS:i=!0,theme:a={},environment:s,cssVarsRoot:l,disableEnvironment:u,disableGlobalStyle:c}=e,f=w.jsx(lT,{environment:s,disabled:u,children:t});return w.jsx(JW,{theme:a,cssVarsRoot:l,children:w.jsxs(RP,{colorModeManager:n,options:a.config,children:[i?w.jsx(fL,{scope:o}):w.jsx(cL,{}),!c&&w.jsx(nG,{}),r?w.jsx(OO,{zIndex:r,children:f}):f]})})},iG=(e,t)=>e.find(n=>n.id===t);function b3(e,t){const n=uT(e,t),r=n?e[n].findIndex(o=>o.id===t):-1;return{position:n,index:r}}function uT(e,t){for(const[n,r]of Object.entries(e))if(iG(r,t))return n}function aG(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function sG(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,o=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,i=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:o,right:i,left:a}}function Ca(e,t=[]){const n=P.useRef(e);return P.useEffect(()=>{n.current=e}),P.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function lG(e,t){const n=Ca(e);P.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function $s(e,t){const n=P.useRef(!1),r=P.useRef(!1);P.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),P.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const cT=P.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),um=P.createContext({}),ad=P.createContext(null),cm=typeof document<"u",qp=cm?P.useLayoutEffect:P.useEffect,fT=P.createContext({strict:!1});function uG(e,t,n,r){const{visualElement:o}=P.useContext(um),i=P.useContext(fT),a=P.useContext(ad),s=P.useContext(cT).reducedMotion,l=P.useRef();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return P.useInsertionEffect(()=>{u&&u.update(n,a)}),qp(()=>{u&&u.render()}),P.useEffect(()=>{u&&u.updateFeatures()}),(window.HandoffAppearAnimations?qp:P.useEffect)(()=>{u&&u.animationState&&u.animationState.animateChanges()}),u}function Bl(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function cG(e,t,n){return P.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Bl(n)&&(n.current=r))},[t])}function kf(e){return typeof e=="string"||Array.isArray(e)}function fm(e){return typeof e=="object"&&typeof e.start=="function"}const cS=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fS=["initial",...cS];function dm(e){return fm(e.animate)||fS.some(t=>kf(e[t]))}function dT(e){return!!(dm(e)||e.variants)}function fG(e,t){if(dm(e)){const{initial:n,animate:r}=e;return{initial:n===!1||kf(n)?n:void 0,animate:kf(r)?r:void 0}}return e.inherit!==!1?t:{}}function dG(e){const{initial:t,animate:n}=fG(e,P.useContext(um));return P.useMemo(()=>({initial:t,animate:n}),[S3(t),S3(n)])}function S3(e){return Array.isArray(e)?e.join(" "):e}const _3={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Mf={};for(const e in _3)Mf[e]={isEnabled:t=>_3[e].some(n=>!!t[n])};function hG(e){for(const t in e)Mf[t]={...Mf[t],...e[t]}}const dS=P.createContext({}),hT=P.createContext({}),pG=Symbol.for("motionComponentSymbol");function mG({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&hG(e);function i(s,l){let u;const c={...P.useContext(cT),...s,layoutId:yG(s)},{isStatic:f}=c,d=dG(s),h=r(s,f);if(!f&&cm){d.visualElement=uG(o,h,c,t);const p=P.useContext(hT),m=P.useContext(fT).strict;d.visualElement&&(u=d.visualElement.loadFeatures(c,m,e,p))}return P.createElement(um.Provider,{value:d},u&&d.visualElement?P.createElement(u,{visualElement:d.visualElement,...c}):null,n(o,s,cG(h,d.visualElement,l),h,f,d.visualElement))}const a=P.forwardRef(i);return a[pG]=o,a}function yG({layoutId:e}){const t=P.useContext(dS).id;return t&&e!==void 0?t+"-"+e:e}function gG(e){function t(r,o={}){return mG(e(r,o))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,o)=>(n.has(o)||n.set(o,t(o)),n.get(o))})}const vG=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function hS(e){return typeof e!="string"||e.includes("-")?!1:!!(vG.indexOf(e)>-1||/[A-Z]/.test(e))}const Yp={};function wG(e){Object.assign(Yp,e)}const sd=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],qs=new Set(sd);function pT(e,{layout:t,layoutId:n}){return qs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Yp[e]||e==="opacity")}const Mr=e=>!!(e&&e.getVelocity),bG={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},SG=sd.length;function _G(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let i="";for(let a=0;at=>typeof t=="string"&&t.startsWith(e),yT=mT("--"),C2=mT("var(--"),EG=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,CG=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ka=(e,t,n)=>Math.min(Math.max(n,e),t),Ys={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Kc={...Ys,transform:e=>ka(0,1,e)},dh={...Ys,default:1},Xc=e=>Math.round(e*1e5)/1e5,hm=/(-)?([\d]*\.?[\d])+/g,gT=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,xG=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ld(e){return typeof e=="string"}const ud=e=>({test:t=>ld(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ra=ud("deg"),fi=ud("%"),Pe=ud("px"),OG=ud("vh"),AG=ud("vw"),E3={...fi,parse:e=>fi.parse(e)/100,transform:e=>fi.transform(e*100)},C3={...Ys,transform:Math.round},vT={borderWidth:Pe,borderTopWidth:Pe,borderRightWidth:Pe,borderBottomWidth:Pe,borderLeftWidth:Pe,borderRadius:Pe,radius:Pe,borderTopLeftRadius:Pe,borderTopRightRadius:Pe,borderBottomRightRadius:Pe,borderBottomLeftRadius:Pe,width:Pe,maxWidth:Pe,height:Pe,maxHeight:Pe,size:Pe,top:Pe,right:Pe,bottom:Pe,left:Pe,padding:Pe,paddingTop:Pe,paddingRight:Pe,paddingBottom:Pe,paddingLeft:Pe,margin:Pe,marginTop:Pe,marginRight:Pe,marginBottom:Pe,marginLeft:Pe,rotate:ra,rotateX:ra,rotateY:ra,rotateZ:ra,scale:dh,scaleX:dh,scaleY:dh,scaleZ:dh,skew:ra,skewX:ra,skewY:ra,distance:Pe,translateX:Pe,translateY:Pe,translateZ:Pe,x:Pe,y:Pe,z:Pe,perspective:Pe,transformPerspective:Pe,opacity:Kc,originX:E3,originY:E3,originZ:Pe,zIndex:C3,fillOpacity:Kc,strokeOpacity:Kc,numOctaves:C3};function pS(e,t,n,r){const{style:o,vars:i,transform:a,transformOrigin:s}=e;let l=!1,u=!1,c=!0;for(const f in t){const d=t[f];if(yT(f)){i[f]=d;continue}const h=vT[f],p=CG(d,h);if(qs.has(f)){if(l=!0,a[f]=p,!c)continue;d!==(h.default||0)&&(c=!1)}else f.startsWith("origin")?(u=!0,s[f]=p):o[f]=p}if(t.transform||(l||r?o.transform=_G(e.transform,n,c,r):o.transform&&(o.transform="none")),u){const{originX:f="50%",originY:d="50%",originZ:h=0}=s;o.transformOrigin=`${f} ${d} ${h}`}}const mS=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function wT(e,t,n){for(const r in t)!Mr(t[r])&&!pT(r,n)&&(e[r]=t[r])}function PG({transformTemplate:e},t,n){return P.useMemo(()=>{const r=mS();return pS(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function TG(e,t,n){const r=e.style||{},o={};return wT(o,r,e),Object.assign(o,PG(e,t,n)),e.transformValues?e.transformValues(o):o}function IG(e,t,n){const r={},o=TG(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const RG=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Zp(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||RG.has(e)}let bT=e=>!Zp(e);function kG(e){e&&(bT=t=>t.startsWith("on")?!Zp(t):e(t))}try{kG(require("@emotion/is-prop-valid").default)}catch{}function MG(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(bT(o)||n===!0&&Zp(o)||!t&&!Zp(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function x3(e,t,n){return typeof e=="string"?e:Pe.transform(t+n*e)}function DG(e,t,n){const r=x3(t,e.x,e.width),o=x3(n,e.y,e.height);return`${r} ${o}`}const LG={offset:"stroke-dashoffset",array:"stroke-dasharray"},NG={offset:"strokeDashoffset",array:"strokeDasharray"};function BG(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?LG:NG;e[i.offset]=Pe.transform(-r);const a=Pe.transform(t),s=Pe.transform(n);e[i.array]=`${a} ${s}`}function yS(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...u},c,f,d){if(pS(e,u,c,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:m}=e;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(o!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=DG(m,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),a!==void 0&&BG(h,a,s,l,!1)}const ST=()=>({...mS(),attrs:{}}),gS=e=>typeof e=="string"&&e.toLowerCase()==="svg";function jG(e,t,n,r){const o=P.useMemo(()=>{const i=ST();return yS(i,t,{enableHardwareAcceleration:!1},gS(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};wT(i,e.style,e),o.style={...i,...o.style}}return o}function FG(e=!1){return(n,r,o,{latestValues:i},a)=>{const l=(hS(n)?jG:IG)(r,i,a,n),c={...MG(r,typeof n=="string",e),...l,ref:o},{children:f}=r,d=P.useMemo(()=>Mr(f)?f.get():f,[f]);return P.createElement(n,{...c,children:d})}}const vS=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function _T(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const ET=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function CT(e,t,n,r){_T(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(ET.has(o)?o:vS(o),t.attrs[o])}function wS(e,t){const{style:n}=e,r={};for(const o in n)(Mr(n[o])||t.style&&Mr(t.style[o])||pT(o,e))&&(r[o]=n[o]);return r}function xT(e,t){const n=wS(e,t);for(const r in e)if(Mr(e[r])||Mr(t[r])){const o=sd.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[o]=e[r]}return n}function bS(e,t,n,r={},o={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,o)),t}function OT(e){const t=P.useRef(null);return t.current===null&&(t.current=e()),t.current}const Qp=e=>Array.isArray(e),$G=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),zG=e=>Qp(e)?e[e.length-1]||0:e;function op(e){const t=Mr(e)?e.get():e;return $G(t)?t.toValue():t}function VG({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const a={latestValues:UG(r,o,i,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const AT=e=>(t,n)=>{const r=P.useContext(um),o=P.useContext(ad),i=()=>VG(e,t,r,o);return n?i():OT(i)};function UG(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=op(i[d]);let{initial:a,animate:s}=e;const l=dm(e),u=dT(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=n?n.initial===!1:!1;c=c||a===!1;const f=c?s:a;return f&&typeof f!="boolean"&&!fm(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=bS(e,h);if(!p)return;const{transitionEnd:m,transition:S,...b}=p;for(const g in b){let E=b[g];if(Array.isArray(E)){const T=c?E.length-1:0;E=E[T]}E!==null&&(o[g]=E)}for(const g in m)o[g]=m[g]}),o}const HG={useVisualState:AT({scrapeMotionValuesFromProps:xT,createRenderState:ST,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}yS(n,r,{enableHardwareAcceleration:!1},gS(t.tagName),e.transformTemplate),CT(t,n)}})},WG={useVisualState:AT({scrapeMotionValuesFromProps:wS,createRenderState:mS})};function GG(e,{forwardMotionProps:t=!1},n,r){return{...hS(e)?HG:WG,preloadedFeatures:n,useRender:FG(t),createVisualElement:r,Component:e}}function Pi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const PT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function pm(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const KG=e=>t=>PT(t)&&e(t,pm(t));function Ri(e,t,n,r){return Pi(e,t,KG(n),r)}const XG=(e,t)=>n=>t(e(n)),xa=(...e)=>e.reduce(XG);function TT(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const O3=TT("dragHorizontal"),A3=TT("dragVertical");function IT(e){let t=!1;if(e==="y")t=A3();else if(e==="x")t=O3();else{const n=O3(),r=A3();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function RT(){const e=IT(!0);return e?(e(),!1):!0}class Fa{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Gt=e=>e;function qG(e){let t=[],n=[],r=0,o=!1,i=!1;const a=new WeakSet,s={schedule:(l,u=!1,c=!1)=>{const f=c&&o,d=f?t:n;return u&&a.add(l),d.indexOf(l)===-1&&(d.push(l),f&&o&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(o){i=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(f[d]=qG(()=>n=!0),f),{}),a=f=>i[f].process(o),s=f=>{n=!1,o.delta=r?1e3/60:Math.max(Math.min(f-o.timestamp,YG),1),o.timestamp=f,o.isProcessing=!0,hh.forEach(a),o.isProcessing=!1,n&&t&&(r=!1,e(s))},l=()=>{n=!0,r=!0,o.isProcessing||e(s)};return{schedule:hh.reduce((f,d)=>{const h=i[d];return f[d]=(p,m=!1,S=!1)=>(n||l(),h.schedule(p,m,S)),f},{}),cancel:f=>hh.forEach(d=>i[d].cancel(f)),state:o,steps:i}}const{schedule:Tt,cancel:Fi,state:Hn,steps:Qy}=ZG(typeof requestAnimationFrame<"u"?requestAnimationFrame:Gt,!0);function P3(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),o=(i,a)=>{if(i.type==="touch"||RT())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t),s[r]&&Tt.update(()=>s[r](i,a))};return Ri(e.current,n,o,{passive:!e.getProps()[r]})}class QG extends Fa{mount(){this.unmount=xa(P3(this.node,!0),P3(this.node,!1))}unmount(){}}class JG extends Fa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=xa(Pi(this.node.current,"focus",()=>this.onFocus()),Pi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const kT=(e,t)=>t?e===t?!0:kT(e,t.parentElement):!1;function Jy(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,pm(n))}class eK extends Fa{constructor(){super(...arguments),this.removeStartListeners=Gt,this.removeEndListeners=Gt,this.removeAccessibleListeners=Gt,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),i=Ri(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();Tt.update(()=>{kT(this.node.current,s.target)?u&&u(s,l):c&&c(s,l)})},{passive:!(r.onTap||r.onPointerUp)}),a=Ri(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=xa(i,a),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=i=>{if(i.key!=="Enter"||this.isPressing)return;const a=s=>{s.key!=="Enter"||!this.checkPressEnd()||Jy("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Tt.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Pi(this.node.current,"keyup",a),Jy("down",(s,l)=>{this.startPress(s,l)})},n=Pi(this.node.current,"keydown",t),r=()=>{this.isPressing&&Jy("cancel",(i,a)=>this.cancelPress(i,a))},o=Pi(this.node.current,"blur",r);this.removeAccessibleListeners=xa(n,o)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:o}=this.node.getProps();o&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Tt.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!RT()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Tt.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Ri(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Pi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=xa(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const x2=new WeakMap,eg=new WeakMap,tK=e=>{const t=x2.get(e.target);t&&t(e)},nK=e=>{e.forEach(tK)};function rK({root:e,...t}){const n=e||document;eg.has(n)||eg.set(n,{});const r=eg.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(nK,{root:e,...t})),r[o]}function oK(e,t,n){const r=rK(t);return x2.set(e,n),r.observe(e),()=>{x2.delete(e),r.unobserve(e)}}const iK={some:0,all:1};class aK extends Fa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:iK[o]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),d=u?c:f;d&&d(l)};return oK(this.node.current,a,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(sK(t,n))&&this.startObserver()}unmount(){}}function sK({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const lK={inView:{Feature:aK},tap:{Feature:eK},focus:{Feature:JG},hover:{Feature:QG}};function MT(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rt[r]=n.get()),t}function cK(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function mm(e,t,n){const r=e.getProps();return bS(r,t,n!==void 0?n:r.custom,uK(e),cK(e))}const fK="framerAppearId",dK="data-"+vS(fK);let hK=Gt,SS=Gt;const Oa=e=>e*1e3,ki=e=>e/1e3,pK={current:!1},DT=e=>Array.isArray(e)&&typeof e[0]=="number";function LT(e){return!!(!e||typeof e=="string"&&NT[e]||DT(e)||Array.isArray(e)&&e.every(LT))}const Oc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,NT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Oc([0,.65,.55,1]),circOut:Oc([.55,0,1,.45]),backIn:Oc([.31,.01,.66,-.59]),backOut:Oc([.33,1.53,.69,.99])};function BT(e){if(e)return DT(e)?Oc(e):Array.isArray(e)?e.map(BT):NT[e]}function mK(e,t,n,{delay:r=0,duration:o,repeat:i=0,repeatType:a="loop",ease:s,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=BT(s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:o,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"})}function yK(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const jT=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,gK=1e-7,vK=12;function wK(e,t,n,r,o){let i,a,s=0;do a=t+(n-t)/2,i=jT(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>gK&&++swK(i,0,1,e,n);return i=>i===0||i===1?i:jT(o(i),t,r)}const bK=cd(.42,0,1,1),SK=cd(0,0,.58,1),FT=cd(.42,0,.58,1),_K=e=>Array.isArray(e)&&typeof e[0]!="number",$T=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,zT=e=>t=>1-e(1-t),VT=e=>1-Math.sin(Math.acos(e)),_S=zT(VT),EK=$T(_S),UT=cd(.33,1.53,.69,.99),ES=zT(UT),CK=$T(ES),xK=e=>(e*=2)<1?.5*ES(e):.5*(2-Math.pow(2,-10*(e-1))),OK={linear:Gt,easeIn:bK,easeInOut:FT,easeOut:SK,circIn:VT,circInOut:EK,circOut:_S,backIn:ES,backInOut:CK,backOut:UT,anticipate:xK},T3=e=>{if(Array.isArray(e)){SS(e.length===4);const[t,n,r,o]=e;return cd(t,n,r,o)}else if(typeof e=="string")return OK[e];return e},CS=(e,t)=>n=>!!(ld(n)&&xG.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),HT=(e,t,n)=>r=>{if(!ld(r))return r;const[o,i,a,s]=r.match(hm);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},AK=e=>ka(0,255,e),tg={...Ys,transform:e=>Math.round(AK(e))},vs={test:CS("rgb","red"),parse:HT("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+tg.transform(e)+", "+tg.transform(t)+", "+tg.transform(n)+", "+Xc(Kc.transform(r))+")"};function PK(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const O2={test:CS("#"),parse:PK,transform:vs.transform},jl={test:CS("hsl","hue"),parse:HT("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+fi.transform(Xc(t))+", "+fi.transform(Xc(n))+", "+Xc(Kc.transform(r))+")"},er={test:e=>vs.test(e)||O2.test(e)||jl.test(e),parse:e=>vs.test(e)?vs.parse(e):jl.test(e)?jl.parse(e):O2.parse(e),transform:e=>ld(e)?e:e.hasOwnProperty("red")?vs.transform(e):jl.transform(e)},Ft=(e,t,n)=>-n*e+n*t+e;function ng(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function TK({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,a=0;if(!t)o=i=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=ng(l,s,e+1/3),i=ng(l,s,e),a=ng(l,s,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}const rg=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},IK=[O2,vs,jl],RK=e=>IK.find(t=>t.test(e));function I3(e){const t=RK(e);let n=t.parse(e);return t===jl&&(n=TK(n)),n}const WT=(e,t)=>{const n=I3(e),r=I3(t),o={...n};return i=>(o.red=rg(n.red,r.red,i),o.green=rg(n.green,r.green,i),o.blue=rg(n.blue,r.blue,i),o.alpha=Ft(n.alpha,r.alpha,i),vs.transform(o))};function kK(e){var t,n;return isNaN(e)&&ld(e)&&(((t=e.match(hm))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(gT))===null||n===void 0?void 0:n.length)||0)>0}const GT={regex:EG,countKey:"Vars",token:"${v}",parse:Gt},KT={regex:gT,countKey:"Colors",token:"${c}",parse:er.parse},XT={regex:hm,countKey:"Numbers",token:"${n}",parse:Ys.parse};function og(e,{regex:t,countKey:n,token:r,parse:o}){const i=e.tokenised.match(t);i&&(e["num"+n]=i.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...i.map(o)))}function Jp(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&og(n,GT),og(n,KT),og(n,XT),n}function qT(e){return Jp(e).values}function YT(e){const{values:t,numColors:n,numVars:r,tokenised:o}=Jp(e),i=t.length;return a=>{let s=o;for(let l=0;ltypeof e=="number"?0:e;function DK(e){const t=qT(e);return YT(e)(t.map(MK))}const Ma={test:kK,parse:qT,createTransformer:YT,getAnimatableNone:DK},ZT=(e,t)=>n=>`${n>0?t:e}`;function QT(e,t){return typeof e=="number"?n=>Ft(e,t,n):er.test(e)?WT(e,t):e.startsWith("var(")?ZT(e,t):eI(e,t)}const JT=(e,t)=>{const n=[...e],r=n.length,o=e.map((i,a)=>QT(i,t[a]));return i=>{for(let a=0;a{const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=QT(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}},eI=(e,t)=>{const n=Ma.createTransformer(t),r=Jp(e),o=Jp(t);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?xa(JT(r.values,o.values),n):ZT(e,t)},Df=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},R3=(e,t)=>n=>Ft(e,t,n);function NK(e){return typeof e=="number"?R3:typeof e=="string"?er.test(e)?WT:eI:Array.isArray(e)?JT:typeof e=="object"?LK:R3}function BK(e,t,n){const r=[],o=n||NK(e[0]),i=e.length-1;for(let a=0;at[0];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=BK(t,r,o),s=a.length,l=u=>{let c=0;if(s>1)for(;cl(ka(e[0],e[i-1],u)):l}function jK(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Df(0,t,r);e.push(Ft(n,1,o))}}function FK(e){const t=[0];return jK(t,e.length-1),t}function $K(e,t){return e.map(n=>n*t)}function zK(e,t){return e.map(()=>t||FT).splice(0,e.length-1)}function e1({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=_K(r)?r.map(T3):T3(r),i={done:!1,value:t[0]},a=$K(n&&n.length===t.length?n:FK(t),e),s=tI(a,t,{ease:Array.isArray(o)?o:zK(t,o)});return{calculatedDuration:e,next:l=>(i.value=s(l),i.done=l>=e,i)}}function nI(e,t){return t?e*(1e3/t):0}const VK=5;function rI(e,t,n){const r=Math.max(t-VK,0);return nI(n-e(r),t-r)}const ig=.001,UK=.01,k3=10,HK=.05,WK=1;function GK({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;hK(e<=Oa(k3));let a=1-t;a=ka(HK,WK,a),e=ka(UK,k3,ki(e)),a<1?(o=u=>{const c=u*a,f=c*e,d=c-n,h=A2(u,a),p=Math.exp(-f);return ig-d/h*p},i=u=>{const f=u*a*e,d=f*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-f),m=A2(Math.pow(u,2),a);return(-o(u)+ig>0?-1:1)*((d-h)*p)/m}):(o=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-ig+c*f},i=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const s=5/e,l=XK(o,i,s);if(e=Oa(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const KK=12;function XK(e,t,n){let r=n;for(let o=1;oe[n]!==void 0)}function ZK(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!M3(e,YK)&&M3(e,qK)){const n=GK(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function oI({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],a={done:!1,value:o},{stiffness:s,damping:l,mass:u,velocity:c,duration:f,isResolvedFromDuration:d}=ZK(r),h=c?-ki(c):0,p=l/(2*Math.sqrt(s*u)),m=i-o,S=ki(Math.sqrt(s/u)),b=Math.abs(m)<5;n||(n=b?.01:2),t||(t=b?.005:.5);let g;if(p<1){const E=A2(S,p);g=T=>{const O=Math.exp(-p*S*T);return i-O*((h+p*S*m)/E*Math.sin(E*T)+m*Math.cos(E*T))}}else if(p===1)g=E=>i-Math.exp(-S*E)*(m+(h+S*m)*E);else{const E=S*Math.sqrt(p*p-1);g=T=>{const O=Math.exp(-p*S*T),A=Math.min(E*T,300);return i-O*((h+p*S*m)*Math.sinh(A)+E*m*Math.cosh(A))/E}}return{calculatedDuration:d&&f||null,next:E=>{const T=g(E);if(d)a.done=E>=f;else{let O=h;E!==0&&(p<1?O=rI(g,E,T):O=0);const A=Math.abs(O)<=n,C=Math.abs(i-T)<=t;a.done=A&&C}return a.value=a.done?i:T,a}}}function D3({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],d={done:!1,value:f},h=y=>s!==void 0&&yl,p=y=>s===void 0?l:l===void 0||Math.abs(s-y)-m*Math.exp(-y/r),E=y=>b+g(y),T=y=>{const _=g(y),v=E(y);d.done=Math.abs(_)<=u,d.value=d.done?b:v};let O,A;const C=y=>{h(d.value)&&(O=y,A=oI({keyframes:[d.value,p(d.value)],velocity:rI(E,y,d.value),damping:o,stiffness:i,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:y=>{let _=!1;return!A&&O===void 0&&(_=!0,T(y),C(y)),O!==void 0&&y>O?A.next(y-O):(!_&&T(y),d)}}}const QK=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Tt.update(t,!0),stop:()=>Fi(t),now:()=>Hn.isProcessing?Hn.timestamp:performance.now()}},L3=2e4;function N3(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=L3?1/0:t}const JK={decay:D3,inertia:D3,tween:e1,keyframes:e1,spring:oI};function t1({autoplay:e=!0,delay:t=0,driver:n=QK,keyframes:r,type:o="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:f,...d}){let h=1,p=!1,m,S;const b=()=>{S=new Promise(B=>{m=B})};b();let g;const E=JK[o]||e1;let T;E!==e1&&typeof r[0]!="number"&&(T=tI([0,100],r,{clamp:!1}),r=[0,100]);const O=E({...d,keyframes:r});let A;s==="mirror"&&(A=E({...d,keyframes:[...r].reverse(),velocity:-(d.velocity||0)}));let C="idle",y=null,_=null,v=null;O.calculatedDuration===null&&i&&(O.calculatedDuration=N3(O));const{calculatedDuration:x}=O;let I=1/0,R=1/0;x!==null&&(I=x+a,R=I*(i+1)-a);let k=0;const M=B=>{if(_===null)return;h>0&&(_=Math.min(_,B)),h<0&&(_=Math.min(B-R/h,_)),y!==null?k=y:k=Math.round(B-_)*h;const V=k-t*(h>=0?1:-1),K=h>=0?V<0:V>R;k=Math.max(V,0),C==="finished"&&y===null&&(k=R);let W=k,Q=O;if(i){const le=k/I;let ge=Math.floor(le),se=le%1;!se&&le>=1&&(se=1),se===1&&ge--,ge=Math.min(ge,i+1);const ue=!!(ge%2);ue&&(s==="reverse"?(se=1-se,a&&(se-=a/I)):s==="mirror"&&(Q=A));let Ie=ka(0,1,se);k>R&&(Ie=s==="reverse"&&ue?1:0),W=Ie*I}const X=K?{done:!1,value:r[0]}:Q.next(W);T&&(X.value=T(X.value));let{done:J}=X;!K&&x!==null&&(J=h>=0?k>=R:k<=0);const te=y===null&&(C==="finished"||C==="running"&&J);return f&&f(X.value),te&&L(),X},N=()=>{g&&g.stop(),g=void 0},D=()=>{C="idle",N(),m(),b(),_=v=null},L=()=>{C="finished",c&&c(),N(),m()},j=()=>{if(p)return;g||(g=n(M));const B=g.now();l&&l(),y!==null?_=B-y:(!_||C==="finished")&&(_=B),C==="finished"&&b(),v=_,y=null,C="running",g.start()};e&&j();const F={then(B,V){return S.then(B,V)},get time(){return ki(k)},set time(B){B=Oa(B),k=B,y!==null||!g||h===0?y=B:_=g.now()-B/h},get duration(){const B=O.calculatedDuration===null?N3(O):O.calculatedDuration;return ki(B)},get speed(){return h},set speed(B){B===h||!g||(h=B,F.time=ki(k))},get state(){return C},play:j,pause:()=>{C="paused",y=k},stop:()=>{p=!0,C!=="idle"&&(C="idle",u&&u(),D())},cancel:()=>{v!==null&&M(v),D()},complete:()=>{C="finished"},sample:B=>(_=0,M(B))};return F}function eX(e){let t;return()=>(t===void 0&&(t=e()),t)}const tX=eX(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),nX=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),ph=10,rX=2e4,oX=(e,t)=>t.type==="spring"||e==="backgroundColor"||!LT(t.ease);function iX(e,t,{onUpdate:n,onComplete:r,...o}){if(!(tX()&&nX.has(t)&&!o.repeatDelay&&o.repeatType!=="mirror"&&o.damping!==0&&o.type!=="inertia"))return!1;let a=!1,s,l;const u=()=>{l=new Promise(g=>{s=g})};u();let{keyframes:c,duration:f=300,ease:d,times:h}=o;if(oX(t,o)){const g=t1({...o,repeat:0,delay:0});let E={done:!1,value:c[0]};const T=[];let O=0;for(;!E.done&&Op.cancel(),S=()=>{Tt.update(m),s(),u()};return p.onfinish=()=>{e.set(yK(c,o)),r&&r(),S()},{then(g,E){return l.then(g,E)},attachTimeline(g){return p.timeline=g,p.onfinish=null,Gt},get time(){return ki(p.currentTime||0)},set time(g){p.currentTime=Oa(g)},get speed(){return p.playbackRate},set speed(g){p.playbackRate=g},get duration(){return ki(f)},play:()=>{a||(p.play(),Fi(m))},pause:()=>p.pause(),stop:()=>{if(a=!0,p.playState==="idle")return;const{currentTime:g}=p;if(g){const E=t1({...o,autoplay:!1});e.setWithVelocity(E.sample(g-ph).value,E.sample(g).value,ph)}S()},complete:()=>p.finish(),cancel:S}}function aX({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Gt,pause:Gt,stop:Gt,then:i=>(i(),Promise.resolve()),cancel:Gt,complete:Gt});return t?t1({keyframes:[0,1],duration:0,delay:t,onComplete:o}):o()}const sX={type:"spring",stiffness:500,damping:25,restSpeed:10},lX=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),uX={type:"keyframes",duration:.8},cX={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fX=(e,{keyframes:t})=>t.length>2?uX:qs.has(e)?e.startsWith("scale")?lX(t[1]):sX:cX,P2=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ma.test(t)||t==="0")&&!t.startsWith("url(")),dX=new Set(["brightness","contrast","saturate","opacity"]);function hX(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(hm)||[];if(!r)return e;const o=n.replace(r,"");let i=dX.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const pX=/([a-z-]*)\(.*?\)/g,T2={...Ma,getAnimatableNone:e=>{const t=e.match(pX);return t?t.map(hX).join(" "):e}},mX={...vT,color:er,backgroundColor:er,outlineColor:er,fill:er,stroke:er,borderColor:er,borderTopColor:er,borderRightColor:er,borderBottomColor:er,borderLeftColor:er,filter:T2,WebkitFilter:T2},xS=e=>mX[e];function iI(e,t){let n=xS(e);return n!==T2&&(n=Ma),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const aI=e=>/^0[^.\s]+$/.test(e);function yX(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||aI(e)}function gX(e,t,n,r){const o=P2(t,n);let i;Array.isArray(n)?i=[...n]:i=[null,n];const a=r.from!==void 0?r.from:e.get();let s;const l=[];for(let u=0;uo=>{const i=sI(r,e)||{},a=i.delay||r.delay||0;let{elapsed:s=0}=r;s=s-Oa(a);const l=gX(t,e,n,i),u=l[0],c=l[l.length-1],f=P2(e,u),d=P2(e,c);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...i,delay:-s,onUpdate:p=>{t.set(p),i.onUpdate&&i.onUpdate(p)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(vX(i)||(h={...h,...fX(e,h)}),h.duration&&(h.duration=Oa(h.duration)),h.repeatDelay&&(h.repeatDelay=Oa(h.repeatDelay)),!f||!d||pK.current||i.type===!1)return aX(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=iX(t,e,h);if(p)return p}return t1(h)};function n1(e){return!!(Mr(e)&&e.add)}const wX=e=>/^\-?\d*\.?\d+$/.test(e);function AS(e,t){e.indexOf(t)===-1&&e.push(t)}function PS(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class TS{constructor(){this.subscriptions=[]}add(t){return AS(this.subscriptions,t),()=>PS(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i!isNaN(parseFloat(e));class SX{constructor(t,n={}){this.version="10.15.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,o=!0)=>{this.prev=this.current,this.current=r;const{delta:i,timestamp:a}=Hn;this.lastUpdated!==a&&(this.timeDelta=i,this.lastUpdated=a,Tt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Tt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=bX(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new TS);const r=this.events[t].add(n);return t==="change"?()=>{r(),Tt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?nI(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Su(e,t){return new SX(e,t)}const lI=e=>t=>t.test(e),_X={test:e=>e==="auto",parse:e=>e},uI=[Ys,Pe,fi,ra,AG,OG,_X],lc=e=>uI.find(lI(e)),EX=[...uI,er,Ma],CX=e=>EX.find(lI(e));function xX(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Su(n))}function OX(e,t){const n=mm(e,t);let{transitionEnd:r={},transition:o={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const a in i){const s=zG(i[a]);xX(e,a,s)}}function AX(e,t,n){var r,o;const i=Object.keys(t).filter(s=>!e.hasValue(s)),a=i.length;if(a)for(let s=0;sl.remove(f))),u.push(m)}return a&&Promise.all(u).then(()=>{a&&OX(e,a)}),u}function I2(e,t,n={}){const r=mm(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(cI(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:f}=o;return RX(e,t,u+l,c,f,n)}:()=>Promise.resolve(),{when:s}=o;if(s){const[l,u]=s==="beforeChildren"?[i,a]:[a,i];return l().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function RX(e,t,n=0,r=0,o=1,i){const a=[],s=(e.variantChildren.size-1)*r,l=o===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(kX).forEach((u,c)=>{u.notify("AnimationStart",t),a.push(I2(u,t,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function kX(e,t){return e.sortNodePosition(t)}function MX(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>I2(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=I2(e,t,n);else{const o=typeof t=="function"?mm(e,t,n.custom):t;r=Promise.all(cI(e,o,n))}return r.then(()=>e.notify("AnimationComplete",t))}const DX=[...cS].reverse(),LX=cS.length;function NX(e){return t=>Promise.all(t.map(({animation:n,options:r})=>MX(e,n,r)))}function BX(e){let t=NX(e);const n=FX();let r=!0;const o=(l,u)=>{const c=mm(e,u);if(c){const{transition:f,transitionEnd:d,...h}=c;l={...l,...h,...d}}return l};function i(l){t=l(e)}function a(l,u){const c=e.getProps(),f=e.getVariantContext(!0)||{},d=[],h=new Set;let p={},m=1/0;for(let b=0;bm&&O;const v=Array.isArray(T)?T:[T];let x=v.reduce(o,{});A===!1&&(x={});const{prevResolvedValues:I={}}=E,R={...I,...x},k=M=>{_=!0,h.delete(M),E.needsAnimating[M]=!0};for(const M in R){const N=x[M],D=I[M];p.hasOwnProperty(M)||(N!==D?Qp(N)&&Qp(D)?!MT(N,D)||y?k(M):E.protectedKeys[M]=!0:N!==void 0?k(M):h.add(M):N!==void 0&&h.has(M)?k(M):E.protectedKeys[M]=!0)}E.prevProp=T,E.prevResolvedValues=x,E.isActive&&(p={...p,...x}),r&&e.blockInitialAnimation&&(_=!1),_&&!C&&d.push(...v.map(M=>({animation:M,options:{type:g,...l}})))}if(h.size){const b={};h.forEach(g=>{const E=e.getBaseTarget(g);E!==void 0&&(b[g]=E)}),d.push({animation:b})}let S=!!d.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(S=!1),r=!1,S?t(d):Promise.resolve()}function s(l,u,c){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=a(c,l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:a,setActive:s,setAnimateFunction:i,getState:()=>n}}function jX(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!MT(t,e):!1}function Qa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function FX(){return{animate:Qa(!0),whileInView:Qa(),whileHover:Qa(),whileTap:Qa(),whileDrag:Qa(),whileFocus:Qa(),exit:Qa()}}class $X extends Fa{constructor(t){super(t),t.animationState||(t.animationState=BX(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),fm(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let zX=0;class VX extends Fa{constructor(){super(...arguments),this.id=zX++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;const i=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const UX={animation:{Feature:$X},exit:{Feature:VX}},B3=(e,t)=>Math.abs(e-t);function HX(e,t){const n=B3(e.x,t.x),r=B3(e.y,t.y);return Math.sqrt(n**2+r**2)}class fI{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=sg(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,f=HX(u.offset,{x:0,y:0})>=3;if(!c&&!f)return;const{point:d}=u,{timestamp:h}=Hn;this.history.push({...d,timestamp:h});const{onStart:p,onMove:m}=this.handlers;c||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=ag(c,this.transformPagePoint),Tt.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,h=sg(u.type==="pointercancel"?this.lastMoveEventInfo:ag(c,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,h),d&&d(u,h)},!PT(t))return;this.handlers=n,this.transformPagePoint=r;const o=pm(t),i=ag(o,this.transformPagePoint),{point:a}=i,{timestamp:s}=Hn;this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,sg(i,this.history)),this.removeListeners=xa(Ri(window,"pointermove",this.handlePointerMove),Ri(window,"pointerup",this.handlePointerUp),Ri(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Fi(this.updatePoint)}}function ag(e,t){return t?{point:t(e.point)}:e}function j3(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sg({point:e},t){return{point:e,delta:j3(e,dI(t)),offset:j3(e,WX(t)),velocity:GX(t,.1)}}function WX(e){return e[0]}function dI(e){return e[e.length-1]}function GX(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=dI(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Oa(t)));)n--;if(!r)return{x:0,y:0};const i=ki(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Zr(e){return e.max-e.min}function R2(e,t=0,n=.01){return Math.abs(e-t)<=n}function F3(e,t,n,r=.5){e.origin=r,e.originPoint=Ft(t.min,t.max,e.origin),e.scale=Zr(n)/Zr(t),(R2(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Ft(n.min,n.max,e.origin)-e.originPoint,(R2(e.translate)||isNaN(e.translate))&&(e.translate=0)}function qc(e,t,n,r){F3(e.x,t.x,n.x,r?r.originX:void 0),F3(e.y,t.y,n.y,r?r.originY:void 0)}function $3(e,t,n){e.min=n.min+t.min,e.max=e.min+Zr(t)}function KX(e,t,n){$3(e.x,t.x,n.x),$3(e.y,t.y,n.y)}function z3(e,t,n){e.min=t.min-n.min,e.max=e.min+Zr(t)}function Yc(e,t,n){z3(e.x,t.x,n.x),z3(e.y,t.y,n.y)}function XX(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Ft(n,e,r.max):Math.min(e,n)),e}function V3(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function qX(e,{top:t,left:n,bottom:r,right:o}){return{x:V3(e.x,n,o),y:V3(e.y,t,r)}}function U3(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Df(t.min,t.max-r,e.min):r>o&&(n=Df(e.min,e.max-o,t.min)),ka(0,1,n)}function QX(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const k2=.35;function JX(e=k2){return e===!1?e=0:e===!0&&(e=k2),{x:H3(e,"left","right"),y:H3(e,"top","bottom")}}function H3(e,t,n){return{min:W3(e,t),max:W3(e,n)}}function W3(e,t){return typeof e=="number"?e:e[t]||0}const G3=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fl=()=>({x:G3(),y:G3()}),K3=()=>({min:0,max:0}),nn=()=>({x:K3(),y:K3()});function Yo(e){return[e("x"),e("y")]}function hI({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function eq({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function tq(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function lg(e){return e===void 0||e===1}function M2({scale:e,scaleX:t,scaleY:n}){return!lg(e)||!lg(t)||!lg(n)}function os(e){return M2(e)||pI(e)||e.z||e.rotate||e.rotateX||e.rotateY}function pI(e){return X3(e.x)||X3(e.y)}function X3(e){return e&&e!=="0%"}function r1(e,t,n){const r=e-n,o=t*r;return n+o}function q3(e,t,n,r,o){return o!==void 0&&(e=r1(e,o,r)),r1(e,n,r)+t}function D2(e,t=0,n=1,r,o){e.min=q3(e.min,t,n,r,o),e.max=q3(e.max,t,n,r,o)}function mI(e,{x:t,y:n}){D2(e.x,t.translate,t.scale,t.originPoint),D2(e.y,n.translate,n.scale,n.originPoint)}function nq(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,a;for(let s=0;s1.0000000000001||e<.999999999999?e:1}function aa(e,t){e.min=e.min+t,e.max=e.max+t}function Z3(e,t,[n,r,o]){const i=t[o]!==void 0?t[o]:.5,a=Ft(e.min,e.max,i);D2(e,t[n],t[r],a,t.scale)}const rq=["x","scaleX","originX"],oq=["y","scaleY","originY"];function $l(e,t){Z3(e.x,t,rq),Z3(e.y,t,oq)}function yI(e,t){return hI(tq(e.getBoundingClientRect(),t))}function iq(e,t,n){const r=yI(e,n),{scroll:o}=t;return o&&(aa(r.x,o.offset.x),aa(r.y,o.offset.y)),r}const aq=new WeakMap;class sq{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=nn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=l=>{this.stopAnimation(),n&&this.snapToCursor(pm(l,"page").point)},i=(l,u)=>{const{drag:c,dragPropagation:f,onDragStart:d}=this.getProps();if(c&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=IT(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yo(p=>{let m=this.getAxisMotionValue(p).get()||0;if(fi.test(m)){const{projection:S}=this.visualElement;if(S&&S.layout){const b=S.layout.layoutBox[p];b&&(m=Zr(b)*(parseFloat(m)/100))}}this.originPoint[p]=m}),d&&Tt.update(()=>d(l,u),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},a=(l,u)=>{const{dragPropagation:c,dragDirectionLock:f,onDirectionLock:d,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(f&&this.currentDirection===null){this.currentDirection=lq(p),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},s=(l,u)=>this.stop(l,u);this.panSession=new fI(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:s},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&Tt.update(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!mh(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=XX(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},o=this.constraints;t&&Bl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=qX(r.layoutBox,t):this.constraints=!1,this.elastic=JX(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Yo(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=QX(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Bl(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=iq(r,o.root,this.visualElement.getTransformPagePoint());let a=YX(o.layout.layoutBox,i);if(n){const s=n(eq(a));this.hasMutatedConstraints=!!s,s&&(a=hI(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Yo(c=>{if(!mh(c,n,this.currentDirection))return;let f=l&&l[c]||{};a&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(OS(t,r,0,n))}stopAnimation(){Yo(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Yo(n=>{const{drag:r}=this.getProps();if(!mh(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:s}=o.layout.layoutBox[n];i.set(t[n]-Ft(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Bl(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Yo(a=>{const s=this.getAxisMotionValue(a);if(s){const l=s.get();o[a]=ZX({min:l,max:l},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Yo(a=>{if(!mh(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(Ft(l,u,o[a]))})}addListeners(){if(!this.visualElement.current)return;aq.set(this.visualElement,this);const t=this.visualElement.current,n=Ri(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Bl(l)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),r();const a=Pi(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Yo(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:a=k2,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:a,dragMomentum:s}}}function mh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function lq(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class uq extends Fa{constructor(t){super(t),this.removeGroupControls=Gt,this.removeListeners=Gt,this.controls=new sq(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Gt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Q3=e=>(t,n)=>{e&&Tt.update(()=>e(t,n))};class cq extends Fa{constructor(){super(...arguments),this.removePointerDownListener=Gt}onPointerDown(t){this.session=new fI(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Q3(t),onStart:Q3(n),onMove:r,onEnd:(i,a)=>{delete this.session,o&&Tt.update(()=>o(i,a))}}}mount(){this.removePointerDownListener=Ri(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function gI(){const e=P.useContext(ad);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=P.useId();return P.useEffect(()=>r(o),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}function fq(){return dq(P.useContext(ad))}function dq(e){return e===null?!0:e.isPresent}const ip={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function J3(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const uc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Pe.test(e))e=parseFloat(e);else return e;const n=J3(e,t.target.x),r=J3(e,t.target.y);return`${n}% ${r}%`}},hq={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ma.parse(e);if(o.length>5)return r;const i=Ma.createTransformer(e),a=typeof o[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;o[0+a]/=s,o[1+a]/=l;const u=Ft(s,l,.5);return typeof o[2+a]=="number"&&(o[2+a]/=u),typeof o[3+a]=="number"&&(o[3+a]/=u),i(o)}};class pq extends ee.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;wG(mq),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),ip.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,o||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||Tt.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function vI(e){const[t,n]=gI(),r=P.useContext(dS);return ee.createElement(pq,{...e,layoutGroup:r,switchLayoutGroup:P.useContext(hT),isPresent:t,safeToRemove:n})}const mq={borderRadius:{...uc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:uc,borderTopRightRadius:uc,borderBottomLeftRadius:uc,borderBottomRightRadius:uc,boxShadow:hq},wI=["TopLeft","TopRight","BottomLeft","BottomRight"],yq=wI.length,ex=e=>typeof e=="string"?parseFloat(e):e,tx=e=>typeof e=="number"||Pe.test(e);function gq(e,t,n,r,o,i){o?(e.opacity=Ft(0,n.opacity!==void 0?n.opacity:1,vq(r)),e.opacityExit=Ft(t.opacity!==void 0?t.opacity:1,0,wq(r))):i&&(e.opacity=Ft(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(Df(e,t,r))}function rx(e,t){e.min=t.min,e.max=t.max}function oo(e,t){rx(e.x,t.x),rx(e.y,t.y)}function ox(e,t,n,r,o){return e-=t,e=r1(e,1/n,r),o!==void 0&&(e=r1(e,1/o,r)),e}function bq(e,t=0,n=1,r=.5,o,i=e,a=e){if(fi.test(t)&&(t=parseFloat(t),t=Ft(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=Ft(i.min,i.max,r);e===i&&(s-=t),e.min=ox(e.min,t,n,s,o),e.max=ox(e.max,t,n,s,o)}function ix(e,t,[n,r,o],i,a){bq(e,t[n],t[r],t[o],t.scale,i,a)}const Sq=["x","scaleX","originX"],_q=["y","scaleY","originY"];function ax(e,t,n,r){ix(e.x,t,Sq,n?n.x:void 0,r?r.x:void 0),ix(e.y,t,_q,n?n.y:void 0,r?r.y:void 0)}function sx(e){return e.translate===0&&e.scale===1}function SI(e){return sx(e.x)&&sx(e.y)}function Eq(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function _I(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function lx(e){return Zr(e.x)/Zr(e.y)}class Cq{constructor(){this.members=[]}add(t){AS(this.members,t),t.scheduleRender()}remove(t){if(PS(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ux(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r=`translate3d(${o}px, ${i}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const xq=(e,t)=>e.depth-t.depth;class Oq{constructor(){this.children=[],this.isDirty=!1}add(t){AS(this.children,t),this.isDirty=!0}remove(t){PS(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(xq),this.isDirty=!1,this.children.forEach(t)}}function Aq(e,t){const n=performance.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Fi(r),e(i-t))};return Tt.read(r,!0),()=>Fi(r)}function Pq(e){window.MotionDebug&&window.MotionDebug.record(e)}function Tq(e){return e instanceof SVGElement&&e.tagName!=="svg"}function Iq(e,t,n){const r=Mr(e)?e:Su(e);return r.start(OS("",r,t,n)),r.animation}const cx=["","X","Y","Z"],fx=1e3;let Rq=0;const is={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function EI({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},s=t==null?void 0:t()){this.id=Rq++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{is.totalNodes=is.resolvedTargetDeltas=is.recalculatedProjection=0,this.nodes.forEach(Dq),this.nodes.forEach(Fq),this.nodes.forEach($q),this.nodes.forEach(Lq),Pq(is)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Aq(d,250),ip.hasAnimatedSinceResize&&(ip.hasAnimatedSinceResize=!1,this.nodes.forEach(hx))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:d,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Wq,{onLayoutAnimationStart:S,onLayoutAnimationComplete:b}=c.getProps(),g=!this.targetLayout||!_I(this.targetLayout,p)||h,E=!d&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||E||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,E);const T={...sI(m,"layout"),onPlay:S,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else d||hx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Fi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(zq),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;cthis.update()))}clearAllSnapshots(){this.nodes.forEach(Nq),this.sharedNodes.forEach(Vq)}scheduleUpdateProjection(){Tt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Tt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const O=T/1e3;px(f.x,a.x,O),px(f.y,a.y,O),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yc(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Uq(this.relativeTarget,this.relativeTargetOrigin,d,O),E&&Eq(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=nn()),oo(E,this.relativeTarget)),m&&(this.animationValues=c,gq(c,u,this.latestValues,O,g,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Fi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tt.update(()=>{ip.hasAnimatedSinceResize=!0,this.currentAnimation=Iq(0,fx,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(fx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&CI(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||nn();const f=Zr(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const d=Zr(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+d}oo(s,l),$l(s,c),qc(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new Cq),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let c=0;c{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(dx),this.root.sharedNodes.clear()}}}function kq(e){e.updateLayout()}function Mq(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,a=n.source!==e.layout.source;i==="size"?Yo(f=>{const d=a?n.measuredBox[f]:n.layoutBox[f],h=Zr(d);d.min=r[f].min,d.max=d.min+h}):CI(i,n.layoutBox,r)&&Yo(f=>{const d=a?n.measuredBox[f]:n.layoutBox[f],h=Zr(r[f]);d.max=d.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const s=Fl();qc(s,r,n.layoutBox);const l=Fl();a?qc(l,e.applyTransform(o,!0),n.measuredBox):qc(l,r,n.layoutBox);const u=!SI(s);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=nn();Yc(p,n.layoutBox,d.layoutBox);const m=nn();Yc(m,r,h.layoutBox),_I(p,m)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Dq(e){is.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Lq(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Nq(e){e.clearSnapshot()}function dx(e){e.clearMeasurements()}function Bq(e){e.isLayoutDirty=!1}function jq(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function hx(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Fq(e){e.resolveTargetDelta()}function $q(e){e.calcProjection()}function zq(e){e.resetRotation()}function Vq(e){e.removeLeadSnapshot()}function px(e,t,n){e.translate=Ft(t.translate,0,n),e.scale=Ft(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function mx(e,t,n,r){e.min=Ft(t.min,n.min,r),e.max=Ft(t.max,n.max,r)}function Uq(e,t,n,r){mx(e.x,t.x,n.x,r),mx(e.y,t.y,n.y,r)}function Hq(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Wq={duration:.45,ease:[.4,0,.1,1]},yx=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),gx=yx("applewebkit/")&&!yx("chrome/")?Math.round:Gt;function vx(e){e.min=gx(e.min),e.max=gx(e.max)}function Gq(e){vx(e.x),vx(e.y)}function CI(e,t,n){return e==="position"||e==="preserve-aspect"&&!R2(lx(t),lx(n),.2)}const Kq=EI({attachResizeListener:(e,t)=>Pi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ug={current:void 0},xI=EI({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ug.current){const e=new Kq({});e.mount(window),e.setOptions({layoutScroll:!0}),ug.current=e}return ug.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Xq={pan:{Feature:cq},drag:{Feature:uq,ProjectionNode:xI,MeasureLayout:vI}},qq=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Yq(e){const t=qq.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function L2(e,t,n=1){const[r,o]=Yq(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);return i?i.trim():C2(o)?L2(o,t,n+1):o}function Zq(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(o=>{const i=o.get();if(!C2(i))return;const a=L2(i,r);a&&o.set(a)});for(const o in t){const i=t[o];if(!C2(i))continue;const a=L2(i,r);a&&(t[o]=a,n||(n={}),n[o]===void 0&&(n[o]=i))}return{target:t,transitionEnd:n}}const Qq=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),OI=e=>Qq.has(e),Jq=e=>Object.keys(e).some(OI),wx=e=>e===Ys||e===Pe,bx=(e,t)=>parseFloat(e.split(", ")[t]),Sx=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return bx(o[1],t);{const i=r.match(/^matrix\((.+)\)$/);return i?bx(i[1],e):0}},eY=new Set(["x","y","z"]),tY=sd.filter(e=>!eY.has(e));function nY(e){const t=[];return tY.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const _u={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Sx(4,13),y:Sx(5,14)};_u.translateX=_u.x;_u.translateY=_u.y;const rY=(e,t,n)=>{const r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),{display:a}=i,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=_u[u](r,i)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(s[u]),e[u]=_u[u](l,i)}),e},oY=(e,t,n={},r={})=>{t={...t},r={...r};const o=Object.keys(t).filter(OI);let i=[],a=!1;const s=[];if(o.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],f=lc(c);const d=t[l];let h;if(Qp(d)){const p=d.length,m=d[0]===null?1:0;c=d[m],f=lc(c);for(let S=m;S=0?window.pageYOffset:null,u=rY(t,e,s);return i.length&&i.forEach(([c,f])=>{e.getValue(c).set(f)}),e.render(),cm&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function iY(e,t,n,r){return Jq(t)?oY(e,t,n,r):{target:t,transitionEnd:r}}const aY=(e,t,n,r)=>{const o=Zq(e,t,r);return t=o.target,r=o.transitionEnd,iY(e,t,n,r)},N2={current:null},AI={current:!1};function sY(){if(AI.current=!0,!!cm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>N2.current=e.matches;e.addListener(t),t()}else N2.current=!1}function lY(e,t,n){const{willChange:r}=t;for(const o in t){const i=t[o],a=n[o];if(Mr(i))e.addValue(o,i),n1(r)&&r.add(o);else if(Mr(a))e.addValue(o,Su(i,{owner:e})),n1(r)&&r.remove(o);else if(a!==i)if(e.hasValue(o)){const s=e.getValue(o);!s.hasAnimated&&s.set(i)}else{const s=e.getStaticValue(o);e.addValue(o,Su(s!==void 0?s:i,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const _x=new WeakMap,PI=Object.keys(Mf),uY=PI.length,Ex=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],cY=fS.length;class fY{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Tt.render(this.render,!1,!0);const{latestValues:s,renderState:l}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=n.initial?{...s}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.isControllingVariants=dm(n),this.isVariantNode=dT(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const f in c){const d=c[f];s[f]!==void 0&&Mr(d)&&(d.set(s[f],!1),n1(u)&&u.add(f))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,_x.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),AI.current||sY(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:N2.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){_x.delete(this.current),this.projection&&this.projection.unmount(),Fi(this.notifyUpdate),Fi(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=qs.has(t),o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Tt.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{o(),i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,o,i){let a,s;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:i,layoutScroll:d,layoutRoot:h})}return s}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):nn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Su(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,o=typeof r=="string"||typeof r=="object"?(n=bS(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&o!==void 0)return o;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Mr(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new TS),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class TI extends fY{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:o},i){let a=TX(r,t||{},this);if(o&&(n&&(n=o(n)),r&&(r=o(r)),a&&(a=o(a))),i){AX(this,r,a);const s=aY(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function dY(e){return window.getComputedStyle(e)}class hY extends TI{readValueFromInstance(t,n){if(qs.has(n)){const r=xS(n);return r&&r.default||0}else{const r=dY(t),o=(yT(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return yI(t,n)}build(t,n,r,o){pS(t,n,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,n){return wS(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Mr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,o){_T(t,n,r,o)}}class pY extends TI{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(qs.has(n)){const r=xS(n);return r&&r.default||0}return n=ET.has(n)?n:vS(n),t.getAttribute(n)}measureInstanceViewportBox(){return nn()}scrapeMotionValuesFromProps(t,n){return xT(t,n)}build(t,n,r,o){yS(t,n,r,this.isSVGTag,o.transformTemplate)}renderInstance(t,n,r,o){CT(t,n,r,o)}mount(t){this.isSVGTag=gS(t.tagName),super.mount(t)}}const mY=(e,t)=>hS(e)?new pY(t,{enableHardwareAcceleration:!1}):new hY(t,{enableHardwareAcceleration:!0}),yY={layout:{ProjectionNode:xI,MeasureLayout:vI}},gY={...UX,...lK,...Xq,...yY},Hi=gG((e,t)=>GG(e,t,gY,mY));function II(){const e=P.useRef(!1);return qp(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function vY(){const e=II(),[t,n]=P.useState(0),r=P.useCallback(()=>{e.current&&n(t+1)},[t]);return[P.useCallback(()=>Tt.postRender(r),[r]),t]}class wY extends P.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function bY({children:e,isPresent:t}){const n=P.useId(),r=P.useRef(null),o=P.useRef({width:0,height:0,top:0,left:0});return P.useInsertionEffect(()=>{const{width:i,height:a,top:s,left:l}=o.current;if(t||!r.current||!i||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${i}px !important; @@ -347,8 +347,8 @@ Error generating stack: `+i.message+` top: ${s}px !important; left: ${l}px !important; } - `),()=>{document.head.removeChild(u)}},[t]),P.createElement(nY,{isPresent:t,childRef:r,sizeRef:o},P.cloneElement(e,{ref:r}))}const Jy=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a})=>{const s=cT(oY),l=P.useId(),u=P.useMemo(()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:c=>{s.set(c,!0);for(const f of s.values())if(!f)return;r&&r()},register:c=>(s.set(c,!1),()=>s.delete(c))}),i?void 0:[n]);return P.useMemo(()=>{s.forEach((c,f)=>s.set(f,!1))},[n]),P.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=P.createElement(rY,{isPresent:n},e)),P.createElement(id.Provider,{value:u},e)};function oY(){return new Map}function iY(e){return P.useEffect(()=>()=>e(),[])}const pl=e=>e.key||"";function aY(e,t){e.forEach(n=>{const r=pl(n);t.set(r,n)})}function sY(e){const t=[];return P.Children.forEach(e,n=>{P.isValidElement(n)&&t.push(n)}),t}const Bu=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:a="sync"})=>{const s=P.useContext(eS).forceRender||tY()[0],l=pI(),u=sY(e);let c=u;const f=P.useRef(new Map).current,d=P.useRef(c),h=P.useRef(new Map).current,p=P.useRef(!0);if(Kp(()=>{p.current=!1,aY(u,h),d.current=c}),iY(()=>{p.current=!0,h.clear(),f.clear()}),p.current)return P.createElement(P.Fragment,null,c.map(g=>P.createElement(Jy,{key:pl(g),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:i,mode:a},g)));c=[...c];const m=d.current.map(pl),_=u.map(pl),b=m.length;for(let g=0;g{if(_.indexOf(E)!==-1)return;const T=h.get(E);if(!T)return;const O=m.indexOf(E);let A=g;if(!A){const C=()=>{h.delete(E),f.delete(E);const y=d.current.findIndex(S=>S.key===E);if(d.current.splice(y,1),!f.size){if(d.current=u,l.current===!1)return;s(),r&&r()}};A=P.createElement(Jy,{key:pl(T),isPresent:!1,onExitComplete:C,custom:t,presenceAffectsLayout:i,mode:a},T),f.set(E,A)}c.splice(O,0,A)}),c=c.map(g=>{const E=g.key;return f.has(E)?g:P.createElement(Jy,{key:pl(g),isPresent:!0,presenceAffectsLayout:i,mode:a},g)}),P.createElement(P.Fragment,null,f.size?c:c.map(g=>P.cloneElement(g)))};var lY={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},mI=P.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:o,requestClose:i=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=lY,toastSpacing:c="0.5rem"}=e,[f,d]=P.useState(s),h=XX();js(()=>{h||r==null||r()},[h]),js(()=>{d(s)},[s]);const p=()=>d(null),m=()=>d(s),_=()=>{h&&o()};P.useEffect(()=>{h&&i&&o()},[h,i,o]),WW(_,f);const b=P.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),g=P.useMemo(()=>VW(a),[a]);return w.jsx(Ui.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:p,onHoverEnd:m,custom:{position:a},style:g,children:w.jsx(ne.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:po(n,{id:t,onClose:_})})})});mI.displayName="ToastComponent";function uY(e,t){var n;const r=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=i==null?void 0:i[t])!=null?n:r}var mx={path:w.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[w.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),w.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),w.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Ge=de((e,t)=>{const{as:n,viewBox:r,color:o="currentColor",focusable:i=!1,children:a,className:s,__css:l,...u}=e,c=_e("chakra-icon",s),f=Eo("Icon",e),d={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...l,...f},h={ref:t,focusable:i,className:c,__css:d},p=r??mx.viewBox;if(n&&typeof n!="string")return w.jsx(ne.svg,{as:n,...h,...u});const m=a??mx.path;return w.jsx(ne.svg,{verticalAlign:"middle",viewBox:p,...h,...u,children:m})});Ge.displayName="Icon";function cY(e){return w.jsx(Ge,{viewBox:"0 0 24 24",...e,children:w.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function fY(e){return w.jsx(Ge,{viewBox:"0 0 24 24",...e,children:w.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function yx(e){return w.jsx(Ge,{viewBox:"0 0 24 24",...e,children:w.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var dY=hi({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),sm=de((e,t)=>{const n=Eo("Spinner",e),{label:r="Loading...",thickness:o="2px",speed:i="0.45s",emptyColor:a="transparent",className:s,...l}=Rt(e),u=_e("chakra-spinner",s),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:o,borderBottomColor:a,borderLeftColor:a,animation:`${dY} ${i} linear infinite`,...n};return w.jsx(ne.div,{ref:t,__css:c,className:u,...l,children:r&&w.jsx(ne.span,{srOnly:!0,children:r})})});sm.displayName="Spinner";var[hY,vS]=tn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[pY,wS]=tn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),yI={info:{icon:fY,colorScheme:"blue"},warning:{icon:yx,colorScheme:"orange"},success:{icon:cY,colorScheme:"green"},error:{icon:yx,colorScheme:"red"},loading:{icon:sm,colorScheme:"blue"}};function mY(e){return yI[e].colorScheme}function yY(e){return yI[e].icon}var gI=de(function(t,n){const r=wS(),{status:o}=vS(),i={display:"inline",...r.description};return w.jsx(ne.div,{ref:n,"data-status":o,...t,className:_e("chakra-alert__desc",t.className),__css:i})});gI.displayName="AlertDescription";function vI(e){const{status:t}=vS(),n=yY(t),r=wS(),o=t==="loading"?r.spinner:r.icon;return w.jsx(ne.span,{display:"inherit","data-status":t,...e,className:_e("chakra-alert__icon",e.className),__css:o,children:e.children||w.jsx(n,{h:"100%",w:"100%"})})}vI.displayName="AlertIcon";var wI=de(function(t,n){const r=wS(),{status:o}=vS();return w.jsx(ne.div,{ref:n,"data-status":o,...t,className:_e("chakra-alert__title",t.className),__css:r.title})});wI.displayName="AlertTitle";var bI=de(function(t,n){var r;const{status:o="info",addRole:i=!0,...a}=Rt(t),s=(r=t.colorScheme)!=null?r:mY(o),l=Pr("Alert",{...t,colorScheme:s}),u={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return w.jsx(hY,{value:{status:o},children:w.jsx(pY,{value:l,children:w.jsx(ne.div,{"data-status":o,role:i?"alert":void 0,ref:n,...a,className:_e("chakra-alert",t.className),__css:u})})})});bI.displayName="Alert";function gY(e){return w.jsx(Ge,{focusable:"false","aria-hidden":!0,...e,children:w.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var lm=de(function(t,n){const r=Eo("CloseButton",t),{children:o,isDisabled:i,__css:a,...s}=Rt(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return w.jsx(ne.button,{type:"button","aria-label":"Close",ref:n,disabled:i,__css:{...l,...r,...a},...s,children:o||w.jsx(gY,{width:"1em",height:"1em"})})});lm.displayName="CloseButton";var vY={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},ti=wY(vY);function wY(e){let t=e;const n=new Set,r=o=>{t=o(t),n.forEach(i=>i())};return{getState:()=>t,subscribe:o=>(n.add(o),()=>{r(()=>e),n.delete(o)}),removeToast:(o,i)=>{r(a=>({...a,[i]:a[i].filter(s=>s.id!=o)}))},notify:(o,i)=>{const a=bY(o,i),{position:s,id:l}=a;return r(u=>{var c,f;const h=s.includes("top")?[a,...(c=u[s])!=null?c:[]]:[...(f=u[s])!=null?f:[],a];return{...u,[s]:h}}),l},update:(o,i)=>{o&&r(a=>{const s={...a},{position:l,index:u}=f3(s,o);return l&&u!==-1&&(s[l][u]={...s[l][u],...i,message:SI(i)}),s})},closeAll:({positions:o}={})=>{r(i=>(o??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=i[u].map(c=>({...c,requestClose:!0})),l),{...i}))},close:o=>{r(i=>{const a=KP(i,o);return a?{...i,[a]:i[a].map(s=>s.id==o?{...s,requestClose:!0}:s)}:i})},isActive:o=>!!f3(ti.getState(),o).position}}var gx=0;function bY(e,t={}){var n,r;gx+=1;const o=(n=t.id)!=null?n:gx,i=(r=t.position)!=null?r:"bottom";return{id:o,message:e,position:i,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>ti.removeToast(String(o),i),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var SY=e=>{const{status:t,variant:n="solid",id:r,title:o,isClosable:i,onClose:a,description:s,colorScheme:l,icon:u}=e,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return w.jsxs(bI,{addRole:!1,status:t,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[w.jsx(vI,{children:u}),w.jsxs(ne.div,{flex:"1",maxWidth:"100%",children:[o&&w.jsx(wI,{id:c==null?void 0:c.title,children:o}),s&&w.jsx(gI,{id:c==null?void 0:c.description,display:"block",children:s})]}),i&&w.jsx(lm,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1})]})};function SI(e={}){const{render:t,toastComponent:n=SY}=e;return o=>typeof t=="function"?t({...o,...e}):w.jsx(n,{...o,...e})}function _Y(e,t){const n=o=>{var i;return{...t,...o,position:uY((i=o==null?void 0:o.position)!=null?i:t==null?void 0:t.position,e)}},r=o=>{const i=n(o),a=SI(i);return ti.notify(a,i)};return r.update=(o,i)=>{ti.update(o,n(i))},r.promise=(o,i)=>{const a=r({...i.loading,status:"loading",duration:null});o.then(s=>r.update(a,{status:"success",duration:5e3,...po(i.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...po(i.error,s)}))},r.closeAll=ti.closeAll,r.close=ti.close,r.isActive=ti.isActive,r}var[EY,CY]=tn({name:"ToastOptionsContext",strict:!1}),xY=e=>{const t=P.useSyncExternalStore(ti.subscribe,ti.getState,ti.getState),{motionVariants:n,component:r=mI,portalProps:o}=e,a=Object.keys(t).map(s=>{const l=t[s];return w.jsx("div",{role:"region","aria-live":"polite","aria-label":"Notifications",id:`chakra-toast-manager-${s}`,style:HW(s),children:w.jsx(Bu,{initial:!1,children:l.map(u=>w.jsx(r,{motionVariants:n,...u},u.id))})},s)});return w.jsx(Nu,{...o,children:a})};function Vi(e){const{theme:t}=yP(),n=CY();return P.useMemo(()=>_Y(t.direction,{...n,...e}),[e,t.direction,n])}var OY=e=>function({children:n,theme:r=e,toastOptions:o,...i}){return w.jsxs(zW,{theme:r,...i,children:[w.jsx(EY,{value:o==null?void 0:o.defaultOptions,children:n}),w.jsx(xY,{...o})]})},AY=OY(BP),PY=Object.defineProperty,TY=(e,t,n)=>t in e?PY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ut=(e,t,n)=>(TY(e,typeof t!="symbol"?t+"":t,n),n);function vx(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var IY=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function wx(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function bx(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var O2=typeof window<"u"?P.useLayoutEffect:P.useEffect,n1=e=>e,RY=class{constructor(){Ut(this,"descendants",new Map),Ut(this,"register",e=>{if(e!=null)return IY(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),Ut(this,"unregister",e=>{this.descendants.delete(e);const t=vx(Array.from(this.descendants.keys()));this.assignIndex(t)}),Ut(this,"destroy",()=>{this.descendants.clear()}),Ut(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),Ut(this,"count",()=>this.descendants.size),Ut(this,"enabledCount",()=>this.enabledValues().length),Ut(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),Ut(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),Ut(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),Ut(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),Ut(this,"first",()=>this.item(0)),Ut(this,"firstEnabled",()=>this.enabledItem(0)),Ut(this,"last",()=>this.item(this.descendants.size-1)),Ut(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),Ut(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),Ut(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),Ut(this,"next",(e,t=!0)=>{const n=wx(e,this.count(),t);return this.item(n)}),Ut(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=wx(r,this.enabledCount(),t);return this.enabledItem(o)}),Ut(this,"prev",(e,t=!0)=>{const n=bx(e,this.count()-1,t);return this.item(n)}),Ut(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=bx(r,this.enabledCount()-1,t);return this.enabledItem(o)}),Ut(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=vx(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)})}};function kY(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Jt(...e){return t=>{e.forEach(n=>{kY(n,t)})}}function MY(...e){return P.useMemo(()=>Jt(...e),e)}function DY(){const e=P.useRef(new RY);return O2(()=>()=>e.current.destroy()),e.current}var[LY,_I]=tn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function NY(e){const t=_I(),[n,r]=P.useState(-1),o=P.useRef(null);O2(()=>()=>{o.current&&t.unregister(o.current)},[]),O2(()=>{if(!o.current)return;const a=Number(o.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const i=n1(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:Jt(i,o)}}function BY(){return[n1(LY),()=>n1(_I()),()=>DY(),o=>NY(o)]}var Sx={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},xs={enter:{duration:.2,ease:Sx.easeOut},exit:{duration:.1,ease:Sx.easeIn}},Os={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},jY={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Os.enter(xs.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Os.exit(xs.exit,n),transitionEnd:t==null?void 0:t.exit}}},EI={initial:"exit",animate:"enter",exit:"exit",variants:jY},FY=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:i,transition:a,transitionEnd:s,delay:l,...u}=t,c=o||r?"enter":"exit",f=r?o&&r:!0,d={transition:a,transitionEnd:s,delay:l};return w.jsx(Bu,{custom:d,children:f&&w.jsx(Ui.div,{ref:n,className:_e("chakra-fade",i),custom:d,...EI,animate:c,...u})})});FY.displayName="Fade";var $Y={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(i=n==null?void 0:n.exit)!=null?i:Os.exit(xs.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Os.enter(xs.enter,n),transitionEnd:e==null?void 0:e.enter}}},CI={initial:"exit",animate:"enter",exit:"exit",variants:$Y},zY=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:c,...f}=t,d=r?o&&r:!0,h=o||r?"enter":"exit",p={initialScale:a,reverse:i,transition:l,transitionEnd:u,delay:c};return w.jsx(Bu,{custom:p,children:d&&w.jsx(Ui.div,{ref:n,className:_e("chakra-offset-slide",s),...CI,animate:h,custom:p,...f})})});zY.displayName="ScaleFade";var UY={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,x:e,y:t,transition:(i=n==null?void 0:n.exit)!=null?i:Os.exit(xs.exit,o),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Os.enter(xs.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:i})=>{var a;const s={x:t,y:e};return{opacity:0,transition:(a=n==null?void 0:n.exit)!=null?a:Os.exit(xs.exit,i),...o?{...s,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...s,...r==null?void 0:r.exit}}}}},A2={initial:"initial",animate:"enter",exit:"exit",variants:UY},VY=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:c,delay:f,...d}=t,h=r?o&&r:!0,p=o||r?"enter":"exit",m={offsetX:s,offsetY:l,reverse:i,transition:u,transitionEnd:c,delay:f};return w.jsx(Bu,{custom:m,children:h&&w.jsx(Ui.div,{ref:n,className:_e("chakra-offset-slide",a),custom:m,...A2,animate:p,...d})})});VY.displayName="SlideFade";var[HY,WY]=tn({name:"AvatarStylesContext",hookName:"useAvatarStyles",providerName:""});function GY(e){var t;const n=e.split(" "),r=(t=n[0])!=null?t:"",o=n.length>1?n[n.length-1]:"";return r&&o?`${r.charAt(0)}${o.charAt(0)}`:r.charAt(0)}function xI(e){const{name:t,getInitials:n,...r}=e,o=WY();return w.jsx(ne.div,{role:"img","aria-label":t,...r,__css:o.label,children:t?n==null?void 0:n(t):null})}xI.displayName="AvatarName";var OI=e=>w.jsxs(ne.svg,{viewBox:"0 0 128 128",color:"#fff",width:"100%",height:"100%",className:"chakra-avatar__svg",...e,children:[w.jsx("path",{fill:"currentColor",d:"M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"}),w.jsx("path",{fill:"currentColor",d:"M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"})]}),P2=de(function(t,n){const{htmlWidth:r,htmlHeight:o,alt:i,...a}=t;return w.jsx("img",{width:r,height:o,ref:n,alt:i,...a})});P2.displayName="NativeImage";function AI(e){const{loading:t,src:n,srcSet:r,onLoad:o,onError:i,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,c]=P.useState("pending");P.useEffect(()=>{c(n?"loading":"pending")},[n]);const f=P.useRef(),d=P.useCallback(()=>{if(!n)return;h();const p=new Image;p.src=n,a&&(p.crossOrigin=a),r&&(p.srcset=r),s&&(p.sizes=s),t&&(p.loading=t),p.onload=m=>{h(),c("loaded"),o==null||o(m)},p.onerror=m=>{h(),c("failed"),i==null||i(m)},f.current=p},[n,a,r,s,o,i,t]),h=()=>{f.current&&(f.current.onload=null,f.current.onerror=null,f.current=null)};return ai(()=>{if(!l)return u==="loading"&&d(),()=>{h()}},[u,d,l]),l?"loaded":u}var KY=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function XY(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var ju=de(function(t,n){const{fallbackSrc:r,fallback:o,src:i,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:c,crossOrigin:f,fallbackStrategy:d="beforeLoadOrError",referrerPolicy:h,...p}=t,m=r!==void 0||o!==void 0,_=u!=null||c||!m,b=AI({...t,crossOrigin:f,ignoreFallback:_}),g=KY(b,d),E={ref:n,objectFit:l,objectPosition:s,..._?p:XY(p,["onError","onLoad"])};return g?o||w.jsx(ne.img,{as:P2,className:"chakra-image__placeholder",src:r,...E}):w.jsx(ne.img,{as:P2,src:i,srcSet:a,crossOrigin:f,loading:u,referrerPolicy:h,className:"chakra-image",...E})});ju.displayName="Image";function PI(e){const{src:t,srcSet:n,onError:r,onLoad:o,getInitials:i,name:a,borderRadius:s,loading:l,iconLabel:u,icon:c=w.jsx(OI,{}),ignoreFallback:f,referrerPolicy:d,crossOrigin:h}=e,m=AI({src:t,onError:r,crossOrigin:h,ignoreFallback:f})==="loaded";return!t||!m?a?w.jsx(xI,{className:"chakra-avatar__initials",getInitials:i,name:a}):P.cloneElement(c,{role:"img","aria-label":u}):w.jsx(ne.img,{src:t,srcSet:n,alt:a,onLoad:o,referrerPolicy:d,crossOrigin:h??void 0,className:"chakra-avatar__img",loading:l,__css:{width:"100%",height:"100%",objectFit:"cover",borderRadius:s}})}PI.displayName="AvatarImage";var qY={display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",textTransform:"uppercase",fontWeight:"medium",position:"relative",flexShrink:0},r1=de((e,t)=>{const n=Pr("Avatar",e),[r,o]=P.useState(!1),{src:i,srcSet:a,name:s,showBorder:l,borderRadius:u="full",onError:c,onLoad:f,getInitials:d=GY,icon:h=w.jsx(OI,{}),iconLabel:p=" avatar",loading:m,children:_,borderColor:b,ignoreFallback:g,crossOrigin:E,referrerPolicy:T,...O}=Rt(e),A={borderRadius:u,borderWidth:l?"2px":void 0,...qY,...n.container};return b&&(A.borderColor=b),w.jsx(ne.span,{ref:t,...O,className:_e("chakra-avatar",e.className),"data-loaded":Re(r),__css:A,children:w.jsxs(HY,{value:n,children:[w.jsx(PI,{src:i,srcSet:a,loading:m,onLoad:ke(f,()=>{o(!0)}),onError:c,getInitials:d,name:s,borderRadius:u,icon:h,iconLabel:p,ignoreFallback:g,crossOrigin:E,referrerPolicy:T}),_]})})});r1.displayName="Avatar";function TI(e){return P.Children.toArray(e).filter(t=>P.isValidElement(t))}var[YY,ZY]=tn({strict:!1,name:"ButtonGroupContext"}),QY={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},JY={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},cd=de(function(t,n){const{size:r,colorScheme:o,variant:i,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,orientation:c="horizontal",...f}=t,d=_e("chakra-button__group",a),h=P.useMemo(()=>({size:r,colorScheme:o,variant:i,isDisabled:u}),[r,o,i,u]);let p={display:"inline-flex",...l?QY[c]:JY[c](s)};const m=c==="vertical";return w.jsx(YY,{value:h,children:w.jsx(ne.div,{ref:n,role:"group",__css:p,className:d,"data-attached":l?"":void 0,"data-orientation":c,flexDir:m?"column":void 0,...f})})});cd.displayName="ButtonGroup";function eZ(e){const[t,n]=P.useState(!e);return{ref:P.useCallback(i=>{i&&n(i.tagName==="BUTTON")},[]),type:t?"button":void 0}}function T2(e){const{children:t,className:n,...r}=e,o=P.isValidElement(t)?P.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,i=_e("chakra-button__icon",n);return w.jsx(ne.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:i,children:o})}T2.displayName="ButtonIcon";function I2(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=w.jsx(sm,{color:"currentColor",width:"1em",height:"1em"}),className:i,__css:a,...s}=e,l=_e("chakra-button__spinner",i),u=n==="start"?"marginEnd":"marginStart",c=P.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return w.jsx(ne.div,{className:l,...s,__css:c,children:o})}I2.displayName="ButtonSpinner";var be=de((e,t)=>{const n=ZY(),r=Eo("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:i,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:c,iconSpacing:f="0.5rem",type:d,spinner:h,spinnerPlacement:p="start",className:m,as:_,...b}=Rt(e),g=P.useMemo(()=>{const A={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:A}}},[r,n]),{ref:E,type:T}=eZ(_),O={rightIcon:u,leftIcon:l,iconSpacing:f,children:s};return w.jsxs(ne.button,{ref:MY(t,E),as:_,type:d??T,"data-active":Re(a),"data-loading":Re(i),__css:g,className:_e("chakra-button",m),...b,disabled:o||i,children:[i&&p==="start"&&w.jsx(I2,{className:"chakra-button__spinner--start",label:c,placement:"start",spacing:f,children:h}),i?c||w.jsx(ne.span,{opacity:0,children:w.jsx(_x,{...O})}):w.jsx(_x,{...O}),i&&p==="end"&&w.jsx(I2,{className:"chakra-button__spinner--end",label:c,placement:"end",spacing:f,children:h})]})});be.displayName="Button";function _x(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return w.jsxs(w.Fragment,{children:[t&&w.jsx(T2,{marginEnd:o,children:t}),r,n&&w.jsx(T2,{marginStart:o,children:n})]})}var um=de((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":i,...a}=e,s=n||r,l=P.isValidElement(s)?P.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return w.jsx(be,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":i,...a,children:l})});um.displayName="IconButton";var[tZ,bS]=jW("Card"),nZ=de(function(t,n){const{className:r,...o}=t,i=bS();return w.jsx(ne.div,{ref:n,className:_e("chakra-card__body",r),__css:i.body,...o})}),rZ=de(function(t,n){const{className:r,justify:o,...i}=t,a=bS();return w.jsx(ne.div,{ref:n,className:_e("chakra-card__footer",r),__css:{display:"flex",justifyContent:o,...a.footer},...i})}),oZ=de(function(t,n){const{className:r,...o}=t,i=bS();return w.jsx(ne.div,{ref:n,className:_e("chakra-card__header",r),__css:i.header,...o})}),iZ=de(function(t,n){const{className:r,children:o,direction:i="column",justify:a,align:s,...l}=Rt(t),u=Pr("Card",t);return w.jsx(ne.div,{ref:n,className:_e("chakra-card",r),__css:{display:"flex",flexDirection:i,justifyContent:a,alignItems:s,position:"relative",minWidth:0,wordWrap:"break-word",...u.container},...l,children:w.jsx(tZ,{value:u,children:o})})}),[Nye,aZ]=tn({name:"CheckboxGroupContext",strict:!1});function sZ(e){const[t,n]=P.useState(e),[r,o]=P.useState(!1);return e!==t&&(o(!0),n(e)),r}function lZ(e){return w.jsx(ne.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:w.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function uZ(e){return w.jsx(ne.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:w.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function cZ(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?uZ:lZ;return n||t?w.jsx(ne.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:w.jsx(o,{...r})}):null}var[fZ,II]=tn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[dZ,fd]=tn({strict:!1,name:"FormControlContext"});function hZ(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:i,...a}=e,s=P.useId(),l=t||`field-${s}`,u=`${l}-label`,c=`${l}-feedback`,f=`${l}-helptext`,[d,h]=P.useState(!1),[p,m]=P.useState(!1),[_,b]=P.useState(!1),g=P.useCallback((C={},y=null)=>({id:f,...C,ref:Jt(y,S=>{S&&m(!0)})}),[f]),E=P.useCallback((C={},y=null)=>({...C,ref:y,"data-focus":Re(_),"data-disabled":Re(o),"data-invalid":Re(r),"data-readonly":Re(i),id:C.id!==void 0?C.id:u,htmlFor:C.htmlFor!==void 0?C.htmlFor:l}),[l,o,_,r,i,u]),T=P.useCallback((C={},y=null)=>({id:c,...C,ref:Jt(y,S=>{S&&h(!0)}),"aria-live":"polite"}),[c]),O=P.useCallback((C={},y=null)=>({...C,...a,ref:y,role:"group"}),[a]),A=P.useCallback((C={},y=null)=>({...C,ref:y,role:"presentation","aria-hidden":!0,children:C.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!i,isDisabled:!!o,isFocused:!!_,onFocus:()=>b(!0),onBlur:()=>b(!1),hasFeedbackText:d,setHasFeedbackText:h,hasHelpText:p,setHasHelpText:m,id:l,labelId:u,feedbackId:c,helpTextId:f,htmlProps:a,getHelpTextProps:g,getErrorMessageProps:T,getRootProps:O,getLabelProps:E,getRequiredIndicatorProps:A}}var Jn=de(function(t,n){const r=Pr("Form",t),o=Rt(t),{getRootProps:i,htmlProps:a,...s}=hZ(o),l=_e("chakra-form-control",t.className);return w.jsx(dZ,{value:s,children:w.jsx(fZ,{value:r,children:w.jsx(ne.div,{...i({},n),className:l,__css:r.container})})})});Jn.displayName="FormControl";var rs=de(function(t,n){const r=fd(),o=II(),i=_e("chakra-form__helper-text",t.className);return w.jsx(ne.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:i})});rs.displayName="FormHelperText";var In=de(function(t,n){var r;const o=Eo("FormLabel",t),i=Rt(t),{className:a,children:s,requiredIndicator:l=w.jsx(RI,{}),optionalIndicator:u=null,...c}=i,f=fd(),d=(r=f==null?void 0:f.getLabelProps(c,n))!=null?r:{ref:n,...c};return w.jsxs(ne.label,{...d,className:_e("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...o},children:[s,f!=null&&f.isRequired?l:u]})});In.displayName="FormLabel";var RI=de(function(t,n){const r=fd(),o=II();if(!(r!=null&&r.isRequired))return null;const i=_e("chakra-form__required-indicator",t.className);return w.jsx(ne.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:i})});RI.displayName="RequiredIndicator";function kI(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...i}=MI(e);return{...i,disabled:t,readOnly:r,required:o,"aria-invalid":Zl(n),"aria-required":Zl(o),"aria-readonly":Zl(r)}}function MI(e){var t,n,r;const o=fd(),{id:i,disabled:a,readOnly:s,required:l,isRequired:u,isInvalid:c,isReadOnly:f,isDisabled:d,onFocus:h,onBlur:p,...m}=e,_=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&_.push(o.feedbackId),o!=null&&o.hasHelpText&&_.push(o.helpTextId),{...m,"aria-describedby":_.join(" ")||void 0,id:i??(o==null?void 0:o.id),isDisabled:(t=a??d)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=s??f)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=l??u)!=null?r:o==null?void 0:o.isRequired,isInvalid:c??(o==null?void 0:o.isInvalid),onFocus:ke(o==null?void 0:o.onFocus,h),onBlur:ke(o==null?void 0:o.onBlur,p)}}var pZ={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};const mZ=()=>typeof document<"u";let Ex=!1,dd=null,Fs=!1,R2=!1;const k2=new Set;function SS(e,t){k2.forEach(n=>n(e,t))}const yZ=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function gZ(e){return!(e.metaKey||!yZ&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Cx(e){Fs=!0,gZ(e)&&(dd="keyboard",SS("keyboard",e))}function al(e){if(dd="pointer",e.type==="mousedown"||e.type==="pointerdown"){Fs=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;SS("pointer",e)}}function vZ(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function wZ(e){vZ(e)&&(Fs=!0,dd="virtual")}function bZ(e){e.target===window||e.target===document||(!Fs&&!R2&&(dd="virtual",SS("virtual",e)),Fs=!1,R2=!1)}function SZ(){Fs=!1,R2=!0}function xx(){return dd!=="pointer"}function _Z(){if(!mZ()||Ex)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Fs=!0,e.apply(this,n)},document.addEventListener("keydown",Cx,!0),document.addEventListener("keyup",Cx,!0),document.addEventListener("click",wZ,!0),window.addEventListener("focus",bZ,!0),window.addEventListener("blur",SZ,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",al,!0),document.addEventListener("pointermove",al,!0),document.addEventListener("pointerup",al,!0)):(document.addEventListener("mousedown",al,!0),document.addEventListener("mousemove",al,!0),document.addEventListener("mouseup",al,!0)),Ex=!0}function DI(e){_Z(),e(xx());const t=()=>e(xx());return k2.add(t),()=>{k2.delete(t)}}function EZ(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function LI(e={}){const t=MI(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:i,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:c,isChecked:f,isFocusable:d,onChange:h,isIndeterminate:p,name:m,value:_,tabIndex:b=void 0,"aria-label":g,"aria-labelledby":E,"aria-invalid":T,...O}=e,A=EZ(O,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),C=Ea(h),y=Ea(s),S=Ea(l),[v,x]=P.useState(!1),[I,R]=P.useState(!1),[k,M]=P.useState(!1),[N,D]=P.useState(!1);P.useEffect(()=>DI(x),[]);const L=P.useRef(null),[j,F]=P.useState(!0),[B,U]=P.useState(!!c),K=f!==void 0,W=K?f:B,Q=P.useCallback(ie=>{if(r||n){ie.preventDefault();return}K||U(W?ie.target.checked:p?!0:ie.target.checked),C==null||C(ie)},[r,n,W,K,p,C]);ai(()=>{L.current&&(L.current.indeterminate=!!p)},[p]),js(()=>{n&&R(!1)},[n,R]),ai(()=>{const ie=L.current;if(!(ie!=null&&ie.form))return;const Ce=()=>{U(!!c)};return ie.form.addEventListener("reset",Ce),()=>{var Ne;return(Ne=ie.form)==null?void 0:Ne.removeEventListener("reset",Ce)}},[]);const X=n&&!d,J=P.useCallback(ie=>{ie.key===" "&&D(!0)},[D]),te=P.useCallback(ie=>{ie.key===" "&&D(!1)},[D]);ai(()=>{if(!L.current)return;L.current.checked!==W&&U(L.current.checked)},[L.current]);const le=P.useCallback((ie={},Ce=null)=>{const Ne=ze=>{I&&ze.preventDefault(),D(!0)};return{...ie,ref:Ce,"data-active":Re(N),"data-hover":Re(k),"data-checked":Re(W),"data-focus":Re(I),"data-focus-visible":Re(I&&v),"data-indeterminate":Re(p),"data-disabled":Re(n),"data-invalid":Re(i),"data-readonly":Re(r),"aria-hidden":!0,onMouseDown:ke(ie.onMouseDown,Ne),onMouseUp:ke(ie.onMouseUp,()=>D(!1)),onMouseEnter:ke(ie.onMouseEnter,()=>M(!0)),onMouseLeave:ke(ie.onMouseLeave,()=>M(!1))}},[N,W,n,I,v,k,p,i,r]),ge=P.useCallback((ie={},Ce=null)=>({...ie,ref:Ce,"data-active":Re(N),"data-hover":Re(k),"data-checked":Re(W),"data-focus":Re(I),"data-focus-visible":Re(I&&v),"data-indeterminate":Re(p),"data-disabled":Re(n),"data-invalid":Re(i),"data-readonly":Re(r)}),[N,W,n,I,v,k,p,i,r]),se=P.useCallback((ie={},Ce=null)=>({...A,...ie,ref:Jt(Ce,Ne=>{Ne&&F(Ne.tagName==="LABEL")}),onClick:ke(ie.onClick,()=>{var Ne;j||((Ne=L.current)==null||Ne.click(),requestAnimationFrame(()=>{var ze;(ze=L.current)==null||ze.focus({preventScroll:!0})}))}),"data-disabled":Re(n),"data-checked":Re(W),"data-invalid":Re(i)}),[A,n,W,i,j]),ue=P.useCallback((ie={},Ce=null)=>({...ie,ref:Jt(L,Ce),type:"checkbox",name:m,value:_,id:a,tabIndex:b,onChange:ke(ie.onChange,Q),onBlur:ke(ie.onBlur,y,()=>R(!1)),onFocus:ke(ie.onFocus,S,()=>R(!0)),onKeyDown:ke(ie.onKeyDown,J),onKeyUp:ke(ie.onKeyUp,te),required:o,checked:W,disabled:X,readOnly:r,"aria-label":g,"aria-labelledby":E,"aria-invalid":T?!!T:i,"aria-describedby":u,"aria-disabled":n,style:pZ}),[m,_,a,Q,y,S,J,te,o,W,X,r,g,E,T,i,u,n,b]),Ie=P.useCallback((ie={},Ce=null)=>({...ie,ref:Ce,onMouseDown:ke(ie.onMouseDown,CZ),"data-disabled":Re(n),"data-checked":Re(W),"data-invalid":Re(i)}),[W,n,i]);return{state:{isInvalid:i,isFocused:I,isChecked:W,isActive:N,isHovered:k,isIndeterminate:p,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:se,getCheckboxProps:le,getIndicatorProps:ge,getInputProps:ue,getLabelProps:Ie,htmlProps:A}}function CZ(e){e.preventDefault(),e.stopPropagation()}var xZ={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},OZ={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},AZ=hi({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),PZ=hi({from:{opacity:0},to:{opacity:1}}),TZ=hi({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),NI=de(function(t,n){const r=aZ(),o={...r,...t},i=Pr("Checkbox",o),a=Rt(t),{spacing:s="0.5rem",className:l,children:u,iconColor:c,iconSize:f,icon:d=w.jsx(cZ,{}),isChecked:h,isDisabled:p=r==null?void 0:r.isDisabled,onChange:m,inputProps:_,...b}=a;let g=h;r!=null&&r.value&&a.value&&(g=r.value.includes(a.value));let E=m;r!=null&&r.onChange&&a.value&&(E=q0(r.onChange,m));const{state:T,getInputProps:O,getCheckboxProps:A,getLabelProps:C,getRootProps:y}=LI({...b,isDisabled:p,isChecked:g,onChange:E}),S=sZ(T.isChecked),v=P.useMemo(()=>({animation:S?T.isIndeterminate?`${PZ} 20ms linear, ${TZ} 200ms linear`:`${AZ} 200ms linear`:void 0,fontSize:f,color:c,...i.icon}),[c,f,S,T.isIndeterminate,i.icon]),x=P.cloneElement(d,{__css:v,isIndeterminate:T.isIndeterminate,isChecked:T.isChecked});return w.jsxs(ne.label,{__css:{...OZ,...i.container},className:_e("chakra-checkbox",l),...y(),children:[w.jsx("input",{className:"chakra-checkbox__input",...O(_,n)}),w.jsx(ne.span,{__css:{...xZ,...i.control},className:"chakra-checkbox__control",...A(),children:x}),u&&w.jsx(ne.span,{className:"chakra-checkbox__label",...C(),__css:{marginStart:s,...i.label},children:u})]})});NI.displayName="Checkbox";function nu(e,t,n,r){const o=Ea(n);return P.useEffect(()=>{const i=typeof e=="function"?e():e??document;if(!(!n||!i))return i.addEventListener(t,o,r),()=>{i.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const i=typeof e=="function"?e():e??document;i==null||i.removeEventListener(t,o,r)}}function IZ(e){return"current"in e}var BI=()=>typeof window<"u";function RZ(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var kZ=e=>BI()&&e.test(navigator.vendor),MZ=e=>BI()&&e.test(RZ()),DZ=()=>MZ(/mac|iphone|ipad|ipod/i),LZ=()=>DZ()&&kZ(/apple/i);function NZ(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var i,a;return(a=(i=t.current)==null?void 0:i.ownerDocument)!=null?a:document};nu(o,"pointerdown",i=>{if(!LZ()||!r)return;const a=i.target,l=(n??[t]).some(u=>{const c=IZ(u)?u.current:u;return(c==null?void 0:c.contains(a))||c===a});o().activeElement!==a&&l&&(i.preventDefault(),a.focus())})}function BZ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var jI={exports:{}},jZ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",FZ=jZ,$Z=FZ;function FI(){}function $I(){}$I.resetWarningCache=FI;var zZ=function(){function e(r,o,i,a,s,l){if(l!==$Z){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:$I,resetWarningCache:FI};return n.PropTypes=n,n};jI.exports=zZ();var UZ=jI.exports,M2="data-focus-lock",zI="data-focus-lock-disabled",VZ="data-no-focus-lock",HZ="data-autofocus-inside",WZ="data-no-autofocus";function GZ(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function KZ(e,t){var n=P.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function UI(e,t){return KZ(t||null,function(n){return e.forEach(function(r){return GZ(r,n)})})}var eg={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},ni=function(){return ni=Object.assign||function(t){for(var n,r=1,o=arguments.length;r=0}).sort(fQ)},dQ=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],xS=dQ.join(","),hQ="".concat(xS,", [data-focus-guard]"),a5=function(e,t){return pi((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?hQ:xS)?[r]:[],a5(r))},[])},pQ=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?cm([e.contentDocument.body],t):[e]},cm=function(e,t){return e.reduce(function(n,r){var o,i=a5(r,t),a=(o=[]).concat.apply(o,i.map(function(s){return pQ(s,t)}));return n.concat(a,r.parentNode?pi(r.parentNode.querySelectorAll(xS)).filter(function(s){return s===r}):[])},[])},mQ=function(e){var t=e.querySelectorAll("[".concat(HZ,"]"));return pi(t).map(function(n){return cm([n])}).reduce(function(n,r){return n.concat(r)},[])},OS=function(e,t){return pi(e).filter(function(n){return e5(t,n)}).filter(function(n){return lQ(n)})},Ox=function(e,t){return t===void 0&&(t=new Map),pi(e).filter(function(n){return t5(t,n)})},L2=function(e,t,n){return i5(OS(cm(e,n),t),!0,n)},Ax=function(e,t){return i5(OS(cm(e),t),!1)},yQ=function(e,t){return OS(mQ(e),t)},ru=function(e,t){return e.shadowRoot?ru(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:pi(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?ru(o,t):!1}return ru(n,t)})},gQ=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},s5=function(e){return e.parentNode?s5(e.parentNode):e},AS=function(e){var t=o1(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(M2);return n.push.apply(n,o?gQ(pi(s5(r).querySelectorAll("[".concat(M2,'="').concat(o,'"]:not([').concat(zI,'="disabled"])')))):[r]),n},[])},vQ=function(e){try{return e()}catch{return}},Lf=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Lf(t.shadowRoot):t instanceof HTMLIFrameElement&&vQ(function(){return t.contentWindow.document})?Lf(t.contentWindow.document):t}},wQ=function(e,t){return e===t},bQ=function(e,t){return!!pi(e.querySelectorAll("iframe")).some(function(n){return wQ(n,t)})},l5=function(e,t){return t===void 0&&(t=Lf(ZI(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:AS(e).some(function(n){return ru(n,t)||bQ(n,t)})},SQ=function(e){e===void 0&&(e=document);var t=Lf(e);return t?pi(e.querySelectorAll("[".concat(VZ,"]"))).some(function(n){return ru(n,t)}):!1},_Q=function(e,t){return t.filter(o5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},PS=function(e,t){return o5(e)&&e.name?_Q(e,t):e},EQ=function(e){var t=new Set;return e.forEach(function(n){return t.add(PS(n,e))}),e.filter(function(n){return t.has(n)})},Px=function(e){return e[0]&&e.length>1?PS(e[0],e):e[0]},Tx=function(e,t){return e.length>1?e.indexOf(PS(e[t],e)):t},u5="NEW_FOCUS",CQ=function(e,t,n,r){var o=e.length,i=e[0],a=e[o-1],s=CS(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,c=r?e.indexOf(r):-1,f=l-u,d=t.indexOf(i),h=t.indexOf(a),p=EQ(t),m=n!==void 0?p.indexOf(n):-1,_=m-(r?p.indexOf(r):l),b=Tx(e,0),g=Tx(e,o-1);if(l===-1||c===-1)return u5;if(!f&&c>=0)return c;if(l<=d&&s&&Math.abs(f)>1)return g;if(l>=h&&s&&Math.abs(f)>1)return b;if(f&&Math.abs(_)>1)return c;if(l<=d)return g;if(l>h)return b;if(f)return Math.abs(f)>1?c:(o+c+f)%o}},xQ=function(e){return function(t){var n,r=(n=n5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},OQ=function(e,t,n){var r=e.map(function(i){var a=i.node;return a}),o=Ox(r.filter(xQ(n)));return o&&o.length?Px(o):Px(Ox(t))},N2=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&N2(e.parentNode.host||e.parentNode,t),t},tg=function(e,t){for(var n=N2(e),r=N2(t),o=0;o=0)return i}return!1},c5=function(e,t,n){var r=o1(e),o=o1(t),i=r[0],a=!1;return o.filter(Boolean).forEach(function(s){a=tg(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=tg(i,l);u&&(!a||ru(u,a)?a=u:a=tg(u,a))})}),a},AQ=function(e,t){return e.reduce(function(n,r){return n.concat(yQ(r,t))},[])},PQ=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(cQ)},TQ=function(e,t){var n=Lf(o1(e).length>0?document:ZI(e).ownerDocument),r=AS(e).filter(i1),o=c5(n||e,e,r),i=new Map,a=Ax(r,i),s=L2(r,i).filter(function(h){var p=h.node;return i1(p)});if(!(!s[0]&&(s=a,!s[0]))){var l=Ax([o],i).map(function(h){var p=h.node;return p}),u=PQ(l,s),c=u.map(function(h){var p=h.node;return p}),f=CQ(c,l,n,t);if(f===u5){var d=OQ(a,c,AQ(r,i));if(d)return{node:d};console.warn("focus-lock: cannot find any node to move focus into");return}return f===void 0?f:u[f]}},IQ=function(e){var t=AS(e).filter(i1),n=c5(e,e,t),r=new Map,o=L2([n],r,!0),i=L2(t,r).filter(function(a){var s=a.node;return i1(s)}).map(function(a){var s=a.node;return s});return o.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:i.indexOf(s)>=0,guard:CS(s)}})},RQ=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},ng=0,rg=!1,f5=function(e,t,n){n===void 0&&(n={});var r=TQ(e,t);if(!rg&&r){if(ng>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),rg=!0,setTimeout(function(){rg=!1},1);return}ng++,RQ(r.node,n.focusOptions),ng--}};function TS(e){setTimeout(e,1)}var kQ=function(){return document&&document.activeElement===document.body},MQ=function(){return kQ()||SQ()},ou=null,Fl=null,iu=null,Nf=!1,DQ=function(){return!0},LQ=function(t){return(ou.whiteList||DQ)(t)},NQ=function(t,n){iu={observerNode:t,portaledElement:n}},BQ=function(t){return iu&&iu.portaledElement===t};function Ix(e,t,n,r){var o=null,i=e;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else if(a.lockItem){if(i!==e)return;o=null}else break}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var jQ=function(t){return t&&"current"in t?t.current:t},FQ=function(t){return t?!!Nf:Nf==="meanwhile"},$Q=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},zQ=function(t,n){return n.some(function(r){return $Q(t,r,r)})},a1=function(){var t=!1;if(ou){var n=ou,r=n.observed,o=n.persistentFocus,i=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||iu&&iu.portaledElement,c=document&&document.activeElement;if(u){var f=[u].concat(a.map(jQ).filter(Boolean));if((!c||LQ(c))&&(o||FQ(s)||!MQ()||!Fl&&i)&&(u&&!(l5(f)||c&&zQ(c,f)||BQ(c))&&(document&&!Fl&&c&&!i?(c.blur&&c.blur(),document.body.focus()):(t=f5(f,Fl,{focusOptions:l}),iu={})),Nf=!1,Fl=document&&document.activeElement),document){var d=document&&document.activeElement,h=IQ(f),p=h.map(function(m){var _=m.node;return _}).indexOf(d);p>-1&&(h.filter(function(m){var _=m.guard,b=m.node;return _&&b.dataset.focusAutoGuard}).forEach(function(m){var _=m.node;return _.removeAttribute("tabIndex")}),Ix(p,h.length,1,h),Ix(p,-1,-1,h))}}}return t},d5=function(t){a1()&&t&&(t.stopPropagation(),t.preventDefault())},IS=function(){return TS(a1)},UQ=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||NQ(r,n)},VQ=function(){return null},h5=function(){Nf="just",TS(function(){Nf="meanwhile"})},HQ=function(){document.addEventListener("focusin",d5),document.addEventListener("focusout",IS),window.addEventListener("blur",h5)},WQ=function(){document.removeEventListener("focusin",d5),document.removeEventListener("focusout",IS),window.removeEventListener("blur",h5)};function GQ(e){return e.filter(function(t){var n=t.disabled;return!n})}function KQ(e){var t=e.slice(-1)[0];t&&!ou&&HQ();var n=ou,r=n&&t&&t.id===n.id;ou=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var i=o.id;return i===n.id}).length||n.returnFocus(!t)),t?(Fl=null,(!r||n.observed!==t.observed)&&t.onActivation(),a1(),TS(a1)):(WQ(),Fl=null)}XI.assignSyncMedium(UQ);qI.assignMedium(IS);YZ.assignMedium(function(e){return e({moveFocusInside:f5,focusInside:l5})});const XQ=rQ(GQ,KQ)(VQ);var p5=P.forwardRef(function(t,n){return P.createElement(YI,ks({sideCar:XQ,ref:n},t))}),m5=YI.propTypes||{};m5.sideCar;BZ(m5,["sideCar"]);p5.propTypes={};const Rx=p5;function y5(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function RS(e){var t;if(!y5(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function qQ(e){var t,n;return(n=(t=g5(e))==null?void 0:t.defaultView)!=null?n:window}function g5(e){return y5(e)?e.ownerDocument:document}function YQ(e){return g5(e).activeElement}function ZQ(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function QQ(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function v5(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:RS(e)&&ZQ(e)?e:v5(QQ(e))}var w5=e=>e.hasAttribute("tabindex"),JQ=e=>w5(e)&&e.tabIndex===-1;function eJ(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function b5(e){return e.parentElement&&b5(e.parentElement)?!0:e.hidden}function tJ(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function S5(e){if(!RS(e)||b5(e)||eJ(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():tJ(e)?!0:w5(e)}function nJ(e){return e?RS(e)&&S5(e)&&!JQ(e):!1}var rJ=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],oJ=rJ.join(),iJ=e=>e.offsetWidth>0&&e.offsetHeight>0;function _5(e){const t=Array.from(e.querySelectorAll(oJ));return t.unshift(e),t.filter(n=>S5(n)&&iJ(n))}var kx,aJ=(kx=Rx.default)!=null?kx:Rx,E5=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:i,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,c=P.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&_5(r.current).length===0&&requestAnimationFrame(()=>{var p;(p=r.current)==null||p.focus()})},[t,r]),f=P.useCallback(()=>{var h;(h=n==null?void 0:n.current)==null||h.focus()},[n]),d=o&&!n;return w.jsx(aJ,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:c,onDeactivation:f,returnFocus:d,children:i})};E5.displayName="FocusLock";var sJ=fW?P.useLayoutEffect:P.useEffect;function Mx(e,t=[]){const n=P.useRef(e);return sJ(()=>{n.current=e}),P.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function lJ(e,t){const n=P.useId();return P.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function uJ(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Wn(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=Mx(n),a=Mx(t),[s,l]=P.useState(e.defaultIsOpen||!1),[u,c]=uJ(r,s),f=lJ(o,"disclosure"),d=P.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),h=P.useCallback(()=>{u||l(!0),i==null||i()},[u,i]),p=P.useCallback(()=>{(c?d:h)()},[c,h,d]);return{isOpen:!!c,onOpen:h,onClose:d,onToggle:p,isControlled:u,getButtonProps:(m={})=>({...m,"aria-expanded":c,"aria-controls":f,onClick:yW(m.onClick,p)}),getDisclosureProps:(m={})=>({...m,hidden:!c,id:f})}}var[cJ,fJ]=tn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),C5=de(function(t,n){const r=Pr("Input",t),{children:o,className:i,...a}=Rt(t),s=_e("chakra-input__group",i),l={},u=TI(o),c=r.field;u.forEach(d=>{var h,p;r&&(c&&d.type.id==="InputLeftElement"&&(l.paddingStart=(h=c.height)!=null?h:c.h),c&&d.type.id==="InputRightElement"&&(l.paddingEnd=(p=c.height)!=null?p:c.h),d.type.id==="InputRightAddon"&&(l.borderEndRadius=0),d.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const f=u.map(d=>{var h,p;const m=HP({size:((h=d.props)==null?void 0:h.size)||t.size,variant:((p=d.props)==null?void 0:p.variant)||t.variant});return d.type.id!=="Input"?P.cloneElement(d,m):P.cloneElement(d,Object.assign(m,l,d.props))});return w.jsx(ne.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...a,children:w.jsx(cJ,{value:r,children:f})})});C5.displayName="InputGroup";var dJ={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},hJ=ne("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),kS=de(function(t,n){var r;const{placement:o="left",...i}=t,a=(r=dJ[o])!=null?r:{},s=fJ();return w.jsx(hJ,{ref:n,...i,__css:{...s.addon,...a}})});kS.displayName="InputAddon";var MS=de(function(t,n){return w.jsx(kS,{ref:n,placement:"left",...t,className:_e("chakra-input__left-addon",t.className)})});MS.displayName="InputLeftAddon";MS.id="InputLeftAddon";var x5=de(function(t,n){return w.jsx(kS,{ref:n,placement:"right",...t,className:_e("chakra-input__right-addon",t.className)})});x5.displayName="InputRightAddon";x5.id="InputRightAddon";var Ht=de(function(t,n){const{htmlSize:r,...o}=t,i=Pr("Input",o),a=Rt(o),s=kI(a),l=_e("chakra-input",t.className);return w.jsx(ne.input,{size:r,...s,__css:i.field,ref:n,className:l})});Ht.displayName="Input";Ht.id="Input";var vn=de(function(t,n){const r=Eo("Link",t),{className:o,isExternal:i,...a}=Rt(t);return w.jsx(ne.a,{target:i?"_blank":void 0,rel:i?"noopener":void 0,ref:n,className:_e("chakra-link",o),...a,__css:r})});vn.displayName="Link";var Fu=de(function(t,n){const{templateAreas:r,gap:o,rowGap:i,columnGap:a,column:s,row:l,autoFlow:u,autoRows:c,templateRows:f,autoColumns:d,templateColumns:h,...p}=t,m={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:i,gridColumnGap:a,gridAutoColumns:d,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:c,gridTemplateRows:f,gridTemplateColumns:h};return w.jsx(ne.div,{ref:n,__css:m,...p})});Fu.displayName="Grid";function O5(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):_r(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var qs=ne("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});qs.displayName="Spacer";var me=de(function(t,n){const r=Eo("Text",t),{className:o,align:i,decoration:a,casing:s,...l}=Rt(t),u=HP({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return w.jsx(ne.p,{ref:n,className:_e("chakra-text",t.className),...u,...l,__css:r})});me.displayName="Text";var A5=e=>w.jsx(ne.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});A5.displayName="StackItem";function pJ(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":O5(n,o=>r[o])}}var fm=de((e,t)=>{const{isInline:n,direction:r,align:o,justify:i,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:c,shouldWrapChildren:f,...d}=e,h=n?"row":r??"column",p=P.useMemo(()=>pJ({spacing:a,direction:h}),[a,h]),m=!!u,_=!f&&!m,b=P.useMemo(()=>{const E=TI(l);return _?E:E.map((T,O)=>{const A=typeof T.key<"u"?T.key:O,C=O+1===E.length,S=f?w.jsx(A5,{children:T},A):T;if(!m)return S;const v=P.cloneElement(u,{__css:p}),x=C?null:v;return w.jsxs(P.Fragment,{children:[S,x]},A)})},[u,p,m,_,f,l]),g=_e("chakra-stack",c);return w.jsx(ne.div,{ref:t,display:"flex",alignItems:o,justifyContent:i,flexDirection:h,flexWrap:s,gap:m?void 0:a,className:g,...d,children:b})});fm.displayName="Stack";var As=de((e,t)=>w.jsx(fm,{align:"center",...e,direction:"column",ref:t}));As.displayName="VStack";var pt=de((e,t)=>w.jsx(fm,{align:"center",...e,direction:"row",ref:t}));pt.displayName="HStack";var jo=de(function(t,n){const r=Eo("Heading",t),{className:o,...i}=Rt(t);return w.jsx(ne.h2,{ref:n,className:_e("chakra-heading",t.className),...i,__css:r})});jo.displayName="Heading";var ve=ne("div");ve.displayName="Box";var P5=de(function(t,n){const{size:r,centerContent:o=!0,...i}=t,a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return w.jsx(ve,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...i})});P5.displayName="Square";var mJ=de(function(t,n){const{size:r,...o}=t;return w.jsx(P5,{size:r,ref:n,borderRadius:"9999px",...o})});mJ.displayName="Circle";var T5=de(function(e,t){const{ratio:n=4/3,children:r,className:o,...i}=e,a=P.Children.only(r),s=_e("chakra-aspect-ratio",o);return w.jsx(ne.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:O5(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...i,children:a})});T5.displayName="AspectRatio";var I5=de(function(t,n){const{className:r,centerContent:o,...i}=Rt(t),a=Eo("Container",t);return w.jsx(ne.div,{ref:n,className:_e("chakra-container",r),...i,__css:{...a,...o&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});I5.displayName="Container";var B2=de(function(t,n){const{direction:r,align:o,justify:i,wrap:a,basis:s,grow:l,shrink:u,...c}=t,f={display:"flex",flexDirection:r,alignItems:o,justifyContent:i,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return w.jsx(ne.div,{ref:n,__css:f,...c})});B2.displayName="Flex";function yJ(e,t={}){const{ssr:n=!0,fallback:r}=t,{getWindow:o}=$W(),i=Array.isArray(e)?e:[e];let a=Array.isArray(r)?r:[r];a=a.filter(u=>u!=null);const[s,l]=P.useState(()=>i.map((u,c)=>({media:u,matches:n?!!a[c]:o().matchMedia(u).matches})));return P.useEffect(()=>{const u=o();l(i.map(d=>({media:d,matches:u.matchMedia(d).matches})));const c=i.map(d=>u.matchMedia(d)),f=d=>{l(h=>h.slice().map(p=>p.media===d.media?{...p,matches:d.matches}:p))};return c.forEach(d=>{typeof d.addListener=="function"?d.addListener(f):d.addEventListener("change",f)}),()=>{c.forEach(d=>{typeof d.removeListener=="function"?d.removeListener(f):d.removeEventListener("change",f)})}},[o]),s.map(u=>u.matches)}function gJ(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function vJ(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=P.useState([]),i=P.useRef(),a=()=>{i.current&&(clearTimeout(i.current),i.current=null)},s=()=>{a(),i.current=setTimeout(()=>{o([]),i.current=null},t)};P.useEffect(()=>a,[]);function l(u){return c=>{if(c.key==="Backspace"){const f=[...r];f.pop(),o(f);return}if(gJ(c)){const f=r.concat(c.key);n(c)&&(c.preventDefault(),c.stopPropagation()),o(f),u(f.join("")),s()}}}return l}function wJ(e,t,n,r){if(t==null)return r;if(!r)return e.find(a=>n(a).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(i=>n(i).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let i;return o.includes(r)?(i=o.indexOf(r)+1,i===o.length&&(i=0),o[i]):(i=e.indexOf(o[0]),e[i])}return r}function bJ(){const e=P.useRef(new Map),t=e.current,n=P.useCallback((o,i,a,s)=>{e.current.set(a,{type:i,el:o,options:s}),o.addEventListener(i,a,s)},[]),r=P.useCallback((o,i,a,s)=>{o.removeEventListener(i,a,s),e.current.delete(a)},[]);return P.useEffect(()=>()=>{t.forEach((o,i)=>{r(o.el,o.type,i,o.options)})},[r,t]),{add:n,remove:r}}function og(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function SJ(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:i=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:c,tabIndex:f,onMouseOver:d,onMouseLeave:h,...p}=e,[m,_]=P.useState(!0),[b,g]=P.useState(!1),E=bJ(),T=D=>{D&&D.tagName!=="BUTTON"&&_(!1)},O=m?f:f||0,A=n&&!r,C=P.useCallback(D=>{if(n){D.stopPropagation(),D.preventDefault();return}D.currentTarget.focus(),l==null||l(D)},[n,l]),y=P.useCallback(D=>{b&&og(D)&&(D.preventDefault(),D.stopPropagation(),g(!1),E.remove(document,"keyup",y,!1))},[b,E]),S=P.useCallback(D=>{if(u==null||u(D),n||D.defaultPrevented||D.metaKey||!og(D.nativeEvent)||m)return;const L=o&&D.key==="Enter";i&&D.key===" "&&(D.preventDefault(),g(!0)),L&&(D.preventDefault(),D.currentTarget.click()),E.add(document,"keyup",y,!1)},[n,m,u,o,i,E,y]),v=P.useCallback(D=>{if(c==null||c(D),n||D.defaultPrevented||D.metaKey||!og(D.nativeEvent)||m)return;i&&D.key===" "&&(D.preventDefault(),g(!1),D.currentTarget.click())},[i,m,n,c]),x=P.useCallback(D=>{D.button===0&&(g(!1),E.remove(document,"mouseup",x,!1))},[E]),I=P.useCallback(D=>{if(D.button!==0)return;if(n){D.stopPropagation(),D.preventDefault();return}m||g(!0),D.currentTarget.focus({preventScroll:!0}),E.add(document,"mouseup",x,!1),a==null||a(D)},[n,m,a,E,x]),R=P.useCallback(D=>{D.button===0&&(m||g(!1),s==null||s(D))},[s,m]),k=P.useCallback(D=>{if(n){D.preventDefault();return}d==null||d(D)},[n,d]),M=P.useCallback(D=>{b&&(D.preventDefault(),g(!1)),h==null||h(D)},[b,h]),N=Jt(t,T);return m?{...p,ref:N,type:"button","aria-disabled":A?void 0:n,disabled:A,onClick:C,onMouseDown:a,onMouseUp:s,onKeyUp:c,onKeyDown:u,onMouseOver:d,onMouseLeave:h}:{...p,ref:N,role:"button","data-active":Re(b),"aria-disabled":n?"true":void 0,tabIndex:A?void 0:O,onClick:C,onMouseDown:I,onMouseUp:R,onKeyUp:v,onKeyDown:S,onMouseOver:k,onMouseLeave:M}}function _J(e){const t=e.current;if(!t)return!1;const n=YQ(t);return!n||t.contains(n)?!1:!!nJ(n)}function R5(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,i=n&&!r;js(()=>{if(!i||_J(e))return;const a=(o==null?void 0:o.current)||e.current;let s;if(a)return s=requestAnimationFrame(()=>{a.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(s)}},[i,e,o])}var EJ={preventScroll:!0,shouldFocus:!1};function CJ(e,t=EJ){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:i}=t,a=xJ(e)?e.current:e,s=o&&i,l=P.useRef(s),u=P.useRef(i);ai(()=>{!u.current&&i&&(l.current=s),u.current=i},[i,s]);const c=P.useCallback(()=>{if(!(!i||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var f;(f=n.current)==null||f.focus({preventScroll:r})});else{const f=_5(a);f.length>0&&requestAnimationFrame(()=>{f[0].focus({preventScroll:r})})}},[i,r,a,n]);js(()=>{c()},[c]),nu(a,"transitionend",c)}function xJ(e){return"current"in e}var sl=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),on={arrowShadowColor:sl("--popper-arrow-shadow-color"),arrowSize:sl("--popper-arrow-size","8px"),arrowSizeHalf:sl("--popper-arrow-size-half"),arrowBg:sl("--popper-arrow-bg"),transformOrigin:sl("--popper-transform-origin"),arrowOffset:sl("--popper-arrow-offset")};function OJ(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var AJ={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},PJ=e=>AJ[e],Dx={scroll:!0,resize:!0};function TJ(e){let t;return typeof e=="object"?t={enabled:!0,options:{...Dx,...e}}:t={enabled:e,options:Dx},t}var IJ={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},RJ={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{Lx(e)},effect:({state:e})=>()=>{Lx(e)}},Lx=e=>{e.elements.popper.style.setProperty(on.transformOrigin.var,PJ(e.placement))},kJ={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{MJ(e)}},MJ=e=>{var t;if(!e.placement)return;const n=DJ(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:on.arrowSize.varRef,height:on.arrowSize.varRef,zIndex:-1});const r={[on.arrowSizeHalf.var]:`calc(${on.arrowSize.varRef} / 2 - 1px)`,[on.arrowOffset.var]:`calc(${on.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},DJ=e=>{if(e.startsWith("top"))return{property:"bottom",value:on.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:on.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:on.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:on.arrowOffset.varRef}},LJ={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{Nx(e)},effect:({state:e})=>()=>{Nx(e)}},Nx=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=OJ(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:on.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},NJ={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},BJ={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function jJ(e,t="ltr"){var n,r;const o=((n=NJ[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=BJ[e])!=null?r:o}var Er="top",So="bottom",_o="right",Cr="left",DS="auto",hd=[Er,So,_o,Cr],Su="start",Bf="end",FJ="clippingParents",k5="viewport",uc="popper",$J="reference",Bx=hd.reduce(function(e,t){return e.concat([t+"-"+Su,t+"-"+Bf])},[]),M5=[].concat(hd,[DS]).reduce(function(e,t){return e.concat([t,t+"-"+Su,t+"-"+Bf])},[]),zJ="beforeRead",UJ="read",VJ="afterRead",HJ="beforeMain",WJ="main",GJ="afterMain",KJ="beforeWrite",XJ="write",qJ="afterWrite",YJ=[zJ,UJ,VJ,HJ,WJ,GJ,KJ,XJ,qJ];function di(e){return e?(e.nodeName||"").toLowerCase():null}function Zr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function $s(e){var t=Zr(e).Element;return e instanceof t||e instanceof Element}function vo(e){var t=Zr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function LS(e){if(typeof ShadowRoot>"u")return!1;var t=Zr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ZJ(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!vo(i)||!di(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function QJ(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!vo(o)||!di(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const JJ={name:"applyStyles",enabled:!0,phase:"write",fn:ZJ,effect:QJ,requires:["computeStyles"]};function fi(e){return e.split("-")[0]}var Ps=Math.max,s1=Math.min,_u=Math.round;function j2(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function D5(){return!/^((?!chrome|android).)*safari/i.test(j2())}function Eu(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&vo(e)&&(o=e.offsetWidth>0&&_u(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&_u(r.height)/e.offsetHeight||1);var a=$s(e)?Zr(e):window,s=a.visualViewport,l=!D5()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/o,c=(r.top+(l&&s?s.offsetTop:0))/i,f=r.width/o,d=r.height/i;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function NS(e){var t=Eu(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function L5(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&LS(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ji(e){return Zr(e).getComputedStyle(e)}function eee(e){return["table","td","th"].indexOf(di(e))>=0}function ja(e){return(($s(e)?e.ownerDocument:e.document)||window.document).documentElement}function dm(e){return di(e)==="html"?e:e.assignedSlot||e.parentNode||(LS(e)?e.host:null)||ja(e)}function jx(e){return!vo(e)||ji(e).position==="fixed"?null:e.offsetParent}function tee(e){var t=/firefox/i.test(j2()),n=/Trident/i.test(j2());if(n&&vo(e)){var r=ji(e);if(r.position==="fixed")return null}var o=dm(e);for(LS(o)&&(o=o.host);vo(o)&&["html","body"].indexOf(di(o))<0;){var i=ji(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function pd(e){for(var t=Zr(e),n=jx(e);n&&eee(n)&&ji(n).position==="static";)n=jx(n);return n&&(di(n)==="html"||di(n)==="body"&&ji(n).position==="static")?t:n||tee(e)||t}function BS(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Yc(e,t,n){return Ps(e,s1(t,n))}function nee(e,t,n){var r=Yc(e,t,n);return r>n?n:r}function N5(){return{top:0,right:0,bottom:0,left:0}}function B5(e){return Object.assign({},N5(),e)}function j5(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var ree=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,B5(typeof t!="number"?t:j5(t,hd))};function oee(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=fi(n.placement),l=BS(s),u=[Cr,_o].indexOf(s)>=0,c=u?"height":"width";if(!(!i||!a)){var f=ree(o.padding,n),d=NS(i),h=l==="y"?Er:Cr,p=l==="y"?So:_o,m=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],_=a[l]-n.rects.reference[l],b=pd(i),g=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,E=m/2-_/2,T=f[h],O=g-d[c]-f[p],A=g/2-d[c]/2+E,C=Yc(T,A,O),y=l;n.modifiersData[r]=(t={},t[y]=C,t.centerOffset=C-A,t)}}function iee(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||L5(t.elements.popper,o)&&(t.elements.arrow=o))}const aee={name:"arrow",enabled:!0,phase:"main",fn:oee,effect:iee,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Cu(e){return e.split("-")[1]}var see={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lee(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:_u(n*o)/o||0,y:_u(r*o)/o||0}}function Fx(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,d=a.x,h=d===void 0?0:d,p=a.y,m=p===void 0?0:p,_=typeof c=="function"?c({x:h,y:m}):{x:h,y:m};h=_.x,m=_.y;var b=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),E=Cr,T=Er,O=window;if(u){var A=pd(n),C="clientHeight",y="clientWidth";if(A===Zr(n)&&(A=ja(n),ji(A).position!=="static"&&s==="absolute"&&(C="scrollHeight",y="scrollWidth")),A=A,o===Er||(o===Cr||o===_o)&&i===Bf){T=So;var S=f&&A===O&&O.visualViewport?O.visualViewport.height:A[C];m-=S-r.height,m*=l?1:-1}if(o===Cr||(o===Er||o===So)&&i===Bf){E=_o;var v=f&&A===O&&O.visualViewport?O.visualViewport.width:A[y];h-=v-r.width,h*=l?1:-1}}var x=Object.assign({position:s},u&&see),I=c===!0?lee({x:h,y:m},Zr(n)):{x:h,y:m};if(h=I.x,m=I.y,l){var R;return Object.assign({},x,(R={},R[T]=g?"0":"",R[E]=b?"0":"",R.transform=(O.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",R))}return Object.assign({},x,(t={},t[T]=g?m+"px":"",t[E]=b?h+"px":"",t.transform="",t))}function uee(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:fi(t.placement),variation:Cu(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Fx(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Fx(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const cee={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:uee,data:{}};var ph={passive:!0};function fee(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,s=a===void 0?!0:a,l=Zr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",n.update,ph)}),s&&l.addEventListener("resize",n.update,ph),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",n.update,ph)}),s&&l.removeEventListener("resize",n.update,ph)}}const dee={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fee,data:{}};var hee={left:"right",right:"left",bottom:"top",top:"bottom"};function op(e){return e.replace(/left|right|bottom|top/g,function(t){return hee[t]})}var pee={start:"end",end:"start"};function $x(e){return e.replace(/start|end/g,function(t){return pee[t]})}function jS(e){var t=Zr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function FS(e){return Eu(ja(e)).left+jS(e).scrollLeft}function mee(e,t){var n=Zr(e),r=ja(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var u=D5();(u||!u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+FS(e),y:l}}function yee(e){var t,n=ja(e),r=jS(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Ps(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ps(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+FS(e),l=-r.scrollTop;return ji(o||n).direction==="rtl"&&(s+=Ps(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}function $S(e){var t=ji(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function F5(e){return["html","body","#document"].indexOf(di(e))>=0?e.ownerDocument.body:vo(e)&&$S(e)?e:F5(dm(e))}function Zc(e,t){var n;t===void 0&&(t=[]);var r=F5(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=Zr(r),a=o?[i].concat(i.visualViewport||[],$S(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Zc(dm(a)))}function F2(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function gee(e,t){var n=Eu(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function zx(e,t,n){return t===k5?F2(mee(e,n)):$s(t)?gee(t,n):F2(yee(ja(e)))}function vee(e){var t=Zc(dm(e)),n=["absolute","fixed"].indexOf(ji(e).position)>=0,r=n&&vo(e)?pd(e):e;return $s(r)?t.filter(function(o){return $s(o)&&L5(o,r)&&di(o)!=="body"}):[]}function wee(e,t,n,r){var o=t==="clippingParents"?vee(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(l,u){var c=zx(e,u,r);return l.top=Ps(c.top,l.top),l.right=s1(c.right,l.right),l.bottom=s1(c.bottom,l.bottom),l.left=Ps(c.left,l.left),l},zx(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function $5(e){var t=e.reference,n=e.element,r=e.placement,o=r?fi(r):null,i=r?Cu(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(o){case Er:l={x:a,y:t.y-n.height};break;case So:l={x:a,y:t.y+t.height};break;case _o:l={x:t.x+t.width,y:s};break;case Cr:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=o?BS(o):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case Su:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Bf:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function jf(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,l=s===void 0?FJ:s,u=n.rootBoundary,c=u===void 0?k5:u,f=n.elementContext,d=f===void 0?uc:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,_=m===void 0?0:m,b=B5(typeof _!="number"?_:j5(_,hd)),g=d===uc?$J:uc,E=e.rects.popper,T=e.elements[p?g:d],O=wee($s(T)?T:T.contextElement||ja(e.elements.popper),l,c,a),A=Eu(e.elements.reference),C=$5({reference:A,element:E,strategy:"absolute",placement:o}),y=F2(Object.assign({},E,C)),S=d===uc?y:A,v={top:O.top-S.top+b.top,bottom:S.bottom-O.bottom+b.bottom,left:O.left-S.left+b.left,right:S.right-O.right+b.right},x=e.modifiersData.offset;if(d===uc&&x){var I=x[o];Object.keys(v).forEach(function(R){var k=[_o,So].indexOf(R)>=0?1:-1,M=[Er,So].indexOf(R)>=0?"y":"x";v[R]+=I[M]*k})}return v}function bee(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?M5:l,c=Cu(r),f=c?s?Bx:Bx.filter(function(p){return Cu(p)===c}):hd,d=f.filter(function(p){return u.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=jf(e,{placement:m,boundary:o,rootBoundary:i,padding:a})[fi(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function See(e){if(fi(e)===DS)return[];var t=op(e);return[$x(e),t,$x(t)]}function _ee(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,_=t.options.placement,b=fi(_),g=b===_,E=l||(g||!p?[op(_)]:See(_)),T=[_].concat(E).reduce(function(W,Q){return W.concat(fi(Q)===DS?bee(t,{placement:Q,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:m}):Q)},[]),O=t.rects.reference,A=t.rects.popper,C=new Map,y=!0,S=T[0],v=0;v=0,M=k?"width":"height",N=jf(t,{placement:x,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),D=k?R?_o:Cr:R?So:Er;O[M]>A[M]&&(D=op(D));var L=op(D),j=[];if(i&&j.push(N[I]<=0),s&&j.push(N[D]<=0,N[L]<=0),j.every(function(W){return W})){S=x,y=!1;break}C.set(x,j)}if(y)for(var F=p?3:1,B=function(Q){var X=T.find(function(J){var te=C.get(J);if(te)return te.slice(0,Q).every(function(le){return le})});if(X)return S=X,"break"},U=F;U>0;U--){var K=B(U);if(K==="break")break}t.placement!==S&&(t.modifiersData[r]._skip=!0,t.placement=S,t.reset=!0)}}const Eee={name:"flip",enabled:!0,phase:"main",fn:_ee,requiresIfExists:["offset"],data:{_skip:!1}};function Ux(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Vx(e){return[Er,_o,So,Cr].some(function(t){return e[t]>=0})}function Cee(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=jf(t,{elementContext:"reference"}),s=jf(t,{altBoundary:!0}),l=Ux(a,r),u=Ux(s,o,i),c=Vx(l),f=Vx(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const xee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Cee};function Oee(e,t,n){var r=fi(e),o=[Cr,Er].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[Cr,_o].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function Aee(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,a=M5.reduce(function(c,f){return c[f]=Oee(f,t.rects,i),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const Pee={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Aee};function Tee(e){var t=e.state,n=e.name;t.modifiersData[n]=$5({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Iee={name:"popperOffsets",enabled:!0,phase:"read",fn:Tee,data:{}};function Ree(e){return e==="x"?"y":"x"}function kee(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,m=p===void 0?0:p,_=jf(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),b=fi(t.placement),g=Cu(t.placement),E=!g,T=BS(b),O=Ree(T),A=t.modifiersData.popperOffsets,C=t.rects.reference,y=t.rects.popper,S=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,v=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),x=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(A){if(i){var R,k=T==="y"?Er:Cr,M=T==="y"?So:_o,N=T==="y"?"height":"width",D=A[T],L=D+_[k],j=D-_[M],F=h?-y[N]/2:0,B=g===Su?C[N]:y[N],U=g===Su?-y[N]:-C[N],K=t.elements.arrow,W=h&&K?NS(K):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:N5(),X=Q[k],J=Q[M],te=Yc(0,C[N],W[N]),le=E?C[N]/2-F-te-X-v.mainAxis:B-te-X-v.mainAxis,ge=E?-C[N]/2+F+te+J+v.mainAxis:U+te+J+v.mainAxis,se=t.elements.arrow&&pd(t.elements.arrow),ue=se?T==="y"?se.clientTop||0:se.clientLeft||0:0,Ie=(R=x==null?void 0:x[T])!=null?R:0,gt=D+le-Ie-ue,ie=D+ge-Ie,Ce=Yc(h?s1(L,gt):L,D,h?Ps(j,ie):j);A[T]=Ce,I[T]=Ce-D}if(s){var Ne,ze=T==="x"?Er:Cr,fr=T==="x"?So:_o,Kt=A[O],Cn=O==="y"?"height":"width",xn=Kt+_[ze],zt=Kt-_[fr],Co=[Er,Cr].indexOf(b)!==-1,Vo=(Ne=x==null?void 0:x[O])!=null?Ne:0,Ha=Co?xn:Kt-C[Cn]-y[Cn]-Vo+v.altAxis,Wa=Co?Kt+C[Cn]+y[Cn]-Vo-v.altAxis:zt,Gi=h&&Co?nee(Ha,Kt,Wa):Yc(h?Ha:xn,Kt,h?Wa:zt);A[O]=Gi,I[O]=Gi-Kt}t.modifiersData[r]=I}}const Mee={name:"preventOverflow",enabled:!0,phase:"main",fn:kee,requiresIfExists:["offset"]};function Dee(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Lee(e){return e===Zr(e)||!vo(e)?jS(e):Dee(e)}function Nee(e){var t=e.getBoundingClientRect(),n=_u(t.width)/e.offsetWidth||1,r=_u(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Bee(e,t,n){n===void 0&&(n=!1);var r=vo(t),o=vo(t)&&Nee(t),i=ja(t),a=Eu(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((di(t)!=="body"||$S(i))&&(s=Lee(t)),vo(t)?(l=Eu(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=FS(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function jee(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function Fee(e){var t=jee(e);return YJ.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function $ee(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function zee(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Hx={placement:"bottom",modifiers:[],strategy:"absolute"};function Wx(){for(var e=arguments.length,t=new Array(e),n=0;n{}),E=P.useCallback(()=>{var v;!t||!p.current||!m.current||((v=g.current)==null||v.call(g),_.current=Hee(p.current,m.current,{placement:b,modifiers:[LJ,kJ,RJ,{...IJ,enabled:!!d},{name:"eventListeners",...TJ(a)},{name:"arrow",options:{padding:i}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!f,options:{boundary:c}},...n??[]],strategy:o}),_.current.forceUpdate(),g.current=_.current.destroy)},[b,t,n,d,a,i,s,l,u,f,c,o]);P.useEffect(()=>()=>{var v;!p.current&&!m.current&&((v=_.current)==null||v.destroy(),_.current=null)},[]);const T=P.useCallback(v=>{p.current=v,E()},[E]),O=P.useCallback((v={},x=null)=>({...v,ref:Jt(T,x)}),[T]),A=P.useCallback(v=>{m.current=v,E()},[E]),C=P.useCallback((v={},x=null)=>({...v,ref:Jt(A,x),style:{...v.style,position:o,minWidth:d?void 0:"max-content",inset:"0 auto auto 0"}}),[o,A,d]),y=P.useCallback((v={},x=null)=>{const{size:I,shadowColor:R,bg:k,style:M,...N}=v;return{...N,ref:x,"data-popper-arrow":"",style:Wee(v)}},[]),S=P.useCallback((v={},x=null)=>({...v,ref:x,"data-popper-arrow-inner":""}),[]);return{update(){var v;(v=_.current)==null||v.update()},forceUpdate(){var v;(v=_.current)==null||v.forceUpdate()},transformOrigin:on.transformOrigin.varRef,referenceRef:T,popperRef:A,getPopperProps:C,getArrowProps:y,getArrowInnerProps:S,getReferenceProps:O}}function Wee(e){const{size:t,shadowColor:n,bg:r,style:o}=e,i={...o,position:"absolute"};return t&&(i["--popper-arrow-size"]=t),n&&(i["--popper-arrow-shadow-color"]=n),r&&(i["--popper-arrow-bg"]=r),i}function US(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=Ea(n),a=Ea(t),[s,l]=P.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,c=r!==void 0,f=P.useId(),d=o??`disclosure-${f}`,h=P.useCallback(()=>{c||l(!1),a==null||a()},[c,a]),p=P.useCallback(()=>{c||l(!0),i==null||i()},[c,i]),m=P.useCallback(()=>{u?h():p()},[u,p,h]);function _(g={}){return{...g,"aria-expanded":u,"aria-controls":d,onClick(E){var T;(T=g.onClick)==null||T.call(g,E),m()}}}function b(g={}){return{...g,hidden:!u,id:d}}return{isOpen:u,onOpen:p,onClose:h,onToggle:m,isControlled:c,getButtonProps:_,getDisclosureProps:b}}function Gee(e){const{ref:t,handler:n,enabled:r=!0}=e,o=Ea(n),a=P.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;P.useEffect(()=>{if(!r)return;const s=f=>{ig(f,t)&&(a.isPointerDown=!0)},l=f=>{if(a.ignoreEmulatedMouseEvents){a.ignoreEmulatedMouseEvents=!1;return}a.isPointerDown&&n&&ig(f,t)&&(a.isPointerDown=!1,o(f))},u=f=>{a.ignoreEmulatedMouseEvents=!0,n&&a.isPointerDown&&ig(f,t)&&(a.isPointerDown=!1,o(f))},c=z5(t.current);return c.addEventListener("mousedown",s,!0),c.addEventListener("mouseup",l,!0),c.addEventListener("touchstart",s,!0),c.addEventListener("touchend",u,!0),()=>{c.removeEventListener("mousedown",s,!0),c.removeEventListener("mouseup",l,!0),c.removeEventListener("touchstart",s,!0),c.removeEventListener("touchend",u,!0)}},[n,t,o,a,r])}function ig(e,t){var n;const r=e.target;return r&&!z5(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function z5(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function U5(e){const{isOpen:t,ref:n}=e,[r,o]=P.useState(t),[i,a]=P.useState(!1);return P.useEffect(()=>{i||(o(t),a(!0))},[t,i,r]),nu(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=qQ(n.current),c=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(c)}}}function V5(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[Kee,Xee,qee,Yee]=BY(),[Zee,md]=tn({strict:!1,name:"MenuContext"});function Qee(e,...t){const n=P.useId(),r=e||n;return P.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function H5(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Gx(e){return H5(e).activeElement===e}function Jee(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:i=!0,isLazy:a,isOpen:s,defaultIsOpen:l,onClose:u,onOpen:c,placement:f="bottom-start",lazyBehavior:d="unmount",direction:h,computePositionOnMount:p=!1,...m}=e,_=P.useRef(null),b=P.useRef(null),g=qee(),E=P.useCallback(()=>{requestAnimationFrame(()=>{var K;(K=_.current)==null||K.focus({preventScroll:!1})})},[]),T=P.useCallback(()=>{const K=setTimeout(()=>{var W;if(o)(W=o.current)==null||W.focus();else{const Q=g.firstEnabled();Q&&R(Q.index)}});L.current.add(K)},[g,o]),O=P.useCallback(()=>{const K=setTimeout(()=>{const W=g.lastEnabled();W&&R(W.index)});L.current.add(K)},[g]),A=P.useCallback(()=>{c==null||c(),i?T():E()},[i,T,E,c]),{isOpen:C,onOpen:y,onClose:S,onToggle:v}=US({isOpen:s,defaultIsOpen:l,onClose:u,onOpen:A});Gee({enabled:C&&r,ref:_,handler:K=>{var W;(W=b.current)!=null&&W.contains(K.target)||S()}});const x=zS({...m,enabled:C||p,placement:f,direction:h}),[I,R]=P.useState(-1);js(()=>{C||R(-1)},[C]),R5(_,{focusRef:b,visible:C,shouldFocus:!0});const k=U5({isOpen:C,ref:_}),[M,N]=Qee(t,"menu-button","menu-list"),D=P.useCallback(()=>{y(),E()},[y,E]),L=P.useRef(new Set([]));ate(()=>{L.current.forEach(K=>clearTimeout(K)),L.current.clear()});const j=P.useCallback(()=>{y(),T()},[T,y]),F=P.useCallback(()=>{y(),O()},[y,O]),B=P.useCallback(()=>{var K,W;const Q=H5(_.current),X=(K=_.current)==null?void 0:K.contains(Q.activeElement);if(!(C&&!X))return;const te=(W=g.item(I))==null?void 0:W.node;te==null||te.focus()},[C,I,g]),U=P.useRef(null);return{openAndFocusMenu:D,openAndFocusFirstItem:j,openAndFocusLastItem:F,onTransitionEnd:B,unstable__animationState:k,descendants:g,popper:x,buttonId:M,menuId:N,forceUpdate:x.forceUpdate,orientation:"vertical",isOpen:C,onToggle:v,onOpen:y,onClose:S,menuRef:_,buttonRef:b,focusedIndex:I,closeOnSelect:n,closeOnBlur:r,autoSelect:i,setFocusedIndex:R,isLazy:a,lazyBehavior:d,initialFocusRef:o,rafId:U}}function ete(e={},t=null){const n=md(),{onToggle:r,popper:o,openAndFocusFirstItem:i,openAndFocusLastItem:a}=n,s=P.useCallback(l=>{const u=l.key,f={Enter:i,ArrowDown:i,ArrowUp:a}[u];f&&(l.preventDefault(),l.stopPropagation(),f(l))},[i,a]);return{...e,ref:Jt(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":Re(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:ke(e.onClick,r),onKeyDown:ke(e.onKeyDown,s)}}function $2(e){var t;return ote(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function tte(e={},t=null){const n=md();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:r,setFocusedIndex:o,menuRef:i,isOpen:a,onClose:s,menuId:l,isLazy:u,lazyBehavior:c,unstable__animationState:f}=n,d=Xee(),h=vJ({preventDefault:b=>b.key!==" "&&$2(b.target)}),p=P.useCallback(b=>{if(!b.currentTarget.contains(b.target))return;const g=b.key,T={Tab:A=>A.preventDefault(),Escape:s,ArrowDown:()=>{const A=d.nextEnabled(r);A&&o(A.index)},ArrowUp:()=>{const A=d.prevEnabled(r);A&&o(A.index)}}[g];if(T){b.preventDefault(),T(b);return}const O=h(A=>{const C=wJ(d.values(),A,y=>{var S,v;return(v=(S=y==null?void 0:y.node)==null?void 0:S.textContent)!=null?v:""},d.item(r));if(C){const y=d.indexOf(C.node);o(y)}});$2(b.target)&&O(b)},[d,r,h,s,o]),m=P.useRef(!1);a&&(m.current=!0);const _=V5({wasSelected:m.current,enabled:u,mode:c,isSelected:f.present});return{...e,ref:Jt(i,t),children:_?e.children:null,tabIndex:-1,role:"menu",id:l,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:ke(e.onKeyDown,p)}}function nte(e={}){const{popper:t,isOpen:n}=md();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function rte(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:i,onFocus:a,isDisabled:s,isFocusable:l,closeOnSelect:u,type:c,...f}=e,d=md(),{setFocusedIndex:h,focusedIndex:p,closeOnSelect:m,onClose:_,menuRef:b,isOpen:g,menuId:E,rafId:T}=d,O=P.useRef(null),A=`${E}-menuitem-${P.useId()}`,{index:C,register:y}=Yee({disabled:s&&!l}),S=P.useCallback(D=>{n==null||n(D),!s&&h(C)},[h,C,s,n]),v=P.useCallback(D=>{r==null||r(D),O.current&&!Gx(O.current)&&S(D)},[S,r]),x=P.useCallback(D=>{o==null||o(D),!s&&h(-1)},[h,s,o]),I=P.useCallback(D=>{i==null||i(D),$2(D.currentTarget)&&(u??m)&&_()},[_,i,m,u]),R=P.useCallback(D=>{a==null||a(D),h(C)},[h,a,C]),k=C===p,M=s&&!l;js(()=>{g&&(k&&!M&&O.current?(T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame(()=>{var D;(D=O.current)==null||D.focus(),T.current=null})):b.current&&!Gx(b.current)&&b.current.focus({preventScroll:!0}))},[k,M,b,g]);const N=SJ({onClick:I,onFocus:R,onMouseEnter:S,onMouseMove:v,onMouseLeave:x,ref:Jt(y,O,t),isDisabled:s,isFocusable:l});return{...f,...N,type:c??N.type,id:A,role:"menuitem",tabIndex:k?0:-1}}function ote(e){var t;if(!ite(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function ite(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function ate(e,t=[]){return P.useEffect(()=>()=>e(),t)}var[ste,yd]=tn({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),VS=e=>{const{children:t}=e,n=Pr("Menu",e),r=Rt(e),{direction:o}=rd(),{descendants:i,...a}=Jee({...r,direction:o}),s=P.useMemo(()=>a,[a]),{isOpen:l,onClose:u,forceUpdate:c}=s;return w.jsx(Kee,{value:i,children:w.jsx(Zee,{value:s,children:w.jsx(ste,{value:n,children:po(t,{isOpen:l,onClose:u,forceUpdate:c})})})})};VS.displayName="Menu";var W5=de((e,t)=>{const n=yd();return w.jsx(ne.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});W5.displayName="MenuCommand";var lte=de((e,t)=>{const{type:n,...r}=e,o=yd(),i=r.as||n?n??void 0:"button",a=P.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return w.jsx(ne.button,{ref:t,type:i,...r,__css:a})}),G5=e=>{const{className:t,children:n,...r}=e,o=yd(),i=P.Children.only(n),a=P.isValidElement(i)?P.cloneElement(i,{focusable:"false","aria-hidden":!0,className:_e("chakra-menu__icon",i.props.className)}):null,s=_e("chakra-menu__icon-wrapper",t);return w.jsx(ne.span,{className:s,...r,__css:o.icon,children:a})};G5.displayName="MenuIcon";var Qo=de((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:i="0.75rem",children:a,...s}=e,l=rte(s,t),c=n||o?w.jsx("span",{style:{pointerEvents:"none",flex:1},children:a}):a;return w.jsxs(lte,{...l,className:_e("chakra-menu__menuitem",l.className),children:[n&&w.jsx(G5,{fontSize:"0.8em",marginEnd:r,children:n}),c,o&&w.jsx(W5,{marginStart:i,children:o})]})});Qo.displayName="MenuItem";var ute={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},cte=ne(Ui.div),HS=de(function(t,n){var r,o;const{rootProps:i,motionProps:a,...s}=t,{isOpen:l,onTransitionEnd:u,unstable__animationState:c}=md(),f=tte(s,n),d=nte(i),h=yd();return w.jsx(ne.div,{...d,__css:{zIndex:(o=t.zIndex)!=null?o:(r=h.list)==null?void 0:r.zIndex},children:w.jsx(cte,{variants:ute,initial:!1,animate:l?"enter":"exit",__css:{outline:0,...h.list},...a,className:_e("chakra-menu__menu-list",f.className),...f,onUpdate:u,onAnimationComplete:q0(c.onComplete,f.onAnimationComplete)})})});HS.displayName="MenuList";var fte=de((e,t)=>{const n=yd();return w.jsx(ne.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),WS=de((e,t)=>{const{children:n,as:r,...o}=e,i=ete(o,t),a=r||fte;return w.jsx(a,{...i,className:_e("chakra-menu__menu-button",e.className),children:w.jsx(ne.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});WS.displayName="MenuButton";var dte={slideInBottom:{...A2,custom:{offsetY:16,reverse:!0}},slideInRight:{...A2,custom:{offsetX:16,reverse:!0}},scale:{...CI,custom:{initialScale:.95,reverse:!0}},none:{}},hte=ne(Ui.section),pte=e=>dte[e||"none"],K5=P.forwardRef((e,t)=>{const{preset:n,motionProps:r=pte(n),...o}=e;return w.jsx(hte,{ref:t,...r,...o})});K5.displayName="ModalTransition";var mte=Object.defineProperty,yte=(e,t,n)=>t in e?mte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gte=(e,t,n)=>(yte(e,typeof t!="symbol"?t+"":t,n),n),vte=class{constructor(){gte(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},z2=new vte;function X5(e,t){const[n,r]=P.useState(0);return P.useEffect(()=>{const o=e.current;if(o){if(t){const i=z2.add(o);r(i)}return()=>{z2.remove(o),r(0)}}},[t,e]),n}var wte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ll=new WeakMap,mh=new WeakMap,yh={},ag=0,q5=function(e){return e&&(e.host||q5(e.parentNode))},bte=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=q5(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ste=function(e,t,n,r){var o=bte(t,Array.isArray(e)?e:[e]);yh[n]||(yh[n]=new WeakMap);var i=yh[n],a=[],s=new Set,l=new Set(o),u=function(f){!f||s.has(f)||(s.add(f),u(f.parentNode))};o.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(d){if(s.has(d))c(d);else{var h=d.getAttribute(r),p=h!==null&&h!=="false",m=(ll.get(d)||0)+1,_=(i.get(d)||0)+1;ll.set(d,m),i.set(d,_),a.push(d),m===1&&p&&mh.set(d,!0),_===1&&d.setAttribute(n,"true"),p||d.setAttribute(r,"true")}})};return c(t),s.clear(),ag++,function(){a.forEach(function(f){var d=ll.get(f)-1,h=i.get(f)-1;ll.set(f,d),i.set(f,h),d||(mh.has(f)||f.removeAttribute(r),mh.delete(f)),h||f.removeAttribute(n)}),ag--,ag||(ll=new WeakMap,ll=new WeakMap,mh=new WeakMap,yh={})}},_te=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||wte(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Ste(r,o,n,"aria-hidden")):function(){return null}};function Ete(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=P.useRef(null),c=P.useRef(null),[f,d,h]=xte(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Cte(u,t&&a);const p=X5(u,t),m=P.useRef(null),_=P.useCallback(S=>{m.current=S.target},[]),b=P.useCallback(S=>{S.key==="Escape"&&(S.stopPropagation(),i&&(n==null||n()),l==null||l())},[i,n,l]),[g,E]=P.useState(!1),[T,O]=P.useState(!1),A=P.useCallback((S={},v=null)=>({role:"dialog",...S,ref:Jt(v,u),id:f,tabIndex:-1,"aria-modal":!0,"aria-labelledby":g?d:void 0,"aria-describedby":T?h:void 0,onClick:ke(S.onClick,x=>x.stopPropagation())}),[h,T,f,d,g]),C=P.useCallback(S=>{S.stopPropagation(),m.current===S.target&&z2.isTopModal(u.current)&&(o&&(n==null||n()),s==null||s())},[n,o,s]),y=P.useCallback((S={},v=null)=>({...S,ref:Jt(v,c),onClick:ke(S.onClick,C),onKeyDown:ke(S.onKeyDown,b),onMouseDown:ke(S.onMouseDown,_)}),[b,_,C]);return{isOpen:t,onClose:n,headerId:d,bodyId:h,setBodyMounted:O,setHeaderMounted:E,dialogRef:u,overlayRef:c,getDialogProps:A,getDialogContainerProps:y,index:p}}function Cte(e,t){const n=e.current;P.useEffect(()=>{if(!(!e.current||!t))return _te(e.current)},[t,e,n])}function xte(e,...t){const n=P.useId(),r=e||n;return P.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[Ote,$u]=tn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Ate,zs]=tn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),$r=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:i,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:c,preserveScrollBarGap:f,motionPreset:d,lockFocusAcrossFrames:h,onCloseComplete:p}=t,m=Pr("Modal",t),b={...Ete(t),autoFocus:o,trapFocus:i,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:c,preserveScrollBarGap:f,motionPreset:d,lockFocusAcrossFrames:h};return w.jsx(Ate,{value:b,children:w.jsx(Ote,{value:m,children:w.jsx(Bu,{onExitComplete:p,children:b.isOpen&&w.jsx(Nu,{...n,children:r})})})})};$r.displayName="Modal";var ip="right-scroll-bar-position",ap="width-before-scroll-bar",Pte="with-scroll-bars-hidden",Tte="--removed-body-scroll-bar-size",Y5=GI(),sg=function(){},hm=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:sg,onWheelCapture:sg,onTouchMoveCapture:sg}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,f=e.shards,d=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,_=e.as,b=_===void 0?"div":_,g=e.gapMode,E=VI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=d,O=UI([n,t]),A=ni(ni({},E),o);return P.createElement(P.Fragment,null,c&&P.createElement(T,{sideCar:Y5,removeScrollBar:u,shards:f,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:g}),a?P.cloneElement(P.Children.only(s),ni(ni({},A),{ref:O})):P.createElement(b,ni({},A,{className:l,ref:O}),s))});hm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};hm.classNames={fullWidth:ap,zeroRight:ip};var Kx,Ite=function(){if(Kx)return Kx;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rte(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ite();return t&&e.setAttribute("nonce",t),e}function kte(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Mte(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Dte=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rte())&&(kte(t,n),Mte(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Lte=function(){var e=Dte();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Z5=function(){var e=Lte(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Nte={left:0,top:0,right:0,gap:0},lg=function(e){return parseInt(e||"",10)||0},Bte=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[lg(n),lg(r),lg(o)]},jte=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Nte;var t=Bte(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Fte=Z5(),$te=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` - .`.concat(Pte,` { + `),()=>{document.head.removeChild(u)}},[t]),P.createElement(wY,{isPresent:t,childRef:r,sizeRef:o},P.cloneElement(e,{ref:r}))}const cg=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a})=>{const s=OT(SY),l=P.useId(),u=P.useMemo(()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:c=>{s.set(c,!0);for(const f of s.values())if(!f)return;r&&r()},register:c=>(s.set(c,!1),()=>s.delete(c))}),i?void 0:[n]);return P.useMemo(()=>{s.forEach((c,f)=>s.set(f,!1))},[n]),P.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=P.createElement(bY,{isPresent:n},e)),P.createElement(ad.Provider,{value:u},e)};function SY(){return new Map}function _Y(e){return P.useEffect(()=>()=>e(),[])}const yl=e=>e.key||"";function EY(e,t){e.forEach(n=>{const r=yl(n);t.set(r,n)})}function CY(e){const t=[];return P.Children.forEach(e,n=>{P.isValidElement(n)&&t.push(n)}),t}const Fu=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:a="sync"})=>{const s=P.useContext(dS).forceRender||vY()[0],l=II(),u=CY(e);let c=u;const f=P.useRef(new Map).current,d=P.useRef(c),h=P.useRef(new Map).current,p=P.useRef(!0);if(qp(()=>{p.current=!1,EY(u,h),d.current=c}),_Y(()=>{p.current=!0,h.clear(),f.clear()}),p.current)return P.createElement(P.Fragment,null,c.map(g=>P.createElement(cg,{key:yl(g),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:i,mode:a},g)));c=[...c];const m=d.current.map(yl),S=u.map(yl),b=m.length;for(let g=0;g{if(S.indexOf(E)!==-1)return;const T=h.get(E);if(!T)return;const O=m.indexOf(E);let A=g;if(!A){const C=()=>{h.delete(E),f.delete(E);const y=d.current.findIndex(_=>_.key===E);if(d.current.splice(y,1),!f.size){if(d.current=u,l.current===!1)return;s(),r&&r()}};A=P.createElement(cg,{key:yl(T),isPresent:!1,onExitComplete:C,custom:t,presenceAffectsLayout:i,mode:a},T),f.set(E,A)}c.splice(O,0,A)}),c=c.map(g=>{const E=g.key;return f.has(E)?g:P.createElement(cg,{key:yl(g),isPresent:!0,presenceAffectsLayout:i,mode:a},g)}),P.createElement(P.Fragment,null,f.size?c:c.map(g=>P.cloneElement(g)))};var xY={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},RI=P.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:o,requestClose:i=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=xY,toastSpacing:c="0.5rem"}=e,[f,d]=P.useState(s),h=fq();$s(()=>{h||r==null||r()},[h]),$s(()=>{d(s)},[s]);const p=()=>d(null),m=()=>d(s),S=()=>{h&&o()};P.useEffect(()=>{h&&i&&o()},[h,i,o]),lG(S,f);const b=P.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),g=P.useMemo(()=>aG(a),[a]);return w.jsx(Hi.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:p,onHoverEnd:m,custom:{position:a},style:g,children:w.jsx(ne.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:mo(n,{id:t,onClose:S})})})});RI.displayName="ToastComponent";function OY(e,t){var n;const r=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=i==null?void 0:i[t])!=null?n:r}var Cx={path:w.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[w.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),w.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),w.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Ne=de((e,t)=>{const{as:n,viewBox:r,color:o="currentColor",focusable:i=!1,children:a,className:s,__css:l,...u}=e,c=_e("chakra-icon",s),f=Co("Icon",e),d={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...l,...f},h={ref:t,focusable:i,className:c,__css:d},p=r??Cx.viewBox;if(n&&typeof n!="string")return w.jsx(ne.svg,{as:n,...h,...u});const m=a??Cx.path;return w.jsx(ne.svg,{verticalAlign:"middle",viewBox:p,...h,...u,children:m})});Ne.displayName="Icon";function AY(e){return w.jsx(Ne,{viewBox:"0 0 24 24",...e,children:w.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function PY(e){return w.jsx(Ne,{viewBox:"0 0 24 24",...e,children:w.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function xx(e){return w.jsx(Ne,{viewBox:"0 0 24 24",...e,children:w.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var TY=pi({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),ym=de((e,t)=>{const n=Co("Spinner",e),{label:r="Loading...",thickness:o="2px",speed:i="0.45s",emptyColor:a="transparent",className:s,...l}=Rt(e),u=_e("chakra-spinner",s),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:o,borderBottomColor:a,borderLeftColor:a,animation:`${TY} ${i} linear infinite`,...n};return w.jsx(ne.div,{ref:t,__css:c,className:u,...l,children:r&&w.jsx(ne.span,{srOnly:!0,children:r})})});ym.displayName="Spinner";var[IY,IS]=tn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[RY,RS]=tn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),kI={info:{icon:PY,colorScheme:"blue"},warning:{icon:xx,colorScheme:"orange"},success:{icon:AY,colorScheme:"green"},error:{icon:xx,colorScheme:"red"},loading:{icon:ym,colorScheme:"blue"}};function kY(e){return kI[e].colorScheme}function MY(e){return kI[e].icon}var MI=de(function(t,n){const r=RS(),{status:o}=IS(),i={display:"inline",...r.description};return w.jsx(ne.div,{ref:n,"data-status":o,...t,className:_e("chakra-alert__desc",t.className),__css:i})});MI.displayName="AlertDescription";function DI(e){const{status:t}=IS(),n=MY(t),r=RS(),o=t==="loading"?r.spinner:r.icon;return w.jsx(ne.span,{display:"inherit","data-status":t,...e,className:_e("chakra-alert__icon",e.className),__css:o,children:e.children||w.jsx(n,{h:"100%",w:"100%"})})}DI.displayName="AlertIcon";var LI=de(function(t,n){const r=RS(),{status:o}=IS();return w.jsx(ne.div,{ref:n,"data-status":o,...t,className:_e("chakra-alert__title",t.className),__css:r.title})});LI.displayName="AlertTitle";var NI=de(function(t,n){var r;const{status:o="info",addRole:i=!0,...a}=Rt(t),s=(r=t.colorScheme)!=null?r:kY(o),l=Dr("Alert",{...t,colorScheme:s}),u={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return w.jsx(IY,{value:{status:o},children:w.jsx(RY,{value:l,children:w.jsx(ne.div,{"data-status":o,role:i?"alert":void 0,ref:n,...a,className:_e("chakra-alert",t.className),__css:u})})})});NI.displayName="Alert";function DY(e){return w.jsx(Ne,{focusable:"false","aria-hidden":!0,...e,children:w.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var gm=de(function(t,n){const r=Co("CloseButton",t),{children:o,isDisabled:i,__css:a,...s}=Rt(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return w.jsx(ne.button,{type:"button","aria-label":"Close",ref:n,disabled:i,__css:{...l,...r,...a},...s,children:o||w.jsx(DY,{width:"1em",height:"1em"})})});gm.displayName="CloseButton";var LY={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},ni=NY(LY);function NY(e){let t=e;const n=new Set,r=o=>{t=o(t),n.forEach(i=>i())};return{getState:()=>t,subscribe:o=>(n.add(o),()=>{r(()=>e),n.delete(o)}),removeToast:(o,i)=>{r(a=>({...a,[i]:a[i].filter(s=>s.id!=o)}))},notify:(o,i)=>{const a=BY(o,i),{position:s,id:l}=a;return r(u=>{var c,f;const h=s.includes("top")?[a,...(c=u[s])!=null?c:[]]:[...(f=u[s])!=null?f:[],a];return{...u,[s]:h}}),l},update:(o,i)=>{o&&r(a=>{const s={...a},{position:l,index:u}=b3(s,o);return l&&u!==-1&&(s[l][u]={...s[l][u],...i,message:BI(i)}),s})},closeAll:({positions:o}={})=>{r(i=>(o??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=i[u].map(c=>({...c,requestClose:!0})),l),{...i}))},close:o=>{r(i=>{const a=uT(i,o);return a?{...i,[a]:i[a].map(s=>s.id==o?{...s,requestClose:!0}:s)}:i})},isActive:o=>!!b3(ni.getState(),o).position}}var Ox=0;function BY(e,t={}){var n,r;Ox+=1;const o=(n=t.id)!=null?n:Ox,i=(r=t.position)!=null?r:"bottom";return{id:o,message:e,position:i,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>ni.removeToast(String(o),i),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var jY=e=>{const{status:t,variant:n="solid",id:r,title:o,isClosable:i,onClose:a,description:s,colorScheme:l,icon:u}=e,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return w.jsxs(NI,{addRole:!1,status:t,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[w.jsx(DI,{children:u}),w.jsxs(ne.div,{flex:"1",maxWidth:"100%",children:[o&&w.jsx(LI,{id:c==null?void 0:c.title,children:o}),s&&w.jsx(MI,{id:c==null?void 0:c.description,display:"block",children:s})]}),i&&w.jsx(gm,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1})]})};function BI(e={}){const{render:t,toastComponent:n=jY}=e;return o=>typeof t=="function"?t({...o,...e}):w.jsx(n,{...o,...e})}function FY(e,t){const n=o=>{var i;return{...t,...o,position:OY((i=o==null?void 0:o.position)!=null?i:t==null?void 0:t.position,e)}},r=o=>{const i=n(o),a=BI(i);return ni.notify(a,i)};return r.update=(o,i)=>{ni.update(o,n(i))},r.promise=(o,i)=>{const a=r({...i.loading,status:"loading",duration:null});o.then(s=>r.update(a,{status:"success",duration:5e3,...mo(i.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...mo(i.error,s)}))},r.closeAll=ni.closeAll,r.close=ni.close,r.isActive=ni.isActive,r}var[$Y,zY]=tn({name:"ToastOptionsContext",strict:!1}),VY=e=>{const t=P.useSyncExternalStore(ni.subscribe,ni.getState,ni.getState),{motionVariants:n,component:r=RI,portalProps:o}=e,a=Object.keys(t).map(s=>{const l=t[s];return w.jsx("div",{role:"region","aria-live":"polite","aria-label":"Notifications",id:`chakra-toast-manager-${s}`,style:sG(s),children:w.jsx(Fu,{initial:!1,children:l.map(u=>w.jsx(r,{motionVariants:n,...u},u.id))})},s)});return w.jsx(ju,{...o,children:a})};function Ho(e){const{theme:t}=kP(),n=zY();return P.useMemo(()=>FY(t.direction,{...n,...e}),[e,t.direction,n])}var UY=e=>function({children:n,theme:r=e,toastOptions:o,...i}){return w.jsxs(oG,{theme:r,...i,children:[w.jsx($Y,{value:o==null?void 0:o.defaultOptions,children:n}),w.jsx(VY,{...o})]})},HY=UY(JP),WY=Object.defineProperty,GY=(e,t,n)=>t in e?WY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ut=(e,t,n)=>(GY(e,typeof t!="symbol"?t+"":t,n),n);function Ax(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var KY=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function Px(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function Tx(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var B2=typeof window<"u"?P.useLayoutEffect:P.useEffect,o1=e=>e,XY=class{constructor(){Ut(this,"descendants",new Map),Ut(this,"register",e=>{if(e!=null)return KY(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),Ut(this,"unregister",e=>{this.descendants.delete(e);const t=Ax(Array.from(this.descendants.keys()));this.assignIndex(t)}),Ut(this,"destroy",()=>{this.descendants.clear()}),Ut(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),Ut(this,"count",()=>this.descendants.size),Ut(this,"enabledCount",()=>this.enabledValues().length),Ut(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),Ut(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),Ut(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),Ut(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),Ut(this,"first",()=>this.item(0)),Ut(this,"firstEnabled",()=>this.enabledItem(0)),Ut(this,"last",()=>this.item(this.descendants.size-1)),Ut(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),Ut(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),Ut(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),Ut(this,"next",(e,t=!0)=>{const n=Px(e,this.count(),t);return this.item(n)}),Ut(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Px(r,this.enabledCount(),t);return this.enabledItem(o)}),Ut(this,"prev",(e,t=!0)=>{const n=Tx(e,this.count()-1,t);return this.item(n)}),Ut(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Tx(r,this.enabledCount()-1,t);return this.enabledItem(o)}),Ut(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=Ax(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)})}};function qY(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Jt(...e){return t=>{e.forEach(n=>{qY(n,t)})}}function YY(...e){return P.useMemo(()=>Jt(...e),e)}function ZY(){const e=P.useRef(new XY);return B2(()=>()=>e.current.destroy()),e.current}var[QY,jI]=tn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function JY(e){const t=jI(),[n,r]=P.useState(-1),o=P.useRef(null);B2(()=>()=>{o.current&&t.unregister(o.current)},[]),B2(()=>{if(!o.current)return;const a=Number(o.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const i=o1(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:Jt(i,o)}}function eZ(){return[o1(QY),()=>o1(jI()),()=>ZY(),o=>JY(o)]}var Ix={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Ps={enter:{duration:.2,ease:Ix.easeOut},exit:{duration:.1,ease:Ix.easeIn}},Ts={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},tZ={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Ts.enter(Ps.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Ts.exit(Ps.exit,n),transitionEnd:t==null?void 0:t.exit}}},FI={initial:"exit",animate:"enter",exit:"exit",variants:tZ},nZ=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:i,transition:a,transitionEnd:s,delay:l,...u}=t,c=o||r?"enter":"exit",f=r?o&&r:!0,d={transition:a,transitionEnd:s,delay:l};return w.jsx(Fu,{custom:d,children:f&&w.jsx(Hi.div,{ref:n,className:_e("chakra-fade",i),custom:d,...FI,animate:c,...u})})});nZ.displayName="Fade";var rZ={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(i=n==null?void 0:n.exit)!=null?i:Ts.exit(Ps.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Ts.enter(Ps.enter,n),transitionEnd:e==null?void 0:e.enter}}},$I={initial:"exit",animate:"enter",exit:"exit",variants:rZ},oZ=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:c,...f}=t,d=r?o&&r:!0,h=o||r?"enter":"exit",p={initialScale:a,reverse:i,transition:l,transitionEnd:u,delay:c};return w.jsx(Fu,{custom:p,children:d&&w.jsx(Hi.div,{ref:n,className:_e("chakra-offset-slide",s),...$I,animate:h,custom:p,...f})})});oZ.displayName="ScaleFade";var iZ={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var i;return{opacity:0,x:e,y:t,transition:(i=n==null?void 0:n.exit)!=null?i:Ts.exit(Ps.exit,o),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Ts.enter(Ps.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:i})=>{var a;const s={x:t,y:e};return{opacity:0,transition:(a=n==null?void 0:n.exit)!=null?a:Ts.exit(Ps.exit,i),...o?{...s,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...s,...r==null?void 0:r.exit}}}}},j2={initial:"initial",animate:"enter",exit:"exit",variants:iZ},aZ=P.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:c,delay:f,...d}=t,h=r?o&&r:!0,p=o||r?"enter":"exit",m={offsetX:s,offsetY:l,reverse:i,transition:u,transitionEnd:c,delay:f};return w.jsx(Fu,{custom:m,children:h&&w.jsx(Hi.div,{ref:n,className:_e("chakra-offset-slide",a),custom:m,...j2,animate:p,...d})})});aZ.displayName="SlideFade";var[sZ,lZ]=tn({name:"AvatarStylesContext",hookName:"useAvatarStyles",providerName:""});function uZ(e){var t;const n=e.split(" "),r=(t=n[0])!=null?t:"",o=n.length>1?n[n.length-1]:"";return r&&o?`${r.charAt(0)}${o.charAt(0)}`:r.charAt(0)}function zI(e){const{name:t,getInitials:n,...r}=e,o=lZ();return w.jsx(ne.div,{role:"img","aria-label":t,...r,__css:o.label,children:t?n==null?void 0:n(t):null})}zI.displayName="AvatarName";var VI=e=>w.jsxs(ne.svg,{viewBox:"0 0 128 128",color:"#fff",width:"100%",height:"100%",className:"chakra-avatar__svg",...e,children:[w.jsx("path",{fill:"currentColor",d:"M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"}),w.jsx("path",{fill:"currentColor",d:"M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"})]}),F2=de(function(t,n){const{htmlWidth:r,htmlHeight:o,alt:i,...a}=t;return w.jsx("img",{width:r,height:o,ref:n,alt:i,...a})});F2.displayName="NativeImage";function UI(e){const{loading:t,src:n,srcSet:r,onLoad:o,onError:i,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,c]=P.useState("pending");P.useEffect(()=>{c(n?"loading":"pending")},[n]);const f=P.useRef(),d=P.useCallback(()=>{if(!n)return;h();const p=new Image;p.src=n,a&&(p.crossOrigin=a),r&&(p.srcset=r),s&&(p.sizes=s),t&&(p.loading=t),p.onload=m=>{h(),c("loaded"),o==null||o(m)},p.onerror=m=>{h(),c("failed"),i==null||i(m)},f.current=p},[n,a,r,s,o,i,t]),h=()=>{f.current&&(f.current.onload=null,f.current.onerror=null,f.current=null)};return si(()=>{if(!l)return u==="loading"&&d(),()=>{h()}},[u,d,l]),l?"loaded":u}var cZ=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function fZ(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var $u=de(function(t,n){const{fallbackSrc:r,fallback:o,src:i,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:c,crossOrigin:f,fallbackStrategy:d="beforeLoadOrError",referrerPolicy:h,...p}=t,m=r!==void 0||o!==void 0,S=u!=null||c||!m,b=UI({...t,crossOrigin:f,ignoreFallback:S}),g=cZ(b,d),E={ref:n,objectFit:l,objectPosition:s,...S?p:fZ(p,["onError","onLoad"])};return g?o||w.jsx(ne.img,{as:F2,className:"chakra-image__placeholder",src:r,...E}):w.jsx(ne.img,{as:F2,src:i,srcSet:a,crossOrigin:f,loading:u,referrerPolicy:h,className:"chakra-image",...E})});$u.displayName="Image";function HI(e){const{src:t,srcSet:n,onError:r,onLoad:o,getInitials:i,name:a,borderRadius:s,loading:l,iconLabel:u,icon:c=w.jsx(VI,{}),ignoreFallback:f,referrerPolicy:d,crossOrigin:h}=e,m=UI({src:t,onError:r,crossOrigin:h,ignoreFallback:f})==="loaded";return!t||!m?a?w.jsx(zI,{className:"chakra-avatar__initials",getInitials:i,name:a}):P.cloneElement(c,{role:"img","aria-label":u}):w.jsx(ne.img,{src:t,srcSet:n,alt:a,onLoad:o,referrerPolicy:d,crossOrigin:h??void 0,className:"chakra-avatar__img",loading:l,__css:{width:"100%",height:"100%",objectFit:"cover",borderRadius:s}})}HI.displayName="AvatarImage";var dZ={display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",textTransform:"uppercase",fontWeight:"medium",position:"relative",flexShrink:0},i1=de((e,t)=>{const n=Dr("Avatar",e),[r,o]=P.useState(!1),{src:i,srcSet:a,name:s,showBorder:l,borderRadius:u="full",onError:c,onLoad:f,getInitials:d=uZ,icon:h=w.jsx(VI,{}),iconLabel:p=" avatar",loading:m,children:S,borderColor:b,ignoreFallback:g,crossOrigin:E,referrerPolicy:T,...O}=Rt(e),A={borderRadius:u,borderWidth:l?"2px":void 0,...dZ,...n.container};return b&&(A.borderColor=b),w.jsx(ne.span,{ref:t,...O,className:_e("chakra-avatar",e.className),"data-loaded":Re(r),__css:A,children:w.jsxs(sZ,{value:n,children:[w.jsx(HI,{src:i,srcSet:a,loading:m,onLoad:ke(f,()=>{o(!0)}),onError:c,getInitials:d,name:s,borderRadius:u,icon:h,iconLabel:p,ignoreFallback:g,crossOrigin:E,referrerPolicy:T}),S]})})});i1.displayName="Avatar";function WI(e){return P.Children.toArray(e).filter(t=>P.isValidElement(t))}var[hZ,pZ]=tn({strict:!1,name:"ButtonGroupContext"}),mZ={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},yZ={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},fd=de(function(t,n){const{size:r,colorScheme:o,variant:i,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,orientation:c="horizontal",...f}=t,d=_e("chakra-button__group",a),h=P.useMemo(()=>({size:r,colorScheme:o,variant:i,isDisabled:u}),[r,o,i,u]);let p={display:"inline-flex",...l?mZ[c]:yZ[c](s)};const m=c==="vertical";return w.jsx(hZ,{value:h,children:w.jsx(ne.div,{ref:n,role:"group",__css:p,className:d,"data-attached":l?"":void 0,"data-orientation":c,flexDir:m?"column":void 0,...f})})});fd.displayName="ButtonGroup";function gZ(e){const[t,n]=P.useState(!e);return{ref:P.useCallback(i=>{i&&n(i.tagName==="BUTTON")},[]),type:t?"button":void 0}}function $2(e){const{children:t,className:n,...r}=e,o=P.isValidElement(t)?P.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,i=_e("chakra-button__icon",n);return w.jsx(ne.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:i,children:o})}$2.displayName="ButtonIcon";function z2(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=w.jsx(ym,{color:"currentColor",width:"1em",height:"1em"}),className:i,__css:a,...s}=e,l=_e("chakra-button__spinner",i),u=n==="start"?"marginEnd":"marginStart",c=P.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return w.jsx(ne.div,{className:l,...s,__css:c,children:o})}z2.displayName="ButtonSpinner";var be=de((e,t)=>{const n=pZ(),r=Co("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:i,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:c,iconSpacing:f="0.5rem",type:d,spinner:h,spinnerPlacement:p="start",className:m,as:S,...b}=Rt(e),g=P.useMemo(()=>{const A={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:A}}},[r,n]),{ref:E,type:T}=gZ(S),O={rightIcon:u,leftIcon:l,iconSpacing:f,children:s};return w.jsxs(ne.button,{ref:YY(t,E),as:S,type:d??T,"data-active":Re(a),"data-loading":Re(i),__css:g,className:_e("chakra-button",m),...b,disabled:o||i,children:[i&&p==="start"&&w.jsx(z2,{className:"chakra-button__spinner--start",label:c,placement:"start",spacing:f,children:h}),i?c||w.jsx(ne.span,{opacity:0,children:w.jsx(Rx,{...O})}):w.jsx(Rx,{...O}),i&&p==="end"&&w.jsx(z2,{className:"chakra-button__spinner--end",label:c,placement:"end",spacing:f,children:h})]})});be.displayName="Button";function Rx(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return w.jsxs(w.Fragment,{children:[t&&w.jsx($2,{marginEnd:o,children:t}),r,n&&w.jsx($2,{marginStart:o,children:n})]})}var dd=de((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":i,...a}=e,s=n||r,l=P.isValidElement(s)?P.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return w.jsx(be,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":i,...a,children:l})});dd.displayName="IconButton";var[vZ,kS]=tG("Card"),wZ=de(function(t,n){const{className:r,...o}=t,i=kS();return w.jsx(ne.div,{ref:n,className:_e("chakra-card__body",r),__css:i.body,...o})}),bZ=de(function(t,n){const{className:r,justify:o,...i}=t,a=kS();return w.jsx(ne.div,{ref:n,className:_e("chakra-card__footer",r),__css:{display:"flex",justifyContent:o,...a.footer},...i})}),SZ=de(function(t,n){const{className:r,...o}=t,i=kS();return w.jsx(ne.div,{ref:n,className:_e("chakra-card__header",r),__css:i.header,...o})}),_Z=de(function(t,n){const{className:r,children:o,direction:i="column",justify:a,align:s,...l}=Rt(t),u=Dr("Card",t);return w.jsx(ne.div,{ref:n,className:_e("chakra-card",r),__css:{display:"flex",flexDirection:i,justifyContent:a,alignItems:s,position:"relative",minWidth:0,wordWrap:"break-word",...u.container},...l,children:w.jsx(vZ,{value:u,children:o})})}),[$ge,EZ]=tn({name:"CheckboxGroupContext",strict:!1});function CZ(e){const[t,n]=P.useState(e),[r,o]=P.useState(!1);return e!==t&&(o(!0),n(e)),r}function xZ(e){return w.jsx(ne.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:w.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function OZ(e){return w.jsx(ne.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:w.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function AZ(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?OZ:xZ;return n||t?w.jsx(ne.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:w.jsx(o,{...r})}):null}var[PZ,GI]=tn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[TZ,hd]=tn({strict:!1,name:"FormControlContext"});function IZ(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:i,...a}=e,s=P.useId(),l=t||`field-${s}`,u=`${l}-label`,c=`${l}-feedback`,f=`${l}-helptext`,[d,h]=P.useState(!1),[p,m]=P.useState(!1),[S,b]=P.useState(!1),g=P.useCallback((C={},y=null)=>({id:f,...C,ref:Jt(y,_=>{_&&m(!0)})}),[f]),E=P.useCallback((C={},y=null)=>({...C,ref:y,"data-focus":Re(S),"data-disabled":Re(o),"data-invalid":Re(r),"data-readonly":Re(i),id:C.id!==void 0?C.id:u,htmlFor:C.htmlFor!==void 0?C.htmlFor:l}),[l,o,S,r,i,u]),T=P.useCallback((C={},y=null)=>({id:c,...C,ref:Jt(y,_=>{_&&h(!0)}),"aria-live":"polite"}),[c]),O=P.useCallback((C={},y=null)=>({...C,...a,ref:y,role:"group"}),[a]),A=P.useCallback((C={},y=null)=>({...C,ref:y,role:"presentation","aria-hidden":!0,children:C.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!i,isDisabled:!!o,isFocused:!!S,onFocus:()=>b(!0),onBlur:()=>b(!1),hasFeedbackText:d,setHasFeedbackText:h,hasHelpText:p,setHasHelpText:m,id:l,labelId:u,feedbackId:c,helpTextId:f,htmlProps:a,getHelpTextProps:g,getErrorMessageProps:T,getRootProps:O,getLabelProps:E,getRequiredIndicatorProps:A}}var Jn=de(function(t,n){const r=Dr("Form",t),o=Rt(t),{getRootProps:i,htmlProps:a,...s}=IZ(o),l=_e("chakra-form-control",t.className);return w.jsx(TZ,{value:s,children:w.jsx(PZ,{value:r,children:w.jsx(ne.div,{...i({},n),className:l,__css:r.container})})})});Jn.displayName="FormControl";var as=de(function(t,n){const r=hd(),o=GI(),i=_e("chakra-form__helper-text",t.className);return w.jsx(ne.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:i})});as.displayName="FormHelperText";var In=de(function(t,n){var r;const o=Co("FormLabel",t),i=Rt(t),{className:a,children:s,requiredIndicator:l=w.jsx(KI,{}),optionalIndicator:u=null,...c}=i,f=hd(),d=(r=f==null?void 0:f.getLabelProps(c,n))!=null?r:{ref:n,...c};return w.jsxs(ne.label,{...d,className:_e("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...o},children:[s,f!=null&&f.isRequired?l:u]})});In.displayName="FormLabel";var KI=de(function(t,n){const r=hd(),o=GI();if(!(r!=null&&r.isRequired))return null;const i=_e("chakra-form__required-indicator",t.className);return w.jsx(ne.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:i})});KI.displayName="RequiredIndicator";function XI(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...i}=qI(e);return{...i,disabled:t,readOnly:r,required:o,"aria-invalid":Jl(n),"aria-required":Jl(o),"aria-readonly":Jl(r)}}function qI(e){var t,n,r;const o=hd(),{id:i,disabled:a,readOnly:s,required:l,isRequired:u,isInvalid:c,isReadOnly:f,isDisabled:d,onFocus:h,onBlur:p,...m}=e,S=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&S.push(o.feedbackId),o!=null&&o.hasHelpText&&S.push(o.helpTextId),{...m,"aria-describedby":S.join(" ")||void 0,id:i??(o==null?void 0:o.id),isDisabled:(t=a??d)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=s??f)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=l??u)!=null?r:o==null?void 0:o.isRequired,isInvalid:c??(o==null?void 0:o.isInvalid),onFocus:ke(o==null?void 0:o.onFocus,h),onBlur:ke(o==null?void 0:o.onBlur,p)}}var RZ={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};const kZ=()=>typeof document<"u";let kx=!1,pd=null,zs=!1,V2=!1;const U2=new Set;function MS(e,t){U2.forEach(n=>n(e,t))}const MZ=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function DZ(e){return!(e.metaKey||!MZ&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Mx(e){zs=!0,DZ(e)&&(pd="keyboard",MS("keyboard",e))}function ll(e){if(pd="pointer",e.type==="mousedown"||e.type==="pointerdown"){zs=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;MS("pointer",e)}}function LZ(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function NZ(e){LZ(e)&&(zs=!0,pd="virtual")}function BZ(e){e.target===window||e.target===document||(!zs&&!V2&&(pd="virtual",MS("virtual",e)),zs=!1,V2=!1)}function jZ(){zs=!1,V2=!0}function Dx(){return pd!=="pointer"}function FZ(){if(!kZ()||kx)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){zs=!0,e.apply(this,n)},document.addEventListener("keydown",Mx,!0),document.addEventListener("keyup",Mx,!0),document.addEventListener("click",NZ,!0),window.addEventListener("focus",BZ,!0),window.addEventListener("blur",jZ,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",ll,!0),document.addEventListener("pointermove",ll,!0),document.addEventListener("pointerup",ll,!0)):(document.addEventListener("mousedown",ll,!0),document.addEventListener("mousemove",ll,!0),document.addEventListener("mouseup",ll,!0)),kx=!0}function YI(e){FZ(),e(Dx());const t=()=>e(Dx());return U2.add(t),()=>{U2.delete(t)}}function $Z(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function ZI(e={}){const t=qI(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:i,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:c,isChecked:f,isFocusable:d,onChange:h,isIndeterminate:p,name:m,value:S,tabIndex:b=void 0,"aria-label":g,"aria-labelledby":E,"aria-invalid":T,...O}=e,A=$Z(O,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),C=Ca(h),y=Ca(s),_=Ca(l),[v,x]=P.useState(!1),[I,R]=P.useState(!1),[k,M]=P.useState(!1),[N,D]=P.useState(!1);P.useEffect(()=>YI(x),[]);const L=P.useRef(null),[j,F]=P.useState(!0),[B,V]=P.useState(!!c),K=f!==void 0,W=K?f:B,Q=P.useCallback(ie=>{if(r||n){ie.preventDefault();return}K||V(W?ie.target.checked:p?!0:ie.target.checked),C==null||C(ie)},[r,n,W,K,p,C]);si(()=>{L.current&&(L.current.indeterminate=!!p)},[p]),$s(()=>{n&&R(!1)},[n,R]),si(()=>{const ie=L.current;if(!(ie!=null&&ie.form))return;const Ce=()=>{V(!!c)};return ie.form.addEventListener("reset",Ce),()=>{var Be;return(Be=ie.form)==null?void 0:Be.removeEventListener("reset",Ce)}},[]);const X=n&&!d,J=P.useCallback(ie=>{ie.key===" "&&D(!0)},[D]),te=P.useCallback(ie=>{ie.key===" "&&D(!1)},[D]);si(()=>{if(!L.current)return;L.current.checked!==W&&V(L.current.checked)},[L.current]);const le=P.useCallback((ie={},Ce=null)=>{const Be=Ue=>{I&&Ue.preventDefault(),D(!0)};return{...ie,ref:Ce,"data-active":Re(N),"data-hover":Re(k),"data-checked":Re(W),"data-focus":Re(I),"data-focus-visible":Re(I&&v),"data-indeterminate":Re(p),"data-disabled":Re(n),"data-invalid":Re(i),"data-readonly":Re(r),"aria-hidden":!0,onMouseDown:ke(ie.onMouseDown,Be),onMouseUp:ke(ie.onMouseUp,()=>D(!1)),onMouseEnter:ke(ie.onMouseEnter,()=>M(!0)),onMouseLeave:ke(ie.onMouseLeave,()=>M(!1))}},[N,W,n,I,v,k,p,i,r]),ge=P.useCallback((ie={},Ce=null)=>({...ie,ref:Ce,"data-active":Re(N),"data-hover":Re(k),"data-checked":Re(W),"data-focus":Re(I),"data-focus-visible":Re(I&&v),"data-indeterminate":Re(p),"data-disabled":Re(n),"data-invalid":Re(i),"data-readonly":Re(r)}),[N,W,n,I,v,k,p,i,r]),se=P.useCallback((ie={},Ce=null)=>({...A,...ie,ref:Jt(Ce,Be=>{Be&&F(Be.tagName==="LABEL")}),onClick:ke(ie.onClick,()=>{var Be;j||((Be=L.current)==null||Be.click(),requestAnimationFrame(()=>{var Ue;(Ue=L.current)==null||Ue.focus({preventScroll:!0})}))}),"data-disabled":Re(n),"data-checked":Re(W),"data-invalid":Re(i)}),[A,n,W,i,j]),ue=P.useCallback((ie={},Ce=null)=>({...ie,ref:Jt(L,Ce),type:"checkbox",name:m,value:S,id:a,tabIndex:b,onChange:ke(ie.onChange,Q),onBlur:ke(ie.onBlur,y,()=>R(!1)),onFocus:ke(ie.onFocus,_,()=>R(!0)),onKeyDown:ke(ie.onKeyDown,J),onKeyUp:ke(ie.onKeyUp,te),required:o,checked:W,disabled:X,readOnly:r,"aria-label":g,"aria-labelledby":E,"aria-invalid":T?!!T:i,"aria-describedby":u,"aria-disabled":n,style:RZ}),[m,S,a,Q,y,_,J,te,o,W,X,r,g,E,T,i,u,n,b]),Ie=P.useCallback((ie={},Ce=null)=>({...ie,ref:Ce,onMouseDown:ke(ie.onMouseDown,zZ),"data-disabled":Re(n),"data-checked":Re(W),"data-invalid":Re(i)}),[W,n,i]);return{state:{isInvalid:i,isFocused:I,isChecked:W,isActive:N,isHovered:k,isIndeterminate:p,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:se,getCheckboxProps:le,getIndicatorProps:ge,getInputProps:ue,getLabelProps:Ie,htmlProps:A}}function zZ(e){e.preventDefault(),e.stopPropagation()}var VZ={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},UZ={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},HZ=pi({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),WZ=pi({from:{opacity:0},to:{opacity:1}}),GZ=pi({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),QI=de(function(t,n){const r=EZ(),o={...r,...t},i=Dr("Checkbox",o),a=Rt(t),{spacing:s="0.5rem",className:l,children:u,iconColor:c,iconSize:f,icon:d=w.jsx(AZ,{}),isChecked:h,isDisabled:p=r==null?void 0:r.isDisabled,onChange:m,inputProps:S,...b}=a;let g=h;r!=null&&r.value&&a.value&&(g=r.value.includes(a.value));let E=m;r!=null&&r.onChange&&a.value&&(E=om(r.onChange,m));const{state:T,getInputProps:O,getCheckboxProps:A,getLabelProps:C,getRootProps:y}=ZI({...b,isDisabled:p,isChecked:g,onChange:E}),_=CZ(T.isChecked),v=P.useMemo(()=>({animation:_?T.isIndeterminate?`${WZ} 20ms linear, ${GZ} 200ms linear`:`${HZ} 200ms linear`:void 0,fontSize:f,color:c,...i.icon}),[c,f,_,T.isIndeterminate,i.icon]),x=P.cloneElement(d,{__css:v,isIndeterminate:T.isIndeterminate,isChecked:T.isChecked});return w.jsxs(ne.label,{__css:{...UZ,...i.container},className:_e("chakra-checkbox",l),...y(),children:[w.jsx("input",{className:"chakra-checkbox__input",...O(S,n)}),w.jsx(ne.span,{__css:{...VZ,...i.control},className:"chakra-checkbox__control",...A(),children:x}),u&&w.jsx(ne.span,{className:"chakra-checkbox__label",...C(),__css:{marginStart:s,...i.label},children:u})]})});QI.displayName="Checkbox";function ou(e,t,n,r){const o=Ca(n);return P.useEffect(()=>{const i=typeof e=="function"?e():e??document;if(!(!n||!i))return i.addEventListener(t,o,r),()=>{i.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const i=typeof e=="function"?e():e??document;i==null||i.removeEventListener(t,o,r)}}function KZ(e){return"current"in e}var JI=()=>typeof window<"u";function XZ(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var qZ=e=>JI()&&e.test(navigator.vendor),YZ=e=>JI()&&e.test(XZ()),ZZ=()=>YZ(/mac|iphone|ipad|ipod/i),QZ=()=>ZZ()&&qZ(/apple/i);function JZ(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var i,a;return(a=(i=t.current)==null?void 0:i.ownerDocument)!=null?a:document};ou(o,"pointerdown",i=>{if(!QZ()||!r)return;const a=i.target,l=(n??[t]).some(u=>{const c=KZ(u)?u.current:u;return(c==null?void 0:c.contains(a))||c===a});o().activeElement!==a&&l&&(i.preventDefault(),a.focus())})}function eQ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var e5={exports:{}},tQ="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",nQ=tQ,rQ=nQ;function t5(){}function n5(){}n5.resetWarningCache=t5;var oQ=function(){function e(r,o,i,a,s,l){if(l!==rQ){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:n5,resetWarningCache:t5};return n.PropTypes=n,n};e5.exports=oQ();var iQ=e5.exports,H2="data-focus-lock",r5="data-focus-lock-disabled",aQ="data-no-focus-lock",sQ="data-autofocus-inside",lQ="data-no-autofocus";function uQ(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function cQ(e,t){var n=P.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function o5(e,t){return cQ(t||null,function(n){return e.forEach(function(r){return uQ(r,n)})})}var fg={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},ri=function(){return ri=Object.assign||function(t){for(var n,r=1,o=arguments.length;r=0}).sort(PQ)},TQ=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],BS=TQ.join(","),IQ="".concat(BS,", [data-focus-guard]"),_5=function(e,t){return mi((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?IQ:BS)?[r]:[],_5(r))},[])},RQ=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?vm([e.contentDocument.body],t):[e]},vm=function(e,t){return e.reduce(function(n,r){var o,i=_5(r,t),a=(o=[]).concat.apply(o,i.map(function(s){return RQ(s,t)}));return n.concat(a,r.parentNode?mi(r.parentNode.querySelectorAll(BS)).filter(function(s){return s===r}):[])},[])},kQ=function(e){var t=e.querySelectorAll("[".concat(sQ,"]"));return mi(t).map(function(n){return vm([n])}).reduce(function(n,r){return n.concat(r)},[])},jS=function(e,t){return mi(e).filter(function(n){return y5(t,n)}).filter(function(n){return xQ(n)})},Lx=function(e,t){return t===void 0&&(t=new Map),mi(e).filter(function(n){return g5(t,n)})},G2=function(e,t,n){return S5(jS(vm(e,n),t),!0,n)},Nx=function(e,t){return S5(jS(vm(e),t),!1)},MQ=function(e,t){return jS(kQ(e),t)},iu=function(e,t){return e.shadowRoot?iu(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:mi(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?iu(o,t):!1}return iu(n,t)})},DQ=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},E5=function(e){return e.parentNode?E5(e.parentNode):e},FS=function(e){var t=a1(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(H2);return n.push.apply(n,o?DQ(mi(E5(r).querySelectorAll("[".concat(H2,'="').concat(o,'"]:not([').concat(r5,'="disabled"])')))):[r]),n},[])},LQ=function(e){try{return e()}catch{return}},Nf=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Nf(t.shadowRoot):t instanceof HTMLIFrameElement&&LQ(function(){return t.contentWindow.document})?Nf(t.contentWindow.document):t}},NQ=function(e,t){return e===t},BQ=function(e,t){return!!mi(e.querySelectorAll("iframe")).some(function(n){return NQ(n,t)})},C5=function(e,t){return t===void 0&&(t=Nf(h5(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:FS(e).some(function(n){return iu(n,t)||BQ(n,t)})},jQ=function(e){e===void 0&&(e=document);var t=Nf(e);return t?mi(e.querySelectorAll("[".concat(aQ,"]"))).some(function(n){return iu(n,t)}):!1},FQ=function(e,t){return t.filter(b5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},$S=function(e,t){return b5(e)&&e.name?FQ(e,t):e},$Q=function(e){var t=new Set;return e.forEach(function(n){return t.add($S(n,e))}),e.filter(function(n){return t.has(n)})},Bx=function(e){return e[0]&&e.length>1?$S(e[0],e):e[0]},jx=function(e,t){return e.length>1?e.indexOf($S(e[t],e)):t},x5="NEW_FOCUS",zQ=function(e,t,n,r){var o=e.length,i=e[0],a=e[o-1],s=NS(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,c=r?e.indexOf(r):-1,f=l-u,d=t.indexOf(i),h=t.indexOf(a),p=$Q(t),m=n!==void 0?p.indexOf(n):-1,S=m-(r?p.indexOf(r):l),b=jx(e,0),g=jx(e,o-1);if(l===-1||c===-1)return x5;if(!f&&c>=0)return c;if(l<=d&&s&&Math.abs(f)>1)return g;if(l>=h&&s&&Math.abs(f)>1)return b;if(f&&Math.abs(S)>1)return c;if(l<=d)return g;if(l>h)return b;if(f)return Math.abs(f)>1?c:(o+c+f)%o}},VQ=function(e){return function(t){var n,r=(n=v5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},UQ=function(e,t,n){var r=e.map(function(i){var a=i.node;return a}),o=Lx(r.filter(VQ(n)));return o&&o.length?Bx(o):Bx(Lx(t))},K2=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&K2(e.parentNode.host||e.parentNode,t),t},dg=function(e,t){for(var n=K2(e),r=K2(t),o=0;o=0)return i}return!1},O5=function(e,t,n){var r=a1(e),o=a1(t),i=r[0],a=!1;return o.filter(Boolean).forEach(function(s){a=dg(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=dg(i,l);u&&(!a||iu(u,a)?a=u:a=dg(u,a))})}),a},HQ=function(e,t){return e.reduce(function(n,r){return n.concat(MQ(r,t))},[])},WQ=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(AQ)},GQ=function(e,t){var n=Nf(a1(e).length>0?document:h5(e).ownerDocument),r=FS(e).filter(s1),o=O5(n||e,e,r),i=new Map,a=Nx(r,i),s=G2(r,i).filter(function(h){var p=h.node;return s1(p)});if(!(!s[0]&&(s=a,!s[0]))){var l=Nx([o],i).map(function(h){var p=h.node;return p}),u=WQ(l,s),c=u.map(function(h){var p=h.node;return p}),f=zQ(c,l,n,t);if(f===x5){var d=UQ(a,c,HQ(r,i));if(d)return{node:d};console.warn("focus-lock: cannot find any node to move focus into");return}return f===void 0?f:u[f]}},KQ=function(e){var t=FS(e).filter(s1),n=O5(e,e,t),r=new Map,o=G2([n],r,!0),i=G2(t,r).filter(function(a){var s=a.node;return s1(s)}).map(function(a){var s=a.node;return s});return o.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:i.indexOf(s)>=0,guard:NS(s)}})},XQ=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},hg=0,pg=!1,A5=function(e,t,n){n===void 0&&(n={});var r=GQ(e,t);if(!pg&&r){if(hg>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),pg=!0,setTimeout(function(){pg=!1},1);return}hg++,XQ(r.node,n.focusOptions),hg--}};function zS(e){setTimeout(e,1)}var qQ=function(){return document&&document.activeElement===document.body},YQ=function(){return qQ()||jQ()},au=null,zl=null,su=null,Bf=!1,ZQ=function(){return!0},QQ=function(t){return(au.whiteList||ZQ)(t)},JQ=function(t,n){su={observerNode:t,portaledElement:n}},eJ=function(t){return su&&su.portaledElement===t};function Fx(e,t,n,r){var o=null,i=e;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else if(a.lockItem){if(i!==e)return;o=null}else break}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var tJ=function(t){return t&&"current"in t?t.current:t},nJ=function(t){return t?!!Bf:Bf==="meanwhile"},rJ=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},oJ=function(t,n){return n.some(function(r){return rJ(t,r,r)})},l1=function(){var t=!1;if(au){var n=au,r=n.observed,o=n.persistentFocus,i=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||su&&su.portaledElement,c=document&&document.activeElement;if(u){var f=[u].concat(a.map(tJ).filter(Boolean));if((!c||QQ(c))&&(o||nJ(s)||!YQ()||!zl&&i)&&(u&&!(C5(f)||c&&oJ(c,f)||eJ(c))&&(document&&!zl&&c&&!i?(c.blur&&c.blur(),document.body.focus()):(t=A5(f,zl,{focusOptions:l}),su={})),Bf=!1,zl=document&&document.activeElement),document){var d=document&&document.activeElement,h=KQ(f),p=h.map(function(m){var S=m.node;return S}).indexOf(d);p>-1&&(h.filter(function(m){var S=m.guard,b=m.node;return S&&b.dataset.focusAutoGuard}).forEach(function(m){var S=m.node;return S.removeAttribute("tabIndex")}),Fx(p,h.length,1,h),Fx(p,-1,-1,h))}}}return t},P5=function(t){l1()&&t&&(t.stopPropagation(),t.preventDefault())},VS=function(){return zS(l1)},iJ=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||JQ(r,n)},aJ=function(){return null},T5=function(){Bf="just",zS(function(){Bf="meanwhile"})},sJ=function(){document.addEventListener("focusin",P5),document.addEventListener("focusout",VS),window.addEventListener("blur",T5)},lJ=function(){document.removeEventListener("focusin",P5),document.removeEventListener("focusout",VS),window.removeEventListener("blur",T5)};function uJ(e){return e.filter(function(t){var n=t.disabled;return!n})}function cJ(e){var t=e.slice(-1)[0];t&&!au&&sJ();var n=au,r=n&&t&&t.id===n.id;au=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var i=o.id;return i===n.id}).length||n.returnFocus(!t)),t?(zl=null,(!r||n.observed!==t.observed)&&t.onActivation(),l1(),zS(l1)):(lJ(),zl=null)}c5.assignSyncMedium(iJ);f5.assignMedium(VS);hQ.assignMedium(function(e){return e({moveFocusInside:A5,focusInside:C5})});const fJ=bQ(uJ,cJ)(aJ);var I5=P.forwardRef(function(t,n){return P.createElement(d5,Ds({sideCar:fJ,ref:n},t))}),R5=d5.propTypes||{};R5.sideCar;eQ(R5,["sideCar"]);I5.propTypes={};const $x=I5;function k5(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function US(e){var t;if(!k5(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function dJ(e){var t,n;return(n=(t=M5(e))==null?void 0:t.defaultView)!=null?n:window}function M5(e){return k5(e)?e.ownerDocument:document}function hJ(e){return M5(e).activeElement}function pJ(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function mJ(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function D5(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:US(e)&&pJ(e)?e:D5(mJ(e))}var L5=e=>e.hasAttribute("tabindex"),yJ=e=>L5(e)&&e.tabIndex===-1;function gJ(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function N5(e){return e.parentElement&&N5(e.parentElement)?!0:e.hidden}function vJ(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function B5(e){if(!US(e)||N5(e)||gJ(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():vJ(e)?!0:L5(e)}function wJ(e){return e?US(e)&&B5(e)&&!yJ(e):!1}var bJ=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],SJ=bJ.join(),_J=e=>e.offsetWidth>0&&e.offsetHeight>0;function j5(e){const t=Array.from(e.querySelectorAll(SJ));return t.unshift(e),t.filter(n=>B5(n)&&_J(n))}var zx,EJ=(zx=$x.default)!=null?zx:$x,F5=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:i,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,c=P.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&j5(r.current).length===0&&requestAnimationFrame(()=>{var p;(p=r.current)==null||p.focus()})},[t,r]),f=P.useCallback(()=>{var h;(h=n==null?void 0:n.current)==null||h.focus()},[n]),d=o&&!n;return w.jsx(EJ,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:c,onDeactivation:f,returnFocus:d,children:i})};F5.displayName="FocusLock";var CJ=PW?P.useLayoutEffect:P.useEffect;function Vx(e,t=[]){const n=P.useRef(e);return CJ(()=>{n.current=e}),P.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function xJ(e,t){const n=P.useId();return P.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function OJ(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function jn(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=Vx(n),a=Vx(t),[s,l]=P.useState(e.defaultIsOpen||!1),[u,c]=OJ(r,s),f=xJ(o,"disclosure"),d=P.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),h=P.useCallback(()=>{u||l(!0),i==null||i()},[u,i]),p=P.useCallback(()=>{(c?d:h)()},[c,h,d]);return{isOpen:!!c,onOpen:h,onClose:d,onToggle:p,isControlled:u,getButtonProps:(m={})=>({...m,"aria-expanded":c,"aria-controls":f,onClick:MW(m.onClick,p)}),getDisclosureProps:(m={})=>({...m,hidden:!c,id:f})}}var[AJ,PJ]=tn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),$5=de(function(t,n){const r=Dr("Input",t),{children:o,className:i,...a}=Rt(t),s=_e("chakra-input__group",i),l={},u=WI(o),c=r.field;u.forEach(d=>{var h,p;r&&(c&&d.type.id==="InputLeftElement"&&(l.paddingStart=(h=c.height)!=null?h:c.h),c&&d.type.id==="InputRightElement"&&(l.paddingEnd=(p=c.height)!=null?p:c.h),d.type.id==="InputRightAddon"&&(l.borderEndRadius=0),d.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const f=u.map(d=>{var h,p;const m=aT({size:((h=d.props)==null?void 0:h.size)||t.size,variant:((p=d.props)==null?void 0:p.variant)||t.variant});return d.type.id!=="Input"?P.cloneElement(d,m):P.cloneElement(d,Object.assign(m,l,d.props))});return w.jsx(ne.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...a,children:w.jsx(AJ,{value:r,children:f})})});$5.displayName="InputGroup";var TJ={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},IJ=ne("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),HS=de(function(t,n){var r;const{placement:o="left",...i}=t,a=(r=TJ[o])!=null?r:{},s=PJ();return w.jsx(IJ,{ref:n,...i,__css:{...s.addon,...a}})});HS.displayName="InputAddon";var WS=de(function(t,n){return w.jsx(HS,{ref:n,placement:"left",...t,className:_e("chakra-input__left-addon",t.className)})});WS.displayName="InputLeftAddon";WS.id="InputLeftAddon";var z5=de(function(t,n){return w.jsx(HS,{ref:n,placement:"right",...t,className:_e("chakra-input__right-addon",t.className)})});z5.displayName="InputRightAddon";z5.id="InputRightAddon";var Lt=de(function(t,n){const{htmlSize:r,...o}=t,i=Dr("Input",o),a=Rt(o),s=XI(a),l=_e("chakra-input",t.className);return w.jsx(ne.input,{size:r,...s,__css:i.field,ref:n,className:l})});Lt.displayName="Input";Lt.id="Input";var vn=de(function(t,n){const r=Co("Link",t),{className:o,isExternal:i,...a}=Rt(t);return w.jsx(ne.a,{target:i?"_blank":void 0,rel:i?"noopener":void 0,ref:n,className:_e("chakra-link",o),...a,__css:r})});vn.displayName="Link";var zu=de(function(t,n){const{templateAreas:r,gap:o,rowGap:i,columnGap:a,column:s,row:l,autoFlow:u,autoRows:c,templateRows:f,autoColumns:d,templateColumns:h,...p}=t,m={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:i,gridColumnGap:a,gridAutoColumns:d,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:c,gridTemplateRows:f,gridTemplateColumns:h};return w.jsx(ne.div,{ref:n,__css:m,...p})});zu.displayName="Grid";function V5(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):_r(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Zs=ne("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Zs.displayName="Spacer";var pe=de(function(t,n){const r=Co("Text",t),{className:o,align:i,decoration:a,casing:s,...l}=Rt(t),u=aT({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return w.jsx(ne.p,{ref:n,className:_e("chakra-text",t.className),...u,...l,__css:r})});pe.displayName="Text";var U5=e=>w.jsx(ne.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});U5.displayName="StackItem";function RJ(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":V5(n,o=>r[o])}}var wm=de((e,t)=>{const{isInline:n,direction:r,align:o,justify:i,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:c,shouldWrapChildren:f,...d}=e,h=n?"row":r??"column",p=P.useMemo(()=>RJ({spacing:a,direction:h}),[a,h]),m=!!u,S=!f&&!m,b=P.useMemo(()=>{const E=WI(l);return S?E:E.map((T,O)=>{const A=typeof T.key<"u"?T.key:O,C=O+1===E.length,_=f?w.jsx(U5,{children:T},A):T;if(!m)return _;const v=P.cloneElement(u,{__css:p}),x=C?null:v;return w.jsxs(P.Fragment,{children:[_,x]},A)})},[u,p,m,S,f,l]),g=_e("chakra-stack",c);return w.jsx(ne.div,{ref:t,display:"flex",alignItems:o,justifyContent:i,flexDirection:h,flexWrap:s,gap:m?void 0:a,className:g,...d,children:b})});wm.displayName="Stack";var Aa=de((e,t)=>w.jsx(wm,{align:"center",...e,direction:"column",ref:t}));Aa.displayName="VStack";var ft=de((e,t)=>w.jsx(wm,{align:"center",...e,direction:"row",ref:t}));ft.displayName="HStack";var Fo=de(function(t,n){const r=Co("Heading",t),{className:o,...i}=Rt(t);return w.jsx(ne.h2,{ref:n,className:_e("chakra-heading",t.className),...i,__css:r})});Fo.displayName="Heading";var ve=ne("div");ve.displayName="Box";var H5=de(function(t,n){const{size:r,centerContent:o=!0,...i}=t,a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return w.jsx(ve,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...i})});H5.displayName="Square";var kJ=de(function(t,n){const{size:r,...o}=t;return w.jsx(H5,{size:r,ref:n,borderRadius:"9999px",...o})});kJ.displayName="Circle";var W5=de(function(e,t){const{ratio:n=4/3,children:r,className:o,...i}=e,a=P.Children.only(r),s=_e("chakra-aspect-ratio",o);return w.jsx(ne.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:V5(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...i,children:a})});W5.displayName="AspectRatio";var G5=de(function(t,n){const{className:r,centerContent:o,...i}=Rt(t),a=Co("Container",t);return w.jsx(ne.div,{ref:n,className:_e("chakra-container",r),...i,__css:{...a,...o&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});G5.displayName="Container";var X2=de(function(t,n){const{direction:r,align:o,justify:i,wrap:a,basis:s,grow:l,shrink:u,...c}=t,f={display:"flex",flexDirection:r,alignItems:o,justifyContent:i,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return w.jsx(ne.div,{ref:n,__css:f,...c})});X2.displayName="Flex";function MJ(e,t={}){const{ssr:n=!0,fallback:r}=t,{getWindow:o}=rG(),i=Array.isArray(e)?e:[e];let a=Array.isArray(r)?r:[r];a=a.filter(u=>u!=null);const[s,l]=P.useState(()=>i.map((u,c)=>({media:u,matches:n?!!a[c]:o().matchMedia(u).matches})));return P.useEffect(()=>{const u=o();l(i.map(d=>({media:d,matches:u.matchMedia(d).matches})));const c=i.map(d=>u.matchMedia(d)),f=d=>{l(h=>h.slice().map(p=>p.media===d.media?{...p,matches:d.matches}:p))};return c.forEach(d=>{typeof d.addListener=="function"?d.addListener(f):d.addEventListener("change",f)}),()=>{c.forEach(d=>{typeof d.removeListener=="function"?d.removeListener(f):d.removeEventListener("change",f)})}},[o]),s.map(u=>u.matches)}function DJ(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function LJ(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=P.useState([]),i=P.useRef(),a=()=>{i.current&&(clearTimeout(i.current),i.current=null)},s=()=>{a(),i.current=setTimeout(()=>{o([]),i.current=null},t)};P.useEffect(()=>a,[]);function l(u){return c=>{if(c.key==="Backspace"){const f=[...r];f.pop(),o(f);return}if(DJ(c)){const f=r.concat(c.key);n(c)&&(c.preventDefault(),c.stopPropagation()),o(f),u(f.join("")),s()}}}return l}function NJ(e,t,n,r){if(t==null)return r;if(!r)return e.find(a=>n(a).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(i=>n(i).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let i;return o.includes(r)?(i=o.indexOf(r)+1,i===o.length&&(i=0),o[i]):(i=e.indexOf(o[0]),e[i])}return r}function BJ(){const e=P.useRef(new Map),t=e.current,n=P.useCallback((o,i,a,s)=>{e.current.set(a,{type:i,el:o,options:s}),o.addEventListener(i,a,s)},[]),r=P.useCallback((o,i,a,s)=>{o.removeEventListener(i,a,s),e.current.delete(a)},[]);return P.useEffect(()=>()=>{t.forEach((o,i)=>{r(o.el,o.type,i,o.options)})},[r,t]),{add:n,remove:r}}function mg(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function jJ(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:i=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:c,tabIndex:f,onMouseOver:d,onMouseLeave:h,...p}=e,[m,S]=P.useState(!0),[b,g]=P.useState(!1),E=BJ(),T=D=>{D&&D.tagName!=="BUTTON"&&S(!1)},O=m?f:f||0,A=n&&!r,C=P.useCallback(D=>{if(n){D.stopPropagation(),D.preventDefault();return}D.currentTarget.focus(),l==null||l(D)},[n,l]),y=P.useCallback(D=>{b&&mg(D)&&(D.preventDefault(),D.stopPropagation(),g(!1),E.remove(document,"keyup",y,!1))},[b,E]),_=P.useCallback(D=>{if(u==null||u(D),n||D.defaultPrevented||D.metaKey||!mg(D.nativeEvent)||m)return;const L=o&&D.key==="Enter";i&&D.key===" "&&(D.preventDefault(),g(!0)),L&&(D.preventDefault(),D.currentTarget.click()),E.add(document,"keyup",y,!1)},[n,m,u,o,i,E,y]),v=P.useCallback(D=>{if(c==null||c(D),n||D.defaultPrevented||D.metaKey||!mg(D.nativeEvent)||m)return;i&&D.key===" "&&(D.preventDefault(),g(!1),D.currentTarget.click())},[i,m,n,c]),x=P.useCallback(D=>{D.button===0&&(g(!1),E.remove(document,"mouseup",x,!1))},[E]),I=P.useCallback(D=>{if(D.button!==0)return;if(n){D.stopPropagation(),D.preventDefault();return}m||g(!0),D.currentTarget.focus({preventScroll:!0}),E.add(document,"mouseup",x,!1),a==null||a(D)},[n,m,a,E,x]),R=P.useCallback(D=>{D.button===0&&(m||g(!1),s==null||s(D))},[s,m]),k=P.useCallback(D=>{if(n){D.preventDefault();return}d==null||d(D)},[n,d]),M=P.useCallback(D=>{b&&(D.preventDefault(),g(!1)),h==null||h(D)},[b,h]),N=Jt(t,T);return m?{...p,ref:N,type:"button","aria-disabled":A?void 0:n,disabled:A,onClick:C,onMouseDown:a,onMouseUp:s,onKeyUp:c,onKeyDown:u,onMouseOver:d,onMouseLeave:h}:{...p,ref:N,role:"button","data-active":Re(b),"aria-disabled":n?"true":void 0,tabIndex:A?void 0:O,onClick:C,onMouseDown:I,onMouseUp:R,onKeyUp:v,onKeyDown:_,onMouseOver:k,onMouseLeave:M}}function FJ(e){const t=e.current;if(!t)return!1;const n=hJ(t);return!n||t.contains(n)?!1:!!wJ(n)}function K5(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,i=n&&!r;$s(()=>{if(!i||FJ(e))return;const a=(o==null?void 0:o.current)||e.current;let s;if(a)return s=requestAnimationFrame(()=>{a.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(s)}},[i,e,o])}var $J={preventScroll:!0,shouldFocus:!1};function zJ(e,t=$J){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:i}=t,a=VJ(e)?e.current:e,s=o&&i,l=P.useRef(s),u=P.useRef(i);si(()=>{!u.current&&i&&(l.current=s),u.current=i},[i,s]);const c=P.useCallback(()=>{if(!(!i||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var f;(f=n.current)==null||f.focus({preventScroll:r})});else{const f=j5(a);f.length>0&&requestAnimationFrame(()=>{f[0].focus({preventScroll:r})})}},[i,r,a,n]);$s(()=>{c()},[c]),ou(a,"transitionend",c)}function VJ(e){return"current"in e}var ul=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),on={arrowShadowColor:ul("--popper-arrow-shadow-color"),arrowSize:ul("--popper-arrow-size","8px"),arrowSizeHalf:ul("--popper-arrow-size-half"),arrowBg:ul("--popper-arrow-bg"),transformOrigin:ul("--popper-transform-origin"),arrowOffset:ul("--popper-arrow-offset")};function UJ(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var HJ={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},WJ=e=>HJ[e],Ux={scroll:!0,resize:!0};function GJ(e){let t;return typeof e=="object"?t={enabled:!0,options:{...Ux,...e}}:t={enabled:e,options:Ux},t}var KJ={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},XJ={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{Hx(e)},effect:({state:e})=>()=>{Hx(e)}},Hx=e=>{e.elements.popper.style.setProperty(on.transformOrigin.var,WJ(e.placement))},qJ={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{YJ(e)}},YJ=e=>{var t;if(!e.placement)return;const n=ZJ(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:on.arrowSize.varRef,height:on.arrowSize.varRef,zIndex:-1});const r={[on.arrowSizeHalf.var]:`calc(${on.arrowSize.varRef} / 2 - 1px)`,[on.arrowOffset.var]:`calc(${on.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},ZJ=e=>{if(e.startsWith("top"))return{property:"bottom",value:on.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:on.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:on.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:on.arrowOffset.varRef}},QJ={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{Wx(e)},effect:({state:e})=>()=>{Wx(e)}},Wx=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=UJ(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:on.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},JJ={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},eee={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function tee(e,t="ltr"){var n,r;const o=((n=JJ[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=eee[e])!=null?r:o}var Er="top",_o="bottom",Eo="right",Cr="left",GS="auto",md=[Er,_o,Eo,Cr],Eu="start",jf="end",nee="clippingParents",X5="viewport",cc="popper",ree="reference",Gx=md.reduce(function(e,t){return e.concat([t+"-"+Eu,t+"-"+jf])},[]),q5=[].concat(md,[GS]).reduce(function(e,t){return e.concat([t,t+"-"+Eu,t+"-"+jf])},[]),oee="beforeRead",iee="read",aee="afterRead",see="beforeMain",lee="main",uee="afterMain",cee="beforeWrite",fee="write",dee="afterWrite",hee=[oee,iee,aee,see,lee,uee,cee,fee,dee];function hi(e){return e?(e.nodeName||"").toLowerCase():null}function Qr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Vs(e){var t=Qr(e).Element;return e instanceof t||e instanceof Element}function wo(e){var t=Qr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function KS(e){if(typeof ShadowRoot>"u")return!1;var t=Qr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function pee(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!wo(i)||!hi(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function mee(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!wo(o)||!hi(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const yee={name:"applyStyles",enabled:!0,phase:"write",fn:pee,effect:mee,requires:["computeStyles"]};function di(e){return e.split("-")[0]}var Is=Math.max,u1=Math.min,Cu=Math.round;function q2(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Y5(){return!/^((?!chrome|android).)*safari/i.test(q2())}function xu(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&wo(e)&&(o=e.offsetWidth>0&&Cu(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Cu(r.height)/e.offsetHeight||1);var a=Vs(e)?Qr(e):window,s=a.visualViewport,l=!Y5()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/o,c=(r.top+(l&&s?s.offsetTop:0))/i,f=r.width/o,d=r.height/i;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function XS(e){var t=xu(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Z5(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&KS(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function $i(e){return Qr(e).getComputedStyle(e)}function gee(e){return["table","td","th"].indexOf(hi(e))>=0}function $a(e){return((Vs(e)?e.ownerDocument:e.document)||window.document).documentElement}function bm(e){return hi(e)==="html"?e:e.assignedSlot||e.parentNode||(KS(e)?e.host:null)||$a(e)}function Kx(e){return!wo(e)||$i(e).position==="fixed"?null:e.offsetParent}function vee(e){var t=/firefox/i.test(q2()),n=/Trident/i.test(q2());if(n&&wo(e)){var r=$i(e);if(r.position==="fixed")return null}var o=bm(e);for(KS(o)&&(o=o.host);wo(o)&&["html","body"].indexOf(hi(o))<0;){var i=$i(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function yd(e){for(var t=Qr(e),n=Kx(e);n&&gee(n)&&$i(n).position==="static";)n=Kx(n);return n&&(hi(n)==="html"||hi(n)==="body"&&$i(n).position==="static")?t:n||vee(e)||t}function qS(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Zc(e,t,n){return Is(e,u1(t,n))}function wee(e,t,n){var r=Zc(e,t,n);return r>n?n:r}function Q5(){return{top:0,right:0,bottom:0,left:0}}function J5(e){return Object.assign({},Q5(),e)}function eR(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var bee=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,J5(typeof t!="number"?t:eR(t,md))};function See(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=di(n.placement),l=qS(s),u=[Cr,Eo].indexOf(s)>=0,c=u?"height":"width";if(!(!i||!a)){var f=bee(o.padding,n),d=XS(i),h=l==="y"?Er:Cr,p=l==="y"?_o:Eo,m=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],S=a[l]-n.rects.reference[l],b=yd(i),g=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,E=m/2-S/2,T=f[h],O=g-d[c]-f[p],A=g/2-d[c]/2+E,C=Zc(T,A,O),y=l;n.modifiersData[r]=(t={},t[y]=C,t.centerOffset=C-A,t)}}function _ee(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||Z5(t.elements.popper,o)&&(t.elements.arrow=o))}const Eee={name:"arrow",enabled:!0,phase:"main",fn:See,effect:_ee,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ou(e){return e.split("-")[1]}var Cee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xee(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Cu(n*o)/o||0,y:Cu(r*o)/o||0}}function Xx(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,d=a.x,h=d===void 0?0:d,p=a.y,m=p===void 0?0:p,S=typeof c=="function"?c({x:h,y:m}):{x:h,y:m};h=S.x,m=S.y;var b=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),E=Cr,T=Er,O=window;if(u){var A=yd(n),C="clientHeight",y="clientWidth";if(A===Qr(n)&&(A=$a(n),$i(A).position!=="static"&&s==="absolute"&&(C="scrollHeight",y="scrollWidth")),A=A,o===Er||(o===Cr||o===Eo)&&i===jf){T=_o;var _=f&&A===O&&O.visualViewport?O.visualViewport.height:A[C];m-=_-r.height,m*=l?1:-1}if(o===Cr||(o===Er||o===_o)&&i===jf){E=Eo;var v=f&&A===O&&O.visualViewport?O.visualViewport.width:A[y];h-=v-r.width,h*=l?1:-1}}var x=Object.assign({position:s},u&&Cee),I=c===!0?xee({x:h,y:m},Qr(n)):{x:h,y:m};if(h=I.x,m=I.y,l){var R;return Object.assign({},x,(R={},R[T]=g?"0":"",R[E]=b?"0":"",R.transform=(O.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",R))}return Object.assign({},x,(t={},t[T]=g?m+"px":"",t[E]=b?h+"px":"",t.transform="",t))}function Oee(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:di(t.placement),variation:Ou(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Xx(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Xx(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Aee={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Oee,data:{}};var yh={passive:!0};function Pee(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,s=a===void 0?!0:a,l=Qr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",n.update,yh)}),s&&l.addEventListener("resize",n.update,yh),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",n.update,yh)}),s&&l.removeEventListener("resize",n.update,yh)}}const Tee={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Pee,data:{}};var Iee={left:"right",right:"left",bottom:"top",top:"bottom"};function ap(e){return e.replace(/left|right|bottom|top/g,function(t){return Iee[t]})}var Ree={start:"end",end:"start"};function qx(e){return e.replace(/start|end/g,function(t){return Ree[t]})}function YS(e){var t=Qr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ZS(e){return xu($a(e)).left+YS(e).scrollLeft}function kee(e,t){var n=Qr(e),r=$a(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var u=Y5();(u||!u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+ZS(e),y:l}}function Mee(e){var t,n=$a(e),r=YS(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Is(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Is(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+ZS(e),l=-r.scrollTop;return $i(o||n).direction==="rtl"&&(s+=Is(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}function QS(e){var t=$i(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function tR(e){return["html","body","#document"].indexOf(hi(e))>=0?e.ownerDocument.body:wo(e)&&QS(e)?e:tR(bm(e))}function Qc(e,t){var n;t===void 0&&(t=[]);var r=tR(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=Qr(r),a=o?[i].concat(i.visualViewport||[],QS(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Qc(bm(a)))}function Y2(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Dee(e,t){var n=xu(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Yx(e,t,n){return t===X5?Y2(kee(e,n)):Vs(t)?Dee(t,n):Y2(Mee($a(e)))}function Lee(e){var t=Qc(bm(e)),n=["absolute","fixed"].indexOf($i(e).position)>=0,r=n&&wo(e)?yd(e):e;return Vs(r)?t.filter(function(o){return Vs(o)&&Z5(o,r)&&hi(o)!=="body"}):[]}function Nee(e,t,n,r){var o=t==="clippingParents"?Lee(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(l,u){var c=Yx(e,u,r);return l.top=Is(c.top,l.top),l.right=u1(c.right,l.right),l.bottom=u1(c.bottom,l.bottom),l.left=Is(c.left,l.left),l},Yx(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function nR(e){var t=e.reference,n=e.element,r=e.placement,o=r?di(r):null,i=r?Ou(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(o){case Er:l={x:a,y:t.y-n.height};break;case _o:l={x:a,y:t.y+t.height};break;case Eo:l={x:t.x+t.width,y:s};break;case Cr:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=o?qS(o):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case Eu:l[u]=l[u]-(t[c]/2-n[c]/2);break;case jf:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Ff(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,l=s===void 0?nee:s,u=n.rootBoundary,c=u===void 0?X5:u,f=n.elementContext,d=f===void 0?cc:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,S=m===void 0?0:m,b=J5(typeof S!="number"?S:eR(S,md)),g=d===cc?ree:cc,E=e.rects.popper,T=e.elements[p?g:d],O=Nee(Vs(T)?T:T.contextElement||$a(e.elements.popper),l,c,a),A=xu(e.elements.reference),C=nR({reference:A,element:E,strategy:"absolute",placement:o}),y=Y2(Object.assign({},E,C)),_=d===cc?y:A,v={top:O.top-_.top+b.top,bottom:_.bottom-O.bottom+b.bottom,left:O.left-_.left+b.left,right:_.right-O.right+b.right},x=e.modifiersData.offset;if(d===cc&&x){var I=x[o];Object.keys(v).forEach(function(R){var k=[Eo,_o].indexOf(R)>=0?1:-1,M=[Er,_o].indexOf(R)>=0?"y":"x";v[R]+=I[M]*k})}return v}function Bee(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?q5:l,c=Ou(r),f=c?s?Gx:Gx.filter(function(p){return Ou(p)===c}):md,d=f.filter(function(p){return u.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=Ff(e,{placement:m,boundary:o,rootBoundary:i,padding:a})[di(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function jee(e){if(di(e)===GS)return[];var t=ap(e);return[qx(e),t,qx(t)]}function Fee(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,S=t.options.placement,b=di(S),g=b===S,E=l||(g||!p?[ap(S)]:jee(S)),T=[S].concat(E).reduce(function(W,Q){return W.concat(di(Q)===GS?Bee(t,{placement:Q,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:m}):Q)},[]),O=t.rects.reference,A=t.rects.popper,C=new Map,y=!0,_=T[0],v=0;v=0,M=k?"width":"height",N=Ff(t,{placement:x,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),D=k?R?Eo:Cr:R?_o:Er;O[M]>A[M]&&(D=ap(D));var L=ap(D),j=[];if(i&&j.push(N[I]<=0),s&&j.push(N[D]<=0,N[L]<=0),j.every(function(W){return W})){_=x,y=!1;break}C.set(x,j)}if(y)for(var F=p?3:1,B=function(Q){var X=T.find(function(J){var te=C.get(J);if(te)return te.slice(0,Q).every(function(le){return le})});if(X)return _=X,"break"},V=F;V>0;V--){var K=B(V);if(K==="break")break}t.placement!==_&&(t.modifiersData[r]._skip=!0,t.placement=_,t.reset=!0)}}const $ee={name:"flip",enabled:!0,phase:"main",fn:Fee,requiresIfExists:["offset"],data:{_skip:!1}};function Zx(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Qx(e){return[Er,Eo,_o,Cr].some(function(t){return e[t]>=0})}function zee(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Ff(t,{elementContext:"reference"}),s=Ff(t,{altBoundary:!0}),l=Zx(a,r),u=Zx(s,o,i),c=Qx(l),f=Qx(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const Vee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zee};function Uee(e,t,n){var r=di(e),o=[Cr,Er].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[Cr,Eo].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function Hee(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,a=q5.reduce(function(c,f){return c[f]=Uee(f,t.rects,i),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const Wee={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Hee};function Gee(e){var t=e.state,n=e.name;t.modifiersData[n]=nR({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Kee={name:"popperOffsets",enabled:!0,phase:"read",fn:Gee,data:{}};function Xee(e){return e==="x"?"y":"x"}function qee(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,m=p===void 0?0:p,S=Ff(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),b=di(t.placement),g=Ou(t.placement),E=!g,T=qS(b),O=Xee(T),A=t.modifiersData.popperOffsets,C=t.rects.reference,y=t.rects.popper,_=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,v=typeof _=="number"?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),x=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(A){if(i){var R,k=T==="y"?Er:Cr,M=T==="y"?_o:Eo,N=T==="y"?"height":"width",D=A[T],L=D+S[k],j=D-S[M],F=h?-y[N]/2:0,B=g===Eu?C[N]:y[N],V=g===Eu?-y[N]:-C[N],K=t.elements.arrow,W=h&&K?XS(K):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Q5(),X=Q[k],J=Q[M],te=Zc(0,C[N],W[N]),le=E?C[N]/2-F-te-X-v.mainAxis:B-te-X-v.mainAxis,ge=E?-C[N]/2+F+te+J+v.mainAxis:V+te+J+v.mainAxis,se=t.elements.arrow&&yd(t.elements.arrow),ue=se?T==="y"?se.clientTop||0:se.clientLeft||0:0,Ie=(R=x==null?void 0:x[T])!=null?R:0,gt=D+le-Ie-ue,ie=D+ge-Ie,Ce=Zc(h?u1(L,gt):L,D,h?Is(j,ie):j);A[T]=Ce,I[T]=Ce-D}if(s){var Be,Ue=T==="x"?Er:Cr,fr=T==="x"?_o:Eo,Kt=A[O],Cn=O==="y"?"height":"width",xn=Kt+S[Ue],Vt=Kt-S[fr],xo=[Er,Cr].indexOf(b)!==-1,Wo=(Be=x==null?void 0:x[O])!=null?Be:0,Ka=xo?xn:Kt-C[Cn]-y[Cn]-Wo+v.altAxis,Xa=xo?Kt+C[Cn]+y[Cn]-Wo-v.altAxis:Vt,Ki=h&&xo?wee(Ka,Kt,Xa):Zc(h?Ka:xn,Kt,h?Xa:Vt);A[O]=Ki,I[O]=Ki-Kt}t.modifiersData[r]=I}}const Yee={name:"preventOverflow",enabled:!0,phase:"main",fn:qee,requiresIfExists:["offset"]};function Zee(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Qee(e){return e===Qr(e)||!wo(e)?YS(e):Zee(e)}function Jee(e){var t=e.getBoundingClientRect(),n=Cu(t.width)/e.offsetWidth||1,r=Cu(t.height)/e.offsetHeight||1;return n!==1||r!==1}function ete(e,t,n){n===void 0&&(n=!1);var r=wo(t),o=wo(t)&&Jee(t),i=$a(t),a=xu(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((hi(t)!=="body"||QS(i))&&(s=Qee(t)),wo(t)?(l=xu(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=ZS(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function tte(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function nte(e){var t=tte(e);return hee.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function rte(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function ote(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Jx={placement:"bottom",modifiers:[],strategy:"absolute"};function e4(){for(var e=arguments.length,t=new Array(e),n=0;n{}),E=P.useCallback(()=>{var v;!t||!p.current||!m.current||((v=g.current)==null||v.call(g),S.current=ste(p.current,m.current,{placement:b,modifiers:[QJ,qJ,XJ,{...KJ,enabled:!!d},{name:"eventListeners",...GJ(a)},{name:"arrow",options:{padding:i}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!f,options:{boundary:c}},...n??[]],strategy:o}),S.current.forceUpdate(),g.current=S.current.destroy)},[b,t,n,d,a,i,s,l,u,f,c,o]);P.useEffect(()=>()=>{var v;!p.current&&!m.current&&((v=S.current)==null||v.destroy(),S.current=null)},[]);const T=P.useCallback(v=>{p.current=v,E()},[E]),O=P.useCallback((v={},x=null)=>({...v,ref:Jt(T,x)}),[T]),A=P.useCallback(v=>{m.current=v,E()},[E]),C=P.useCallback((v={},x=null)=>({...v,ref:Jt(A,x),style:{...v.style,position:o,minWidth:d?void 0:"max-content",inset:"0 auto auto 0"}}),[o,A,d]),y=P.useCallback((v={},x=null)=>{const{size:I,shadowColor:R,bg:k,style:M,...N}=v;return{...N,ref:x,"data-popper-arrow":"",style:lte(v)}},[]),_=P.useCallback((v={},x=null)=>({...v,ref:x,"data-popper-arrow-inner":""}),[]);return{update(){var v;(v=S.current)==null||v.update()},forceUpdate(){var v;(v=S.current)==null||v.forceUpdate()},transformOrigin:on.transformOrigin.varRef,referenceRef:T,popperRef:A,getPopperProps:C,getArrowProps:y,getArrowInnerProps:_,getReferenceProps:O}}function lte(e){const{size:t,shadowColor:n,bg:r,style:o}=e,i={...o,position:"absolute"};return t&&(i["--popper-arrow-size"]=t),n&&(i["--popper-arrow-shadow-color"]=n),r&&(i["--popper-arrow-bg"]=r),i}function e_(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=Ca(n),a=Ca(t),[s,l]=P.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,c=r!==void 0,f=P.useId(),d=o??`disclosure-${f}`,h=P.useCallback(()=>{c||l(!1),a==null||a()},[c,a]),p=P.useCallback(()=>{c||l(!0),i==null||i()},[c,i]),m=P.useCallback(()=>{u?h():p()},[u,p,h]);function S(g={}){return{...g,"aria-expanded":u,"aria-controls":d,onClick(E){var T;(T=g.onClick)==null||T.call(g,E),m()}}}function b(g={}){return{...g,hidden:!u,id:d}}return{isOpen:u,onOpen:p,onClose:h,onToggle:m,isControlled:c,getButtonProps:S,getDisclosureProps:b}}function ute(e){const{ref:t,handler:n,enabled:r=!0}=e,o=Ca(n),a=P.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;P.useEffect(()=>{if(!r)return;const s=f=>{yg(f,t)&&(a.isPointerDown=!0)},l=f=>{if(a.ignoreEmulatedMouseEvents){a.ignoreEmulatedMouseEvents=!1;return}a.isPointerDown&&n&&yg(f,t)&&(a.isPointerDown=!1,o(f))},u=f=>{a.ignoreEmulatedMouseEvents=!0,n&&a.isPointerDown&&yg(f,t)&&(a.isPointerDown=!1,o(f))},c=rR(t.current);return c.addEventListener("mousedown",s,!0),c.addEventListener("mouseup",l,!0),c.addEventListener("touchstart",s,!0),c.addEventListener("touchend",u,!0),()=>{c.removeEventListener("mousedown",s,!0),c.removeEventListener("mouseup",l,!0),c.removeEventListener("touchstart",s,!0),c.removeEventListener("touchend",u,!0)}},[n,t,o,a,r])}function yg(e,t){var n;const r=e.target;return r&&!rR(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function rR(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function oR(e){const{isOpen:t,ref:n}=e,[r,o]=P.useState(t),[i,a]=P.useState(!1);return P.useEffect(()=>{i||(o(t),a(!0))},[t,i,r]),ou(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=dJ(n.current),c=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(c)}}}function iR(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[cte,fte,dte,hte]=eZ(),[pte,gd]=tn({strict:!1,name:"MenuContext"});function mte(e,...t){const n=P.useId(),r=e||n;return P.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function aR(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function t4(e){return aR(e).activeElement===e}function yte(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:i=!0,isLazy:a,isOpen:s,defaultIsOpen:l,onClose:u,onOpen:c,placement:f="bottom-start",lazyBehavior:d="unmount",direction:h,computePositionOnMount:p=!1,...m}=e,S=P.useRef(null),b=P.useRef(null),g=dte(),E=P.useCallback(()=>{requestAnimationFrame(()=>{var K;(K=S.current)==null||K.focus({preventScroll:!1})})},[]),T=P.useCallback(()=>{const K=setTimeout(()=>{var W;if(o)(W=o.current)==null||W.focus();else{const Q=g.firstEnabled();Q&&R(Q.index)}});L.current.add(K)},[g,o]),O=P.useCallback(()=>{const K=setTimeout(()=>{const W=g.lastEnabled();W&&R(W.index)});L.current.add(K)},[g]),A=P.useCallback(()=>{c==null||c(),i?T():E()},[i,T,E,c]),{isOpen:C,onOpen:y,onClose:_,onToggle:v}=e_({isOpen:s,defaultIsOpen:l,onClose:u,onOpen:A});ute({enabled:C&&r,ref:S,handler:K=>{var W;(W=b.current)!=null&&W.contains(K.target)||_()}});const x=JS({...m,enabled:C||p,placement:f,direction:h}),[I,R]=P.useState(-1);$s(()=>{C||R(-1)},[C]),K5(S,{focusRef:b,visible:C,shouldFocus:!0});const k=oR({isOpen:C,ref:S}),[M,N]=mte(t,"menu-button","menu-list"),D=P.useCallback(()=>{y(),E()},[y,E]),L=P.useRef(new Set([]));Ete(()=>{L.current.forEach(K=>clearTimeout(K)),L.current.clear()});const j=P.useCallback(()=>{y(),T()},[T,y]),F=P.useCallback(()=>{y(),O()},[y,O]),B=P.useCallback(()=>{var K,W;const Q=aR(S.current),X=(K=S.current)==null?void 0:K.contains(Q.activeElement);if(!(C&&!X))return;const te=(W=g.item(I))==null?void 0:W.node;te==null||te.focus()},[C,I,g]),V=P.useRef(null);return{openAndFocusMenu:D,openAndFocusFirstItem:j,openAndFocusLastItem:F,onTransitionEnd:B,unstable__animationState:k,descendants:g,popper:x,buttonId:M,menuId:N,forceUpdate:x.forceUpdate,orientation:"vertical",isOpen:C,onToggle:v,onOpen:y,onClose:_,menuRef:S,buttonRef:b,focusedIndex:I,closeOnSelect:n,closeOnBlur:r,autoSelect:i,setFocusedIndex:R,isLazy:a,lazyBehavior:d,initialFocusRef:o,rafId:V}}function gte(e={},t=null){const n=gd(),{onToggle:r,popper:o,openAndFocusFirstItem:i,openAndFocusLastItem:a}=n,s=P.useCallback(l=>{const u=l.key,f={Enter:i,ArrowDown:i,ArrowUp:a}[u];f&&(l.preventDefault(),l.stopPropagation(),f(l))},[i,a]);return{...e,ref:Jt(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":Re(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:ke(e.onClick,r),onKeyDown:ke(e.onKeyDown,s)}}function Z2(e){var t;return Ste(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function vte(e={},t=null){const n=gd();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:r,setFocusedIndex:o,menuRef:i,isOpen:a,onClose:s,menuId:l,isLazy:u,lazyBehavior:c,unstable__animationState:f}=n,d=fte(),h=LJ({preventDefault:b=>b.key!==" "&&Z2(b.target)}),p=P.useCallback(b=>{if(!b.currentTarget.contains(b.target))return;const g=b.key,T={Tab:A=>A.preventDefault(),Escape:s,ArrowDown:()=>{const A=d.nextEnabled(r);A&&o(A.index)},ArrowUp:()=>{const A=d.prevEnabled(r);A&&o(A.index)}}[g];if(T){b.preventDefault(),T(b);return}const O=h(A=>{const C=NJ(d.values(),A,y=>{var _,v;return(v=(_=y==null?void 0:y.node)==null?void 0:_.textContent)!=null?v:""},d.item(r));if(C){const y=d.indexOf(C.node);o(y)}});Z2(b.target)&&O(b)},[d,r,h,s,o]),m=P.useRef(!1);a&&(m.current=!0);const S=iR({wasSelected:m.current,enabled:u,mode:c,isSelected:f.present});return{...e,ref:Jt(i,t),children:S?e.children:null,tabIndex:-1,role:"menu",id:l,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:ke(e.onKeyDown,p)}}function wte(e={}){const{popper:t,isOpen:n}=gd();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function bte(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:i,onFocus:a,isDisabled:s,isFocusable:l,closeOnSelect:u,type:c,...f}=e,d=gd(),{setFocusedIndex:h,focusedIndex:p,closeOnSelect:m,onClose:S,menuRef:b,isOpen:g,menuId:E,rafId:T}=d,O=P.useRef(null),A=`${E}-menuitem-${P.useId()}`,{index:C,register:y}=hte({disabled:s&&!l}),_=P.useCallback(D=>{n==null||n(D),!s&&h(C)},[h,C,s,n]),v=P.useCallback(D=>{r==null||r(D),O.current&&!t4(O.current)&&_(D)},[_,r]),x=P.useCallback(D=>{o==null||o(D),!s&&h(-1)},[h,s,o]),I=P.useCallback(D=>{i==null||i(D),Z2(D.currentTarget)&&(u??m)&&S()},[S,i,m,u]),R=P.useCallback(D=>{a==null||a(D),h(C)},[h,a,C]),k=C===p,M=s&&!l;$s(()=>{g&&(k&&!M&&O.current?(T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame(()=>{var D;(D=O.current)==null||D.focus(),T.current=null})):b.current&&!t4(b.current)&&b.current.focus({preventScroll:!0}))},[k,M,b,g]);const N=jJ({onClick:I,onFocus:R,onMouseEnter:_,onMouseMove:v,onMouseLeave:x,ref:Jt(y,O,t),isDisabled:s,isFocusable:l});return{...f,...N,type:c??N.type,id:A,role:"menuitem",tabIndex:k?0:-1}}function Ste(e){var t;if(!_te(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function _te(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Ete(e,t=[]){return P.useEffect(()=>()=>e(),t)}var[Cte,vd]=tn({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Sm=e=>{const{children:t}=e,n=Dr("Menu",e),r=Rt(e),{direction:o}=od(),{descendants:i,...a}=yte({...r,direction:o}),s=P.useMemo(()=>a,[a]),{isOpen:l,onClose:u,forceUpdate:c}=s;return w.jsx(cte,{value:i,children:w.jsx(pte,{value:s,children:w.jsx(Cte,{value:n,children:mo(t,{isOpen:l,onClose:u,forceUpdate:c})})})})};Sm.displayName="Menu";var sR=de((e,t)=>{const n=vd();return w.jsx(ne.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});sR.displayName="MenuCommand";var xte=de((e,t)=>{const{type:n,...r}=e,o=vd(),i=r.as||n?n??void 0:"button",a=P.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return w.jsx(ne.button,{ref:t,type:i,...r,__css:a})}),lR=e=>{const{className:t,children:n,...r}=e,o=vd(),i=P.Children.only(n),a=P.isValidElement(i)?P.cloneElement(i,{focusable:"false","aria-hidden":!0,className:_e("chakra-menu__icon",i.props.className)}):null,s=_e("chakra-menu__icon-wrapper",t);return w.jsx(ne.span,{className:s,...r,__css:o.icon,children:a})};lR.displayName="MenuIcon";var $r=de((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:i="0.75rem",children:a,...s}=e,l=bte(s,t),c=n||o?w.jsx("span",{style:{pointerEvents:"none",flex:1},children:a}):a;return w.jsxs(xte,{...l,className:_e("chakra-menu__menuitem",l.className),children:[n&&w.jsx(lR,{fontSize:"0.8em",marginEnd:r,children:n}),c,o&&w.jsx(sR,{marginStart:i,children:o})]})});$r.displayName="MenuItem";var Ote={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},Ate=ne(Hi.div),_m=de(function(t,n){var r,o;const{rootProps:i,motionProps:a,...s}=t,{isOpen:l,onTransitionEnd:u,unstable__animationState:c}=gd(),f=vte(s,n),d=wte(i),h=vd();return w.jsx(ne.div,{...d,__css:{zIndex:(o=t.zIndex)!=null?o:(r=h.list)==null?void 0:r.zIndex},children:w.jsx(Ate,{variants:Ote,initial:!1,animate:l?"enter":"exit",__css:{outline:0,...h.list},...a,className:_e("chakra-menu__menu-list",f.className),...f,onUpdate:u,onAnimationComplete:om(c.onComplete,f.onAnimationComplete)})})});_m.displayName="MenuList";var Pte=de((e,t)=>{const n=vd();return w.jsx(ne.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Em=de((e,t)=>{const{children:n,as:r,...o}=e,i=gte(o,t),a=r||Pte;return w.jsx(a,{...i,className:_e("chakra-menu__menu-button",e.className),children:w.jsx(ne.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Em.displayName="MenuButton";var Tte={slideInBottom:{...j2,custom:{offsetY:16,reverse:!0}},slideInRight:{...j2,custom:{offsetX:16,reverse:!0}},scale:{...$I,custom:{initialScale:.95,reverse:!0}},none:{}},Ite=ne(Hi.section),Rte=e=>Tte[e||"none"],uR=P.forwardRef((e,t)=>{const{preset:n,motionProps:r=Rte(n),...o}=e;return w.jsx(Ite,{ref:t,...r,...o})});uR.displayName="ModalTransition";var kte=Object.defineProperty,Mte=(e,t,n)=>t in e?kte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dte=(e,t,n)=>(Mte(e,typeof t!="symbol"?t+"":t,n),n),Lte=class{constructor(){Dte(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},Q2=new Lte;function cR(e,t){const[n,r]=P.useState(0);return P.useEffect(()=>{const o=e.current;if(o){if(t){const i=Q2.add(o);r(i)}return()=>{Q2.remove(o),r(0)}}},[t,e]),n}var Nte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cl=new WeakMap,gh=new WeakMap,vh={},gg=0,fR=function(e){return e&&(e.host||fR(e.parentNode))},Bte=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=fR(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},jte=function(e,t,n,r){var o=Bte(t,Array.isArray(e)?e:[e]);vh[n]||(vh[n]=new WeakMap);var i=vh[n],a=[],s=new Set,l=new Set(o),u=function(f){!f||s.has(f)||(s.add(f),u(f.parentNode))};o.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(d){if(s.has(d))c(d);else{var h=d.getAttribute(r),p=h!==null&&h!=="false",m=(cl.get(d)||0)+1,S=(i.get(d)||0)+1;cl.set(d,m),i.set(d,S),a.push(d),m===1&&p&&gh.set(d,!0),S===1&&d.setAttribute(n,"true"),p||d.setAttribute(r,"true")}})};return c(t),s.clear(),gg++,function(){a.forEach(function(f){var d=cl.get(f)-1,h=i.get(f)-1;cl.set(f,d),i.set(f,h),d||(gh.has(f)||f.removeAttribute(r),gh.delete(f)),h||f.removeAttribute(n)}),gg--,gg||(cl=new WeakMap,cl=new WeakMap,gh=new WeakMap,vh={})}},Fte=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Nte(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),jte(r,o,n,"aria-hidden")):function(){return null}};function $te(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=P.useRef(null),c=P.useRef(null),[f,d,h]=Vte(r,"chakra-modal","chakra-modal--header","chakra-modal--body");zte(u,t&&a);const p=cR(u,t),m=P.useRef(null),S=P.useCallback(_=>{m.current=_.target},[]),b=P.useCallback(_=>{_.key==="Escape"&&(_.stopPropagation(),i&&(n==null||n()),l==null||l())},[i,n,l]),[g,E]=P.useState(!1),[T,O]=P.useState(!1),A=P.useCallback((_={},v=null)=>({role:"dialog",..._,ref:Jt(v,u),id:f,tabIndex:-1,"aria-modal":!0,"aria-labelledby":g?d:void 0,"aria-describedby":T?h:void 0,onClick:ke(_.onClick,x=>x.stopPropagation())}),[h,T,f,d,g]),C=P.useCallback(_=>{_.stopPropagation(),m.current===_.target&&Q2.isTopModal(u.current)&&(o&&(n==null||n()),s==null||s())},[n,o,s]),y=P.useCallback((_={},v=null)=>({..._,ref:Jt(v,c),onClick:ke(_.onClick,C),onKeyDown:ke(_.onKeyDown,b),onMouseDown:ke(_.onMouseDown,S)}),[b,S,C]);return{isOpen:t,onClose:n,headerId:d,bodyId:h,setBodyMounted:O,setHeaderMounted:E,dialogRef:u,overlayRef:c,getDialogProps:A,getDialogContainerProps:y,index:p}}function zte(e,t){const n=e.current;P.useEffect(()=>{if(!(!e.current||!t))return Fte(e.current)},[t,e,n])}function Vte(e,...t){const n=P.useId(),r=e||n;return P.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[Ute,Vu]=tn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Hte,Us]=tn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),xr=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:i,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:c,preserveScrollBarGap:f,motionPreset:d,lockFocusAcrossFrames:h,onCloseComplete:p}=t,m=Dr("Modal",t),b={...$te(t),autoFocus:o,trapFocus:i,initialFocusRef:a,finalFocusRef:s,returnFocusOnClose:l,blockScrollOnMount:u,allowPinchZoom:c,preserveScrollBarGap:f,motionPreset:d,lockFocusAcrossFrames:h};return w.jsx(Hte,{value:b,children:w.jsx(Ute,{value:m,children:w.jsx(Fu,{onExitComplete:p,children:b.isOpen&&w.jsx(ju,{...n,children:r})})})})};xr.displayName="Modal";var sp="right-scroll-bar-position",lp="width-before-scroll-bar",Wte="with-scroll-bars-hidden",Gte="--removed-body-scroll-bar-size",dR=l5(),vg=function(){},Cm=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:vg,onWheelCapture:vg,onTouchMoveCapture:vg}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,f=e.shards,d=e.sideCar,h=e.noIsolation,p=e.inert,m=e.allowPinchZoom,S=e.as,b=S===void 0?"div":S,g=e.gapMode,E=i5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=d,O=o5([n,t]),A=ri(ri({},E),o);return P.createElement(P.Fragment,null,c&&P.createElement(T,{sideCar:dR,removeScrollBar:u,shards:f,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:g}),a?P.cloneElement(P.Children.only(s),ri(ri({},A),{ref:O})):P.createElement(b,ri({},A,{className:l,ref:O}),s))});Cm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Cm.classNames={fullWidth:lp,zeroRight:sp};var n4,Kte=function(){if(n4)return n4;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Xte(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Kte();return t&&e.setAttribute("nonce",t),e}function qte(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yte(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Zte=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xte())&&(qte(t,n),Yte(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Qte=function(){var e=Zte();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hR=function(){var e=Qte(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Jte={left:0,top:0,right:0,gap:0},wg=function(e){return parseInt(e||"",10)||0},ene=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[wg(n),wg(r),wg(o)]},tne=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Jte;var t=ene(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},nne=hR(),rne=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Wte,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; } @@ -365,29 +365,29 @@ Error generating stack: `+i.message+` `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` } - .`).concat(ip,` { + .`).concat(sp,` { right: `).concat(s,"px ").concat(r,`; } - .`).concat(ap,` { + .`).concat(lp,` { margin-right: `).concat(s,"px ").concat(r,`; } - .`).concat(ip," .").concat(ip,` { + .`).concat(sp," .").concat(sp,` { right: 0 `).concat(r,`; } - .`).concat(ap," .").concat(ap,` { + .`).concat(lp," .").concat(lp,` { margin-right: 0 `).concat(r,`; } body { - `).concat(Tte,": ").concat(s,`px; + `).concat(Gte,": ").concat(s,`px; } -`)},zte=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=P.useMemo(function(){return jte(o)},[o]);return P.createElement(Fte,{styles:$te(i,!t,o,n?"":"!important")})},U2=!1;if(typeof window<"u")try{var gh=Object.defineProperty({},"passive",{get:function(){return U2=!0,!0}});window.addEventListener("test",gh,gh),window.removeEventListener("test",gh,gh)}catch{U2=!1}var ul=U2?{passive:!1}:!1,Ute=function(e){return e.tagName==="TEXTAREA"},Q5=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ute(e)&&n[t]==="visible")},Vte=function(e){return Q5(e,"overflowY")},Hte=function(e){return Q5(e,"overflowX")},Xx=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=J5(e,r);if(o){var i=eR(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Wte=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Gte=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},J5=function(e,t){return e==="v"?Vte(t):Hte(t)},eR=function(e,t){return e==="v"?Wte(t):Gte(t)},Kte=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xte=function(e,t,n,r,o){var i=Kte(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),u=!1,c=a>0,f=0,d=0;do{var h=eR(e,s),p=h[0],m=h[1],_=h[2],b=m-_-i*p;(p||b)&&J5(e,s)&&(f+=b,d+=p),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(o&&f===0||!o&&a>f)||!c&&(o&&d===0||!o&&-a>d))&&(u=!0),u},vh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qx=function(e){return[e.deltaX,e.deltaY]},Yx=function(e){return e&&"current"in e?e.current:e},qte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yte=function(e){return` +`)},one=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=P.useMemo(function(){return tne(o)},[o]);return P.createElement(nne,{styles:rne(i,!t,o,n?"":"!important")})},J2=!1;if(typeof window<"u")try{var wh=Object.defineProperty({},"passive",{get:function(){return J2=!0,!0}});window.addEventListener("test",wh,wh),window.removeEventListener("test",wh,wh)}catch{J2=!1}var fl=J2?{passive:!1}:!1,ine=function(e){return e.tagName==="TEXTAREA"},pR=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ine(e)&&n[t]==="visible")},ane=function(e){return pR(e,"overflowY")},sne=function(e){return pR(e,"overflowX")},r4=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=mR(e,r);if(o){var i=yR(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lne=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},une=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},mR=function(e,t){return e==="v"?ane(t):sne(t)},yR=function(e,t){return e==="v"?lne(t):une(t)},cne=function(e,t){return e==="h"&&t==="rtl"?-1:1},fne=function(e,t,n,r,o){var i=cne(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),u=!1,c=a>0,f=0,d=0;do{var h=yR(e,s),p=h[0],m=h[1],S=h[2],b=m-S-i*p;(p||b)&&mR(e,s)&&(f+=b,d+=p),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(o&&f===0||!o&&a>f)||!c&&(o&&d===0||!o&&-a>d))&&(u=!0),u},bh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},o4=function(e){return[e.deltaX,e.deltaY]},i4=function(e){return e&&"current"in e?e.current:e},dne=function(e,t){return e[0]===t[0]&&e[1]===t[1]},hne=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Zte=0,cl=[];function Qte(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),o=P.useState(Zte++)[0],i=P.useState(Z5)[0],a=P.useRef(e);P.useEffect(function(){a.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=XZ([e.lockRef.current],(e.shards||[]).map(Yx),!0).filter(Boolean);return m.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=P.useCallback(function(m,_){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var b=vh(m),g=n.current,E="deltaX"in m?m.deltaX:g[0]-b[0],T="deltaY"in m?m.deltaY:g[1]-b[1],O,A=m.target,C=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in m&&C==="h"&&A.type==="range")return!1;var y=Xx(C,A);if(!y)return!0;if(y?O=C:(O=C==="v"?"h":"v",y=Xx(C,A)),!y)return!1;if(!r.current&&"changedTouches"in m&&(E||T)&&(r.current=O),!O)return!0;var S=r.current||O;return Xte(S,_,m,S==="h"?E:T,!0)},[]),l=P.useCallback(function(m){var _=m;if(!(!cl.length||cl[cl.length-1]!==i)){var b="deltaY"in _?qx(_):vh(_),g=t.current.filter(function(O){return O.name===_.type&&O.target===_.target&&qte(O.delta,b)})[0];if(g&&g.should){_.cancelable&&_.preventDefault();return}if(!g){var E=(a.current.shards||[]).map(Yx).filter(Boolean).filter(function(O){return O.contains(_.target)}),T=E.length>0?s(_,E[0]):!a.current.noIsolation;T&&_.cancelable&&_.preventDefault()}}},[]),u=P.useCallback(function(m,_,b,g){var E={name:m,delta:_,target:b,should:g};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),c=P.useCallback(function(m){n.current=vh(m),r.current=void 0},[]),f=P.useCallback(function(m){u(m.type,qx(m),m.target,s(m,e.lockRef.current))},[]),d=P.useCallback(function(m){u(m.type,vh(m),m.target,s(m,e.lockRef.current))},[]);P.useEffect(function(){return cl.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,ul),document.addEventListener("touchmove",l,ul),document.addEventListener("touchstart",c,ul),function(){cl=cl.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,ul),document.removeEventListener("touchmove",l,ul),document.removeEventListener("touchstart",c,ul)}},[]);var h=e.removeScrollBar,p=e.inert;return P.createElement(P.Fragment,null,p?P.createElement(i,{styles:Yte(o)}):null,h?P.createElement(zte,{gapMode:e.gapMode}):null)}const Jte=qZ(Y5,Qte);var tR=P.forwardRef(function(e,t){return P.createElement(hm,ni({},e,{ref:t,sideCar:Jte}))});tR.classNames=hm.classNames;const ene=tR;function tne(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:i,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:c,isOpen:f}=zs(),[d,h]=tI();P.useEffect(()=>{!d&&h&&setTimeout(h)},[d,h]);const p=X5(r,f);return w.jsx(E5,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:c,children:w.jsx(ene,{removeScrollBar:!u,allowPinchZoom:a,enabled:p===1&&i,forwardProps:!0,children:e.children})})}var zr=de((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:i,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=zs(),u=s(a,t),c=l(o),f=_e("chakra-modal__content",n),d=$u(),h={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...d.dialog},p={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...d.dialogContainer},{motionPreset:m}=zs();return w.jsx(tne,{children:w.jsx(ne.div,{...c,className:"chakra-modal__content-container",tabIndex:-1,__css:p,children:w.jsx(K5,{preset:m,motionProps:i,className:f,...u,__css:h,children:r})})})});zr.displayName="ModalContent";var gd=de((e,t)=>{const{className:n,...r}=e,o=_e("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...$u().footer};return w.jsx(ne.footer,{ref:t,...r,__css:a,className:o})});gd.displayName="ModalFooter";var Ur=de((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:i}=zs();P.useEffect(()=>(i(!0),()=>i(!1)),[i]);const a=_e("chakra-modal__header",n),l={flex:0,...$u().header};return w.jsx(ne.header,{ref:t,className:a,id:o,...r,__css:l})});Ur.displayName="ModalHeader";var nne=ne(Ui.div),Vr=de((e,t)=>{const{className:n,transition:r,motionProps:o,...i}=e,a=_e("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...$u().overlay},{motionPreset:u}=zs(),f=o||(u==="none"?{}:EI);return w.jsx(nne,{...f,__css:l,ref:t,className:a,...i})});Vr.displayName="ModalOverlay";var Hr=de((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:i}=zs();P.useEffect(()=>(i(!0),()=>i(!1)),[i]);const a=_e("chakra-modal__body",n),s=$u();return w.jsx(ne.div,{ref:t,className:a,id:o,...r,__css:s.body})});Hr.displayName="ModalBody";var Wr=de((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:i}=zs(),a=_e("chakra-modal__close-btn",r),s=$u();return w.jsx(lm,{ref:t,__css:s.closeButton,className:a,onClick:ke(n,l=>{l.stopPropagation(),i()}),...o})});Wr.displayName="ModalCloseButton";var[rne,Ys]=tn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[one,vd]=tn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),nR=de(function(t,n){const{getHeaderProps:r}=Ys(),o=vd();return w.jsx(ne.header,{...r(t,n),className:_e("chakra-popover__header",t.className),__css:o.header})});nR.displayName="PopoverHeader";function GS(e){const t=P.Children.only(e.children),{getTriggerProps:n}=Ys();return P.cloneElement(t,n(t.props,t.ref))}GS.displayName="PopoverTrigger";var fl={click:"click",hover:"hover"};function ine(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:i=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=fl.click,openDelay:c=200,closeDelay:f=200,isLazy:d,lazyBehavior:h="unmount",computePositionOnMount:p,...m}=e,{isOpen:_,onClose:b,onOpen:g,onToggle:E}=US(e),T=P.useRef(null),O=P.useRef(null),A=P.useRef(null),C=P.useRef(!1),y=P.useRef(!1);_&&(y.current=!0);const[S,v]=P.useState(!1),[x,I]=P.useState(!1),R=P.useId(),k=o??R,[M,N,D,L]=["popover-trigger","popover-content","popover-header","popover-body"].map(ie=>`${ie}-${k}`),{referenceRef:j,getArrowProps:F,getPopperProps:B,getArrowInnerProps:U,forceUpdate:K}=zS({...m,enabled:_||!!p}),W=U5({isOpen:_,ref:A});NZ({enabled:_,ref:O}),R5(A,{focusRef:O,visible:_,shouldFocus:i&&u===fl.click}),CJ(A,{focusRef:r,visible:_,shouldFocus:a&&u===fl.click});const Q=V5({wasSelected:y.current,enabled:d,mode:h,isSelected:W.present}),X=P.useCallback((ie={},Ce=null)=>{const Ne={...ie,style:{...ie.style,transformOrigin:on.transformOrigin.varRef,[on.arrowSize.var]:s?`${s}px`:void 0,[on.arrowShadowColor.var]:l},ref:Jt(A,Ce),children:Q?ie.children:null,id:N,tabIndex:-1,role:"dialog",onKeyDown:ke(ie.onKeyDown,ze=>{n&&ze.key==="Escape"&&b()}),onBlur:ke(ie.onBlur,ze=>{const fr=Zx(ze),Kt=ug(A.current,fr),Cn=ug(O.current,fr);_&&t&&(!Kt&&!Cn)&&b()}),"aria-labelledby":S?D:void 0,"aria-describedby":x?L:void 0};return u===fl.hover&&(Ne.role="tooltip",Ne.onMouseEnter=ke(ie.onMouseEnter,()=>{C.current=!0}),Ne.onMouseLeave=ke(ie.onMouseLeave,ze=>{ze.nativeEvent.relatedTarget!==null&&(C.current=!1,setTimeout(()=>b(),f))})),Ne},[Q,N,S,D,x,L,u,n,b,_,t,f,l,s]),J=P.useCallback((ie={},Ce=null)=>B({...ie,style:{visibility:_?"visible":"hidden",...ie.style}},Ce),[_,B]),te=P.useCallback((ie,Ce=null)=>({...ie,ref:Jt(Ce,T,j)}),[T,j]),le=P.useRef(),ge=P.useRef(),se=P.useCallback(ie=>{T.current==null&&j(ie)},[j]),ue=P.useCallback((ie={},Ce=null)=>{const Ne={...ie,ref:Jt(O,Ce,se),id:M,"aria-haspopup":"dialog","aria-expanded":_,"aria-controls":N};return u===fl.click&&(Ne.onClick=ke(ie.onClick,E)),u===fl.hover&&(Ne.onFocus=ke(ie.onFocus,()=>{le.current===void 0&&g()}),Ne.onBlur=ke(ie.onBlur,ze=>{const fr=Zx(ze),Kt=!ug(A.current,fr);_&&t&&Kt&&b()}),Ne.onKeyDown=ke(ie.onKeyDown,ze=>{ze.key==="Escape"&&b()}),Ne.onMouseEnter=ke(ie.onMouseEnter,()=>{C.current=!0,le.current=window.setTimeout(()=>g(),c)}),Ne.onMouseLeave=ke(ie.onMouseLeave,()=>{C.current=!1,le.current&&(clearTimeout(le.current),le.current=void 0),ge.current=window.setTimeout(()=>{C.current===!1&&b()},f)})),Ne},[M,_,N,u,se,E,g,t,b,c,f]);P.useEffect(()=>()=>{le.current&&clearTimeout(le.current),ge.current&&clearTimeout(ge.current)},[]);const Ie=P.useCallback((ie={},Ce=null)=>({...ie,id:D,ref:Jt(Ce,Ne=>{v(!!Ne)})}),[D]),gt=P.useCallback((ie={},Ce=null)=>({...ie,id:L,ref:Jt(Ce,Ne=>{I(!!Ne)})}),[L]);return{forceUpdate:K,isOpen:_,onAnimationComplete:W.onComplete,onClose:b,getAnchorProps:te,getArrowProps:F,getArrowInnerProps:U,getPopoverPositionerProps:J,getPopoverProps:X,getTriggerProps:ue,getHeaderProps:Ie,getBodyProps:gt}}function ug(e,t){return e===t||(e==null?void 0:e.contains(t))}function Zx(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function KS(e){const t=Pr("Popover",e),{children:n,...r}=Rt(e),o=rd(),i=ine({...r,direction:o.direction});return w.jsx(rne,{value:i,children:w.jsx(one,{value:t,children:po(n,{isOpen:i.isOpen,onClose:i.onClose,forceUpdate:i.forceUpdate})})})}KS.displayName="Popover";var cg=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function XS(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:i,boxShadow:a,shadowColor:s}=e,{getArrowProps:l,getArrowInnerProps:u}=Ys(),c=vd(),f=(t=n??r)!=null?t:o,d=i??a;return w.jsx(ne.div,{...l(),className:"chakra-popover__arrow-positioner",children:w.jsx(ne.div,{className:_e("chakra-popover__arrow",e.className),...u(e),__css:{"--popper-arrow-shadow-color":cg("colors",s),"--popper-arrow-bg":cg("colors",f),"--popper-arrow-shadow":cg("shadows",d),...c.arrow}})})}XS.displayName="PopoverArrow";var qS=de(function(t,n){const{getBodyProps:r}=Ys(),o=vd();return w.jsx(ne.div,{...r(t,n),className:_e("chakra-popover__body",t.className),__css:o.body})});qS.displayName="PopoverBody";var YS=de(function(t,n){const{onClose:r}=Ys(),o=vd();return w.jsx(lm,{size:"sm",onClick:r,className:_e("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});YS.displayName="PopoverCloseButton";function ane(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var sne={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},lne=ne(Ui.section),rR=de(function(t,n){const{variants:r=sne,...o}=t,{isOpen:i}=Ys();return w.jsx(lne,{ref:n,variants:ane(r),initial:!1,animate:i?"enter":"exit",...o})});rR.displayName="PopoverTransition";var ZS=de(function(t,n){const{rootProps:r,motionProps:o,...i}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=Ys(),u=vd(),c={position:"relative",display:"flex",flexDirection:"column",...u.content};return w.jsx(ne.div,{...s(r),__css:u.popper,className:"chakra-popover__popper",children:w.jsx(rR,{...o,...a(i,n),onAnimationComplete:q0(l,i.onAnimationComplete),className:_e("chakra-popover__content",t.className),__css:c})})});ZS.displayName="PopoverContent";function une(e,t,n){return(e-t)*100/(n-t)}hi({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});hi({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var cne=hi({"0%":{left:"-40%"},"100%":{left:"100%"}}),fne=hi({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function dne(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:i,isIndeterminate:a,role:s="progressbar"}=e,l=une(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof i=="function"?i(t,l):o})(),role:s},percent:l,value:t}}var[hne,pne]=tn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),mne=de((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:i,role:a,...s}=e,l=dne({value:o,min:n,max:r,isIndeterminate:i,role:a}),c={height:"100%",...pne().filledTrack};return w.jsx(ne.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:c})}),oR=de((e,t)=>{var n;const{value:r,min:o=0,max:i=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:c,"aria-label":f,"aria-labelledby":d,"aria-valuetext":h,title:p,role:m,..._}=Rt(e),b=Pr("Progress",e),g=u??((n=b.track)==null?void 0:n.borderRadius),E={animation:`${fne} 1s linear infinite`},A={...!c&&a&&s&&E,...c&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${cne} 1s ease infinite normal none running`}},C={overflow:"hidden",position:"relative",...b.track};return w.jsx(ne.div,{ref:t,borderRadius:g,__css:C,..._,children:w.jsxs(hne,{value:b,children:[w.jsx(mne,{"aria-label":f,"aria-labelledby":d,"aria-valuetext":h,min:o,max:i,value:r,isIndeterminate:c,css:A,borderRadius:g,title:p,role:m}),l]})})});oR.displayName="Progress";function yne(e){return e&&_r(e)&&_r(e.target)}function gne(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:i,isFocusable:a,isNative:s,...l}=e,[u,c]=P.useState(r||""),f=typeof n<"u",d=f?n:u,h=P.useRef(null),p=P.useCallback(()=>{const O=h.current;if(!O)return;let A="input:not(:disabled):checked";const C=O.querySelector(A);if(C){C.focus();return}A="input:not(:disabled)";const y=O.querySelector(A);y==null||y.focus()},[]),_=`radio-${P.useId()}`,b=o||_,g=P.useCallback(O=>{const A=yne(O)?O.target.value:O;f||c(A),t==null||t(String(A))},[t,f]),E=P.useCallback((O={},A=null)=>({...O,ref:Jt(A,h),role:"radiogroup"}),[]),T=P.useCallback((O={},A=null)=>({...O,ref:A,name:b,[s?"checked":"isChecked"]:d!=null?O.value===d:void 0,onChange(y){g(y)},"data-radiogroup":!0}),[s,b,g,d]);return{getRootProps:E,getRadioProps:T,name:b,ref:h,focus:p,setValue:c,value:d,onChange:g,isDisabled:i,isFocusable:a,htmlProps:l}}var[vne,iR]=tn({name:"RadioGroupContext",strict:!1}),aR=de((e,t)=>{const{colorScheme:n,size:r,variant:o,children:i,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:c,onChange:f,getRootProps:d,name:h,htmlProps:p}=gne(u),m=P.useMemo(()=>({name:h,size:r,onChange:f,colorScheme:n,value:c,variant:o,isDisabled:s,isFocusable:l}),[h,r,f,n,c,o,s,l]);return w.jsx(vne,{value:m,children:w.jsx(ne.div,{...d(p,t),className:_e("chakra-radio-group",a),children:i})})});aR.displayName="RadioGroup";var wne={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function bne(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:i,isRequired:a,onChange:s,isInvalid:l,name:u,value:c,id:f,"data-radiogroup":d,"aria-describedby":h,...p}=e,m=`radio-${P.useId()}`,_=fd(),g=!!iR()||!!d;let T=!!_&&!g?_.id:m;T=f??T;const O=o??(_==null?void 0:_.isDisabled),A=i??(_==null?void 0:_.isReadOnly),C=a??(_==null?void 0:_.isRequired),y=l??(_==null?void 0:_.isInvalid),[S,v]=P.useState(!1),[x,I]=P.useState(!1),[R,k]=P.useState(!1),[M,N]=P.useState(!1),[D,L]=P.useState(!!t),j=typeof n<"u",F=j?n:D;P.useEffect(()=>DI(v),[]);const B=P.useCallback(se=>{if(A||O){se.preventDefault();return}j||L(se.target.checked),s==null||s(se)},[j,O,A,s]),U=P.useCallback(se=>{se.key===" "&&N(!0)},[N]),K=P.useCallback(se=>{se.key===" "&&N(!1)},[N]),W=P.useCallback((se={},ue=null)=>({...se,ref:ue,"data-active":Re(M),"data-hover":Re(R),"data-disabled":Re(O),"data-invalid":Re(y),"data-checked":Re(F),"data-focus":Re(x),"data-focus-visible":Re(x&&S),"data-readonly":Re(A),"aria-hidden":!0,onMouseDown:ke(se.onMouseDown,()=>N(!0)),onMouseUp:ke(se.onMouseUp,()=>N(!1)),onMouseEnter:ke(se.onMouseEnter,()=>k(!0)),onMouseLeave:ke(se.onMouseLeave,()=>k(!1))}),[M,R,O,y,F,x,A,S]),{onFocus:Q,onBlur:X}=_??{},J=P.useCallback((se={},ue=null)=>{const Ie=O&&!r;return{...se,id:T,ref:ue,type:"radio",name:u,value:c,onChange:ke(se.onChange,B),onBlur:ke(X,se.onBlur,()=>I(!1)),onFocus:ke(Q,se.onFocus,()=>I(!0)),onKeyDown:ke(se.onKeyDown,U),onKeyUp:ke(se.onKeyUp,K),checked:F,disabled:Ie,readOnly:A,required:C,"aria-invalid":Zl(y),"aria-disabled":Zl(Ie),"aria-required":Zl(C),"data-readonly":Re(A),"aria-describedby":h,style:wne}},[O,r,T,u,c,B,X,Q,U,K,F,A,C,y,h]);return{state:{isInvalid:y,isFocused:x,isChecked:F,isActive:M,isHovered:R,isDisabled:O,isReadOnly:A,isRequired:C},getCheckboxProps:W,getRadioProps:W,getInputProps:J,getLabelProps:(se={},ue=null)=>({...se,ref:ue,onMouseDown:ke(se.onMouseDown,Sne),"data-disabled":Re(O),"data-checked":Re(F),"data-invalid":Re(y)}),getRootProps:(se,ue=null)=>({...se,ref:ue,"data-disabled":Re(O),"data-checked":Re(F),"data-invalid":Re(y)}),htmlProps:p}}function Sne(e){e.preventDefault(),e.stopPropagation()}function _ne(e,t){const n={},r={};for(const[o,i]of Object.entries(e))t.includes(o)?n[o]=i:r[o]=i;return[n,r]}var Oc=de((e,t)=>{var n;const r=iR(),{onChange:o,value:i}=e,a=Pr("Radio",{...r,...e}),s=Rt(e),{spacing:l="0.5rem",children:u,isDisabled:c=r==null?void 0:r.isDisabled,isFocusable:f=r==null?void 0:r.isFocusable,inputProps:d,...h}=s;let p=e.isChecked;(r==null?void 0:r.value)!=null&&i!=null&&(p=r.value===i);let m=o;r!=null&&r.onChange&&i!=null&&(m=q0(r.onChange,o));const _=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:b,getCheckboxProps:g,getLabelProps:E,getRootProps:T,htmlProps:O}=bne({...h,isChecked:p,isFocusable:f,isDisabled:c,onChange:m,name:_}),[A,C]=_ne(O,Ej),y=g(C),S=b(d,t),v=E(),x=Object.assign({},A,T()),I={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...a.container},R={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...a.control},k={userSelect:"none",marginStart:l,...a.label};return w.jsxs(ne.label,{className:"chakra-radio",...x,__css:I,children:[w.jsx("input",{className:"chakra-radio__input",...S}),w.jsx(ne.span,{className:"chakra-radio__control",...y,__css:R}),u&&w.jsx(ne.span,{className:"chakra-radio__label",...v,__css:k,children:u})]})});Oc.displayName="Radio";function Ene(){const e=P.useRef(!0);return P.useEffect(()=>{e.current=!1},[]),e.current}function Cne(e){const t=P.useRef();return P.useEffect(()=>{t.current=e},[e]),t.current}var xne=ne("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),V2=Ee("skeleton-start-color"),H2=Ee("skeleton-end-color"),One=hi({from:{opacity:0},to:{opacity:1}}),Ane=hi({from:{borderColor:V2.reference,background:V2.reference},to:{borderColor:H2.reference,background:H2.reference}}),sR=de((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=Eo("Skeleton",n),o=Ene(),{startColor:i="",endColor:a="",isLoaded:s,fadeDuration:l,speed:u,className:c,fitContent:f,...d}=Rt(n),[h,p]=gB("colors",[i,a]),m=Cne(s),_=_e("chakra-skeleton",c),b={...h&&{[V2.variable]:h},...p&&{[H2.variable]:p}};if(s){const g=o||m?"none":`${One} ${l}s`;return w.jsx(ne.div,{ref:t,className:_,__css:{animation:g},...d})}return w.jsx(xne,{ref:t,className:_,...d,__css:{width:f?"fit-content":void 0,...r,...b,_dark:{...r._dark,...b},animation:`${u}s linear infinite alternate ${Ane}`}})});sR.displayName="Skeleton";var W2=de(function(t,n){const r=Pr("Switch",t),{spacing:o="0.5rem",children:i,...a}=Rt(t),{getIndicatorProps:s,getInputProps:l,getCheckboxProps:u,getRootProps:c,getLabelProps:f}=LI(a),d=P.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),h=P.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),p=P.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return w.jsxs(ne.label,{...c(),className:_e("chakra-switch",t.className),__css:d,children:[w.jsx("input",{className:"chakra-switch__input",...l({},n)}),w.jsx(ne.span,{...u(),className:"chakra-switch__track",__css:h,children:w.jsx(ne.span,{__css:r.thumb,className:"chakra-switch__thumb",...s()})}),i&&w.jsx(ne.span,{className:"chakra-switch__label",...f(),__css:p,children:i})]})});W2.displayName="Switch";var[Pne,wd]=tn({name:"TableStylesContext",errorMessage:`useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),bd=de((e,t)=>{const n=Pr("Table",e),{className:r,layout:o,...i}=Rt(e);return w.jsx(Pne,{value:n,children:w.jsx(ne.table,{ref:t,__css:{tableLayout:o,...n.table},className:_e("chakra-table",r),...i})})});bd.displayName="Table";var pm=de((e,t)=>{const n=wd();return w.jsx(ne.thead,{...e,ref:t,__css:n.thead})}),ka=de((e,t)=>{const n=wd();return w.jsx(ne.tr,{...e,ref:t,__css:n.tr})}),mm=de((e,t)=>{const n=wd();return w.jsx(ne.tbody,{...e,ref:t,__css:n.tbody})}),Nt=de(({isNumeric:e,...t},n)=>{const r=wd();return w.jsx(ne.td,{...t,ref:n,__css:r.td,"data-is-numeric":e})}),Bt=de(({isNumeric:e,...t},n)=>{const r=wd();return w.jsx(ne.th,{...t,ref:n,__css:r.th,"data-is-numeric":e})});function Tne(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Ine=["h","minH","height","minHeight"],QS=de((e,t)=>{const n=Eo("Textarea",e),{className:r,rows:o,...i}=Rt(e),a=kI(i),s=o?Tne(n,Ine):n;return w.jsx(ne.textarea,{ref:t,rows:o,...a,className:_e("chakra-textarea",r),__css:s})});QS.displayName="Textarea";var Rne={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},G2=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},sp=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function kne(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:i,closeOnPointerDown:a=o,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:c,id:f,isOpen:d,defaultIsOpen:h,arrowSize:p=10,arrowShadowColor:m,arrowPadding:_,modifiers:b,isDisabled:g,gutter:E,offset:T,direction:O,...A}=e,{isOpen:C,onOpen:y,onClose:S}=US({isOpen:d,defaultIsOpen:h,onOpen:l,onClose:u}),{referenceRef:v,getPopperProps:x,getArrowInnerProps:I,getArrowProps:R}=zS({enabled:C,placement:c,arrowPadding:_,modifiers:b,gutter:E,offset:T,direction:O}),k=P.useId(),N=`tooltip-${f??k}`,D=P.useRef(null),L=P.useRef(),j=P.useCallback(()=>{L.current&&(clearTimeout(L.current),L.current=void 0)},[]),F=P.useRef(),B=P.useCallback(()=>{F.current&&(clearTimeout(F.current),F.current=void 0)},[]),U=P.useCallback(()=>{B(),S()},[S,B]),K=Mne(D,U),W=P.useCallback(()=>{if(!g&&!L.current){C&&K();const ue=sp(D);L.current=ue.setTimeout(y,t)}},[K,g,C,y,t]),Q=P.useCallback(()=>{j();const ue=sp(D);F.current=ue.setTimeout(U,n)},[n,U,j]),X=P.useCallback(()=>{C&&r&&Q()},[r,Q,C]),J=P.useCallback(()=>{C&&a&&Q()},[a,Q,C]),te=P.useCallback(ue=>{C&&ue.key==="Escape"&&Q()},[C,Q]);nu(()=>G2(D),"keydown",s?te:void 0),nu(()=>{const ue=D.current;if(!ue)return null;const Ie=v5(ue);return Ie.localName==="body"?sp(D):Ie},"scroll",()=>{C&&i&&U()},{passive:!0,capture:!0}),P.useEffect(()=>{g&&(j(),C&&S())},[g,C,S,j]),P.useEffect(()=>()=>{j(),B()},[j,B]),nu(()=>D.current,"pointerleave",Q);const le=P.useCallback((ue={},Ie=null)=>({...ue,ref:Jt(D,Ie,v),onPointerEnter:ke(ue.onPointerEnter,ie=>{ie.pointerType!=="touch"&&W()}),onClick:ke(ue.onClick,X),onPointerDown:ke(ue.onPointerDown,J),onFocus:ke(ue.onFocus,W),onBlur:ke(ue.onBlur,Q),"aria-describedby":C?N:void 0}),[W,Q,J,C,N,X,v]),ge=P.useCallback((ue={},Ie=null)=>x({...ue,style:{...ue.style,[on.arrowSize.var]:p?`${p}px`:void 0,[on.arrowShadowColor.var]:m}},Ie),[x,p,m]),se=P.useCallback((ue={},Ie=null)=>{const gt={...ue.style,position:"relative",transformOrigin:on.transformOrigin.varRef};return{ref:Ie,...A,...ue,id:N,role:"tooltip",style:gt}},[A,N]);return{isOpen:C,show:W,hide:Q,getTriggerProps:le,getTooltipProps:se,getTooltipPositionerProps:ge,getArrowProps:R,getArrowInnerProps:I}}var fg="chakra-ui:close-tooltip";function Mne(e,t){return P.useEffect(()=>{const n=G2(e);return n.addEventListener(fg,t),()=>n.removeEventListener(fg,t)},[t,e]),()=>{const n=G2(e),r=sp(e);n.dispatchEvent(new r.CustomEvent(fg))}}function Dne(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Lne(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var Nne=ne(Ui.div),l1=de((e,t)=>{var n,r;const o=Eo("Tooltip",e),i=Rt(e),a=rd(),{children:s,label:l,shouldWrapChildren:u,"aria-label":c,hasArrow:f,bg:d,portalProps:h,background:p,backgroundColor:m,bgColor:_,motionProps:b,...g}=i,E=(r=(n=p??m)!=null?n:d)!=null?r:_;if(E){o.bg=E;const x=Bj(a,"colors",E);o[on.arrowBg.var]=x}const T=kne({...g,direction:a.direction}),O=typeof s=="string"||u;let A;if(O)A=w.jsx(ne.span,{display:"inline-block",tabIndex:0,...T.getTriggerProps(),children:s});else{const x=P.Children.only(s);A=P.cloneElement(x,T.getTriggerProps(x.props,x.ref))}const C=!!c,y=T.getTooltipProps({},t),S=C?Dne(y,["role","id"]):y,v=Lne(y,["role","id"]);return l?w.jsxs(w.Fragment,{children:[A,w.jsx(Bu,{children:T.isOpen&&w.jsx(Nu,{...h,children:w.jsx(ne.div,{...T.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:w.jsxs(Nne,{variants:Rne,initial:"exit",animate:"enter",exit:"exit",...b,...S,__css:o,children:[l,C&&w.jsx(ne.span,{srOnly:!0,...v,children:c}),f&&w.jsx(ne.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:w.jsx(ne.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):w.jsx(w.Fragment,{children:s})});l1.displayName="Tooltip";var K2={},Qx=K0;K2.createRoot=Qx.createRoot,K2.hydrateRoot=Qx.hydrateRoot;/** +`)},pne=0,dl=[];function mne(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),o=P.useState(pne++)[0],i=P.useState(hR)[0],a=P.useRef(e);P.useEffect(function(){a.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=fQ([e.lockRef.current],(e.shards||[]).map(i4),!0).filter(Boolean);return m.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=P.useCallback(function(m,S){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var b=bh(m),g=n.current,E="deltaX"in m?m.deltaX:g[0]-b[0],T="deltaY"in m?m.deltaY:g[1]-b[1],O,A=m.target,C=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in m&&C==="h"&&A.type==="range")return!1;var y=r4(C,A);if(!y)return!0;if(y?O=C:(O=C==="v"?"h":"v",y=r4(C,A)),!y)return!1;if(!r.current&&"changedTouches"in m&&(E||T)&&(r.current=O),!O)return!0;var _=r.current||O;return fne(_,S,m,_==="h"?E:T,!0)},[]),l=P.useCallback(function(m){var S=m;if(!(!dl.length||dl[dl.length-1]!==i)){var b="deltaY"in S?o4(S):bh(S),g=t.current.filter(function(O){return O.name===S.type&&O.target===S.target&&dne(O.delta,b)})[0];if(g&&g.should){S.cancelable&&S.preventDefault();return}if(!g){var E=(a.current.shards||[]).map(i4).filter(Boolean).filter(function(O){return O.contains(S.target)}),T=E.length>0?s(S,E[0]):!a.current.noIsolation;T&&S.cancelable&&S.preventDefault()}}},[]),u=P.useCallback(function(m,S,b,g){var E={name:m,delta:S,target:b,should:g};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),c=P.useCallback(function(m){n.current=bh(m),r.current=void 0},[]),f=P.useCallback(function(m){u(m.type,o4(m),m.target,s(m,e.lockRef.current))},[]),d=P.useCallback(function(m){u(m.type,bh(m),m.target,s(m,e.lockRef.current))},[]);P.useEffect(function(){return dl.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,fl),document.addEventListener("touchmove",l,fl),document.addEventListener("touchstart",c,fl),function(){dl=dl.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,fl),document.removeEventListener("touchmove",l,fl),document.removeEventListener("touchstart",c,fl)}},[]);var h=e.removeScrollBar,p=e.inert;return P.createElement(P.Fragment,null,p?P.createElement(i,{styles:hne(o)}):null,h?P.createElement(one,{gapMode:e.gapMode}):null)}const yne=dQ(dR,mne);var gR=P.forwardRef(function(e,t){return P.createElement(Cm,ri({},e,{ref:t,sideCar:yne}))});gR.classNames=Cm.classNames;const gne=gR;function vne(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:i,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:c,isOpen:f}=Us(),[d,h]=gI();P.useEffect(()=>{!d&&h&&setTimeout(h)},[d,h]);const p=cR(r,f);return w.jsx(F5,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:c,children:w.jsx(gne,{removeScrollBar:!u,allowPinchZoom:a,enabled:p===1&&i,forwardProps:!0,children:e.children})})}var Or=de((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:i,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Us(),u=s(a,t),c=l(o),f=_e("chakra-modal__content",n),d=Vu(),h={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...d.dialog},p={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...d.dialogContainer},{motionPreset:m}=Us();return w.jsx(vne,{children:w.jsx(ne.div,{...c,className:"chakra-modal__content-container",tabIndex:-1,__css:p,children:w.jsx(uR,{preset:m,motionProps:i,className:f,...u,__css:h,children:r})})})});Or.displayName="ModalContent";var wd=de((e,t)=>{const{className:n,...r}=e,o=_e("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...Vu().footer};return w.jsx(ne.footer,{ref:t,...r,__css:a,className:o})});wd.displayName="ModalFooter";var Ar=de((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:i}=Us();P.useEffect(()=>(i(!0),()=>i(!1)),[i]);const a=_e("chakra-modal__header",n),l={flex:0,...Vu().header};return w.jsx(ne.header,{ref:t,className:a,id:o,...r,__css:l})});Ar.displayName="ModalHeader";var wne=ne(Hi.div),Pr=de((e,t)=>{const{className:n,transition:r,motionProps:o,...i}=e,a=_e("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Vu().overlay},{motionPreset:u}=Us(),f=o||(u==="none"?{}:FI);return w.jsx(wne,{...f,__css:l,ref:t,className:a,...i})});Pr.displayName="ModalOverlay";var Tr=de((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:i}=Us();P.useEffect(()=>(i(!0),()=>i(!1)),[i]);const a=_e("chakra-modal__body",n),s=Vu();return w.jsx(ne.div,{ref:t,className:a,id:o,...r,__css:s.body})});Tr.displayName="ModalBody";var Ir=de((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:i}=Us(),a=_e("chakra-modal__close-btn",r),s=Vu();return w.jsx(gm,{ref:t,__css:s.closeButton,className:a,onClick:ke(n,l=>{l.stopPropagation(),i()}),...o})});Ir.displayName="ModalCloseButton";var[bne,Qs]=tn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[Sne,bd]=tn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),vR=de(function(t,n){const{getHeaderProps:r}=Qs(),o=bd();return w.jsx(ne.header,{...r(t,n),className:_e("chakra-popover__header",t.className),__css:o.header})});vR.displayName="PopoverHeader";function t_(e){const t=P.Children.only(e.children),{getTriggerProps:n}=Qs();return P.cloneElement(t,n(t.props,t.ref))}t_.displayName="PopoverTrigger";var hl={click:"click",hover:"hover"};function _ne(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:i=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=hl.click,openDelay:c=200,closeDelay:f=200,isLazy:d,lazyBehavior:h="unmount",computePositionOnMount:p,...m}=e,{isOpen:S,onClose:b,onOpen:g,onToggle:E}=e_(e),T=P.useRef(null),O=P.useRef(null),A=P.useRef(null),C=P.useRef(!1),y=P.useRef(!1);S&&(y.current=!0);const[_,v]=P.useState(!1),[x,I]=P.useState(!1),R=P.useId(),k=o??R,[M,N,D,L]=["popover-trigger","popover-content","popover-header","popover-body"].map(ie=>`${ie}-${k}`),{referenceRef:j,getArrowProps:F,getPopperProps:B,getArrowInnerProps:V,forceUpdate:K}=JS({...m,enabled:S||!!p}),W=oR({isOpen:S,ref:A});JZ({enabled:S,ref:O}),K5(A,{focusRef:O,visible:S,shouldFocus:i&&u===hl.click}),zJ(A,{focusRef:r,visible:S,shouldFocus:a&&u===hl.click});const Q=iR({wasSelected:y.current,enabled:d,mode:h,isSelected:W.present}),X=P.useCallback((ie={},Ce=null)=>{const Be={...ie,style:{...ie.style,transformOrigin:on.transformOrigin.varRef,[on.arrowSize.var]:s?`${s}px`:void 0,[on.arrowShadowColor.var]:l},ref:Jt(A,Ce),children:Q?ie.children:null,id:N,tabIndex:-1,role:"dialog",onKeyDown:ke(ie.onKeyDown,Ue=>{n&&Ue.key==="Escape"&&b()}),onBlur:ke(ie.onBlur,Ue=>{const fr=a4(Ue),Kt=bg(A.current,fr),Cn=bg(O.current,fr);S&&t&&(!Kt&&!Cn)&&b()}),"aria-labelledby":_?D:void 0,"aria-describedby":x?L:void 0};return u===hl.hover&&(Be.role="tooltip",Be.onMouseEnter=ke(ie.onMouseEnter,()=>{C.current=!0}),Be.onMouseLeave=ke(ie.onMouseLeave,Ue=>{Ue.nativeEvent.relatedTarget!==null&&(C.current=!1,setTimeout(()=>b(),f))})),Be},[Q,N,_,D,x,L,u,n,b,S,t,f,l,s]),J=P.useCallback((ie={},Ce=null)=>B({...ie,style:{visibility:S?"visible":"hidden",...ie.style}},Ce),[S,B]),te=P.useCallback((ie,Ce=null)=>({...ie,ref:Jt(Ce,T,j)}),[T,j]),le=P.useRef(),ge=P.useRef(),se=P.useCallback(ie=>{T.current==null&&j(ie)},[j]),ue=P.useCallback((ie={},Ce=null)=>{const Be={...ie,ref:Jt(O,Ce,se),id:M,"aria-haspopup":"dialog","aria-expanded":S,"aria-controls":N};return u===hl.click&&(Be.onClick=ke(ie.onClick,E)),u===hl.hover&&(Be.onFocus=ke(ie.onFocus,()=>{le.current===void 0&&g()}),Be.onBlur=ke(ie.onBlur,Ue=>{const fr=a4(Ue),Kt=!bg(A.current,fr);S&&t&&Kt&&b()}),Be.onKeyDown=ke(ie.onKeyDown,Ue=>{Ue.key==="Escape"&&b()}),Be.onMouseEnter=ke(ie.onMouseEnter,()=>{C.current=!0,le.current=window.setTimeout(()=>g(),c)}),Be.onMouseLeave=ke(ie.onMouseLeave,()=>{C.current=!1,le.current&&(clearTimeout(le.current),le.current=void 0),ge.current=window.setTimeout(()=>{C.current===!1&&b()},f)})),Be},[M,S,N,u,se,E,g,t,b,c,f]);P.useEffect(()=>()=>{le.current&&clearTimeout(le.current),ge.current&&clearTimeout(ge.current)},[]);const Ie=P.useCallback((ie={},Ce=null)=>({...ie,id:D,ref:Jt(Ce,Be=>{v(!!Be)})}),[D]),gt=P.useCallback((ie={},Ce=null)=>({...ie,id:L,ref:Jt(Ce,Be=>{I(!!Be)})}),[L]);return{forceUpdate:K,isOpen:S,onAnimationComplete:W.onComplete,onClose:b,getAnchorProps:te,getArrowProps:F,getArrowInnerProps:V,getPopoverPositionerProps:J,getPopoverProps:X,getTriggerProps:ue,getHeaderProps:Ie,getBodyProps:gt}}function bg(e,t){return e===t||(e==null?void 0:e.contains(t))}function a4(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function n_(e){const t=Dr("Popover",e),{children:n,...r}=Rt(e),o=od(),i=_ne({...r,direction:o.direction});return w.jsx(bne,{value:i,children:w.jsx(Sne,{value:t,children:mo(n,{isOpen:i.isOpen,onClose:i.onClose,forceUpdate:i.forceUpdate})})})}n_.displayName="Popover";var Sg=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function r_(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:i,boxShadow:a,shadowColor:s}=e,{getArrowProps:l,getArrowInnerProps:u}=Qs(),c=bd(),f=(t=n??r)!=null?t:o,d=i??a;return w.jsx(ne.div,{...l(),className:"chakra-popover__arrow-positioner",children:w.jsx(ne.div,{className:_e("chakra-popover__arrow",e.className),...u(e),__css:{"--popper-arrow-shadow-color":Sg("colors",s),"--popper-arrow-bg":Sg("colors",f),"--popper-arrow-shadow":Sg("shadows",d),...c.arrow}})})}r_.displayName="PopoverArrow";var o_=de(function(t,n){const{getBodyProps:r}=Qs(),o=bd();return w.jsx(ne.div,{...r(t,n),className:_e("chakra-popover__body",t.className),__css:o.body})});o_.displayName="PopoverBody";var i_=de(function(t,n){const{onClose:r}=Qs(),o=bd();return w.jsx(gm,{size:"sm",onClick:r,className:_e("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});i_.displayName="PopoverCloseButton";function Ene(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var Cne={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},xne=ne(Hi.section),wR=de(function(t,n){const{variants:r=Cne,...o}=t,{isOpen:i}=Qs();return w.jsx(xne,{ref:n,variants:Ene(r),initial:!1,animate:i?"enter":"exit",...o})});wR.displayName="PopoverTransition";var a_=de(function(t,n){const{rootProps:r,motionProps:o,...i}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=Qs(),u=bd(),c={position:"relative",display:"flex",flexDirection:"column",...u.content};return w.jsx(ne.div,{...s(r),__css:u.popper,className:"chakra-popover__popper",children:w.jsx(wR,{...o,...a(i,n),onAnimationComplete:om(l,i.onAnimationComplete),className:_e("chakra-popover__content",t.className),__css:c})})});a_.displayName="PopoverContent";function One(e,t,n){return(e-t)*100/(n-t)}pi({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});pi({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var Ane=pi({"0%":{left:"-40%"},"100%":{left:"100%"}}),Pne=pi({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function Tne(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:i,isIndeterminate:a,role:s="progressbar"}=e,l=One(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof i=="function"?i(t,l):o})(),role:s},percent:l,value:t}}var[Ine,Rne]=tn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),kne=de((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:i,role:a,...s}=e,l=Tne({value:o,min:n,max:r,isIndeterminate:i,role:a}),c={height:"100%",...Rne().filledTrack};return w.jsx(ne.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:c})}),bR=de((e,t)=>{var n;const{value:r,min:o=0,max:i=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:c,"aria-label":f,"aria-labelledby":d,"aria-valuetext":h,title:p,role:m,...S}=Rt(e),b=Dr("Progress",e),g=u??((n=b.track)==null?void 0:n.borderRadius),E={animation:`${Pne} 1s linear infinite`},A={...!c&&a&&s&&E,...c&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${Ane} 1s ease infinite normal none running`}},C={overflow:"hidden",position:"relative",...b.track};return w.jsx(ne.div,{ref:t,borderRadius:g,__css:C,...S,children:w.jsxs(Ine,{value:b,children:[w.jsx(kne,{"aria-label":f,"aria-labelledby":d,"aria-valuetext":h,min:o,max:i,value:r,isIndeterminate:c,css:A,borderRadius:g,title:p,role:m}),l]})})});bR.displayName="Progress";function Mne(e){return e&&_r(e)&&_r(e.target)}function Dne(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:i,isFocusable:a,isNative:s,...l}=e,[u,c]=P.useState(r||""),f=typeof n<"u",d=f?n:u,h=P.useRef(null),p=P.useCallback(()=>{const O=h.current;if(!O)return;let A="input:not(:disabled):checked";const C=O.querySelector(A);if(C){C.focus();return}A="input:not(:disabled)";const y=O.querySelector(A);y==null||y.focus()},[]),S=`radio-${P.useId()}`,b=o||S,g=P.useCallback(O=>{const A=Mne(O)?O.target.value:O;f||c(A),t==null||t(String(A))},[t,f]),E=P.useCallback((O={},A=null)=>({...O,ref:Jt(A,h),role:"radiogroup"}),[]),T=P.useCallback((O={},A=null)=>({...O,ref:A,name:b,[s?"checked":"isChecked"]:d!=null?O.value===d:void 0,onChange(y){g(y)},"data-radiogroup":!0}),[s,b,g,d]);return{getRootProps:E,getRadioProps:T,name:b,ref:h,focus:p,setValue:c,value:d,onChange:g,isDisabled:i,isFocusable:a,htmlProps:l}}var[Lne,SR]=tn({name:"RadioGroupContext",strict:!1}),_R=de((e,t)=>{const{colorScheme:n,size:r,variant:o,children:i,className:a,isDisabled:s,isFocusable:l,...u}=e,{value:c,onChange:f,getRootProps:d,name:h,htmlProps:p}=Dne(u),m=P.useMemo(()=>({name:h,size:r,onChange:f,colorScheme:n,value:c,variant:o,isDisabled:s,isFocusable:l}),[h,r,f,n,c,o,s,l]);return w.jsx(Lne,{value:m,children:w.jsx(ne.div,{...d(p,t),className:_e("chakra-radio-group",a),children:i})})});_R.displayName="RadioGroup";var Nne={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function Bne(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:i,isRequired:a,onChange:s,isInvalid:l,name:u,value:c,id:f,"data-radiogroup":d,"aria-describedby":h,...p}=e,m=`radio-${P.useId()}`,S=hd(),g=!!SR()||!!d;let T=!!S&&!g?S.id:m;T=f??T;const O=o??(S==null?void 0:S.isDisabled),A=i??(S==null?void 0:S.isReadOnly),C=a??(S==null?void 0:S.isRequired),y=l??(S==null?void 0:S.isInvalid),[_,v]=P.useState(!1),[x,I]=P.useState(!1),[R,k]=P.useState(!1),[M,N]=P.useState(!1),[D,L]=P.useState(!!t),j=typeof n<"u",F=j?n:D;P.useEffect(()=>YI(v),[]);const B=P.useCallback(se=>{if(A||O){se.preventDefault();return}j||L(se.target.checked),s==null||s(se)},[j,O,A,s]),V=P.useCallback(se=>{se.key===" "&&N(!0)},[N]),K=P.useCallback(se=>{se.key===" "&&N(!1)},[N]),W=P.useCallback((se={},ue=null)=>({...se,ref:ue,"data-active":Re(M),"data-hover":Re(R),"data-disabled":Re(O),"data-invalid":Re(y),"data-checked":Re(F),"data-focus":Re(x),"data-focus-visible":Re(x&&_),"data-readonly":Re(A),"aria-hidden":!0,onMouseDown:ke(se.onMouseDown,()=>N(!0)),onMouseUp:ke(se.onMouseUp,()=>N(!1)),onMouseEnter:ke(se.onMouseEnter,()=>k(!0)),onMouseLeave:ke(se.onMouseLeave,()=>k(!1))}),[M,R,O,y,F,x,A,_]),{onFocus:Q,onBlur:X}=S??{},J=P.useCallback((se={},ue=null)=>{const Ie=O&&!r;return{...se,id:T,ref:ue,type:"radio",name:u,value:c,onChange:ke(se.onChange,B),onBlur:ke(X,se.onBlur,()=>I(!1)),onFocus:ke(Q,se.onFocus,()=>I(!0)),onKeyDown:ke(se.onKeyDown,V),onKeyUp:ke(se.onKeyUp,K),checked:F,disabled:Ie,readOnly:A,required:C,"aria-invalid":Jl(y),"aria-disabled":Jl(Ie),"aria-required":Jl(C),"data-readonly":Re(A),"aria-describedby":h,style:Nne}},[O,r,T,u,c,B,X,Q,V,K,F,A,C,y,h]);return{state:{isInvalid:y,isFocused:x,isChecked:F,isActive:M,isHovered:R,isDisabled:O,isReadOnly:A,isRequired:C},getCheckboxProps:W,getRadioProps:W,getInputProps:J,getLabelProps:(se={},ue=null)=>({...se,ref:ue,onMouseDown:ke(se.onMouseDown,jne),"data-disabled":Re(O),"data-checked":Re(F),"data-invalid":Re(y)}),getRootProps:(se,ue=null)=>({...se,ref:ue,"data-disabled":Re(O),"data-checked":Re(F),"data-invalid":Re(y)}),htmlProps:p}}function jne(e){e.preventDefault(),e.stopPropagation()}function Fne(e,t){const n={},r={};for(const[o,i]of Object.entries(e))t.includes(o)?n[o]=i:r[o]=i;return[n,r]}var Ac=de((e,t)=>{var n;const r=SR(),{onChange:o,value:i}=e,a=Dr("Radio",{...r,...e}),s=Rt(e),{spacing:l="0.5rem",children:u,isDisabled:c=r==null?void 0:r.isDisabled,isFocusable:f=r==null?void 0:r.isFocusable,inputProps:d,...h}=s;let p=e.isChecked;(r==null?void 0:r.value)!=null&&i!=null&&(p=r.value===i);let m=o;r!=null&&r.onChange&&i!=null&&(m=om(r.onChange,o));const S=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:b,getCheckboxProps:g,getLabelProps:E,getRootProps:T,htmlProps:O}=Bne({...h,isChecked:p,isFocusable:f,isDisabled:c,onChange:m,name:S}),[A,C]=Fne(O,$j),y=g(C),_=b(d,t),v=E(),x=Object.assign({},A,T()),I={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...a.container},R={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...a.control},k={userSelect:"none",marginStart:l,...a.label};return w.jsxs(ne.label,{className:"chakra-radio",...x,__css:I,children:[w.jsx("input",{className:"chakra-radio__input",..._}),w.jsx(ne.span,{className:"chakra-radio__control",...y,__css:R}),u&&w.jsx(ne.span,{className:"chakra-radio__label",...v,__css:k,children:u})]})});Ac.displayName="Radio";function $ne(){const e=P.useRef(!0);return P.useEffect(()=>{e.current=!1},[]),e.current}function zne(e){const t=P.useRef();return P.useEffect(()=>{t.current=e},[e]),t.current}var Vne=ne("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),ew=Ee("skeleton-start-color"),tw=Ee("skeleton-end-color"),Une=pi({from:{opacity:0},to:{opacity:1}}),Hne=pi({from:{borderColor:ew.reference,background:ew.reference},to:{borderColor:tw.reference,background:tw.reference}}),ER=de((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=Co("Skeleton",n),o=$ne(),{startColor:i="",endColor:a="",isLoaded:s,fadeDuration:l,speed:u,className:c,fitContent:f,...d}=Rt(n),[h,p]=DB("colors",[i,a]),m=zne(s),S=_e("chakra-skeleton",c),b={...h&&{[ew.variable]:h},...p&&{[tw.variable]:p}};if(s){const g=o||m?"none":`${Une} ${l}s`;return w.jsx(ne.div,{ref:t,className:S,__css:{animation:g},...d})}return w.jsx(Vne,{ref:t,className:S,...d,__css:{width:f?"fit-content":void 0,...r,...b,_dark:{...r._dark,...b},animation:`${u}s linear infinite alternate ${Hne}`}})});ER.displayName="Skeleton";var nw=de(function(t,n){const r=Dr("Switch",t),{spacing:o="0.5rem",children:i,...a}=Rt(t),{getIndicatorProps:s,getInputProps:l,getCheckboxProps:u,getRootProps:c,getLabelProps:f}=ZI(a),d=P.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),h=P.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),p=P.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return w.jsxs(ne.label,{...c(),className:_e("chakra-switch",t.className),__css:d,children:[w.jsx("input",{className:"chakra-switch__input",...l({},n)}),w.jsx(ne.span,{...u(),className:"chakra-switch__track",__css:h,children:w.jsx(ne.span,{__css:r.thumb,className:"chakra-switch__thumb",...s()})}),i&&w.jsx(ne.span,{className:"chakra-switch__label",...f(),__css:p,children:i})]})});nw.displayName="Switch";var[Wne,Sd]=tn({name:"TableStylesContext",errorMessage:`useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in "
" `}),_d=de((e,t)=>{const n=Dr("Table",e),{className:r,layout:o,...i}=Rt(e);return w.jsx(Wne,{value:n,children:w.jsx(ne.table,{ref:t,__css:{tableLayout:o,...n.table},className:_e("chakra-table",r),...i})})});_d.displayName="Table";var xm=de((e,t)=>{const n=Sd();return w.jsx(ne.thead,{...e,ref:t,__css:n.thead})}),Da=de((e,t)=>{const n=Sd();return w.jsx(ne.tr,{...e,ref:t,__css:n.tr})}),Om=de((e,t)=>{const n=Sd();return w.jsx(ne.tbody,{...e,ref:t,__css:n.tbody})}),Bt=de(({isNumeric:e,...t},n)=>{const r=Sd();return w.jsx(ne.td,{...t,ref:n,__css:r.td,"data-is-numeric":e})}),jt=de(({isNumeric:e,...t},n)=>{const r=Sd();return w.jsx(ne.th,{...t,ref:n,__css:r.th,"data-is-numeric":e})});function Gne(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Kne=["h","minH","height","minHeight"],s_=de((e,t)=>{const n=Co("Textarea",e),{className:r,rows:o,...i}=Rt(e),a=XI(i),s=o?Gne(n,Kne):n;return w.jsx(ne.textarea,{ref:t,rows:o,...a,className:_e("chakra-textarea",r),__css:s})});s_.displayName="Textarea";var Xne={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},rw=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},up=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function qne(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:i,closeOnPointerDown:a=o,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:c,id:f,isOpen:d,defaultIsOpen:h,arrowSize:p=10,arrowShadowColor:m,arrowPadding:S,modifiers:b,isDisabled:g,gutter:E,offset:T,direction:O,...A}=e,{isOpen:C,onOpen:y,onClose:_}=e_({isOpen:d,defaultIsOpen:h,onOpen:l,onClose:u}),{referenceRef:v,getPopperProps:x,getArrowInnerProps:I,getArrowProps:R}=JS({enabled:C,placement:c,arrowPadding:S,modifiers:b,gutter:E,offset:T,direction:O}),k=P.useId(),N=`tooltip-${f??k}`,D=P.useRef(null),L=P.useRef(),j=P.useCallback(()=>{L.current&&(clearTimeout(L.current),L.current=void 0)},[]),F=P.useRef(),B=P.useCallback(()=>{F.current&&(clearTimeout(F.current),F.current=void 0)},[]),V=P.useCallback(()=>{B(),_()},[_,B]),K=Yne(D,V),W=P.useCallback(()=>{if(!g&&!L.current){C&&K();const ue=up(D);L.current=ue.setTimeout(y,t)}},[K,g,C,y,t]),Q=P.useCallback(()=>{j();const ue=up(D);F.current=ue.setTimeout(V,n)},[n,V,j]),X=P.useCallback(()=>{C&&r&&Q()},[r,Q,C]),J=P.useCallback(()=>{C&&a&&Q()},[a,Q,C]),te=P.useCallback(ue=>{C&&ue.key==="Escape"&&Q()},[C,Q]);ou(()=>rw(D),"keydown",s?te:void 0),ou(()=>{const ue=D.current;if(!ue)return null;const Ie=D5(ue);return Ie.localName==="body"?up(D):Ie},"scroll",()=>{C&&i&&V()},{passive:!0,capture:!0}),P.useEffect(()=>{g&&(j(),C&&_())},[g,C,_,j]),P.useEffect(()=>()=>{j(),B()},[j,B]),ou(()=>D.current,"pointerleave",Q);const le=P.useCallback((ue={},Ie=null)=>({...ue,ref:Jt(D,Ie,v),onPointerEnter:ke(ue.onPointerEnter,ie=>{ie.pointerType!=="touch"&&W()}),onClick:ke(ue.onClick,X),onPointerDown:ke(ue.onPointerDown,J),onFocus:ke(ue.onFocus,W),onBlur:ke(ue.onBlur,Q),"aria-describedby":C?N:void 0}),[W,Q,J,C,N,X,v]),ge=P.useCallback((ue={},Ie=null)=>x({...ue,style:{...ue.style,[on.arrowSize.var]:p?`${p}px`:void 0,[on.arrowShadowColor.var]:m}},Ie),[x,p,m]),se=P.useCallback((ue={},Ie=null)=>{const gt={...ue.style,position:"relative",transformOrigin:on.transformOrigin.varRef};return{ref:Ie,...A,...ue,id:N,role:"tooltip",style:gt}},[A,N]);return{isOpen:C,show:W,hide:Q,getTriggerProps:le,getTooltipProps:se,getTooltipPositionerProps:ge,getArrowProps:R,getArrowInnerProps:I}}var _g="chakra-ui:close-tooltip";function Yne(e,t){return P.useEffect(()=>{const n=rw(e);return n.addEventListener(_g,t),()=>n.removeEventListener(_g,t)},[t,e]),()=>{const n=rw(e),r=up(e);n.dispatchEvent(new r.CustomEvent(_g))}}function Zne(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Qne(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var Jne=ne(Hi.div),c1=de((e,t)=>{var n,r;const o=Co("Tooltip",e),i=Rt(e),a=od(),{children:s,label:l,shouldWrapChildren:u,"aria-label":c,hasArrow:f,bg:d,portalProps:h,background:p,backgroundColor:m,bgColor:S,motionProps:b,...g}=i,E=(r=(n=p??m)!=null?n:d)!=null?r:S;if(E){o.bg=E;const x=eF(a,"colors",E);o[on.arrowBg.var]=x}const T=qne({...g,direction:a.direction}),O=typeof s=="string"||u;let A;if(O)A=w.jsx(ne.span,{display:"inline-block",tabIndex:0,...T.getTriggerProps(),children:s});else{const x=P.Children.only(s);A=P.cloneElement(x,T.getTriggerProps(x.props,x.ref))}const C=!!c,y=T.getTooltipProps({},t),_=C?Zne(y,["role","id"]):y,v=Qne(y,["role","id"]);return l?w.jsxs(w.Fragment,{children:[A,w.jsx(Fu,{children:T.isOpen&&w.jsx(ju,{...h,children:w.jsx(ne.div,{...T.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:w.jsxs(Jne,{variants:Xne,initial:"exit",animate:"enter",exit:"exit",...b,..._,__css:o,children:[l,C&&w.jsx(ne.span,{srOnly:!0,...v,children:c}),f&&w.jsx(ne.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:w.jsx(ne.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):w.jsx(w.Fragment,{children:s})});c1.displayName="Tooltip";var ow={},s4=nm;ow.createRoot=s4.createRoot,ow.hydrateRoot=s4.hydrateRoot;/** * @remix-run/router v1.8.0 * * Copyright (c) Remix Software Inc. @@ -396,7 +396,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ff(){return Ff=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ym(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jne(){return Math.random().toString(36).substr(2,8)}function e4(e,t){return{usr:e.state,key:e.key,idx:t}}function X2(e,t,n,r){return n===void 0&&(n=null),Ff({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Zs(t):t,{state:n,key:t&&t.key||r||jne()})}function u1(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Zs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Fne(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s=da.Pop,l=null,u=c();u==null&&(u=0,a.replaceState(Ff({},a.state,{idx:u}),""));function c(){return(a.state||{idx:null}).idx}function f(){s=da.Pop;let _=c(),b=_==null?null:_-u;u=_,l&&l({action:s,location:m.location,delta:b})}function d(_,b){s=da.Push;let g=X2(m.location,_,b);n&&n(g,_),u=c()+1;let E=e4(g,u),T=m.createHref(g);try{a.pushState(E,"",T)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;o.location.assign(T)}i&&l&&l({action:s,location:m.location,delta:1})}function h(_,b){s=da.Replace;let g=X2(m.location,_,b);n&&n(g,_),u=c();let E=e4(g,u),T=m.createHref(g);a.replaceState(E,"",T),i&&l&&l({action:s,location:m.location,delta:0})}function p(_){let b=o.location.origin!=="null"?o.location.origin:o.location.href,g=typeof _=="string"?_:u1(_);return sn(b,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,b)}let m={get action(){return s},get location(){return e(o,a)},listen(_){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Jx,f),l=_,()=>{o.removeEventListener(Jx,f),l=null}},createHref(_){return t(o,_)},createURL:p,encodeLocation(_){let b=p(_);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:d,replace:h,go(_){return a.go(_)}};return m}var t4;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(t4||(t4={}));function $ne(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Zs(t):t,o=JS(r.pathname||"/",n);if(o==null)return null;let i=lR(e);zne(i);let a=null;for(let s=0;a==null&&s{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(sn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Oa([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(sn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),lR(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Xne(u,i.index),routesMeta:c})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let l of uR(i.path))o(i,a,l)}),t}function uR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=uR(r.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function zne(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:qne(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Une=/^:\w+$/,Vne=3,Hne=2,Wne=1,Gne=10,Kne=-2,n4=e=>e==="*";function Xne(e,t){let n=e.split("/"),r=n.length;return n.some(n4)&&(r+=Kne),t&&(r+=Hne),n.filter(o=>!n4(o)).reduce((o,i)=>o+(Une.test(i)?Vne:i===""?Wne:Gne),r)}function qne(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Yne(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a{if(c==="*"){let d=s[f]||"";a=i.slice(0,i.length-d.length).replace(/(.)\/+$/,"$1")}return u[c]=ere(s[f]||"",c),u},{}),pathname:i,pathnameBase:a,pattern:e}}function Qne(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ym(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(a,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Jne(e){try{return decodeURI(e)}catch(t){return ym(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ere(e,t){try{return decodeURIComponent(e)}catch(n){return ym(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function JS(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function tre(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Zs(e):e;return{pathname:n?n.startsWith("/")?n:nre(n,t):t,search:ore(r),hash:ire(o)}}function nre(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function dg(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function cR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fR(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Zs(e):(o=Ff({},e),sn(!o.pathname||!o.pathname.includes("?"),dg("?","pathname","search",o)),sn(!o.pathname||!o.pathname.includes("#"),dg("#","pathname","hash",o)),sn(!o.search||!o.search.includes("#"),dg("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(r||a==null)s=n;else{let f=t.length-1;if(a.startsWith("..")){let d=a.split("/");for(;d[0]==="..";)d.shift(),f-=1;o.pathname=d.join("/")}s=f>=0?t[f]:"/"}let l=tre(o,s),u=a&&a!=="/"&&a.endsWith("/"),c=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Oa=e=>e.join("/").replace(/\/\/+/g,"/"),rre=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ore=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ire=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function are(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const dR=["post","put","patch","delete"];new Set(dR);const sre=["get",...dR];new Set(sre);/** + */function $f(){return $f=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Am(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function tre(){return Math.random().toString(36).substr(2,8)}function u4(e,t){return{usr:e.state,key:e.key,idx:t}}function iw(e,t,n,r){return n===void 0&&(n=null),$f({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Js(t):t,{state:n,key:t&&t.key||r||tre()})}function f1(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Js(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function nre(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s=ha.Pop,l=null,u=c();u==null&&(u=0,a.replaceState($f({},a.state,{idx:u}),""));function c(){return(a.state||{idx:null}).idx}function f(){s=ha.Pop;let S=c(),b=S==null?null:S-u;u=S,l&&l({action:s,location:m.location,delta:b})}function d(S,b){s=ha.Push;let g=iw(m.location,S,b);n&&n(g,S),u=c()+1;let E=u4(g,u),T=m.createHref(g);try{a.pushState(E,"",T)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;o.location.assign(T)}i&&l&&l({action:s,location:m.location,delta:1})}function h(S,b){s=ha.Replace;let g=iw(m.location,S,b);n&&n(g,S),u=c();let E=u4(g,u),T=m.createHref(g);a.replaceState(E,"",T),i&&l&&l({action:s,location:m.location,delta:0})}function p(S){let b=o.location.origin!=="null"?o.location.origin:o.location.href,g=typeof S=="string"?S:f1(S);return sn(b,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,b)}let m={get action(){return s},get location(){return e(o,a)},listen(S){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(l4,f),l=S,()=>{o.removeEventListener(l4,f),l=null}},createHref(S){return t(o,S)},createURL:p,encodeLocation(S){let b=p(S);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:d,replace:h,go(S){return a.go(S)}};return m}var c4;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(c4||(c4={}));function rre(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Js(t):t,o=l_(r.pathname||"/",n);if(o==null)return null;let i=CR(e);ore(i);let a=null;for(let s=0;a==null&&s{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(sn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Pa([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(sn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),CR(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:fre(u,i.index),routesMeta:c})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let l of xR(i.path))o(i,a,l)}),t}function xR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=xR(r.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function ore(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dre(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ire=/^:\w+$/,are=3,sre=2,lre=1,ure=10,cre=-2,f4=e=>e==="*";function fre(e,t){let n=e.split("/"),r=n.length;return n.some(f4)&&(r+=cre),t&&(r+=sre),n.filter(o=>!f4(o)).reduce((o,i)=>o+(ire.test(i)?are:i===""?lre:ure),r)}function dre(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function hre(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a{if(c==="*"){let d=s[f]||"";a=i.slice(0,i.length-d.length).replace(/(.)\/+$/,"$1")}return u[c]=gre(s[f]||"",c),u},{}),pathname:i,pathnameBase:a,pattern:e}}function mre(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Am(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(a,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function yre(e){try{return decodeURI(e)}catch(t){return Am(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function gre(e,t){try{return decodeURIComponent(e)}catch(n){return Am(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function l_(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function vre(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Js(e):e;return{pathname:n?n.startsWith("/")?n:wre(n,t):t,search:Sre(r),hash:_re(o)}}function wre(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Eg(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function OR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function AR(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Js(e):(o=$f({},e),sn(!o.pathname||!o.pathname.includes("?"),Eg("?","pathname","search",o)),sn(!o.pathname||!o.pathname.includes("#"),Eg("#","pathname","hash",o)),sn(!o.search||!o.search.includes("#"),Eg("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(r||a==null)s=n;else{let f=t.length-1;if(a.startsWith("..")){let d=a.split("/");for(;d[0]==="..";)d.shift(),f-=1;o.pathname=d.join("/")}s=f>=0?t[f]:"/"}let l=vre(o,s),u=a&&a!=="/"&&a.endsWith("/"),c=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Pa=e=>e.join("/").replace(/\/\/+/g,"/"),bre=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Sre=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_re=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ere(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const PR=["post","put","patch","delete"];new Set(PR);const Cre=["get",...PR];new Set(Cre);/** * React Router v6.15.0 * * Copyright (c) Remix Software Inc. @@ -405,7 +405,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function c1(){return c1=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),a=P.useRef(!1);return mR(()=>{a.current=!0}),P.useCallback(function(l,u){if(u===void 0&&(u={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let c=fR(l,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Oa([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,i,o,e])}const fre=P.createContext(null);function dre(e){let t=P.useContext(Hi).outlet;return t&&P.createElement(fre.Provider,{value:e},t)}function t_(){let{matches:e}=P.useContext(Hi),t=e[e.length-1];return t?t.params:{}}function n_(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=P.useContext(Hi),{pathname:o}=_d(),i=JSON.stringify(cR(r).map(a=>a.pathnameBase));return P.useMemo(()=>fR(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function hre(e,t){return pre(e,t)}function pre(e,t,n){Sd()||sn(!1);let{navigator:r}=P.useContext(Qs),{matches:o}=P.useContext(Hi),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let s=i?i.pathnameBase:"/";i&&i.route;let l=_d(),u;if(t){var c;let m=typeof t=="string"?Zs(t):t;s==="/"||(c=m.pathname)!=null&&c.startsWith(s)||sn(!1),u=m}else u=l;let f=u.pathname||"/",d=s==="/"?f:f.slice(s.length)||"/",h=$ne(e,{pathname:d}),p=wre(h&&h.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:Oa([s,r.encodeLocation?r.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?s:Oa([s,r.encodeLocation?r.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,n);return t&&p?P.createElement(gm.Provider,{value:{location:c1({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:da.Pop}},p):p}function mre(){let e=Ere(),t=are(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},t),n?P.createElement("pre",{style:o},n):null,i)}const yre=P.createElement(mre,null);class gre extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?P.createElement(Hi.Provider,{value:this.props.routeContext},P.createElement(pR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vre(e){let{routeContext:t,match:n,children:r}=e,o=P.useContext(e_);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),P.createElement(Hi.Provider,{value:t},r)}function wre(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,a=(r=n)==null?void 0:r.errors;if(a!=null){let s=i.findIndex(l=>l.route.id&&(a==null?void 0:a[l.route.id]));s>=0||sn(!1),i=i.slice(0,Math.min(i.length,s+1))}return i.reduceRight((s,l,u)=>{let c=l.route.id?a==null?void 0:a[l.route.id]:null,f=null;n&&(f=l.route.errorElement||yre);let d=t.concat(i.slice(0,u+1)),h=()=>{let p;return c?p=f:l.route.Component?p=P.createElement(l.route.Component,null):l.route.element?p=l.route.element:p=s,P.createElement(vre,{match:l,routeContext:{outlet:s,matches:d,isDataRoute:n!=null},children:p})};return n&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?P.createElement(gre,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:h(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):h()},null)}var yR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(yR||{}),f1=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(f1||{});function bre(e){let t=P.useContext(e_);return t||sn(!1),t}function Sre(e){let t=P.useContext(hR);return t||sn(!1),t}function _re(e){let t=P.useContext(Hi);return t||sn(!1),t}function gR(e){let t=_re(),n=t.matches[t.matches.length-1];return n.route.id||sn(!1),n.route.id}function Ere(){var e;let t=P.useContext(pR),n=Sre(f1.UseRouteError),r=gR(f1.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function Cre(){let{router:e}=bre(yR.UseNavigateStable),t=gR(f1.UseNavigateStable),n=P.useRef(!1);return mR(()=>{n.current=!0}),P.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,c1({fromRouteId:t},i)))},[e,t])}function xre(e){return dre(e.context)}function Po(e){sn(!1)}function Ore(e){let{basename:t="/",children:n=null,location:r,navigationType:o=da.Pop,navigator:i,static:a=!1}=e;Sd()&&sn(!1);let s=t.replace(/^\/*/,"/"),l=P.useMemo(()=>({basename:s,navigator:i,static:a}),[s,i,a]);typeof r=="string"&&(r=Zs(r));let{pathname:u="/",search:c="",hash:f="",state:d=null,key:h="default"}=r,p=P.useMemo(()=>{let m=JS(u,s);return m==null?null:{location:{pathname:m,search:c,hash:f,state:d,key:h},navigationType:o}},[s,u,c,f,d,h,o]);return p==null?null:P.createElement(Qs.Provider,{value:l},P.createElement(gm.Provider,{children:n,value:p}))}function Are(e){let{children:t,location:n}=e;return hre(q2(t),n)}new Promise(()=>{});function q2(e,t){t===void 0&&(t=[]);let n=[];return P.Children.forEach(e,(r,o)=>{if(!P.isValidElement(r))return;let i=[...t,o];if(r.type===P.Fragment){n.push.apply(n,q2(r.props.children,i));return}r.type!==Po&&sn(!1),!r.props.index||!r.props.children||sn(!1);let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=q2(r.props.children,i)),n.push(a)}),n}/** + */function d1(){return d1=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),a=P.useRef(!1);return RR(()=>{a.current=!0}),P.useCallback(function(l,u){if(u===void 0&&(u={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let c=AR(l,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Pa([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,i,o,e])}const Pre=P.createContext(null);function Tre(e){let t=P.useContext(Wi).outlet;return t&&P.createElement(Pre.Provider,{value:e},t)}function c_(){let{matches:e}=P.useContext(Wi),t=e[e.length-1];return t?t.params:{}}function f_(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=P.useContext(Wi),{pathname:o}=Cd(),i=JSON.stringify(OR(r).map(a=>a.pathnameBase));return P.useMemo(()=>AR(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function Ire(e,t){return Rre(e,t)}function Rre(e,t,n){Ed()||sn(!1);let{navigator:r}=P.useContext(el),{matches:o}=P.useContext(Wi),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let s=i?i.pathnameBase:"/";i&&i.route;let l=Cd(),u;if(t){var c;let m=typeof t=="string"?Js(t):t;s==="/"||(c=m.pathname)!=null&&c.startsWith(s)||sn(!1),u=m}else u=l;let f=u.pathname||"/",d=s==="/"?f:f.slice(s.length)||"/",h=rre(e,{pathname:d}),p=Nre(h&&h.map(m=>Object.assign({},m,{params:Object.assign({},a,m.params),pathname:Pa([s,r.encodeLocation?r.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?s:Pa([s,r.encodeLocation?r.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,n);return t&&p?P.createElement(Pm.Provider,{value:{location:d1({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:ha.Pop}},p):p}function kre(){let e=$re(),t=Ere(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},t),n?P.createElement("pre",{style:o},n):null,i)}const Mre=P.createElement(kre,null);class Dre extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?P.createElement(Wi.Provider,{value:this.props.routeContext},P.createElement(IR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Lre(e){let{routeContext:t,match:n,children:r}=e,o=P.useContext(u_);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),P.createElement(Wi.Provider,{value:t},r)}function Nre(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,a=(r=n)==null?void 0:r.errors;if(a!=null){let s=i.findIndex(l=>l.route.id&&(a==null?void 0:a[l.route.id]));s>=0||sn(!1),i=i.slice(0,Math.min(i.length,s+1))}return i.reduceRight((s,l,u)=>{let c=l.route.id?a==null?void 0:a[l.route.id]:null,f=null;n&&(f=l.route.errorElement||Mre);let d=t.concat(i.slice(0,u+1)),h=()=>{let p;return c?p=f:l.route.Component?p=P.createElement(l.route.Component,null):l.route.element?p=l.route.element:p=s,P.createElement(Lre,{match:l,routeContext:{outlet:s,matches:d,isDataRoute:n!=null},children:p})};return n&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?P.createElement(Dre,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:h(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):h()},null)}var kR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(kR||{}),h1=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(h1||{});function Bre(e){let t=P.useContext(u_);return t||sn(!1),t}function jre(e){let t=P.useContext(TR);return t||sn(!1),t}function Fre(e){let t=P.useContext(Wi);return t||sn(!1),t}function MR(e){let t=Fre(),n=t.matches[t.matches.length-1];return n.route.id||sn(!1),n.route.id}function $re(){var e;let t=P.useContext(IR),n=jre(h1.UseRouteError),r=MR(h1.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function zre(){let{router:e}=Bre(kR.UseNavigateStable),t=MR(h1.UseNavigateStable),n=P.useRef(!1);return RR(()=>{n.current=!0}),P.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,d1({fromRouteId:t},i)))},[e,t])}function Vre(e){return Tre(e.context)}function To(e){sn(!1)}function Ure(e){let{basename:t="/",children:n=null,location:r,navigationType:o=ha.Pop,navigator:i,static:a=!1}=e;Ed()&&sn(!1);let s=t.replace(/^\/*/,"/"),l=P.useMemo(()=>({basename:s,navigator:i,static:a}),[s,i,a]);typeof r=="string"&&(r=Js(r));let{pathname:u="/",search:c="",hash:f="",state:d=null,key:h="default"}=r,p=P.useMemo(()=>{let m=l_(u,s);return m==null?null:{location:{pathname:m,search:c,hash:f,state:d,key:h},navigationType:o}},[s,u,c,f,d,h,o]);return p==null?null:P.createElement(el.Provider,{value:l},P.createElement(Pm.Provider,{children:n,value:p}))}function Hre(e){let{children:t,location:n}=e;return Ire(aw(t),n)}new Promise(()=>{});function aw(e,t){t===void 0&&(t=[]);let n=[];return P.Children.forEach(e,(r,o)=>{if(!P.isValidElement(r))return;let i=[...t,o];if(r.type===P.Fragment){n.push.apply(n,aw(r.props.children,i));return}r.type!==To&&sn(!1),!r.props.index||!r.props.children||sn(!1);let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=aw(r.props.children,i)),n.push(a)}),n}/** * React Router DOM v6.15.0 * * Copyright (c) Remix Software Inc. @@ -414,11 +414,11 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function d1(){return d1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Pre(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Tre(e,t){return e.button===0&&(!t||t==="_self")&&!Pre(e)}const Ire=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Rre=["aria-current","caseSensitive","className","end","style","to","children"],kre="startTransition",r4=lv[kre];function Mre(e){let{basename:t,children:n,future:r,window:o}=e,i=P.useRef();i.current==null&&(i.current=Bne({window:o,v5Compat:!0}));let a=i.current,[s,l]=P.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},c=P.useCallback(f=>{u&&r4?r4(()=>l(f)):l(f)},[l,u]);return P.useLayoutEffect(()=>a.listen(c),[a,c]),P.createElement(Ore,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a})}const Dre=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Lre=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$f=P.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:l,to:u,preventScrollReset:c}=t,f=vR(t,Ire),{basename:d}=P.useContext(Qs),h,p=!1;if(typeof u=="string"&&Lre.test(u)&&(h=u,Dre))try{let g=new URL(window.location.href),E=u.startsWith("//")?new URL(g.protocol+u):new URL(u),T=JS(E.pathname,d);E.origin===g.origin&&T!=null?u=T+E.search+E.hash:p=!0}catch{}let m=lre(u,{relative:o}),_=Nre(u,{replace:a,state:s,target:l,preventScrollReset:c,relative:o});function b(g){r&&r(g),g.defaultPrevented||_(g)}return P.createElement("a",d1({},f,{href:h||m,onClick:p||i?r:b,ref:n,target:l}))}),h1=P.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:l,children:u}=t,c=vR(t,Rre),f=n_(l,{relative:c.relative}),d=_d(),h=P.useContext(hR),{navigator:p}=P.useContext(Qs),m=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,_=d.pathname,b=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;o||(_=_.toLowerCase(),b=b?b.toLowerCase():null,m=m.toLowerCase());let g=_===m||!a&&_.startsWith(m)&&_.charAt(m.length)==="/",E=b!=null&&(b===m||!a&&b.startsWith(m)&&b.charAt(m.length)==="/"),T=g?r:void 0,O;typeof i=="function"?O=i({isActive:g,isPending:E}):O=[i,g?"active":null,E?"pending":null].filter(Boolean).join(" ");let A=typeof s=="function"?s({isActive:g,isPending:E}):s;return P.createElement($f,d1({},c,{"aria-current":T,className:O,ref:n,style:A,to:l}),typeof u=="function"?u({isActive:g,isPending:E}):u)});var o4;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(o4||(o4={}));var i4;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(i4||(i4={}));function Nre(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a}=t===void 0?{}:t,s=ure(),l=_d(),u=n_(e,{relative:a});return P.useCallback(c=>{if(Tre(c,n)){c.preventDefault();let f=r!==void 0?r:u1(l)===u1(u);s(e,{replace:f,state:o,preventScrollReset:i,relative:a})}},[l,s,u,r,o,n,e,i,a])}let Bre=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var zf={};Object.defineProperty(zf,"__esModule",{value:!0});zf.bech32m=Lo=zf.bech32=void 0;const p1="qpzry9x8gf2tvdw0s3jn54khce6mua7l",wR={};for(let e=0;e>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function a4(e){let t=1;for(let n=0;n126)return"Invalid prefix ("+e+")";t=au(t)^r>>5}t=au(t);for(let n=0;n=n;)i-=n,s.push(o>>i&a);if(r)i>0&&s.push(o<=t)return"Excess padding";if(o<l)throw new TypeError("Exceeds length limit");a=a.toLowerCase();let u=a4(a);if(typeof u=="string")throw new Error(u);let c=a+"1";for(let f=0;f>5)throw new Error("Non 5-bit word");u=au(u)^d,c+=p1.charAt(d)}for(let f=0;f<6;++f)u=au(u);u^=t;for(let f=0;f<6;++f){const d=u>>(5-f)*5&31;c+=p1.charAt(d)}return c}function r(a,s){if(s=s||90,a.length<8)return a+" too short";if(a.length>s)return"Exceeds length limit";const l=a.toLowerCase(),u=a.toUpperCase();if(a!==l&&a!==u)return"Mixed-case string "+a;a=l;const c=a.lastIndexOf("1");if(c===-1)return"No separator character for "+a;if(c===0)return"Missing prefix for "+a;const f=a.slice(0,c),d=a.slice(c+1);if(d.length<6)return"Data too short";let h=a4(f);if(typeof h=="string")return h;const p=[];for(let m=0;m=d.length)&&p.push(b)}return h!==t?"Invalid checksum for "+a:{prefix:f,words:p}}function o(a,s){const l=r(a,s);if(typeof l=="object")return l}function i(a,s){const l=r(a,s);if(typeof l=="object")return l;throw new Error(l)}return{decodeUnsafe:o,decode:i,encode:n,toWords:jre,fromWordsUnsafe:Fre,fromWords:$re}}var Lo=zf.bech32=bR("bech32");zf.bech32m=bR("bech32m");var SR={};(function(e){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(x){if(!Number.isSafeInteger(x))throw new Error(`Wrong integer: ${x}`)}e.assertNumber=t;function n(...x){const I=(M,N)=>D=>M(N(D)),R=Array.from(x).reverse().reduce((M,N)=>M?I(M,N.encode):N.encode,void 0),k=x.reduce((M,N)=>M?I(M,N.decode):N.decode,void 0);return{encode:R,decode:k}}function r(x){return{encode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return I.map(R=>{if(t(R),R<0||R>=x.length)throw new Error(`Digit index outside alphabet: ${R} (alphabet: ${x.length})`);return x[R]})},decode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("alphabet.decode input should be array of strings");return I.map(R=>{if(typeof R!="string")throw new Error(`alphabet.decode: not string element=${R}`);const k=x.indexOf(R);if(k===-1)throw new Error(`Unknown letter: "${R}". Allowed: ${x}`);return k})}}}function o(x=""){if(typeof x!="string")throw new Error("join separator should be string");return{encode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("join.encode input should be array of strings");for(let R of I)if(typeof R!="string")throw new Error(`join.encode: non-string input=${R}`);return I.join(x)},decode:I=>{if(typeof I!="string")throw new Error("join.decode input should be string");return I.split(x)}}}function i(x,I="="){if(t(x),typeof I!="string")throw new Error("padding chr should be string");return{encode(R){if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("padding.encode input should be array of strings");for(let k of R)if(typeof k!="string")throw new Error(`padding.encode: non-string input=${k}`);for(;R.length*x%8;)R.push(I);return R},decode(R){if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("padding.encode input should be array of strings");for(let M of R)if(typeof M!="string")throw new Error(`padding.decode: non-string input=${M}`);let k=R.length;if(k*x%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;k>0&&R[k-1]===I;k--)if(!((k-1)*x%8))throw new Error("Invalid padding: string has too much padding");return R.slice(0,k)}}}function a(x){if(typeof x!="function")throw new Error("normalize fn should be function");return{encode:I=>I,decode:I=>x(I)}}function s(x,I,R){if(I<2)throw new Error(`convertRadix: wrong from=${I}, base cannot be less than 2`);if(R<2)throw new Error(`convertRadix: wrong to=${R}, base cannot be less than 2`);if(!Array.isArray(x))throw new Error("convertRadix: data should be array");if(!x.length)return[];let k=0;const M=[],N=Array.from(x);for(N.forEach(D=>{if(t(D),D<0||D>=I)throw new Error(`Wrong integer: ${D}`)});;){let D=0,L=!0;for(let j=k;jI?l(I,x%I):x,u=(x,I)=>x+(I-l(x,I));function c(x,I,R,k){if(!Array.isArray(x))throw new Error("convertRadix2: data should be array");if(I<=0||I>32)throw new Error(`convertRadix2: wrong from=${I}`);if(R<=0||R>32)throw new Error(`convertRadix2: wrong to=${R}`);if(u(I,R)>32)throw new Error(`convertRadix2: carry overflow from=${I} to=${R} carryBits=${u(I,R)}`);let M=0,N=0;const D=2**R-1,L=[];for(const j of x){if(t(j),j>=2**I)throw new Error(`convertRadix2: invalid data word=${j} from=${I}`);if(M=M<32)throw new Error(`convertRadix2: carry overflow pos=${N} from=${I}`);for(N+=I;N>=R;N-=R)L.push((M>>N-R&D)>>>0);M&=2**N-1}if(M=M<=I)throw new Error("Excess padding");if(!k&&M)throw new Error(`Non-zero padding: ${M}`);return k&&N>0&&L.push(M>>>0),L}function f(x){return t(x),{encode:I=>{if(!(I instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return s(Array.from(I),2**8,x)},decode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(s(I,x,2**8))}}}function d(x,I=!1){if(t(x),x<=0||x>32)throw new Error("radix2: bits should be in (0..32]");if(u(8,x)>32||u(x,8)>32)throw new Error("radix2: carry overflow");return{encode:R=>{if(!(R instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return c(Array.from(R),8,x,!I)},decode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(c(R,x,8,I))}}}function h(x){if(typeof x!="function")throw new Error("unsafeWrapper fn should be function");return function(...I){try{return x.apply(null,I)}catch{}}}function p(x,I){if(t(x),typeof I!="function")throw new Error("checksum fn should be function");return{encode(R){if(!(R instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const k=I(R).slice(0,x),M=new Uint8Array(R.length+x);return M.set(R),M.set(k,R.length),M},decode(R){if(!(R instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const k=R.slice(0,-x),M=I(k).slice(0,x),N=R.slice(-x);for(let D=0;Dx.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i(6),o("")),e.base64url=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),i(6),o(""));const m=x=>n(f(58),r(x),o(""));e.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const _=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(x){let I="";for(let R=0;Rn(p(4,I=>x(x(I))),e.base58);e.base58check=b;const g=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),E=[996825010,642813549,513874426,1027748829,705979059];function T(x){const I=x>>25;let R=(x&33554431)<<5;for(let k=0;k>k&1)===1&&(R^=E[k]);return R}function O(x,I,R=1){const k=x.length;let M=1;for(let N=0;N126)throw new Error(`Invalid prefix (${x})`);M=T(M)^D>>5}M=T(M);for(let N=0;NK)throw new TypeError(`Length ${W} exceeds limit ${K}`);return B=B.toLowerCase(),`${B}1${g.encode(U)}${O(B,U,I)}`}function L(B,U=90){if(typeof B!="string")throw new Error(`bech32.decode input should be string, not ${typeof B}`);if(B.length<8||U!==!1&&B.length>U)throw new TypeError(`Wrong string length: ${B.length} (${B}). Expected (8..${U})`);const K=B.toLowerCase();if(B!==K&&B!==B.toUpperCase())throw new Error("String must be lowercase or uppercase");B=K;const W=B.lastIndexOf("1");if(W===0||W===-1)throw new Error('Letter "1" must be present between prefix and data only');const Q=B.slice(0,W),X=B.slice(W+1);if(X.length<6)throw new Error("Data must be at least 6 characters long");const J=g.decode(X).slice(0,-6),te=O(Q,J,I);if(!X.endsWith(te))throw new Error(`Invalid checksum in ${B}: expected "${te}"`);return{prefix:Q,words:J}}const j=h(L);function F(B){const{prefix:U,words:K}=L(B,!1);return{prefix:U,words:K,bytes:k(K)}}return{encode:D,decode:L,decodeToBytes:F,decodeUnsafe:j,fromWords:k,fromWordsUnsafe:N,toWords:M}}e.bech32=A("bech32"),e.bech32m=A("bech32m"),e.utf8={encode:x=>new TextDecoder().decode(x),decode:x=>new TextEncoder().encode(x)},e.hex=n(d(4),r("0123456789abcdef"),o(""),a(x=>{if(typeof x!="string"||x.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof x} with length ${x.length}`);return x.toLowerCase()}));const C={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},y=`Invalid encoding type. Available types: ${Object.keys(C).join(", ")}`,S=(x,I)=>{if(typeof x!="string"||!C.hasOwnProperty(x))throw new TypeError(y);if(!(I instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return C[x].encode(I)};e.bytesToString=S,e.str=e.bytesToString;const v=(x,I)=>{if(!C.hasOwnProperty(x))throw new TypeError(y);if(typeof I!="string")throw new TypeError("stringToBytes() expects string");return C[x].decode(I)};e.stringToBytes=v,e.bytes=e.stringToBytes})(SR);const{bech32:Jo,hex:Mo,utf8:zre}=SR,s4={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},l4={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},u4={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},c4={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},wh=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],Ure={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},Vre=BigInt("2100000000000000000"),f4=BigInt(1e11),Y2={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},_R={};for(let e=0,t=Object.keys(Y2);eMo.encode(Jo.fromWordsUnsafe(e)),16:e=>Mo.encode(Jo.fromWordsUnsafe(e)),13:e=>zre.encode(Jo.fromWordsUnsafe(e)),19:e=>Mo.encode(Jo.fromWordsUnsafe(e)),23:e=>Mo.encode(Jo.fromWordsUnsafe(e)),27:e=>Mo.encode(Jo.fromWordsUnsafe(e)),6:m1,24:m1,3:Gre,5:Kre};function Wre(e){return t=>({tagCode:parseInt(e),words:Jo.encode("unknown",t,Number.MAX_SAFE_INTEGER)})}function m1(e){return e.reverse().reduce((t,n,r)=>t+n*Math.pow(32,r),0)}function Gre(e){const t=[];let n,r,o,i,a,s=Jo.fromWordsUnsafe(e);for(;s.length>0;)n=Mo.encode(s.slice(0,33)),r=Mo.encode(s.slice(33,41)),o=parseInt(Mo.encode(s.slice(41,45)),16),i=parseInt(Mo.encode(s.slice(45,49)),16),a=parseInt(Mo.encode(s.slice(49,51)),16),s=s.slice(51),t.push({pubkey:n,short_channel_id:r,fee_base_msat:o,fee_proportional_millionths:i,cltv_expiry_delta:a});return t}function Kre(e){const t=e.slice().reverse().map(o=>[!!(o&1),!!(o&2),!!(o&4),!!(o&8),!!(o&16)]).reduce((o,i)=>o.concat(i),[]);for(;t.length{let a;t[i*2]?a="required":t[i*2+1]?a="supported":a="unsupported",n[o]=a});const r=t.slice(wh.length*2);return n.extra_bits={start_bit:wh.length*2,bits:r,has_required:r.reduce((o,i,a)=>a%2!==0?o||!1:o||i,!1)},n}function ER(e,t){let n,r;if(e.slice(-1).match(/^[munp]$/))n=e.slice(-1),r=e.slice(0,-1);else{if(e.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=e}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");const o=BigInt(r),i=n?o*f4/Ure[n]:o*f4;if(n==="p"&&o%BigInt(10)!==BigInt(0)||i>Vre)throw new Error("Amount is outside of valid range");return t?i.toString():i}function Xre(e,t){if(typeof e!="string")throw new Error("Lightning Payment Request must be string");if(e.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const n=[],r=Jo.decode(e,Number.MAX_SAFE_INTEGER);e=e.toLowerCase();const o=r.prefix;let i=r.words,a=e.slice(o.length+1),s=i.slice(-104);i=i.slice(0,-104);let l=o.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(l&&!l[2]&&(l=o.match(/^ln(\S+)$/)),!l)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});const u=l[1];let c;if(t){if(t.bech32===void 0||t.pubKeyHash===void 0||t.scriptHash===void 0||!Array.isArray(t.validWitnessVersions))throw new Error("Invalid network");c=t}else switch(u){case s4.bech32:c=s4;break;case l4.bech32:c=l4;break;case u4.bech32:c=u4;break;case c4.bech32:c=c4;break}if(!c||c.bech32!==u)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:u,value:c});const f=l[2];let d;if(f){const T=l[3];d=ER(f+T,!0),n.push({name:"amount",letters:l[2]+l[3],value:d})}else d=null;n.push({name:"separator",letters:"1"});const h=m1(i.slice(0,7));i=i.slice(7),n.push({name:"timestamp",letters:a.slice(0,7),value:h}),a=a.slice(7);let p,m,_,b;for(;i.length>0;){const T=i[0].toString();p=_R[T]||"unknown_tag",m=Hre[T]||Wre(T),i=i.slice(1),_=m1(i.slice(0,2)),i=i.slice(2),b=i.slice(0,_),i=i.slice(_),n.push({name:p,tag:a[0],letters:a.slice(0,1+2+_),value:m(b)}),a=a.slice(1+2+_)}n.push({name:"signature",letters:a.slice(0,104),value:Mo.encode(Jo.fromWordsUnsafe(s))}),a=a.slice(104),n.push({name:"checksum",letters:a});let g={paymentRequest:e,sections:n,get expiry(){let T=n.find(O=>O.name==="expiry");if(T)return E("timestamp")+T.value},get route_hints(){return n.filter(T=>T.name==="route_hint").map(T=>T.value)}};for(let T in Y2)T!=="route_hint"&&Object.defineProperty(g,T,{get(){return E(T)}});return g;function E(T){let O=n.find(A=>A.name===T);return O?O.value:void 0}}var qre={decode:Xre,hrpToMillisat:ER};function Z2(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Yre(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function CR(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Zre(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Z2(e.outputLen),Z2(e.blockLen)}function Qre(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Jre(e,t){CR(e);const n=t.outputLen;if(e.lengthe instanceof Uint8Array,pg=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Go=(e,t)=>e<<32-t|e>>>t,eoe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!eoe)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function toe(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function o_(e){if(typeof e=="string"&&(e=toe(e)),!xR(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function noe(...e){const t=new Uint8Array(e.reduce((r,o)=>r+o.length,0));let n=0;return e.forEach(r=>{if(!xR(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class OR{clone(){return this._cloneInto()}}function AR(e){const t=r=>e().update(o_(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function PR(e=32){if(hg&&typeof hg.getRandomValues=="function")return hg.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function roe(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),l=r?4:0,u=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+u,s,r)}class ooe extends OR{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=pg(this.buffer)}update(t){ys.exists(this);const{view:n,buffer:r,blockLen:o}=this;t=o_(t);const i=t.length;for(let a=0;ao-a&&(this.process(r,0),a=0);for(let f=a;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&n,aoe=(e,t,n)=>e&t^e&n^t&n,soe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Zi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qi=new Uint32Array(64);class TR extends ooe{constructor(){super(64,32,8,!1),this.A=Zi[0]|0,this.B=Zi[1]|0,this.C=Zi[2]|0,this.D=Zi[3]|0,this.E=Zi[4]|0,this.F=Zi[5]|0,this.G=Zi[6]|0,this.H=Zi[7]|0}get(){const{A:t,B:n,C:r,D:o,E:i,F:a,G:s,H:l}=this;return[t,n,r,o,i,a,s,l]}set(t,n,r,o,i,a,s,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=s|0,this.H=l|0}process(t,n){for(let f=0;f<16;f++,n+=4)Qi[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const d=Qi[f-15],h=Qi[f-2],p=Go(d,7)^Go(d,18)^d>>>3,m=Go(h,17)^Go(h,19)^h>>>10;Qi[f]=m+Qi[f-7]+p+Qi[f-16]|0}let{A:r,B:o,C:i,D:a,E:s,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=Go(s,6)^Go(s,11)^Go(s,25),h=c+d+ioe(s,l,u)+soe[f]+Qi[f]|0,m=(Go(r,2)^Go(r,13)^Go(r,22))+aoe(r,o,i)|0;c=u,u=l,l=s,s=a+h|0,a=i,i=o,o=r,r=h+m|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,s=s+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,o,i,a,s,l,u,c)}roundClean(){Qi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class loe extends TR{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const y1=AR(()=>new TR);AR(()=>new loe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const IR=BigInt(0),vm=BigInt(1),uoe=BigInt(2),wm=e=>e instanceof Uint8Array,coe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function zo(e){if(!wm(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+o.length,0));let n=0;return e.forEach(r=>{if(!wm(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function doe(e,t){if(e.length!==t.length)return!1;for(let n=0;nIR;e>>=vm,t+=1);return t}function moe(e,t){return e>>BigInt(t)&vm}const yoe=(e,t,n)=>e|(n?vm:IR)<(uoe<new Uint8Array(e),d4=e=>Uint8Array.from(e);function MR(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=mg(e),o=mg(e),i=0;const a=()=>{r.fill(1),o.fill(0),i=0},s=(...f)=>n(o,r,...f),l=(f=mg())=>{o=s(d4([0]),f),r=s(),f.length!==0&&(o=s(d4([1]),f),r=s())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f{a(),l(f);let h;for(;!(h=d(u()));)l();return a(),h}}const goe={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ed(e,t,n={}){const r=(o,i,a)=>{const s=goe[i];if(typeof s!="function")throw new Error(`Invalid validator "${i}", expected function`);const l=e[o];if(!(a&&l===void 0)&&!s(l,e))throw new Error(`Invalid param ${String(o)}=${l} (${typeof l}), expected ${i}`)};for(const[o,i]of Object.entries(t))r(o,i,!1);for(const[o,i]of Object.entries(n))r(o,i,!0);return e}const voe=Object.freeze(Object.defineProperty({__proto__:null,bitGet:moe,bitLen:poe,bitMask:s_,bitSet:yoe,bytesToHex:zo,bytesToNumberBE:xr,bytesToNumberLE:a_,concatBytes:Us,createHmacDrbg:MR,ensureBytes:Rn,equalBytes:doe,hexToBytes:xu,hexToNumber:i_,numberToBytesBE:Aa,numberToBytesLE:kR,numberToHexUnpadded:RR,numberToVarBytesBE:foe,utf8ToBytes:hoe,validateObject:Ed},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bn=BigInt(0),Qt=BigInt(1),ss=BigInt(2),woe=BigInt(3),Q2=BigInt(4),h4=BigInt(5),p4=BigInt(8);BigInt(9);BigInt(16);function Mn(e,t){const n=e%t;return n>=bn?n:t+n}function boe(e,t,n){if(n<=bn||t 0");if(n===Qt)return bn;let r=Qt;for(;t>bn;)t&Qt&&(r=r*e%n),e=e*e%n,t>>=Qt;return r}function oo(e,t,n){let r=e;for(;t-- >bn;)r*=r,r%=n;return r}function J2(e,t){if(e===bn||t<=bn)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Mn(e,t),r=t,o=bn,i=Qt;for(;n!==bn;){const s=r/n,l=r%n,u=o-i*s;r=n,n=l,o=i,i=u}if(r!==Qt)throw new Error("invert: does not exist");return Mn(o,t)}function Soe(e){const t=(e-Qt)/ss;let n,r,o;for(n=e-Qt,r=0;n%ss===bn;n/=ss,r++);for(o=ss;o(r[o]="function",r),t);return Ed(e,n)}function xoe(e,t,n){if(n 0");if(n===bn)return e.ONE;if(n===Qt)return t;let r=e.ONE,o=t;for(;n>bn;)n&Qt&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Qt;return r}function Ooe(e,t){const n=new Array(t.length),r=t.reduce((i,a,s)=>e.is0(a)?i:(n[s]=i,e.mul(i,a)),e.ONE),o=e.inv(r);return t.reduceRight((i,a,s)=>e.is0(a)?i:(n[s]=e.mul(i,n[s]),e.mul(i,a)),o),n}function l_(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Aoe(e,t,n=!1,r={}){if(e<=bn)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:i}=l_(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=_oe(e),s=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:s_(o),ZERO:bn,ONE:Qt,create:l=>Mn(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return bn<=l&&ll===bn,isOdd:l=>(l&Qt)===Qt,neg:l=>Mn(-l,e),eql:(l,u)=>l===u,sqr:l=>Mn(l*l,e),add:(l,u)=>Mn(l+u,e),sub:(l,u)=>Mn(l-u,e),mul:(l,u)=>Mn(l*u,e),pow:(l,u)=>xoe(s,l,u),div:(l,u)=>Mn(l*J2(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>J2(l,e),sqrt:r.sqrt||(l=>a(s,l)),invertBatch:l=>Ooe(s,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?kR(l,i):Aa(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?a_(l):xr(l)}});return Object.freeze(s)}function Poe(e,t,n=!1){e=Rn("privateHash",e);const r=e.length,o=l_(t).nByteLength+8;if(o<24||r1024)throw new Error(`hashToPrivateScalar: expected ${o}-1024 bytes of input, got ${r}`);const i=n?a_(e):xr(e);return Mn(i,t-Qt)+Qt}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Toe=BigInt(0),yg=BigInt(1);function Ioe(e,t){const n=(o,i)=>{const a=i.negate();return o?a:i},r=o=>{const i=Math.ceil(t/o)+1,a=2**(o-1);return{windows:i,windowSize:a}};return{constTimeNegate:n,unsafeLadder(o,i){let a=e.ZERO,s=o;for(;i>Toe;)i&yg&&(a=a.add(s)),s=s.double(),i>>=yg;return a},precomputeWindow(o,i){const{windows:a,windowSize:s}=r(i),l=[];let u=o,c=u;for(let f=0;f>=h,_>l&&(_-=d,a+=yg);const b=m,g=m+Math.abs(_)-1,E=p%2!==0,T=_<0;_===0?c=c.add(n(E,i[b])):u=u.add(n(T,i[g]))}return{p:u,f:c}},wNAFCached(o,i,a,s){const l=o._WINDOW_SIZE||1;let u=i.get(o);return u||(u=this.precomputeWindow(o,l),l!==1&&i.set(o,s(u))),this.wNAF(l,u,a)}}}function DR(e){return Coe(e.Fp),Ed(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...l_(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Roe(e){const t=DR(e);Ed(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:koe,hexToBytes:Moe}=voe,gs={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=gs;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:koe(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=gs,n=typeof e=="string"?Moe(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:o,l:i}=gs._parseInt(n.subarray(2)),{d:a,l:s}=gs._parseInt(i);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=t(n(e.s)),o=t(n(e.r)),i=r.length/2,a=o.length/2,s=n(i),l=n(a);return`30${n(a+i+4)}02${l}${o}02${s}${r}`}},Ei=BigInt(0),lo=BigInt(1);BigInt(2);const m4=BigInt(3);BigInt(4);function Doe(e){const t=Roe(e),{Fp:n}=t,r=t.toBytes||((p,m,_)=>{const b=m.toAffine();return Us(Uint8Array.from([4]),n.toBytes(b.x),n.toBytes(b.y))}),o=t.fromBytes||(p=>{const m=p.subarray(1),_=n.fromBytes(m.subarray(0,n.BYTES)),b=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:_,y:b}});function i(p){const{a:m,b:_}=t,b=n.sqr(p),g=n.mul(b,p);return n.add(n.add(g,n.mul(p,m)),_)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function a(p){return typeof p=="bigint"&&Ein.eql(E,n.ZERO);return g(_)&&g(b)?f.ZERO:new f(_,b,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const _=n.invertBatch(m.map(b=>b.pz));return m.map((b,g)=>b.toAffine(_[g])).map(f.fromAffine)}static fromHex(m){const _=f.fromAffine(o(Rn("pointHex",m)));return _.assertValidity(),_}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:m,y:_}=this.toAffine();if(!n.isValid(m)||!n.isValid(_))throw new Error("bad point: x or y not FE");const b=n.sqr(_),g=i(m);if(!n.eql(b,g))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:_,py:b,pz:g}=this,{px:E,py:T,pz:O}=m,A=n.eql(n.mul(_,O),n.mul(E,g)),C=n.eql(n.mul(b,O),n.mul(T,g));return A&&C}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:_}=t,b=n.mul(_,m4),{px:g,py:E,pz:T}=this;let O=n.ZERO,A=n.ZERO,C=n.ZERO,y=n.mul(g,g),S=n.mul(E,E),v=n.mul(T,T),x=n.mul(g,E);return x=n.add(x,x),C=n.mul(g,T),C=n.add(C,C),O=n.mul(m,C),A=n.mul(b,v),A=n.add(O,A),O=n.sub(S,A),A=n.add(S,A),A=n.mul(O,A),O=n.mul(x,O),C=n.mul(b,C),v=n.mul(m,v),x=n.sub(y,v),x=n.mul(m,x),x=n.add(x,C),C=n.add(y,y),y=n.add(C,y),y=n.add(y,v),y=n.mul(y,x),A=n.add(A,y),v=n.mul(E,T),v=n.add(v,v),y=n.mul(v,x),O=n.sub(O,y),C=n.mul(v,S),C=n.add(C,C),C=n.add(C,C),new f(O,A,C)}add(m){c(m);const{px:_,py:b,pz:g}=this,{px:E,py:T,pz:O}=m;let A=n.ZERO,C=n.ZERO,y=n.ZERO;const S=t.a,v=n.mul(t.b,m4);let x=n.mul(_,E),I=n.mul(b,T),R=n.mul(g,O),k=n.add(_,b),M=n.add(E,T);k=n.mul(k,M),M=n.add(x,I),k=n.sub(k,M),M=n.add(_,g);let N=n.add(E,O);return M=n.mul(M,N),N=n.add(x,R),M=n.sub(M,N),N=n.add(b,g),A=n.add(T,O),N=n.mul(N,A),A=n.add(I,R),N=n.sub(N,A),y=n.mul(S,M),A=n.mul(v,R),y=n.add(A,y),A=n.sub(I,y),y=n.add(I,y),C=n.mul(A,y),I=n.add(x,x),I=n.add(I,x),R=n.mul(S,R),M=n.mul(v,M),I=n.add(I,R),R=n.sub(x,R),R=n.mul(S,R),M=n.add(M,R),x=n.mul(I,M),C=n.add(C,x),x=n.mul(N,M),A=n.mul(k,A),A=n.sub(A,x),x=n.mul(k,I),y=n.mul(N,y),y=n.add(y,x),new f(A,C,y)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,_=>{const b=n.invertBatch(_.map(g=>g.pz));return _.map((g,E)=>g.toAffine(b[E])).map(f.fromAffine)})}multiplyUnsafe(m){const _=f.ZERO;if(m===Ei)return _;if(s(m),m===lo)return this;const{endo:b}=t;if(!b)return h.unsafeLadder(this,m);let{k1neg:g,k1:E,k2neg:T,k2:O}=b.splitScalar(m),A=_,C=_,y=this;for(;E>Ei||O>Ei;)E&lo&&(A=A.add(y)),O&lo&&(C=C.add(y)),y=y.double(),E>>=lo,O>>=lo;return g&&(A=A.negate()),T&&(C=C.negate()),C=new f(n.mul(C.px,b.beta),C.py,C.pz),A.add(C)}multiply(m){s(m);let _=m,b,g;const{endo:E}=t;if(E){const{k1neg:T,k1:O,k2neg:A,k2:C}=E.splitScalar(_);let{p:y,f:S}=this.wNAF(O),{p:v,f:x}=this.wNAF(C);y=h.constTimeNegate(T,y),v=h.constTimeNegate(A,v),v=new f(n.mul(v.px,E.beta),v.py,v.pz),b=y.add(v),g=S.add(x)}else{const{p:T,f:O}=this.wNAF(_);b=T,g=O}return f.normalizeZ([b,g])[0]}multiplyAndAddUnsafe(m,_,b){const g=f.BASE,E=(O,A)=>A===Ei||A===lo||!O.equals(g)?O.multiplyUnsafe(A):O.multiply(A),T=E(this,_).add(E(m,b));return T.is0()?void 0:T}toAffine(m){const{px:_,py:b,pz:g}=this,E=this.is0();m==null&&(m=E?n.ONE:n.inv(g));const T=n.mul(_,m),O=n.mul(b,m),A=n.mul(g,m);if(E)return{x:n.ZERO,y:n.ZERO};if(!n.eql(A,n.ONE))throw new Error("invZ was invalid");return{x:T,y:O}}isTorsionFree(){const{h:m,isTorsionFree:_}=t;if(m===lo)return!0;if(_)return _(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:_}=t;return m===lo?this:_?_(f,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return zo(this.toRawBytes(m))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=t.nBitLength,h=Ioe(f,t.endo?Math.ceil(d/2):d);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:a}}function Loe(e){const t=DR(e);return Ed(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Noe(e){const t=Loe(e),{Fp:n,n:r}=t,o=n.BYTES+1,i=2*n.BYTES+1;function a(M){return Eizo(Aa(M,t.nByteLength));function p(M){const N=r>>lo;return M>N}function m(M){return p(M)?s(-M):M}const _=(M,N,D)=>xr(M.slice(N,D));class b{constructor(N,D,L){this.r=N,this.s=D,this.recovery=L,this.assertValidity()}static fromCompact(N){const D=t.nByteLength;return N=Rn("compactSignature",N,D*2),new b(_(N,0,D),_(N,D,2*D))}static fromDER(N){const{r:D,s:L}=gs.toSig(Rn("DER",N));return new b(D,L)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new b(this.r,this.s,N)}recoverPublicKey(N){const{r:D,s:L,recovery:j}=this,F=C(Rn("msgHash",N));if(j==null||![0,1,2,3].includes(j))throw new Error("recovery id invalid");const B=j===2||j===3?D+t.n:D;if(B>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const U=j&1?"03":"02",K=u.fromHex(U+h(B)),W=l(B),Q=s(-F*W),X=s(L*W),J=u.BASE.multiplyAndAddUnsafe(K,Q,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return xu(this.toDERHex())}toDERHex(){return gs.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return xu(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const g={isValidPrivateKey(M){try{return c(M),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const M=t.randomBytes(n.BYTES+8),N=Poe(M,r);return Aa(N,t.nByteLength)},precompute(M=8,N=u.BASE){return N._setWindowSize(M),N.multiply(BigInt(3)),N}};function E(M,N=!0){return u.fromPrivateKey(M).toRawBytes(N)}function T(M){const N=M instanceof Uint8Array,D=typeof M=="string",L=(N||D)&&M.length;return N?L===o||L===i:D?L===2*o||L===2*i:M instanceof u}function O(M,N,D=!0){if(T(M))throw new Error("first arg must be private key");if(!T(N))throw new Error("second arg must be public key");return u.fromHex(N).multiply(c(M)).toRawBytes(D)}const A=t.bits2int||function(M){const N=xr(M),D=M.length*8-t.nBitLength;return D>0?N>>BigInt(D):N},C=t.bits2int_modN||function(M){return s(A(M))},y=s_(t.nBitLength);function S(M){if(typeof M!="bigint")throw new Error("bigint expected");if(!(Ei<=M&&Mle in D))throw new Error("sign() legacy options not supported");const{hash:L,randomBytes:j}=t;let{lowS:F,prehash:B,extraEntropy:U}=D;F==null&&(F=!0),M=Rn("msgHash",M),B&&(M=Rn("prehashed msgHash",L(M)));const K=C(M),W=c(N),Q=[S(W),S(K)];if(U!=null){const le=U===!0?j(n.BYTES):U;Q.push(Rn("extraEntropy",le,n.BYTES))}const X=Us(...Q),J=K;function te(le){const ge=A(le);if(!d(ge))return;const se=l(ge),ue=u.BASE.multiply(ge).toAffine(),Ie=s(ue.x);if(Ie===Ei)return;const gt=s(se*s(J+Ie*W));if(gt===Ei)return;let ie=(ue.x===Ie?0:2)|Number(ue.y&lo),Ce=gt;return F&&p(gt)&&(Ce=m(gt),ie^=1),new b(Ie,Ce,ie)}return{seed:X,k2sig:te}}const x={lowS:t.lowS,prehash:!1},I={lowS:t.lowS,prehash:!1};function R(M,N,D=x){const{seed:L,k2sig:j}=v(M,N,D),F=t;return MR(F.hash.outputLen,F.nByteLength,F.hmac)(L,j)}u.BASE._setWindowSize(8);function k(M,N,D,L=I){var ue;const j=M;if(N=Rn("msgHash",N),D=Rn("publicKey",D),"strict"in L)throw new Error("options.strict was renamed to lowS");const{lowS:F,prehash:B}=L;let U,K;try{if(typeof j=="string"||j instanceof Uint8Array)try{U=b.fromDER(j)}catch(Ie){if(!(Ie instanceof gs.Err))throw Ie;U=b.fromCompact(j)}else if(typeof j=="object"&&typeof j.r=="bigint"&&typeof j.s=="bigint"){const{r:Ie,s:gt}=j;U=new b(Ie,gt)}else throw new Error("PARSE");K=u.fromHex(D)}catch(Ie){if(Ie.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(F&&U.hasHighS())return!1;B&&(N=t.hash(N));const{r:W,s:Q}=U,X=C(N),J=l(Q),te=s(X*J),le=s(W*J),ge=(ue=u.BASE.multiplyAndAddUnsafe(K,te,le))==null?void 0:ue.toAffine();return ge?s(ge.x)===W:!1}return{CURVE:t,getPublicKey:E,getSharedSecret:O,sign:R,verify:k,ProjectivePoint:u,Signature:b,utils:g}}class LR extends OR{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,ys.hash(t);const r=o_(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?t.create().update(r).digest():r);for(let a=0;anew LR(e,t).update(n).digest();NR.create=(e,t)=>new LR(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Boe(e){return{hash:e,hmac:(t,...n)=>NR(e,t,noe(...n)),randomBytes:PR}}function joe(e,t){const n=r=>Noe({...e,...Boe(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bm=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),g1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),BR=BigInt(1),v1=BigInt(2),y4=(e,t)=>(e+t/v1)/t;function jR(e){const t=bm,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),l=BigInt(88),u=e*e*e%t,c=u*u*e%t,f=oo(c,n,t)*c%t,d=oo(f,n,t)*c%t,h=oo(d,v1,t)*u%t,p=oo(h,o,t)*h%t,m=oo(p,i,t)*p%t,_=oo(m,s,t)*m%t,b=oo(_,l,t)*_%t,g=oo(b,s,t)*m%t,E=oo(g,n,t)*c%t,T=oo(E,a,t)*p%t,O=oo(T,r,t)*u%t,A=oo(O,v1,t);if(!ew.eql(ew.sqr(A),e))throw new Error("Cannot find square root");return A}const ew=Aoe(bm,void 0,void 0,{sqrt:jR}),u_=joe({a:BigInt(0),b:BigInt(7),Fp:ew,n:g1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=g1,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-BR*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,a=BigInt("0x100000000000000000000000000000000"),s=y4(i*e,t),l=y4(-r*e,t);let u=Mn(e-s*n-l*o,t),c=Mn(-s*r-l*i,t);const f=u>a,d=c>a;if(f&&(u=t-u),d&&(c=t-c),u>a||c>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},y1),Sm=BigInt(0),FR=e=>typeof e=="bigint"&&Smtypeof e=="bigint"&&Smo.charCodeAt(0)));n=Us(r,r),g4[e]=n}return y1(Us(n,...t))}const c_=e=>e.toRawBytes(!0).slice(1),tw=e=>Aa(e,32),gg=e=>Mn(e,bm),Uf=e=>Mn(e,g1),f_=u_.ProjectivePoint,$oe=(e,t,n)=>f_.BASE.multiplyAndAddUnsafe(e,t,n);function nw(e){let t=u_.utils.normPrivateKeyToScalar(e),n=f_.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:Uf(-t),bytes:c_(n)}}function $R(e){if(!FR(e))throw new Error("bad x: need 0 < x < p");const t=gg(e*e),n=gg(t*e+BigInt(7));let r=jR(n);r%v1!==Sm&&(r=gg(-r));const o=new f_(e,r,BR);return o.assertValidity(),o}function zR(...e){return Uf(xr(w1("BIP0340/challenge",...e)))}function zoe(e){return nw(e).bytes}function Uoe(e,t,n=PR(32)){const r=Rn("message",e),{bytes:o,scalar:i}=nw(t),a=Rn("auxRand",n,32),s=tw(i^xr(w1("BIP0340/aux",a))),l=w1("BIP0340/nonce",s,o,r),u=Uf(xr(l));if(u===Sm)throw new Error("sign failed: k is zero");const{bytes:c,scalar:f}=nw(u),d=zR(c,o,r),h=new Uint8Array(64);if(h.set(c,0),h.set(tw(Uf(f+d*i)),32),!UR(h,r,o))throw new Error("sign: Invalid signature produced");return h}function UR(e,t,n){const r=Rn("signature",e,64),o=Rn("message",t),i=Rn("publicKey",n,32);try{const a=$R(xr(i)),s=xr(r.subarray(0,32));if(!FR(s))return!1;const l=xr(r.subarray(32,64));if(!Foe(l))return!1;const u=zR(tw(s),c_(a),o),c=$oe(a,l,Uf(-u));return!(!c||!c.hasEvenY()||c.toAffine().x!==s)}catch{return!1}}const b1=(()=>({getPublicKey:zoe,sign:Uoe,verify:UR,utils:{randomPrivateKey:u_.utils.randomPrivateKey,lift_x:$R,pointToBytes:c_,numberToBytesBE:Aa,bytesToNumberBE:xr,taggedHash:w1,mod:Mn}}))();var d_=(e=>(e.PublicKeys="npub",e.PrivateKeys="nsec",e.NoteIDs="note",e.LNURL="lnurl",e.Profile="nprofile",e.Event="nevent",e.Relay="nrelay",e.EventCoordinate="naddr",e))(d_||{}),Cd=(e=>(e.AUTH="AUTH",e.CLOSE="CLOSE",e.COUNT="COUNT",e.EVENT="EVENT",e.REQ="REQ",e))(Cd||{}),ar=(e=>(e[e.METADATA=0]="METADATA",e[e.SHORT_TEXT_NOTE=1]="SHORT_TEXT_NOTE",e[e.RECOMMEND_RELAY=2]="RECOMMEND_RELAY",e[e.CONTACTS=3]="CONTACTS",e[e.ENCRYPTED_DIRECT_MESSAGES=4]="ENCRYPTED_DIRECT_MESSAGES",e[e.EVENT_DELETION=5]="EVENT_DELETION",e[e.REPOST=6]="REPOST",e[e.REACTION=7]="REACTION",e[e.BADGE_AWARD=8]="BADGE_AWARD",e[e.GENERIC_REPOST=16]="GENERIC_REPOST",e[e.CHANNEL_CREATION=40]="CHANNEL_CREATION",e[e.CHANNEL_METADATA=41]="CHANNEL_METADATA",e[e.CHANNEL_MESSAGE=42]="CHANNEL_MESSAGE",e[e.CHANNEL_HIDE_MESSAGE=43]="CHANNEL_HIDE_MESSAGE",e[e.CHANNEL_MUTE_USER=44]="CHANNEL_MUTE_USER",e[e.FILE_METADATA=1063]="FILE_METADATA",e[e.LIVE_CHAT_MESSAGE=1311]="LIVE_CHAT_MESSAGE",e[e.REPORTING=1984]="REPORTING",e[e.LABEL=1985]="LABEL",e[e.ZAP_REQUEST=9734]="ZAP_REQUEST",e[e.ZAP_RECEIPT=9735]="ZAP_RECEIPT",e[e.MUTE_LIST=1e4]="MUTE_LIST",e[e.PIN_LIST=10001]="PIN_LIST",e[e.RELAY_LIST_METADATA=10002]="RELAY_LIST_METADATA",e[e.WALLET_INFO=13194]="WALLET_INFO",e[e.CLIENT_AUTHENTICATION=22242]="CLIENT_AUTHENTICATION",e[e.WALLET_REQUEST=23194]="WALLET_REQUEST",e[e.WALLET_RESPONSE=23195]="WALLET_RESPONSE",e[e.NOSTR_CONNECT=24133]="NOSTR_CONNECT",e[e.HTTP_AUTH=27235]="HTTP_AUTH",e[e.CATEGORIZED_PEOPLE_LIST=3e4]="CATEGORIZED_PEOPLE_LIST",e[e.CATEGORIZED_BOOKMARK_LIST=30001]="CATEGORIZED_BOOKMARK_LIST",e[e.PROFILE_BADGES=30008]="PROFILE_BADGES",e[e.BADGE_DEFINITION=30009]="BADGE_DEFINITION",e[e.CREATE_OR_UPDATE_A_STALL=30017]="CREATE_OR_UPDATE_A_STALL",e[e.CREATE_OR_UPDATE_A_PRODUCT=30018]="CREATE_OR_UPDATE_A_PRODUCT",e[e.LONG_FORM_CONTENT=30023]="LONG_FORM_CONTENT",e[e.DRAFT_LONG_FORM_CONTENT=30024]="DRAFT_LONG_FORM_CONTENT",e[e.APPLICATION_SPECIFIC_DATA=30078]="APPLICATION_SPECIFIC_DATA",e[e.LIVE_EVENT=30311]="LIVE_EVENT",e[e.CLASSIFIED_LISTING=30402]="CLASSIFIED_LISTING",e[e.DRAFT_CLASSIFIED_LISTING=30403]="DRAFT_CLASSIFIED_LISTING",e[e.HANDLER_RECOMMENDATION=31989]="HANDLER_RECOMMENDATION",e[e.HANDLER_INFORMATION=31990]="HANDLER_INFORMATION",e))(ar||{}),VR=(e=>(e.GITHUB="github",e.TWITTER="twitter",e.MASTODON="mastodon",e.TELEGRAM="telegram",e))(VR||{}),ml=(e=>(e.AUTH="AUTH",e.COUNT="COUNT",e.EOSE="EOSE",e.EVENT="EVENT",e.NOTICE="NOTICE",e.OK="OK",e))(ml||{});function HR(e){const t=new Uint8Array(Math.ceil(e.length/2));for(let n=0;nt.toString(16).padStart(2,"0")).join("")}function Voe(e){const t=[];for(const i of e){const a=new Uint8Array([i.type]);let s;i.type===1?s=new TextEncoder().encode(i.value):i.type===3?s=new Uint32Array([i.value]):s=HR(i.value);const l=new Uint8Array([s.length]);t.push(a),t.push(l),t.push(s)}let n=t.reduce((i,a)=>i+a.length,0);const r=new Uint8Array(n);let o=0;for(const i of t)r.set(i,o),o+=i.length;return r}function Hoe(e){let t=0;const n=[];for(;t{let n;return t.type===3?n=t.value:t.type===1?n=new TextDecoder().decode(t.value):n=WR(t.value),{type:t.type,value:n}})}function GR(e,t){let n;e==="npub"||e==="nsec"||e==="note"||e==="lnurl"?n=HR(t[0].value):n=Voe(t);const r=Lo.toWords(new Uint8Array(n.buffer));return Lo.encode(e,r,1023)}function Ts(e){const{prefix:t,words:n}=Lo.decode(e,1023),r=new Uint8Array(Lo.fromWords(n));let o;if(t==="npub"||t==="nsec"||t==="note"||t==="lnurl")o=[{type:0,value:WR(r)}];else if(t==="nprofile"||t==="nevent"||t==="nrelay"||t==="naddr"){const i=Hoe(r);o=Woe(i)}else throw new Error("Unknown prefix: "+t);return{prefix:t,tlvItems:o}}function Goe(e){return qre.decode(e)}function Koe(e){const t=e.tags.filter(r=>r[0]==="amount");if(t.length===0)return;const n=[];for(const r of t)r.length===2&&n.push(r[1]);return n&&n.length>0?n:void 0}function Xoe(e){return["amount",e]}function KR(e){if(!e.tags)return;let t=!1,n="";for(const r of e.tags)r.find(i=>i==="content-warning")&&(t=!0,r.length===2&&r[0]==="content-warning"||r.length===3&&r[2]==="content-warning"&&r[0]==="l"?n=r[1]:n="N/A");return t?n:void 0}var qoe=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/,Yoe=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/g,XR=(e=>(e.npub="npub",e.nsec="nsec",e.note="note",e.lnurl="lnurl",e.nprofile="nprofile",e.nevent="nevent",e))(XR||{});function Zoe(e){if(typeof e!="string")return null;const t=e.match(qoe);return t&&t.length===3?{prefix:t[1],bech32:`${t[1]}${t[2]}`}:null}function Qoe(e){return Zoe(e)!==null}function qR(e){return/^(wss?):\/\/([a-zA-Z0-9.-]+)(:\d+)?(\/[a-zA-Z0-9_/.-]*)?$/.test(e)}function Joe(e,t){if(!e||e==="")return{isValid:!0};if(t===6)try{return JSON.parse(e),{isValid:!0}}catch(n){return console.error(n),{isValid:!1,error:"Invalid JSON format"}}else if(t===2&&!qR(e))return{isValid:!1,error:`Expected a valid websocket URL, got ${e}.`};return eie(e)?{isValid:!1,error:"HTML tags are not allowed"}:{isValid:!0}}function eie(e){return/<[^>]*>/.test(e)}var YR=[{name:"www.youtube.com"},{name:"music.youtube.com"},{name:"youtu.be",rewrite:e=>`https://www.youtube.com/watch?v=${e.split("/").pop()}`},{name:"twitch.tv"},{name:"vimeo.com"},{name:"rumble.com"}],tie=["jpg","jpeg","png","gif","webp"],nie=["mp4","webm","ogg"],rie=YR.map(e=>e.name.replace(/\./g,"\\.")).join("|"),oie=nie.join("|"),iie=`https?:\\/\\/(${rie})\\/\\w+\\/([a-zA-Z0-9_-]+)(?:\\?[a-zA-Z0-9_=&-]+)?|https?:\\/\\/\\S+\\.(${oie})`,aie=new RegExp(iie,"gi"),sie=tie.join("|"),lie=new RegExp(`\\bhttps?:\\/\\/\\S+?\\.(${sie})(?:\\?\\S+)?\\b`,"gi");function ZR(e){if(e===void 0)return;const t=e==null?void 0:e.match(lie),n=e==null?void 0:e.match(aie),o=Array.from(e.matchAll(Yoe),s=>s.slice(1,3)).map(([s,l])=>Object.values(XR).includes(s)?{type:s,data:l}:null).filter(s=>s!==null),i=/#[a-zA-Z0-9_-]+/gi,a=e==null?void 0:e.match(i);return t&&e&&t.forEach(s=>e=e.replace(s,"")),n&&e&&n.forEach(s=>e=e.replace(s,"")),n&&n.forEach((s,l)=>{const u=YR.find(c=>s.includes(c.name));u!=null&&u.rewrite&&(n[l]=u.rewrite(s))}),{images:t||void 0,videos:n||void 0,nurls:o&&o.length>0?o:void 0,tags:a||void 0,text:e.trim()}}function uie(e){if(!e)return;let t=[];for(let n of e){if(!Array.isArray(n)||n.length<2||n.length>3||n[0]!=="a")continue;let r=n[1].split(":");if(r.length!==3)continue;let o=r[0],i=r[1],a=r[2],s;n.length===3&&(s=n[2]),t.push({kind:o,pubkey:i,identifier:a,relay:s})}if(t.length!==0)return t}function cie(e){const t=uie(e.tags);if(t)return t}function fie(e){const{kind:t,pubkey:n,identifier:r,relay:o}=e;return o?[`a:${t}:${n}:${r}, ${o}`]:[`a:${t}:${n}:${r}`]}function die(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({eventId:r[1]}):r.length===3?n.push({eventId:r[1],relayUrl:r[2]}):r.length===4&&n.push({eventId:r[1],relayUrl:r[2],marker:r[3]});return n&&n.length>0?n:void 0}function hie(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(let r=0;r2&&(r===1?n.push({eventId:t[r][1],relayUrl:"",marker:"mention"}):r>1&&n.push({eventId:t[r][1],relayUrl:"",marker:"reply"}));return n&&n.length>0?n:void 0}function pie(e){return!e.tags||e.tags.length===0?!1:e.tags.filter(n=>n[0]==="e"&&n.length>2).length===0}function mie(e){const t=e.tags.filter(n=>n[0]==="expiration");if(t.length!==0)return parseInt(t[0][1])}function yie(e){const t=[],n=e.tags.filter(r=>r[0]==="d");if(n.length!==0){for(const r of n){let o=r[1]||"";t.includes(o)||t.push(o)}return t&&t.length>0?t:void 0}}function gie(e){return["d",e]}function vie(e){const t=e.tags.filter(r=>r[0]==="lnurl");if(t.length===0)return;const n=[];for(const r of t)r.length>0&&n.push(r[1]);return n&&n.length>0?n:void 0}function wie(e){return["lnurl",e]}function bie(e){const t=e.tags.filter(n=>n[0]==="nonce");if(t.length!==0)return[parseInt(t[0][1]),parseInt(t[0][2])]}function Sie(e,t){if(e.hasNonceTag())throw new Error("Event already has a nonce.");if(t.length!==2)throw new Error("Nonce must be an array of 2 numbers: [miningResult, difficulty]");const n=t[0].toString(),r=t[1].toString();return e.addTag(["nonce",n,r]),e}function _ie(e,t){return e.tags=e.tags.filter(n=>n[0]!=="nonce"),e.addNonceTag(t),e}function Eie(e){const t=e.tags.filter(r=>r[0]==="p");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push([r[1]]):r.length===3&&n.push([r[1],r[2]]);return n}function Cie(e){const t=e.tags.filter(r=>r[0]==="relays");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({url:r[1],read:!0,write:!0}):r.length===3&&n.push({url:r[1],read:r[2]==="read",write:r[2]==="write"});return n.length>0?n:void 0}function xie(e){if(e.kind!==1984)throw new Error(`Event is not a report: ${e.kind}. Expected 1984.`);const t=e.tags.filter(s=>s[0]==="p");if(!t||t.length===0)return;let n;const r=e.tags.filter(s=>s[0]==="e");r.length>0&&r[0].length>0&&(n=r[0][1]);let o;t[0].length===3?o=t[0][2]:r.length>0&&r[0].length===3&&(o=r[0][2]);let i;return t[0].length>0&&(i=t[0][1]),!o||!i?void 0:{eventId:n,kind:o,publicKey:i,content:e.content&&e.content!==""?e.content:void 0}}function Oie(e){const{eventId:t,kind:n,publicKey:r}=e;if(!n)throw new Error("Report must have a kind.");if(!r)throw new Error("Report must mention a public key.");if(n==="impersonation"&&t)throw new Error("Impersonation reports should refer to a person, not an event.");const o=[];return t?(o.push(["e",t,n]),r&&o.push(["p",r])):r&&o.push(["p",r,n]),o}function Aie(e){const t=e.tags.filter(n=>n[0]==="subject");if(t.length!==0)return t[0][1]}function QR(e){return e?e.startsWith("Re:"):!1}function Pie(e){return QR(e)?e:`Re: ${e}`}function Tie(e){const t=e.tags?e.tags.filter(n=>n[0]==="t"):[];return t.length>0?t.map(n=>n[1]):void 0}function Iie(){const e=b1.utils.randomPrivateKey(),t=b1.getPublicKey(e);return{privateKey:zo(e),publicKey:zo(t)}}function Rie(e){return zo(b1.getPublicKey(Buffer.from(e,"hex")))}function kie(e){return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}var JR=new TextEncoder,v4=new TextDecoder("utf-8");function ek(e){const t=y1(JR.encode(e));return zo(t)}function tk({callback:e,amount:t,event:n,lnurl:r}){return`${e}?amount=${t}&nostr=${n}&lnurl=${r}`}function Mie(e){if(e.allowsNostr&&e.nostrPubkey)return!0}function Die(e,t){const n=e.amount?e.amount:void 0,r=e.lnurl?e.lnurl:void 0;if(!n||!r)return!0;const o=Goe(t.pr);let i;const a=o.sections.find(s=>s.name==="amount");if(a)i=a.value;else return!1;return!(n&&n.toString()!==i)}function Lie(e){const t=new sr(e),n=t.hasPublicKeyTags();if(!n)throw new Error("No pubkey tags found");if(e.kind!==9734)throw new Error("Event is not a zap request");const r=n[0],o=t.hasRelaysTag(),i={pubkey:r,content:"",id:t.id,sig:t.sig,kind:t.kind,tags:t.tags,relays:o};return JSON.stringify(i)}function Nie(e){let t=/,*?((lnurl)([0-9]{1,}[a-z0-9]+){1})/.exec(e.toLowerCase());return t?t[1]:null}function Bie(e){if(e=e.trim(),e.toLowerCase().slice(0,6)==="lnurl1"){const{words:t}=Lo.decode(e,2e4),n=new Uint8Array(Lo.fromWords(t));return v4.decode(n)}else if(e.slice(0,9)==="lnurlc://"||e.slice(0,9)==="lnurlw://"||e.slice(0,9)==="lnurlp://"||e.slice(0,10)==="keyauth://"){let[t,n]=e.split("://");return(n.match(/\.onion($|\W)/)?"http":"https")+"://"+n}else if(e.slice(0,8)==="https://"){let t=Nie(e);if(t){const{words:n}=Lo.decode(t,2e4),r=new Uint8Array(Lo.fromWords(n));return v4.decode(r)}return e}throw new Error(`invalid url ${e}`)}function nk(e){const t=JR.encode(e),n=Lo.toWords(new Uint8Array(t));return Lo.encode("lnurl",n,2e4)}function rk(e){return e.endsWith(".onion")}function jie(e){const[t,n]=e.split("@");return`${rk(n)?"http":"https"}://${n}/.well-known/lnurlp/${t}`}function Fie(e){const[t,n]=e.split("@");return`${rk(n)?"http":"https"}://${n}/.well-known/nostr.json?name=${t}`}function $ie(e){let t=0;for(let n=0;nl[0]==="nonce");i!==-1?e.tags[i][1]=r.toString():e.tags.push(["nonce",r.toString(),o]);const a=JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content]);if(e.id=ek(a),$ie(e.id)>=t)return console.log("Proof of work complete"),e.tags=e.tags.filter(l=>l[0]!=="nonce"),e.tags.push(["nonce",r.toString(),o]),e;if(n&&r>=n)return;r++}}function h_(e){return/^[a-z0-9\.\-_\/@]*$/.test(e)}function Uie(e){return e.toLowerCase()}function Vie(e,t){if(e.length!==64)throw new Error("Invalid event hash");const n=b1.sign(e,t);return zo(n)}function Hie(e){return e?JSON.stringify(e):""}function Wie(e){try{const t=JSON.parse(e);return{name:t.name??null,display_name:t.display_name??null,picture:t.picture??null,banner:t.banner??null,nip05:t.nip05??null,website:t.website??null,about:t.about??null,image:t.image??null,npub:t.npub??null,lud16:t.lud16??null,lud06:t.lud06??null}}catch(t){return console.error("Unable to parse user metadata string",t),null}}var Gie=class{constructor(e){if(e){if(!h_(e.identity))throw new Error("Invalid identity. Valid: a-z, 0-9, -, _, @");this.type=e.type,this.identity=Uie(e.identity),this.proof=e.proof}}toTag(){switch(this.type){case"github":return["i",`github:${this.identity}`,this.proof];case"twitter":return["i",`twitter:${this.identity}`,this.proof];case"mastodon":return["i",`mastodon:${this.identity}`,this.proof];case"telegram":return["i",`telegram:${this.identity}`,this.proof];default:throw new Error(`Unknown claim type ${this.type}. Valid: github, twitter, mastodon, telegram`)}}fromTag(e){if(ok(e))return this.type=e[1].split(":")[0],this.identity=e[1].split(":")[1],this.proof=e[2],this}};function ok(e){return!(e.length!==3||!Object.values(VR).includes(e[1].split(":")[0])||!h_(e[1].split(":")[1]))}function ik(e){const t=e.tags.filter(r=>r[0]==="i"&&ok(r));if(t.length===0)return;const n=[];for(const r of t){const o=new Gie;o.fromTag(r),n.push(o)}return n}var sr=class{constructor(e){this.id=e.id?e.id:"",this.pubkey=e.pubkey?e.pubkey:"",this.created_at=e.created_at?e.created_at:Math.floor(Date.now()/1e3),this.kind=e.kind!=null?e.kind:1,this.tags=e.tags&&e.tags.length>0?e.tags:[],this.content=e.content,this.sig=e.sig?e.sig:""}generateId(){if(this.pubkey==="")throw new Error("Cannot generate event ID without a public key. Set a public key first.");const e=kie(this.ToObj());this.id=ek(e)}sign(e){if(this.id==="")throw new Error("Cannot sign event without an ID. Generate ID first.");this.pubkey=e.publicKey,this.sig=Vie(this.id,e.privateKey)}signAndGenerateId(e){this.pubkey=e.publicKey,this.generateId(),this.sign(e)}ToObj(){const e={};for(const[t,n]of Object.entries(this))n!==void 0&&(e[t]=n);return e}toURI(){return encodeURI(JSON.stringify(this.ToObj()))}proofOfWork(e,t){const n=zie(this,e,t);if(n)this.id=n.id,this.tags=n.tags;else throw new Error("Failed to generate proof of work.")}hasMentions(){const e=this.extractContent();if(!e)return;const t=e==null?void 0:e.nurls.filter(n=>n.type==="npub");return t.length>0?t:void 0}setContentWithoutChecks(e){return this.content=e,this}extractContent(){return ZR(this.content)}addTag(e){this.tags||(this.tags=[]),this.tags.push(e)}removeTag(e){this.tags&&(this.tags=this.tags.filter(t=>t[0]!==e[0]&&t[1]!==e[1]))}addEventTag(e){const t=e.relayUrl?e.relayUrl:"";let n=["e",e.eventId];e.marker?n=[...n,t,e.marker]:e.relayUrl&&(n=[...n,e.relayUrl]),this.addTag(n)}hasEventTags(){return pie(this)?hie(this):die(this)}hasTags(){return Tie(this)}addPublicKeyTag(e,t){const n=["p",e];t&&n.push(t),this.addTag(n)}hasPublicKeyTags(){return Eie(this)}addRelaysTag(e){const t=this.tags.filter(n=>n[0]==="relays");if(t.length===0)this.tags.push(["relays",...e]);else for(const n of t)n.splice(1,0,...e)}hasRelaysTag(){return Cie(this)}addEventCoordinatesTag(e){this.addTag(fie(e))}hasEventCoordinatesTags(){return cie(this)}addIdentifierTag(e){this.addTag(gie(e))}hasIdentifierTags(){return yie(this)}addLnurlTag(e){this.addTag(wie(e))}hasLnurlTags(){return vie(this)}addAmountTag(e){this.addTag(Xoe(e))}hasAmountTags(){return Koe(this)}addKindTag(e){this.addTag(["k",e.toString()])}addExpirationTag(e){if(this.hasExpirationTag())throw new Error("Event already has an expiration.");this.addTag(["expiration",e.toString()])}hasExpirationTag(){return mie(this)}addSubjectTag(e){if(this.kind!==1)throw new Error(`Event kind ${this.kind} should not have a subject.`);if(this.hasSubjectTag())throw new Error("Event already has a subject.");this.addTag(["subject",e])}hasSubjectTag(){return Aie(this)}addNonceTag(e){const t=Sie(this,e);this.tags=t.tags}hasNonceTag(){return bie(this)}replaceNonceTag(e){const t=_ie(this,e);this.tags=t.tags}addContentWarningTag(e){if(this.hasContentWarningTag())throw new Error("Event already has a content warning.");this.addTag(["content-warning",e||""])}hasContentWarningTag(){return KR(this)}addExternalIdentityClaimTag(e){this.addTag(e.toTag())}hasExternalIdentityClaimTag(){return ik(this)}addReportTags(e){if(this.kind!==1984)throw new Error(`Event kind ${this.kind} should not have a report. Expected 1984.`);if(this.hasReportTags())throw new Error("Event already has report tags.");Oie(e).forEach(n=>this.addTag(n))}hasReportTags(){return xie(this)}newZapReceipt(e){if(this.kind!==9734)throw new Error(`Event kind ${this.kind} should not have a zap receipt. Expected 9734.`);return eae({bolt11:e.bolt11,description:e.description,preimage:e.preimage,zapRequest:this})}determineRequiredNIP(){const e=[];return this.hasExternalIdentityClaimTag()&&e.push(39),this.hasExpirationTag()&&e.push(40),e}isReadyToPublish(){if(this.id==="")return{isReady:!1,reason:"Event has no ID."};if(this.pubkey==="")return{isReady:!1,reason:"Event has no pubkey."};if(this.sig==="")return{isReady:!1,reason:"Event has no signature."};const e=Joe(this.content,this.kind);return e.isValid?{isReady:!0}:{isReady:!1,reason:e.error}}isReadyToPublishOrThrow(){const e=this.isReadyToPublish();if(!e.isReady)throw new Error(e.reason)}};function Kie(e){const t=new sr({content:e.text,kind:1});return e.subject&&t.addSubjectTag(e.subject),t}function Xie(e){const t=new sr({content:e.text,kind:e.isDraft?30024:30023});return e.identifier&&t.addEventTag({eventId:e.identifier}),t}function qie(e){const t=new sr({content:e.text,kind:1}),n=new sr(e.inResponseTo);if(n.kind!==1)throw new Error("Event you are responding to be SHORT_TEXT_NOTE");const r=n.hasSubjectTag();r?QR(r)?t.addSubjectTag(r):t.addSubjectTag(Pie(r)):console.log("Event you are responding to does not have a subject.");const o=n.hasEventTags(),i=o?o.find(l=>l.marker==="root"):void 0;i?(t.addEventTag({eventId:i.eventId,relayUrl:e.relayUrl,marker:"root"}),t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"reply"})):t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"root"});const a=n.hasPublicKeyTags(),s=[];a&&s.push(a),s.push([n.pubkey,e.relayUrl]);for(const l of s)t.addPublicKeyTag(l[0],l[1]);return t}function Yie(e){if(e.text!=="+"&&e.text!=="-")throw new Error("Reaction must be either '+' or '-'");const t=new sr({content:e.text,kind:7,tags:[]});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function ak(e){const t=new sr({content:JSON.stringify({...e.inResponseTo,relay:e.relayUrl}),kind:6});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function Zie(e){const t=new sr({content:Hie(e.userMetadata),kind:0,tags:[]});if(e.claims)for(const n of e.claims)h_(n.identity)?t.addExternalIdentityClaimTag(n):console.log("Invalid provider name",n.identity);return e.mastodonUrl&&t.addTag(["mostr",e.mastodonUrl]),t}function Qie(e){if(!qR(e.relayUrl))throw new Error("Invalid server URL");const t=new sr({content:e.relayUrl,kind:2});return e.nonce&&t.addNonceTag(e.nonce),t}function sk(e){const t=new sr({content:"",kind:9734});return e.relayUrls&&e.relayUrls.length>0&&t.addRelaysTag(e.relayUrls),t.addAmountTag(e.amount.toString()),t.addLnurlTag(e.lnurl),t.addPublicKeyTag(e.recipientPubkey),e.eventId&&t.addEventTag({eventId:e.eventId}),t}function Jie(e,t,n){const r=sk(e);r.signAndGenerateId(n);const o=r.toURI();return{event:r,eventUri:o,invoiceUrl:tk({callback:t,amount:e.amount,event:o,lnurl:e.lnurl})}}function eae(e){const t=e.zapRequest.tags.find(i=>i[0]==="p"),n=e.zapRequest.tags.find(i=>i[0]==="e"),r=Lie(e.zapRequest),o=new sr({content:"",kind:9735,tags:[t,["bolt11",e.bolt11],["description",r]],created_at:e.zapRequest.created_at});return n&&o.addEventTag({eventId:n[1]}),e.preimage&&o.addTag(["preimage",e.preimage]),o}function tae(e){return new sr({content:"",kind:22242,tags:[["relay",e.relayUrl],["challenge",e.challenge]]})}function nae(e){const t=new sr({content:"",kind:3});for(const n of e.contacts)t.tags.push(["p",n.key,n.relayUrl?n.relayUrl:"",n.petname?n.petname:""]);return t}var Fa=class{constructor(e){this.ids=e==null?void 0:e.ids,this.authors=e==null?void 0:e.authors,this.kinds=e==null?void 0:e.kinds,this["#e"]=e==null?void 0:e["#e"],this["#p"]=e==null?void 0:e["#p"],this["#t"]=e==null?void 0:e["#t"],this.since=e==null?void 0:e.since,this.until=e==null?void 0:e.until,this.limit=e==null?void 0:e.limit}addId(e){this.ids||(this.ids=[]),this.ids.push(e)}addAuthor(e){this.authors||(this.authors=[]),this.authors.push(e)}addKind(e){this.kinds||(this.kinds=[]),this.kinds.push(e)}updateLimit(e){this.limit=e}toObj(){return JSON.parse(JSON.stringify(this))}},rae=class{constructor(e){this.pubkey=(e==null?void 0:e.pubkey)||void 0,this.claims=(e==null?void 0:e.claims)||[],this.data=(e==null?void 0:e.data)||{},this.lastUpdated=(e==null?void 0:e.lastUpdated)||0}loaded(){return this.data!==void 0}hasZapInfo(){return this.lightningZapInfo!==void 0}fromPublicKey(e){return this.pubkey=e,this}fromEvent(e,t=!0){const n=new sr(e);if(n.kind!==0){if(t)throw new Error("wrong event kind");return}if(this.pubkey&&this.pubkey!==""&&n.pubkey!==this.pubkey){if(t)throw new Error("wrong event pubkey");return}if(this.pubkey=n.pubkey,this.lastUpdated=n.created_at,n.content&&n.content!==""){const o=Wie(n.content);o&&(this.data=o)}const r=ik(e);return r&&(this.claims=r),this}getNip05Url(){var t;const e=((t=this.data)==null?void 0:t.nip05)||void 0;if(e)return Fie(e)}validateWellKnown(e){return e?Object.keys(e.names).find(n=>e.names[n]===this.pubkey)?(this.nip05isValid=!0,!0):(this.nip05isValid=!1,!1):!1}getLud16(){var e;return((e=this.data)==null?void 0:e.lud16)||void 0}getLud16Url(){const e=this.getLud16();if(e)return jie(e)}getLud06(){var e;return((e=this.data)==null?void 0:e.lud06)||void 0}getLud06Url(){const e=this.getLud06();if(e)return Bie(e)}getLud16Or06(){const e=this.getLud06();if(e)return{type:"lud06",url:e};const t=this.getLud16();if(t)return{type:"lud16",url:t}}getLud16Or06Url(){const e=this.getLud06Url();if(e)return{type:"lud06",url:e};const t=this.getLud16Url();if(t)return{type:"lud16",url:t}}getMetadataFilter(){const e=new Fa;return e.addAuthor(this.pubkey),e.addKind(0),e}toJson(){return{pubkey:this.pubkey,claims:this.claims,data:this.data,lightningZapInfo:this.lightningZapInfo,lastUpdated:this.lastUpdated,nip05isValid:this.nip05isValid}}fromJson(e){return this.pubkey=e.pubkey,this.claims=e.claims,this.data=e.data,this.lightningZapInfo=e.lightningZapInfo,this.lastUpdated=e.lastUpdated,this.nip05isValid=e.nip05isValid,this}};/** + */function p1(){return p1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Wre(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gre(e,t){return e.button===0&&(!t||t==="_self")&&!Wre(e)}const Kre=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Xre=["aria-current","caseSensitive","className","end","style","to","children"],qre="startTransition",d4=wv[qre];function Yre(e){let{basename:t,children:n,future:r,window:o}=e,i=P.useRef();i.current==null&&(i.current=ere({window:o,v5Compat:!0}));let a=i.current,[s,l]=P.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},c=P.useCallback(f=>{u&&d4?d4(()=>l(f)):l(f)},[l,u]);return P.useLayoutEffect(()=>a.listen(c),[a,c]),P.createElement(Ure,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a})}const Zre=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Qre=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zf=P.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:l,to:u,preventScrollReset:c}=t,f=DR(t,Kre),{basename:d}=P.useContext(el),h,p=!1;if(typeof u=="string"&&Qre.test(u)&&(h=u,Zre))try{let g=new URL(window.location.href),E=u.startsWith("//")?new URL(g.protocol+u):new URL(u),T=l_(E.pathname,d);E.origin===g.origin&&T!=null?u=T+E.search+E.hash:p=!0}catch{}let m=xre(u,{relative:o}),S=Jre(u,{replace:a,state:s,target:l,preventScrollReset:c,relative:o});function b(g){r&&r(g),g.defaultPrevented||S(g)}return P.createElement("a",p1({},f,{href:h||m,onClick:p||i?r:b,ref:n,target:l}))}),m1=P.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:l,children:u}=t,c=DR(t,Xre),f=f_(l,{relative:c.relative}),d=Cd(),h=P.useContext(TR),{navigator:p}=P.useContext(el),m=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,S=d.pathname,b=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;o||(S=S.toLowerCase(),b=b?b.toLowerCase():null,m=m.toLowerCase());let g=S===m||!a&&S.startsWith(m)&&S.charAt(m.length)==="/",E=b!=null&&(b===m||!a&&b.startsWith(m)&&b.charAt(m.length)==="/"),T=g?r:void 0,O;typeof i=="function"?O=i({isActive:g,isPending:E}):O=[i,g?"active":null,E?"pending":null].filter(Boolean).join(" ");let A=typeof s=="function"?s({isActive:g,isPending:E}):s;return P.createElement(zf,p1({},c,{"aria-current":T,className:O,ref:n,style:A,to:l}),typeof u=="function"?u({isActive:g,isPending:E}):u)});var h4;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(h4||(h4={}));var p4;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(p4||(p4={}));function Jre(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a}=t===void 0?{}:t,s=Ore(),l=Cd(),u=f_(e,{relative:a});return P.useCallback(c=>{if(Gre(c,n)){c.preventDefault();let f=r!==void 0?r:f1(l)===f1(u);s(e,{replace:f,state:o,preventScrollReset:i,relative:a})}},[l,s,u,r,o,n,e,i,a])}let eoe=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");var Vf={};Object.defineProperty(Vf,"__esModule",{value:!0});Vf.bech32m=No=Vf.bech32=void 0;const y1="qpzry9x8gf2tvdw0s3jn54khce6mua7l",LR={};for(let e=0;e>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function m4(e){let t=1;for(let n=0;n126)return"Invalid prefix ("+e+")";t=lu(t)^r>>5}t=lu(t);for(let n=0;n=n;)i-=n,s.push(o>>i&a);if(r)i>0&&s.push(o<=t)return"Excess padding";if(o<l)throw new TypeError("Exceeds length limit");a=a.toLowerCase();let u=m4(a);if(typeof u=="string")throw new Error(u);let c=a+"1";for(let f=0;f>5)throw new Error("Non 5-bit word");u=lu(u)^d,c+=y1.charAt(d)}for(let f=0;f<6;++f)u=lu(u);u^=t;for(let f=0;f<6;++f){const d=u>>(5-f)*5&31;c+=y1.charAt(d)}return c}function r(a,s){if(s=s||90,a.length<8)return a+" too short";if(a.length>s)return"Exceeds length limit";const l=a.toLowerCase(),u=a.toUpperCase();if(a!==l&&a!==u)return"Mixed-case string "+a;a=l;const c=a.lastIndexOf("1");if(c===-1)return"No separator character for "+a;if(c===0)return"Missing prefix for "+a;const f=a.slice(0,c),d=a.slice(c+1);if(d.length<6)return"Data too short";let h=m4(f);if(typeof h=="string")return h;const p=[];for(let m=0;m=d.length)&&p.push(b)}return h!==t?"Invalid checksum for "+a:{prefix:f,words:p}}function o(a,s){const l=r(a,s);if(typeof l=="object")return l}function i(a,s){const l=r(a,s);if(typeof l=="object")return l;throw new Error(l)}return{decodeUnsafe:o,decode:i,encode:n,toWords:toe,fromWordsUnsafe:noe,fromWords:roe}}var No=Vf.bech32=NR("bech32");Vf.bech32m=NR("bech32m");var BR={};(function(e){/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0;function t(x){if(!Number.isSafeInteger(x))throw new Error(`Wrong integer: ${x}`)}e.assertNumber=t;function n(...x){const I=(M,N)=>D=>M(N(D)),R=Array.from(x).reverse().reduce((M,N)=>M?I(M,N.encode):N.encode,void 0),k=x.reduce((M,N)=>M?I(M,N.decode):N.decode,void 0);return{encode:R,decode:k}}function r(x){return{encode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return I.map(R=>{if(t(R),R<0||R>=x.length)throw new Error(`Digit index outside alphabet: ${R} (alphabet: ${x.length})`);return x[R]})},decode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("alphabet.decode input should be array of strings");return I.map(R=>{if(typeof R!="string")throw new Error(`alphabet.decode: not string element=${R}`);const k=x.indexOf(R);if(k===-1)throw new Error(`Unknown letter: "${R}". Allowed: ${x}`);return k})}}}function o(x=""){if(typeof x!="string")throw new Error("join separator should be string");return{encode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="string")throw new Error("join.encode input should be array of strings");for(let R of I)if(typeof R!="string")throw new Error(`join.encode: non-string input=${R}`);return I.join(x)},decode:I=>{if(typeof I!="string")throw new Error("join.decode input should be string");return I.split(x)}}}function i(x,I="="){if(t(x),typeof I!="string")throw new Error("padding chr should be string");return{encode(R){if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("padding.encode input should be array of strings");for(let k of R)if(typeof k!="string")throw new Error(`padding.encode: non-string input=${k}`);for(;R.length*x%8;)R.push(I);return R},decode(R){if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("padding.encode input should be array of strings");for(let M of R)if(typeof M!="string")throw new Error(`padding.decode: non-string input=${M}`);let k=R.length;if(k*x%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;k>0&&R[k-1]===I;k--)if(!((k-1)*x%8))throw new Error("Invalid padding: string has too much padding");return R.slice(0,k)}}}function a(x){if(typeof x!="function")throw new Error("normalize fn should be function");return{encode:I=>I,decode:I=>x(I)}}function s(x,I,R){if(I<2)throw new Error(`convertRadix: wrong from=${I}, base cannot be less than 2`);if(R<2)throw new Error(`convertRadix: wrong to=${R}, base cannot be less than 2`);if(!Array.isArray(x))throw new Error("convertRadix: data should be array");if(!x.length)return[];let k=0;const M=[],N=Array.from(x);for(N.forEach(D=>{if(t(D),D<0||D>=I)throw new Error(`Wrong integer: ${D}`)});;){let D=0,L=!0;for(let j=k;jI?l(I,x%I):x,u=(x,I)=>x+(I-l(x,I));function c(x,I,R,k){if(!Array.isArray(x))throw new Error("convertRadix2: data should be array");if(I<=0||I>32)throw new Error(`convertRadix2: wrong from=${I}`);if(R<=0||R>32)throw new Error(`convertRadix2: wrong to=${R}`);if(u(I,R)>32)throw new Error(`convertRadix2: carry overflow from=${I} to=${R} carryBits=${u(I,R)}`);let M=0,N=0;const D=2**R-1,L=[];for(const j of x){if(t(j),j>=2**I)throw new Error(`convertRadix2: invalid data word=${j} from=${I}`);if(M=M<32)throw new Error(`convertRadix2: carry overflow pos=${N} from=${I}`);for(N+=I;N>=R;N-=R)L.push((M>>N-R&D)>>>0);M&=2**N-1}if(M=M<=I)throw new Error("Excess padding");if(!k&&M)throw new Error(`Non-zero padding: ${M}`);return k&&N>0&&L.push(M>>>0),L}function f(x){return t(x),{encode:I=>{if(!(I instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return s(Array.from(I),2**8,x)},decode:I=>{if(!Array.isArray(I)||I.length&&typeof I[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(s(I,x,2**8))}}}function d(x,I=!1){if(t(x),x<=0||x>32)throw new Error("radix2: bits should be in (0..32]");if(u(8,x)>32||u(x,8)>32)throw new Error("radix2: carry overflow");return{encode:R=>{if(!(R instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return c(Array.from(R),8,x,!I)},decode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(c(R,x,8,I))}}}function h(x){if(typeof x!="function")throw new Error("unsafeWrapper fn should be function");return function(...I){try{return x.apply(null,I)}catch{}}}function p(x,I){if(t(x),typeof I!="function")throw new Error("checksum fn should be function");return{encode(R){if(!(R instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const k=I(R).slice(0,x),M=new Uint8Array(R.length+x);return M.set(R),M.set(k,R.length),M},decode(R){if(!(R instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const k=R.slice(0,-x),M=I(k).slice(0,x),N=R.slice(-x);for(let D=0;Dx.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e.base64=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i(6),o("")),e.base64url=n(d(6),r("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),i(6),o(""));const m=x=>n(f(58),r(x),o(""));e.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const S=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(x){let I="";for(let R=0;Rn(p(4,I=>x(x(I))),e.base58);e.base58check=b;const g=n(r("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),E=[996825010,642813549,513874426,1027748829,705979059];function T(x){const I=x>>25;let R=(x&33554431)<<5;for(let k=0;k>k&1)===1&&(R^=E[k]);return R}function O(x,I,R=1){const k=x.length;let M=1;for(let N=0;N126)throw new Error(`Invalid prefix (${x})`);M=T(M)^D>>5}M=T(M);for(let N=0;NK)throw new TypeError(`Length ${W} exceeds limit ${K}`);return B=B.toLowerCase(),`${B}1${g.encode(V)}${O(B,V,I)}`}function L(B,V=90){if(typeof B!="string")throw new Error(`bech32.decode input should be string, not ${typeof B}`);if(B.length<8||V!==!1&&B.length>V)throw new TypeError(`Wrong string length: ${B.length} (${B}). Expected (8..${V})`);const K=B.toLowerCase();if(B!==K&&B!==B.toUpperCase())throw new Error("String must be lowercase or uppercase");B=K;const W=B.lastIndexOf("1");if(W===0||W===-1)throw new Error('Letter "1" must be present between prefix and data only');const Q=B.slice(0,W),X=B.slice(W+1);if(X.length<6)throw new Error("Data must be at least 6 characters long");const J=g.decode(X).slice(0,-6),te=O(Q,J,I);if(!X.endsWith(te))throw new Error(`Invalid checksum in ${B}: expected "${te}"`);return{prefix:Q,words:J}}const j=h(L);function F(B){const{prefix:V,words:K}=L(B,!1);return{prefix:V,words:K,bytes:k(K)}}return{encode:D,decode:L,decodeToBytes:F,decodeUnsafe:j,fromWords:k,fromWordsUnsafe:N,toWords:M}}e.bech32=A("bech32"),e.bech32m=A("bech32m"),e.utf8={encode:x=>new TextDecoder().decode(x),decode:x=>new TextEncoder().encode(x)},e.hex=n(d(4),r("0123456789abcdef"),o(""),a(x=>{if(typeof x!="string"||x.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof x} with length ${x.length}`);return x.toLowerCase()}));const C={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},y=`Invalid encoding type. Available types: ${Object.keys(C).join(", ")}`,_=(x,I)=>{if(typeof x!="string"||!C.hasOwnProperty(x))throw new TypeError(y);if(!(I instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return C[x].encode(I)};e.bytesToString=_,e.str=e.bytesToString;const v=(x,I)=>{if(!C.hasOwnProperty(x))throw new TypeError(y);if(typeof I!="string")throw new TypeError("stringToBytes() expects string");return C[x].decode(I)};e.stringToBytes=v,e.bytes=e.stringToBytes})(BR);const{bech32:ei,hex:Do,utf8:ooe}=BR,y4={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0]},g4={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},v4={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0]},w4={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0]},Sh=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],ioe={m:BigInt(1e3),u:BigInt(1e6),n:BigInt(1e9),p:BigInt(1e12)},aoe=BigInt("2100000000000000000"),b4=BigInt(1e11),sw={payment_hash:1,payment_secret:16,description:13,payee:19,description_hash:23,expiry:6,min_final_cltv_expiry:24,fallback_address:9,route_hint:3,feature_bits:5,metadata:27},jR={};for(let e=0,t=Object.keys(sw);eDo.encode(ei.fromWordsUnsafe(e)),16:e=>Do.encode(ei.fromWordsUnsafe(e)),13:e=>ooe.encode(ei.fromWordsUnsafe(e)),19:e=>Do.encode(ei.fromWordsUnsafe(e)),23:e=>Do.encode(ei.fromWordsUnsafe(e)),27:e=>Do.encode(ei.fromWordsUnsafe(e)),6:g1,24:g1,3:uoe,5:coe};function loe(e){return t=>({tagCode:parseInt(e),words:ei.encode("unknown",t,Number.MAX_SAFE_INTEGER)})}function g1(e){return e.reverse().reduce((t,n,r)=>t+n*Math.pow(32,r),0)}function uoe(e){const t=[];let n,r,o,i,a,s=ei.fromWordsUnsafe(e);for(;s.length>0;)n=Do.encode(s.slice(0,33)),r=Do.encode(s.slice(33,41)),o=parseInt(Do.encode(s.slice(41,45)),16),i=parseInt(Do.encode(s.slice(45,49)),16),a=parseInt(Do.encode(s.slice(49,51)),16),s=s.slice(51),t.push({pubkey:n,short_channel_id:r,fee_base_msat:o,fee_proportional_millionths:i,cltv_expiry_delta:a});return t}function coe(e){const t=e.slice().reverse().map(o=>[!!(o&1),!!(o&2),!!(o&4),!!(o&8),!!(o&16)]).reduce((o,i)=>o.concat(i),[]);for(;t.length{let a;t[i*2]?a="required":t[i*2+1]?a="supported":a="unsupported",n[o]=a});const r=t.slice(Sh.length*2);return n.extra_bits={start_bit:Sh.length*2,bits:r,has_required:r.reduce((o,i,a)=>a%2!==0?o||!1:o||i,!1)},n}function FR(e,t){let n,r;if(e.slice(-1).match(/^[munp]$/))n=e.slice(-1),r=e.slice(0,-1);else{if(e.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");r=e}if(!r.match(/^\d+$/))throw new Error("Not a valid human readable amount");const o=BigInt(r),i=n?o*b4/ioe[n]:o*b4;if(n==="p"&&o%BigInt(10)!==BigInt(0)||i>aoe)throw new Error("Amount is outside of valid range");return t?i.toString():i}function foe(e,t){if(typeof e!="string")throw new Error("Lightning Payment Request must be string");if(e.slice(0,2).toLowerCase()!=="ln")throw new Error("Not a proper lightning payment request");const n=[],r=ei.decode(e,Number.MAX_SAFE_INTEGER);e=e.toLowerCase();const o=r.prefix;let i=r.words,a=e.slice(o.length+1),s=i.slice(-104);i=i.slice(0,-104);let l=o.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(l&&!l[2]&&(l=o.match(/^ln(\S+)$/)),!l)throw new Error("Not a proper lightning payment request");n.push({name:"lightning_network",letters:"ln"});const u=l[1];let c;if(t){if(t.bech32===void 0||t.pubKeyHash===void 0||t.scriptHash===void 0||!Array.isArray(t.validWitnessVersions))throw new Error("Invalid network");c=t}else switch(u){case y4.bech32:c=y4;break;case g4.bech32:c=g4;break;case v4.bech32:c=v4;break;case w4.bech32:c=w4;break}if(!c||c.bech32!==u)throw new Error("Unknown coin bech32 prefix");n.push({name:"coin_network",letters:u,value:c});const f=l[2];let d;if(f){const T=l[3];d=FR(f+T,!0),n.push({name:"amount",letters:l[2]+l[3],value:d})}else d=null;n.push({name:"separator",letters:"1"});const h=g1(i.slice(0,7));i=i.slice(7),n.push({name:"timestamp",letters:a.slice(0,7),value:h}),a=a.slice(7);let p,m,S,b;for(;i.length>0;){const T=i[0].toString();p=jR[T]||"unknown_tag",m=soe[T]||loe(T),i=i.slice(1),S=g1(i.slice(0,2)),i=i.slice(2),b=i.slice(0,S),i=i.slice(S),n.push({name:p,tag:a[0],letters:a.slice(0,1+2+S),value:m(b)}),a=a.slice(1+2+S)}n.push({name:"signature",letters:a.slice(0,104),value:Do.encode(ei.fromWordsUnsafe(s))}),a=a.slice(104),n.push({name:"checksum",letters:a});let g={paymentRequest:e,sections:n,get expiry(){let T=n.find(O=>O.name==="expiry");if(T)return E("timestamp")+T.value},get route_hints(){return n.filter(T=>T.name==="route_hint").map(T=>T.value)}};for(let T in sw)T!=="route_hint"&&Object.defineProperty(g,T,{get(){return E(T)}});return g;function E(T){let O=n.find(A=>A.name===T);return O?O.value:void 0}}var doe={decode:foe,hrpToMillisat:FR};function lw(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function hoe(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}function $R(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function poe(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");lw(e.outputLen),lw(e.blockLen)}function moe(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function yoe(e,t){$R(e);const n=t.outputLen;if(e.lengthe instanceof Uint8Array,xg=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Xo=(e,t)=>e<<32-t|e>>>t,goe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!goe)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function voe(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function h_(e){if(typeof e=="string"&&(e=voe(e)),!zR(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function woe(...e){const t=new Uint8Array(e.reduce((r,o)=>r+o.length,0));let n=0;return e.forEach(r=>{if(!zR(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class VR{clone(){return this._cloneInto()}}function UR(e){const t=r=>e().update(h_(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function HR(e=32){if(Cg&&typeof Cg.getRandomValues=="function")return Cg.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function boe(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),i=BigInt(4294967295),a=Number(n>>o&i),s=Number(n&i),l=r?4:0,u=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+u,s,r)}class Soe extends VR{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=xg(this.buffer)}update(t){ws.exists(this);const{view:n,buffer:r,blockLen:o}=this;t=h_(t);const i=t.length;for(let a=0;ao-a&&(this.process(r,0),a=0);for(let f=a;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&n,Eoe=(e,t,n)=>e&t^e&n^t&n,Coe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Qi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ji=new Uint32Array(64);class WR extends Soe{constructor(){super(64,32,8,!1),this.A=Qi[0]|0,this.B=Qi[1]|0,this.C=Qi[2]|0,this.D=Qi[3]|0,this.E=Qi[4]|0,this.F=Qi[5]|0,this.G=Qi[6]|0,this.H=Qi[7]|0}get(){const{A:t,B:n,C:r,D:o,E:i,F:a,G:s,H:l}=this;return[t,n,r,o,i,a,s,l]}set(t,n,r,o,i,a,s,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=s|0,this.H=l|0}process(t,n){for(let f=0;f<16;f++,n+=4)Ji[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const d=Ji[f-15],h=Ji[f-2],p=Xo(d,7)^Xo(d,18)^d>>>3,m=Xo(h,17)^Xo(h,19)^h>>>10;Ji[f]=m+Ji[f-7]+p+Ji[f-16]|0}let{A:r,B:o,C:i,D:a,E:s,F:l,G:u,H:c}=this;for(let f=0;f<64;f++){const d=Xo(s,6)^Xo(s,11)^Xo(s,25),h=c+d+_oe(s,l,u)+Coe[f]+Ji[f]|0,m=(Xo(r,2)^Xo(r,13)^Xo(r,22))+Eoe(r,o,i)|0;c=u,u=l,l=s,s=a+h|0,a=i,i=o,o=r,r=h+m|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,s=s+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,o,i,a,s,l,u,c)}roundClean(){Ji.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class xoe extends WR{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const v1=UR(()=>new WR);UR(()=>new xoe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const GR=BigInt(0),Tm=BigInt(1),Ooe=BigInt(2),Im=e=>e instanceof Uint8Array,Aoe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Vo(e){if(!Im(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+o.length,0));let n=0;return e.forEach(r=>{if(!Im(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function Toe(e,t){if(e.length!==t.length)return!1;for(let n=0;nGR;e>>=Tm,t+=1);return t}function koe(e,t){return e>>BigInt(t)&Tm}const Moe=(e,t,n)=>e|(n?Tm:GR)<(Ooe<new Uint8Array(e),S4=e=>Uint8Array.from(e);function qR(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Og(e),o=Og(e),i=0;const a=()=>{r.fill(1),o.fill(0),i=0},s=(...f)=>n(o,r,...f),l=(f=Og())=>{o=s(S4([0]),f),r=s(),f.length!==0&&(o=s(S4([1]),f),r=s())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f{a(),l(f);let h;for(;!(h=d(u()));)l();return a(),h}}const Doe={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function xd(e,t,n={}){const r=(o,i,a)=>{const s=Doe[i];if(typeof s!="function")throw new Error(`Invalid validator "${i}", expected function`);const l=e[o];if(!(a&&l===void 0)&&!s(l,e))throw new Error(`Invalid param ${String(o)}=${l} (${typeof l}), expected ${i}`)};for(const[o,i]of Object.entries(t))r(o,i,!1);for(const[o,i]of Object.entries(n))r(o,i,!0);return e}const Loe=Object.freeze(Object.defineProperty({__proto__:null,bitGet:koe,bitLen:Roe,bitMask:y_,bitSet:Moe,bytesToHex:Vo,bytesToNumberBE:Rr,bytesToNumberLE:m_,concatBytes:Hs,createHmacDrbg:qR,ensureBytes:Rn,equalBytes:Toe,hexToBytes:Au,hexToNumber:p_,numberToBytesBE:Ta,numberToBytesLE:XR,numberToHexUnpadded:KR,numberToVarBytesBE:Poe,utf8ToBytes:Ioe,validateObject:xd},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bn=BigInt(0),Qt=BigInt(1),cs=BigInt(2),Noe=BigInt(3),uw=BigInt(4),_4=BigInt(5),E4=BigInt(8);BigInt(9);BigInt(16);function Mn(e,t){const n=e%t;return n>=bn?n:t+n}function Boe(e,t,n){if(n<=bn||t 0");if(n===Qt)return bn;let r=Qt;for(;t>bn;)t&Qt&&(r=r*e%n),e=e*e%n,t>>=Qt;return r}function io(e,t,n){let r=e;for(;t-- >bn;)r*=r,r%=n;return r}function cw(e,t){if(e===bn||t<=bn)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Mn(e,t),r=t,o=bn,i=Qt;for(;n!==bn;){const s=r/n,l=r%n,u=o-i*s;r=n,n=l,o=i,i=u}if(r!==Qt)throw new Error("invert: does not exist");return Mn(o,t)}function joe(e){const t=(e-Qt)/cs;let n,r,o;for(n=e-Qt,r=0;n%cs===bn;n/=cs,r++);for(o=cs;o(r[o]="function",r),t);return xd(e,n)}function Voe(e,t,n){if(n 0");if(n===bn)return e.ONE;if(n===Qt)return t;let r=e.ONE,o=t;for(;n>bn;)n&Qt&&(r=e.mul(r,o)),o=e.sqr(o),n>>=Qt;return r}function Uoe(e,t){const n=new Array(t.length),r=t.reduce((i,a,s)=>e.is0(a)?i:(n[s]=i,e.mul(i,a)),e.ONE),o=e.inv(r);return t.reduceRight((i,a,s)=>e.is0(a)?i:(n[s]=e.mul(i,n[s]),e.mul(i,a)),o),n}function g_(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Hoe(e,t,n=!1,r={}){if(e<=bn)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:i}=g_(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=Foe(e),s=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:y_(o),ZERO:bn,ONE:Qt,create:l=>Mn(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return bn<=l&&ll===bn,isOdd:l=>(l&Qt)===Qt,neg:l=>Mn(-l,e),eql:(l,u)=>l===u,sqr:l=>Mn(l*l,e),add:(l,u)=>Mn(l+u,e),sub:(l,u)=>Mn(l-u,e),mul:(l,u)=>Mn(l*u,e),pow:(l,u)=>Voe(s,l,u),div:(l,u)=>Mn(l*cw(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>cw(l,e),sqrt:r.sqrt||(l=>a(s,l)),invertBatch:l=>Uoe(s,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>n?XR(l,i):Ta(l,i),fromBytes:l=>{if(l.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${l.length}`);return n?m_(l):Rr(l)}});return Object.freeze(s)}function Woe(e,t,n=!1){e=Rn("privateHash",e);const r=e.length,o=g_(t).nByteLength+8;if(o<24||r1024)throw new Error(`hashToPrivateScalar: expected ${o}-1024 bytes of input, got ${r}`);const i=n?m_(e):Rr(e);return Mn(i,t-Qt)+Qt}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Goe=BigInt(0),Ag=BigInt(1);function Koe(e,t){const n=(o,i)=>{const a=i.negate();return o?a:i},r=o=>{const i=Math.ceil(t/o)+1,a=2**(o-1);return{windows:i,windowSize:a}};return{constTimeNegate:n,unsafeLadder(o,i){let a=e.ZERO,s=o;for(;i>Goe;)i&Ag&&(a=a.add(s)),s=s.double(),i>>=Ag;return a},precomputeWindow(o,i){const{windows:a,windowSize:s}=r(i),l=[];let u=o,c=u;for(let f=0;f>=h,S>l&&(S-=d,a+=Ag);const b=m,g=m+Math.abs(S)-1,E=p%2!==0,T=S<0;S===0?c=c.add(n(E,i[b])):u=u.add(n(T,i[g]))}return{p:u,f:c}},wNAFCached(o,i,a,s){const l=o._WINDOW_SIZE||1;let u=i.get(o);return u||(u=this.precomputeWindow(o,l),l!==1&&i.set(o,s(u))),this.wNAF(l,u,a)}}}function YR(e){return zoe(e.Fp),xd(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...g_(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Xoe(e){const t=YR(e);xd(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:qoe,hexToBytes:Yoe}=Loe,bs={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=bs;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:qoe(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=bs,n=typeof e=="string"?Yoe(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:o,l:i}=bs._parseInt(n.subarray(2)),{d:a,l:s}=bs._parseInt(i);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const c=u.toString(16);return c.length&1?`0${c}`:c},r=t(n(e.s)),o=t(n(e.r)),i=r.length/2,a=o.length/2,s=n(i),l=n(a);return`30${n(a+i+4)}02${l}${o}02${s}${r}`}},Ci=BigInt(0),uo=BigInt(1);BigInt(2);const C4=BigInt(3);BigInt(4);function Zoe(e){const t=Xoe(e),{Fp:n}=t,r=t.toBytes||((p,m,S)=>{const b=m.toAffine();return Hs(Uint8Array.from([4]),n.toBytes(b.x),n.toBytes(b.y))}),o=t.fromBytes||(p=>{const m=p.subarray(1),S=n.fromBytes(m.subarray(0,n.BYTES)),b=n.fromBytes(m.subarray(n.BYTES,2*n.BYTES));return{x:S,y:b}});function i(p){const{a:m,b:S}=t,b=n.sqr(p),g=n.mul(b,p);return n.add(n.add(g,n.mul(p,m)),S)}if(!n.eql(n.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function a(p){return typeof p=="bigint"&&Cin.eql(E,n.ZERO);return g(S)&&g(b)?f.ZERO:new f(S,b,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const S=n.invertBatch(m.map(b=>b.pz));return m.map((b,g)=>b.toAffine(S[g])).map(f.fromAffine)}static fromHex(m){const S=f.fromAffine(o(Rn("pointHex",m)));return S.assertValidity(),S}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:m,y:S}=this.toAffine();if(!n.isValid(m)||!n.isValid(S))throw new Error("bad point: x or y not FE");const b=n.sqr(S),g=i(m);if(!n.eql(b,g))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(n.isOdd)return!n.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){c(m);const{px:S,py:b,pz:g}=this,{px:E,py:T,pz:O}=m,A=n.eql(n.mul(S,O),n.mul(E,g)),C=n.eql(n.mul(b,O),n.mul(T,g));return A&&C}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:m,b:S}=t,b=n.mul(S,C4),{px:g,py:E,pz:T}=this;let O=n.ZERO,A=n.ZERO,C=n.ZERO,y=n.mul(g,g),_=n.mul(E,E),v=n.mul(T,T),x=n.mul(g,E);return x=n.add(x,x),C=n.mul(g,T),C=n.add(C,C),O=n.mul(m,C),A=n.mul(b,v),A=n.add(O,A),O=n.sub(_,A),A=n.add(_,A),A=n.mul(O,A),O=n.mul(x,O),C=n.mul(b,C),v=n.mul(m,v),x=n.sub(y,v),x=n.mul(m,x),x=n.add(x,C),C=n.add(y,y),y=n.add(C,y),y=n.add(y,v),y=n.mul(y,x),A=n.add(A,y),v=n.mul(E,T),v=n.add(v,v),y=n.mul(v,x),O=n.sub(O,y),C=n.mul(v,_),C=n.add(C,C),C=n.add(C,C),new f(O,A,C)}add(m){c(m);const{px:S,py:b,pz:g}=this,{px:E,py:T,pz:O}=m;let A=n.ZERO,C=n.ZERO,y=n.ZERO;const _=t.a,v=n.mul(t.b,C4);let x=n.mul(S,E),I=n.mul(b,T),R=n.mul(g,O),k=n.add(S,b),M=n.add(E,T);k=n.mul(k,M),M=n.add(x,I),k=n.sub(k,M),M=n.add(S,g);let N=n.add(E,O);return M=n.mul(M,N),N=n.add(x,R),M=n.sub(M,N),N=n.add(b,g),A=n.add(T,O),N=n.mul(N,A),A=n.add(I,R),N=n.sub(N,A),y=n.mul(_,M),A=n.mul(v,R),y=n.add(A,y),A=n.sub(I,y),y=n.add(I,y),C=n.mul(A,y),I=n.add(x,x),I=n.add(I,x),R=n.mul(_,R),M=n.mul(v,M),I=n.add(I,R),R=n.sub(x,R),R=n.mul(_,R),M=n.add(M,R),x=n.mul(I,M),C=n.add(C,x),x=n.mul(N,M),A=n.mul(k,A),A=n.sub(A,x),x=n.mul(k,I),y=n.mul(N,y),y=n.add(y,x),new f(A,C,y)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return h.wNAFCached(this,u,m,S=>{const b=n.invertBatch(S.map(g=>g.pz));return S.map((g,E)=>g.toAffine(b[E])).map(f.fromAffine)})}multiplyUnsafe(m){const S=f.ZERO;if(m===Ci)return S;if(s(m),m===uo)return this;const{endo:b}=t;if(!b)return h.unsafeLadder(this,m);let{k1neg:g,k1:E,k2neg:T,k2:O}=b.splitScalar(m),A=S,C=S,y=this;for(;E>Ci||O>Ci;)E&uo&&(A=A.add(y)),O&uo&&(C=C.add(y)),y=y.double(),E>>=uo,O>>=uo;return g&&(A=A.negate()),T&&(C=C.negate()),C=new f(n.mul(C.px,b.beta),C.py,C.pz),A.add(C)}multiply(m){s(m);let S=m,b,g;const{endo:E}=t;if(E){const{k1neg:T,k1:O,k2neg:A,k2:C}=E.splitScalar(S);let{p:y,f:_}=this.wNAF(O),{p:v,f:x}=this.wNAF(C);y=h.constTimeNegate(T,y),v=h.constTimeNegate(A,v),v=new f(n.mul(v.px,E.beta),v.py,v.pz),b=y.add(v),g=_.add(x)}else{const{p:T,f:O}=this.wNAF(S);b=T,g=O}return f.normalizeZ([b,g])[0]}multiplyAndAddUnsafe(m,S,b){const g=f.BASE,E=(O,A)=>A===Ci||A===uo||!O.equals(g)?O.multiplyUnsafe(A):O.multiply(A),T=E(this,S).add(E(m,b));return T.is0()?void 0:T}toAffine(m){const{px:S,py:b,pz:g}=this,E=this.is0();m==null&&(m=E?n.ONE:n.inv(g));const T=n.mul(S,m),O=n.mul(b,m),A=n.mul(g,m);if(E)return{x:n.ZERO,y:n.ZERO};if(!n.eql(A,n.ONE))throw new Error("invZ was invalid");return{x:T,y:O}}isTorsionFree(){const{h:m,isTorsionFree:S}=t;if(m===uo)return!0;if(S)return S(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:S}=t;return m===uo?this:S?S(f,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return this.assertValidity(),r(f,this,m)}toHex(m=!0){return Vo(this.toRawBytes(m))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const d=t.nBitLength,h=Koe(f,t.endo?Math.ceil(d/2):d);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:i,isWithinCurveOrder:a}}function Qoe(e){const t=YR(e);return xd(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Joe(e){const t=Qoe(e),{Fp:n,n:r}=t,o=n.BYTES+1,i=2*n.BYTES+1;function a(M){return CiVo(Ta(M,t.nByteLength));function p(M){const N=r>>uo;return M>N}function m(M){return p(M)?s(-M):M}const S=(M,N,D)=>Rr(M.slice(N,D));class b{constructor(N,D,L){this.r=N,this.s=D,this.recovery=L,this.assertValidity()}static fromCompact(N){const D=t.nByteLength;return N=Rn("compactSignature",N,D*2),new b(S(N,0,D),S(N,D,2*D))}static fromDER(N){const{r:D,s:L}=bs.toSig(Rn("DER",N));return new b(D,L)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(N){return new b(this.r,this.s,N)}recoverPublicKey(N){const{r:D,s:L,recovery:j}=this,F=C(Rn("msgHash",N));if(j==null||![0,1,2,3].includes(j))throw new Error("recovery id invalid");const B=j===2||j===3?D+t.n:D;if(B>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const V=j&1?"03":"02",K=u.fromHex(V+h(B)),W=l(B),Q=s(-F*W),X=s(L*W),J=u.BASE.multiplyAndAddUnsafe(K,Q,X);if(!J)throw new Error("point at infinify");return J.assertValidity(),J}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Au(this.toDERHex())}toDERHex(){return bs.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Au(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const g={isValidPrivateKey(M){try{return c(M),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const M=t.randomBytes(n.BYTES+8),N=Woe(M,r);return Ta(N,t.nByteLength)},precompute(M=8,N=u.BASE){return N._setWindowSize(M),N.multiply(BigInt(3)),N}};function E(M,N=!0){return u.fromPrivateKey(M).toRawBytes(N)}function T(M){const N=M instanceof Uint8Array,D=typeof M=="string",L=(N||D)&&M.length;return N?L===o||L===i:D?L===2*o||L===2*i:M instanceof u}function O(M,N,D=!0){if(T(M))throw new Error("first arg must be private key");if(!T(N))throw new Error("second arg must be public key");return u.fromHex(N).multiply(c(M)).toRawBytes(D)}const A=t.bits2int||function(M){const N=Rr(M),D=M.length*8-t.nBitLength;return D>0?N>>BigInt(D):N},C=t.bits2int_modN||function(M){return s(A(M))},y=y_(t.nBitLength);function _(M){if(typeof M!="bigint")throw new Error("bigint expected");if(!(Ci<=M&&Mle in D))throw new Error("sign() legacy options not supported");const{hash:L,randomBytes:j}=t;let{lowS:F,prehash:B,extraEntropy:V}=D;F==null&&(F=!0),M=Rn("msgHash",M),B&&(M=Rn("prehashed msgHash",L(M)));const K=C(M),W=c(N),Q=[_(W),_(K)];if(V!=null){const le=V===!0?j(n.BYTES):V;Q.push(Rn("extraEntropy",le,n.BYTES))}const X=Hs(...Q),J=K;function te(le){const ge=A(le);if(!d(ge))return;const se=l(ge),ue=u.BASE.multiply(ge).toAffine(),Ie=s(ue.x);if(Ie===Ci)return;const gt=s(se*s(J+Ie*W));if(gt===Ci)return;let ie=(ue.x===Ie?0:2)|Number(ue.y&uo),Ce=gt;return F&&p(gt)&&(Ce=m(gt),ie^=1),new b(Ie,Ce,ie)}return{seed:X,k2sig:te}}const x={lowS:t.lowS,prehash:!1},I={lowS:t.lowS,prehash:!1};function R(M,N,D=x){const{seed:L,k2sig:j}=v(M,N,D),F=t;return qR(F.hash.outputLen,F.nByteLength,F.hmac)(L,j)}u.BASE._setWindowSize(8);function k(M,N,D,L=I){var ue;const j=M;if(N=Rn("msgHash",N),D=Rn("publicKey",D),"strict"in L)throw new Error("options.strict was renamed to lowS");const{lowS:F,prehash:B}=L;let V,K;try{if(typeof j=="string"||j instanceof Uint8Array)try{V=b.fromDER(j)}catch(Ie){if(!(Ie instanceof bs.Err))throw Ie;V=b.fromCompact(j)}else if(typeof j=="object"&&typeof j.r=="bigint"&&typeof j.s=="bigint"){const{r:Ie,s:gt}=j;V=new b(Ie,gt)}else throw new Error("PARSE");K=u.fromHex(D)}catch(Ie){if(Ie.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(F&&V.hasHighS())return!1;B&&(N=t.hash(N));const{r:W,s:Q}=V,X=C(N),J=l(Q),te=s(X*J),le=s(W*J),ge=(ue=u.BASE.multiplyAndAddUnsafe(K,te,le))==null?void 0:ue.toAffine();return ge?s(ge.x)===W:!1}return{CURVE:t,getPublicKey:E,getSharedSecret:O,sign:R,verify:k,ProjectivePoint:u,Signature:b,utils:g}}class ZR extends VR{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,ws.hash(t);const r=h_(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?t.create().update(r).digest():r);for(let a=0;anew ZR(e,t).update(n).digest();QR.create=(e,t)=>new ZR(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function eie(e){return{hash:e,hmac:(t,...n)=>QR(e,t,woe(...n)),randomBytes:HR}}function tie(e,t){const n=r=>Joe({...e,...eie(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rm=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),w1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),JR=BigInt(1),b1=BigInt(2),x4=(e,t)=>(e+t/b1)/t;function ek(e){const t=Rm,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),l=BigInt(88),u=e*e*e%t,c=u*u*e%t,f=io(c,n,t)*c%t,d=io(f,n,t)*c%t,h=io(d,b1,t)*u%t,p=io(h,o,t)*h%t,m=io(p,i,t)*p%t,S=io(m,s,t)*m%t,b=io(S,l,t)*S%t,g=io(b,s,t)*m%t,E=io(g,n,t)*c%t,T=io(E,a,t)*p%t,O=io(T,r,t)*u%t,A=io(O,b1,t);if(!fw.eql(fw.sqr(A),e))throw new Error("Cannot find square root");return A}const fw=Hoe(Rm,void 0,void 0,{sqrt:ek}),v_=tie({a:BigInt(0),b:BigInt(7),Fp:fw,n:w1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=w1,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-JR*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,a=BigInt("0x100000000000000000000000000000000"),s=x4(i*e,t),l=x4(-r*e,t);let u=Mn(e-s*n-l*o,t),c=Mn(-s*r-l*i,t);const f=u>a,d=c>a;if(f&&(u=t-u),d&&(c=t-c),u>a||c>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:c}}}},v1),km=BigInt(0),tk=e=>typeof e=="bigint"&&kmtypeof e=="bigint"&&kmo.charCodeAt(0)));n=Hs(r,r),O4[e]=n}return v1(Hs(n,...t))}const w_=e=>e.toRawBytes(!0).slice(1),dw=e=>Ta(e,32),Pg=e=>Mn(e,Rm),Uf=e=>Mn(e,w1),b_=v_.ProjectivePoint,rie=(e,t,n)=>b_.BASE.multiplyAndAddUnsafe(e,t,n);function hw(e){let t=v_.utils.normPrivateKeyToScalar(e),n=b_.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:Uf(-t),bytes:w_(n)}}function nk(e){if(!tk(e))throw new Error("bad x: need 0 < x < p");const t=Pg(e*e),n=Pg(t*e+BigInt(7));let r=ek(n);r%b1!==km&&(r=Pg(-r));const o=new b_(e,r,JR);return o.assertValidity(),o}function rk(...e){return Uf(Rr(S1("BIP0340/challenge",...e)))}function oie(e){return hw(e).bytes}function iie(e,t,n=HR(32)){const r=Rn("message",e),{bytes:o,scalar:i}=hw(t),a=Rn("auxRand",n,32),s=dw(i^Rr(S1("BIP0340/aux",a))),l=S1("BIP0340/nonce",s,o,r),u=Uf(Rr(l));if(u===km)throw new Error("sign failed: k is zero");const{bytes:c,scalar:f}=hw(u),d=rk(c,o,r),h=new Uint8Array(64);if(h.set(c,0),h.set(dw(Uf(f+d*i)),32),!ok(h,r,o))throw new Error("sign: Invalid signature produced");return h}function ok(e,t,n){const r=Rn("signature",e,64),o=Rn("message",t),i=Rn("publicKey",n,32);try{const a=nk(Rr(i)),s=Rr(r.subarray(0,32));if(!tk(s))return!1;const l=Rr(r.subarray(32,64));if(!nie(l))return!1;const u=rk(dw(s),w_(a),o),c=rie(a,l,Uf(-u));return!(!c||!c.hasEvenY()||c.toAffine().x!==s)}catch{return!1}}const _1=(()=>({getPublicKey:oie,sign:iie,verify:ok,utils:{randomPrivateKey:v_.utils.randomPrivateKey,lift_x:nk,pointToBytes:w_,numberToBytesBE:Ta,bytesToNumberBE:Rr,taggedHash:S1,mod:Mn}}))();var Mi=(e=>(e.PublicKeys="npub",e.PrivateKeys="nsec",e.NoteIDs="note",e.LNURL="lnurl",e.Profile="nprofile",e.Event="nevent",e.Relay="nrelay",e.EventCoordinate="naddr",e))(Mi||{}),Od=(e=>(e.AUTH="AUTH",e.CLOSE="CLOSE",e.COUNT="COUNT",e.EVENT="EVENT",e.REQ="REQ",e))(Od||{}),ar=(e=>(e[e.METADATA=0]="METADATA",e[e.SHORT_TEXT_NOTE=1]="SHORT_TEXT_NOTE",e[e.RECOMMEND_RELAY=2]="RECOMMEND_RELAY",e[e.CONTACTS=3]="CONTACTS",e[e.ENCRYPTED_DIRECT_MESSAGES=4]="ENCRYPTED_DIRECT_MESSAGES",e[e.EVENT_DELETION=5]="EVENT_DELETION",e[e.REPOST=6]="REPOST",e[e.REACTION=7]="REACTION",e[e.BADGE_AWARD=8]="BADGE_AWARD",e[e.GENERIC_REPOST=16]="GENERIC_REPOST",e[e.CHANNEL_CREATION=40]="CHANNEL_CREATION",e[e.CHANNEL_METADATA=41]="CHANNEL_METADATA",e[e.CHANNEL_MESSAGE=42]="CHANNEL_MESSAGE",e[e.CHANNEL_HIDE_MESSAGE=43]="CHANNEL_HIDE_MESSAGE",e[e.CHANNEL_MUTE_USER=44]="CHANNEL_MUTE_USER",e[e.FILE_METADATA=1063]="FILE_METADATA",e[e.LIVE_CHAT_MESSAGE=1311]="LIVE_CHAT_MESSAGE",e[e.REPORTING=1984]="REPORTING",e[e.LABEL=1985]="LABEL",e[e.ZAP_REQUEST=9734]="ZAP_REQUEST",e[e.ZAP_RECEIPT=9735]="ZAP_RECEIPT",e[e.MUTE_LIST=1e4]="MUTE_LIST",e[e.PIN_LIST=10001]="PIN_LIST",e[e.RELAY_LIST_METADATA=10002]="RELAY_LIST_METADATA",e[e.WALLET_INFO=13194]="WALLET_INFO",e[e.CLIENT_AUTHENTICATION=22242]="CLIENT_AUTHENTICATION",e[e.WALLET_REQUEST=23194]="WALLET_REQUEST",e[e.WALLET_RESPONSE=23195]="WALLET_RESPONSE",e[e.NOSTR_CONNECT=24133]="NOSTR_CONNECT",e[e.HTTP_AUTH=27235]="HTTP_AUTH",e[e.CATEGORIZED_PEOPLE_LIST=3e4]="CATEGORIZED_PEOPLE_LIST",e[e.CATEGORIZED_BOOKMARK_LIST=30001]="CATEGORIZED_BOOKMARK_LIST",e[e.PROFILE_BADGES=30008]="PROFILE_BADGES",e[e.BADGE_DEFINITION=30009]="BADGE_DEFINITION",e[e.CREATE_OR_UPDATE_A_STALL=30017]="CREATE_OR_UPDATE_A_STALL",e[e.CREATE_OR_UPDATE_A_PRODUCT=30018]="CREATE_OR_UPDATE_A_PRODUCT",e[e.LONG_FORM_CONTENT=30023]="LONG_FORM_CONTENT",e[e.DRAFT_LONG_FORM_CONTENT=30024]="DRAFT_LONG_FORM_CONTENT",e[e.APPLICATION_SPECIFIC_DATA=30078]="APPLICATION_SPECIFIC_DATA",e[e.LIVE_EVENT=30311]="LIVE_EVENT",e[e.CLASSIFIED_LISTING=30402]="CLASSIFIED_LISTING",e[e.DRAFT_CLASSIFIED_LISTING=30403]="DRAFT_CLASSIFIED_LISTING",e[e.HANDLER_RECOMMENDATION=31989]="HANDLER_RECOMMENDATION",e[e.HANDLER_INFORMATION=31990]="HANDLER_INFORMATION",e))(ar||{}),ik=(e=>(e.GITHUB="github",e.TWITTER="twitter",e.MASTODON="mastodon",e.TELEGRAM="telegram",e))(ik||{}),gl=(e=>(e.AUTH="AUTH",e.COUNT="COUNT",e.EOSE="EOSE",e.EVENT="EVENT",e.NOTICE="NOTICE",e.OK="OK",e))(gl||{});function ak(e){const t=new Uint8Array(Math.ceil(e.length/2));for(let n=0;nt.toString(16).padStart(2,"0")).join("")}function aie(e){const t=[];for(const i of e){const a=new Uint8Array([i.type]);let s;i.type===1?s=new TextEncoder().encode(i.value):i.type===3?s=new Uint32Array([i.value]):s=ak(i.value);const l=new Uint8Array([s.length]);t.push(a),t.push(l),t.push(s)}let n=t.reduce((i,a)=>i+a.length,0);const r=new Uint8Array(n);let o=0;for(const i of t)r.set(i,o),o+=i.length;return r}function sie(e){let t=0;const n=[];for(;t{let n;return t.type===3?n=t.value:t.type===1?n=new TextDecoder().decode(t.value):n=sk(t.value),{type:t.type,value:n}})}function S_(e,t){let n;e==="npub"||e==="nsec"||e==="note"||e==="lnurl"?n=ak(t[0].value):n=aie(t);const r=No.toWords(new Uint8Array(n.buffer));return No.encode(e,r,1023)}function Rs(e){const{prefix:t,words:n}=No.decode(e,1023),r=new Uint8Array(No.fromWords(n));let o;if(t==="npub"||t==="nsec"||t==="note"||t==="lnurl")o=[{type:0,value:sk(r)}];else if(t==="nprofile"||t==="nevent"||t==="nrelay"||t==="naddr"){const i=sie(r);o=lie(i)}else throw new Error("Unknown prefix: "+t);return{prefix:t,tlvItems:o}}function uie(e){return doe.decode(e)}function cie(e){const t=e.tags.filter(r=>r[0]==="amount");if(t.length===0)return;const n=[];for(const r of t)r.length===2&&n.push(r[1]);return n&&n.length>0?n:void 0}function fie(e){return["amount",e]}function lk(e){if(!e.tags)return;let t=!1,n="";for(const r of e.tags)r.find(i=>i==="content-warning")&&(t=!0,r.length===2&&r[0]==="content-warning"||r.length===3&&r[2]==="content-warning"&&r[0]==="l"?n=r[1]:n="N/A");return t?n:void 0}var die=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/,hie=/(?:nostr:)?(npub|nsec|note|lnurl|nprofile|nevent)([a-zA-Z0-9]+)/g,uk=(e=>(e.npub="npub",e.nsec="nsec",e.note="note",e.lnurl="lnurl",e.nprofile="nprofile",e.nevent="nevent",e))(uk||{});function pie(e){if(typeof e!="string")return null;const t=e.match(die);return t&&t.length===3?{prefix:t[1],bech32:`${t[1]}${t[2]}`}:null}function mie(e){return pie(e)!==null}function ck(e){return/^(wss?):\/\/([a-zA-Z0-9.-]+)(:\d+)?(\/[a-zA-Z0-9_/.-]*)?$/.test(e)}function yie(e,t){if(!e||e==="")return{isValid:!0};if(t===6)try{return JSON.parse(e),{isValid:!0}}catch(n){return console.error(n),{isValid:!1,error:"Invalid JSON format"}}else if(t===2&&!ck(e))return{isValid:!1,error:`Expected a valid websocket URL, got ${e}.`};return gie(e)?{isValid:!1,error:"HTML tags are not allowed"}:{isValid:!0}}function gie(e){return/<[^>]*>/.test(e)}var fk=[{name:"www.youtube.com"},{name:"music.youtube.com"},{name:"youtu.be",rewrite:e=>`https://www.youtube.com/watch?v=${e.split("/").pop()}`},{name:"twitch.tv"},{name:"vimeo.com"},{name:"rumble.com"}],vie=["jpg","jpeg","png","gif","webp"],wie=["mp4","webm","ogg"],bie=fk.map(e=>e.name.replace(/\./g,"\\.")).join("|"),Sie=wie.join("|"),_ie=`https?:\\/\\/(${bie})\\/\\w+\\/([a-zA-Z0-9_-]+)(?:\\?[a-zA-Z0-9_=&-]+)?|https?:\\/\\/\\S+\\.(${Sie})`,Eie=new RegExp(_ie,"gi"),Cie=vie.join("|"),xie=new RegExp(`\\bhttps?:\\/\\/\\S+?\\.(${Cie})(?:\\?\\S+)?\\b`,"gi");function dk(e){if(e===void 0)return;const t=e==null?void 0:e.match(xie),n=e==null?void 0:e.match(Eie),o=Array.from(e.matchAll(hie),s=>s.slice(1,3)).map(([s,l])=>Object.values(uk).includes(s)?{type:s,data:l}:null).filter(s=>s!==null),i=/#[a-zA-Z0-9_-]+/gi,a=e==null?void 0:e.match(i);return t&&e&&t.forEach(s=>e=e.replace(s,"")),n&&e&&n.forEach(s=>e=e.replace(s,"")),n&&n.forEach((s,l)=>{const u=fk.find(c=>s.includes(c.name));u!=null&&u.rewrite&&(n[l]=u.rewrite(s))}),{images:t||void 0,videos:n||void 0,nurls:o&&o.length>0?o:void 0,tags:a||void 0,text:e.trim()}}function Oie(e){if(!e)return;let t=[];for(let n of e){if(!Array.isArray(n)||n.length<2||n.length>3||n[0]!=="a")continue;let r=n[1].split(":");if(r.length!==3)continue;let o=r[0],i=r[1],a=r[2],s;n.length===3&&(s=n[2]),t.push({kind:o,pubkey:i,identifier:a,relay:s})}if(t.length!==0)return t}function Aie(e){const t=Oie(e.tags);if(t)return t}function Pie(e){const{kind:t,pubkey:n,identifier:r,relay:o}=e;return o?[`a:${t}:${n}:${r}, ${o}`]:[`a:${t}:${n}:${r}`]}function Tie(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({eventId:r[1]}):r.length===3?n.push({eventId:r[1],relayUrl:r[2]}):r.length===4&&n.push({eventId:r[1],relayUrl:r[2],marker:r[3]});return n&&n.length>0?n:void 0}function Iie(e){const t=e.tags.filter(r=>r[0]==="e");if(t.length===0)return;const n=[];for(let r=0;r2&&(r===1?n.push({eventId:t[r][1],relayUrl:"",marker:"mention"}):r>1&&n.push({eventId:t[r][1],relayUrl:"",marker:"reply"}));return n&&n.length>0?n:void 0}function Rie(e){return!e.tags||e.tags.length===0?!1:e.tags.filter(n=>n[0]==="e"&&n.length>2).length===0}function kie(e){const t=e.tags.filter(n=>n[0]==="expiration");if(t.length!==0)return parseInt(t[0][1])}function Mie(e){const t=[],n=e.tags.filter(r=>r[0]==="d");if(n.length!==0){for(const r of n){let o=r[1]||"";t.includes(o)||t.push(o)}return t&&t.length>0?t:void 0}}function Die(e){return["d",e]}function Lie(e){const t=e.tags.filter(r=>r[0]==="lnurl");if(t.length===0)return;const n=[];for(const r of t)r.length>0&&n.push(r[1]);return n&&n.length>0?n:void 0}function Nie(e){return["lnurl",e]}function Bie(e){const t=e.tags.filter(n=>n[0]==="nonce");if(t.length!==0)return[parseInt(t[0][1]),parseInt(t[0][2])]}function jie(e,t){if(e.hasNonceTag())throw new Error("Event already has a nonce.");if(t.length!==2)throw new Error("Nonce must be an array of 2 numbers: [miningResult, difficulty]");const n=t[0].toString(),r=t[1].toString();return e.addTag(["nonce",n,r]),e}function Fie(e,t){return e.tags=e.tags.filter(n=>n[0]!=="nonce"),e.addNonceTag(t),e}function $ie(e){const t=e.tags.filter(r=>r[0]==="p");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push([r[1]]):r.length===3&&n.push([r[1],r[2]]);return n}function zie(e){const t=e.tags.filter(r=>r[0]==="relays");if(t.length===0)return;const n=[];for(const r of t)r.length===2?n.push({url:r[1],read:!0,write:!0}):r.length===3&&n.push({url:r[1],read:r[2]==="read",write:r[2]==="write"});return n.length>0?n:void 0}function Vie(e){if(e.kind!==1984)throw new Error(`Event is not a report: ${e.kind}. Expected 1984.`);const t=e.tags.filter(s=>s[0]==="p");if(!t||t.length===0)return;let n;const r=e.tags.filter(s=>s[0]==="e");r.length>0&&r[0].length>0&&(n=r[0][1]);let o;t[0].length===3?o=t[0][2]:r.length>0&&r[0].length===3&&(o=r[0][2]);let i;return t[0].length>0&&(i=t[0][1]),!o||!i?void 0:{eventId:n,kind:o,publicKey:i,content:e.content&&e.content!==""?e.content:void 0}}function Uie(e){const{eventId:t,kind:n,publicKey:r}=e;if(!n)throw new Error("Report must have a kind.");if(!r)throw new Error("Report must mention a public key.");if(n==="impersonation"&&t)throw new Error("Impersonation reports should refer to a person, not an event.");const o=[];return t?(o.push(["e",t,n]),r&&o.push(["p",r])):r&&o.push(["p",r,n]),o}function Hie(e){const t=e.tags.filter(n=>n[0]==="subject");if(t.length!==0)return t[0][1]}function hk(e){return e?e.startsWith("Re:"):!1}function Wie(e){return hk(e)?e:`Re: ${e}`}function Gie(e){const t=e.tags?e.tags.filter(n=>n[0]==="t"):[];return t.length>0?t.map(n=>n[1]):void 0}function Kie(){const e=_1.utils.randomPrivateKey(),t=_1.getPublicKey(e);return{privateKey:Vo(e),publicKey:Vo(t)}}function Xie(e){return Vo(_1.getPublicKey(Buffer.from(e,"hex")))}function qie(e){return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}var pk=new TextEncoder,A4=new TextDecoder("utf-8");function mk(e){const t=v1(pk.encode(e));return Vo(t)}function yk({callback:e,amount:t,event:n,lnurl:r}){return`${e}?amount=${t}&nostr=${n}&lnurl=${r}`}function Yie(e){if(e.allowsNostr&&e.nostrPubkey)return!0}function Zie(e,t){const n=e.amount?e.amount:void 0,r=e.lnurl?e.lnurl:void 0;if(!n||!r)return!0;const o=uie(t.pr);let i;const a=o.sections.find(s=>s.name==="amount");if(a)i=a.value;else return!1;return!(n&&n.toString()!==i)}function Qie(e){const t=new sr(e),n=t.hasPublicKeyTags();if(!n)throw new Error("No pubkey tags found");if(e.kind!==9734)throw new Error("Event is not a zap request");const r=n[0],o=t.hasRelaysTag(),i={pubkey:r,content:"",id:t.id,sig:t.sig,kind:t.kind,tags:t.tags,relays:o};return JSON.stringify(i)}function Jie(e){let t=/,*?((lnurl)([0-9]{1,}[a-z0-9]+){1})/.exec(e.toLowerCase());return t?t[1]:null}function eae(e){if(e=e.trim(),e.toLowerCase().slice(0,6)==="lnurl1"){const{words:t}=No.decode(e,2e4),n=new Uint8Array(No.fromWords(t));return A4.decode(n)}else if(e.slice(0,9)==="lnurlc://"||e.slice(0,9)==="lnurlw://"||e.slice(0,9)==="lnurlp://"||e.slice(0,10)==="keyauth://"){let[t,n]=e.split("://");return(n.match(/\.onion($|\W)/)?"http":"https")+"://"+n}else if(e.slice(0,8)==="https://"){let t=Jie(e);if(t){const{words:n}=No.decode(t,2e4),r=new Uint8Array(No.fromWords(n));return A4.decode(r)}return e}throw new Error(`invalid url ${e}`)}function gk(e){const t=pk.encode(e),n=No.toWords(new Uint8Array(t));return No.encode("lnurl",n,2e4)}function vk(e){return e.endsWith(".onion")}function tae(e){const[t,n]=e.split("@");return`${vk(n)?"http":"https"}://${n}/.well-known/lnurlp/${t}`}function nae(e){const[t,n]=e.split("@");return`${vk(n)?"http":"https"}://${n}/.well-known/nostr.json?name=${t}`}function rae(e){let t=0;for(let n=0;nl[0]==="nonce");i!==-1?e.tags[i][1]=r.toString():e.tags.push(["nonce",r.toString(),o]);const a=JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content]);if(e.id=mk(a),rae(e.id)>=t)return console.log("Proof of work complete"),e.tags=e.tags.filter(l=>l[0]!=="nonce"),e.tags.push(["nonce",r.toString(),o]),e;if(n&&r>=n)return;r++}}function __(e){return/^[a-z0-9\.\-_\/@]*$/.test(e)}function iae(e){return e.toLowerCase()}function aae(e,t){if(e.length!==64)throw new Error("Invalid event hash");const n=_1.sign(e,t);return Vo(n)}function sae(e){return e?JSON.stringify(e):""}function lae(e){try{const t=JSON.parse(e);return{name:t.name??null,display_name:t.display_name??null,picture:t.picture??null,banner:t.banner??null,nip05:t.nip05??null,website:t.website??null,about:t.about??null,image:t.image??null,npub:t.npub??null,lud16:t.lud16??null,lud06:t.lud06??null}}catch(t){return console.error("Unable to parse user metadata string",t),null}}var uae=class{constructor(e){if(e){if(!__(e.identity))throw new Error("Invalid identity. Valid: a-z, 0-9, -, _, @");this.type=e.type,this.identity=iae(e.identity),this.proof=e.proof}}toTag(){switch(this.type){case"github":return["i",`github:${this.identity}`,this.proof];case"twitter":return["i",`twitter:${this.identity}`,this.proof];case"mastodon":return["i",`mastodon:${this.identity}`,this.proof];case"telegram":return["i",`telegram:${this.identity}`,this.proof];default:throw new Error(`Unknown claim type ${this.type}. Valid: github, twitter, mastodon, telegram`)}}fromTag(e){if(wk(e))return this.type=e[1].split(":")[0],this.identity=e[1].split(":")[1],this.proof=e[2],this}};function wk(e){return!(e.length!==3||!Object.values(ik).includes(e[1].split(":")[0])||!__(e[1].split(":")[1]))}function bk(e){const t=e.tags.filter(r=>r[0]==="i"&&wk(r));if(t.length===0)return;const n=[];for(const r of t){const o=new uae;o.fromTag(r),n.push(o)}return n}var sr=class{constructor(e){this.id=e.id?e.id:"",this.pubkey=e.pubkey?e.pubkey:"",this.created_at=e.created_at?e.created_at:Math.floor(Date.now()/1e3),this.kind=e.kind!=null?e.kind:1,this.tags=e.tags&&e.tags.length>0?e.tags:[],this.content=e.content,this.sig=e.sig?e.sig:""}generateId(){if(this.pubkey==="")throw new Error("Cannot generate event ID without a public key. Set a public key first.");const e=qie(this.ToObj());this.id=mk(e)}sign(e){if(this.id==="")throw new Error("Cannot sign event without an ID. Generate ID first.");this.pubkey=e.publicKey,this.sig=aae(this.id,e.privateKey)}signAndGenerateId(e){this.pubkey=e.publicKey,this.generateId(),this.sign(e)}ToObj(){const e={};for(const[t,n]of Object.entries(this))n!==void 0&&(e[t]=n);return e}toURI(){return encodeURI(JSON.stringify(this.ToObj()))}proofOfWork(e,t){const n=oae(this,e,t);if(n)this.id=n.id,this.tags=n.tags;else throw new Error("Failed to generate proof of work.")}hasMentions(){const e=this.extractContent();if(!e)return;const t=e==null?void 0:e.nurls.filter(n=>n.type==="npub");return t.length>0?t:void 0}setContentWithoutChecks(e){return this.content=e,this}extractContent(){return dk(this.content)}addTag(e){this.tags||(this.tags=[]),this.tags.push(e)}removeTag(e){this.tags&&(this.tags=this.tags.filter(t=>t[0]!==e[0]&&t[1]!==e[1]))}addEventTag(e){const t=e.relayUrl?e.relayUrl:"";let n=["e",e.eventId];e.marker?n=[...n,t,e.marker]:e.relayUrl&&(n=[...n,e.relayUrl]),this.addTag(n)}hasEventTags(){return Rie(this)?Iie(this):Tie(this)}hasTags(){return Gie(this)}addPublicKeyTag(e,t){const n=["p",e];t&&n.push(t),this.addTag(n)}hasPublicKeyTags(){return $ie(this)}addRelaysTag(e){const t=this.tags.filter(n=>n[0]==="relays");if(t.length===0)this.tags.push(["relays",...e]);else for(const n of t)n.splice(1,0,...e)}hasRelaysTag(){return zie(this)}addEventCoordinatesTag(e){this.addTag(Pie(e))}hasEventCoordinatesTags(){return Aie(this)}addIdentifierTag(e){this.addTag(Die(e))}hasIdentifierTags(){return Mie(this)}addLnurlTag(e){this.addTag(Nie(e))}hasLnurlTags(){return Lie(this)}addAmountTag(e){this.addTag(fie(e))}hasAmountTags(){return cie(this)}addKindTag(e){this.addTag(["k",e.toString()])}addExpirationTag(e){if(this.hasExpirationTag())throw new Error("Event already has an expiration.");this.addTag(["expiration",e.toString()])}hasExpirationTag(){return kie(this)}addSubjectTag(e){if(this.kind!==1)throw new Error(`Event kind ${this.kind} should not have a subject.`);if(this.hasSubjectTag())throw new Error("Event already has a subject.");this.addTag(["subject",e])}hasSubjectTag(){return Hie(this)}addNonceTag(e){const t=jie(this,e);this.tags=t.tags}hasNonceTag(){return Bie(this)}replaceNonceTag(e){const t=Fie(this,e);this.tags=t.tags}addContentWarningTag(e){if(this.hasContentWarningTag())throw new Error("Event already has a content warning.");this.addTag(["content-warning",e||""])}hasContentWarningTag(){return lk(this)}addExternalIdentityClaimTag(e){this.addTag(e.toTag())}hasExternalIdentityClaimTag(){return bk(this)}addReportTags(e){if(this.kind!==1984)throw new Error(`Event kind ${this.kind} should not have a report. Expected 1984.`);if(this.hasReportTags())throw new Error("Event already has report tags.");Uie(e).forEach(n=>this.addTag(n))}hasReportTags(){return Vie(this)}newZapReceipt(e){if(this.kind!==9734)throw new Error(`Event kind ${this.kind} should not have a zap receipt. Expected 9734.`);return gae({bolt11:e.bolt11,description:e.description,preimage:e.preimage,zapRequest:this})}determineRequiredNIP(){const e=[];return this.hasExternalIdentityClaimTag()&&e.push(39),this.hasExpirationTag()&&e.push(40),e}isReadyToPublish(){if(this.id==="")return{isReady:!1,reason:"Event has no ID."};if(this.pubkey==="")return{isReady:!1,reason:"Event has no pubkey."};if(this.sig==="")return{isReady:!1,reason:"Event has no signature."};const e=yie(this.content,this.kind);return e.isValid?{isReady:!0}:{isReady:!1,reason:e.error}}isReadyToPublishOrThrow(){const e=this.isReadyToPublish();if(!e.isReady)throw new Error(e.reason)}};function cae(e){const t=new sr({content:e.text,kind:1});return e.subject&&t.addSubjectTag(e.subject),t}function fae(e){const t=new sr({content:e.text,kind:e.isDraft?30024:30023});return e.identifier&&t.addEventTag({eventId:e.identifier}),t}function dae(e){const t=new sr({content:e.text,kind:1}),n=new sr(e.inResponseTo);if(n.kind!==1)throw new Error("Event you are responding to be SHORT_TEXT_NOTE");const r=n.hasSubjectTag();r?hk(r)?t.addSubjectTag(r):t.addSubjectTag(Wie(r)):console.log("Event you are responding to does not have a subject.");const o=n.hasEventTags(),i=o?o.find(l=>l.marker==="root"):void 0;i?(t.addEventTag({eventId:i.eventId,relayUrl:e.relayUrl,marker:"root"}),t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"reply"})):t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl,marker:"root"});const a=n.hasPublicKeyTags(),s=[];a&&s.push(a),s.push([n.pubkey,e.relayUrl]);for(const l of s)t.addPublicKeyTag(l[0],l[1]);return t}function hae(e){if(e.text!=="+"&&e.text!=="-")throw new Error("Reaction must be either '+' or '-'");const t=new sr({content:e.text,kind:7,tags:[]});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function Sk(e){const t=new sr({content:JSON.stringify({...e.inResponseTo,relay:e.relayUrl}),kind:6});return t.addEventTag({eventId:e.inResponseTo.id,relayUrl:e.relayUrl}),t.addPublicKeyTag(e.inResponseTo.pubkey,e.relayUrl),t}function pae(e){const t=new sr({content:sae(e.userMetadata),kind:0,tags:[]});if(e.claims)for(const n of e.claims)__(n.identity)?t.addExternalIdentityClaimTag(n):console.log("Invalid provider name",n.identity);return e.mastodonUrl&&t.addTag(["mostr",e.mastodonUrl]),t}function mae(e){if(!ck(e.relayUrl))throw new Error("Invalid server URL");const t=new sr({content:e.relayUrl,kind:2});return e.nonce&&t.addNonceTag(e.nonce),t}function _k(e){const t=new sr({content:"",kind:9734});return e.relayUrls&&e.relayUrls.length>0&&t.addRelaysTag(e.relayUrls),t.addAmountTag(e.amount.toString()),t.addLnurlTag(e.lnurl),t.addPublicKeyTag(e.recipientPubkey),e.eventId&&t.addEventTag({eventId:e.eventId}),t}function yae(e,t,n){const r=_k(e);r.signAndGenerateId(n);const o=r.toURI();return{event:r,eventUri:o,invoiceUrl:yk({callback:t,amount:e.amount,event:o,lnurl:e.lnurl})}}function gae(e){const t=e.zapRequest.tags.find(i=>i[0]==="p"),n=e.zapRequest.tags.find(i=>i[0]==="e"),r=Qie(e.zapRequest),o=new sr({content:"",kind:9735,tags:[t,["bolt11",e.bolt11],["description",r]],created_at:e.zapRequest.created_at});return n&&o.addEventTag({eventId:n[1]}),e.preimage&&o.addTag(["preimage",e.preimage]),o}function vae(e){return new sr({content:"",kind:22242,tags:[["relay",e.relayUrl],["challenge",e.challenge]]})}function wae(e){const t=new sr({content:"",kind:3});for(const n of e.contacts)t.tags.push(["p",n.key,n.relayUrl?n.relayUrl:"",n.petname?n.petname:""]);return t}var za=class{constructor(e){this.ids=e==null?void 0:e.ids,this.authors=e==null?void 0:e.authors,this.kinds=e==null?void 0:e.kinds,this["#e"]=e==null?void 0:e["#e"],this["#p"]=e==null?void 0:e["#p"],this["#t"]=e==null?void 0:e["#t"],this.since=e==null?void 0:e.since,this.until=e==null?void 0:e.until,this.limit=e==null?void 0:e.limit}addId(e){this.ids||(this.ids=[]),this.ids.push(e)}addAuthor(e){this.authors||(this.authors=[]),this.authors.push(e)}addKind(e){this.kinds||(this.kinds=[]),this.kinds.push(e)}updateLimit(e){this.limit=e}toObj(){return JSON.parse(JSON.stringify(this))}},bae=class{constructor(e){this.pubkey=(e==null?void 0:e.pubkey)||void 0,this.claims=(e==null?void 0:e.claims)||[],this.data=(e==null?void 0:e.data)||{},this.lastUpdated=(e==null?void 0:e.lastUpdated)||0}loaded(){return this.data!==void 0}hasZapInfo(){return this.lightningZapInfo!==void 0}fromPublicKey(e){return this.pubkey=e,this}fromEvent(e,t=!0){const n=new sr(e);if(n.kind!==0){if(t)throw new Error("wrong event kind");return}if(this.pubkey&&this.pubkey!==""&&n.pubkey!==this.pubkey){if(t)throw new Error("wrong event pubkey");return}if(this.pubkey=n.pubkey,this.lastUpdated=n.created_at,n.content&&n.content!==""){const o=lae(n.content);o&&(this.data=o)}const r=bk(e);return r&&(this.claims=r),this}getNip05Url(){var t;const e=((t=this.data)==null?void 0:t.nip05)||void 0;if(e)return nae(e)}validateWellKnown(e){return e?Object.keys(e.names).find(n=>e.names[n]===this.pubkey)?(this.nip05isValid=!0,!0):(this.nip05isValid=!1,!1):!1}getLud16(){var e;return((e=this.data)==null?void 0:e.lud16)||void 0}getLud16Url(){const e=this.getLud16();if(e)return tae(e)}getLud06(){var e;return((e=this.data)==null?void 0:e.lud06)||void 0}getLud06Url(){const e=this.getLud06();if(e)return eae(e)}getLud16Or06(){const e=this.getLud06();if(e)return{type:"lud06",url:e};const t=this.getLud16();if(t)return{type:"lud16",url:t}}getLud16Or06Url(){const e=this.getLud06Url();if(e)return{type:"lud06",url:e};const t=this.getLud16Url();if(t)return{type:"lud16",url:t}}getMetadataFilter(){const e=new za;return e.addAuthor(this.pubkey),e.addKind(0),e}toJson(){return{pubkey:this.pubkey,claims:this.claims,data:this.data,lightningZapInfo:this.lightningZapInfo,lastUpdated:this.lastUpdated,nip05isValid:this.nip05isValid}}fromJson(e){return this.pubkey=e.pubkey,this.claims=e.claims,this.data=e.data,this.lightningZapInfo=e.lightningZapInfo,this.lastUpdated=e.lastUpdated,this.nip05isValid=e.nip05isValid,this}};/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 - */const lk=Symbol("Comlink.proxy"),oae=Symbol("Comlink.endpoint"),iae=Symbol("Comlink.releaseProxy"),vg=Symbol("Comlink.finalizer"),lp=Symbol("Comlink.thrown"),uk=e=>typeof e=="object"&&e!==null||typeof e=="function",aae={canHandle:e=>uk(e)&&e[lk],serialize(e){const{port1:t,port2:n}=new MessageChannel;return fk(e,t),[n,[n]]},deserialize(e){return e.start(),hk(e)}},sae={canHandle:e=>uk(e)&&lp in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},ck=new Map([["proxy",aae],["throw",sae]]);function lae(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function fk(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(o){if(!o||!o.data)return;if(!lae(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:i,type:a,path:s}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(ls);let u;try{const c=s.slice(0,-1).reduce((d,h)=>d[h],e),f=s.reduce((d,h)=>d[h],e);switch(a){case"GET":u=f;break;case"SET":c[s.slice(-1)[0]]=ls(o.data.value),u=!0;break;case"APPLY":u=f.apply(c,l);break;case"CONSTRUCT":{const d=new f(...l);u=pae(d)}break;case"ENDPOINT":{const{port1:d,port2:h}=new MessageChannel;fk(e,h),u=hae(d,[d])}break;case"RELEASE":u=void 0;break;default:return}}catch(c){u={value:c,[lp]:0}}Promise.resolve(u).catch(c=>({value:c,[lp]:0})).then(c=>{const[f,d]=E1(c);t.postMessage(Object.assign(Object.assign({},f),{id:i}),d),a==="RELEASE"&&(t.removeEventListener("message",r),dk(t),vg in e&&typeof e[vg]=="function"&&e[vg]())}).catch(c=>{const[f,d]=E1({value:new TypeError("Unserializable return value"),[lp]:0});t.postMessage(Object.assign(Object.assign({},f),{id:i}),d)})}),t.start&&t.start()}function uae(e){return e.constructor.name==="MessagePort"}function dk(e){uae(e)&&e.close()}function hk(e,t){return rw(e,[],t)}function bh(e){if(e)throw new Error("Proxy has been released and is not useable")}function pk(e){return yl(e,{type:"RELEASE"}).then(()=>{dk(e)})}const S1=new WeakMap,_1="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(S1.get(e)||0)-1;S1.set(e,t),t===0&&pk(e)});function cae(e,t){const n=(S1.get(t)||0)+1;S1.set(t,n),_1&&_1.register(e,t,e)}function fae(e){_1&&_1.unregister(e)}function rw(e,t=[],n=function(){}){let r=!1;const o=new Proxy(n,{get(i,a){if(bh(r),a===iae)return()=>{fae(o),pk(e),r=!0};if(a==="then"){if(t.length===0)return{then:()=>o};const s=yl(e,{type:"GET",path:t.map(l=>l.toString())}).then(ls);return s.then.bind(s)}return rw(e,[...t,a])},set(i,a,s){bh(r);const[l,u]=E1(s);return yl(e,{type:"SET",path:[...t,a].map(c=>c.toString()),value:l},u).then(ls)},apply(i,a,s){bh(r);const l=t[t.length-1];if(l===oae)return yl(e,{type:"ENDPOINT"}).then(ls);if(l==="bind")return rw(e,t.slice(0,-1));const[u,c]=w4(s);return yl(e,{type:"APPLY",path:t.map(f=>f.toString()),argumentList:u},c).then(ls)},construct(i,a){bh(r);const[s,l]=w4(a);return yl(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:s},l).then(ls)}});return cae(o,e),o}function dae(e){return Array.prototype.concat.apply([],e)}function w4(e){const t=e.map(E1);return[t.map(n=>n[0]),dae(t.map(n=>n[1]))]}const mk=new WeakMap;function hae(e,t){return mk.set(e,t),e}function pae(e){return Object.assign(e,{[lk]:!0})}function E1(e){for(const[t,n]of ck)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},mk.get(e)||[]]}function ls(e){switch(e.type){case"HANDLER":return ck.get(e.name).deserialize(e.value);case"RAW":return e.value}}function yl(e,t,n){return new Promise(r=>{const o=mae();e.addEventListener("message",function i(a){!a.data||!a.data.id||a.data.id!==o||(e.removeEventListener("message",i),r(a.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)})}function mae(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const b4=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const f=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(d=>d(t,f))}},o=()=>t,s={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,o,s),s},yae=e=>e?b4(e):b4;var yk={exports:{}},gk={},vk={exports:{}},wk={};/** + */const Ek=Symbol("Comlink.proxy"),Sae=Symbol("Comlink.endpoint"),_ae=Symbol("Comlink.releaseProxy"),Tg=Symbol("Comlink.finalizer"),cp=Symbol("Comlink.thrown"),Ck=e=>typeof e=="object"&&e!==null||typeof e=="function",Eae={canHandle:e=>Ck(e)&&e[Ek],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Ok(e,t),[n,[n]]},deserialize(e){return e.start(),Pk(e)}},Cae={canHandle:e=>Ck(e)&&cp in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},xk=new Map([["proxy",Eae],["throw",Cae]]);function xae(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function Ok(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(o){if(!o||!o.data)return;if(!xae(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:i,type:a,path:s}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(fs);let u;try{const c=s.slice(0,-1).reduce((d,h)=>d[h],e),f=s.reduce((d,h)=>d[h],e);switch(a){case"GET":u=f;break;case"SET":c[s.slice(-1)[0]]=fs(o.data.value),u=!0;break;case"APPLY":u=f.apply(c,l);break;case"CONSTRUCT":{const d=new f(...l);u=Rae(d)}break;case"ENDPOINT":{const{port1:d,port2:h}=new MessageChannel;Ok(e,h),u=Iae(d,[d])}break;case"RELEASE":u=void 0;break;default:return}}catch(c){u={value:c,[cp]:0}}Promise.resolve(u).catch(c=>({value:c,[cp]:0})).then(c=>{const[f,d]=x1(c);t.postMessage(Object.assign(Object.assign({},f),{id:i}),d),a==="RELEASE"&&(t.removeEventListener("message",r),Ak(t),Tg in e&&typeof e[Tg]=="function"&&e[Tg]())}).catch(c=>{const[f,d]=x1({value:new TypeError("Unserializable return value"),[cp]:0});t.postMessage(Object.assign(Object.assign({},f),{id:i}),d)})}),t.start&&t.start()}function Oae(e){return e.constructor.name==="MessagePort"}function Ak(e){Oae(e)&&e.close()}function Pk(e,t){return pw(e,[],t)}function _h(e){if(e)throw new Error("Proxy has been released and is not useable")}function Tk(e){return vl(e,{type:"RELEASE"}).then(()=>{Ak(e)})}const E1=new WeakMap,C1="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(E1.get(e)||0)-1;E1.set(e,t),t===0&&Tk(e)});function Aae(e,t){const n=(E1.get(t)||0)+1;E1.set(t,n),C1&&C1.register(e,t,e)}function Pae(e){C1&&C1.unregister(e)}function pw(e,t=[],n=function(){}){let r=!1;const o=new Proxy(n,{get(i,a){if(_h(r),a===_ae)return()=>{Pae(o),Tk(e),r=!0};if(a==="then"){if(t.length===0)return{then:()=>o};const s=vl(e,{type:"GET",path:t.map(l=>l.toString())}).then(fs);return s.then.bind(s)}return pw(e,[...t,a])},set(i,a,s){_h(r);const[l,u]=x1(s);return vl(e,{type:"SET",path:[...t,a].map(c=>c.toString()),value:l},u).then(fs)},apply(i,a,s){_h(r);const l=t[t.length-1];if(l===Sae)return vl(e,{type:"ENDPOINT"}).then(fs);if(l==="bind")return pw(e,t.slice(0,-1));const[u,c]=P4(s);return vl(e,{type:"APPLY",path:t.map(f=>f.toString()),argumentList:u},c).then(fs)},construct(i,a){_h(r);const[s,l]=P4(a);return vl(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:s},l).then(fs)}});return Aae(o,e),o}function Tae(e){return Array.prototype.concat.apply([],e)}function P4(e){const t=e.map(x1);return[t.map(n=>n[0]),Tae(t.map(n=>n[1]))]}const Ik=new WeakMap;function Iae(e,t){return Ik.set(e,t),e}function Rae(e){return Object.assign(e,{[Ek]:!0})}function x1(e){for(const[t,n]of xk)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},Ik.get(e)||[]]}function fs(e){switch(e.type){case"HANDLER":return xk.get(e.name).deserialize(e.value);case"RAW":return e.value}}function vl(e,t,n){return new Promise(r=>{const o=kae();e.addEventListener("message",function i(a){!a.data||!a.data.id||a.data.id!==o||(e.removeEventListener("message",i),r(a.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)})}function kae(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const T4=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const f=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(d=>d(t,f))}},o=()=>t,s={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,o,s),s},Mae=e=>e?T4(e):T4;var Rk={exports:{}},kk={},Mk={exports:{}},Dk={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -426,7 +426,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ou=P;function gae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vae=typeof Object.is=="function"?Object.is:gae,wae=Ou.useState,bae=Ou.useEffect,Sae=Ou.useLayoutEffect,_ae=Ou.useDebugValue;function Eae(e,t){var n=t(),r=wae({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Sae(function(){o.value=n,o.getSnapshot=t,wg(o)&&i({inst:o})},[e,n,t]),bae(function(){return wg(o)&&i({inst:o}),e(function(){wg(o)&&i({inst:o})})},[e]),_ae(n),n}function wg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vae(e,n)}catch{return!0}}function Cae(e,t){return t()}var xae=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Cae:Eae;wk.useSyncExternalStore=Ou.useSyncExternalStore!==void 0?Ou.useSyncExternalStore:xae;vk.exports=wk;var Oae=vk.exports;/** + */var Pu=P;function Dae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lae=typeof Object.is=="function"?Object.is:Dae,Nae=Pu.useState,Bae=Pu.useEffect,jae=Pu.useLayoutEffect,Fae=Pu.useDebugValue;function $ae(e,t){var n=t(),r=Nae({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return jae(function(){o.value=n,o.getSnapshot=t,Ig(o)&&i({inst:o})},[e,n,t]),Bae(function(){return Ig(o)&&i({inst:o}),e(function(){Ig(o)&&i({inst:o})})},[e]),Fae(n),n}function Ig(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lae(e,n)}catch{return!0}}function zae(e,t){return t()}var Vae=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?zae:$ae;Dk.useSyncExternalStore=Pu.useSyncExternalStore!==void 0?Pu.useSyncExternalStore:Vae;Mk.exports=Dk;var Uae=Mk.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -434,14 +434,14 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _m=P,Aae=Oae;function Pae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tae=typeof Object.is=="function"?Object.is:Pae,Iae=Aae.useSyncExternalStore,Rae=_m.useRef,kae=_m.useEffect,Mae=_m.useMemo,Dae=_m.useDebugValue;gk.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Rae(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Mae(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),o!==void 0&&a.hasValue){var p=a.value;if(o(p,h))return f=p}return f=h}if(p=f,Tae(c,h))return p;var m=r(h);return o!==void 0&&o(p,m)?p:(c=h,f=m)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,o]);var s=Iae(e,i[0],i[1]);return kae(function(){a.hasValue=!0,a.value=s},[s]),Dae(s),s};yk.exports=gk;var Lae=yk.exports;const Nae=Qe(Lae),{useSyncExternalStoreWithSelector:Bae}=Nae;function jae(e,t=e.getState,n){const r=Bae(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return P.useDebugValue(r),r}const S4=e=>{const t=typeof e=="function"?yae(e):e,n=(r,o)=>jae(t,r,o);return Object.assign(n,t),n},Fae=e=>e?S4(e):S4,bk=100,ow={"wss://relay.shitforce.one":{read:!0,write:!0},"wss://relay.nostr.band":{read:!0,write:!0},"wss://offchain.pub":{read:!0,write:!1},"wss://nos.lol":{read:!0,write:!1},"wss://relay.snort.social":{read:!0,write:!1},"wss://relay.damus.io":{read:!0,write:!0},"wss://soloco.nl":{read:!0,write:!1},"wss://eden.nostr.land":{read:!0,write:!0},"wss://nostr.gruntwerk.org":{read:!0,write:!1},"wss://relay.cryptocculture.com":{read:!0,write:!1},"wss://relay.nostr.bg":{read:!0,write:!1},"wss://relay.nostrich.de":{read:!0,write:!1},"wss://relay.nostr.ro":{read:!0,write:!1}};function $ae(){const e=localStorage.getItem("nostr-client:keystore:keystore");if(e)if(e==="localstore"){const t=localStorage.getItem("nostr-client:keystore:public-key"),n=localStorage.getItem("nostr-client:keystore:private-key");if(t&&n)return{keystore:"localstore",publicKey:t,privateKey:n}}else{if(e==="nos2x")return{keystore:"nos2x",publicKey:void 0,privateKey:void 0};if(e==="download")return{keystore:"download",publicKey:void 0,privateKey:void 0}}return{keystore:"none",publicKey:void 0,privateKey:void 0}}function bg(e){localStorage.setItem("nostr-client:keystore:keystore",e.keystore),e.keystore==="localstore"&&e.publicKey&&e.privateKey?(localStorage.setItem("nostr-client:keystore:public-key",e.publicKey),localStorage.setItem("nostr-client:keystore:private-key",e.privateKey)):e.keystore==="nos2x"||e.keystore}const zae=500,_4=new Worker(new URL("/nostr-ts/assets/worker-ef9cca43.js",self.location),{type:"module"});function Uae(e,t){let n=null,r=[];return function(o){if(o.data.type==="event:update"){const i=o.data.data.event.id,a=r.findIndex(s=>s.data.type==="event:update"?s.data.data.event.id===i:!1);a!==-1?r[a]=o:r.push(o)}else r.push(o);n||(n=setTimeout(()=>{e(r),r=[],n=null},t))}}const Z=Fae((e,t)=>({status:"loading",store:hk(_4),_processEvents:n=>{n.forEach(r=>{const o=r.data;if(o.type!=="RAW")switch(o.type){case"event:notify":break;case"event:new":t().addEvent(o.data,o.view);break;case"event:update":t().updateEvent(o.data);break;case"relay:message":e({relayEvents:[...t().relayEvents,o.data]});break;case"status:change":e({status:o.data}),console.log(`Status changed to ${o.data}`);break;default:console.log(`Unsupported payload type: ${o.type}`)}})},init:async()=>{try{await t().loadKeyStore();const n=Uae(t()._processEvents,zae);_4.addEventListener("message",n),await t().store.init()}catch(n){console.error("Initialization failed:",n)}},connected:!1,connect:async n=>{t().connected||(await t().store.connect(n),e({connected:!0}))},disconnect:async()=>{await t().store.disconnect(),e({connected:!1})},getRelays:async()=>t().store.getRelays(),updateRelay:async(n,r)=>t().store.updateRelay(n,r),relayAuth:async(n,r)=>{const o=t().keypair;if(!o)throw new Error("Keypair not initialized");const i=t().keystore,a=tae({relayUrl:n,challenge:r});if(a.pubkey=o.publicKey,a.generateId(),i==="localstore"){if(!o.privateKey||o.privateKey==="")throw new Error("No private key available");a.sign({privateKey:o.privateKey,publicKey:o.publicKey})}else if(i==="nos2x")if(window.nostr&&window.nostr.signEvent){const s=await window.nostr.signEvent(a.ToObj());if(!s.sig)throw new Error("No signature");a.sig=s.sig}else throw new Error("Nostr not initialized");else throw new Error("Invalid keystore");await t().subscribe({type:Cd.AUTH,signedEvent:a.ToObj(),relayUrls:[n],options:{timeoutIn:3e5}})},relayEvents:[],getSubscriptions:async n=>t().store.getSubscriptions(n),subscribe:async n=>t().store.subscribe(n),unsubscribe:async n=>t().store.unsubscribe(n),unsubscribeAll:async()=>t().store.unsubscribeAll(),unsubscribeByToken:async n=>(console.log("=> CLIENT: Unsubscribe by token",n),e(r=>({events:{...r.events,[n]:[]},eventsNewest:{...r.eventsNewest,[n]:0},eventsNewer:{...r.eventsNewer,[n]:[]}})),t().store.unsubscribeByToken(n)),keystore:"none",loadKeyStore:()=>{const n=$ae();e({keystore:n.keystore}),n.keystore==="localstore"&&n.publicKey&&n.privateKey&&(e({keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0}),t().store.setUserPubkey(n.publicKey))},saveKeyStore:()=>{const n=t().keystore;if(n==="localstore"){const r=t().keypair;bg(r?{keystore:n,publicKey:r.publicKey,privateKey:r.privateKey}:{keystore:n})}},resetKeyStore:()=>{bg({keystore:"none"}),e({keystore:"none",keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1}),t().store.setUserPubkey("")},setKeyStore:n=>{n.keystore==="localstore"?n.publicKey&&n.privateKey&&(e({keystore:n.keystore,keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0}),t().saveKeyStore(),t().store.setUserPubkey(n.publicKey)):n.keystore==="nos2x"?(e({keystore:n.keystore,keypair:{publicKey:n.publicKey||""},keypairIsLoaded:!0}),t().store.setUserPubkey(n.publicKey||"")):console.error(`Unknown keystore ${n.keystore}`)},keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1,getPopularEvents:async()=>t().store.getPopularEvents(),getPopularUsers:async()=>t().store.getPopularUsers(),calculatePopular:async()=>t().store.calculatePopular(),count:async n=>(console.log("=> CLIENT: TODO Count",n),new Promise(r=>r([]))),countEvents:async()=>new Promise(n=>n(0)),getEvent:async(n,r)=>{const o=await t().store.getEvent(n,r);return o&&e(i=>{const a=i.events;return i.events[r.view]=[o],{events:a}}),o},nextQuery:void 0,getEvents:async(n,r)=>{var u,c;if(!n){const f=t().nextQuery;if(!f)throw new Error("No query params provided and no next query set");n={token:f.token,query:f.next}}const{token:o,query:i}=n,a=r||"append",s=i.reqCount?i.reqCount===0:!0;s&&e({nextQuery:void 0});const l=await t().store.getEvents(n);if(t().nextQuery&&o!==((u=t().nextQuery)==null?void 0:u.token)||!l.events||l.events.length===0)return l.next;if(!n.query.reqCount||n.query.reqCount===0){const f=(c=l.events)==null?void 0:c.reduce((d,h)=>d.event.created_at>h.event.created_at?d:h);e({eventsNewest:{...t().eventsNewest,token:(f==null?void 0:f.event.created_at)||0}})}return e(f=>{const d={...f.events};return l.events&&l.events.length>0&&(s||a==="replace"?d[o]=l.events:a==="prepend"?d[o]=[...l.events,...d[o]||[]]:d[o]=[...d[o]||[],...l.events]),{events:d,nextQuery:{token:o,next:l.next}}}),l.next},getEventReplies:async(n,r,o)=>{const i=await t().store.getEventReplies(n,r,o);if(i)return e(a=>{const s=a.events;return a.events[r]=i,{events:s}}),i.length},events:{},eventsNewest:{},mergeNewerEvents:n=>{e(r=>{const o=r.events[n]||[],i=r.eventsNewer[n]||[];i.sort((s,l)=>s.event.created_at>l.event.created_at?-1:1),t().requestInformation({source:"events:related",idsOrKeys:[...i.map(s=>s.event.id)]},{view:n,timeoutIn:1e4,isLive:!0}),t().requestInformation({source:"users",idsOrKeys:[...new Set([...i.map(s=>s.event.pubkey)])]},{view:n,timeoutIn:1e4,isLive:!0});const a=[...i,...o];return{events:{...r.events,[n]:a},eventsNewer:{...r.eventsNewer,[n]:[]}}})},eventsNewer:{},addEvent:(n,r)=>{e(o=>{const i=o.eventsNewest[r]||0,s=(i===0?!0:n.event.created_at>i)?"eventsNewer":"events",l=o[s][r]||[];return l.find(c=>c.event.id===n.event.id)?o:{[s]:{...o[s],[r]:[...l,n]}}})},updateEvent:(n,r)=>{if(r){const i=(t().events[r]||[]).findIndex(a=>a.event.id===n.event.id);if(i!==-1){e(a=>{const s=a.events[r]||[];return s[i]=n,{events:{...a.events,[r]:s}}});return}}else{let o=!1;["events","eventsNewer"].forEach(i=>{if(o)return;const a=i==="events"?t().events:t().eventsNewer;for(const s in a)if(Object.prototype.hasOwnProperty.call(a,s)){const u=a[s].findIndex(c=>c.event.id===n.event.id);if(u!==-1){o=!0,e(c=>{const f=c[i][s]||[];return f[u]=n,{[i]:{...c[i],[s]:f}}});return}}})}},maxEvents:bk,setMaxEvents:async n=>{e({maxEvents:n})},determineApplicableRelays:async n=>{const r=await t().getRelays();if(!r){console.log("=> CLIENT: No relays found");return}const i=(n.relayUrls&&n.relayUrls.length>0?r.filter(a=>{var s;return(s=n.relayUrls)==null?void 0:s.includes(a.url)}):r).filter(a=>a.isReady&&a.write);if(i.length===0){console.log("=> CLIENT: No ready relays found");return}return console.log(`=> CLIENT: Found ${i.length} ready relays`),{relays:i,pow:0}},generateQueueItems:async n=>{const r=await t().determineApplicableRelays(n);if(!r)return;const o=[];for(const i of r.relays){const{relayUrls:a,...s}=n;o.push({...s,id:Bre(),relayUrl:i.url,send:!1})}return console.log(o),o},getQueueItems:async()=>t().store.getQueueItems(),getUser:async n=>t().store.getUser(n),addUser:async n=>t().store.addUser(n),updateUser:async(n,r)=>t().store.updateUser(n,r),countUsers:async()=>t().store.countUsers(),eventProofOfWork:async(n,r)=>new Promise(o=>{const i=new Worker(new URL("/nostr-ts/assets/pow-worker-3948d45b.js",self.location),{type:"module"});i.onmessage=function(a){o(a.data.result),i.terminate()},i.postMessage({event:n,bits:r})}),sendEvent:async n=>t().store.sendEvent(n),signEvent:async n=>{const r=t().keystore;if(n.pubkey||(n.pubkey=t().keypair.publicKey),n.id||n.generateId(),r==="localstore"){const o=t().keypair;if(!o)throw new Error("Keypair not initialized");return n.sign({privateKey:o.privateKey||"",publicKey:o.publicKey}),n}else if(r==="nos2x")if(window.nostr&&window.nostr.signEvent){const o=await window.nostr.signEvent(n.ToObj());if(!o.sig)throw new Error("No signature");return n.sig=o.sig,n}else throw new Error("Nostr not initialized");else throw new Error("Invalid keystore")},signAndSendEvent:async n=>{const r=t().keypair;if(!r)throw new Error("Keypair not initialized");let o=n.event;o.pubkey=r.publicKey,o.generateId();let i=n.relayUrls;const a=await t().determineApplicableRelays(n);if(!a)throw new Error("No relays available");i=a.relays.map(c=>c.url);let s=n.pow;const l=a.pow;if(s&&s!==0){if(s0){const c=await t().generateQueueItems({...n,relayUrls:i,pow:s});c&&(u=c),await t().store.addQueueItems(u);const f=await t().eventProofOfWork(n.event,s);o=new sr(f);for(const d of u)d.event=o,d.powDone=Date.now()}if(o=await t().signEvent(o),o.isReadyToPublishOrThrow(),u.length===0){const c=await t().generateQueueItems({...n,relayUrls:i,pow:s,event:o});c&&(u=c),await t().store.addQueueItems(u)}else for(const c of u)c.event=o,await t().store.updateQueueItem(c);return await t().store.sendQueueItems(u),o.id},followUser:async n=>{await t().store.followUser(n.pubkey)},unfollowUser:async n=>{await t().store.unfollowUser(n)},followingUser:async n=>{const r=await t().store.getUser(n);return(r==null?void 0:r.following)||!1},getAllUsersFollowing:async()=>t().store.getAllUsersFollowing(),blockUser:async n=>{await t().store.blockUser(n.pubkey);const r=t().events;e(o=>{const i={};for(const[a,s]of Object.entries(r))i[a]=s.filter(l=>l.event.pubkey!==n.pubkey);return{events:i}})},unblockUser:async n=>t().store.unblockUser(n),getAllUsersBlocked:async()=>t().store.getAllUsersBlocked(),lastContactsUpdate:async n=>t().store.lastContactsUpdate(n),createList:async n=>t().store.createList(n),updateList:async(n,r)=>t().store.updateList(n,r),deleteList:async n=>t().store.deleteList(n),getAllLists:async()=>t().store.getAllLists(),getList:async n=>t().store.getList(n),getListsWithUser:async n=>t().store.getListsWithUser(n),addUserToList:async(n,r)=>t().store.addUserToList(n,r),removeUserFromList:async(n,r)=>t().store.removeUserFromList(n,r),requestInformation:(n,r)=>t().store.requestInformation(n,r)}));var Sh,iw,Vae=(Sh=function(e,t){return Sh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},Sh(e,t)},function(e,t){function n(){this.constructor=e}Sh(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),Hae=function(e){function t(n){var r,o,i,a=this.constructor,s=e.call(this,n)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),r=s,o=a.prototype,(i=Object.setPrototypeOf)?i(r,o):r.__proto__=o,function(l,u){u===void 0&&(u=l.constructor);var c=Error.captureStackTrace;c&&c(l,u)}(s),s}return Vae(t,e),t}(Error),Wae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tr=function(e){function t(n){n===void 0&&(n=void 0);var r=e.call(this,n)||this;return r.message=n,r}return Wae(t,e),t.prototype.getKind=function(){return this.constructor.kind},t.kind="Exception",t}(Hae),Gae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yt=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Gae(t,e),t.kind="ArgumentException",t}(Tr),Kae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Me=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Kae(t,e),t.kind="IllegalArgumentException",t}(Tr),Sk=function(){function e(t){if(this.binarizer=t,t===null)throw new Me("Binarizer must be non-null.")}return e.prototype.getWidth=function(){return this.binarizer.getWidth()},e.prototype.getHeight=function(){return this.binarizer.getHeight()},e.prototype.getBlackRow=function(t,n){return this.binarizer.getBlackRow(t,n)},e.prototype.getBlackMatrix=function(){return this.matrix!==null&&this.matrix!==void 0||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},e.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},e.prototype.crop=function(t,n,r,o){var i=this.binarizer.getLuminanceSource().crop(t,n,r,o);return new e(this.binarizer.createBinarizer(i))},e.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},e.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new e(this.binarizer.createBinarizer(t))},e.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new e(this.binarizer.createBinarizer(t))},e.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},e}(),Xae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hn=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Xae(t,e),t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}(Tr),qae=function(){function e(t){this.source=t}return e.prototype.getLuminanceSource=function(){return this.source},e.prototype.getWidth=function(){return this.source.getWidth()},e.prototype.getHeight=function(){return this.source.getHeight()},e}(),It=function(){function e(){}return e.arraycopy=function(t,n,r,o,i){for(;i--;)r[o++]=t[n++]},e.currentTimeMillis=function(){return Date.now()},e}(),Yae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),p_=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Yae(t,e),t.kind="IndexOutOfBoundsException",t}(Tr),Zae=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),E4=function(e){function t(n,r){n===void 0&&(n=void 0),r===void 0&&(r=void 0);var o=e.call(this,r)||this;return o.index=n,o.message=r,o}return Zae(t,e),t.kind="ArrayIndexOutOfBoundsException",t}(p_),Qae=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gr=function(){function e(){}return e.fill=function(t,n){for(var r=0,o=t.length;rr)throw new Me("fromIndex("+n+") > toIndex("+r+")");if(n<0)throw new E4(n);if(r>t)throw new E4(r)},e.asList=function(){for(var t=[],n=0;n>1,s=r(n,t[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},e.numberComparator=function(t,n){return t-n},e}(),Dn=function(){function e(){}return e.numberOfTrailingZeros=function(t){var n;if(t===0)return 32;var r=31;return(n=t<<16)!==0&&(r-=16,t=n),(n=t<<8)!==0&&(r-=8,t=n),(n=t<<4)!==0&&(r-=4,t=n),(n=t<<2)!==0&&(r-=2,t=n),r-(t<<1>>>31)},e.numberOfLeadingZeros=function(t){if(t===0)return 32;var n=1;return!(t>>>16)&&(n+=16,t<<=16),!(t>>>24)&&(n+=8,t<<=8),!(t>>>28)&&(n+=4,t<<=4),!(t>>>30)&&(n+=2,t<<=2),n-=t>>>31},e.toHexString=function(t){return t.toString(16)},e.toBinaryString=function(t){return String(parseInt(String(t),2))},e.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,t+=t>>>8,63&(t+=t>>>16)},e.truncDivision=function(t,n){return Math.trunc(t/n)},e.parseInt=function(t,n){return n===void 0&&(n=void 0),parseInt(t,n)},e.MIN_VALUE_32_BITS=-2147483648,e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}(),ri=function(){function e(t,n){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=n??e.makeArray(t))}return e.prototype.getSize=function(){return this.size},e.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},e.prototype.ensureCapacity=function(t){if(t>32*this.bits.length){var n=e.makeArray(t);It.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},e.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(31&t))!=0},e.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},e.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},e.prototype.getNextSet=function(t){var n=this.size;if(t>=n)return n;var r=this.bits,o=Math.floor(t/32),i=r[o];i&=~((1<<(31&t))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=r[o]}var s=32*o+Dn.numberOfTrailingZeros(i);return s>n?n:s},e.prototype.getNextUnset=function(t){var n=this.size;if(t>=n)return n;var r=this.bits,o=Math.floor(t/32),i=~r[o];i&=~((1<<(31&t))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=~r[o]}var s=32*o+Dn.numberOfTrailingZeros(i);return s>n?n:s},e.prototype.setBulk=function(t,n){this.bits[Math.floor(t/32)]=n},e.prototype.setRange=function(t,n){if(nthis.size)throw new Me;if(n!==t){n--;for(var r=Math.floor(t/32),o=Math.floor(n/32),i=this.bits,a=r;a<=o;a++){var s=(2<<(ar?0:31&t));i[a]|=s}}},e.prototype.clear=function(){for(var t=this.bits.length,n=this.bits,r=0;rthis.size)throw new Me;if(n===t)return!0;n--;for(var o=Math.floor(t/32),i=Math.floor(n/32),a=this.bits,s=o;s<=i;s++){var l=(2<<(so?0:31&t))&4294967295;if((a[s]&l)!==(r?l:0))return!1}return!0},e.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},e.prototype.appendBits=function(t,n){if(n<0||n>32)throw new Me("Num bits must be between 0 and 32");this.ensureCapacity(this.size+n);for(var r=n;r>0;r--)this.appendBit((t>>r-1&1)==1)},e.prototype.appendBitArray=function(t){var n=t.size;this.ensureCapacity(this.size+n);for(var r=0;r>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,t[n-i]=a}if(this.size!==32*r){var s=32*r-this.size,l=t[0]>>>s;for(i=1;i>>s}t[r-1]=l}this.bits=t},e.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.size===n.size&&Gr.equals(this.bits,n.bits)},e.prototype.hashCode=function(){return 31*this.size+Gr.hashCode(this.bits)},e.prototype.toString=function(){for(var t="",n=0,r=this.size;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(e){e[e.Cp437=0]="Cp437",e[e.ISO8859_1=1]="ISO8859_1",e[e.ISO8859_2=2]="ISO8859_2",e[e.ISO8859_3=3]="ISO8859_3",e[e.ISO8859_4=4]="ISO8859_4",e[e.ISO8859_5=5]="ISO8859_5",e[e.ISO8859_6=6]="ISO8859_6",e[e.ISO8859_7=7]="ISO8859_7",e[e.ISO8859_8=8]="ISO8859_8",e[e.ISO8859_9=9]="ISO8859_9",e[e.ISO8859_10=10]="ISO8859_10",e[e.ISO8859_11=11]="ISO8859_11",e[e.ISO8859_13=12]="ISO8859_13",e[e.ISO8859_14=13]="ISO8859_14",e[e.ISO8859_15=14]="ISO8859_15",e[e.ISO8859_16=15]="ISO8859_16",e[e.SJIS=16]="SJIS",e[e.Cp1250=17]="Cp1250",e[e.Cp1251=18]="Cp1251",e[e.Cp1252=19]="Cp1252",e[e.Cp1256=20]="Cp1256",e[e.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",e[e.UTF8=22]="UTF8",e[e.ASCII=23]="ASCII",e[e.Big5=24]="Big5",e[e.GB18030=25]="GB18030",e[e.EUC_KR=26]="EUC_KR"})(at||(at={}));var aw,mr=function(){function e(t,n,r){for(var o,i,a=[],s=3;s=900)throw new ae("incorect value");var n=e.VALUES_TO_ECI.get(t);if(n===void 0)throw new ae("incorect value");return n},e.getCharacterSetECIByName=function(t){var n=e.NAME_TO_ECI.get(t);if(n===void 0)throw new ae("incorect value");return n},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.getName()===n.getName()},e.VALUE_IDENTIFIER_TO_ECI=new Map,e.VALUES_TO_ECI=new Map,e.NAME_TO_ECI=new Map,e.Cp437=new e(at.Cp437,Int32Array.from([0,2]),"Cp437"),e.ISO8859_1=new e(at.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),e.ISO8859_2=new e(at.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),e.ISO8859_3=new e(at.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),e.ISO8859_4=new e(at.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),e.ISO8859_5=new e(at.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),e.ISO8859_6=new e(at.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),e.ISO8859_7=new e(at.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),e.ISO8859_8=new e(at.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),e.ISO8859_9=new e(at.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),e.ISO8859_10=new e(at.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),e.ISO8859_11=new e(at.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),e.ISO8859_13=new e(at.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),e.ISO8859_14=new e(at.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),e.ISO8859_15=new e(at.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),e.ISO8859_16=new e(at.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),e.SJIS=new e(at.SJIS,20,"SJIS","Shift_JIS"),e.Cp1250=new e(at.Cp1250,21,"Cp1250","windows-1250"),e.Cp1251=new e(at.Cp1251,22,"Cp1251","windows-1251"),e.Cp1252=new e(at.Cp1252,23,"Cp1252","windows-1252"),e.Cp1256=new e(at.Cp1256,24,"Cp1256","windows-1256"),e.UnicodeBigUnmarked=new e(at.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),e.UTF8=new e(at.UTF8,26,"UTF8","UTF-8"),e.ASCII=new e(at.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),e.Big5=new e(at.Big5,28,"Big5"),e.GB18030=new e(at.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),e.EUC_KR=new e(at.EUC_KR,30,"EUC_KR","EUC-KR"),e}(),tse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),up=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return tse(t,e),t.kind="UnsupportedOperationException",t}(Tr),Is=function(){function e(){}return e.decode=function(t,n){var r=this.encodingName(n);return this.customDecoder?this.customDecoder(t,r):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(r)?this.decodeFallback(t,r):new TextDecoder(r).decode(t)},e.shouldDecodeOnFallback=function(t){return!e.isBrowser()&&t==="ISO-8859-1"},e.encode=function(t,n){var r=this.encodingName(n);return this.customEncoder?this.customEncoder(t,r):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)},e.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},e.encodingName=function(t){return typeof t=="string"?t:t.getName()},e.encodingCharacterSet=function(t){return t instanceof mr?t:mr.getCharacterSetECIByName(t)},e.decodeFallback=function(t,n){var r=this.encodingCharacterSet(n);if(e.isDecodeFallbackSupported(r)){for(var o="",i=0,a=t.length;i3&&t[0]===239&&t[1]===187&&t[2]===191,E=0;E0?128&T?s--:a=!1:128&T&&(64&T?(s++,32&T?(s++,16&T?(s++,8&T?a=!1:c++):u++):l++):a=!1)),o&&(T>127&&T<160?o=!1:T>159&&(T<192||T===215||T===247)&&b++),i&&(f>0?T<64||T===127||T>252?i=!1:f--:T===128||T===160||T>239?i=!1:T>160&&T<224?(d++,p=0,++h>m&&(m=h)):T>127?(f++,h=0,++p>_&&(_=p)):(h=0,p=0))}return a&&s>0&&(a=!1),i&&f>0&&(i=!1),a&&(g||l+u+c>0)?e.UTF8:i&&(e.ASSUME_SHIFT_JIS||m>=3||_>=3)?e.SHIFT_JIS:o&&i?m===2&&d===2||10*b>=r?e.SHIFT_JIS:e.ISO88591:o?e.ISO88591:i?e.SHIFT_JIS:a?e.UTF8:e.PLATFORM_DEFAULT_ENCODING},e.format=function(t){for(var n=[],r=1;ra){if(s===-1)s=i-a;else if(i-a!==s)throw new Me("row lengths do not match");a=i,l++}u++}else if(t.substring(u,u+n.length)===n)u+=n.length,o[i]=!0,i++;else{if(t.substring(u,u+r.length)!==r)throw new Me("illegal character encountered: "+t.substring(u));u+=r.length,o[i]=!1,i++}if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new Me("row lengths do not match");l++}for(var c=new e(s,l),f=0;f>>(31&t)&1)!=0},e.prototype.set=function(t,n){var r=n*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)&4294967295},e.prototype.unset=function(t,n){var r=n*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t)&4294967295)},e.prototype.flip=function(t,n){var r=n*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)&4294967295},e.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new Me("input matrix dimensions do not match");for(var n=new ri(Math.floor(this.width/32)+1),r=this.rowSize,o=this.bits,i=0,a=this.height;ithis.height||i>this.width)throw new Me("The region must fit inside the matrix");for(var s=this.rowSize,l=this.bits,u=n;ul&&(l=u),32*cs){for(d=31;!(f>>>d);)d--;32*c+d>s&&(s=32*c+d)}}}return s=0&&n[r]===0;)r--;if(r<0)return null;for(var o=Math.floor(r/t),i=32*Math.floor(r%t),a=n[r],s=31;!(a>>>s);)s--;return i+=s,Int32Array.from([i,o])},e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.getRowSize=function(){return this.rowSize},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.width===n.width&&this.height===n.height&&this.rowSize===n.rowSize&&Gr.equals(this.bits,n.bits)},e.prototype.hashCode=function(){var t=this.width;return t=31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+Gr.hashCode(this.bits)},e.prototype.toString=function(t,n,r){return t===void 0&&(t="X "),n===void 0&&(n=" "),r===void 0&&(r=` -`),this.buildToString(t,n,r)},e.prototype.buildToString=function(t,n,r){for(var o=new mt,i=0,a=this.height;i>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(s);if(i<3)for(l=0;l>t.LUMINANCE_SHIFT]++;var d=t.estimateBlackPoint(a),h=n.getMatrix();for(s=0;sa&&(i=s,a=n[s]),n[s]>o&&(o=n[s]);var l=0,u=0;for(s=0;su&&(l=s,u=p)}if(i>l){var f=i;i=l,l=f}if(l-i<=r/16)throw new Y;var d=l-1,h=-1;for(s=l-1;s>i;s--){var p,m=s-i;(p=m*m*(l-s)*(o-n[s]))>h&&(d=s,h=p)}return d<=t.MINIMUM_DIMENSION&&o>=t.MINIMUM_DIMENSION){var i=n.getMatrix(),a=r>>t.BLOCK_SIZE_POWER;r&t.BLOCK_SIZE_MASK&&a++;var s=o>>t.BLOCK_SIZE_POWER;o&t.BLOCK_SIZE_MASK&&s++;var l=t.calculateBlackPoints(i,a,s,r,o),u=new Fi(r,o);t.calculateThresholdForBlock(i,a,s,r,o,l,u),this.matrix=u}else this.matrix=e.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(n){return new t(n)},t.calculateThresholdForBlock=function(n,r,o,i,a,s,l){for(var u=a-t.BLOCK_SIZE,c=i-t.BLOCK_SIZE,f=0;fu&&(d=u);for(var h=t.cap(f,2,o-3),p=0;pc&&(m=c);for(var _=t.cap(p,2,r-3),b=0,g=-2;g<=2;g++){var E=s[h+g];b+=E[_-2]+E[_-1]+E[_]+E[_+1]+E[_+2]}var T=b/25;t.thresholdBlock(n,m,d,T,i,l)}}},t.cap=function(n,r,o){return no?o:n},t.thresholdBlock=function(n,r,o,i,a,s){for(var l=0,u=o*a+r;ls&&(f=s);for(var d=0;dl&&(h=l);for(var p=0,m=255,_=0,b=0,g=f*i+h;b_&&(_=T)}if(_-m>t.MIN_DYNAMIC_RANGE)for(b++,g+=i;b>2*t.BLOCK_SIZE_POWER;if(_-m<=t.MIN_DYNAMIC_RANGE&&(O=m/2,c>0&&d>0)){var A=(u[c-1][d]+2*u[c][d-1]+u[c-1][d-1])/4;m>10,i[s]=u}return i},t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length0&&o[o.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},zu=function(){function e(t,n,r){n===void 0&&(n=500),this.reader=t,this.timeBetweenScansMillis=n,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(e.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),e.prototype.listVideoInputDevices=function(){return Kn(this,void 0,void 0,function(){var t,n,r,o,i,a,s,l,u,c,f,d;return Xn(this,function(h){switch(h.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=h.sent(),n=[];try{for(r=cse(t),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,l=i.label||"Video device "+(n.length+1),u=i.groupId,c={deviceId:s,label:l,kind:a,groupId:u},n.push(c))}catch(p){f={error:p}}finally{try{o&&!o.done&&(d=r.return)&&d.call(r)}finally{if(f)throw f.error}}return[2,n]}})})},e.prototype.getVideoInputDevices=function(){return Kn(this,void 0,void 0,function(){return Xn(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map(function(n){return new use(n.deviceId,n.label)})]}})})},e.prototype.findDeviceById=function(t){return Kn(this,void 0,void 0,function(){var n;return Xn(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===t})]:[2,null]}})})},e.prototype.decodeFromInputVideoDevice=function(t,n){return Kn(this,void 0,void 0,function(){return Xn(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,n)];case 1:return[2,r.sent()]}})})},e.prototype.decodeOnceFromVideoDevice=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return this.reset(),r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},e.prototype.decodeOnceFromConstraints=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},e.prototype.decodeOnceFromStream=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,n)];case 1:return r=o.sent(),[4,this.decodeOnce(r)];case 2:return[2,o.sent()]}})})},e.prototype.decodeFromInputVideoDeviceContinuously=function(t,n,r){return Kn(this,void 0,void 0,function(){return Xn(this,function(o){switch(o.label){case 0:return[4,this.decodeFromVideoDevice(t,n,r)];case 1:return[2,o.sent()]}})})},e.prototype.decodeFromVideoDevice=function(t,n,r){return Kn(this,void 0,void 0,function(){var o;return Xn(this,function(i){switch(i.label){case 0:return o={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},e.prototype.decodeFromConstraints=function(t,n,r){return Kn(this,void 0,void 0,function(){var o;return Xn(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return o=i.sent(),[4,this.decodeFromStream(o,n,r)];case 2:return[2,i.sent()]}})})},e.prototype.decodeFromStream=function(t,n,r){return Kn(this,void 0,void 0,function(){var o;return Xn(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,n)];case 1:return o=i.sent(),[4,this.decodeContinuously(o,r)];case 2:return[2,i.sent()]}})})},e.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},e.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},e.prototype.attachStreamToVideo=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return r=this.prepareVideoElement(n),this.addVideoSource(r,t),this.videoElement=r,this.stream=t,[4,this.playVideoOnLoadAsync(r)];case 1:return o.sent(),[2,r]}})})},e.prototype.playVideoOnLoadAsync=function(t){var n=this;return new Promise(function(r,o){return n.playVideoOnLoad(t,function(){return r()})})},e.prototype.playVideoOnLoad=function(t,n){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",n),this.tryPlayVideo(t)},e.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},e.prototype.tryPlayVideo=function(t){return Kn(this,void 0,void 0,function(){return Xn(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[3,4];case 3:return n.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},e.prototype.getMediaElement=function(t,n){var r=document.getElementById(t);if(!r)throw new Yt("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Yt("element with id '"+t+"' must be an "+n+" element");return r},e.prototype.decodeFromImage=function(t,n){if(!t&&!n)throw new Yt("either imageElement with a src set or an url must be provided");return n&&!t?this.decodeFromImageUrl(n):this.decodeFromImageElement(t)},e.prototype.decodeFromVideo=function(t,n){if(!t&&!n)throw new Yt("Either an element with a src set or an URL must be provided");return n&&!t?this.decodeFromVideoUrl(n):this.decodeFromVideoElement(t)},e.prototype.decodeFromVideoContinuously=function(t,n,r){if(t===void 0&&n===void 0)throw new Yt("Either an element with a src set or an URL must be provided");return n&&!t?this.decodeFromVideoUrlContinuously(n,r):this.decodeFromVideoElementContinuously(t,r)},e.prototype.decodeFromImageElement=function(t){if(!t)throw new Yt("An image element must be provided.");this.reset();var n=this.prepareImageElement(t);return this.imageElement=n,this.isImageLoaded(n)?this.decodeOnce(n,!1,!0):this._decodeOnLoadImage(n)},e.prototype.decodeFromVideoElement=function(t){var n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(n)},e.prototype.decodeFromVideoElementContinuously=function(t,n){var r=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(r,n)},e.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new Yt("A video element must be provided.");this.reset();var n=this.prepareVideoElement(t);return this.videoElement=n,n},e.prototype.decodeFromImageUrl=function(t){if(!t)throw new Yt("An URL must be provided.");this.reset();var n=this.prepareImageElement();this.imageElement=n;var r=this._decodeOnLoadImage(n);return n.src=t,r},e.prototype.decodeFromVideoUrl=function(t){if(!t)throw new Yt("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElement(n);return n.src=t,r},e.prototype.decodeFromVideoUrlContinuously=function(t,n){if(!t)throw new Yt("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),o=this.decodeFromVideoElementContinuously(r,n);return r.src=t,o},e.prototype._decodeOnLoadImage=function(t){var n=this;return new Promise(function(r,o){n.imageLoadedListener=function(){return n.decodeOnce(t,!1,!0).then(r,o)},t.addEventListener("load",n.imageLoadedListener)})},e.prototype._decodeOnLoadVideo=function(t){return Kn(this,void 0,void 0,function(){return Xn(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return n.sent(),[4,this.decodeOnce(t)];case 2:return[2,n.sent()]}})})},e.prototype._decodeOnLoadVideoContinuously=function(t,n){return Kn(this,void 0,void 0,function(){return Xn(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return r.sent(),this.decodeContinuously(t,n),[2]}})})},e.prototype.isImageLoaded=function(t){return!!t.complete&&t.naturalWidth!==0},e.prototype.prepareImageElement=function(t){var n;return t===void 0&&((n=document.createElement("img")).width=200,n.height=200),typeof t=="string"&&(n=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(n=t),n},e.prototype.prepareVideoElement=function(t){var n;return t||typeof document>"u"||((n=document.createElement("video")).width=200,n.height=200),typeof t=="string"&&(n=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(n=t),n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},e.prototype.decodeOnce=function(t,n,r){var o=this;n===void 0&&(n=!0),r===void 0&&(r=!0),this._stopAsyncDecode=!1;var i=function(a,s){if(o._stopAsyncDecode)return s(new Y("Video stream has ended before any code could be detected.")),void(o._stopAsyncDecode=void 0);try{a(o.decode(t))}catch(l){if(n&&l instanceof Y||(l instanceof hn||l instanceof ae)&&r)return setTimeout(i,o._timeBetweenDecodingAttempts,a,s);s(l)}};return new Promise(function(a,s){return i(a,s)})},e.prototype.decodeContinuously=function(t,n){var r=this;this._stopContinuousDecode=!1;var o=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var i=r.decode(t);n(i,null),setTimeout(o,r.timeBetweenScansMillis)}catch(a){n(null,a),(a instanceof hn||a instanceof ae||a instanceof Y)&&setTimeout(o,r._timeBetweenDecodingAttempts)}};o()},e.prototype.decode=function(t){var n=this.createBinaryBitmap(t);return this.decodeBitmap(n)},e.prototype.createBinaryBitmap=function(t){var n=this.getCaptureCanvasContext(t);this.drawImageOnCanvas(n,t);var r=this.getCaptureCanvas(t),o=new lse(r),i=new _k(o);return new Sk(i)},e.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var n=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=n}return this.captureCanvasContext},e.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var n=this.createCaptureCanvas(t);this.captureCanvas=n}return this.captureCanvas},e.prototype.drawImageOnCanvas=function(t,n){t.drawImage(n,0,0)},e.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},e.prototype.createCaptureCanvas=function(t){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var n,r,o=document.createElement("canvas");return t!==void 0&&(t instanceof HTMLVideoElement?(n=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),o.style.width=n+"px",o.style.height=r+"px",o.width=n,o.height=r,o},e.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},e.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},e.prototype._destroyVideoElement=function(){this.videoElement&&(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener("ended",this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},e.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},e.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},e.prototype.addVideoSource=function(t,n){try{t.srcObject=n}catch{t.src=URL.createObjectURL(n)}},e.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch{t.src=""}this.videoElement.removeAttribute("src")},e}(),Ir=function(){function e(t,n,r,o,i,a){r===void 0&&(r=n==null?0:8*n.length),a===void 0&&(a=It.currentTimeMillis()),this.text=t,this.rawBytes=n,this.numBits=r,this.resultPoints=o,this.format=i,this.timestamp=a,this.text=t,this.rawBytes=n,this.numBits=r??(n==null?0:8*n.length),this.resultPoints=o,this.format=i,this.resultMetadata=null,this.timestamp=a??It.currentTimeMillis()}return e.prototype.getText=function(){return this.text},e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.getBarcodeFormat=function(){return this.format},e.prototype.getResultMetadata=function(){return this.resultMetadata},e.prototype.putMetadata=function(t,n){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(t,n)},e.prototype.putAllMetadata=function(t){t!==null&&(this.resultMetadata===null?this.resultMetadata=t:this.resultMetadata=new Map(t))},e.prototype.addResultPoints=function(t){var n=this.resultPoints;if(n===null)this.resultPoints=t;else if(t!==null&&t.length>0){var r=new Array(n.length+t.length);It.arraycopy(n,0,r,0,n.length),It.arraycopy(t,0,r,n.length,t.length),this.resultPoints=r}},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.toString=function(){return this.text},e}();(function(e){e[e.AZTEC=0]="AZTEC",e[e.CODABAR=1]="CODABAR",e[e.CODE_39=2]="CODE_39",e[e.CODE_93=3]="CODE_93",e[e.CODE_128=4]="CODE_128",e[e.DATA_MATRIX=5]="DATA_MATRIX",e[e.EAN_8=6]="EAN_8",e[e.EAN_13=7]="EAN_13",e[e.ITF=8]="ITF",e[e.MAXICODE=9]="MAXICODE",e[e.PDF_417=10]="PDF_417",e[e.QR_CODE=11]="QR_CODE",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(aw||(aw={}));var sw,Te=aw;(function(e){e[e.OTHER=0]="OTHER",e[e.ORIENTATION=1]="ORIENTATION",e[e.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",e[e.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",e[e.ISSUE_NUMBER=4]="ISSUE_NUMBER",e[e.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",e[e.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",e[e.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",e[e.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",e[e.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",e[e.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(sw||(sw={}));var Pn,Ln=sw,Cm=function(){function e(t,n,r,o,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=t,this.text=n,this.byteSegments=r,this.ecLevel=o,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=t==null?0:8*t.length}return e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.setNumBits=function(t){this.numBits=t},e.prototype.getText=function(){return this.text},e.prototype.getByteSegments=function(){return this.byteSegments},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getErrorsCorrected=function(){return this.errorsCorrected},e.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},e.prototype.getErasures=function(){return this.erasures},e.prototype.setErasures=function(t){this.erasures=t},e.prototype.getOther=function(){return this.other},e.prototype.setOther=function(t){this.other=t},e.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},e.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},e.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},e}(),Ac=function(){function e(){}return e.prototype.exp=function(t){return this.expTable[t]},e.prototype.log=function(t){if(t===0)throw new Me;return this.logTable[t]},e.addOrSubtract=function(t,n){return t^n},e}(),Qc=function(){function e(t,n){if(n.length===0)throw new Me;this.field=t;var r=n.length;if(r>1&&n[0]===0){for(var o=1;or.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;It.arraycopy(r,0,i,0,a);for(var s=a;s=t.getDegree()&&!o.isZero();){var s=o.getDegree()-t.getDegree(),l=n.multiply(o.getCoefficient(o.getDegree()),a),u=t.multiplyByMonomial(s,l),c=n.buildMonomial(s,l);r=r.addOrSubtract(c),o=o.addOrSubtract(u)}return[r,o]},e.prototype.toString=function(){for(var t="",n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);if(r!==0){if(r<0?(t+=" - ",r=-r):t.length>0&&(t+=" + "),n===0||r!==1){var o=this.field.log(r);o===0?t+="1":o===1?t+="a":(t+="a^",t+=o)}n!==0&&(n===1?t+="x":(t+="x^",t+=n))}}return t},e}(),fse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ek=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return fse(t,e),t.kind="ArithmeticException",t}(Tr),dse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ha=function(e){function t(n,r,o){var i=e.call(this)||this;i.primitive=n,i.size=r,i.generatorBase=o;for(var a=new Int32Array(r),s=1,l=0;l=r&&(s^=n,s&=r-1);i.expTable=a;var u=new Int32Array(r);for(l=0;l=(r/2|0);){var c=a,f=l;if(l=u,(a=s).isZero())throw new _h("r_{i-1} was zero");s=c;for(var d=i.getZero(),h=a.getCoefficient(a.getDegree()),p=i.inverse(h);s.getDegree()>=a.getDegree()&&!s.isZero();){var m=s.getDegree()-a.getDegree(),_=i.multiply(s.getCoefficient(s.getDegree()),p);d=d.addOrSubtract(i.buildMonomial(m,_)),s=s.addOrSubtract(a.multiplyByMonomial(m,_))}if(u=d.multiply(l).addOrSubtract(f),s.getDegree()>=a.getDegree())throw new Od("Division algorithm failed to reduce polynomial?")}var b=u.getCoefficient(0);if(b===0)throw new _h("sigmaTilde(0) was zero");var g=i.inverse(b);return[u.multiplyScalar(g),s.multiplyScalar(g)]},e.prototype.findErrorLocations=function(t){var n=t.getDegree();if(n===1)return Int32Array.from([t.getCoefficient(1)]);for(var r=new Int32Array(n),o=0,i=this.field,a=1;a1,d,d+r-1),d+=r-1;else for(var p=r-1;p>=0;--p)f[d++]=(h&1<=8?e.readCode(t,n,8):e.readCode(t,n,r)<<8-r},e.convertBoolArrayToByteArray=function(t){for(var n=new Uint8Array((t.length+7)/8),r=0;r{const t=typeof e=="function"?Mae(e):e,n=(r,o)=>tse(t,r,o);return Object.assign(n,t),n},nse=e=>e?I4(e):I4,Lk=100,mw={"wss://relay.shitforce.one":{read:!0,write:!0},"wss://relay.nostr.band":{read:!0,write:!0},"wss://offchain.pub":{read:!0,write:!1},"wss://nos.lol":{read:!0,write:!1},"wss://relay.snort.social":{read:!0,write:!1},"wss://relay.damus.io":{read:!0,write:!0},"wss://soloco.nl":{read:!0,write:!1},"wss://eden.nostr.land":{read:!0,write:!0},"wss://nostr.gruntwerk.org":{read:!0,write:!1},"wss://relay.cryptocculture.com":{read:!0,write:!1},"wss://relay.nostr.bg":{read:!0,write:!1},"wss://relay.nostrich.de":{read:!0,write:!1},"wss://relay.nostr.ro":{read:!0,write:!1}};function rse(){const e=localStorage.getItem("nostr-client:keystore:keystore");if(e)if(e==="localstore"){const t=localStorage.getItem("nostr-client:keystore:public-key"),n=localStorage.getItem("nostr-client:keystore:private-key");if(t&&n)return{keystore:"localstore",publicKey:t,privateKey:n}}else{if(e==="nos2x")return{keystore:"nos2x",publicKey:void 0,privateKey:void 0};if(e==="download")return{keystore:"download",publicKey:void 0,privateKey:void 0}}return{keystore:"none",publicKey:void 0,privateKey:void 0}}function Rg(e){localStorage.setItem("nostr-client:keystore:keystore",e.keystore),e.keystore==="localstore"&&e.publicKey&&e.privateKey?(localStorage.setItem("nostr-client:keystore:public-key",e.publicKey),localStorage.setItem("nostr-client:keystore:private-key",e.privateKey)):e.keystore==="nos2x"||e.keystore}const ose=500,R4=new Worker(new URL("/nostr-ts/assets/worker-ef9cca43.js",self.location),{type:"module"});function ise(e,t){let n=null,r=[];return function(o){if(o.data.type==="event:update"){const i=o.data.data.event.id,a=r.findIndex(s=>s.data.type==="event:update"?s.data.data.event.id===i:!1);a!==-1?r[a]=o:r.push(o)}else r.push(o);n||(n=setTimeout(()=>{e(r),r=[],n=null},t))}}const Z=nse((e,t)=>({status:"loading",store:Pk(R4),_processEvents:n=>{n.forEach(r=>{const o=r.data;if(o.type!=="RAW")switch(o.type){case"event:notify":break;case"event:new":t().addEvent(o.data,o.view);break;case"event:update":t().updateEvent(o.data);break;case"relay:message":e({relayEvents:[...t().relayEvents,o.data]});break;case"status:change":e({status:o.data}),console.log(`Status changed to ${o.data}`);break;default:console.log(`Unsupported payload type: ${o.type}`)}})},init:async()=>{try{await t().loadKeyStore();const n=ise(t()._processEvents,ose);R4.addEventListener("message",n),await t().store.init()}catch(n){console.error("Initialization failed:",n)}},connected:!1,connect:async n=>{t().connected||(await t().store.connect(n),e({connected:!0}))},disconnect:async()=>{await t().store.disconnect(),e({connected:!1})},getRelays:async()=>t().store.getRelays(),updateRelay:async(n,r)=>t().store.updateRelay(n,r),relayAuth:async(n,r)=>{const o=t().keypair;if(!o)throw new Error("Keypair not initialized");const i=t().keystore,a=vae({relayUrl:n,challenge:r});if(a.pubkey=o.publicKey,a.generateId(),i==="localstore"){if(!o.privateKey||o.privateKey==="")throw new Error("No private key available");a.sign({privateKey:o.privateKey,publicKey:o.publicKey})}else if(i==="nos2x")if(window.nostr&&window.nostr.signEvent){const s=await window.nostr.signEvent(a.ToObj());if(!s.sig)throw new Error("No signature");a.sig=s.sig}else throw new Error("Nostr not initialized");else throw new Error("Invalid keystore");await t().subscribe({type:Od.AUTH,signedEvent:a.ToObj(),relayUrls:[n],options:{timeoutIn:3e5}})},relayEvents:[],getSubscriptions:async n=>t().store.getSubscriptions(n),subscribe:async n=>t().store.subscribe(n),unsubscribe:async n=>t().store.unsubscribe(n),unsubscribeAll:async()=>t().store.unsubscribeAll(),unsubscribeByToken:async n=>(console.log("=> CLIENT: Unsubscribe by token",n),e(r=>({events:{...r.events,[n]:[]},eventsNewest:{...r.eventsNewest,[n]:0},eventsNewer:{...r.eventsNewer,[n]:[]}})),t().store.unsubscribeByToken(n)),keystore:"none",loadKeyStore:()=>{const n=rse();e({keystore:n.keystore}),n.keystore==="localstore"&&n.publicKey&&n.privateKey&&(e({keypair:{publicKey:n.publicKey,privateKey:n.privateKey},keypairIsLoaded:!0}),t().store.setUserPubkey(n.publicKey))},saveKeyStore:()=>{const n=t().keystore;if(n==="localstore"){const r=t().keypair;Rg(r?{keystore:n,publicKey:r.publicKey,privateKey:r.privateKey}:{keystore:n})}},resetKeyStore:()=>{Rg({keystore:"none"}),e({keystore:"none",keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1}),t().store.setUserPubkey("")},setKeyStore:n=>{n.keystore==="localstore"?n.publicKey&&(e({keystore:n.keystore,keypair:{publicKey:n.publicKey,privateKey:n.privateKey||""},keypairIsLoaded:!0}),t().saveKeyStore(),t().store.setUserPubkey(n.publicKey)):n.keystore==="nos2x"?(e({keystore:n.keystore,keypair:{publicKey:n.publicKey||""},keypairIsLoaded:!0}),t().store.setUserPubkey(n.publicKey||"")):console.error(`Unknown keystore ${n.keystore}`)},keypair:{publicKey:"",privateKey:""},keypairIsLoaded:!1,getPopularEvents:async()=>t().store.getPopularEvents(),getPopularUsers:async()=>t().store.getPopularUsers(),calculatePopular:async()=>t().store.calculatePopular(),count:async n=>(console.log("=> CLIENT: TODO Count",n),new Promise(r=>r([]))),countEvents:async()=>new Promise(n=>n(0)),getEvent:async(n,r)=>{const o=await t().store.getEvent(n,r);return o&&e(i=>{const a=i.events;return i.events[r.view]=[o],{events:a}}),o},nextQuery:void 0,getEvents:async(n,r)=>{var u,c;if(!n){const f=t().nextQuery;if(!f)throw new Error("No query params provided and no next query set");n={token:f.token,query:f.next}}const{token:o,query:i}=n,a=r||"append",s=i.reqCount?i.reqCount===0:!0;s&&e({nextQuery:void 0});const l=await t().store.getEvents(n);if(t().nextQuery&&o!==((u=t().nextQuery)==null?void 0:u.token)||!l.events||l.events.length===0)return l.next;if(!n.query.reqCount||n.query.reqCount===0){const f=(c=l.events)==null?void 0:c.reduce((d,h)=>d.event.created_at>h.event.created_at?d:h);e({eventsNewest:{...t().eventsNewest,token:(f==null?void 0:f.event.created_at)||0}})}return e(f=>{const d={...f.events};return l.events&&l.events.length>0&&(s||a==="replace"?d[o]=l.events:a==="prepend"?d[o]=[...l.events,...d[o]||[]]:d[o]=[...d[o]||[],...l.events]),{events:d,nextQuery:{token:o,next:l.next}}}),l.next},getEventReplies:async(n,r,o)=>{const i=await t().store.getEventReplies(n,r,o);if(i)return e(a=>{const s=a.events;return a.events[r]=i,{events:s}}),i.length},events:{},eventsNewest:{},mergeNewerEvents:n=>{e(r=>{const o=r.events[n]||[],i=r.eventsNewer[n]||[];i.sort((s,l)=>s.event.created_at>l.event.created_at?-1:1),t().requestInformation({source:"events:related",idsOrKeys:[...i.map(s=>s.event.id)]},{view:n,timeoutIn:1e4,isLive:!0}),t().requestInformation({source:"users",idsOrKeys:[...new Set([...i.map(s=>s.event.pubkey)])]},{view:n,timeoutIn:1e4,isLive:!0});const a=[...i,...o];return{events:{...r.events,[n]:a},eventsNewer:{...r.eventsNewer,[n]:[]}}})},eventsNewer:{},addEvent:(n,r)=>{e(o=>{const i=o.eventsNewest[r]||0,s=(i===0?!0:n.event.created_at>i)?"eventsNewer":"events",l=o[s][r]||[];return l.find(c=>c.event.id===n.event.id)?o:{[s]:{...o[s],[r]:[...l,n]}}})},updateEvent:(n,r)=>{if(r){const i=(t().events[r]||[]).findIndex(a=>a.event.id===n.event.id);if(i!==-1){e(a=>{const s=a.events[r]||[];return s[i]=n,{events:{...a.events,[r]:s}}});return}}else{let o=!1;["events","eventsNewer"].forEach(i=>{if(o)return;const a=i==="events"?t().events:t().eventsNewer;for(const s in a)if(Object.prototype.hasOwnProperty.call(a,s)){const u=a[s].findIndex(c=>c.event.id===n.event.id);if(u!==-1){o=!0,e(c=>{const f=c[i][s]||[];return f[u]=n,{[i]:{...c[i],[s]:f}}});return}}})}},maxEvents:Lk,setMaxEvents:async n=>{e({maxEvents:n})},determineApplicableRelays:async n=>{const r=await t().getRelays();if(!r){console.log("=> CLIENT: No relays found");return}const i=(n.relayUrls&&n.relayUrls.length>0?r.filter(a=>{var s;return(s=n.relayUrls)==null?void 0:s.includes(a.url)}):r).filter(a=>a.isReady&&a.write);if(i.length===0){console.log("=> CLIENT: No ready relays found");return}return console.log(`=> CLIENT: Found ${i.length} ready relays`),{relays:i,pow:0}},generateQueueItems:async n=>{const r=await t().determineApplicableRelays(n);if(!r)return;const o=[];for(const i of r.relays){const{relayUrls:a,...s}=n;o.push({...s,id:eoe(),relayUrl:i.url,send:!1})}return console.log(o),o},getQueueItems:async()=>t().store.getQueueItems(),getUser:async n=>t().store.getUser(n),addUser:async n=>t().store.addUser(n),updateUser:async(n,r)=>t().store.updateUser(n,r),countUsers:async()=>t().store.countUsers(),eventProofOfWork:async(n,r)=>new Promise(o=>{const i=new Worker(new URL("/nostr-ts/assets/pow-worker-3948d45b.js",self.location),{type:"module"});i.onmessage=function(a){o(a.data.result),i.terminate()},i.postMessage({event:n,bits:r})}),sendEvent:async n=>t().store.sendEvent(n),signEvent:async n=>{const r=t().keystore;if(n.pubkey||(n.pubkey=t().keypair.publicKey),n.id||n.generateId(),r==="localstore"){const o=t().keypair;if(!o)throw new Error("Keypair not initialized");return n.sign({privateKey:o.privateKey||"",publicKey:o.publicKey}),n}else if(r==="nos2x")if(window.nostr&&window.nostr.signEvent){const o=await window.nostr.signEvent(n.ToObj());if(!o.sig)throw new Error("No signature");return n.sig=o.sig,n}else throw new Error("Nostr not initialized");else throw new Error("Invalid keystore")},signAndSendEvent:async n=>{const r=t().keypair;if(!r)throw new Error("Keypair not initialized");let o=n.event;o.pubkey=r.publicKey,o.generateId();let i=n.relayUrls;const a=await t().determineApplicableRelays(n);if(!a)throw new Error("No relays available");i=a.relays.map(c=>c.url);let s=n.pow;const l=a.pow;if(s&&s!==0){if(s0){const c=await t().generateQueueItems({...n,relayUrls:i,pow:s});c&&(u=c),await t().store.addQueueItems(u);const f=await t().eventProofOfWork(n.event,s);o=new sr(f);for(const d of u)d.event=o,d.powDone=Date.now()}if(o=await t().signEvent(o),o.isReadyToPublishOrThrow(),u.length===0){const c=await t().generateQueueItems({...n,relayUrls:i,pow:s,event:o});c&&(u=c),await t().store.addQueueItems(u)}else for(const c of u)c.event=o,await t().store.updateQueueItem(c);return await t().store.sendQueueItems(u),o.id},followUser:async n=>{await t().store.followUser(n.pubkey)},unfollowUser:async n=>{await t().store.unfollowUser(n)},followingUser:async n=>{const r=await t().store.getUser(n);return(r==null?void 0:r.following)||!1},getAllUsersFollowing:async()=>t().store.getAllUsersFollowing(),blockUser:async n=>{await t().store.blockUser(n.pubkey);const r=t().events;e(o=>{const i={};for(const[a,s]of Object.entries(r))i[a]=s.filter(l=>l.event.pubkey!==n.pubkey);return{events:i}})},unblockUser:async n=>t().store.unblockUser(n),getAllUsersBlocked:async()=>t().store.getAllUsersBlocked(),lastContactsUpdate:async n=>t().store.lastContactsUpdate(n),createList:async n=>t().store.createList(n),updateList:async(n,r)=>t().store.updateList(n,r),deleteList:async n=>t().store.deleteList(n),getAllLists:async()=>t().store.getAllLists(),getList:async n=>t().store.getList(n),getListsWithUser:async n=>t().store.getListsWithUser(n),addUserToList:async(n,r)=>t().store.addUserToList(n,r),removeUserFromList:async(n,r)=>t().store.removeUserFromList(n,r),requestInformation:(n,r)=>t().store.requestInformation(n,r)}));var Eh,yw,ase=(Eh=function(e,t){return Eh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},Eh(e,t)},function(e,t){function n(){this.constructor=e}Eh(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),sse=function(e){function t(n){var r,o,i,a=this.constructor,s=e.call(this,n)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),r=s,o=a.prototype,(i=Object.setPrototypeOf)?i(r,o):r.__proto__=o,function(l,u){u===void 0&&(u=l.constructor);var c=Error.captureStackTrace;c&&c(l,u)}(s),s}return ase(t,e),t}(Error),lse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lr=function(e){function t(n){n===void 0&&(n=void 0);var r=e.call(this,n)||this;return r.message=n,r}return lse(t,e),t.prototype.getKind=function(){return this.constructor.kind},t.kind="Exception",t}(sse),use=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yt=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return use(t,e),t.kind="ArgumentException",t}(Lr),cse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Me=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return cse(t,e),t.kind="IllegalArgumentException",t}(Lr),Nk=function(){function e(t){if(this.binarizer=t,t===null)throw new Me("Binarizer must be non-null.")}return e.prototype.getWidth=function(){return this.binarizer.getWidth()},e.prototype.getHeight=function(){return this.binarizer.getHeight()},e.prototype.getBlackRow=function(t,n){return this.binarizer.getBlackRow(t,n)},e.prototype.getBlackMatrix=function(){return this.matrix!==null&&this.matrix!==void 0||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},e.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},e.prototype.crop=function(t,n,r,o){var i=this.binarizer.getLuminanceSource().crop(t,n,r,o);return new e(this.binarizer.createBinarizer(i))},e.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},e.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new e(this.binarizer.createBinarizer(t))},e.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new e(this.binarizer.createBinarizer(t))},e.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},e}(),fse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hn=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return fse(t,e),t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}(Lr),dse=function(){function e(t){this.source=t}return e.prototype.getLuminanceSource=function(){return this.source},e.prototype.getWidth=function(){return this.source.getWidth()},e.prototype.getHeight=function(){return this.source.getHeight()},e}(),It=function(){function e(){}return e.arraycopy=function(t,n,r,o,i){for(;i--;)r[o++]=t[n++]},e.currentTimeMillis=function(){return Date.now()},e}(),hse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),E_=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return hse(t,e),t.kind="IndexOutOfBoundsException",t}(Lr),pse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),k4=function(e){function t(n,r){n===void 0&&(n=void 0),r===void 0&&(r=void 0);var o=e.call(this,r)||this;return o.index=n,o.message=r,o}return pse(t,e),t.kind="ArrayIndexOutOfBoundsException",t}(E_),mse=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Kr=function(){function e(){}return e.fill=function(t,n){for(var r=0,o=t.length;rr)throw new Me("fromIndex("+n+") > toIndex("+r+")");if(n<0)throw new k4(n);if(r>t)throw new k4(r)},e.asList=function(){for(var t=[],n=0;n>1,s=r(n,t[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},e.numberComparator=function(t,n){return t-n},e}(),Dn=function(){function e(){}return e.numberOfTrailingZeros=function(t){var n;if(t===0)return 32;var r=31;return(n=t<<16)!==0&&(r-=16,t=n),(n=t<<8)!==0&&(r-=8,t=n),(n=t<<4)!==0&&(r-=4,t=n),(n=t<<2)!==0&&(r-=2,t=n),r-(t<<1>>>31)},e.numberOfLeadingZeros=function(t){if(t===0)return 32;var n=1;return!(t>>>16)&&(n+=16,t<<=16),!(t>>>24)&&(n+=8,t<<=8),!(t>>>28)&&(n+=4,t<<=4),!(t>>>30)&&(n+=2,t<<=2),n-=t>>>31},e.toHexString=function(t){return t.toString(16)},e.toBinaryString=function(t){return String(parseInt(String(t),2))},e.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,t+=t>>>8,63&(t+=t>>>16)},e.truncDivision=function(t,n){return Math.trunc(t/n)},e.parseInt=function(t,n){return n===void 0&&(n=void 0),parseInt(t,n)},e.MIN_VALUE_32_BITS=-2147483648,e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}(),oi=function(){function e(t,n){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=n??e.makeArray(t))}return e.prototype.getSize=function(){return this.size},e.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},e.prototype.ensureCapacity=function(t){if(t>32*this.bits.length){var n=e.makeArray(t);It.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},e.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(31&t))!=0},e.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},e.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},e.prototype.getNextSet=function(t){var n=this.size;if(t>=n)return n;var r=this.bits,o=Math.floor(t/32),i=r[o];i&=~((1<<(31&t))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=r[o]}var s=32*o+Dn.numberOfTrailingZeros(i);return s>n?n:s},e.prototype.getNextUnset=function(t){var n=this.size;if(t>=n)return n;var r=this.bits,o=Math.floor(t/32),i=~r[o];i&=~((1<<(31&t))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=~r[o]}var s=32*o+Dn.numberOfTrailingZeros(i);return s>n?n:s},e.prototype.setBulk=function(t,n){this.bits[Math.floor(t/32)]=n},e.prototype.setRange=function(t,n){if(nthis.size)throw new Me;if(n!==t){n--;for(var r=Math.floor(t/32),o=Math.floor(n/32),i=this.bits,a=r;a<=o;a++){var s=(2<<(ar?0:31&t));i[a]|=s}}},e.prototype.clear=function(){for(var t=this.bits.length,n=this.bits,r=0;rthis.size)throw new Me;if(n===t)return!0;n--;for(var o=Math.floor(t/32),i=Math.floor(n/32),a=this.bits,s=o;s<=i;s++){var l=(2<<(so?0:31&t))&4294967295;if((a[s]&l)!==(r?l:0))return!1}return!0},e.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},e.prototype.appendBits=function(t,n){if(n<0||n>32)throw new Me("Num bits must be between 0 and 32");this.ensureCapacity(this.size+n);for(var r=n;r>0;r--)this.appendBit((t>>r-1&1)==1)},e.prototype.appendBitArray=function(t){var n=t.size;this.ensureCapacity(this.size+n);for(var r=0;r>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,t[n-i]=a}if(this.size!==32*r){var s=32*r-this.size,l=t[0]>>>s;for(i=1;i>>s}t[r-1]=l}this.bits=t},e.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.size===n.size&&Kr.equals(this.bits,n.bits)},e.prototype.hashCode=function(){return 31*this.size+Kr.hashCode(this.bits)},e.prototype.toString=function(){for(var t="",n=0,r=this.size;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(e){e[e.Cp437=0]="Cp437",e[e.ISO8859_1=1]="ISO8859_1",e[e.ISO8859_2=2]="ISO8859_2",e[e.ISO8859_3=3]="ISO8859_3",e[e.ISO8859_4=4]="ISO8859_4",e[e.ISO8859_5=5]="ISO8859_5",e[e.ISO8859_6=6]="ISO8859_6",e[e.ISO8859_7=7]="ISO8859_7",e[e.ISO8859_8=8]="ISO8859_8",e[e.ISO8859_9=9]="ISO8859_9",e[e.ISO8859_10=10]="ISO8859_10",e[e.ISO8859_11=11]="ISO8859_11",e[e.ISO8859_13=12]="ISO8859_13",e[e.ISO8859_14=13]="ISO8859_14",e[e.ISO8859_15=14]="ISO8859_15",e[e.ISO8859_16=15]="ISO8859_16",e[e.SJIS=16]="SJIS",e[e.Cp1250=17]="Cp1250",e[e.Cp1251=18]="Cp1251",e[e.Cp1252=19]="Cp1252",e[e.Cp1256=20]="Cp1256",e[e.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",e[e.UTF8=22]="UTF8",e[e.ASCII=23]="ASCII",e[e.Big5=24]="Big5",e[e.GB18030=25]="GB18030",e[e.EUC_KR=26]="EUC_KR"})(at||(at={}));var gw,mr=function(){function e(t,n,r){for(var o,i,a=[],s=3;s=900)throw new ae("incorect value");var n=e.VALUES_TO_ECI.get(t);if(n===void 0)throw new ae("incorect value");return n},e.getCharacterSetECIByName=function(t){var n=e.NAME_TO_ECI.get(t);if(n===void 0)throw new ae("incorect value");return n},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.getName()===n.getName()},e.VALUE_IDENTIFIER_TO_ECI=new Map,e.VALUES_TO_ECI=new Map,e.NAME_TO_ECI=new Map,e.Cp437=new e(at.Cp437,Int32Array.from([0,2]),"Cp437"),e.ISO8859_1=new e(at.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),e.ISO8859_2=new e(at.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),e.ISO8859_3=new e(at.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),e.ISO8859_4=new e(at.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),e.ISO8859_5=new e(at.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),e.ISO8859_6=new e(at.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),e.ISO8859_7=new e(at.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),e.ISO8859_8=new e(at.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),e.ISO8859_9=new e(at.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),e.ISO8859_10=new e(at.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),e.ISO8859_11=new e(at.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),e.ISO8859_13=new e(at.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),e.ISO8859_14=new e(at.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),e.ISO8859_15=new e(at.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),e.ISO8859_16=new e(at.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),e.SJIS=new e(at.SJIS,20,"SJIS","Shift_JIS"),e.Cp1250=new e(at.Cp1250,21,"Cp1250","windows-1250"),e.Cp1251=new e(at.Cp1251,22,"Cp1251","windows-1251"),e.Cp1252=new e(at.Cp1252,23,"Cp1252","windows-1252"),e.Cp1256=new e(at.Cp1256,24,"Cp1256","windows-1256"),e.UnicodeBigUnmarked=new e(at.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),e.UTF8=new e(at.UTF8,26,"UTF8","UTF-8"),e.ASCII=new e(at.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),e.Big5=new e(at.Big5,28,"Big5"),e.GB18030=new e(at.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),e.EUC_KR=new e(at.EUC_KR,30,"EUC_KR","EUC-KR"),e}(),vse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fp=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return vse(t,e),t.kind="UnsupportedOperationException",t}(Lr),ks=function(){function e(){}return e.decode=function(t,n){var r=this.encodingName(n);return this.customDecoder?this.customDecoder(t,r):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(r)?this.decodeFallback(t,r):new TextDecoder(r).decode(t)},e.shouldDecodeOnFallback=function(t){return!e.isBrowser()&&t==="ISO-8859-1"},e.encode=function(t,n){var r=this.encodingName(n);return this.customEncoder?this.customEncoder(t,r):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)},e.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},e.encodingName=function(t){return typeof t=="string"?t:t.getName()},e.encodingCharacterSet=function(t){return t instanceof mr?t:mr.getCharacterSetECIByName(t)},e.decodeFallback=function(t,n){var r=this.encodingCharacterSet(n);if(e.isDecodeFallbackSupported(r)){for(var o="",i=0,a=t.length;i3&&t[0]===239&&t[1]===187&&t[2]===191,E=0;E0?128&T?s--:a=!1:128&T&&(64&T?(s++,32&T?(s++,16&T?(s++,8&T?a=!1:c++):u++):l++):a=!1)),o&&(T>127&&T<160?o=!1:T>159&&(T<192||T===215||T===247)&&b++),i&&(f>0?T<64||T===127||T>252?i=!1:f--:T===128||T===160||T>239?i=!1:T>160&&T<224?(d++,p=0,++h>m&&(m=h)):T>127?(f++,h=0,++p>S&&(S=p)):(h=0,p=0))}return a&&s>0&&(a=!1),i&&f>0&&(i=!1),a&&(g||l+u+c>0)?e.UTF8:i&&(e.ASSUME_SHIFT_JIS||m>=3||S>=3)?e.SHIFT_JIS:o&&i?m===2&&d===2||10*b>=r?e.SHIFT_JIS:e.ISO88591:o?e.ISO88591:i?e.SHIFT_JIS:a?e.UTF8:e.PLATFORM_DEFAULT_ENCODING},e.format=function(t){for(var n=[],r=1;ra){if(s===-1)s=i-a;else if(i-a!==s)throw new Me("row lengths do not match");a=i,l++}u++}else if(t.substring(u,u+n.length)===n)u+=n.length,o[i]=!0,i++;else{if(t.substring(u,u+r.length)!==r)throw new Me("illegal character encountered: "+t.substring(u));u+=r.length,o[i]=!1,i++}if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new Me("row lengths do not match");l++}for(var c=new e(s,l),f=0;f>>(31&t)&1)!=0},e.prototype.set=function(t,n){var r=n*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)&4294967295},e.prototype.unset=function(t,n){var r=n*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t)&4294967295)},e.prototype.flip=function(t,n){var r=n*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)&4294967295},e.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new Me("input matrix dimensions do not match");for(var n=new oi(Math.floor(this.width/32)+1),r=this.rowSize,o=this.bits,i=0,a=this.height;ithis.height||i>this.width)throw new Me("The region must fit inside the matrix");for(var s=this.rowSize,l=this.bits,u=n;ul&&(l=u),32*cs){for(d=31;!(f>>>d);)d--;32*c+d>s&&(s=32*c+d)}}}return s=0&&n[r]===0;)r--;if(r<0)return null;for(var o=Math.floor(r/t),i=32*Math.floor(r%t),a=n[r],s=31;!(a>>>s);)s--;return i+=s,Int32Array.from([i,o])},e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.getRowSize=function(){return this.rowSize},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.width===n.width&&this.height===n.height&&this.rowSize===n.rowSize&&Kr.equals(this.bits,n.bits)},e.prototype.hashCode=function(){var t=this.width;return t=31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+Kr.hashCode(this.bits)},e.prototype.toString=function(t,n,r){return t===void 0&&(t="X "),n===void 0&&(n=" "),r===void 0&&(r=` +`),this.buildToString(t,n,r)},e.prototype.buildToString=function(t,n,r){for(var o=new mt,i=0,a=this.height;i>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(s);if(i<3)for(l=0;l>t.LUMINANCE_SHIFT]++;var d=t.estimateBlackPoint(a),h=n.getMatrix();for(s=0;sa&&(i=s,a=n[s]),n[s]>o&&(o=n[s]);var l=0,u=0;for(s=0;su&&(l=s,u=p)}if(i>l){var f=i;i=l,l=f}if(l-i<=r/16)throw new Y;var d=l-1,h=-1;for(s=l-1;s>i;s--){var p,m=s-i;(p=m*m*(l-s)*(o-n[s]))>h&&(d=s,h=p)}return d<=t.MINIMUM_DIMENSION&&o>=t.MINIMUM_DIMENSION){var i=n.getMatrix(),a=r>>t.BLOCK_SIZE_POWER;r&t.BLOCK_SIZE_MASK&&a++;var s=o>>t.BLOCK_SIZE_POWER;o&t.BLOCK_SIZE_MASK&&s++;var l=t.calculateBlackPoints(i,a,s,r,o),u=new zi(r,o);t.calculateThresholdForBlock(i,a,s,r,o,l,u),this.matrix=u}else this.matrix=e.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(n){return new t(n)},t.calculateThresholdForBlock=function(n,r,o,i,a,s,l){for(var u=a-t.BLOCK_SIZE,c=i-t.BLOCK_SIZE,f=0;fu&&(d=u);for(var h=t.cap(f,2,o-3),p=0;pc&&(m=c);for(var S=t.cap(p,2,r-3),b=0,g=-2;g<=2;g++){var E=s[h+g];b+=E[S-2]+E[S-1]+E[S]+E[S+1]+E[S+2]}var T=b/25;t.thresholdBlock(n,m,d,T,i,l)}}},t.cap=function(n,r,o){return no?o:n},t.thresholdBlock=function(n,r,o,i,a,s){for(var l=0,u=o*a+r;ls&&(f=s);for(var d=0;dl&&(h=l);for(var p=0,m=255,S=0,b=0,g=f*i+h;bS&&(S=T)}if(S-m>t.MIN_DYNAMIC_RANGE)for(b++,g+=i;b>2*t.BLOCK_SIZE_POWER;if(S-m<=t.MIN_DYNAMIC_RANGE&&(O=m/2,c>0&&d>0)){var A=(u[c-1][d]+2*u[c][d-1]+u[c-1][d-1])/4;m>10,i[s]=u}return i},t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length0&&o[o.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Uu=function(){function e(t,n,r){n===void 0&&(n=500),this.reader=t,this.timeBetweenScansMillis=n,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(e.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),e.prototype.listVideoInputDevices=function(){return Kn(this,void 0,void 0,function(){var t,n,r,o,i,a,s,l,u,c,f,d;return Xn(this,function(h){switch(h.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=h.sent(),n=[];try{for(r=Ase(t),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,l=i.label||"Video device "+(n.length+1),u=i.groupId,c={deviceId:s,label:l,kind:a,groupId:u},n.push(c))}catch(p){f={error:p}}finally{try{o&&!o.done&&(d=r.return)&&d.call(r)}finally{if(f)throw f.error}}return[2,n]}})})},e.prototype.getVideoInputDevices=function(){return Kn(this,void 0,void 0,function(){return Xn(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map(function(n){return new Ose(n.deviceId,n.label)})]}})})},e.prototype.findDeviceById=function(t){return Kn(this,void 0,void 0,function(){var n;return Xn(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===t})]:[2,null]}})})},e.prototype.decodeFromInputVideoDevice=function(t,n){return Kn(this,void 0,void 0,function(){return Xn(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,n)];case 1:return[2,r.sent()]}})})},e.prototype.decodeOnceFromVideoDevice=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return this.reset(),r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},e.prototype.decodeOnceFromConstraints=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},e.prototype.decodeOnceFromStream=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,n)];case 1:return r=o.sent(),[4,this.decodeOnce(r)];case 2:return[2,o.sent()]}})})},e.prototype.decodeFromInputVideoDeviceContinuously=function(t,n,r){return Kn(this,void 0,void 0,function(){return Xn(this,function(o){switch(o.label){case 0:return[4,this.decodeFromVideoDevice(t,n,r)];case 1:return[2,o.sent()]}})})},e.prototype.decodeFromVideoDevice=function(t,n,r){return Kn(this,void 0,void 0,function(){var o;return Xn(this,function(i){switch(i.label){case 0:return o={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},e.prototype.decodeFromConstraints=function(t,n,r){return Kn(this,void 0,void 0,function(){var o;return Xn(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return o=i.sent(),[4,this.decodeFromStream(o,n,r)];case 2:return[2,i.sent()]}})})},e.prototype.decodeFromStream=function(t,n,r){return Kn(this,void 0,void 0,function(){var o;return Xn(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,n)];case 1:return o=i.sent(),[4,this.decodeContinuously(o,r)];case 2:return[2,i.sent()]}})})},e.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},e.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},e.prototype.attachStreamToVideo=function(t,n){return Kn(this,void 0,void 0,function(){var r;return Xn(this,function(o){switch(o.label){case 0:return r=this.prepareVideoElement(n),this.addVideoSource(r,t),this.videoElement=r,this.stream=t,[4,this.playVideoOnLoadAsync(r)];case 1:return o.sent(),[2,r]}})})},e.prototype.playVideoOnLoadAsync=function(t){var n=this;return new Promise(function(r,o){return n.playVideoOnLoad(t,function(){return r()})})},e.prototype.playVideoOnLoad=function(t,n){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",n),this.tryPlayVideo(t)},e.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},e.prototype.tryPlayVideo=function(t){return Kn(this,void 0,void 0,function(){return Xn(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[3,4];case 3:return n.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},e.prototype.getMediaElement=function(t,n){var r=document.getElementById(t);if(!r)throw new Yt("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Yt("element with id '"+t+"' must be an "+n+" element");return r},e.prototype.decodeFromImage=function(t,n){if(!t&&!n)throw new Yt("either imageElement with a src set or an url must be provided");return n&&!t?this.decodeFromImageUrl(n):this.decodeFromImageElement(t)},e.prototype.decodeFromVideo=function(t,n){if(!t&&!n)throw new Yt("Either an element with a src set or an URL must be provided");return n&&!t?this.decodeFromVideoUrl(n):this.decodeFromVideoElement(t)},e.prototype.decodeFromVideoContinuously=function(t,n,r){if(t===void 0&&n===void 0)throw new Yt("Either an element with a src set or an URL must be provided");return n&&!t?this.decodeFromVideoUrlContinuously(n,r):this.decodeFromVideoElementContinuously(t,r)},e.prototype.decodeFromImageElement=function(t){if(!t)throw new Yt("An image element must be provided.");this.reset();var n=this.prepareImageElement(t);return this.imageElement=n,this.isImageLoaded(n)?this.decodeOnce(n,!1,!0):this._decodeOnLoadImage(n)},e.prototype.decodeFromVideoElement=function(t){var n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(n)},e.prototype.decodeFromVideoElementContinuously=function(t,n){var r=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(r,n)},e.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new Yt("A video element must be provided.");this.reset();var n=this.prepareVideoElement(t);return this.videoElement=n,n},e.prototype.decodeFromImageUrl=function(t){if(!t)throw new Yt("An URL must be provided.");this.reset();var n=this.prepareImageElement();this.imageElement=n;var r=this._decodeOnLoadImage(n);return n.src=t,r},e.prototype.decodeFromVideoUrl=function(t){if(!t)throw new Yt("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElement(n);return n.src=t,r},e.prototype.decodeFromVideoUrlContinuously=function(t,n){if(!t)throw new Yt("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),o=this.decodeFromVideoElementContinuously(r,n);return r.src=t,o},e.prototype._decodeOnLoadImage=function(t){var n=this;return new Promise(function(r,o){n.imageLoadedListener=function(){return n.decodeOnce(t,!1,!0).then(r,o)},t.addEventListener("load",n.imageLoadedListener)})},e.prototype._decodeOnLoadVideo=function(t){return Kn(this,void 0,void 0,function(){return Xn(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return n.sent(),[4,this.decodeOnce(t)];case 2:return[2,n.sent()]}})})},e.prototype._decodeOnLoadVideoContinuously=function(t,n){return Kn(this,void 0,void 0,function(){return Xn(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return r.sent(),this.decodeContinuously(t,n),[2]}})})},e.prototype.isImageLoaded=function(t){return!!t.complete&&t.naturalWidth!==0},e.prototype.prepareImageElement=function(t){var n;return t===void 0&&((n=document.createElement("img")).width=200,n.height=200),typeof t=="string"&&(n=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(n=t),n},e.prototype.prepareVideoElement=function(t){var n;return t||typeof document>"u"||((n=document.createElement("video")).width=200,n.height=200),typeof t=="string"&&(n=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(n=t),n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},e.prototype.decodeOnce=function(t,n,r){var o=this;n===void 0&&(n=!0),r===void 0&&(r=!0),this._stopAsyncDecode=!1;var i=function(a,s){if(o._stopAsyncDecode)return s(new Y("Video stream has ended before any code could be detected.")),void(o._stopAsyncDecode=void 0);try{a(o.decode(t))}catch(l){if(n&&l instanceof Y||(l instanceof hn||l instanceof ae)&&r)return setTimeout(i,o._timeBetweenDecodingAttempts,a,s);s(l)}};return new Promise(function(a,s){return i(a,s)})},e.prototype.decodeContinuously=function(t,n){var r=this;this._stopContinuousDecode=!1;var o=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var i=r.decode(t);n(i,null),setTimeout(o,r.timeBetweenScansMillis)}catch(a){n(null,a),(a instanceof hn||a instanceof ae||a instanceof Y)&&setTimeout(o,r._timeBetweenDecodingAttempts)}};o()},e.prototype.decode=function(t){var n=this.createBinaryBitmap(t);return this.decodeBitmap(n)},e.prototype.createBinaryBitmap=function(t){var n=this.getCaptureCanvasContext(t);this.drawImageOnCanvas(n,t);var r=this.getCaptureCanvas(t),o=new xse(r),i=new Bk(o);return new Nk(i)},e.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var n=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=n}return this.captureCanvasContext},e.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var n=this.createCaptureCanvas(t);this.captureCanvas=n}return this.captureCanvas},e.prototype.drawImageOnCanvas=function(t,n){t.drawImage(n,0,0)},e.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},e.prototype.createCaptureCanvas=function(t){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var n,r,o=document.createElement("canvas");return t!==void 0&&(t instanceof HTMLVideoElement?(n=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),o.style.width=n+"px",o.style.height=r+"px",o.width=n,o.height=r,o},e.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},e.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},e.prototype._destroyVideoElement=function(){this.videoElement&&(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener("ended",this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},e.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},e.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},e.prototype.addVideoSource=function(t,n){try{t.srcObject=n}catch{t.src=URL.createObjectURL(n)}},e.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch{t.src=""}this.videoElement.removeAttribute("src")},e}(),Nr=function(){function e(t,n,r,o,i,a){r===void 0&&(r=n==null?0:8*n.length),a===void 0&&(a=It.currentTimeMillis()),this.text=t,this.rawBytes=n,this.numBits=r,this.resultPoints=o,this.format=i,this.timestamp=a,this.text=t,this.rawBytes=n,this.numBits=r??(n==null?0:8*n.length),this.resultPoints=o,this.format=i,this.resultMetadata=null,this.timestamp=a??It.currentTimeMillis()}return e.prototype.getText=function(){return this.text},e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.getBarcodeFormat=function(){return this.format},e.prototype.getResultMetadata=function(){return this.resultMetadata},e.prototype.putMetadata=function(t,n){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(t,n)},e.prototype.putAllMetadata=function(t){t!==null&&(this.resultMetadata===null?this.resultMetadata=t:this.resultMetadata=new Map(t))},e.prototype.addResultPoints=function(t){var n=this.resultPoints;if(n===null)this.resultPoints=t;else if(t!==null&&t.length>0){var r=new Array(n.length+t.length);It.arraycopy(n,0,r,0,n.length),It.arraycopy(t,0,r,n.length,t.length),this.resultPoints=r}},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.toString=function(){return this.text},e}();(function(e){e[e.AZTEC=0]="AZTEC",e[e.CODABAR=1]="CODABAR",e[e.CODE_39=2]="CODE_39",e[e.CODE_93=3]="CODE_93",e[e.CODE_128=4]="CODE_128",e[e.DATA_MATRIX=5]="DATA_MATRIX",e[e.EAN_8=6]="EAN_8",e[e.EAN_13=7]="EAN_13",e[e.ITF=8]="ITF",e[e.MAXICODE=9]="MAXICODE",e[e.PDF_417=10]="PDF_417",e[e.QR_CODE=11]="QR_CODE",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(gw||(gw={}));var vw,Te=gw;(function(e){e[e.OTHER=0]="OTHER",e[e.ORIENTATION=1]="ORIENTATION",e[e.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",e[e.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",e[e.ISSUE_NUMBER=4]="ISSUE_NUMBER",e[e.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",e[e.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",e[e.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",e[e.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",e[e.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",e[e.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(vw||(vw={}));var Pn,Ln=vw,Lm=function(){function e(t,n,r,o,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=t,this.text=n,this.byteSegments=r,this.ecLevel=o,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=t==null?0:8*t.length}return e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.setNumBits=function(t){this.numBits=t},e.prototype.getText=function(){return this.text},e.prototype.getByteSegments=function(){return this.byteSegments},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getErrorsCorrected=function(){return this.errorsCorrected},e.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},e.prototype.getErasures=function(){return this.erasures},e.prototype.setErasures=function(t){this.erasures=t},e.prototype.getOther=function(){return this.other},e.prototype.setOther=function(t){this.other=t},e.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},e.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},e.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},e}(),Pc=function(){function e(){}return e.prototype.exp=function(t){return this.expTable[t]},e.prototype.log=function(t){if(t===0)throw new Me;return this.logTable[t]},e.addOrSubtract=function(t,n){return t^n},e}(),Jc=function(){function e(t,n){if(n.length===0)throw new Me;this.field=t;var r=n.length;if(r>1&&n[0]===0){for(var o=1;or.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;It.arraycopy(r,0,i,0,a);for(var s=a;s=t.getDegree()&&!o.isZero();){var s=o.getDegree()-t.getDegree(),l=n.multiply(o.getCoefficient(o.getDegree()),a),u=t.multiplyByMonomial(s,l),c=n.buildMonomial(s,l);r=r.addOrSubtract(c),o=o.addOrSubtract(u)}return[r,o]},e.prototype.toString=function(){for(var t="",n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);if(r!==0){if(r<0?(t+=" - ",r=-r):t.length>0&&(t+=" + "),n===0||r!==1){var o=this.field.log(r);o===0?t+="1":o===1?t+="a":(t+="a^",t+=o)}n!==0&&(n===1?t+="x":(t+="x^",t+=n))}}return t},e}(),Pse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jk=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Pse(t,e),t.kind="ArithmeticException",t}(Lr),Tse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pa=function(e){function t(n,r,o){var i=e.call(this)||this;i.primitive=n,i.size=r,i.generatorBase=o;for(var a=new Int32Array(r),s=1,l=0;l=r&&(s^=n,s&=r-1);i.expTable=a;var u=new Int32Array(r);for(l=0;l=(r/2|0);){var c=a,f=l;if(l=u,(a=s).isZero())throw new Ch("r_{i-1} was zero");s=c;for(var d=i.getZero(),h=a.getCoefficient(a.getDegree()),p=i.inverse(h);s.getDegree()>=a.getDegree()&&!s.isZero();){var m=s.getDegree()-a.getDegree(),S=i.multiply(s.getCoefficient(s.getDegree()),p);d=d.addOrSubtract(i.buildMonomial(m,S)),s=s.addOrSubtract(a.multiplyByMonomial(m,S))}if(u=d.multiply(l).addOrSubtract(f),s.getDegree()>=a.getDegree())throw new Pd("Division algorithm failed to reduce polynomial?")}var b=u.getCoefficient(0);if(b===0)throw new Ch("sigmaTilde(0) was zero");var g=i.inverse(b);return[u.multiplyScalar(g),s.multiplyScalar(g)]},e.prototype.findErrorLocations=function(t){var n=t.getDegree();if(n===1)return Int32Array.from([t.getCoefficient(1)]);for(var r=new Int32Array(n),o=0,i=this.field,a=1;a1,d,d+r-1),d+=r-1;else for(var p=r-1;p>=0;--p)f[d++]=(h&1<=8?e.readCode(t,n,8):e.readCode(t,n,r)<<8-r},e.convertBoolArrayToByteArray=function(t){for(var n=new Uint8Array((t.length+7)/8),r=0;r","?","[","]","{","}","CTRL_UL"],e.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],e}(),Ze=function(){function e(){}return e.round=function(t){return t===NaN?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},e.distance=function(t,n,r,o){var i=t-r,a=n-o;return Math.sqrt(i*i+a*a)},e.sum=function(t){for(var n=0,r=0,o=t.length;r!==o;r++)n+=t[r];return n},e}(),lw=function(){function e(){}return e.floatToIntBits=function(t){return t},e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}(),we=function(){function e(t,n){this.x=t,this.y=n}return e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.equals=function(t){if(t instanceof e){var n=t;return this.x===n.x&&this.y===n.y}return!1},e.prototype.hashCode=function(){return 31*lw.floatToIntBits(this.x)+lw.floatToIntBits(this.y)},e.prototype.toString=function(){return"("+this.x+","+this.y+")"},e.orderBestPatterns=function(t){var n,r,o,i=this.distance(t[0],t[1]),a=this.distance(t[1],t[2]),s=this.distance(t[0],t[2]);if(a>=i&&a>=s?(r=t[0],n=t[1],o=t[2]):s>=a&&s>=i?(r=t[1],n=t[0],o=t[2]):(r=t[2],n=t[0],o=t[1]),this.crossProductZ(n,r,o)<0){var l=n;n=o,o=l}t[0]=n,t[1]=r,t[2]=o},e.distance=function(t,n){return Ze.distance(t.x,t.y,n.x,n.y)},e.crossProductZ=function(t,n,r){var o=n.x,i=n.y;return(r.x-o)*(t.y-i)-(r.y-i)*(t.x-o)},e}(),m_=function(){function e(t,n){this.bits=t,this.points=n}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),mse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yse=function(e){function t(n,r,o,i,a){var s=e.call(this,n,r)||this;return s.compact=o,s.nbDatablocks=i,s.nbLayers=a,s}return mse(t,e),t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(m_),uw=function(){function e(t,n,r,o){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),n==null&&(n=e.INIT_SIZE),r==null&&(r=t.getWidth()/2|0),o==null&&(o=t.getHeight()/2|0);var i=n/2|0;if(this.leftInit=r-i,this.rightInit=r+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Y}return e.prototype.detect=function(){for(var t=this.leftInit,n=this.rightInit,r=this.upInit,o=this.downInit,i=!1,a=!0,s=!1,l=!1,u=!1,c=!1,f=!1,d=this.width,h=this.height;a;){a=!1;for(var p=!0;(p||!l)&&n=d){i=!0;break}for(var m=!0;(m||!u)&&o=h){i=!0;break}for(var _=!0;(_||!c)&&t>=0;)(_=this.containsBlackPoint(r,o,t,!1))?(t--,a=!0,c=!0):c||t--;if(t<0){i=!0;break}for(var b=!0;(b||!f)&&r>=0;)(b=this.containsBlackPoint(t,n,r,!0))?(r--,a=!0,f=!0):f||r--;if(r<0){i=!0;break}a&&(s=!0)}if(!i&&s){for(var g=n-t,E=null,T=1;E===null&&Tr||l<-1||l>o)throw new Y;i=!1,s===-1?(n[a]=0,i=!0):s===r&&(n[a]=r-1,i=!0),l===-1?(n[a+1]=0,i=!0):l===o&&(n[a+1]=o-1,i=!0)}for(i=!0,a=n.length-2;a>=0&&i;a-=2){if(s=Math.floor(n[a]),l=Math.floor(n[a+1]),s<-1||s>r||l<-1||l>o)throw new Y;i=!1,s===-1?(n[a]=0,i=!0):s===r&&(n[a]=r-1,i=!0),l===-1?(n[a+1]=0,i=!0):l===o&&(n[a+1]=o-1,i=!0)}},e}(),Ck=function(){function e(t,n,r,o,i,a,s,l,u){this.a11=t,this.a21=n,this.a31=r,this.a12=o,this.a22=i,this.a32=a,this.a13=s,this.a23=l,this.a33=u}return e.quadrilateralToQuadrilateral=function(t,n,r,o,i,a,s,l,u,c,f,d,h,p,m,_){var b=e.quadrilateralToSquare(t,n,r,o,i,a,s,l);return e.squareToQuadrilateral(u,c,f,d,h,p,m,_).times(b)},e.prototype.transformPoints=function(t){for(var n=t.length,r=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,l=this.a23,u=this.a31,c=this.a32,f=this.a33,d=0;d>1&127):(o<<=10,o+=(a>>2&992)+(a>>1&31))}var s=this.getCorrectedParameterData(o,this.compact);this.compact?(this.nbLayers=1+(s>>6),this.nbDataBlocks=1+(63&s)):(this.nbLayers=1+(s>>11),this.nbDataBlocks=1+(2047&s))},e.prototype.getRotation=function(t,n){var r=0;t.forEach(function(i,a,s){r=(r<<3)+((i>>n-2<<1)+(1&i))}),r=((1&r)<<11)+(r>>1);for(var o=0;o<4;o++)if(Dn.bitCount(r^this.EXPECTED_CORNER_BITS[o])<=2)return o;throw new Y},e.prototype.getCorrectedParameterData=function(t,n){var r,o;n?(r=7,o=2):(r=10,o=4);for(var i=r-o,a=new Int32Array(r),s=r-1;s>=0;--s)a[s]=15&t,t>>=4;try{new xm(ha.AZTEC_PARAM).decode(a,i)}catch{throw new Y}var l=0;for(s=0;s2){var f=this.distancePoint(c,s)*this.nbCenterLayers/(this.distancePoint(i,n)*(this.nbCenterLayers+2));if(f<.75||f>1.25||!this.isWhiteOrBlackRectangle(s,l,u,c))break}n=s,r=l,o=u,i=c,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new Y;this.compact=this.nbCenterLayers===5;var d=new we(n.getX()+.5,n.getY()-.5),h=new we(r.getX()+.5,r.getY()+.5),p=new we(o.getX()-.5,o.getY()+.5),m=new we(i.getX()-.5,i.getY()-.5);return this.expandSquare([d,h,p,m],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},e.prototype.getMatrixCenter=function(){var t,n,r,o;try{t=(u=new uw(this.image).detect())[0],n=u[1],r=u[2],o=u[3]}catch{var i=this.image.getWidth()/2,a=this.image.getHeight()/2;t=this.getFirstDifferent(new dr(i+7,a-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new dr(i+7,a+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new dr(i-7,a+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new dr(i-7,a-7),!1,-1,-1).toResultPoint()}var s=Ze.round((t.getX()+o.getX()+n.getX()+r.getX())/4),l=Ze.round((t.getY()+o.getY()+n.getY()+r.getY())/4);try{var u;t=(u=new uw(this.image,15,s,l).detect())[0],n=u[1],r=u[2],o=u[3]}catch{t=this.getFirstDifferent(new dr(s+7,l-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new dr(s+7,l+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new dr(s-7,l+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new dr(s-7,l-7),!1,-1,-1).toResultPoint()}return s=Ze.round((t.getX()+o.getX()+n.getX()+r.getX())/4),l=Ze.round((t.getY()+o.getY()+n.getY()+r.getY())/4),new dr(s,l)},e.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},e.prototype.sampleGrid=function(t,n,r,o,i){var a=y_.getInstance(),s=this.getDimension(),l=s/2-this.nbCenterLayers,u=s/2+this.nbCenterLayers;return a.sampleGrid(t,s,s,l,l,u,l,u,u,l,u,n.getX(),n.getY(),r.getX(),r.getY(),o.getX(),o.getY(),i.getX(),i.getY())},e.prototype.sampleLine=function(t,n,r){for(var o=0,i=this.distanceResultPoint(t,n),a=i/r,s=t.getX(),l=t.getY(),u=a*(n.getX()-t.getX())/i,c=a*(n.getY()-t.getY())/i,f=0;f.1&&d<.9?0:d<=.1===u?1:-1},e.prototype.getFirstDifferent=function(t,n,r,o){for(var i=t.getX()+r,a=t.getY()+o;this.isValid(i,a)&&this.image.get(i,a)===n;)i+=r,a+=o;for(i-=r,a-=o;this.isValid(i,a)&&this.image.get(i,a)===n;)i+=r;for(i-=r;this.isValid(i,a)&&this.image.get(i,a)===n;)a+=o;return new dr(i,a-=o)},e.prototype.expandSquare=function(t,n,r){var o=r/(2*n),i=t[0].getX()-t[2].getX(),a=t[0].getY()-t[2].getY(),s=(t[0].getX()+t[2].getX())/2,l=(t[0].getY()+t[2].getY())/2,u=new we(s+o*i,l+o*a),c=new we(s-o*i,l-o*a);return i=t[1].getX()-t[3].getX(),a=t[1].getY()-t[3].getY(),s=(t[1].getX()+t[3].getX())/2,l=(t[1].getY()+t[3].getY())/2,[u,new we(s+o*i,l+o*a),c,new we(s-o*i,l-o*a)]},e.prototype.isValid=function(t,n){return t>=0&&t0&&n>(s?8:5));r=s?i:15;for(var u=Math.trunc(i/2),c=0;c=i)break;try{a=t.getBlackRow(d,a)}catch{continue}for(var h=function(b){if(b===1&&(a.reverse(),n&&n.get(Et.NEED_RESULT_POINT_CALLBACK)===!0)){var g=new Map;n.forEach(function(O,A){return g.set(A,O)}),g.delete(Et.NEED_RESULT_POINT_CALLBACK),n=g}try{var E=p.decodeRow(d,a,n);if(b===1){E.putMetadata(Ln.ORIENTATION,180);var T=E.getResultPoints();T!==null&&(T[0]=new we(o-T[0].getX()-1,T[0].getY()),T[1]=new we(o-T[1].getX()-1,T[1].getY()))}return{value:E}}catch{}},p=this,m=0;m<2;m++){var _=h(m);if(typeof _=="object")return _.value}}throw new Y},e.recordPattern=function(t,n,r){for(var o=r.length,i=0;i=a)throw new Y;for(var s=!t.get(n),l=0,u=n;u0&&o>=0;)t.get(--n)!==i&&(o--,i=!i);if(o>=0)throw new Y;e.recordPattern(t,n+1,r)},e.patternMatchVariance=function(t,n,r){for(var o=t.length,i=0,a=0,s=0;sd?f-d:d-f;if(h>r)return Number.POSITIVE_INFINITY;u+=h}return u/i},e}(),Sse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),O4=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Sse(t,e),t.findStartPattern=function(n){for(var r=n.getSize(),o=n.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),s=o,l=!1,u=o;u=0&&n.isRange(Math.max(0,s-(u-s)/2),s,!1))return Int32Array.from([s,u,f]);s+=a[0]+a[1],(a=a.slice(2,a.length-1))[i-1]=0,a[i]=0,i--}else i++;a[i]=1,l=!l}throw new Y},t.decodeCode=function(n,r,o){Nn.recordPattern(n,o,r);for(var i=t.MAX_AVG_VARIANCE,a=-1,s=0;s=0)return a;throw new Y},t.prototype.decodeRow=function(n,r,o){var i,a=o&&o.get(Et.ASSUME_GS1)===!0,s=t.findStartPattern(r),l=s[2],u=0,c=new Uint8Array(20);switch(c[u++]=l,l){case t.CODE_START_A:i=t.CODE_CODE_A;break;case t.CODE_START_B:i=t.CODE_CODE_B;break;case t.CODE_START_C:i=t.CODE_CODE_C;break;default:throw new ae}for(var f=!1,d=!1,h="",p=s[0],m=s[1],_=Int32Array.from([0,0,0,0,0,0]),b=0,g=0,E=l,T=0,O=!0,A=!1,C=!1;!f;){var y=d;switch(d=!1,b=g,g=t.decodeCode(r,_,m),c[u++]=g,g!==t.CODE_STOP&&(O=!0),g!==t.CODE_STOP&&(E+=++T*g),p=m,m+=_.reduce(function(D,L){return D+L},0),g){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new ae}switch(i){case t.CODE_CODE_A:if(g<64)h+=C===A?String.fromCharCode(" ".charCodeAt(0)+g):String.fromCharCode(" ".charCodeAt(0)+g+128),C=!1;else if(g<96)h+=C===A?String.fromCharCode(g-64):String.fromCharCode(g+64),C=!1;else switch(g!==t.CODE_STOP&&(O=!1),g){case t.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!A&&C?(A=!0,C=!1):A&&C?(A=!1,C=!1):C=!0;break;case t.CODE_SHIFT:d=!0,i=t.CODE_CODE_B;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:f=!0}break;case t.CODE_CODE_B:if(g<96)h+=C===A?String.fromCharCode(" ".charCodeAt(0)+g):String.fromCharCode(" ".charCodeAt(0)+g+128),C=!1;else switch(g!==t.CODE_STOP&&(O=!1),g){case t.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!A&&C?(A=!0,C=!1):A&&C?(A=!1,C=!1):C=!0;break;case t.CODE_SHIFT:d=!0,i=t.CODE_CODE_A;break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:f=!0}break;case t.CODE_CODE_C:if(g<100)g<10&&(h+="0"),h+=g;else switch(g!==t.CODE_STOP&&(O=!1),g){case t.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_STOP:f=!0}}y&&(i=i===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var S=m-p;if(m=r.getNextUnset(m),!r.isRange(m,Math.min(r.getSize(),m+(m-p)/2),!1))throw new Y;if((E-=T*b)%103!==b)throw new hn;var v=h.length;if(v===0)throw new Y;v>0&&O&&(h=i===t.CODE_CODE_C?h.substring(0,v-2):h.substring(0,v-1));for(var x=(s[1]+s[0])/2,I=p+S/2,R=c.length,k=new Uint8Array(R),M=0;M=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},A4=function(e){function t(n,r){n===void 0&&(n=!1),r===void 0&&(r=!1);var o=e.call(this)||this;return o.usingCheckDigit=n,o.extendedMode=r,o.decodeRowResult="",o.counters=new Int32Array(9),o}return _se(t,e),t.prototype.decodeRow=function(n,r,o){var i,a,s,l,u=this.counters;u.fill(0),this.decodeRowResult="";var c,f,d=t.findAsteriskPattern(r,u),h=r.getNextSet(d[1]),p=r.getSize();do{t.recordPattern(r,h,u);var m=t.toNarrowWidePattern(u);if(m<0)throw new Y;c=t.patternToChar(m),this.decodeRowResult+=c,f=h;try{for(var _=(i=void 0,Sg(u)),b=_.next();!b.done;b=_.next())h+=b.value}catch(x){i={error:x}}finally{try{b&&!b.done&&(a=_.return)&&a.call(_)}finally{if(i)throw i.error}}h=r.getNextSet(h)}while(c!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var g,E=0;try{for(var T=Sg(u),O=T.next();!O.done;O=T.next())E+=O.value}catch(x){s={error:x}}finally{try{O&&!O.done&&(l=T.return)&&l.call(T)}finally{if(s)throw s.error}}if(h!==p&&2*(h-f-E)s&&(l=p)}catch(m){r={error:m}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}s=l,i=0;for(var f=0,d=0,h=0;hs&&(d|=1<0;h++){var p;if((p=n[h])>s&&(i--,2*p>=f))return-1}return d}}while(i>3);return-1},t.patternToChar=function(n){for(var r=0;r="A"&&s<="Z"))throw new ae;l=String.fromCharCode(s.charCodeAt(0)+32);break;case"$":if(!(s>="A"&&s<="Z"))throw new ae;l=String.fromCharCode(s.charCodeAt(0)-64);break;case"%":if(s>="A"&&s<="E")l=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")l=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")l=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")l="\0";else if(s==="V")l="@";else if(s==="W")l="`";else{if(s!=="X"&&s!=="Y"&&s!=="Z")throw new ae;l=""}break;case"/":if(s>="A"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)-32);else{if(s!=="Z")throw new ae;l=":"}}o+=l,i++}else o+=a}return o},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}(Nn),Ese=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cse=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},P4=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.narrowLineWidth=-1,n}return Ese(t,e),t.prototype.decodeRow=function(n,r,o){var i,a,s=this.decodeStart(r),l=this.decodeEnd(r),u=new mt;t.decodeMiddle(r,s[1],l[0],u);var c=u.toString(),f=null;o!=null&&(f=o.get(Et.ALLOWED_LENGTHS)),f==null&&(f=t.DEFAULT_ALLOWED_LENGTHS);var d=c.length,h=!1,p=0;try{for(var m=Cse(f),_=m.next();!_.done;_=m.next()){var b=_.value;if(d===b){h=!0;break}b>p&&(p=b)}}catch(E){i={error:E}}finally{try{_&&!_.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}if(!h&&d>p&&(h=!0),!h)throw new ae;var g=[new we(s[1],n),new we(l[0],n)];return new Ir(c,null,0,g,Te.ITF,new Date().getTime())},t.decodeMiddle=function(n,r,o,i){var a=new Int32Array(10),s=new Int32Array(5),l=new Int32Array(5);for(a.fill(0),s.fill(0),l.fill(0);r0&&i>=0&&!n.get(i);i--)o--;if(o!==0)throw new Y},t.skipWhiteSpace=function(n){var r=n.getSize(),o=n.getNextSet(0);if(o===r)throw new Y;return o},t.prototype.decodeEnd=function(n){n.reverse();try{var r=t.skipWhiteSpace(n),o=void 0;try{o=t.findGuardPattern(n,r,t.END_PATTERN_REVERSED[0])}catch(a){a instanceof Y&&(o=t.findGuardPattern(n,r,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(n,o[0]);var i=o[0];return o[0]=n.getSize()-o[1],o[1]=n.getSize()-i,o}finally{n.reverse()}},t.findGuardPattern=function(n,r,o){var i=o.length,a=new Int32Array(i),s=n.getSize(),l=!1,u=0,c=r;a.fill(0);for(var f=r;f=0)return o%10;throw new Y},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(Nn),xse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Au=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.decodeRowStringBuffer="",n}return xse(t,e),t.findStartGuardPattern=function(n){for(var r,o=!1,i=0,a=Int32Array.from([0,0,0]);!o;){a=Int32Array.from([0,0,0]);var s=(r=t.findGuardPattern(n,i,!1,this.START_END_PATTERN,a))[0],l=s-((i=r[1])-s);l>=0&&(o=n.isRange(l,s,!1))}return r},t.checkChecksum=function(n){return t.checkStandardUPCEANChecksum(n)},t.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var o=parseInt(n.charAt(r-1),10);return t.getStandardUPCEANChecksum(n.substring(0,r-1))===o},t.getStandardUPCEANChecksum=function(n){for(var r=n.length,o=0,i=r-1;i>=0;i-=2){if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}for(o*=3,i=r-2;i>=0;i-=2){var a;if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}return(1e3-o)%10},t.decodeEnd=function(n,r){return t.findGuardPattern(n,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(n,r,o,i){return this.findGuardPattern(n,r,o,i,new Int32Array(i.length))},t.findGuardPattern=function(n,r,o,i,a){for(var s=n.getSize(),l=0,u=r=o?n.getNextUnset(r):n.getNextSet(r),c=i.length,f=o,d=r;d=0)return s;throw new Y},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}(Nn),Ose=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ase=function(){function e(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,n,r){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(n,r,o),a=o.toString(),s=e.parseExtensionString(a),l=[new we((r[0]+r[1])/2,t),new we(i,t)],u=new Ir(a,null,0,l,Te.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},e.prototype.decodeMiddle=function(t,n,r){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),l=n[1],u=0,c=0;c<5&&l=10&&(u|=1<<4-c),c!==4&&(l=t.getNextSet(l),l=t.getNextUnset(l))}if(r.length!==5)throw new Y;var p=this.determineCheckDigit(u);if(e.extensionChecksum(r.toString())!==p)throw new Y;return l},e.extensionChecksum=function(t){for(var n=t.length,r=0,o=n-2;o>=0;o-=2)r+=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);for(r*=3,o=n-1;o>=0;o-=2)r+=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);return(r*=3)%10},e.prototype.determineCheckDigit=function(t){for(var n=0;n<10;n++)if(t===this.CHECK_DIGIT_ENCODINGS[n])return n;throw new Y},e.parseExtensionString=function(t){if(t.length!==5)return null;var n=e.parseExtension5String(t);return n==null?null:new Map([[Ln.SUGGESTED_PRICE,n]])},e.parseExtension5String=function(t){var n;switch(t.charAt(0)){case"0":n="£";break;case"5":n="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}n="";break;default:n=""}var r=parseInt(t.substring(1)),o=r%100;return n+(r/100).toString()+"."+(o<10?"0"+o:o.toString())},e}(),Pse=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tse=function(){function e(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,n,r){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(n,r,o),a=o.toString(),s=e.parseExtensionString(a),l=[new we((r[0]+r[1])/2,t),new we(i,t)],u=new Ir(a,null,0,l,Te.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},e.prototype.decodeMiddle=function(t,n,r){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),l=n[1],u=0,c=0;c<2&&l=10&&(u|=1<<1-c),c!==1&&(l=t.getNextSet(l),l=t.getNextUnset(l))}if(r.length!==2)throw new Y;if(parseInt(r.toString())%4!==u)throw new Y;return l},e.parseExtensionString=function(t){return t.length!==2?null:new Map([[Ln.ISSUE_NUMBER,parseInt(t)]])},e}(),Ise=function(){function e(){}return e.decodeRow=function(t,n,r){var o=Au.findGuardPattern(n,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new Ase().decodeRow(t,n,o)}catch{return new Tse().decodeRow(t,n,o)}},e.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),e}(),Rse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fn=function(e){function t(){var n=e.call(this)||this;n.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var r=10;r<20;r++){for(var o=t.L_PATTERNS[r-10],i=new Int32Array(o.length),a=0;a=r.getSize()||!r.isRange(p,m,!1))throw new Y;var _=c.toString();if(_.length<8)throw new ae;if(!t.checkChecksum(_))throw new hn;var b=(i[1]+i[0])/2,g=(d[1]+d[0])/2,E=this.getBarcodeFormat(),T=[new we(b,n),new we(g,n)],O=new Ir(_,null,0,T,E,new Date().getTime()),A=0;try{var C=Ise.decodeRow(n,r,d[1]);O.putMetadata(Ln.UPC_EAN_EXTENSION,C.getText()),O.putAllMetadata(C.getResultMetadata()),O.addResultPoints(C.getResultPoints()),A=C.getText().length}catch{}var y=o==null?null:o.get(Et.ALLOWED_EAN_EXTENSIONS);if(y!=null){var S=!1;for(var v in y)if(A.toString()===v){S=!0;break}if(!S)throw new Y}return E===Te.EAN_13||Te.UPC_A,O},t.checkChecksum=function(n){return t.checkStandardUPCEANChecksum(n)},t.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var o=parseInt(n.charAt(r-1),10);return t.getStandardUPCEANChecksum(n.substring(0,r-1))===o},t.getStandardUPCEANChecksum=function(n){for(var r=n.length,o=0,i=r-1;i>=0;i-=2){if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}for(o*=3,i=r-2;i>=0;i-=2){var a;if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}return(1e3-o)%10},t.decodeEnd=function(n,r){return t.findGuardPattern(n,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(Au),kse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),T4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},cw=function(e){function t(){var n=e.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return kse(t,e),t.prototype.decodeMiddle=function(n,r,o){var i,a,s,l,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=n.getSize(),f=r[1],d=0,h=0;h<6&&f=10&&(d|=1<<5-h)}for(o=t.determineFirstDigit(o,d),f=fn.findGuardPattern(n,f,!0,fn.MIDDLE_PATTERN,new Int32Array(fn.MIDDLE_PATTERN.length).fill(0))[1],h=0;h<6&&f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},R4=function(e){function t(){var n=e.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return Mse(t,e),t.prototype.decodeMiddle=function(n,r,o){var i,a,s,l,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=n.getSize(),f=r[1],d=0;d<4&&f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},k4=function(e){function t(){var n=e.call(this)||this;return n.decodeMiddleCounters=new Int32Array(4),n}return Nse(t,e),t.prototype.decodeMiddle=function(n,r,o){var i,a,s=this.decodeMiddleCounters.map(function(m){return m});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var l=n.getSize(),u=r[1],c=0,f=0;f<6&&u=10&&(c|=1<<5-f)}return t.determineNumSysAndCheckDigit(new mt(o),c),u},t.prototype.decodeEnd=function(n,r){return t.findGuardPatternWithoutCounters(n,r,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(n){return fn.checkChecksum(t.convertUPCEtoUPCA(n))},t.determineNumSysAndCheckDigit=function(n,r){for(var o=0;o<=1;o++)for(var i=0;i<10;i++)if(r===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[o][i])return n.insert(0,"0"+o),void n.append("0"+i);throw Y.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return Te.UPC_E},t.convertUPCEtoUPCA=function(n){var r=n.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),o=new mt;o.append(n.charAt(0));var i=r[5];switch(i){case 0:case 1:case 2:o.appendChars(r,0,2),o.append(i),o.append("0000"),o.appendChars(r,2,3);break;case 3:o.appendChars(r,0,3),o.append("00000"),o.appendChars(r,3,2);break;case 4:o.appendChars(r,0,4),o.append("00000"),o.append(r[4]);break;default:o.appendChars(r,0,5),o.append("0000"),o.append(i)}return n.length>=8&&o.append(n.charAt(7)),o.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(fn),jse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),M4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_g=function(e){function t(n){var r=e.call(this)||this,o=n==null?null:n.get(Et.POSSIBLE_FORMATS),i=[];return o!=null&&(o.indexOf(Te.EAN_13)>-1?i.push(new cw):o.indexOf(Te.UPC_A)>-1&&i.push(new Lse),o.indexOf(Te.EAN_8)>-1&&i.push(new R4),o.indexOf(Te.UPC_E)>-1&&i.push(new k4)),i.length===0&&(i.push(new cw),i.push(new R4),i.push(new k4)),r.readers=i,r}return jse(t,e),t.prototype.decodeRow=function(n,r,o){var i,a;try{for(var s=M4(this.readers),l=s.next();!l.done;l=s.next()){var u=l.value;try{var c=u.decodeRow(n,r,o),f=c.getBarcodeFormat()===Te.EAN_13&&c.getText().charAt(0)==="0",d=o==null?null:o.get(Et.POSSIBLE_FORMATS),h=d==null||d.includes(Te.UPC_A);if(f&&h){var p=c.getRawBytes(),m=new Ir(c.getText().substring(1),p,p.length,c.getResultPoints(),Te.UPC_A);return m.putAllMetadata(c.getResultMetadata()),m}return c}catch{}}}catch(_){i={error:_}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}throw new Y},t.prototype.reset=function(){var n,r;try{for(var o=M4(this.readers),i=o.next();!i.done;i=o.next())i.value.reset()}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t}(Nn),Fse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$se=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},os=function(e){function t(){var n=e.call(this)||this;return n.decodeFinderCounters=new Int32Array(4),n.dataCharacterCounters=new Int32Array(8),n.oddRoundingErrors=new Array(4),n.evenRoundingErrors=new Array(4),n.oddCounts=new Array(n.dataCharacterCounters.length/2),n.evenCounts=new Array(n.dataCharacterCounters.length/2),n}return Fse(t,e),t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(n,r){for(var o=0;oi&&(i=r[a],o=a);n[o]++},t.decrement=function(n,r){for(var o=0,i=r[0],a=1;a=t.MIN_FINDER_PATTERN_RATIO&&a<=t.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;try{for(var u=$se(n),c=u.next();!c.done;c=u.next()){var f=c.value;f>l&&(l=f),f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$l=function(){function e(){}return e.getRSSvalue=function(t,n,r){var o,i,a=0;try{for(var s=zse(t),l=s.next();!l.done;l=s.next())a+=l.value}catch(b){o={error:b}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var u=0,c=0,f=t.length,d=0;d=f-d-1&&(p-=e.combins(a-h-(f-d),f-d-2)),f-d-1>1){for(var m=0,_=a-h-(f-d-2);_>n;_--)m+=e.combins(a-h-_-1,f-d-3);p-=m*(f-1-d)}else a-h>n&&p--;u+=p}a-=h}return u},e.combins=function(t,n){var r,o;t-n>n?(o=n,r=t-n):(o=t-n,r=n);for(var i=1,a=1,s=t;s>r;s--)i*=s,a<=o&&(i/=a,a++);for(;a<=o;)i/=a,a++;return i},e}(),Use=function(){function e(){}return e.buildBitArray=function(t){var n=2*t.length-1;t[t.length-1].getRightChar()==null&&(n-=1);for(var r=new ri(12*n),o=0,i=t[0].getRightChar().getValue(),a=11;a>=0;--a)i&1<=0;--u)l&1<=0;--u)c&1<10||o<0||o>10)throw new ae;return i.firstDigit=r,i.secondDigit=o,i}return Wse(t,e),t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(g_),Ch=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gse=function(){function e(){}return e.parseFieldsInGeneralPurpose=function(t){var n,r,o,i,a,s,l,u;if(!t)return null;if(t.length<2)throw new Y;var c=t.substring(0,2);try{for(var f=Ch(e.TWO_DIGIT_DATA_LENGTH),d=f.next();!d.done;d=f.next())if((O=d.value)[0]===c)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(2,O[2],t):e.processFixedAI(2,O[1],t)}catch(A){n={error:A}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}if(t.length<3)throw new Y;var h=t.substring(0,3);try{for(var p=Ch(e.THREE_DIGIT_DATA_LENGTH),m=p.next();!m.done;m=p.next())if((O=m.value)[0]===h)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(3,O[2],t):e.processFixedAI(3,O[1],t)}catch(A){o={error:A}}finally{try{m&&!m.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var _=Ch(e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),b=_.next();!b.done;b=_.next())if((O=b.value)[0]===h)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,O[2],t):e.processFixedAI(4,O[1],t)}catch(A){a={error:A}}finally{try{b&&!b.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}if(t.length<4)throw new Y;var g=t.substring(0,4);try{for(var E=Ch(e.FOUR_DIGIT_DATA_LENGTH),T=E.next();!T.done;T=E.next()){var O;if((O=T.value)[0]===g)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,O[2],t):e.processFixedAI(4,O[1],t)}}catch(A){l={error:A}}finally{try{T&&!T.done&&(u=E.return)&&u.call(E)}finally{if(l)throw l.error}}throw new Y},e.processFixedAI=function(t,n,r){if(r.lengththis.information.getSize())return t+4<=this.information.getSize();for(var n=t;nthis.information.getSize()){var n=this.extractNumericValueFromBitArray(t,4);return new Eh(this.information.getSize(),n===0?Eh.FNC1:n-1,Eh.FNC1)}var r=this.extractNumericValueFromBitArray(t,7);return new Eh(t+7,(r-8)/11,(r-8)%11)},e.prototype.extractNumericValueFromBitArray=function(t,n){return e.extractNumericValueFromBitArray(this.information,t,n)},e.extractNumericValueFromBitArray=function(t,n,r){for(var o=0,i=0;ithis.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,5);if(n>=5&&n<16)return!0;if(t+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116)return!0;if(t+8>this.information.getSize())return!1;var o=this.extractNumericValueFromBitArray(t,8);return o>=232&&o<253},e.prototype.decodeIsoIec646=function(t){var n=this.extractNumericValueFromBitArray(t,5);if(n===15)return new Ao(t+5,Ao.FNC1);if(n>=5&&n<15)return new Ao(t+5,"0"+(n-5));var r,o=this.extractNumericValueFromBitArray(t,7);if(o>=64&&o<90)return new Ao(t+7,""+(o+1));if(o>=90&&o<116)return new Ao(t+7,""+(o+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new ae}return new Ao(t+8,r)},e.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,5);if(n>=5&&n<16)return!0;if(t+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63},e.prototype.decodeAlphanumeric=function(t){var n=this.extractNumericValueFromBitArray(t,5);if(n===15)return new Ao(t+5,Ao.FNC1);if(n>=5&&n<15)return new Ao(t+5,"0"+(n-5));var r,o=this.extractNumericValueFromBitArray(t,6);if(o>=32&&o<58)return new Ao(t+6,""+(o+33));switch(o){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new Od("Decoding invalid alphanumeric value: "+o)}return new Ao(t+6,r)},e.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var n=0;n<5&&n+tthis.information.getSize())return!1;for(var n=t;nthis.information.getSize())return!1;for(var n=0;n<4&&n+t=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fle=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.pairs=new Array(t.MAX_PAIRS),n.rows=new Array,n.startEnd=[2],n}return cle(t,e),t.prototype.decodeRow=function(n,r,o){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(n,r))}catch{}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(n,r))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(n,r){for(var o,i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(r,this.pairs,n))}catch(s){if(s instanceof Y){if(!this.pairs.length)throw new Y;i=!0}}if(this.checkChecksum())return this.pairs;if(o=!!this.rows.length,this.storeRow(n,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0))!=null)return a}throw new Y},t.prototype.checkRowsBoolean=function(n){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,n&&(this.rows=this.rows.reverse());var r=null;try{r=this.checkRows(new Array,0)}catch(o){console.log(o)}return n&&(this.rows=this.rows.reverse()),r},t.prototype.checkRows=function(n,r){for(var o,i,a=r;as.length)){for(var l=!0,u=0;un){a=s.isEquivalent(this.pairs);break}i=s.isEquivalent(this.pairs),o++}a||i||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(o,new ule(this.pairs,n,r)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(n,r){var o,i,a,s,l,u;try{for(var c=ea(r),f=c.next();!f.done;f=c.next()){var d=f.value;if(d.getPairs().length!==n.length)try{for(var h=(a=void 0,ea(d.getPairs())),p=h.next();!p.done;p=h.next()){var m=p.value,_=!1;try{for(var b=(l=void 0,ea(n)),g=b.next();!g.done;g=b.next()){var E=g.value;if(D4.equals(m,E)){_=!0;break}}}catch(T){l={error:T}}finally{try{g&&!g.done&&(u=b.return)&&u.call(b)}finally{if(l)throw l.error}}}}catch(T){a={error:T}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}}}catch(T){o={error:T}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}},t.isPartialRow=function(n,r){var o,i,a,s,l,u;try{for(var c=ea(r),f=c.next();!f.done;f=c.next()){var d=f.value,h=!0;try{for(var p=(a=void 0,ea(n)),m=p.next();!m.done;m=p.next()){var _=m.value,b=!1;try{for(var g=(l=void 0,ea(d.getPairs())),E=g.next();!E.done;E=g.next()){var T=E.value;if(_.equals(T)){b=!0;break}}}catch(O){l={error:O}}finally{try{E&&!E.done&&(u=g.return)&&u.call(g)}finally{if(l)throw l.error}}if(!b){h=!1;break}}}catch(O){a={error:O}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}if(h)return!0}}catch(O){o={error:O}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(n){var r=function(s){try{if(s.get(1))return new qse(s);if(!s.get(2))return new Zse(s);switch(cp.extractNumericValueFromBitArray(s,1,4)){case 4:return new tle(s);case 5:return new rle(s)}switch(cp.extractNumericValueFromBitArray(s,1,5)){case 12:return new ile(s);case 13:return new sle(s)}switch(cp.extractNumericValueFromBitArray(s,1,7)){case 56:return new Ji(s,"310","11");case 57:return new Ji(s,"320","11");case 58:return new Ji(s,"310","13");case 59:return new Ji(s,"320","13");case 60:return new Ji(s,"310","15");case 61:return new Ji(s,"320","15");case 62:return new Ji(s,"310","17");case 63:return new Ji(s,"320","17")}}catch(l){throw console.log(l),new Od("unknown decoder: "+s)}}(Use.buildBitArray(n)).parseInformation(),o=n[0].getFinderPattern().getResultPoints(),i=n[n.length-1].getFinderPattern().getResultPoints(),a=[o[0],o[1],i[0],i[1]];return new Ir(r,null,null,a,Te.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var n=this.pairs.get(0),r=n.getLeftChar(),o=n.getRightChar();if(o==null)return!1;for(var i=o.getChecksumPortion(),a=2,s=1;s=0?a=o:this.isEmptyPair(r)?a=0:a=r[r.length-1].getFinderPattern().getStartEnd()[1];var l=r.length%2!=0;this.startFromEven&&(l=!l);for(var u=!1;a=0&&!n.get(l);)l--;l++,i=this.startEnd[0]-l,a=l,s=this.startEnd[1]}else a=this.startEnd[0],i=(s=n.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,c=this.getDecodeFinderCounters();It.arraycopy(c,0,c,1,c.length-1),c[0]=i;try{u=this.parseFinderValue(c,t.FINDER_PATTERNS)}catch{return null}return new xk(u,[a,s],a,s,r)},t.prototype.decodeDataCharacter=function(n,r,o,i){for(var a=this.getDataCharacterCounters(),s=0;s.3)throw new Y;var h=this.getOddCounts(),p=this.getEvenCounts(),m=this.getOddRoundingErrors(),_=this.getEvenRoundingErrors();for(l=0;l8){if(b>8.7)throw new Y;g=8}var E=l/2;1&l?(p[E]=g,_[E]=b-g):(h[E]=g,m[E]=b-g)}this.adjustOddEvenCounts(17);var T=4*r.getValue()+(o?0:2)+(i?0:1)-1,O=0,A=0;for(l=h.length-1;l>=0;l--){if(t.isNotA1left(r,o,i)){var C=t.WEIGHTS[T][2*l];A+=h[l]*C}O+=h[l]}var y=0;for(l=p.length-1;l>=0;l--)t.isNotA1left(r,o,i)&&(C=t.WEIGHTS[T][2*l+1],y+=p[l]*C);var S=A+y;if(1&O||O>13||O<4)throw new Y;var v=(13-O)/2,x=t.SYMBOL_WIDEST[v],I=9-x,R=$l.getRSSvalue(h,x,!0),k=$l.getRSSvalue(p,I,!1),M=t.EVEN_TOTAL_SUBSET[v],N=t.GSUM[v];return new x1(R*M+k+N,S)},t.isNotA1left=function(n,r,o){return!(n.getValue()==0&&r&&o)},t.prototype.adjustOddEvenCounts=function(n){var r=Ze.sum(new Int32Array(this.getOddCounts())),o=Ze.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;r>13?a=!0:r<4&&(i=!0);var s=!1,l=!1;o>13?l=!0:o<4&&(s=!0);var u=r+o-n,c=(1&r)==1,f=(1&o)==0;if(u==1)if(c){if(f)throw new Y;a=!0}else{if(!f)throw new Y;l=!0}else if(u==-1)if(c){if(f)throw new Y;i=!0}else{if(!f)throw new Y;s=!0}else{if(u!=0)throw new Y;if(c){if(!f)throw new Y;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},L4=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.possibleLeftPairs=[],n.possibleRightPairs=[],n}return ple(t,e),t.prototype.decodeRow=function(n,r,o){var i,a,s,l,u=this.decodePair(r,!1,n,o);t.addOrTally(this.possibleLeftPairs,u),r.reverse();var c=this.decodePair(r,!0,n,o);t.addOrTally(this.possibleRightPairs,c),r.reverse();try{for(var f=Eg(this.possibleLeftPairs),d=f.next();!d.done;d=f.next()){var h=d.value;if(h.getCount()>1)try{for(var p=(s=void 0,Eg(this.possibleRightPairs)),m=p.next();!m.done;m=p.next()){var _=m.value;if(_.getCount()>1&&t.checkChecksum(h,_))return t.constructResult(h,_)}}catch(b){s={error:b}}finally{try{m&&!m.done&&(l=p.return)&&l.call(p)}finally{if(s)throw s.error}}}}catch(b){i={error:b}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}throw new Y},t.addOrTally=function(n,r){var o,i;if(r!=null){var a=!1;try{for(var s=Eg(n),l=s.next();!l.done;l=s.next()){var u=l.value;if(u.getValue()===r.getValue()){u.incrementCount(),a=!0;break}}}catch(c){o={error:c}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}a||n.push(r)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(n,r){for(var o=4537077*n.getValue()+r.getValue(),i=new String(o).toString(),a=new mt,s=13-i.length;s>0;s--)a.append("0");a.append(i);var l=0;for(s=0;s<13;s++){var u=a.charAt(s).charCodeAt(0)-"0".charCodeAt(0);l+=1&s?u:3*u}(l=10-l%10)===10&&(l=0),a.append(l.toString());var c=n.getFinderPattern().getResultPoints(),f=r.getFinderPattern().getResultPoints();return new Ir(a.toString(),null,0,[c[0],c[1],f[0],f[1]],Te.RSS_14,new Date().getTime())},t.checkChecksum=function(n,r){var o=(n.getChecksumPortion()+16*r.getChecksumPortion())%79,i=9*n.getFinderPattern().getValue()+r.getFinderPattern().getValue();return i>72&&i--,i>8&&i--,o===i},t.prototype.decodePair=function(n,r,o,i){try{var a=this.findFinderPattern(n,r),s=this.parseFoundFinderPattern(n,o,r,a),l=i==null?null:i.get(Et.NEED_RESULT_POINT_CALLBACK);if(l!=null){var u=(a[0]+a[1])/2;r&&(u=n.getSize()-1-u),l.foundPossibleResultPoint(new we(u,o))}var c=this.decodeDataCharacter(n,s,!0),f=this.decodeDataCharacter(n,s,!1);return new hle(1597*c.getValue()+f.getValue(),c.getChecksumPortion()+4*f.getChecksumPortion(),s)}catch{return null}},t.prototype.decodeDataCharacter=function(n,r,o){for(var i=this.getDataCharacterCounters(),a=0;a8&&(b=8);var g=Math.floor(s/2);1&s?(h[g]=b,m[g]=_-b):(d[g]=b,p[g]=_-b)}this.adjustOddEvenCounts(o,c);var E=0,T=0;for(s=d.length-1;s>=0;s--)T*=9,T+=d[s],E+=d[s];var O=0,A=0;for(s=h.length-1;s>=0;s--)O*=9,O+=h[s],A+=h[s];var C=T+3*O;if(o){if(1&E||E>12||E<4)throw new Y;var y=(12-E)/2,S=9-(k=t.OUTSIDE_ODD_WIDEST[y]),v=$l.getRSSvalue(d,k,!1),x=$l.getRSSvalue(h,S,!0),I=t.OUTSIDE_EVEN_TOTAL_SUBSET[y],R=t.OUTSIDE_GSUM[y];return new x1(v*I+x+R,C)}if(1&A||A>10||A<4)throw new Y;y=(10-A)/2,S=9-(k=t.INSIDE_ODD_WIDEST[y]),v=$l.getRSSvalue(d,k,!0),x=$l.getRSSvalue(h,S,!1);var k,M=t.INSIDE_ODD_TOTAL_SUBSET[y];return R=t.INSIDE_GSUM[y],new x1(x*M+v+R,C)},t.prototype.findFinderPattern=function(n,r){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var i=n.getSize(),a=!1,s=0;s=0&&a!==n.get(s);)s--;s++;var l=i[0]-s,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);It.arraycopy(u,0,c,1,u.length-1),c[0]=l;var f=this.parseFinderValue(c,t.FINDER_PATTERNS),d=s,h=i[1];return o&&(d=n.getSize()-1-d,h=n.getSize()-1-h),new xk(f,[s,i[1]],d,h,r)},t.prototype.adjustOddEvenCounts=function(n,r){var o=Ze.sum(new Int32Array(this.getOddCounts())),i=Ze.sum(new Int32Array(this.getEvenCounts())),a=!1,s=!1,l=!1,u=!1;n?(o>12?s=!0:o<4&&(a=!0),i>12?u=!0:i<4&&(l=!0)):(o>11?s=!0:o<5&&(a=!0),i>10?u=!0:i<4&&(l=!0));var c=o+i-r,f=(1&o)==(n?1:0),d=(1&i)==1;if(c===1)if(f){if(d)throw new Y;s=!0}else{if(!d)throw new Y;u=!0}else if(c===-1)if(f){if(d)throw new Y;a=!0}else{if(!d)throw new Y;l=!0}else{if(c!==0)throw new Y;if(f){if(!d)throw new Y;o=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ot=function(){function e(t,n,r){this.ecCodewords=t,this.ecBlocks=[n],r&&this.ecBlocks.push(r)}return e.prototype.getECCodewords=function(){return this.ecCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),Je=function(){function e(t,n){this.count=t,this.dataCodewords=n}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),gle=function(){function e(t,n,r,o,i,a){var s,l;this.versionNumber=t,this.symbolSizeRows=n,this.symbolSizeColumns=r,this.dataRegionSizeRows=o,this.dataRegionSizeColumns=i,this.ecBlocks=a;var u=0,c=a.getECCodewords(),f=a.getECBlocks();try{for(var d=N4(f),h=d.next();!h.done;h=d.next()){var p=h.value;u+=p.getCount()*(p.getDataCodewords()+c)}}catch(m){s={error:m}}finally{try{h&&!h.done&&(l=d.return)&&l.call(d)}finally{if(s)throw s.error}}this.totalCodewords=u}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},e.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},e.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},e.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e.getVersionForDimensions=function(t,n){var r,o;if(1&t||1&n)throw new ae;try{for(var i=N4(e.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===n)return s}}catch(l){r={error:l}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}throw new ae},e.prototype.toString=function(){return""+this.versionNumber},e.buildVersions=function(){return[new e(1,10,10,8,8,new ot(5,new Je(1,3))),new e(2,12,12,10,10,new ot(7,new Je(1,5))),new e(3,14,14,12,12,new ot(10,new Je(1,8))),new e(4,16,16,14,14,new ot(12,new Je(1,12))),new e(5,18,18,16,16,new ot(14,new Je(1,18))),new e(6,20,20,18,18,new ot(18,new Je(1,22))),new e(7,22,22,20,20,new ot(20,new Je(1,30))),new e(8,24,24,22,22,new ot(24,new Je(1,36))),new e(9,26,26,24,24,new ot(28,new Je(1,44))),new e(10,32,32,14,14,new ot(36,new Je(1,62))),new e(11,36,36,16,16,new ot(42,new Je(1,86))),new e(12,40,40,18,18,new ot(48,new Je(1,114))),new e(13,44,44,20,20,new ot(56,new Je(1,144))),new e(14,48,48,22,22,new ot(68,new Je(1,174))),new e(15,52,52,24,24,new ot(42,new Je(2,102))),new e(16,64,64,14,14,new ot(56,new Je(2,140))),new e(17,72,72,16,16,new ot(36,new Je(4,92))),new e(18,80,80,18,18,new ot(48,new Je(4,114))),new e(19,88,88,20,20,new ot(56,new Je(4,144))),new e(20,96,96,22,22,new ot(68,new Je(4,174))),new e(21,104,104,24,24,new ot(56,new Je(6,136))),new e(22,120,120,18,18,new ot(68,new Je(6,175))),new e(23,132,132,20,20,new ot(62,new Je(8,163))),new e(24,144,144,22,22,new ot(62,new Je(8,156),new Je(2,155))),new e(25,8,18,6,16,new ot(7,new Je(1,5))),new e(26,8,32,6,14,new ot(11,new Je(1,10))),new e(27,12,26,10,24,new ot(14,new Je(1,16))),new e(28,12,36,10,16,new ot(18,new Je(1,22))),new e(29,16,36,14,16,new ot(24,new Je(1,32))),new e(30,16,48,14,22,new ot(28,new Je(1,49)))]},e.VERSIONS=e.buildVersions(),e}(),vle=function(){function e(t){var n=t.getHeight();if(n<8||n>144||1&n)throw new ae;this.version=e.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new Fi(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return e.prototype.getVersion=function(){return this.version},e.readVersion=function(t){var n=t.getHeight(),r=t.getWidth();return gle.getVersionForDimensions(n,r)},e.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),n=0,r=4,o=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),s=!1,l=!1,u=!1,c=!1;do if(r!==i||o!==0||s)if(r!==i-2||o!==0||!(3&a)||l)if(r!==i+4||o!==2||7&a||u)if(r!==i-2||o!==0||(7&a)!=4||c){do r=0&&!this.readMappingMatrix.get(o,r)&&(t[n++]=255&this.readUtah(r,o,i,a)),r-=2,o+=2;while(r>=0&&o=0&&o=0);r+=3,o+=1}else t[n++]=255&this.readCorner4(i,a),r-=2,o+=2,c=!0;else t[n++]=255&this.readCorner3(i,a),r-=2,o+=2,u=!0;else t[n++]=255&this.readCorner2(i,a),r-=2,o+=2,l=!0;else t[n++]=255&this.readCorner1(i,a),r-=2,o+=2,s=!0;while(r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wle=function(){function e(t,n){this.numDataCodewords=t,this.codewords=n}return e.getDataBlocks=function(t,n){var r,o,i,a,s=n.getECBlocks(),l=0,u=s.getECBlocks();try{for(var c=B4(u),f=c.next();!f.done;f=c.next())l+=(_=f.value).getCount()}catch(R){r={error:R}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}var d=new Array(l),h=0;try{for(var p=B4(u),m=p.next();!m.done;m=p.next())for(var _=m.value,b=0;b<_.getCount();b++){var g=_.getDataCodewords(),E=s.getECCodewords()+g;d[h++]=new e(g,new Uint8Array(E))}}catch(R){i={error:R}}finally{try{m&&!m.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}var T=d[0].codewords.length-s.getECCodewords(),O=T-1,A=0;for(b=0;b7?b-1:b;d[x].codewords[I]=t[A++]}if(A!==t.length)throw new Me;return d},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}(),Pk=function(){function e(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return e.prototype.getBitOffset=function(){return this.bitOffset},e.prototype.getByteOffset=function(){return this.byteOffset},e.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Me(""+t);var n=0,r=this.bitOffset,o=this.byteOffset,i=this.bytes;if(r>0){var a=8-r,s=t>8-s<<(u=a-s);n=(i[o]&l)>>u,t-=s,(r+=s)===8&&(r=0,o++)}if(t>0){for(;t>=8;)n=n<<8|255&i[o],o++,t-=8;if(t>0){var u;l=255>>(u=8-t)<>u,r+=t}}return this.bitOffset=r,this.byteOffset=o,n},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();(function(e){e[e.PAD_ENCODE=0]="PAD_ENCODE",e[e.ASCII_ENCODE=1]="ASCII_ENCODE",e[e.C40_ENCODE=2]="C40_ENCODE",e[e.TEXT_ENCODE=3]="TEXT_ENCODE",e[e.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",e[e.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",e[e.BASE256_ENCODE=6]="BASE256_ENCODE"})(un||(un={}));var Ul,ble=function(){function e(){}return e.decode=function(t){var n=new Pk(t),r=new mt,o=new mt,i=new Array,a=un.ASCII_ENCODE;do if(a===un.ASCII_ENCODE)a=this.decodeAsciiSegment(n,r,o);else{switch(a){case un.C40_ENCODE:this.decodeC40Segment(n,r);break;case un.TEXT_ENCODE:this.decodeTextSegment(n,r);break;case un.ANSIX12_ENCODE:this.decodeAnsiX12Segment(n,r);break;case un.EDIFACT_ENCODE:this.decodeEdifactSegment(n,r);break;case un.BASE256_ENCODE:this.decodeBase256Segment(n,r,i);break;default:throw new ae}a=un.ASCII_ENCODE}while(a!==un.PAD_ENCODE&&n.available()>0);return o.length()>0&&r.append(o.toString()),new Cm(t,r.toString(),i.length===0?null:i,null)},e.decodeAsciiSegment=function(t,n,r){var o=!1;do{var i=t.readBits(8);if(i===0)throw new ae;if(i<=128)return o&&(i+=128),n.append(String.fromCharCode(i-1)),un.ASCII_ENCODE;if(i===129)return un.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&n.append("0"),n.append(""+a)}else switch(i){case 230:return un.C40_ENCODE;case 231:return un.BASE256_ENCODE;case 232:n.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:o=!0;break;case 236:n.append("[)>05"),r.insert(0,"");break;case 237:n.append("[)>06"),r.insert(0,"");break;case 238:return un.ANSIX12_ENCODE;case 239:return un.TEXT_ENCODE;case 240:return un.EDIFACT_ENCODE;default:if(i!==254||t.available()!==0)throw new ae}}while(t.available()>0);return un.ASCII_ENCODE},e.decodeC40Segment=function(t,n){var r=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var l=o[s];switch(i){case 0:if(l<3)i=l+1;else{if(!(l0)},e.decodeTextSegment=function(t,n){var r=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var l=o[s];switch(i){case 0:if(l<3)i=l+1;else{if(!(l0)},e.decodeAnsiX12Segment=function(t,n){var r=[];do{if(t.available()===8)return;var o=t.readBits(8);if(o===254)return;this.parseTwoBytes(o,t.readBits(8),r);for(var i=0;i<3;i++){var a=r[i];switch(a){case 0:n.append("\r");break;case 1:n.append("*");break;case 2:n.append(">");break;case 3:n.append(" ");break;default:if(a<14)n.append(String.fromCharCode(a+44));else{if(!(a<40))throw new ae;n.append(String.fromCharCode(a+51))}}}}while(t.available()>0)},e.parseTwoBytes=function(t,n,r){var o=(t<<8)+n-1,i=Math.floor(o/1600);r[0]=i,o-=1600*i,i=Math.floor(o/40),r[1]=i,r[2]=o-40*i},e.decodeEdifactSegment=function(t,n){do{if(t.available()<=16)return;for(var r=0;r<4;r++){var o=t.readBits(6);if(o===31){var i=8-t.getBitOffset();return void(i!==8&&t.readBits(i))}!(32&o)&&(o|=64),n.append(String.fromCharCode(o))}}while(t.available()>0)},e.decodeBase256Segment=function(t,n,r){var o,i=1+t.getByteOffset(),a=this.unrandomize255State(t.readBits(8),i++);if((o=a===0?t.available()/8|0:a<250?a:250*(a-249)+this.unrandomize255State(t.readBits(8),i++))<0)throw new ae;for(var s=new Uint8Array(o),l=0;l=0?r:r+256},e.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],e.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],e.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],e.TEXT_SHIFT2_SET_CHARS=e.C40_SHIFT2_SET_CHARS,e.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],e}(),Sle=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_le=function(){function e(){this.rsDecoder=new xm(ha.DATA_MATRIX_FIELD_256)}return e.prototype.decode=function(t){var n,r,o=new vle(t),i=o.getVersion(),a=o.readCodewords(),s=wle.getDataBlocks(a,i),l=0;try{for(var u=Sle(s),c=u.next();!c.done;c=u.next())l+=c.value.getNumDataCodewords()}catch(g){n={error:g}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}for(var f=new Uint8Array(l),d=s.length,h=0;hs&&(c=s,f[0]=n,f[1]=r,f[2]=o,f[3]=i),c>l&&(c=l,f[0]=r,f[1]=o,f[2]=i,f[3]=n),c>u&&(f[0]=o,f[1]=i,f[2]=n,f[3]=r),f},e.prototype.detectSolid2=function(t){var n=t[0],r=t[1],o=t[2],i=t[3],a=this.transitionsBetween(n,i),s=e.shiftPoint(r,o,4*(a+1)),l=e.shiftPoint(o,r,4*(a+1));return this.transitionsBetween(s,n)this.transitionsBetween(l,f)+this.transitionsBetween(u,f)?c:f:c:this.isValid(f)?f:null},e.prototype.shiftToModuleCenter=function(t){var n=t[0],r=t[1],o=t[2],i=t[3],a=this.transitionsBetween(n,i)+1,s=this.transitionsBetween(o,i)+1,l=e.shiftPoint(n,r,4*s),u=e.shiftPoint(o,r,4*a);(1&(a=this.transitionsBetween(l,i)+1))==1&&(a+=1),(1&(s=this.transitionsBetween(u,i)+1))==1&&(s+=1);var c,f,d=(n.getX()+r.getX()+o.getX()+i.getX())/4,h=(n.getY()+r.getY()+o.getY()+i.getY())/4;return n=e.moveAway(n,d,h),r=e.moveAway(r,d,h),o=e.moveAway(o,d,h),i=e.moveAway(i,d,h),l=e.shiftPoint(n,r,4*s),l=e.shiftPoint(l,i,4*a),c=e.shiftPoint(r,n,4*s),c=e.shiftPoint(c,o,4*a),u=e.shiftPoint(o,i,4*s),u=e.shiftPoint(u,r,4*a),f=e.shiftPoint(i,o,4*s),[l,c,u,f=e.shiftPoint(f,n,4*a)]},e.prototype.isValid=function(t){return t.getX()>=0&&t.getX()0&&t.getY()Math.abs(i-r);if(s){var l=r;r=o,o=l,l=i,i=a,a=l}for(var u=Math.abs(i-r),c=Math.abs(a-o),f=-u/2,d=o0){if(b===a)break;b+=d,f-=u}}return p},e}(),O1=function(){function e(){this.decoder=new _le}return e.prototype.decode=function(t,n){var r,o;if(n===void 0&&(n=null),n!=null&&n.has(Et.PURE_BARCODE)){var i=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decode(i),o=e.NO_POINTS}else{var a=new Ele(t.getBlackMatrix()).detect();r=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=r.getRawBytes(),l=new Ir(r.getText(),s,8*s.length,o,Te.DATA_MATRIX,It.currentTimeMillis()),u=r.getByteSegments();u!=null&&l.putMetadata(Ln.BYTE_SEGMENTS,u);var c=r.getECLevel();return c!=null&&l.putMetadata(Ln.ERROR_CORRECTION_LEVEL,c),l},e.prototype.reset=function(){},e.extractPureBits=function(t){var n=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(n==null||r==null)throw new Y;var o=this.moduleSize(n,t),i=n[1],a=r[1],s=n[0],l=(r[0]-s+1)/o,u=(a-i+1)/o;if(l<=0||u<=0)throw new Y;var c=o/2;i+=c,s+=c;for(var f=new Fi(l,u),d=0;d=e.FOR_BITS.size)throw new Me;return e.FOR_BITS.get(t)},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.L=new e(Ul.L,"L",1),e.M=new e(Ul.M,"M",0),e.Q=new e(Ul.Q,"Q",3),e.H=new e(Ul.H,"H",2),e}(),Ole=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tk=function(){function e(t){this.errorCorrectionLevel=xle.forBits(t>>3&3),this.dataMask=7&t}return e.numBitsDiffering=function(t,n){return Dn.bitCount(t^n)},e.decodeFormatInformation=function(t,n){var r=e.doDecodeFormatInformation(t,n);return r!==null?r:e.doDecodeFormatInformation(t^e.FORMAT_INFO_MASK_QR,n^e.FORMAT_INFO_MASK_QR)},e.doDecodeFormatInformation=function(t,n){var r,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=Ole(e.FORMAT_INFO_DECODE_LOOKUP),l=s.next();!l.done;l=s.next()){var u=l.value,c=u[0];if(c===t||c===n)return new e(u[1]);var f=e.numBitsDiffering(t,c);f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},G=function(){function e(t){for(var n=[],r=1;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},dp=function(){function e(t,n){for(var r,o,i=[],a=2;a40)throw new Me;return e.VERSIONS[t-1]},e.decodeVersionInformation=function(t){for(var n=Number.MAX_SAFE_INTEGER,r=0,o=0;o6&&(n.setRegion(t-11,0,3,6),n.setRegion(0,t-11,6,3)),n},e.prototype.toString=function(){return""+this.versionNumber},e.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),e.VERSIONS=[new e(1,new Int32Array(0),new G(7,new $(1,19)),new G(10,new $(1,16)),new G(13,new $(1,13)),new G(17,new $(1,9))),new e(2,Int32Array.from([6,18]),new G(10,new $(1,34)),new G(16,new $(1,28)),new G(22,new $(1,22)),new G(28,new $(1,16))),new e(3,Int32Array.from([6,22]),new G(15,new $(1,55)),new G(26,new $(1,44)),new G(18,new $(2,17)),new G(22,new $(2,13))),new e(4,Int32Array.from([6,26]),new G(20,new $(1,80)),new G(18,new $(2,32)),new G(26,new $(2,24)),new G(16,new $(4,9))),new e(5,Int32Array.from([6,30]),new G(26,new $(1,108)),new G(24,new $(2,43)),new G(18,new $(2,15),new $(2,16)),new G(22,new $(2,11),new $(2,12))),new e(6,Int32Array.from([6,34]),new G(18,new $(2,68)),new G(16,new $(4,27)),new G(24,new $(4,19)),new G(28,new $(4,15))),new e(7,Int32Array.from([6,22,38]),new G(20,new $(2,78)),new G(18,new $(4,31)),new G(18,new $(2,14),new $(4,15)),new G(26,new $(4,13),new $(1,14))),new e(8,Int32Array.from([6,24,42]),new G(24,new $(2,97)),new G(22,new $(2,38),new $(2,39)),new G(22,new $(4,18),new $(2,19)),new G(26,new $(4,14),new $(2,15))),new e(9,Int32Array.from([6,26,46]),new G(30,new $(2,116)),new G(22,new $(3,36),new $(2,37)),new G(20,new $(4,16),new $(4,17)),new G(24,new $(4,12),new $(4,13))),new e(10,Int32Array.from([6,28,50]),new G(18,new $(2,68),new $(2,69)),new G(26,new $(4,43),new $(1,44)),new G(24,new $(6,19),new $(2,20)),new G(28,new $(6,15),new $(2,16))),new e(11,Int32Array.from([6,30,54]),new G(20,new $(4,81)),new G(30,new $(1,50),new $(4,51)),new G(28,new $(4,22),new $(4,23)),new G(24,new $(3,12),new $(8,13))),new e(12,Int32Array.from([6,32,58]),new G(24,new $(2,92),new $(2,93)),new G(22,new $(6,36),new $(2,37)),new G(26,new $(4,20),new $(6,21)),new G(28,new $(7,14),new $(4,15))),new e(13,Int32Array.from([6,34,62]),new G(26,new $(4,107)),new G(22,new $(8,37),new $(1,38)),new G(24,new $(8,20),new $(4,21)),new G(22,new $(12,11),new $(4,12))),new e(14,Int32Array.from([6,26,46,66]),new G(30,new $(3,115),new $(1,116)),new G(24,new $(4,40),new $(5,41)),new G(20,new $(11,16),new $(5,17)),new G(24,new $(11,12),new $(5,13))),new e(15,Int32Array.from([6,26,48,70]),new G(22,new $(5,87),new $(1,88)),new G(24,new $(5,41),new $(5,42)),new G(30,new $(5,24),new $(7,25)),new G(24,new $(11,12),new $(7,13))),new e(16,Int32Array.from([6,26,50,74]),new G(24,new $(5,98),new $(1,99)),new G(28,new $(7,45),new $(3,46)),new G(24,new $(15,19),new $(2,20)),new G(30,new $(3,15),new $(13,16))),new e(17,Int32Array.from([6,30,54,78]),new G(28,new $(1,107),new $(5,108)),new G(28,new $(10,46),new $(1,47)),new G(28,new $(1,22),new $(15,23)),new G(28,new $(2,14),new $(17,15))),new e(18,Int32Array.from([6,30,56,82]),new G(30,new $(5,120),new $(1,121)),new G(26,new $(9,43),new $(4,44)),new G(28,new $(17,22),new $(1,23)),new G(28,new $(2,14),new $(19,15))),new e(19,Int32Array.from([6,30,58,86]),new G(28,new $(3,113),new $(4,114)),new G(26,new $(3,44),new $(11,45)),new G(26,new $(17,21),new $(4,22)),new G(26,new $(9,13),new $(16,14))),new e(20,Int32Array.from([6,34,62,90]),new G(28,new $(3,107),new $(5,108)),new G(26,new $(3,41),new $(13,42)),new G(30,new $(15,24),new $(5,25)),new G(28,new $(15,15),new $(10,16))),new e(21,Int32Array.from([6,28,50,72,94]),new G(28,new $(4,116),new $(4,117)),new G(26,new $(17,42)),new G(28,new $(17,22),new $(6,23)),new G(30,new $(19,16),new $(6,17))),new e(22,Int32Array.from([6,26,50,74,98]),new G(28,new $(2,111),new $(7,112)),new G(28,new $(17,46)),new G(30,new $(7,24),new $(16,25)),new G(24,new $(34,13))),new e(23,Int32Array.from([6,30,54,78,102]),new G(30,new $(4,121),new $(5,122)),new G(28,new $(4,47),new $(14,48)),new G(30,new $(11,24),new $(14,25)),new G(30,new $(16,15),new $(14,16))),new e(24,Int32Array.from([6,28,54,80,106]),new G(30,new $(6,117),new $(4,118)),new G(28,new $(6,45),new $(14,46)),new G(30,new $(11,24),new $(16,25)),new G(30,new $(30,16),new $(2,17))),new e(25,Int32Array.from([6,32,58,84,110]),new G(26,new $(8,106),new $(4,107)),new G(28,new $(8,47),new $(13,48)),new G(30,new $(7,24),new $(22,25)),new G(30,new $(22,15),new $(13,16))),new e(26,Int32Array.from([6,30,58,86,114]),new G(28,new $(10,114),new $(2,115)),new G(28,new $(19,46),new $(4,47)),new G(28,new $(28,22),new $(6,23)),new G(30,new $(33,16),new $(4,17))),new e(27,Int32Array.from([6,34,62,90,118]),new G(30,new $(8,122),new $(4,123)),new G(28,new $(22,45),new $(3,46)),new G(30,new $(8,23),new $(26,24)),new G(30,new $(12,15),new $(28,16))),new e(28,Int32Array.from([6,26,50,74,98,122]),new G(30,new $(3,117),new $(10,118)),new G(28,new $(3,45),new $(23,46)),new G(30,new $(4,24),new $(31,25)),new G(30,new $(11,15),new $(31,16))),new e(29,Int32Array.from([6,30,54,78,102,126]),new G(30,new $(7,116),new $(7,117)),new G(28,new $(21,45),new $(7,46)),new G(30,new $(1,23),new $(37,24)),new G(30,new $(19,15),new $(26,16))),new e(30,Int32Array.from([6,26,52,78,104,130]),new G(30,new $(5,115),new $(10,116)),new G(28,new $(19,47),new $(10,48)),new G(30,new $(15,24),new $(25,25)),new G(30,new $(23,15),new $(25,16))),new e(31,Int32Array.from([6,30,56,82,108,134]),new G(30,new $(13,115),new $(3,116)),new G(28,new $(2,46),new $(29,47)),new G(30,new $(42,24),new $(1,25)),new G(30,new $(23,15),new $(28,16))),new e(32,Int32Array.from([6,34,60,86,112,138]),new G(30,new $(17,115)),new G(28,new $(10,46),new $(23,47)),new G(30,new $(10,24),new $(35,25)),new G(30,new $(19,15),new $(35,16))),new e(33,Int32Array.from([6,30,58,86,114,142]),new G(30,new $(17,115),new $(1,116)),new G(28,new $(14,46),new $(21,47)),new G(30,new $(29,24),new $(19,25)),new G(30,new $(11,15),new $(46,16))),new e(34,Int32Array.from([6,34,62,90,118,146]),new G(30,new $(13,115),new $(6,116)),new G(28,new $(14,46),new $(23,47)),new G(30,new $(44,24),new $(7,25)),new G(30,new $(59,16),new $(1,17))),new e(35,Int32Array.from([6,30,54,78,102,126,150]),new G(30,new $(12,121),new $(7,122)),new G(28,new $(12,47),new $(26,48)),new G(30,new $(39,24),new $(14,25)),new G(30,new $(22,15),new $(41,16))),new e(36,Int32Array.from([6,24,50,76,102,128,154]),new G(30,new $(6,121),new $(14,122)),new G(28,new $(6,47),new $(34,48)),new G(30,new $(46,24),new $(10,25)),new G(30,new $(2,15),new $(64,16))),new e(37,Int32Array.from([6,28,54,80,106,132,158]),new G(30,new $(17,122),new $(4,123)),new G(28,new $(29,46),new $(14,47)),new G(30,new $(49,24),new $(10,25)),new G(30,new $(24,15),new $(46,16))),new e(38,Int32Array.from([6,32,58,84,110,136,162]),new G(30,new $(4,122),new $(18,123)),new G(28,new $(13,46),new $(32,47)),new G(30,new $(48,24),new $(14,25)),new G(30,new $(42,15),new $(32,16))),new e(39,Int32Array.from([6,26,54,82,110,138,166]),new G(30,new $(20,117),new $(4,118)),new G(28,new $(40,47),new $(7,48)),new G(30,new $(43,24),new $(22,25)),new G(30,new $(10,15),new $(67,16))),new e(40,Int32Array.from([6,30,58,86,114,142,170]),new G(30,new $(19,118),new $(6,119)),new G(28,new $(18,47),new $(31,48)),new G(30,new $(34,24),new $(34,25)),new G(30,new $(20,15),new $(61,16)))],e}();(function(e){e[e.DATA_MASK_000=0]="DATA_MASK_000",e[e.DATA_MASK_001=1]="DATA_MASK_001",e[e.DATA_MASK_010=2]="DATA_MASK_010",e[e.DATA_MASK_011=3]="DATA_MASK_011",e[e.DATA_MASK_100=4]="DATA_MASK_100",e[e.DATA_MASK_101=5]="DATA_MASK_101",e[e.DATA_MASK_110=6]="DATA_MASK_110",e[e.DATA_MASK_111=7]="DATA_MASK_111"})(yn||(yn={}));var so,j4=function(){function e(t,n){this.value=t,this.isMasked=n}return e.prototype.unmaskBitMatrix=function(t,n){for(var r=0;r=0;r--)t=this.copyBit(8,r,t);var o=this.bitMatrix.getHeight(),i=0,a=o-7;for(r=o-1;r>=a;r--)i=this.copyBit(8,r,i);for(n=o-8;n=0;i--)for(var a=t-9;a>=o;a--)r=this.copyBit(a,i,r);var s=dp.decodeVersionInformation(r);if(s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;for(r=0,a=5;a>=0;a--)for(i=t-9;i>=o;i--)r=this.copyBit(a,i,r);if((s=dp.decodeVersionInformation(r))!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;throw new ae},e.prototype.copyBit=function(t,n,r){return(this.isMirror?this.bitMatrix.get(n,t):this.bitMatrix.get(t,n))?r<<1|1:r<<1},e.prototype.readCodewords=function(){var t=this.readFormatInformation(),n=this.readVersion(),r=j4.values.get(t.getDataMask()),o=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,o);for(var i=n.buildFunctionPattern(),a=!0,s=new Uint8Array(n.getTotalCodewords()),l=0,u=0,c=0,f=o-1;f>0;f-=2){f===6&&f--;for(var d=0;d=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ile=function(){function e(t,n){this.numDataCodewords=t,this.codewords=n}return e.getDataBlocks=function(t,n,r){var o,i,a,s;if(t.length!==n.getTotalCodewords())throw new Me;var l=n.getECBlocksForLevel(r),u=0,c=l.getECBlocks();try{for(var f=F4(c),d=f.next();!d.done;d=f.next())u+=(b=d.value).getCount()}catch(I){o={error:I}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var h=new Array(u),p=0;try{for(var m=F4(c),_=m.next();!_.done;_=m.next())for(var b=_.value,g=0;g=0&&h[A].codewords.length!==O;)A--;A++;var C=O-l.getECCodewordsPerBlock(),y=0;for(g=0;gt.available())throw new ae;for(var o=new Uint8Array(2*r),i=0;r>0;){var a=t.readBits(13),s=a/96<<8&4294967295|a%96;s+=s<959?41377:42657,o[i]=s>>8&255,o[i+1]=255&s,i+=2,r--}try{n.append(Is.decode(o,gn.GB2312))}catch(l){throw new ae(l)}},e.decodeKanjiSegment=function(t,n,r){if(13*r>t.available())throw new ae;for(var o=new Uint8Array(2*r),i=0;r>0;){var a=t.readBits(13),s=a/192<<8&4294967295|a%192;s+=s<7936?33088:49472,o[i]=s>>8,o[i+1]=s,i+=2,r--}try{n.append(Is.decode(o,gn.SHIFT_JIS))}catch(l){throw new ae(l)}},e.decodeByteSegment=function(t,n,r,o,i,a){if(8*r>t.available())throw new ae;for(var s,l=new Uint8Array(r),u=0;u=e.ALPHANUMERIC_CHARS.length)throw new ae;return e.ALPHANUMERIC_CHARS[t]},e.decodeAlphanumericSegment=function(t,n,r,o){for(var i=n.length();r>1;){if(t.available()<11)throw new ae;var a=t.readBits(11);n.append(e.toAlphaNumericChar(Math.floor(a/45))),n.append(e.toAlphaNumericChar(a%45)),r-=2}if(r===1){if(t.available()<6)throw new ae;n.append(e.toAlphaNumericChar(t.readBits(6)))}if(o)for(var s=i;s=3;){if(t.available()<10)throw new ae;var o=t.readBits(10);if(o>=1e3)throw new ae;n.append(e.toAlphaNumericChar(Math.floor(o/100))),n.append(e.toAlphaNumericChar(Math.floor(o/10)%10)),n.append(e.toAlphaNumericChar(o%10)),r-=3}if(r===2){if(t.available()<7)throw new ae;var i=t.readBits(7);if(i>=100)throw new ae;n.append(e.toAlphaNumericChar(Math.floor(i/10))),n.append(e.toAlphaNumericChar(i%10))}else if(r===1){if(t.available()<4)throw new ae;var a=t.readBits(4);if(a>=10)throw new ae;n.append(e.toAlphaNumericChar(a))}},e.parseECIValue=function(t){var n=t.readBits(8);if(!(128&n))return 127&n;if((192&n)==128)return(63&n)<<8&4294967295|t.readBits(8);if((224&n)==192)return(31&n)<<16&4294967295|t.readBits(16);throw new ae},e.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.GB2312_SUBSET=1,e}(),Ik=function(){function e(t){this.mirrored=t}return e.prototype.isMirrored=function(){return this.mirrored},e.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&t!==null&&!(t.length<3)){var n=t[0];t[0]=t[2],t[2]=n}},e}(),$4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},kle=function(){function e(){this.rsDecoder=new xm(ha.QR_CODE_FIELD_256)}return e.prototype.decodeBooleanArray=function(t,n){return this.decodeBitMatrix(Fi.parseFromBooleanArray(t),n)},e.prototype.decodeBitMatrix=function(t,n){var r=new Tle(t),o=null;try{return this.decodeBitMatrixParser(r,n)}catch(a){o=a}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var i=this.decodeBitMatrixParser(r,n);return i.setOther(new Ik(!0)),i}catch(a){throw o!==null?o:a}},e.prototype.decodeBitMatrixParser=function(t,n){var r,o,i,a,s=t.readVersion(),l=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),c=Ile.getDataBlocks(u,s,l),f=0;try{for(var d=$4(c),h=d.next();!h.done;h=d.next())f+=(g=h.value).getNumDataCodewords()}catch(A){r={error:A}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}var p=new Uint8Array(f),m=0;try{for(var _=$4(c),b=_.next();!b.done;b=_.next()){var g,E=(g=b.value).getCodewords(),T=g.getNumDataCodewords();this.correctErrors(E,T);for(var O=0;O=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Nle=function(){function e(t,n,r,o,i,a,s){this.image=t,this.startX=n,this.startY=r,this.width=o,this.height=i,this.moduleSize=a,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return e.prototype.find=function(){for(var t=this.startX,n=this.height,r=t+this.width,o=this.startY+n/2,i=new Int32Array(3),a=this.image,s=0;s=r)return!1;return!0},e.prototype.crossCheckVertical=function(t,n,r,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var l=t;l>=0&&i.get(n,l)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&!i.get(n,l)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=t+1;lr)return NaN;for(;lr)return NaN;var u=s[0]+s[1]+s[2];return 5*Math.abs(u-o)>=2*o?NaN:this.foundPatternCross(s)?e.centerFromEnd(s,l):NaN},e.prototype.handlePossibleCenter=function(t,n,r){var o,i,a=t[0]+t[1]+t[2],s=e.centerFromEnd(t,r),l=this.crossCheckVertical(n,s,2*t[1],a);if(!isNaN(l)){var u=(t[0]+t[1]+t[2])/3;try{for(var c=Lle(this.possibleCenters),f=c.next();!f.done;f=c.next()){var d=f.value;if(d.aboutEquals(u,l,s))return d.combineEstimate(l,s,u)}}catch(p){o={error:p}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}var h=new Dle(s,l,u);this.possibleCenters.push(h),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(h)}return null},e}(),Ble=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jle=function(e){function t(n,r,o,i){var a=e.call(this,n,r)||this;return a.estimatedModuleSize=o,a.count=i,i===void 0&&(a.count=1),a}return Ble(t,e),t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(n,r,o){if(Math.abs(r-this.getY())<=n&&Math.abs(o-this.getX())<=n){var i=Math.abs(n-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(n,r,o){var i=this.count+1;return new t((this.count*this.getX()+r)/i,(this.count*this.getY()+n)/i,(this.count*this.estimatedModuleSize+o)/i,i)},t}(we),Fle=function(){function e(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e}(),cc=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$le=function(){function e(t,n){this.image=t,this.resultPointCallback=n,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=n}return e.prototype.getImage=function(){return this.image},e.prototype.getPossibleCenters=function(){return this.possibleCenters},e.prototype.find=function(t){var n=t!=null&&t.get(Et.TRY_HARDER)!==void 0,r=t!=null&&t.get(Et.PURE_BARCODE)!==void 0,o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*e.MAX_MODULES));(su[2]&&(c+=h-u[2]-s,d=a-1)}f=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,f=3;else u[++f]++;e.foundPatternCross(u)&&this.handlePossibleCenter(u,c,a,r)===!0&&(s=u[0],this.hasSkipped&&(l=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return we.orderBestPatterns(p),new Fle(p)},e.centerFromEnd=function(t,n){return n-t[4]-t[3]-t[2]/2},e.foundPatternCross=function(t){for(var n=0,r=0;r<5;r++){var o=t[r];if(o===0)return!1;n+=o}if(n<7)return!1;var i=n/7,a=i/2;return Math.abs(i-t[0])=a&&n>=a&&s.get(n-a,t-a);)i[2]++,a++;if(t=a&&n>=a&&!s.get(n-a,t-a)&&i[1]<=r;)i[1]++,a++;if(tr)return!1;for(;t>=a&&n>=a&&s.get(n-a,t-a)&&i[0]<=r;)i[0]++,a++;if(i[0]>r)return!1;var l=s.getHeight(),u=s.getWidth();for(a=1;t+a=l||n+a>=u)return!1;for(;t+a=l||n+a>=u||i[3]>=r)return!1;for(;t+a=r)return!1;var c=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(c-o)<2*o&&e.foundPatternCross(i)},e.prototype.crossCheckVertical=function(t,n,r,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),l=t;l>=0&&i.get(n,l);)s[2]++,l--;if(l<0)return NaN;for(;l>=0&&!i.get(n,l)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&i.get(n,l)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=t+1;l=r)return NaN;for(;l=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=2*o?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,l):NaN},e.prototype.crossCheckHorizontal=function(t,n,r,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),l=t;l>=0&&i.get(l,n);)s[2]++,l--;if(l<0)return NaN;for(;l>=0&&!i.get(l,n)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&i.get(l,n)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=t+1;l=r)return NaN;for(;l=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=o?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,l):NaN},e.prototype.handlePossibleCenter=function(t,n,r,o){var i=t[0]+t[1]+t[2]+t[3]+t[4],a=e.centerFromEnd(t,r),s=this.crossCheckVertical(n,Math.floor(a),t[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),t[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),t[2],i)))){for(var l=i/7,u=!1,c=this.possibleCenters,f=0,d=c.length;f=e.CENTER_QUORUM){if(r!=null)return this.hasSkipped=!0,Math.floor((Math.abs(r.getX()-a.getX())-Math.abs(r.getY()-a.getY()))/2);r=a}}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return 0},e.prototype.haveMultiplyConfirmedCenters=function(){var t,n,r,o,i=0,a=0,s=this.possibleCenters.length;try{for(var l=cc(this.possibleCenters),u=l.next();!u.done;u=l.next())(p=u.value).getCount()>=e.CENTER_QUORUM&&(i++,a+=p.getEstimatedModuleSize())}catch(m){t={error:m}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}if(i<3)return!1;var c=a/s,f=0;try{for(var d=cc(this.possibleCenters),h=d.next();!h.done;h=d.next()){var p=h.value;f+=Math.abs(p.getEstimatedModuleSize()-c)}}catch(m){r={error:m}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}return f<=.05*a},e.prototype.selectBestPatterns=function(){var t,n,r,o,i=this.possibleCenters.length;if(i<3)throw new Y;var a,s=this.possibleCenters;if(i>3){var l=0,u=0;try{for(var c=cc(this.possibleCenters),f=c.next();!f.done;f=c.next()){var d=f.value.getEstimatedModuleSize();l+=d,u+=d*d}}catch(E){t={error:E}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}a=l/i;var h=Math.sqrt(u/i-a*a);s.sort(function(E,T){var O=Math.abs(T.getEstimatedModuleSize()-a),A=Math.abs(E.getEstimatedModuleSize()-a);return OA?1:0});for(var p=Math.max(.2*a,h),m=0;m3;m++){var _=s[m];Math.abs(_.getEstimatedModuleSize()-a)>p&&(s.splice(m,1),m--)}}if(s.length>3){l=0;try{for(var b=cc(s),g=b.next();!g.done;g=b.next())l+=g.value.getEstimatedModuleSize()}catch(E){r={error:E}}finally{try{g&&!g.done&&(o=b.return)&&o.call(b)}finally{if(r)throw r.error}}a=l/s.length,s.sort(function(E,T){if(T.getCount()===E.getCount()){var O=Math.abs(T.getEstimatedModuleSize()-a),A=Math.abs(E.getEstimatedModuleSize()-a);return OA?-1:0}return T.getCount()-E.getCount()}),s.splice(3)}return[s[0],s[1],s[2]]},e.CENTER_QUORUM=2,e.MIN_SKIP=3,e.MAX_MODULES=57,e}(),zle=function(){function e(t){this.image=t}return e.prototype.getImage=function(){return this.image},e.prototype.getResultPointCallback=function(){return this.resultPointCallback},e.prototype.detect=function(t){this.resultPointCallback=t==null?null:t.get(Et.NEED_RESULT_POINT_CALLBACK);var n=new $le(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(n)},e.prototype.processFinderPatternInfo=function(t){var n=t.getTopLeft(),r=t.getTopRight(),o=t.getBottomLeft(),i=this.calculateModuleSize(n,r,o);if(i<1)throw new Y("No pattern found in proccess finder.");var a=e.computeDimension(n,r,o,i),s=dp.getProvisionalVersionForDimension(a),l=s.getDimensionForVersion()-7,u=null;if(s.getAlignmentPatternCenters().length>0)for(var c=r.getX()-n.getX()+o.getX(),f=r.getY()-n.getY()+o.getY(),d=1-3/l,h=Math.floor(n.getX()+d*(c-n.getX())),p=Math.floor(n.getY()+d*(f-n.getY())),m=4;m<=16;m<<=1)try{u=this.findAlignmentInRegion(i,h,p,m);break}catch(g){if(!(g instanceof Y))throw g}var _=e.createTransform(n,r,o,u,a),b=e.sampleGrid(this.image,_,a);return new m_(b,u===null?[o,n,r]:[o,n,r,u])},e.createTransform=function(t,n,r,o,i){var a,s,l,u,c=i-3.5;return o!==null?(a=o.getX(),s=o.getY(),u=l=c-3):(a=n.getX()-t.getX()+r.getX(),s=n.getY()-t.getY()+r.getY(),l=c,u=c),Ck.quadrilateralToQuadrilateral(3.5,3.5,c,3.5,l,u,3.5,c,t.getX(),t.getY(),n.getX(),n.getY(),a,s,r.getX(),r.getY())},e.sampleGrid=function(t,n,r){return y_.getInstance().sampleGridWithTransform(t,r,r,n)},e.computeDimension=function(t,n,r,o){var i=Ze.round(we.distance(t,n)/o),a=Ze.round(we.distance(t,r)/o),s=Math.floor((i+a)/2)+7;switch(3&s){case 0:s++;break;case 2:s--;break;case 3:throw new Y("Dimensions could be not found.")}return s},e.prototype.calculateModuleSize=function(t,n,r){return(this.calculateModuleSizeOneWay(t,n)+this.calculateModuleSizeOneWay(t,r))/2},e.prototype.calculateModuleSizeOneWay=function(t,n){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(n.getX()),Math.floor(n.getY())),o=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()),Math.floor(n.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(r)?o/7:isNaN(o)?r/7:(r+o)/14},e.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,n,r,o){var i=this.sizeOfBlackWhiteBlackRun(t,n,r,o),a=1,s=t-(r-t);s<0?(a=t/(t-s),s=0):s>=this.image.getWidth()&&(a=(this.image.getWidth()-1-t)/(s-t),s=this.image.getWidth()-1);var l=Math.floor(n-(o-n)*a);return a=1,l<0?(a=n/(n-l),l=0):l>=this.image.getHeight()&&(a=(this.image.getHeight()-1-n)/(l-n),l=this.image.getHeight()-1),s=Math.floor(t+(s-t)*a),(i+=this.sizeOfBlackWhiteBlackRun(t,n,s,l))-1},e.prototype.sizeOfBlackWhiteBlackRun=function(t,n,r,o){var i=Math.abs(o-n)>Math.abs(r-t);if(i){var a=t;t=n,n=a,a=r,r=o,o=a}for(var s=Math.abs(r-t),l=Math.abs(o-n),u=-s/2,c=t0){if(m===o)break;m+=f,u-=s}}return d===2?Ze.distance(r+c,o,t,n):NaN},e.prototype.findAlignmentInRegion=function(t,n,r,o){var i=Math.floor(o*t),a=Math.max(0,n-i),s=Math.min(this.image.getWidth()-1,n+i);if(s-a<3*t)throw new Y("Alignment top exceeds estimated module size.");var l=Math.max(0,r-i),u=Math.min(this.image.getHeight()-1,r+i);if(u-l<3*t)throw new Y("Alignment bottom exceeds estimated module size.");return new Nle(this.image,a,l,s-a,u-l,t,this.resultPointCallback).find()},e}(),A1=function(){function e(){this.decoder=new kle}return e.prototype.getDecoder=function(){return this.decoder},e.prototype.decode=function(t,n){var r,o;if(n!=null&&n.get(Et.PURE_BARCODE)!==void 0){var i=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decodeBitMatrix(i,n),o=e.NO_POINTS}else{var a=new zle(t.getBlackMatrix()).detect(n);r=this.decoder.decodeBitMatrix(a.getBits(),n),o=a.getPoints()}r.getOther()instanceof Ik&&r.getOther().applyMirroredCorrection(o);var s=new Ir(r.getText(),r.getRawBytes(),void 0,o,Te.QR_CODE,void 0),l=r.getByteSegments();l!==null&&s.putMetadata(Ln.BYTE_SEGMENTS,l);var u=r.getECLevel();return u!==null&&s.putMetadata(Ln.ERROR_CORRECTION_LEVEL,u),r.hasStructuredAppend()&&(s.putMetadata(Ln.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),s.putMetadata(Ln.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),s},e.prototype.reset=function(){},e.extractPureBits=function(t){var n=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(n===null||r===null)throw new Y;var o=this.moduleSize(n,t),i=n[1],a=r[1],s=n[0],l=r[0];if(s>=l||i>=a)throw new Y;if(a-i!=l-s&&(l=s+(a-i))>=t.getWidth())throw new Y;var u=Math.round((l-s+1)/o),c=Math.round((a-i+1)/o);if(u<=0||c<=0)throw new Y;if(c!==u)throw new Y;var f=Math.floor(o/2);i+=f;var d=(s+=f)+Math.floor((u-1)*o)-l;if(d>0){if(d>f)throw new Y;s-=d}var h=i+Math.floor((c-1)*o)-a;if(h>0){if(h>f)throw new Y;i-=h}for(var p=new Fi(u,c),m=0;m=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ke=function(){function e(){}return e.prototype.PDF417Common=function(){},e.getBitCountSum=function(t){return Ze.sum(t)},e.toIntArray=function(t){var n,r;if(t==null||!t.length)return e.EMPTY_INT_ARRAY;var o=new Int32Array(t.length),i=0;try{for(var a=Ule(t),s=a.next();!s.done;s=a.next()){var l=s.value;o[i++]=l}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},e.getCodeword=function(t){var n=Gr.binarySearch(e.SYMBOL_TABLE,262143&t);return n<0?-1:(e.CODEWORD_TABLE[n]-1)%e.NUMBER_OF_CODEWORDS},e.NUMBER_OF_CODEWORDS=929,e.MAX_CODEWORDS_IN_BARCODE=e.NUMBER_OF_CODEWORDS-1,e.MIN_ROWS_IN_BARCODE=3,e.MAX_ROWS_IN_BARCODE=90,e.MODULES_IN_CODEWORD=17,e.MODULES_IN_STOP_PATTERN=18,e.BARS_IN_MODULE=8,e.EMPTY_INT_ARRAY=new Int32Array([]),e.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),e.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),e}(),Vle=function(){function e(t,n){this.bits=t,this.points=n}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),Hle=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wle=function(){function e(){}return e.detectMultiple=function(t,n,r){var o=t.getBlackMatrix(),i=e.detect(r,o);return i.length||((o=o.clone()).rotate180(),i=e.detect(r,o)),new Vle(o,i)},e.detect=function(t,n){for(var r,o,i=new Array,a=0,s=0,l=!1;a0;){if((d=e.findGuardPattern(t,i,--o,r,!1,a,u))==null){o++;break}h=d}s[0]=new we(h[0],o),s[1]=new we(h[1],o),l=!0;break}var c=o+1;if(l){for(var f=0,d=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);ce.SKIPPED_ROW_COUNT_MAX)break;f++}}c-=f+1,s[2]=new we(d[0],c),s[3]=new we(d[1],c)}return c-o0&&u++d?f-d:d-f;if(h>r)return 1/0;u+=h}return u/i},e.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),e.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),e.MAX_AVG_VARIANCE=.42,e.MAX_INDIVIDUAL_VARIANCE=.8,e.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),e.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),e.MAX_PIXEL_DRIFT=3,e.MAX_PATTERN_DRIFT=5,e.SKIPPED_ROW_COUNT_MAX=25,e.ROW_STEP=5,e.BARCODE_MIN_HEIGHT=10,e}(),Gle=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vs=function(){function e(t,n){if(n.length===0)throw new Me;this.field=t;var r=n.length;if(r>1&&n[0]===0){for(var o=1;or.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;It.arraycopy(r,0,i,0,a);for(var s=a;s=0;n--){var r=this.getCoefficient(n);r!==0&&(r<0?(t.append(" - "),r=-r):t.length()>0&&t.append(" + "),n!==0&&r===1||t.append(r),n!==0&&(n===1?t.append("x"):(t.append("x^"),t.append(n))))}return t.toString()},e}(),Kle=function(){function e(){}return e.prototype.add=function(t,n){return(t+n)%this.modulus},e.prototype.subtract=function(t,n){return(this.modulus+t-n)%this.modulus},e.prototype.exp=function(t){return this.expTable[t]},e.prototype.log=function(t){if(t===0)throw new Me;return this.logTable[t]},e.prototype.inverse=function(t){if(t===0)throw new Ek;return this.expTable[this.modulus-this.logTable[t]-1]},e.prototype.multiply=function(t,n){return t===0||n===0?0:this.expTable[(this.logTable[t]+this.logTable[n])%(this.modulus-1)]},e.prototype.getSize=function(){return this.modulus},e.prototype.equals=function(t){return t===this},e}(),Xle=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qle=function(e){function t(n,r){var o=e.call(this)||this;o.modulus=n,o.expTable=new Int32Array(n),o.logTable=new Int32Array(n);for(var i=1,a=0;a=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Zle=function(){function e(){this.field=qle.PDF417_GF}return e.prototype.decode=function(t,n,r){for(var o,i,a=new vs(this.field,t),s=new Int32Array(n),l=!1,u=n;u>0;u--){var c=a.evaluateAt(this.field.exp(u));s[n-u]=c,c!==0&&(l=!0)}if(!l)return 0;var f=this.field.getOne();if(r!=null)try{for(var d=Yle(r),h=d.next();!h.done;h=d.next()){var p=h.value,m=this.field.exp(t.length-1-p),_=new vs(this.field,new Int32Array([this.field.subtract(0,m),1]));f=f.multiply(_)}}catch(y){o={error:y}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}var b=new vs(this.field,s),g=this.runEuclideanAlgorithm(this.field.buildMonomial(n,1),b,n),E=g[0],T=g[1],O=this.findErrorLocations(E),A=this.findErrorMagnitudes(T,E,O);for(u=0;u=Math.round(r/2);){var u=i,c=s;if(s=l,(i=a).isZero())throw hn.getChecksumInstance();a=u;for(var f=this.field.getZero(),d=i.getCoefficient(i.getDegree()),h=this.field.inverse(d);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),m=this.field.multiply(a.getCoefficient(a.getDegree()),h);f=f.add(this.field.buildMonomial(p,m)),a=a.subtract(i.multiplyByMonomial(p,m))}l=f.multiply(s).subtract(c).negative()}var _=l.getCoefficient(0);if(_===0)throw hn.getChecksumInstance();var b=this.field.inverse(_);return[l.multiply(b),a.multiply(b)]},e.prototype.findErrorLocations=function(t){for(var n=t.getDegree(),r=new Int32Array(n),o=0,i=1;i0){var l=r?this.topLeft:this.topRight,u=Math.trunc(l.getY()-t);u<0&&(u=0);var c=new we(l.getX(),u);r?o=c:a=c}if(n>0){var f=r?this.bottomLeft:this.bottomRight,d=Math.trunc(f.getY()+n);d>=this.image.getHeight()&&(d=this.image.getHeight()-1);var h=new we(f.getX(),d);r?i=h:s=h}return new e(this.image,o,i,a,s)},e.prototype.getMinX=function(){return this.minX},e.prototype.getMaxX=function(){return this.maxX},e.prototype.getMinY=function(){return this.minY},e.prototype.getMaxY=function(){return this.maxY},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getBottomRight=function(){return this.bottomRight},e}(),Qle=function(){function e(t,n,r,o){this.columnCount=t,this.errorCorrectionLevel=o,this.rowCountUpperPart=n,this.rowCountLowerPart=r,this.rowCount=n+r}return e.prototype.getColumnCount=function(){return this.columnCount},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},e.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},e}(),v_=function(){function e(){this.buffer=""}return e.form=function(t,n){var r=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(o,i,a,s,l,u){if(o==="%%")return"%";if(n[++r]!==void 0){o=s?parseInt(s.substr(1)):void 0;var c,f=l?parseInt(l.substr(1)):void 0;switch(u){case"s":c=n[r];break;case"c":c=n[r][0];break;case"f":c=parseFloat(n[r]).toFixed(o);break;case"p":c=parseFloat(n[r]).toPrecision(o);break;case"e":c=parseFloat(n[r]).toExponential(o);break;case"x":c=parseInt(n[r]).toString(f||16);break;case"d":c=parseFloat(parseInt(n[r],f||10).toPrecision(o)).toFixed(0)}c=typeof c=="object"?JSON.stringify(c):(+c).toString(f);for(var d=parseInt(a),h=a&&a[0]+""=="0"?"0":" ";c.length=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Rk=function(){function e(t){this.boundingBox=new fw(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return e.prototype.getCodewordNearby=function(t){var n=this.getCodeword(t);if(n!=null)return n;for(var r=1;r=0&&(n=this.codewords[o])!=null||(o=this.imageRowToCodewordIndex(t)+r)=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tue=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Pc=function(){function e(){this.values=new Map}return e.prototype.setValue=function(t){t=Math.trunc(t);var n=this.values.get(t);n==null&&(n=0),n++,this.values.set(t,n)},e.prototype.getValue=function(){var t,n,r=-1,o=new Array,i=function(u,c){var f=function(){return u},d=function(){return c};d()>r?(r=d(),(o=[]).push(f())):d()===r&&o.push(f())};try{for(var a=eue(this.values.entries()),s=a.next();!s.done;s=a.next()){var l=tue(s.value,2);i(l[0],l[1])}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return Ke.toIntArray(o)},e.prototype.getConfidence=function(t){return this.values.get(t)},e}(),nue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cg=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},z4=function(e){function t(n,r){var o=e.call(this,n)||this;return o._isLeft=r,o}return nue(t,e),t.prototype.setRowNumbers=function(){var n,r;try{for(var o=Cg(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;a!=null&&a.setRowNumberAsRowIndicatorColumn()}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(n){var r=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(r,n);for(var o=this.getBoundingBox(),i=this._isLeft?o.getTopLeft():o.getTopRight(),a=this._isLeft?o.getBottomLeft():o.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),l=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=-1,c=1,f=0,d=s;d=n.getRowCount()||p>d)r[d]=null;else{for(var m=void 0,_=(m=c>2?(c-2)*p:p)>=d,b=1;b<=m&&!_;b++)_=r[d-b]!=null;_?r[d]=null:(u=h.getRowNumber(),f=1)}}},t.prototype.getRowHeights=function(){var n,r,o=this.getBarcodeMetadata();if(o==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(o);var i=new Int32Array(o.getRowCount());try{for(var a=Cg(this.getCodewords()),s=a.next();!s.done;s=a.next()){var l=s.value;if(l!=null){var u=l.getRowNumber();if(u>=i.length)continue;i[u]++}}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(n){for(var r=this.getBoundingBox(),o=this._isLeft?r.getTopLeft():r.getTopRight(),i=this._isLeft?r.getBottomLeft():r.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),l=this.getCodewords(),u=-1,c=a;c=n.getRowCount()?l[c]=null:u=f.getRowNumber())}},t.prototype.getBarcodeMetadata=function(){var n,r,o=this.getCodewords(),i=new Pc,a=new Pc,s=new Pc,l=new Pc;try{for(var u=Cg(o),c=u.next();!c.done;c=u.next()){var f=c.value;if(f!=null){f.setRowNumberAsRowIndicatorColumn();var d=f.getValue()%30,h=f.getRowNumber();switch(this._isLeft||(h+=2),h%3){case 0:a.setValue(3*d+1);break;case 1:l.setValue(d/3),s.setValue(d%3);break;case 2:i.setValue(d+1)}}}}catch(m){n={error:m}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(i.getValue().length===0||a.getValue().length===0||s.getValue().length===0||l.getValue().length===0||i.getValue()[0]<1||a.getValue()[0]+s.getValue()[0]Ke.MAX_ROWS_IN_BARCODE)return null;var p=new Qle(i.getValue()[0],a.getValue()[0],s.getValue()[0],l.getValue()[0]);return this.removeIncorrectCodewords(o,p),p},t.prototype.removeIncorrectCodewords=function(n,r){for(var o=0;or.getRowCount())n[o]=null;else switch(this._isLeft||(s+=2),s%3){case 0:3*a+1!==r.getRowCountUpperPart()&&(n[o]=null);break;case 1:Math.trunc(a/3)===r.getErrorCorrectionLevel()&&a%3===r.getRowCountLowerPart()||(n[o]=null);break;case 2:a+1!==r.getColumnCount()&&(n[o]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+` -`+e.prototype.toString.call(this)},t}(Rk),rue=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},oue=function(){function e(t,n){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=n,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return e.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t,n=Ke.MAX_CODEWORDS_IN_BARCODE;do t=n,n=this.adjustRowNumbersAndGetCount();while(n>0&&n0&&i0&&(u[0]=r[n-1],u[4]=s[n-1],u[5]=l[n-1]),n>1&&(u[8]=r[n-2],u[10]=s[n-2],u[11]=l[n-2]),n>=1;r=1&n,e.RATIOS_TABLE[t]||(e.RATIOS_TABLE[t]=new Array(Ke.BARS_IN_MODULE)),e.RATIOS_TABLE[t][Ke.BARS_IN_MODULE-o-1]=Math.fround(i/Ke.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},e.getDecodedValue=function(t){var n=e.getDecodedCodewordValue(e.sampleBitCounts(t));return n!==-1?n:e.getClosestDecodedValue(t)},e.sampleBitCounts=function(t){for(var n=Ze.sum(t),r=new Int32Array(Ke.BARS_IN_MODULE),o=0,i=0,a=0;a1)for(var o=0;o=i)break}lt.length||r<0||n+r>t.length||n+r<0)throw new p_;if(r!==0)for(var o=0;o0&&this.grow(n)},t.prototype.grow=function(n){var r=this.buf.length<<1;if(r-n<0&&(r=n),r<0){if(n<0)throw new due;r=Dn.MAX_VALUE}this.buf=Gr.copyOfUint8Array(this.buf,r)},t.prototype.write=function(n){this.ensureCapacity(this.count+1),this.buf[this.count]=n,this.count+=1},t.prototype.writeBytesOffset=function(n,r,o){if(r<0||r>n.length||o<0||r+o-n.length>0)throw new p_;this.ensureCapacity(this.count+o),It.arraycopy(n,r,this.buf,this.count,o),this.count+=o},t.prototype.writeTo=function(n){n.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return Gr.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(n){return n?typeof n=="string"?this.toString_string(n):this.toString_number(n):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(n){return new String(this.buf).toString()},t.prototype.toString_number=function(n){return new String(this.buf).toString()},t.prototype.close=function(){},t}(cue);function kk(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function ta(e){if(xh===void 0&&(xh=kk()),xh===null)throw new Error("BigInt is not supported!");return xh(e)}(function(e){e[e.ALPHA=0]="ALPHA",e[e.LOWER=1]="LOWER",e[e.MIXED=2]="MIXED",e[e.PUNCT=3]="PUNCT",e[e.ALPHA_SHIFT=4]="ALPHA_SHIFT",e[e.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(ct||(ct={}));var mue=function(){function e(){}return e.decode=function(t,n){var r=new mt(""),o=mr.ISO8859_1;r.enableDecoding(o);for(var i=1,a=t[i++],s=new sue;it[0])throw ae.getFormatInstance();for(var o=new Int32Array(e.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i0){for(var d=0;d<6;++d)a.write(Number(ta(l)>>ta(8*(5-d))));l=0,s=0}}o===n[0]&&f0){for(d=0;d<6;++d)a.write(Number(ta(l)>>ta(8*(5-d))));l=0,s=0}}}return i.append(Is.decode(a.toByteArray(),r)),o},e.numericCompaction=function(t,n,r){for(var o=0,i=!1,a=new Int32Array(e.MAX_NUMERIC_CODEWORDS);n0&&(r.append(e.decodeBase900toBase10(a,o)),o=0)}return n},e.decodeBase900toBase10=function(t,n){for(var r=ta(0),o=0;o@[\\]_\`~!\r ,: --.$/"|*()?{}'`,e.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",e.EXP900=kk()?function(){var t=[];t[0]=ta(1);var n=ta(900);t[1]=n;for(var r=2;r<16;r++)t[r]=t[r-1]*n;return t}():[],e.NUMBER_OF_SEQUENCE_CODEWORDS=2,e}(),fc=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yue=function(){function e(){}return e.decode=function(t,n,r,o,i,a,s){for(var l,u=new fw(t,n,r,o,i),c=null,f=null,d=!0;;d=!1){if(n!=null&&(c=e.getRowIndicatorColumn(t,u,n,!0,a,s)),o!=null&&(f=e.getRowIndicatorColumn(t,u,o,!1,a,s)),(l=e.merge(c,f))==null)throw Y.getNotFoundInstance();var h=l.getBoundingBox();if(!d||h==null||!(h.getMinY()u.getMaxY()))break;u=h}l.setBoundingBox(u);var p=l.getBarcodeColumnCount()+1;l.setDetectionResultColumn(0,c),l.setDetectionResultColumn(p,f);for(var m=c!=null,_=1;_<=p;_++){var b=m?_:p-_;if(l.getDetectionResultColumn(b)===void 0){var g=void 0;g=b===0||b===p?new z4(u,b===0):new Rk(u),l.setDetectionResultColumn(b,g);for(var E=-1,T=E,O=u.getMinY();O<=u.getMaxY();O++){if((E=e.getStartColumn(l,b,O,m))<0||E>u.getMaxX()){if(T===-1)continue;E=T}var A=e.detectCodeword(t,u.getMinX(),u.getMaxX(),m,E,O,a,s);A!=null&&(g.setCodeword(O,A),T=E,a=Math.min(a,A.getWidth()),s=Math.max(s,A.getWidth()))}}}return e.createDecoderResult(l)},e.merge=function(t,n){if(t==null&&n==null)return null;var r=e.getBarcodeMetadata(t,n);if(r==null)return null;var o=fw.merge(e.adjustBoundingBox(t),e.adjustBoundingBox(n));return new oue(r,o)},e.adjustBoundingBox=function(t){var n,r;if(t==null)return null;var o=t.getRowHeights();if(o==null)return null;var i=e.getMax(o),a=0;try{for(var s=fc(o),l=s.next();!l.done;l=s.next()){var u=l.value;if(a+=i-u,u>0)break}}catch(h){n={error:h}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var c=t.getCodewords(),f=0;a>0&&c[f]==null;f++)a--;var d=0;for(f=o.length-1;f>=0&&(d+=i-o[f],!(o[f]>0));f--);for(f=c.length-1;d>0&&c[f]==null;f--)d--;return t.getBoundingBox().addMissingRows(a,d,t.isLeft())},e.getMax=function(t){var n,r,o=-1;try{for(var i=fc(t),a=i.next();!a.done;a=i.next()){var s=a.value;o=Math.max(o,s)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},e.getBarcodeMetadata=function(t,n){var r,o;return t==null||(r=t.getBarcodeMetadata())==null?n==null?null:n.getBarcodeMetadata():n==null||(o=n.getBarcodeMetadata())==null?r:r.getColumnCount()!==o.getColumnCount()&&r.getErrorCorrectionLevel()!==o.getErrorCorrectionLevel()&&r.getRowCount()!==o.getRowCount()?null:r},e.getRowIndicatorColumn=function(t,n,r,o,i,a){for(var s=new z4(n,o),l=0;l<2;l++)for(var u=l===0?1:-1,c=Math.trunc(Math.trunc(r.getX())),f=Math.trunc(Math.trunc(r.getY()));f<=n.getMaxY()&&f>=n.getMinY();f+=u){var d=e.detectCodeword(t,0,t.getWidth(),o,c,f,i,a);d!=null&&(s.setCodeword(f,d),c=o?d.getStartX():d.getEndX())}return s},e.adjustCodewordCount=function(t,n){var r=n[0][1],o=r.getValue(),i=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-e.getNumberOfECCodeWords(t.getBarcodeECLevel());if(o.length===0){if(i<1||i>Ke.MAX_CODEWORDS_IN_BARCODE)throw Y.getNotFoundInstance();r.setValue(i)}else o[0]!==i&&r.setValue(i)},e.createDecoderResult=function(t){var n=e.createBarcodeMatrix(t);e.adjustCodewordCount(t,n);for(var r=new Array,o=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),i=[],a=new Array,s=0;s0;){for(var l=0;l=0){if(_>=a.length)continue;a[_][u].setValue(m.getValue())}}}}catch(b){o={error:b}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}u++}}catch(b){n={error:b}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return a},e.isValidBarcodeColumn=function(t,n){return n>=0&&n<=t.getBarcodeColumnCount()+1},e.getStartColumn=function(t,n,r,o){var i,a,s=o?1:-1,l=null;if(e.isValidBarcodeColumn(t,n-s)&&(l=t.getDetectionResultColumn(n-s).getCodeword(r)),l!=null)return o?l.getEndX():l.getStartX();if((l=t.getDetectionResultColumn(n).getCodewordNearby(r))!=null)return o?l.getStartX():l.getEndX();if(e.isValidBarcodeColumn(t,n-s)&&(l=t.getDetectionResultColumn(n-s).getCodewordNearby(r)),l!=null)return o?l.getEndX():l.getStartX();for(var u=0;e.isValidBarcodeColumn(t,n-s);){n-=s;try{for(var c=(i=void 0,fc(t.getDetectionResultColumn(n).getCodewords())),f=c.next();!f.done;f=c.next()){var d=f.value;if(d!=null)return(o?d.getEndX():d.getStartX())+s*u*(d.getEndX()-d.getStartX())}}catch(h){i={error:h}}finally{try{f&&!f.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}u++}return o?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},e.detectCodeword=function(t,n,r,o,i,a,s,l){i=e.adjustCodewordStartColumn(t,n,r,o,i,a);var u,c=e.getModuleBitCount(t,n,r,o,i,a);if(c==null)return null;var f=Ze.sum(c);if(o)u=i+f;else{for(var d=0;d=n)&&u=n:se.CODEWORD_SKEW_SIZE)return i;s+=l}l=-l,o=!o}return s},e.checkCodewordSkew=function(t,n,r){return n-e.CODEWORD_SKEW_SIZE<=t&&t<=r+e.CODEWORD_SKEW_SIZE},e.decodeCodewords=function(t,n,r){if(t.length===0)throw ae.getFormatInstance();var o=1<r/2+e.MAX_ERRORS||r<0||r>e.MAX_EC_CODEWORDS)throw hn.getChecksumInstance();return e.errorCorrection.decode(t,r,n)},e.verifyCodewordCount=function(t,n){if(t.length<4)throw ae.getFormatInstance();var r=t[0];if(r>t.length)throw ae.getFormatInstance();if(r===0){if(!(n>=1;return n},e.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},e.getCodewordBucketNumber_number=function(t){return e.getCodewordBucketNumber(e.getBitCountForCodeword(t))},e.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},e.toString=function(t){for(var n=new v_,r=0;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},P1=function(){function e(){}return e.prototype.decode=function(t,n){n===void 0&&(n=null);var r=e.decode(t,n,!1);if(r==null||r.length===0||r[0]==null)throw Y.getNotFoundInstance();return r[0]},e.prototype.decodeMultiple=function(t,n){n===void 0&&(n=null);try{return e.decode(t,n,!0)}catch(r){throw r instanceof ae||r instanceof hn?Y.getNotFoundInstance():r}},e.decode=function(t,n,r){var o,i,a=new Array,s=Wle.detectMultiple(t,n,r);try{for(var l=gue(s.getPoints()),u=l.next();!u.done;u=l.next()){var c=u.value,f=yue.decode(s.getBits(),c[4],c[5],c[6],c[7],e.getMinCodewordWidth(c),e.getMaxCodewordWidth(c)),d=new Ir(f.getText(),f.getRawBytes(),void 0,c,Te.PDF_417);d.putMetadata(Ln.ERROR_CORRECTION_LEVEL,f.getECLevel());var h=f.getOther();h!=null&&d.putMetadata(Ln.PDF417_EXTRA_METADATA,h),a.push(d)}}catch(p){o={error:p}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return a.map(function(p){return p})},e.getMaxWidth=function(t,n){return t==null||n==null?0:Math.trunc(Math.abs(t.getX()-n.getX()))},e.getMinWidth=function(t,n){return t==null||n==null?Dn.MAX_VALUE:Math.trunc(Math.abs(t.getX()-n.getX()))},e.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(e.getMaxWidth(t[0],t[4]),e.getMaxWidth(t[6],t[2])*Ke.MODULES_IN_CODEWORD/Ke.MODULES_IN_STOP_PATTERN),Math.max(e.getMaxWidth(t[1],t[5]),e.getMaxWidth(t[7],t[3])*Ke.MODULES_IN_CODEWORD/Ke.MODULES_IN_STOP_PATTERN)))},e.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(e.getMinWidth(t[0],t[4]),e.getMinWidth(t[6],t[2])*Ke.MODULES_IN_CODEWORD/Ke.MODULES_IN_STOP_PATTERN),Math.min(e.getMinWidth(t[1],t[5]),e.getMinWidth(t[7],t[3])*Ke.MODULES_IN_CODEWORD/Ke.MODULES_IN_STOP_PATTERN)))},e.prototype.reset=function(){},e}(),vue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),V4=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return vue(t,e),t.kind="ReaderException",t}(Tr),H4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Mk=function(){function e(){}return e.prototype.decode=function(t,n){return this.setHints(n),this.decodeInternal(t)},e.prototype.decodeWithState=function(t){return this.readers!==null&&this.readers!==void 0||this.setHints(null),this.decodeInternal(t)},e.prototype.setHints=function(t){this.hints=t;var n=t!=null&&t.get(Et.TRY_HARDER)!==void 0,r=t==null?null:t.get(Et.POSSIBLE_FORMATS),o=new Array;if(r!=null){var i=r.some(function(a){return a===Te.UPC_A||a===Te.UPC_E||a===Te.EAN_13||a===Te.EAN_8||a===Te.CODABAR||a===Te.CODE_39||a===Te.CODE_93||a===Te.CODE_128||a===Te.ITF||a===Te.RSS_14||a===Te.RSS_EXPANDED});i&&!n&&o.push(new zl(t)),r.includes(Te.QR_CODE)&&o.push(new A1),r.includes(Te.DATA_MATRIX)&&o.push(new O1),r.includes(Te.AZTEC)&&o.push(new C1),r.includes(Te.PDF_417)&&o.push(new P1),i&&n&&o.push(new zl(t))}o.length===0&&(n||o.push(new zl(t)),o.push(new A1),o.push(new O1),o.push(new C1),o.push(new P1),n&&o.push(new zl(t))),this.readers=o},e.prototype.reset=function(){var t,n;if(this.readers!==null)try{for(var r=H4(this.readers),o=r.next();!o.done;o=r.next())o.value.reset()}catch(i){t={error:i}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.decodeInternal=function(t){var n,r;if(this.readers===null)throw new V4("No readers where selected, nothing can be read.");try{for(var o=H4(this.readers),i=o.next();!i.done;i=o.next()){var a=i.value;try{return a.decode(t,this.hints)}catch(s){if(s instanceof V4)continue}}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}throw new Y("No MultiFormat Readers were able to detect the code.")},e}(),wue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){n===void 0&&(n=null),r===void 0&&(r=500);var o=new Mk;return o.setHints(n),e.call(this,o,r)||this}wue(t,e),t.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)}})(zu);var bue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n){return n===void 0&&(n=500),e.call(this,new P1,n)||this}bue(t,e)})(zu);var W4,Sue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n){return n===void 0&&(n=500),e.call(this,new A1,n)||this}Sue(t,e)})(zu),function(e){e[e.ERROR_CORRECTION=0]="ERROR_CORRECTION",e[e.CHARACTER_SET=1]="CHARACTER_SET",e[e.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",e[e.MIN_SIZE=3]="MIN_SIZE",e[e.MAX_SIZE=4]="MAX_SIZE",e[e.MARGIN=5]="MARGIN",e[e.PDF417_COMPACT=6]="PDF417_COMPACT",e[e.PDF417_COMPACTION=7]="PDF417_COMPACTION",e[e.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",e[e.AZTEC_LAYERS=9]="AZTEC_LAYERS",e[e.QR_VERSION=10]="QR_VERSION"}(W4||(W4={}));var _ue=function(){function e(){}return e.applyMaskPenaltyRule1=function(t){return e.applyMaskPenaltyRule1Internal(t,!0)+e.applyMaskPenaltyRule1Internal(t,!1)},e.applyMaskPenaltyRule2=function(t){for(var n=0,r=t.getArray(),o=t.getWidth(),i=t.getHeight(),a=0;a=5&&(r+=e.N1+(l-5)),l=1,u=f)}l>=5&&(r+=e.N1+(l-5))}return r},e.N1=3,e.N2=3,e.N3=40,e.N4=10,e}(),Eue=function(){function e(){this.maskPattern=-1}return e.prototype.getMode=function(){return this.mode},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getVersion=function(){return this.version},e.prototype.getMaskPattern=function(){return this.maskPattern},e.prototype.getMatrix=function(){return this.matrix},e.prototype.toString=function(){var t=new mt;return t.append(`<< +`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],e.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],e}(),Qe=function(){function e(){}return e.round=function(t){return t===NaN?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},e.distance=function(t,n,r,o){var i=t-r,a=n-o;return Math.sqrt(i*i+a*a)},e.sum=function(t){for(var n=0,r=0,o=t.length;r!==o;r++)n+=t[r];return n},e}(),ww=function(){function e(){}return e.floatToIntBits=function(t){return t},e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}(),we=function(){function e(t,n){this.x=t,this.y=n}return e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.equals=function(t){if(t instanceof e){var n=t;return this.x===n.x&&this.y===n.y}return!1},e.prototype.hashCode=function(){return 31*ww.floatToIntBits(this.x)+ww.floatToIntBits(this.y)},e.prototype.toString=function(){return"("+this.x+","+this.y+")"},e.orderBestPatterns=function(t){var n,r,o,i=this.distance(t[0],t[1]),a=this.distance(t[1],t[2]),s=this.distance(t[0],t[2]);if(a>=i&&a>=s?(r=t[0],n=t[1],o=t[2]):s>=a&&s>=i?(r=t[1],n=t[0],o=t[2]):(r=t[2],n=t[0],o=t[1]),this.crossProductZ(n,r,o)<0){var l=n;n=o,o=l}t[0]=n,t[1]=r,t[2]=o},e.distance=function(t,n){return Qe.distance(t.x,t.y,n.x,n.y)},e.crossProductZ=function(t,n,r){var o=n.x,i=n.y;return(r.x-o)*(t.y-i)-(r.y-i)*(t.x-o)},e}(),C_=function(){function e(t,n){this.bits=t,this.points=n}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),kse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mse=function(e){function t(n,r,o,i,a){var s=e.call(this,n,r)||this;return s.compact=o,s.nbDatablocks=i,s.nbLayers=a,s}return kse(t,e),t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(C_),bw=function(){function e(t,n,r,o){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),n==null&&(n=e.INIT_SIZE),r==null&&(r=t.getWidth()/2|0),o==null&&(o=t.getHeight()/2|0);var i=n/2|0;if(this.leftInit=r-i,this.rightInit=r+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Y}return e.prototype.detect=function(){for(var t=this.leftInit,n=this.rightInit,r=this.upInit,o=this.downInit,i=!1,a=!0,s=!1,l=!1,u=!1,c=!1,f=!1,d=this.width,h=this.height;a;){a=!1;for(var p=!0;(p||!l)&&n=d){i=!0;break}for(var m=!0;(m||!u)&&o=h){i=!0;break}for(var S=!0;(S||!c)&&t>=0;)(S=this.containsBlackPoint(r,o,t,!1))?(t--,a=!0,c=!0):c||t--;if(t<0){i=!0;break}for(var b=!0;(b||!f)&&r>=0;)(b=this.containsBlackPoint(t,n,r,!0))?(r--,a=!0,f=!0):f||r--;if(r<0){i=!0;break}a&&(s=!0)}if(!i&&s){for(var g=n-t,E=null,T=1;E===null&&Tr||l<-1||l>o)throw new Y;i=!1,s===-1?(n[a]=0,i=!0):s===r&&(n[a]=r-1,i=!0),l===-1?(n[a+1]=0,i=!0):l===o&&(n[a+1]=o-1,i=!0)}for(i=!0,a=n.length-2;a>=0&&i;a-=2){if(s=Math.floor(n[a]),l=Math.floor(n[a+1]),s<-1||s>r||l<-1||l>o)throw new Y;i=!1,s===-1?(n[a]=0,i=!0):s===r&&(n[a]=r-1,i=!0),l===-1?(n[a+1]=0,i=!0):l===o&&(n[a+1]=o-1,i=!0)}},e}(),Fk=function(){function e(t,n,r,o,i,a,s,l,u){this.a11=t,this.a21=n,this.a31=r,this.a12=o,this.a22=i,this.a32=a,this.a13=s,this.a23=l,this.a33=u}return e.quadrilateralToQuadrilateral=function(t,n,r,o,i,a,s,l,u,c,f,d,h,p,m,S){var b=e.quadrilateralToSquare(t,n,r,o,i,a,s,l);return e.squareToQuadrilateral(u,c,f,d,h,p,m,S).times(b)},e.prototype.transformPoints=function(t){for(var n=t.length,r=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,l=this.a23,u=this.a31,c=this.a32,f=this.a33,d=0;d>1&127):(o<<=10,o+=(a>>2&992)+(a>>1&31))}var s=this.getCorrectedParameterData(o,this.compact);this.compact?(this.nbLayers=1+(s>>6),this.nbDataBlocks=1+(63&s)):(this.nbLayers=1+(s>>11),this.nbDataBlocks=1+(2047&s))},e.prototype.getRotation=function(t,n){var r=0;t.forEach(function(i,a,s){r=(r<<3)+((i>>n-2<<1)+(1&i))}),r=((1&r)<<11)+(r>>1);for(var o=0;o<4;o++)if(Dn.bitCount(r^this.EXPECTED_CORNER_BITS[o])<=2)return o;throw new Y},e.prototype.getCorrectedParameterData=function(t,n){var r,o;n?(r=7,o=2):(r=10,o=4);for(var i=r-o,a=new Int32Array(r),s=r-1;s>=0;--s)a[s]=15&t,t>>=4;try{new Nm(pa.AZTEC_PARAM).decode(a,i)}catch{throw new Y}var l=0;for(s=0;s2){var f=this.distancePoint(c,s)*this.nbCenterLayers/(this.distancePoint(i,n)*(this.nbCenterLayers+2));if(f<.75||f>1.25||!this.isWhiteOrBlackRectangle(s,l,u,c))break}n=s,r=l,o=u,i=c,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new Y;this.compact=this.nbCenterLayers===5;var d=new we(n.getX()+.5,n.getY()-.5),h=new we(r.getX()+.5,r.getY()+.5),p=new we(o.getX()-.5,o.getY()+.5),m=new we(i.getX()-.5,i.getY()-.5);return this.expandSquare([d,h,p,m],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},e.prototype.getMatrixCenter=function(){var t,n,r,o;try{t=(u=new bw(this.image).detect())[0],n=u[1],r=u[2],o=u[3]}catch{var i=this.image.getWidth()/2,a=this.image.getHeight()/2;t=this.getFirstDifferent(new dr(i+7,a-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new dr(i+7,a+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new dr(i-7,a+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new dr(i-7,a-7),!1,-1,-1).toResultPoint()}var s=Qe.round((t.getX()+o.getX()+n.getX()+r.getX())/4),l=Qe.round((t.getY()+o.getY()+n.getY()+r.getY())/4);try{var u;t=(u=new bw(this.image,15,s,l).detect())[0],n=u[1],r=u[2],o=u[3]}catch{t=this.getFirstDifferent(new dr(s+7,l-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new dr(s+7,l+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new dr(s-7,l+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new dr(s-7,l-7),!1,-1,-1).toResultPoint()}return s=Qe.round((t.getX()+o.getX()+n.getX()+r.getX())/4),l=Qe.round((t.getY()+o.getY()+n.getY()+r.getY())/4),new dr(s,l)},e.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},e.prototype.sampleGrid=function(t,n,r,o,i){var a=x_.getInstance(),s=this.getDimension(),l=s/2-this.nbCenterLayers,u=s/2+this.nbCenterLayers;return a.sampleGrid(t,s,s,l,l,u,l,u,u,l,u,n.getX(),n.getY(),r.getX(),r.getY(),o.getX(),o.getY(),i.getX(),i.getY())},e.prototype.sampleLine=function(t,n,r){for(var o=0,i=this.distanceResultPoint(t,n),a=i/r,s=t.getX(),l=t.getY(),u=a*(n.getX()-t.getX())/i,c=a*(n.getY()-t.getY())/i,f=0;f.1&&d<.9?0:d<=.1===u?1:-1},e.prototype.getFirstDifferent=function(t,n,r,o){for(var i=t.getX()+r,a=t.getY()+o;this.isValid(i,a)&&this.image.get(i,a)===n;)i+=r,a+=o;for(i-=r,a-=o;this.isValid(i,a)&&this.image.get(i,a)===n;)i+=r;for(i-=r;this.isValid(i,a)&&this.image.get(i,a)===n;)a+=o;return new dr(i,a-=o)},e.prototype.expandSquare=function(t,n,r){var o=r/(2*n),i=t[0].getX()-t[2].getX(),a=t[0].getY()-t[2].getY(),s=(t[0].getX()+t[2].getX())/2,l=(t[0].getY()+t[2].getY())/2,u=new we(s+o*i,l+o*a),c=new we(s-o*i,l-o*a);return i=t[1].getX()-t[3].getX(),a=t[1].getY()-t[3].getY(),s=(t[1].getX()+t[3].getX())/2,l=(t[1].getY()+t[3].getY())/2,[u,new we(s+o*i,l+o*a),c,new we(s-o*i,l-o*a)]},e.prototype.isValid=function(t,n){return t>=0&&t0&&n>(s?8:5));r=s?i:15;for(var u=Math.trunc(i/2),c=0;c=i)break;try{a=t.getBlackRow(d,a)}catch{continue}for(var h=function(b){if(b===1&&(a.reverse(),n&&n.get(Et.NEED_RESULT_POINT_CALLBACK)===!0)){var g=new Map;n.forEach(function(O,A){return g.set(A,O)}),g.delete(Et.NEED_RESULT_POINT_CALLBACK),n=g}try{var E=p.decodeRow(d,a,n);if(b===1){E.putMetadata(Ln.ORIENTATION,180);var T=E.getResultPoints();T!==null&&(T[0]=new we(o-T[0].getX()-1,T[0].getY()),T[1]=new we(o-T[1].getX()-1,T[1].getY()))}return{value:E}}catch{}},p=this,m=0;m<2;m++){var S=h(m);if(typeof S=="object")return S.value}}throw new Y},e.recordPattern=function(t,n,r){for(var o=r.length,i=0;i=a)throw new Y;for(var s=!t.get(n),l=0,u=n;u0&&o>=0;)t.get(--n)!==i&&(o--,i=!i);if(o>=0)throw new Y;e.recordPattern(t,n+1,r)},e.patternMatchVariance=function(t,n,r){for(var o=t.length,i=0,a=0,s=0;sd?f-d:d-f;if(h>r)return Number.POSITIVE_INFINITY;u+=h}return u/i},e}(),jse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),L4=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return jse(t,e),t.findStartPattern=function(n){for(var r=n.getSize(),o=n.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),s=o,l=!1,u=o;u=0&&n.isRange(Math.max(0,s-(u-s)/2),s,!1))return Int32Array.from([s,u,f]);s+=a[0]+a[1],(a=a.slice(2,a.length-1))[i-1]=0,a[i]=0,i--}else i++;a[i]=1,l=!l}throw new Y},t.decodeCode=function(n,r,o){Nn.recordPattern(n,o,r);for(var i=t.MAX_AVG_VARIANCE,a=-1,s=0;s=0)return a;throw new Y},t.prototype.decodeRow=function(n,r,o){var i,a=o&&o.get(Et.ASSUME_GS1)===!0,s=t.findStartPattern(r),l=s[2],u=0,c=new Uint8Array(20);switch(c[u++]=l,l){case t.CODE_START_A:i=t.CODE_CODE_A;break;case t.CODE_START_B:i=t.CODE_CODE_B;break;case t.CODE_START_C:i=t.CODE_CODE_C;break;default:throw new ae}for(var f=!1,d=!1,h="",p=s[0],m=s[1],S=Int32Array.from([0,0,0,0,0,0]),b=0,g=0,E=l,T=0,O=!0,A=!1,C=!1;!f;){var y=d;switch(d=!1,b=g,g=t.decodeCode(r,S,m),c[u++]=g,g!==t.CODE_STOP&&(O=!0),g!==t.CODE_STOP&&(E+=++T*g),p=m,m+=S.reduce(function(D,L){return D+L},0),g){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new ae}switch(i){case t.CODE_CODE_A:if(g<64)h+=C===A?String.fromCharCode(" ".charCodeAt(0)+g):String.fromCharCode(" ".charCodeAt(0)+g+128),C=!1;else if(g<96)h+=C===A?String.fromCharCode(g-64):String.fromCharCode(g+64),C=!1;else switch(g!==t.CODE_STOP&&(O=!1),g){case t.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!A&&C?(A=!0,C=!1):A&&C?(A=!1,C=!1):C=!0;break;case t.CODE_SHIFT:d=!0,i=t.CODE_CODE_B;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:f=!0}break;case t.CODE_CODE_B:if(g<96)h+=C===A?String.fromCharCode(" ".charCodeAt(0)+g):String.fromCharCode(" ".charCodeAt(0)+g+128),C=!1;else switch(g!==t.CODE_STOP&&(O=!1),g){case t.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!A&&C?(A=!0,C=!1):A&&C?(A=!1,C=!1):C=!0;break;case t.CODE_SHIFT:d=!0,i=t.CODE_CODE_A;break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:f=!0}break;case t.CODE_CODE_C:if(g<100)g<10&&(h+="0"),h+=g;else switch(g!==t.CODE_STOP&&(O=!1),g){case t.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_STOP:f=!0}}y&&(i=i===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var _=m-p;if(m=r.getNextUnset(m),!r.isRange(m,Math.min(r.getSize(),m+(m-p)/2),!1))throw new Y;if((E-=T*b)%103!==b)throw new hn;var v=h.length;if(v===0)throw new Y;v>0&&O&&(h=i===t.CODE_CODE_C?h.substring(0,v-2):h.substring(0,v-1));for(var x=(s[1]+s[0])/2,I=p+_/2,R=c.length,k=new Uint8Array(R),M=0;M=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},N4=function(e){function t(n,r){n===void 0&&(n=!1),r===void 0&&(r=!1);var o=e.call(this)||this;return o.usingCheckDigit=n,o.extendedMode=r,o.decodeRowResult="",o.counters=new Int32Array(9),o}return Fse(t,e),t.prototype.decodeRow=function(n,r,o){var i,a,s,l,u=this.counters;u.fill(0),this.decodeRowResult="";var c,f,d=t.findAsteriskPattern(r,u),h=r.getNextSet(d[1]),p=r.getSize();do{t.recordPattern(r,h,u);var m=t.toNarrowWidePattern(u);if(m<0)throw new Y;c=t.patternToChar(m),this.decodeRowResult+=c,f=h;try{for(var S=(i=void 0,kg(u)),b=S.next();!b.done;b=S.next())h+=b.value}catch(x){i={error:x}}finally{try{b&&!b.done&&(a=S.return)&&a.call(S)}finally{if(i)throw i.error}}h=r.getNextSet(h)}while(c!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var g,E=0;try{for(var T=kg(u),O=T.next();!O.done;O=T.next())E+=O.value}catch(x){s={error:x}}finally{try{O&&!O.done&&(l=T.return)&&l.call(T)}finally{if(s)throw s.error}}if(h!==p&&2*(h-f-E)s&&(l=p)}catch(m){r={error:m}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}s=l,i=0;for(var f=0,d=0,h=0;hs&&(d|=1<0;h++){var p;if((p=n[h])>s&&(i--,2*p>=f))return-1}return d}}while(i>3);return-1},t.patternToChar=function(n){for(var r=0;r="A"&&s<="Z"))throw new ae;l=String.fromCharCode(s.charCodeAt(0)+32);break;case"$":if(!(s>="A"&&s<="Z"))throw new ae;l=String.fromCharCode(s.charCodeAt(0)-64);break;case"%":if(s>="A"&&s<="E")l=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")l=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")l=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")l="\0";else if(s==="V")l="@";else if(s==="W")l="`";else{if(s!=="X"&&s!=="Y"&&s!=="Z")throw new ae;l=""}break;case"/":if(s>="A"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)-32);else{if(s!=="Z")throw new ae;l=":"}}o+=l,i++}else o+=a}return o},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}(Nn),$se=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zse=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},B4=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.narrowLineWidth=-1,n}return $se(t,e),t.prototype.decodeRow=function(n,r,o){var i,a,s=this.decodeStart(r),l=this.decodeEnd(r),u=new mt;t.decodeMiddle(r,s[1],l[0],u);var c=u.toString(),f=null;o!=null&&(f=o.get(Et.ALLOWED_LENGTHS)),f==null&&(f=t.DEFAULT_ALLOWED_LENGTHS);var d=c.length,h=!1,p=0;try{for(var m=zse(f),S=m.next();!S.done;S=m.next()){var b=S.value;if(d===b){h=!0;break}b>p&&(p=b)}}catch(E){i={error:E}}finally{try{S&&!S.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}if(!h&&d>p&&(h=!0),!h)throw new ae;var g=[new we(s[1],n),new we(l[0],n)];return new Nr(c,null,0,g,Te.ITF,new Date().getTime())},t.decodeMiddle=function(n,r,o,i){var a=new Int32Array(10),s=new Int32Array(5),l=new Int32Array(5);for(a.fill(0),s.fill(0),l.fill(0);r0&&i>=0&&!n.get(i);i--)o--;if(o!==0)throw new Y},t.skipWhiteSpace=function(n){var r=n.getSize(),o=n.getNextSet(0);if(o===r)throw new Y;return o},t.prototype.decodeEnd=function(n){n.reverse();try{var r=t.skipWhiteSpace(n),o=void 0;try{o=t.findGuardPattern(n,r,t.END_PATTERN_REVERSED[0])}catch(a){a instanceof Y&&(o=t.findGuardPattern(n,r,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(n,o[0]);var i=o[0];return o[0]=n.getSize()-o[1],o[1]=n.getSize()-i,o}finally{n.reverse()}},t.findGuardPattern=function(n,r,o){var i=o.length,a=new Int32Array(i),s=n.getSize(),l=!1,u=0,c=r;a.fill(0);for(var f=r;f=0)return o%10;throw new Y},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(Nn),Vse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tu=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.decodeRowStringBuffer="",n}return Vse(t,e),t.findStartGuardPattern=function(n){for(var r,o=!1,i=0,a=Int32Array.from([0,0,0]);!o;){a=Int32Array.from([0,0,0]);var s=(r=t.findGuardPattern(n,i,!1,this.START_END_PATTERN,a))[0],l=s-((i=r[1])-s);l>=0&&(o=n.isRange(l,s,!1))}return r},t.checkChecksum=function(n){return t.checkStandardUPCEANChecksum(n)},t.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var o=parseInt(n.charAt(r-1),10);return t.getStandardUPCEANChecksum(n.substring(0,r-1))===o},t.getStandardUPCEANChecksum=function(n){for(var r=n.length,o=0,i=r-1;i>=0;i-=2){if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}for(o*=3,i=r-2;i>=0;i-=2){var a;if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}return(1e3-o)%10},t.decodeEnd=function(n,r){return t.findGuardPattern(n,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(n,r,o,i){return this.findGuardPattern(n,r,o,i,new Int32Array(i.length))},t.findGuardPattern=function(n,r,o,i,a){for(var s=n.getSize(),l=0,u=r=o?n.getNextUnset(r):n.getNextSet(r),c=i.length,f=o,d=r;d=0)return s;throw new Y},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}(Nn),Use=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hse=function(){function e(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,n,r){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(n,r,o),a=o.toString(),s=e.parseExtensionString(a),l=[new we((r[0]+r[1])/2,t),new we(i,t)],u=new Nr(a,null,0,l,Te.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},e.prototype.decodeMiddle=function(t,n,r){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),l=n[1],u=0,c=0;c<5&&l=10&&(u|=1<<4-c),c!==4&&(l=t.getNextSet(l),l=t.getNextUnset(l))}if(r.length!==5)throw new Y;var p=this.determineCheckDigit(u);if(e.extensionChecksum(r.toString())!==p)throw new Y;return l},e.extensionChecksum=function(t){for(var n=t.length,r=0,o=n-2;o>=0;o-=2)r+=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);for(r*=3,o=n-1;o>=0;o-=2)r+=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);return(r*=3)%10},e.prototype.determineCheckDigit=function(t){for(var n=0;n<10;n++)if(t===this.CHECK_DIGIT_ENCODINGS[n])return n;throw new Y},e.parseExtensionString=function(t){if(t.length!==5)return null;var n=e.parseExtension5String(t);return n==null?null:new Map([[Ln.SUGGESTED_PRICE,n]])},e.parseExtension5String=function(t){var n;switch(t.charAt(0)){case"0":n="£";break;case"5":n="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}n="";break;default:n=""}var r=parseInt(t.substring(1)),o=r%100;return n+(r/100).toString()+"."+(o<10?"0"+o:o.toString())},e}(),Wse=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gse=function(){function e(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,n,r){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(n,r,o),a=o.toString(),s=e.parseExtensionString(a),l=[new we((r[0]+r[1])/2,t),new we(i,t)],u=new Nr(a,null,0,l,Te.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},e.prototype.decodeMiddle=function(t,n,r){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),l=n[1],u=0,c=0;c<2&&l=10&&(u|=1<<1-c),c!==1&&(l=t.getNextSet(l),l=t.getNextUnset(l))}if(r.length!==2)throw new Y;if(parseInt(r.toString())%4!==u)throw new Y;return l},e.parseExtensionString=function(t){return t.length!==2?null:new Map([[Ln.ISSUE_NUMBER,parseInt(t)]])},e}(),Kse=function(){function e(){}return e.decodeRow=function(t,n,r){var o=Tu.findGuardPattern(n,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new Hse().decodeRow(t,n,o)}catch{return new Gse().decodeRow(t,n,o)}},e.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),e}(),Xse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fn=function(e){function t(){var n=e.call(this)||this;n.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var r=10;r<20;r++){for(var o=t.L_PATTERNS[r-10],i=new Int32Array(o.length),a=0;a=r.getSize()||!r.isRange(p,m,!1))throw new Y;var S=c.toString();if(S.length<8)throw new ae;if(!t.checkChecksum(S))throw new hn;var b=(i[1]+i[0])/2,g=(d[1]+d[0])/2,E=this.getBarcodeFormat(),T=[new we(b,n),new we(g,n)],O=new Nr(S,null,0,T,E,new Date().getTime()),A=0;try{var C=Kse.decodeRow(n,r,d[1]);O.putMetadata(Ln.UPC_EAN_EXTENSION,C.getText()),O.putAllMetadata(C.getResultMetadata()),O.addResultPoints(C.getResultPoints()),A=C.getText().length}catch{}var y=o==null?null:o.get(Et.ALLOWED_EAN_EXTENSIONS);if(y!=null){var _=!1;for(var v in y)if(A.toString()===v){_=!0;break}if(!_)throw new Y}return E===Te.EAN_13||Te.UPC_A,O},t.checkChecksum=function(n){return t.checkStandardUPCEANChecksum(n)},t.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var o=parseInt(n.charAt(r-1),10);return t.getStandardUPCEANChecksum(n.substring(0,r-1))===o},t.getStandardUPCEANChecksum=function(n){for(var r=n.length,o=0,i=r-1;i>=0;i-=2){if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}for(o*=3,i=r-2;i>=0;i-=2){var a;if((a=n.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new ae;o+=a}return(1e3-o)%10},t.decodeEnd=function(n,r){return t.findGuardPattern(n,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(Tu),qse=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),j4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Sw=function(e){function t(){var n=e.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return qse(t,e),t.prototype.decodeMiddle=function(n,r,o){var i,a,s,l,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=n.getSize(),f=r[1],d=0,h=0;h<6&&f=10&&(d|=1<<5-h)}for(o=t.determineFirstDigit(o,d),f=fn.findGuardPattern(n,f,!0,fn.MIDDLE_PATTERN,new Int32Array(fn.MIDDLE_PATTERN.length).fill(0))[1],h=0;h<6&&f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$4=function(e){function t(){var n=e.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return Yse(t,e),t.prototype.decodeMiddle=function(n,r,o){var i,a,s,l,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=n.getSize(),f=r[1],d=0;d<4&&f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},z4=function(e){function t(){var n=e.call(this)||this;return n.decodeMiddleCounters=new Int32Array(4),n}return Jse(t,e),t.prototype.decodeMiddle=function(n,r,o){var i,a,s=this.decodeMiddleCounters.map(function(m){return m});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var l=n.getSize(),u=r[1],c=0,f=0;f<6&&u=10&&(c|=1<<5-f)}return t.determineNumSysAndCheckDigit(new mt(o),c),u},t.prototype.decodeEnd=function(n,r){return t.findGuardPatternWithoutCounters(n,r,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(n){return fn.checkChecksum(t.convertUPCEtoUPCA(n))},t.determineNumSysAndCheckDigit=function(n,r){for(var o=0;o<=1;o++)for(var i=0;i<10;i++)if(r===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[o][i])return n.insert(0,"0"+o),void n.append("0"+i);throw Y.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return Te.UPC_E},t.convertUPCEtoUPCA=function(n){var r=n.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),o=new mt;o.append(n.charAt(0));var i=r[5];switch(i){case 0:case 1:case 2:o.appendChars(r,0,2),o.append(i),o.append("0000"),o.appendChars(r,2,3);break;case 3:o.appendChars(r,0,3),o.append("00000"),o.appendChars(r,3,2);break;case 4:o.appendChars(r,0,4),o.append("00000"),o.append(r[4]);break;default:o.appendChars(r,0,5),o.append("0000"),o.append(i)}return n.length>=8&&o.append(n.charAt(7)),o.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(fn),tle=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),V4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Mg=function(e){function t(n){var r=e.call(this)||this,o=n==null?null:n.get(Et.POSSIBLE_FORMATS),i=[];return o!=null&&(o.indexOf(Te.EAN_13)>-1?i.push(new Sw):o.indexOf(Te.UPC_A)>-1&&i.push(new Qse),o.indexOf(Te.EAN_8)>-1&&i.push(new $4),o.indexOf(Te.UPC_E)>-1&&i.push(new z4)),i.length===0&&(i.push(new Sw),i.push(new $4),i.push(new z4)),r.readers=i,r}return tle(t,e),t.prototype.decodeRow=function(n,r,o){var i,a;try{for(var s=V4(this.readers),l=s.next();!l.done;l=s.next()){var u=l.value;try{var c=u.decodeRow(n,r,o),f=c.getBarcodeFormat()===Te.EAN_13&&c.getText().charAt(0)==="0",d=o==null?null:o.get(Et.POSSIBLE_FORMATS),h=d==null||d.includes(Te.UPC_A);if(f&&h){var p=c.getRawBytes(),m=new Nr(c.getText().substring(1),p,p.length,c.getResultPoints(),Te.UPC_A);return m.putAllMetadata(c.getResultMetadata()),m}return c}catch{}}}catch(S){i={error:S}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}throw new Y},t.prototype.reset=function(){var n,r;try{for(var o=V4(this.readers),i=o.next();!i.done;i=o.next())i.value.reset()}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t}(Nn),nle=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rle=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ss=function(e){function t(){var n=e.call(this)||this;return n.decodeFinderCounters=new Int32Array(4),n.dataCharacterCounters=new Int32Array(8),n.oddRoundingErrors=new Array(4),n.evenRoundingErrors=new Array(4),n.oddCounts=new Array(n.dataCharacterCounters.length/2),n.evenCounts=new Array(n.dataCharacterCounters.length/2),n}return nle(t,e),t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(n,r){for(var o=0;oi&&(i=r[a],o=a);n[o]++},t.decrement=function(n,r){for(var o=0,i=r[0],a=1;a=t.MIN_FINDER_PATTERN_RATIO&&a<=t.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;try{for(var u=rle(n),c=u.next();!c.done;c=u.next()){var f=c.value;f>l&&(l=f),f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Vl=function(){function e(){}return e.getRSSvalue=function(t,n,r){var o,i,a=0;try{for(var s=ole(t),l=s.next();!l.done;l=s.next())a+=l.value}catch(b){o={error:b}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var u=0,c=0,f=t.length,d=0;d=f-d-1&&(p-=e.combins(a-h-(f-d),f-d-2)),f-d-1>1){for(var m=0,S=a-h-(f-d-2);S>n;S--)m+=e.combins(a-h-S-1,f-d-3);p-=m*(f-1-d)}else a-h>n&&p--;u+=p}a-=h}return u},e.combins=function(t,n){var r,o;t-n>n?(o=n,r=t-n):(o=t-n,r=n);for(var i=1,a=1,s=t;s>r;s--)i*=s,a<=o&&(i/=a,a++);for(;a<=o;)i/=a,a++;return i},e}(),ile=function(){function e(){}return e.buildBitArray=function(t){var n=2*t.length-1;t[t.length-1].getRightChar()==null&&(n-=1);for(var r=new oi(12*n),o=0,i=t[0].getRightChar().getValue(),a=11;a>=0;--a)i&1<=0;--u)l&1<=0;--u)c&1<10||o<0||o>10)throw new ae;return i.firstDigit=r,i.secondDigit=o,i}return lle(t,e),t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(O_),Oh=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ule=function(){function e(){}return e.parseFieldsInGeneralPurpose=function(t){var n,r,o,i,a,s,l,u;if(!t)return null;if(t.length<2)throw new Y;var c=t.substring(0,2);try{for(var f=Oh(e.TWO_DIGIT_DATA_LENGTH),d=f.next();!d.done;d=f.next())if((O=d.value)[0]===c)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(2,O[2],t):e.processFixedAI(2,O[1],t)}catch(A){n={error:A}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}if(t.length<3)throw new Y;var h=t.substring(0,3);try{for(var p=Oh(e.THREE_DIGIT_DATA_LENGTH),m=p.next();!m.done;m=p.next())if((O=m.value)[0]===h)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(3,O[2],t):e.processFixedAI(3,O[1],t)}catch(A){o={error:A}}finally{try{m&&!m.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var S=Oh(e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),b=S.next();!b.done;b=S.next())if((O=b.value)[0]===h)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,O[2],t):e.processFixedAI(4,O[1],t)}catch(A){a={error:A}}finally{try{b&&!b.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}if(t.length<4)throw new Y;var g=t.substring(0,4);try{for(var E=Oh(e.FOUR_DIGIT_DATA_LENGTH),T=E.next();!T.done;T=E.next()){var O;if((O=T.value)[0]===g)return O[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,O[2],t):e.processFixedAI(4,O[1],t)}}catch(A){l={error:A}}finally{try{T&&!T.done&&(u=E.return)&&u.call(E)}finally{if(l)throw l.error}}throw new Y},e.processFixedAI=function(t,n,r){if(r.lengththis.information.getSize())return t+4<=this.information.getSize();for(var n=t;nthis.information.getSize()){var n=this.extractNumericValueFromBitArray(t,4);return new xh(this.information.getSize(),n===0?xh.FNC1:n-1,xh.FNC1)}var r=this.extractNumericValueFromBitArray(t,7);return new xh(t+7,(r-8)/11,(r-8)%11)},e.prototype.extractNumericValueFromBitArray=function(t,n){return e.extractNumericValueFromBitArray(this.information,t,n)},e.extractNumericValueFromBitArray=function(t,n,r){for(var o=0,i=0;ithis.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,5);if(n>=5&&n<16)return!0;if(t+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116)return!0;if(t+8>this.information.getSize())return!1;var o=this.extractNumericValueFromBitArray(t,8);return o>=232&&o<253},e.prototype.decodeIsoIec646=function(t){var n=this.extractNumericValueFromBitArray(t,5);if(n===15)return new Po(t+5,Po.FNC1);if(n>=5&&n<15)return new Po(t+5,"0"+(n-5));var r,o=this.extractNumericValueFromBitArray(t,7);if(o>=64&&o<90)return new Po(t+7,""+(o+1));if(o>=90&&o<116)return new Po(t+7,""+(o+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new ae}return new Po(t+8,r)},e.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,5);if(n>=5&&n<16)return!0;if(t+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63},e.prototype.decodeAlphanumeric=function(t){var n=this.extractNumericValueFromBitArray(t,5);if(n===15)return new Po(t+5,Po.FNC1);if(n>=5&&n<15)return new Po(t+5,"0"+(n-5));var r,o=this.extractNumericValueFromBitArray(t,6);if(o>=32&&o<58)return new Po(t+6,""+(o+33));switch(o){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new Pd("Decoding invalid alphanumeric value: "+o)}return new Po(t+6,r)},e.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var n=0;n<5&&n+tthis.information.getSize())return!1;for(var n=t;nthis.information.getSize())return!1;for(var n=0;n<4&&n+t=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ple=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.pairs=new Array(t.MAX_PAIRS),n.rows=new Array,n.startEnd=[2],n}return Ale(t,e),t.prototype.decodeRow=function(n,r,o){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(n,r))}catch{}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(n,r))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(n,r){for(var o,i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(r,this.pairs,n))}catch(s){if(s instanceof Y){if(!this.pairs.length)throw new Y;i=!0}}if(this.checkChecksum())return this.pairs;if(o=!!this.rows.length,this.storeRow(n,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0))!=null)return a}throw new Y},t.prototype.checkRowsBoolean=function(n){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,n&&(this.rows=this.rows.reverse());var r=null;try{r=this.checkRows(new Array,0)}catch(o){console.log(o)}return n&&(this.rows=this.rows.reverse()),r},t.prototype.checkRows=function(n,r){for(var o,i,a=r;as.length)){for(var l=!0,u=0;un){a=s.isEquivalent(this.pairs);break}i=s.isEquivalent(this.pairs),o++}a||i||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(o,new Ole(this.pairs,n,r)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(n,r){var o,i,a,s,l,u;try{for(var c=ta(r),f=c.next();!f.done;f=c.next()){var d=f.value;if(d.getPairs().length!==n.length)try{for(var h=(a=void 0,ta(d.getPairs())),p=h.next();!p.done;p=h.next()){var m=p.value,S=!1;try{for(var b=(l=void 0,ta(n)),g=b.next();!g.done;g=b.next()){var E=g.value;if(U4.equals(m,E)){S=!0;break}}}catch(T){l={error:T}}finally{try{g&&!g.done&&(u=b.return)&&u.call(b)}finally{if(l)throw l.error}}}}catch(T){a={error:T}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}}}catch(T){o={error:T}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}},t.isPartialRow=function(n,r){var o,i,a,s,l,u;try{for(var c=ta(r),f=c.next();!f.done;f=c.next()){var d=f.value,h=!0;try{for(var p=(a=void 0,ta(n)),m=p.next();!m.done;m=p.next()){var S=m.value,b=!1;try{for(var g=(l=void 0,ta(d.getPairs())),E=g.next();!E.done;E=g.next()){var T=E.value;if(S.equals(T)){b=!0;break}}}catch(O){l={error:O}}finally{try{E&&!E.done&&(u=g.return)&&u.call(g)}finally{if(l)throw l.error}}if(!b){h=!1;break}}}catch(O){a={error:O}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}if(h)return!0}}catch(O){o={error:O}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(n){var r=function(s){try{if(s.get(1))return new dle(s);if(!s.get(2))return new ple(s);switch(dp.extractNumericValueFromBitArray(s,1,4)){case 4:return new vle(s);case 5:return new ble(s)}switch(dp.extractNumericValueFromBitArray(s,1,5)){case 12:return new _le(s);case 13:return new Cle(s)}switch(dp.extractNumericValueFromBitArray(s,1,7)){case 56:return new ea(s,"310","11");case 57:return new ea(s,"320","11");case 58:return new ea(s,"310","13");case 59:return new ea(s,"320","13");case 60:return new ea(s,"310","15");case 61:return new ea(s,"320","15");case 62:return new ea(s,"310","17");case 63:return new ea(s,"320","17")}}catch(l){throw console.log(l),new Pd("unknown decoder: "+s)}}(ile.buildBitArray(n)).parseInformation(),o=n[0].getFinderPattern().getResultPoints(),i=n[n.length-1].getFinderPattern().getResultPoints(),a=[o[0],o[1],i[0],i[1]];return new Nr(r,null,null,a,Te.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var n=this.pairs.get(0),r=n.getLeftChar(),o=n.getRightChar();if(o==null)return!1;for(var i=o.getChecksumPortion(),a=2,s=1;s=0?a=o:this.isEmptyPair(r)?a=0:a=r[r.length-1].getFinderPattern().getStartEnd()[1];var l=r.length%2!=0;this.startFromEven&&(l=!l);for(var u=!1;a=0&&!n.get(l);)l--;l++,i=this.startEnd[0]-l,a=l,s=this.startEnd[1]}else a=this.startEnd[0],i=(s=n.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,c=this.getDecodeFinderCounters();It.arraycopy(c,0,c,1,c.length-1),c[0]=i;try{u=this.parseFinderValue(c,t.FINDER_PATTERNS)}catch{return null}return new $k(u,[a,s],a,s,r)},t.prototype.decodeDataCharacter=function(n,r,o,i){for(var a=this.getDataCharacterCounters(),s=0;s.3)throw new Y;var h=this.getOddCounts(),p=this.getEvenCounts(),m=this.getOddRoundingErrors(),S=this.getEvenRoundingErrors();for(l=0;l8){if(b>8.7)throw new Y;g=8}var E=l/2;1&l?(p[E]=g,S[E]=b-g):(h[E]=g,m[E]=b-g)}this.adjustOddEvenCounts(17);var T=4*r.getValue()+(o?0:2)+(i?0:1)-1,O=0,A=0;for(l=h.length-1;l>=0;l--){if(t.isNotA1left(r,o,i)){var C=t.WEIGHTS[T][2*l];A+=h[l]*C}O+=h[l]}var y=0;for(l=p.length-1;l>=0;l--)t.isNotA1left(r,o,i)&&(C=t.WEIGHTS[T][2*l+1],y+=p[l]*C);var _=A+y;if(1&O||O>13||O<4)throw new Y;var v=(13-O)/2,x=t.SYMBOL_WIDEST[v],I=9-x,R=Vl.getRSSvalue(h,x,!0),k=Vl.getRSSvalue(p,I,!1),M=t.EVEN_TOTAL_SUBSET[v],N=t.GSUM[v];return new A1(R*M+k+N,_)},t.isNotA1left=function(n,r,o){return!(n.getValue()==0&&r&&o)},t.prototype.adjustOddEvenCounts=function(n){var r=Qe.sum(new Int32Array(this.getOddCounts())),o=Qe.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;r>13?a=!0:r<4&&(i=!0);var s=!1,l=!1;o>13?l=!0:o<4&&(s=!0);var u=r+o-n,c=(1&r)==1,f=(1&o)==0;if(u==1)if(c){if(f)throw new Y;a=!0}else{if(!f)throw new Y;l=!0}else if(u==-1)if(c){if(f)throw new Y;i=!0}else{if(!f)throw new Y;s=!0}else{if(u!=0)throw new Y;if(c){if(!f)throw new Y;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},H4=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.possibleLeftPairs=[],n.possibleRightPairs=[],n}return Rle(t,e),t.prototype.decodeRow=function(n,r,o){var i,a,s,l,u=this.decodePair(r,!1,n,o);t.addOrTally(this.possibleLeftPairs,u),r.reverse();var c=this.decodePair(r,!0,n,o);t.addOrTally(this.possibleRightPairs,c),r.reverse();try{for(var f=Dg(this.possibleLeftPairs),d=f.next();!d.done;d=f.next()){var h=d.value;if(h.getCount()>1)try{for(var p=(s=void 0,Dg(this.possibleRightPairs)),m=p.next();!m.done;m=p.next()){var S=m.value;if(S.getCount()>1&&t.checkChecksum(h,S))return t.constructResult(h,S)}}catch(b){s={error:b}}finally{try{m&&!m.done&&(l=p.return)&&l.call(p)}finally{if(s)throw s.error}}}}catch(b){i={error:b}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}throw new Y},t.addOrTally=function(n,r){var o,i;if(r!=null){var a=!1;try{for(var s=Dg(n),l=s.next();!l.done;l=s.next()){var u=l.value;if(u.getValue()===r.getValue()){u.incrementCount(),a=!0;break}}}catch(c){o={error:c}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}a||n.push(r)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(n,r){for(var o=4537077*n.getValue()+r.getValue(),i=new String(o).toString(),a=new mt,s=13-i.length;s>0;s--)a.append("0");a.append(i);var l=0;for(s=0;s<13;s++){var u=a.charAt(s).charCodeAt(0)-"0".charCodeAt(0);l+=1&s?u:3*u}(l=10-l%10)===10&&(l=0),a.append(l.toString());var c=n.getFinderPattern().getResultPoints(),f=r.getFinderPattern().getResultPoints();return new Nr(a.toString(),null,0,[c[0],c[1],f[0],f[1]],Te.RSS_14,new Date().getTime())},t.checkChecksum=function(n,r){var o=(n.getChecksumPortion()+16*r.getChecksumPortion())%79,i=9*n.getFinderPattern().getValue()+r.getFinderPattern().getValue();return i>72&&i--,i>8&&i--,o===i},t.prototype.decodePair=function(n,r,o,i){try{var a=this.findFinderPattern(n,r),s=this.parseFoundFinderPattern(n,o,r,a),l=i==null?null:i.get(Et.NEED_RESULT_POINT_CALLBACK);if(l!=null){var u=(a[0]+a[1])/2;r&&(u=n.getSize()-1-u),l.foundPossibleResultPoint(new we(u,o))}var c=this.decodeDataCharacter(n,s,!0),f=this.decodeDataCharacter(n,s,!1);return new Ile(1597*c.getValue()+f.getValue(),c.getChecksumPortion()+4*f.getChecksumPortion(),s)}catch{return null}},t.prototype.decodeDataCharacter=function(n,r,o){for(var i=this.getDataCharacterCounters(),a=0;a8&&(b=8);var g=Math.floor(s/2);1&s?(h[g]=b,m[g]=S-b):(d[g]=b,p[g]=S-b)}this.adjustOddEvenCounts(o,c);var E=0,T=0;for(s=d.length-1;s>=0;s--)T*=9,T+=d[s],E+=d[s];var O=0,A=0;for(s=h.length-1;s>=0;s--)O*=9,O+=h[s],A+=h[s];var C=T+3*O;if(o){if(1&E||E>12||E<4)throw new Y;var y=(12-E)/2,_=9-(k=t.OUTSIDE_ODD_WIDEST[y]),v=Vl.getRSSvalue(d,k,!1),x=Vl.getRSSvalue(h,_,!0),I=t.OUTSIDE_EVEN_TOTAL_SUBSET[y],R=t.OUTSIDE_GSUM[y];return new A1(v*I+x+R,C)}if(1&A||A>10||A<4)throw new Y;y=(10-A)/2,_=9-(k=t.INSIDE_ODD_WIDEST[y]),v=Vl.getRSSvalue(d,k,!0),x=Vl.getRSSvalue(h,_,!1);var k,M=t.INSIDE_ODD_TOTAL_SUBSET[y];return R=t.INSIDE_GSUM[y],new A1(x*M+v+R,C)},t.prototype.findFinderPattern=function(n,r){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var i=n.getSize(),a=!1,s=0;s=0&&a!==n.get(s);)s--;s++;var l=i[0]-s,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);It.arraycopy(u,0,c,1,u.length-1),c[0]=l;var f=this.parseFinderValue(c,t.FINDER_PATTERNS),d=s,h=i[1];return o&&(d=n.getSize()-1-d,h=n.getSize()-1-h),new $k(f,[s,i[1]],d,h,r)},t.prototype.adjustOddEvenCounts=function(n,r){var o=Qe.sum(new Int32Array(this.getOddCounts())),i=Qe.sum(new Int32Array(this.getEvenCounts())),a=!1,s=!1,l=!1,u=!1;n?(o>12?s=!0:o<4&&(a=!0),i>12?u=!0:i<4&&(l=!0)):(o>11?s=!0:o<5&&(a=!0),i>10?u=!0:i<4&&(l=!0));var c=o+i-r,f=(1&o)==(n?1:0),d=(1&i)==1;if(c===1)if(f){if(d)throw new Y;s=!0}else{if(!d)throw new Y;u=!0}else if(c===-1)if(f){if(d)throw new Y;a=!0}else{if(!d)throw new Y;l=!0}else{if(c!==0)throw new Y;if(f){if(!d)throw new Y;o=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ot=function(){function e(t,n,r){this.ecCodewords=t,this.ecBlocks=[n],r&&this.ecBlocks.push(r)}return e.prototype.getECCodewords=function(){return this.ecCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),Je=function(){function e(t,n){this.count=t,this.dataCodewords=n}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),Dle=function(){function e(t,n,r,o,i,a){var s,l;this.versionNumber=t,this.symbolSizeRows=n,this.symbolSizeColumns=r,this.dataRegionSizeRows=o,this.dataRegionSizeColumns=i,this.ecBlocks=a;var u=0,c=a.getECCodewords(),f=a.getECBlocks();try{for(var d=W4(f),h=d.next();!h.done;h=d.next()){var p=h.value;u+=p.getCount()*(p.getDataCodewords()+c)}}catch(m){s={error:m}}finally{try{h&&!h.done&&(l=d.return)&&l.call(d)}finally{if(s)throw s.error}}this.totalCodewords=u}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},e.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},e.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},e.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e.getVersionForDimensions=function(t,n){var r,o;if(1&t||1&n)throw new ae;try{for(var i=W4(e.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===n)return s}}catch(l){r={error:l}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}throw new ae},e.prototype.toString=function(){return""+this.versionNumber},e.buildVersions=function(){return[new e(1,10,10,8,8,new ot(5,new Je(1,3))),new e(2,12,12,10,10,new ot(7,new Je(1,5))),new e(3,14,14,12,12,new ot(10,new Je(1,8))),new e(4,16,16,14,14,new ot(12,new Je(1,12))),new e(5,18,18,16,16,new ot(14,new Je(1,18))),new e(6,20,20,18,18,new ot(18,new Je(1,22))),new e(7,22,22,20,20,new ot(20,new Je(1,30))),new e(8,24,24,22,22,new ot(24,new Je(1,36))),new e(9,26,26,24,24,new ot(28,new Je(1,44))),new e(10,32,32,14,14,new ot(36,new Je(1,62))),new e(11,36,36,16,16,new ot(42,new Je(1,86))),new e(12,40,40,18,18,new ot(48,new Je(1,114))),new e(13,44,44,20,20,new ot(56,new Je(1,144))),new e(14,48,48,22,22,new ot(68,new Je(1,174))),new e(15,52,52,24,24,new ot(42,new Je(2,102))),new e(16,64,64,14,14,new ot(56,new Je(2,140))),new e(17,72,72,16,16,new ot(36,new Je(4,92))),new e(18,80,80,18,18,new ot(48,new Je(4,114))),new e(19,88,88,20,20,new ot(56,new Je(4,144))),new e(20,96,96,22,22,new ot(68,new Je(4,174))),new e(21,104,104,24,24,new ot(56,new Je(6,136))),new e(22,120,120,18,18,new ot(68,new Je(6,175))),new e(23,132,132,20,20,new ot(62,new Je(8,163))),new e(24,144,144,22,22,new ot(62,new Je(8,156),new Je(2,155))),new e(25,8,18,6,16,new ot(7,new Je(1,5))),new e(26,8,32,6,14,new ot(11,new Je(1,10))),new e(27,12,26,10,24,new ot(14,new Je(1,16))),new e(28,12,36,10,16,new ot(18,new Je(1,22))),new e(29,16,36,14,16,new ot(24,new Je(1,32))),new e(30,16,48,14,22,new ot(28,new Je(1,49)))]},e.VERSIONS=e.buildVersions(),e}(),Lle=function(){function e(t){var n=t.getHeight();if(n<8||n>144||1&n)throw new ae;this.version=e.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new zi(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return e.prototype.getVersion=function(){return this.version},e.readVersion=function(t){var n=t.getHeight(),r=t.getWidth();return Dle.getVersionForDimensions(n,r)},e.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),n=0,r=4,o=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),s=!1,l=!1,u=!1,c=!1;do if(r!==i||o!==0||s)if(r!==i-2||o!==0||!(3&a)||l)if(r!==i+4||o!==2||7&a||u)if(r!==i-2||o!==0||(7&a)!=4||c){do r=0&&!this.readMappingMatrix.get(o,r)&&(t[n++]=255&this.readUtah(r,o,i,a)),r-=2,o+=2;while(r>=0&&o=0&&o=0);r+=3,o+=1}else t[n++]=255&this.readCorner4(i,a),r-=2,o+=2,c=!0;else t[n++]=255&this.readCorner3(i,a),r-=2,o+=2,u=!0;else t[n++]=255&this.readCorner2(i,a),r-=2,o+=2,l=!0;else t[n++]=255&this.readCorner1(i,a),r-=2,o+=2,s=!0;while(r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Nle=function(){function e(t,n){this.numDataCodewords=t,this.codewords=n}return e.getDataBlocks=function(t,n){var r,o,i,a,s=n.getECBlocks(),l=0,u=s.getECBlocks();try{for(var c=G4(u),f=c.next();!f.done;f=c.next())l+=(S=f.value).getCount()}catch(R){r={error:R}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}var d=new Array(l),h=0;try{for(var p=G4(u),m=p.next();!m.done;m=p.next())for(var S=m.value,b=0;b7?b-1:b;d[x].codewords[I]=t[A++]}if(A!==t.length)throw new Me;return d},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}(),Uk=function(){function e(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return e.prototype.getBitOffset=function(){return this.bitOffset},e.prototype.getByteOffset=function(){return this.byteOffset},e.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Me(""+t);var n=0,r=this.bitOffset,o=this.byteOffset,i=this.bytes;if(r>0){var a=8-r,s=t>8-s<<(u=a-s);n=(i[o]&l)>>u,t-=s,(r+=s)===8&&(r=0,o++)}if(t>0){for(;t>=8;)n=n<<8|255&i[o],o++,t-=8;if(t>0){var u;l=255>>(u=8-t)<>u,r+=t}}return this.bitOffset=r,this.byteOffset=o,n},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();(function(e){e[e.PAD_ENCODE=0]="PAD_ENCODE",e[e.ASCII_ENCODE=1]="ASCII_ENCODE",e[e.C40_ENCODE=2]="C40_ENCODE",e[e.TEXT_ENCODE=3]="TEXT_ENCODE",e[e.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",e[e.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",e[e.BASE256_ENCODE=6]="BASE256_ENCODE"})(un||(un={}));var Hl,Ble=function(){function e(){}return e.decode=function(t){var n=new Uk(t),r=new mt,o=new mt,i=new Array,a=un.ASCII_ENCODE;do if(a===un.ASCII_ENCODE)a=this.decodeAsciiSegment(n,r,o);else{switch(a){case un.C40_ENCODE:this.decodeC40Segment(n,r);break;case un.TEXT_ENCODE:this.decodeTextSegment(n,r);break;case un.ANSIX12_ENCODE:this.decodeAnsiX12Segment(n,r);break;case un.EDIFACT_ENCODE:this.decodeEdifactSegment(n,r);break;case un.BASE256_ENCODE:this.decodeBase256Segment(n,r,i);break;default:throw new ae}a=un.ASCII_ENCODE}while(a!==un.PAD_ENCODE&&n.available()>0);return o.length()>0&&r.append(o.toString()),new Lm(t,r.toString(),i.length===0?null:i,null)},e.decodeAsciiSegment=function(t,n,r){var o=!1;do{var i=t.readBits(8);if(i===0)throw new ae;if(i<=128)return o&&(i+=128),n.append(String.fromCharCode(i-1)),un.ASCII_ENCODE;if(i===129)return un.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&n.append("0"),n.append(""+a)}else switch(i){case 230:return un.C40_ENCODE;case 231:return un.BASE256_ENCODE;case 232:n.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:o=!0;break;case 236:n.append("[)>05"),r.insert(0,"");break;case 237:n.append("[)>06"),r.insert(0,"");break;case 238:return un.ANSIX12_ENCODE;case 239:return un.TEXT_ENCODE;case 240:return un.EDIFACT_ENCODE;default:if(i!==254||t.available()!==0)throw new ae}}while(t.available()>0);return un.ASCII_ENCODE},e.decodeC40Segment=function(t,n){var r=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var l=o[s];switch(i){case 0:if(l<3)i=l+1;else{if(!(l0)},e.decodeTextSegment=function(t,n){var r=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var l=o[s];switch(i){case 0:if(l<3)i=l+1;else{if(!(l0)},e.decodeAnsiX12Segment=function(t,n){var r=[];do{if(t.available()===8)return;var o=t.readBits(8);if(o===254)return;this.parseTwoBytes(o,t.readBits(8),r);for(var i=0;i<3;i++){var a=r[i];switch(a){case 0:n.append("\r");break;case 1:n.append("*");break;case 2:n.append(">");break;case 3:n.append(" ");break;default:if(a<14)n.append(String.fromCharCode(a+44));else{if(!(a<40))throw new ae;n.append(String.fromCharCode(a+51))}}}}while(t.available()>0)},e.parseTwoBytes=function(t,n,r){var o=(t<<8)+n-1,i=Math.floor(o/1600);r[0]=i,o-=1600*i,i=Math.floor(o/40),r[1]=i,r[2]=o-40*i},e.decodeEdifactSegment=function(t,n){do{if(t.available()<=16)return;for(var r=0;r<4;r++){var o=t.readBits(6);if(o===31){var i=8-t.getBitOffset();return void(i!==8&&t.readBits(i))}!(32&o)&&(o|=64),n.append(String.fromCharCode(o))}}while(t.available()>0)},e.decodeBase256Segment=function(t,n,r){var o,i=1+t.getByteOffset(),a=this.unrandomize255State(t.readBits(8),i++);if((o=a===0?t.available()/8|0:a<250?a:250*(a-249)+this.unrandomize255State(t.readBits(8),i++))<0)throw new ae;for(var s=new Uint8Array(o),l=0;l=0?r:r+256},e.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],e.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],e.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],e.TEXT_SHIFT2_SET_CHARS=e.C40_SHIFT2_SET_CHARS,e.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],e}(),jle=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fle=function(){function e(){this.rsDecoder=new Nm(pa.DATA_MATRIX_FIELD_256)}return e.prototype.decode=function(t){var n,r,o=new Lle(t),i=o.getVersion(),a=o.readCodewords(),s=Nle.getDataBlocks(a,i),l=0;try{for(var u=jle(s),c=u.next();!c.done;c=u.next())l+=c.value.getNumDataCodewords()}catch(g){n={error:g}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}for(var f=new Uint8Array(l),d=s.length,h=0;hs&&(c=s,f[0]=n,f[1]=r,f[2]=o,f[3]=i),c>l&&(c=l,f[0]=r,f[1]=o,f[2]=i,f[3]=n),c>u&&(f[0]=o,f[1]=i,f[2]=n,f[3]=r),f},e.prototype.detectSolid2=function(t){var n=t[0],r=t[1],o=t[2],i=t[3],a=this.transitionsBetween(n,i),s=e.shiftPoint(r,o,4*(a+1)),l=e.shiftPoint(o,r,4*(a+1));return this.transitionsBetween(s,n)this.transitionsBetween(l,f)+this.transitionsBetween(u,f)?c:f:c:this.isValid(f)?f:null},e.prototype.shiftToModuleCenter=function(t){var n=t[0],r=t[1],o=t[2],i=t[3],a=this.transitionsBetween(n,i)+1,s=this.transitionsBetween(o,i)+1,l=e.shiftPoint(n,r,4*s),u=e.shiftPoint(o,r,4*a);(1&(a=this.transitionsBetween(l,i)+1))==1&&(a+=1),(1&(s=this.transitionsBetween(u,i)+1))==1&&(s+=1);var c,f,d=(n.getX()+r.getX()+o.getX()+i.getX())/4,h=(n.getY()+r.getY()+o.getY()+i.getY())/4;return n=e.moveAway(n,d,h),r=e.moveAway(r,d,h),o=e.moveAway(o,d,h),i=e.moveAway(i,d,h),l=e.shiftPoint(n,r,4*s),l=e.shiftPoint(l,i,4*a),c=e.shiftPoint(r,n,4*s),c=e.shiftPoint(c,o,4*a),u=e.shiftPoint(o,i,4*s),u=e.shiftPoint(u,r,4*a),f=e.shiftPoint(i,o,4*s),[l,c,u,f=e.shiftPoint(f,n,4*a)]},e.prototype.isValid=function(t){return t.getX()>=0&&t.getX()0&&t.getY()Math.abs(i-r);if(s){var l=r;r=o,o=l,l=i,i=a,a=l}for(var u=Math.abs(i-r),c=Math.abs(a-o),f=-u/2,d=o0){if(b===a)break;b+=d,f-=u}}return p},e}(),P1=function(){function e(){this.decoder=new Fle}return e.prototype.decode=function(t,n){var r,o;if(n===void 0&&(n=null),n!=null&&n.has(Et.PURE_BARCODE)){var i=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decode(i),o=e.NO_POINTS}else{var a=new $le(t.getBlackMatrix()).detect();r=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=r.getRawBytes(),l=new Nr(r.getText(),s,8*s.length,o,Te.DATA_MATRIX,It.currentTimeMillis()),u=r.getByteSegments();u!=null&&l.putMetadata(Ln.BYTE_SEGMENTS,u);var c=r.getECLevel();return c!=null&&l.putMetadata(Ln.ERROR_CORRECTION_LEVEL,c),l},e.prototype.reset=function(){},e.extractPureBits=function(t){var n=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(n==null||r==null)throw new Y;var o=this.moduleSize(n,t),i=n[1],a=r[1],s=n[0],l=(r[0]-s+1)/o,u=(a-i+1)/o;if(l<=0||u<=0)throw new Y;var c=o/2;i+=c,s+=c;for(var f=new zi(l,u),d=0;d=e.FOR_BITS.size)throw new Me;return e.FOR_BITS.get(t)},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.L=new e(Hl.L,"L",1),e.M=new e(Hl.M,"M",0),e.Q=new e(Hl.Q,"Q",3),e.H=new e(Hl.H,"H",2),e}(),Ule=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hk=function(){function e(t){this.errorCorrectionLevel=Vle.forBits(t>>3&3),this.dataMask=7&t}return e.numBitsDiffering=function(t,n){return Dn.bitCount(t^n)},e.decodeFormatInformation=function(t,n){var r=e.doDecodeFormatInformation(t,n);return r!==null?r:e.doDecodeFormatInformation(t^e.FORMAT_INFO_MASK_QR,n^e.FORMAT_INFO_MASK_QR)},e.doDecodeFormatInformation=function(t,n){var r,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=Ule(e.FORMAT_INFO_DECODE_LOOKUP),l=s.next();!l.done;l=s.next()){var u=l.value,c=u[0];if(c===t||c===n)return new e(u[1]);var f=e.numBitsDiffering(t,c);f=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},G=function(){function e(t){for(var n=[],r=1;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pp=function(){function e(t,n){for(var r,o,i=[],a=2;a40)throw new Me;return e.VERSIONS[t-1]},e.decodeVersionInformation=function(t){for(var n=Number.MAX_SAFE_INTEGER,r=0,o=0;o6&&(n.setRegion(t-11,0,3,6),n.setRegion(0,t-11,6,3)),n},e.prototype.toString=function(){return""+this.versionNumber},e.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),e.VERSIONS=[new e(1,new Int32Array(0),new G(7,new $(1,19)),new G(10,new $(1,16)),new G(13,new $(1,13)),new G(17,new $(1,9))),new e(2,Int32Array.from([6,18]),new G(10,new $(1,34)),new G(16,new $(1,28)),new G(22,new $(1,22)),new G(28,new $(1,16))),new e(3,Int32Array.from([6,22]),new G(15,new $(1,55)),new G(26,new $(1,44)),new G(18,new $(2,17)),new G(22,new $(2,13))),new e(4,Int32Array.from([6,26]),new G(20,new $(1,80)),new G(18,new $(2,32)),new G(26,new $(2,24)),new G(16,new $(4,9))),new e(5,Int32Array.from([6,30]),new G(26,new $(1,108)),new G(24,new $(2,43)),new G(18,new $(2,15),new $(2,16)),new G(22,new $(2,11),new $(2,12))),new e(6,Int32Array.from([6,34]),new G(18,new $(2,68)),new G(16,new $(4,27)),new G(24,new $(4,19)),new G(28,new $(4,15))),new e(7,Int32Array.from([6,22,38]),new G(20,new $(2,78)),new G(18,new $(4,31)),new G(18,new $(2,14),new $(4,15)),new G(26,new $(4,13),new $(1,14))),new e(8,Int32Array.from([6,24,42]),new G(24,new $(2,97)),new G(22,new $(2,38),new $(2,39)),new G(22,new $(4,18),new $(2,19)),new G(26,new $(4,14),new $(2,15))),new e(9,Int32Array.from([6,26,46]),new G(30,new $(2,116)),new G(22,new $(3,36),new $(2,37)),new G(20,new $(4,16),new $(4,17)),new G(24,new $(4,12),new $(4,13))),new e(10,Int32Array.from([6,28,50]),new G(18,new $(2,68),new $(2,69)),new G(26,new $(4,43),new $(1,44)),new G(24,new $(6,19),new $(2,20)),new G(28,new $(6,15),new $(2,16))),new e(11,Int32Array.from([6,30,54]),new G(20,new $(4,81)),new G(30,new $(1,50),new $(4,51)),new G(28,new $(4,22),new $(4,23)),new G(24,new $(3,12),new $(8,13))),new e(12,Int32Array.from([6,32,58]),new G(24,new $(2,92),new $(2,93)),new G(22,new $(6,36),new $(2,37)),new G(26,new $(4,20),new $(6,21)),new G(28,new $(7,14),new $(4,15))),new e(13,Int32Array.from([6,34,62]),new G(26,new $(4,107)),new G(22,new $(8,37),new $(1,38)),new G(24,new $(8,20),new $(4,21)),new G(22,new $(12,11),new $(4,12))),new e(14,Int32Array.from([6,26,46,66]),new G(30,new $(3,115),new $(1,116)),new G(24,new $(4,40),new $(5,41)),new G(20,new $(11,16),new $(5,17)),new G(24,new $(11,12),new $(5,13))),new e(15,Int32Array.from([6,26,48,70]),new G(22,new $(5,87),new $(1,88)),new G(24,new $(5,41),new $(5,42)),new G(30,new $(5,24),new $(7,25)),new G(24,new $(11,12),new $(7,13))),new e(16,Int32Array.from([6,26,50,74]),new G(24,new $(5,98),new $(1,99)),new G(28,new $(7,45),new $(3,46)),new G(24,new $(15,19),new $(2,20)),new G(30,new $(3,15),new $(13,16))),new e(17,Int32Array.from([6,30,54,78]),new G(28,new $(1,107),new $(5,108)),new G(28,new $(10,46),new $(1,47)),new G(28,new $(1,22),new $(15,23)),new G(28,new $(2,14),new $(17,15))),new e(18,Int32Array.from([6,30,56,82]),new G(30,new $(5,120),new $(1,121)),new G(26,new $(9,43),new $(4,44)),new G(28,new $(17,22),new $(1,23)),new G(28,new $(2,14),new $(19,15))),new e(19,Int32Array.from([6,30,58,86]),new G(28,new $(3,113),new $(4,114)),new G(26,new $(3,44),new $(11,45)),new G(26,new $(17,21),new $(4,22)),new G(26,new $(9,13),new $(16,14))),new e(20,Int32Array.from([6,34,62,90]),new G(28,new $(3,107),new $(5,108)),new G(26,new $(3,41),new $(13,42)),new G(30,new $(15,24),new $(5,25)),new G(28,new $(15,15),new $(10,16))),new e(21,Int32Array.from([6,28,50,72,94]),new G(28,new $(4,116),new $(4,117)),new G(26,new $(17,42)),new G(28,new $(17,22),new $(6,23)),new G(30,new $(19,16),new $(6,17))),new e(22,Int32Array.from([6,26,50,74,98]),new G(28,new $(2,111),new $(7,112)),new G(28,new $(17,46)),new G(30,new $(7,24),new $(16,25)),new G(24,new $(34,13))),new e(23,Int32Array.from([6,30,54,78,102]),new G(30,new $(4,121),new $(5,122)),new G(28,new $(4,47),new $(14,48)),new G(30,new $(11,24),new $(14,25)),new G(30,new $(16,15),new $(14,16))),new e(24,Int32Array.from([6,28,54,80,106]),new G(30,new $(6,117),new $(4,118)),new G(28,new $(6,45),new $(14,46)),new G(30,new $(11,24),new $(16,25)),new G(30,new $(30,16),new $(2,17))),new e(25,Int32Array.from([6,32,58,84,110]),new G(26,new $(8,106),new $(4,107)),new G(28,new $(8,47),new $(13,48)),new G(30,new $(7,24),new $(22,25)),new G(30,new $(22,15),new $(13,16))),new e(26,Int32Array.from([6,30,58,86,114]),new G(28,new $(10,114),new $(2,115)),new G(28,new $(19,46),new $(4,47)),new G(28,new $(28,22),new $(6,23)),new G(30,new $(33,16),new $(4,17))),new e(27,Int32Array.from([6,34,62,90,118]),new G(30,new $(8,122),new $(4,123)),new G(28,new $(22,45),new $(3,46)),new G(30,new $(8,23),new $(26,24)),new G(30,new $(12,15),new $(28,16))),new e(28,Int32Array.from([6,26,50,74,98,122]),new G(30,new $(3,117),new $(10,118)),new G(28,new $(3,45),new $(23,46)),new G(30,new $(4,24),new $(31,25)),new G(30,new $(11,15),new $(31,16))),new e(29,Int32Array.from([6,30,54,78,102,126]),new G(30,new $(7,116),new $(7,117)),new G(28,new $(21,45),new $(7,46)),new G(30,new $(1,23),new $(37,24)),new G(30,new $(19,15),new $(26,16))),new e(30,Int32Array.from([6,26,52,78,104,130]),new G(30,new $(5,115),new $(10,116)),new G(28,new $(19,47),new $(10,48)),new G(30,new $(15,24),new $(25,25)),new G(30,new $(23,15),new $(25,16))),new e(31,Int32Array.from([6,30,56,82,108,134]),new G(30,new $(13,115),new $(3,116)),new G(28,new $(2,46),new $(29,47)),new G(30,new $(42,24),new $(1,25)),new G(30,new $(23,15),new $(28,16))),new e(32,Int32Array.from([6,34,60,86,112,138]),new G(30,new $(17,115)),new G(28,new $(10,46),new $(23,47)),new G(30,new $(10,24),new $(35,25)),new G(30,new $(19,15),new $(35,16))),new e(33,Int32Array.from([6,30,58,86,114,142]),new G(30,new $(17,115),new $(1,116)),new G(28,new $(14,46),new $(21,47)),new G(30,new $(29,24),new $(19,25)),new G(30,new $(11,15),new $(46,16))),new e(34,Int32Array.from([6,34,62,90,118,146]),new G(30,new $(13,115),new $(6,116)),new G(28,new $(14,46),new $(23,47)),new G(30,new $(44,24),new $(7,25)),new G(30,new $(59,16),new $(1,17))),new e(35,Int32Array.from([6,30,54,78,102,126,150]),new G(30,new $(12,121),new $(7,122)),new G(28,new $(12,47),new $(26,48)),new G(30,new $(39,24),new $(14,25)),new G(30,new $(22,15),new $(41,16))),new e(36,Int32Array.from([6,24,50,76,102,128,154]),new G(30,new $(6,121),new $(14,122)),new G(28,new $(6,47),new $(34,48)),new G(30,new $(46,24),new $(10,25)),new G(30,new $(2,15),new $(64,16))),new e(37,Int32Array.from([6,28,54,80,106,132,158]),new G(30,new $(17,122),new $(4,123)),new G(28,new $(29,46),new $(14,47)),new G(30,new $(49,24),new $(10,25)),new G(30,new $(24,15),new $(46,16))),new e(38,Int32Array.from([6,32,58,84,110,136,162]),new G(30,new $(4,122),new $(18,123)),new G(28,new $(13,46),new $(32,47)),new G(30,new $(48,24),new $(14,25)),new G(30,new $(42,15),new $(32,16))),new e(39,Int32Array.from([6,26,54,82,110,138,166]),new G(30,new $(20,117),new $(4,118)),new G(28,new $(40,47),new $(7,48)),new G(30,new $(43,24),new $(22,25)),new G(30,new $(10,15),new $(67,16))),new e(40,Int32Array.from([6,30,58,86,114,142,170]),new G(30,new $(19,118),new $(6,119)),new G(28,new $(18,47),new $(31,48)),new G(30,new $(34,24),new $(34,25)),new G(30,new $(20,15),new $(61,16)))],e}();(function(e){e[e.DATA_MASK_000=0]="DATA_MASK_000",e[e.DATA_MASK_001=1]="DATA_MASK_001",e[e.DATA_MASK_010=2]="DATA_MASK_010",e[e.DATA_MASK_011=3]="DATA_MASK_011",e[e.DATA_MASK_100=4]="DATA_MASK_100",e[e.DATA_MASK_101=5]="DATA_MASK_101",e[e.DATA_MASK_110=6]="DATA_MASK_110",e[e.DATA_MASK_111=7]="DATA_MASK_111"})(yn||(yn={}));var lo,K4=function(){function e(t,n){this.value=t,this.isMasked=n}return e.prototype.unmaskBitMatrix=function(t,n){for(var r=0;r=0;r--)t=this.copyBit(8,r,t);var o=this.bitMatrix.getHeight(),i=0,a=o-7;for(r=o-1;r>=a;r--)i=this.copyBit(8,r,i);for(n=o-8;n=0;i--)for(var a=t-9;a>=o;a--)r=this.copyBit(a,i,r);var s=pp.decodeVersionInformation(r);if(s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;for(r=0,a=5;a>=0;a--)for(i=t-9;i>=o;i--)r=this.copyBit(a,i,r);if((s=pp.decodeVersionInformation(r))!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;throw new ae},e.prototype.copyBit=function(t,n,r){return(this.isMirror?this.bitMatrix.get(n,t):this.bitMatrix.get(t,n))?r<<1|1:r<<1},e.prototype.readCodewords=function(){var t=this.readFormatInformation(),n=this.readVersion(),r=K4.values.get(t.getDataMask()),o=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,o);for(var i=n.buildFunctionPattern(),a=!0,s=new Uint8Array(n.getTotalCodewords()),l=0,u=0,c=0,f=o-1;f>0;f-=2){f===6&&f--;for(var d=0;d=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Kle=function(){function e(t,n){this.numDataCodewords=t,this.codewords=n}return e.getDataBlocks=function(t,n,r){var o,i,a,s;if(t.length!==n.getTotalCodewords())throw new Me;var l=n.getECBlocksForLevel(r),u=0,c=l.getECBlocks();try{for(var f=X4(c),d=f.next();!d.done;d=f.next())u+=(b=d.value).getCount()}catch(I){o={error:I}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var h=new Array(u),p=0;try{for(var m=X4(c),S=m.next();!S.done;S=m.next())for(var b=S.value,g=0;g=0&&h[A].codewords.length!==O;)A--;A++;var C=O-l.getECCodewordsPerBlock(),y=0;for(g=0;gt.available())throw new ae;for(var o=new Uint8Array(2*r),i=0;r>0;){var a=t.readBits(13),s=a/96<<8&4294967295|a%96;s+=s<959?41377:42657,o[i]=s>>8&255,o[i+1]=255&s,i+=2,r--}try{n.append(ks.decode(o,gn.GB2312))}catch(l){throw new ae(l)}},e.decodeKanjiSegment=function(t,n,r){if(13*r>t.available())throw new ae;for(var o=new Uint8Array(2*r),i=0;r>0;){var a=t.readBits(13),s=a/192<<8&4294967295|a%192;s+=s<7936?33088:49472,o[i]=s>>8,o[i+1]=s,i+=2,r--}try{n.append(ks.decode(o,gn.SHIFT_JIS))}catch(l){throw new ae(l)}},e.decodeByteSegment=function(t,n,r,o,i,a){if(8*r>t.available())throw new ae;for(var s,l=new Uint8Array(r),u=0;u=e.ALPHANUMERIC_CHARS.length)throw new ae;return e.ALPHANUMERIC_CHARS[t]},e.decodeAlphanumericSegment=function(t,n,r,o){for(var i=n.length();r>1;){if(t.available()<11)throw new ae;var a=t.readBits(11);n.append(e.toAlphaNumericChar(Math.floor(a/45))),n.append(e.toAlphaNumericChar(a%45)),r-=2}if(r===1){if(t.available()<6)throw new ae;n.append(e.toAlphaNumericChar(t.readBits(6)))}if(o)for(var s=i;s=3;){if(t.available()<10)throw new ae;var o=t.readBits(10);if(o>=1e3)throw new ae;n.append(e.toAlphaNumericChar(Math.floor(o/100))),n.append(e.toAlphaNumericChar(Math.floor(o/10)%10)),n.append(e.toAlphaNumericChar(o%10)),r-=3}if(r===2){if(t.available()<7)throw new ae;var i=t.readBits(7);if(i>=100)throw new ae;n.append(e.toAlphaNumericChar(Math.floor(i/10))),n.append(e.toAlphaNumericChar(i%10))}else if(r===1){if(t.available()<4)throw new ae;var a=t.readBits(4);if(a>=10)throw new ae;n.append(e.toAlphaNumericChar(a))}},e.parseECIValue=function(t){var n=t.readBits(8);if(!(128&n))return 127&n;if((192&n)==128)return(63&n)<<8&4294967295|t.readBits(8);if((224&n)==192)return(31&n)<<16&4294967295|t.readBits(16);throw new ae},e.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.GB2312_SUBSET=1,e}(),Wk=function(){function e(t){this.mirrored=t}return e.prototype.isMirrored=function(){return this.mirrored},e.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&t!==null&&!(t.length<3)){var n=t[0];t[0]=t[2],t[2]=n}},e}(),q4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},qle=function(){function e(){this.rsDecoder=new Nm(pa.QR_CODE_FIELD_256)}return e.prototype.decodeBooleanArray=function(t,n){return this.decodeBitMatrix(zi.parseFromBooleanArray(t),n)},e.prototype.decodeBitMatrix=function(t,n){var r=new Gle(t),o=null;try{return this.decodeBitMatrixParser(r,n)}catch(a){o=a}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var i=this.decodeBitMatrixParser(r,n);return i.setOther(new Wk(!0)),i}catch(a){throw o!==null?o:a}},e.prototype.decodeBitMatrixParser=function(t,n){var r,o,i,a,s=t.readVersion(),l=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),c=Kle.getDataBlocks(u,s,l),f=0;try{for(var d=q4(c),h=d.next();!h.done;h=d.next())f+=(g=h.value).getNumDataCodewords()}catch(A){r={error:A}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}var p=new Uint8Array(f),m=0;try{for(var S=q4(c),b=S.next();!b.done;b=S.next()){var g,E=(g=b.value).getCodewords(),T=g.getNumDataCodewords();this.correctErrors(E,T);for(var O=0;O=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Jle=function(){function e(t,n,r,o,i,a,s){this.image=t,this.startX=n,this.startY=r,this.width=o,this.height=i,this.moduleSize=a,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return e.prototype.find=function(){for(var t=this.startX,n=this.height,r=t+this.width,o=this.startY+n/2,i=new Int32Array(3),a=this.image,s=0;s=r)return!1;return!0},e.prototype.crossCheckVertical=function(t,n,r,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var l=t;l>=0&&i.get(n,l)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&!i.get(n,l)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=t+1;lr)return NaN;for(;lr)return NaN;var u=s[0]+s[1]+s[2];return 5*Math.abs(u-o)>=2*o?NaN:this.foundPatternCross(s)?e.centerFromEnd(s,l):NaN},e.prototype.handlePossibleCenter=function(t,n,r){var o,i,a=t[0]+t[1]+t[2],s=e.centerFromEnd(t,r),l=this.crossCheckVertical(n,s,2*t[1],a);if(!isNaN(l)){var u=(t[0]+t[1]+t[2])/3;try{for(var c=Qle(this.possibleCenters),f=c.next();!f.done;f=c.next()){var d=f.value;if(d.aboutEquals(u,l,s))return d.combineEstimate(l,s,u)}}catch(p){o={error:p}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}var h=new Zle(s,l,u);this.possibleCenters.push(h),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(h)}return null},e}(),eue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),tue=function(e){function t(n,r,o,i){var a=e.call(this,n,r)||this;return a.estimatedModuleSize=o,a.count=i,i===void 0&&(a.count=1),a}return eue(t,e),t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(n,r,o){if(Math.abs(r-this.getY())<=n&&Math.abs(o-this.getX())<=n){var i=Math.abs(n-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(n,r,o){var i=this.count+1;return new t((this.count*this.getX()+r)/i,(this.count*this.getY()+n)/i,(this.count*this.estimatedModuleSize+o)/i,i)},t}(we),nue=function(){function e(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e}(),fc=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},rue=function(){function e(t,n){this.image=t,this.resultPointCallback=n,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=n}return e.prototype.getImage=function(){return this.image},e.prototype.getPossibleCenters=function(){return this.possibleCenters},e.prototype.find=function(t){var n=t!=null&&t.get(Et.TRY_HARDER)!==void 0,r=t!=null&&t.get(Et.PURE_BARCODE)!==void 0,o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*e.MAX_MODULES));(su[2]&&(c+=h-u[2]-s,d=a-1)}f=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,f=3;else u[++f]++;e.foundPatternCross(u)&&this.handlePossibleCenter(u,c,a,r)===!0&&(s=u[0],this.hasSkipped&&(l=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return we.orderBestPatterns(p),new nue(p)},e.centerFromEnd=function(t,n){return n-t[4]-t[3]-t[2]/2},e.foundPatternCross=function(t){for(var n=0,r=0;r<5;r++){var o=t[r];if(o===0)return!1;n+=o}if(n<7)return!1;var i=n/7,a=i/2;return Math.abs(i-t[0])=a&&n>=a&&s.get(n-a,t-a);)i[2]++,a++;if(t=a&&n>=a&&!s.get(n-a,t-a)&&i[1]<=r;)i[1]++,a++;if(tr)return!1;for(;t>=a&&n>=a&&s.get(n-a,t-a)&&i[0]<=r;)i[0]++,a++;if(i[0]>r)return!1;var l=s.getHeight(),u=s.getWidth();for(a=1;t+a=l||n+a>=u)return!1;for(;t+a=l||n+a>=u||i[3]>=r)return!1;for(;t+a=r)return!1;var c=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(c-o)<2*o&&e.foundPatternCross(i)},e.prototype.crossCheckVertical=function(t,n,r,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),l=t;l>=0&&i.get(n,l);)s[2]++,l--;if(l<0)return NaN;for(;l>=0&&!i.get(n,l)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&i.get(n,l)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=t+1;l=r)return NaN;for(;l=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=2*o?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,l):NaN},e.prototype.crossCheckHorizontal=function(t,n,r,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),l=t;l>=0&&i.get(l,n);)s[2]++,l--;if(l<0)return NaN;for(;l>=0&&!i.get(l,n)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&i.get(l,n)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=t+1;l=r)return NaN;for(;l=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=o?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,l):NaN},e.prototype.handlePossibleCenter=function(t,n,r,o){var i=t[0]+t[1]+t[2]+t[3]+t[4],a=e.centerFromEnd(t,r),s=this.crossCheckVertical(n,Math.floor(a),t[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),t[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),t[2],i)))){for(var l=i/7,u=!1,c=this.possibleCenters,f=0,d=c.length;f=e.CENTER_QUORUM){if(r!=null)return this.hasSkipped=!0,Math.floor((Math.abs(r.getX()-a.getX())-Math.abs(r.getY()-a.getY()))/2);r=a}}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return 0},e.prototype.haveMultiplyConfirmedCenters=function(){var t,n,r,o,i=0,a=0,s=this.possibleCenters.length;try{for(var l=fc(this.possibleCenters),u=l.next();!u.done;u=l.next())(p=u.value).getCount()>=e.CENTER_QUORUM&&(i++,a+=p.getEstimatedModuleSize())}catch(m){t={error:m}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}if(i<3)return!1;var c=a/s,f=0;try{for(var d=fc(this.possibleCenters),h=d.next();!h.done;h=d.next()){var p=h.value;f+=Math.abs(p.getEstimatedModuleSize()-c)}}catch(m){r={error:m}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}return f<=.05*a},e.prototype.selectBestPatterns=function(){var t,n,r,o,i=this.possibleCenters.length;if(i<3)throw new Y;var a,s=this.possibleCenters;if(i>3){var l=0,u=0;try{for(var c=fc(this.possibleCenters),f=c.next();!f.done;f=c.next()){var d=f.value.getEstimatedModuleSize();l+=d,u+=d*d}}catch(E){t={error:E}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}a=l/i;var h=Math.sqrt(u/i-a*a);s.sort(function(E,T){var O=Math.abs(T.getEstimatedModuleSize()-a),A=Math.abs(E.getEstimatedModuleSize()-a);return OA?1:0});for(var p=Math.max(.2*a,h),m=0;m3;m++){var S=s[m];Math.abs(S.getEstimatedModuleSize()-a)>p&&(s.splice(m,1),m--)}}if(s.length>3){l=0;try{for(var b=fc(s),g=b.next();!g.done;g=b.next())l+=g.value.getEstimatedModuleSize()}catch(E){r={error:E}}finally{try{g&&!g.done&&(o=b.return)&&o.call(b)}finally{if(r)throw r.error}}a=l/s.length,s.sort(function(E,T){if(T.getCount()===E.getCount()){var O=Math.abs(T.getEstimatedModuleSize()-a),A=Math.abs(E.getEstimatedModuleSize()-a);return OA?-1:0}return T.getCount()-E.getCount()}),s.splice(3)}return[s[0],s[1],s[2]]},e.CENTER_QUORUM=2,e.MIN_SKIP=3,e.MAX_MODULES=57,e}(),oue=function(){function e(t){this.image=t}return e.prototype.getImage=function(){return this.image},e.prototype.getResultPointCallback=function(){return this.resultPointCallback},e.prototype.detect=function(t){this.resultPointCallback=t==null?null:t.get(Et.NEED_RESULT_POINT_CALLBACK);var n=new rue(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(n)},e.prototype.processFinderPatternInfo=function(t){var n=t.getTopLeft(),r=t.getTopRight(),o=t.getBottomLeft(),i=this.calculateModuleSize(n,r,o);if(i<1)throw new Y("No pattern found in proccess finder.");var a=e.computeDimension(n,r,o,i),s=pp.getProvisionalVersionForDimension(a),l=s.getDimensionForVersion()-7,u=null;if(s.getAlignmentPatternCenters().length>0)for(var c=r.getX()-n.getX()+o.getX(),f=r.getY()-n.getY()+o.getY(),d=1-3/l,h=Math.floor(n.getX()+d*(c-n.getX())),p=Math.floor(n.getY()+d*(f-n.getY())),m=4;m<=16;m<<=1)try{u=this.findAlignmentInRegion(i,h,p,m);break}catch(g){if(!(g instanceof Y))throw g}var S=e.createTransform(n,r,o,u,a),b=e.sampleGrid(this.image,S,a);return new C_(b,u===null?[o,n,r]:[o,n,r,u])},e.createTransform=function(t,n,r,o,i){var a,s,l,u,c=i-3.5;return o!==null?(a=o.getX(),s=o.getY(),u=l=c-3):(a=n.getX()-t.getX()+r.getX(),s=n.getY()-t.getY()+r.getY(),l=c,u=c),Fk.quadrilateralToQuadrilateral(3.5,3.5,c,3.5,l,u,3.5,c,t.getX(),t.getY(),n.getX(),n.getY(),a,s,r.getX(),r.getY())},e.sampleGrid=function(t,n,r){return x_.getInstance().sampleGridWithTransform(t,r,r,n)},e.computeDimension=function(t,n,r,o){var i=Qe.round(we.distance(t,n)/o),a=Qe.round(we.distance(t,r)/o),s=Math.floor((i+a)/2)+7;switch(3&s){case 0:s++;break;case 2:s--;break;case 3:throw new Y("Dimensions could be not found.")}return s},e.prototype.calculateModuleSize=function(t,n,r){return(this.calculateModuleSizeOneWay(t,n)+this.calculateModuleSizeOneWay(t,r))/2},e.prototype.calculateModuleSizeOneWay=function(t,n){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(n.getX()),Math.floor(n.getY())),o=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()),Math.floor(n.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(r)?o/7:isNaN(o)?r/7:(r+o)/14},e.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,n,r,o){var i=this.sizeOfBlackWhiteBlackRun(t,n,r,o),a=1,s=t-(r-t);s<0?(a=t/(t-s),s=0):s>=this.image.getWidth()&&(a=(this.image.getWidth()-1-t)/(s-t),s=this.image.getWidth()-1);var l=Math.floor(n-(o-n)*a);return a=1,l<0?(a=n/(n-l),l=0):l>=this.image.getHeight()&&(a=(this.image.getHeight()-1-n)/(l-n),l=this.image.getHeight()-1),s=Math.floor(t+(s-t)*a),(i+=this.sizeOfBlackWhiteBlackRun(t,n,s,l))-1},e.prototype.sizeOfBlackWhiteBlackRun=function(t,n,r,o){var i=Math.abs(o-n)>Math.abs(r-t);if(i){var a=t;t=n,n=a,a=r,r=o,o=a}for(var s=Math.abs(r-t),l=Math.abs(o-n),u=-s/2,c=t0){if(m===o)break;m+=f,u-=s}}return d===2?Qe.distance(r+c,o,t,n):NaN},e.prototype.findAlignmentInRegion=function(t,n,r,o){var i=Math.floor(o*t),a=Math.max(0,n-i),s=Math.min(this.image.getWidth()-1,n+i);if(s-a<3*t)throw new Y("Alignment top exceeds estimated module size.");var l=Math.max(0,r-i),u=Math.min(this.image.getHeight()-1,r+i);if(u-l<3*t)throw new Y("Alignment bottom exceeds estimated module size.");return new Jle(this.image,a,l,s-a,u-l,t,this.resultPointCallback).find()},e}(),T1=function(){function e(){this.decoder=new qle}return e.prototype.getDecoder=function(){return this.decoder},e.prototype.decode=function(t,n){var r,o;if(n!=null&&n.get(Et.PURE_BARCODE)!==void 0){var i=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decodeBitMatrix(i,n),o=e.NO_POINTS}else{var a=new oue(t.getBlackMatrix()).detect(n);r=this.decoder.decodeBitMatrix(a.getBits(),n),o=a.getPoints()}r.getOther()instanceof Wk&&r.getOther().applyMirroredCorrection(o);var s=new Nr(r.getText(),r.getRawBytes(),void 0,o,Te.QR_CODE,void 0),l=r.getByteSegments();l!==null&&s.putMetadata(Ln.BYTE_SEGMENTS,l);var u=r.getECLevel();return u!==null&&s.putMetadata(Ln.ERROR_CORRECTION_LEVEL,u),r.hasStructuredAppend()&&(s.putMetadata(Ln.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),s.putMetadata(Ln.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),s},e.prototype.reset=function(){},e.extractPureBits=function(t){var n=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(n===null||r===null)throw new Y;var o=this.moduleSize(n,t),i=n[1],a=r[1],s=n[0],l=r[0];if(s>=l||i>=a)throw new Y;if(a-i!=l-s&&(l=s+(a-i))>=t.getWidth())throw new Y;var u=Math.round((l-s+1)/o),c=Math.round((a-i+1)/o);if(u<=0||c<=0)throw new Y;if(c!==u)throw new Y;var f=Math.floor(o/2);i+=f;var d=(s+=f)+Math.floor((u-1)*o)-l;if(d>0){if(d>f)throw new Y;s-=d}var h=i+Math.floor((c-1)*o)-a;if(h>0){if(h>f)throw new Y;i-=h}for(var p=new zi(u,c),m=0;m=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Xe=function(){function e(){}return e.prototype.PDF417Common=function(){},e.getBitCountSum=function(t){return Qe.sum(t)},e.toIntArray=function(t){var n,r;if(t==null||!t.length)return e.EMPTY_INT_ARRAY;var o=new Int32Array(t.length),i=0;try{for(var a=iue(t),s=a.next();!s.done;s=a.next()){var l=s.value;o[i++]=l}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},e.getCodeword=function(t){var n=Kr.binarySearch(e.SYMBOL_TABLE,262143&t);return n<0?-1:(e.CODEWORD_TABLE[n]-1)%e.NUMBER_OF_CODEWORDS},e.NUMBER_OF_CODEWORDS=929,e.MAX_CODEWORDS_IN_BARCODE=e.NUMBER_OF_CODEWORDS-1,e.MIN_ROWS_IN_BARCODE=3,e.MAX_ROWS_IN_BARCODE=90,e.MODULES_IN_CODEWORD=17,e.MODULES_IN_STOP_PATTERN=18,e.BARS_IN_MODULE=8,e.EMPTY_INT_ARRAY=new Int32Array([]),e.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),e.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),e}(),aue=function(){function e(t,n){this.bits=t,this.points=n}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),sue=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},lue=function(){function e(){}return e.detectMultiple=function(t,n,r){var o=t.getBlackMatrix(),i=e.detect(r,o);return i.length||((o=o.clone()).rotate180(),i=e.detect(r,o)),new aue(o,i)},e.detect=function(t,n){for(var r,o,i=new Array,a=0,s=0,l=!1;a0;){if((d=e.findGuardPattern(t,i,--o,r,!1,a,u))==null){o++;break}h=d}s[0]=new we(h[0],o),s[1]=new we(h[1],o),l=!0;break}var c=o+1;if(l){for(var f=0,d=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);ce.SKIPPED_ROW_COUNT_MAX)break;f++}}c-=f+1,s[2]=new we(d[0],c),s[3]=new we(d[1],c)}return c-o0&&u++d?f-d:d-f;if(h>r)return 1/0;u+=h}return u/i},e.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),e.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),e.MAX_AVG_VARIANCE=.42,e.MAX_INDIVIDUAL_VARIANCE=.8,e.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),e.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),e.MAX_PIXEL_DRIFT=3,e.MAX_PATTERN_DRIFT=5,e.SKIPPED_ROW_COUNT_MAX=25,e.ROW_STEP=5,e.BARCODE_MIN_HEIGHT=10,e}(),uue=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ss=function(){function e(t,n){if(n.length===0)throw new Me;this.field=t;var r=n.length;if(r>1&&n[0]===0){for(var o=1;or.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;It.arraycopy(r,0,i,0,a);for(var s=a;s=0;n--){var r=this.getCoefficient(n);r!==0&&(r<0?(t.append(" - "),r=-r):t.length()>0&&t.append(" + "),n!==0&&r===1||t.append(r),n!==0&&(n===1?t.append("x"):(t.append("x^"),t.append(n))))}return t.toString()},e}(),cue=function(){function e(){}return e.prototype.add=function(t,n){return(t+n)%this.modulus},e.prototype.subtract=function(t,n){return(this.modulus+t-n)%this.modulus},e.prototype.exp=function(t){return this.expTable[t]},e.prototype.log=function(t){if(t===0)throw new Me;return this.logTable[t]},e.prototype.inverse=function(t){if(t===0)throw new jk;return this.expTable[this.modulus-this.logTable[t]-1]},e.prototype.multiply=function(t,n){return t===0||n===0?0:this.expTable[(this.logTable[t]+this.logTable[n])%(this.modulus-1)]},e.prototype.getSize=function(){return this.modulus},e.prototype.equals=function(t){return t===this},e}(),fue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),due=function(e){function t(n,r){var o=e.call(this)||this;o.modulus=n,o.expTable=new Int32Array(n),o.logTable=new Int32Array(n);for(var i=1,a=0;a=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pue=function(){function e(){this.field=due.PDF417_GF}return e.prototype.decode=function(t,n,r){for(var o,i,a=new Ss(this.field,t),s=new Int32Array(n),l=!1,u=n;u>0;u--){var c=a.evaluateAt(this.field.exp(u));s[n-u]=c,c!==0&&(l=!0)}if(!l)return 0;var f=this.field.getOne();if(r!=null)try{for(var d=hue(r),h=d.next();!h.done;h=d.next()){var p=h.value,m=this.field.exp(t.length-1-p),S=new Ss(this.field,new Int32Array([this.field.subtract(0,m),1]));f=f.multiply(S)}}catch(y){o={error:y}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}var b=new Ss(this.field,s),g=this.runEuclideanAlgorithm(this.field.buildMonomial(n,1),b,n),E=g[0],T=g[1],O=this.findErrorLocations(E),A=this.findErrorMagnitudes(T,E,O);for(u=0;u=Math.round(r/2);){var u=i,c=s;if(s=l,(i=a).isZero())throw hn.getChecksumInstance();a=u;for(var f=this.field.getZero(),d=i.getCoefficient(i.getDegree()),h=this.field.inverse(d);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),m=this.field.multiply(a.getCoefficient(a.getDegree()),h);f=f.add(this.field.buildMonomial(p,m)),a=a.subtract(i.multiplyByMonomial(p,m))}l=f.multiply(s).subtract(c).negative()}var S=l.getCoefficient(0);if(S===0)throw hn.getChecksumInstance();var b=this.field.inverse(S);return[l.multiply(b),a.multiply(b)]},e.prototype.findErrorLocations=function(t){for(var n=t.getDegree(),r=new Int32Array(n),o=0,i=1;i0){var l=r?this.topLeft:this.topRight,u=Math.trunc(l.getY()-t);u<0&&(u=0);var c=new we(l.getX(),u);r?o=c:a=c}if(n>0){var f=r?this.bottomLeft:this.bottomRight,d=Math.trunc(f.getY()+n);d>=this.image.getHeight()&&(d=this.image.getHeight()-1);var h=new we(f.getX(),d);r?i=h:s=h}return new e(this.image,o,i,a,s)},e.prototype.getMinX=function(){return this.minX},e.prototype.getMaxX=function(){return this.maxX},e.prototype.getMinY=function(){return this.minY},e.prototype.getMaxY=function(){return this.maxY},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getBottomRight=function(){return this.bottomRight},e}(),mue=function(){function e(t,n,r,o){this.columnCount=t,this.errorCorrectionLevel=o,this.rowCountUpperPart=n,this.rowCountLowerPart=r,this.rowCount=n+r}return e.prototype.getColumnCount=function(){return this.columnCount},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},e.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},e}(),A_=function(){function e(){this.buffer=""}return e.form=function(t,n){var r=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(o,i,a,s,l,u){if(o==="%%")return"%";if(n[++r]!==void 0){o=s?parseInt(s.substr(1)):void 0;var c,f=l?parseInt(l.substr(1)):void 0;switch(u){case"s":c=n[r];break;case"c":c=n[r][0];break;case"f":c=parseFloat(n[r]).toFixed(o);break;case"p":c=parseFloat(n[r]).toPrecision(o);break;case"e":c=parseFloat(n[r]).toExponential(o);break;case"x":c=parseInt(n[r]).toString(f||16);break;case"d":c=parseFloat(parseInt(n[r],f||10).toPrecision(o)).toFixed(0)}c=typeof c=="object"?JSON.stringify(c):(+c).toString(f);for(var d=parseInt(a),h=a&&a[0]+""=="0"?"0":" ";c.length=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gk=function(){function e(t){this.boundingBox=new _w(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return e.prototype.getCodewordNearby=function(t){var n=this.getCodeword(t);if(n!=null)return n;for(var r=1;r=0&&(n=this.codewords[o])!=null||(o=this.imageRowToCodewordIndex(t)+r)=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vue=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Tc=function(){function e(){this.values=new Map}return e.prototype.setValue=function(t){t=Math.trunc(t);var n=this.values.get(t);n==null&&(n=0),n++,this.values.set(t,n)},e.prototype.getValue=function(){var t,n,r=-1,o=new Array,i=function(u,c){var f=function(){return u},d=function(){return c};d()>r?(r=d(),(o=[]).push(f())):d()===r&&o.push(f())};try{for(var a=gue(this.values.entries()),s=a.next();!s.done;s=a.next()){var l=vue(s.value,2);i(l[0],l[1])}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return Xe.toIntArray(o)},e.prototype.getConfidence=function(t){return this.values.get(t)},e}(),wue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lg=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Y4=function(e){function t(n,r){var o=e.call(this,n)||this;return o._isLeft=r,o}return wue(t,e),t.prototype.setRowNumbers=function(){var n,r;try{for(var o=Lg(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;a!=null&&a.setRowNumberAsRowIndicatorColumn()}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(n){var r=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(r,n);for(var o=this.getBoundingBox(),i=this._isLeft?o.getTopLeft():o.getTopRight(),a=this._isLeft?o.getBottomLeft():o.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),l=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=-1,c=1,f=0,d=s;d=n.getRowCount()||p>d)r[d]=null;else{for(var m=void 0,S=(m=c>2?(c-2)*p:p)>=d,b=1;b<=m&&!S;b++)S=r[d-b]!=null;S?r[d]=null:(u=h.getRowNumber(),f=1)}}},t.prototype.getRowHeights=function(){var n,r,o=this.getBarcodeMetadata();if(o==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(o);var i=new Int32Array(o.getRowCount());try{for(var a=Lg(this.getCodewords()),s=a.next();!s.done;s=a.next()){var l=s.value;if(l!=null){var u=l.getRowNumber();if(u>=i.length)continue;i[u]++}}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(n){for(var r=this.getBoundingBox(),o=this._isLeft?r.getTopLeft():r.getTopRight(),i=this._isLeft?r.getBottomLeft():r.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),l=this.getCodewords(),u=-1,c=a;c=n.getRowCount()?l[c]=null:u=f.getRowNumber())}},t.prototype.getBarcodeMetadata=function(){var n,r,o=this.getCodewords(),i=new Tc,a=new Tc,s=new Tc,l=new Tc;try{for(var u=Lg(o),c=u.next();!c.done;c=u.next()){var f=c.value;if(f!=null){f.setRowNumberAsRowIndicatorColumn();var d=f.getValue()%30,h=f.getRowNumber();switch(this._isLeft||(h+=2),h%3){case 0:a.setValue(3*d+1);break;case 1:l.setValue(d/3),s.setValue(d%3);break;case 2:i.setValue(d+1)}}}}catch(m){n={error:m}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(i.getValue().length===0||a.getValue().length===0||s.getValue().length===0||l.getValue().length===0||i.getValue()[0]<1||a.getValue()[0]+s.getValue()[0]Xe.MAX_ROWS_IN_BARCODE)return null;var p=new mue(i.getValue()[0],a.getValue()[0],s.getValue()[0],l.getValue()[0]);return this.removeIncorrectCodewords(o,p),p},t.prototype.removeIncorrectCodewords=function(n,r){for(var o=0;or.getRowCount())n[o]=null;else switch(this._isLeft||(s+=2),s%3){case 0:3*a+1!==r.getRowCountUpperPart()&&(n[o]=null);break;case 1:Math.trunc(a/3)===r.getErrorCorrectionLevel()&&a%3===r.getRowCountLowerPart()||(n[o]=null);break;case 2:a+1!==r.getColumnCount()&&(n[o]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+` +`+e.prototype.toString.call(this)},t}(Gk),bue=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Sue=function(){function e(t,n){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=n,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return e.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t,n=Xe.MAX_CODEWORDS_IN_BARCODE;do t=n,n=this.adjustRowNumbersAndGetCount();while(n>0&&n0&&i0&&(u[0]=r[n-1],u[4]=s[n-1],u[5]=l[n-1]),n>1&&(u[8]=r[n-2],u[10]=s[n-2],u[11]=l[n-2]),n>=1;r=1&n,e.RATIOS_TABLE[t]||(e.RATIOS_TABLE[t]=new Array(Xe.BARS_IN_MODULE)),e.RATIOS_TABLE[t][Xe.BARS_IN_MODULE-o-1]=Math.fround(i/Xe.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},e.getDecodedValue=function(t){var n=e.getDecodedCodewordValue(e.sampleBitCounts(t));return n!==-1?n:e.getClosestDecodedValue(t)},e.sampleBitCounts=function(t){for(var n=Qe.sum(t),r=new Int32Array(Xe.BARS_IN_MODULE),o=0,i=0,a=0;a1)for(var o=0;o=i)break}lt.length||r<0||n+r>t.length||n+r<0)throw new E_;if(r!==0)for(var o=0;o0&&this.grow(n)},t.prototype.grow=function(n){var r=this.buf.length<<1;if(r-n<0&&(r=n),r<0){if(n<0)throw new Tue;r=Dn.MAX_VALUE}this.buf=Kr.copyOfUint8Array(this.buf,r)},t.prototype.write=function(n){this.ensureCapacity(this.count+1),this.buf[this.count]=n,this.count+=1},t.prototype.writeBytesOffset=function(n,r,o){if(r<0||r>n.length||o<0||r+o-n.length>0)throw new E_;this.ensureCapacity(this.count+o),It.arraycopy(n,r,this.buf,this.count,o),this.count+=o},t.prototype.writeTo=function(n){n.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return Kr.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(n){return n?typeof n=="string"?this.toString_string(n):this.toString_number(n):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(n){return new String(this.buf).toString()},t.prototype.toString_number=function(n){return new String(this.buf).toString()},t.prototype.close=function(){},t}(Aue);function Kk(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function na(e){if(Ah===void 0&&(Ah=Kk()),Ah===null)throw new Error("BigInt is not supported!");return Ah(e)}(function(e){e[e.ALPHA=0]="ALPHA",e[e.LOWER=1]="LOWER",e[e.MIXED=2]="MIXED",e[e.PUNCT=3]="PUNCT",e[e.ALPHA_SHIFT=4]="ALPHA_SHIFT",e[e.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(ct||(ct={}));var kue=function(){function e(){}return e.decode=function(t,n){var r=new mt(""),o=mr.ISO8859_1;r.enableDecoding(o);for(var i=1,a=t[i++],s=new Cue;it[0])throw ae.getFormatInstance();for(var o=new Int32Array(e.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i0){for(var d=0;d<6;++d)a.write(Number(na(l)>>na(8*(5-d))));l=0,s=0}}o===n[0]&&f0){for(d=0;d<6;++d)a.write(Number(na(l)>>na(8*(5-d))));l=0,s=0}}}return i.append(ks.decode(a.toByteArray(),r)),o},e.numericCompaction=function(t,n,r){for(var o=0,i=!1,a=new Int32Array(e.MAX_NUMERIC_CODEWORDS);n0&&(r.append(e.decodeBase900toBase10(a,o)),o=0)}return n},e.decodeBase900toBase10=function(t,n){for(var r=na(0),o=0;o@[\\]_\`~!\r ,: +-.$/"|*()?{}'`,e.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",e.EXP900=Kk()?function(){var t=[];t[0]=na(1);var n=na(900);t[1]=n;for(var r=2;r<16;r++)t[r]=t[r-1]*n;return t}():[],e.NUMBER_OF_SEQUENCE_CODEWORDS=2,e}(),dc=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Mue=function(){function e(){}return e.decode=function(t,n,r,o,i,a,s){for(var l,u=new _w(t,n,r,o,i),c=null,f=null,d=!0;;d=!1){if(n!=null&&(c=e.getRowIndicatorColumn(t,u,n,!0,a,s)),o!=null&&(f=e.getRowIndicatorColumn(t,u,o,!1,a,s)),(l=e.merge(c,f))==null)throw Y.getNotFoundInstance();var h=l.getBoundingBox();if(!d||h==null||!(h.getMinY()u.getMaxY()))break;u=h}l.setBoundingBox(u);var p=l.getBarcodeColumnCount()+1;l.setDetectionResultColumn(0,c),l.setDetectionResultColumn(p,f);for(var m=c!=null,S=1;S<=p;S++){var b=m?S:p-S;if(l.getDetectionResultColumn(b)===void 0){var g=void 0;g=b===0||b===p?new Y4(u,b===0):new Gk(u),l.setDetectionResultColumn(b,g);for(var E=-1,T=E,O=u.getMinY();O<=u.getMaxY();O++){if((E=e.getStartColumn(l,b,O,m))<0||E>u.getMaxX()){if(T===-1)continue;E=T}var A=e.detectCodeword(t,u.getMinX(),u.getMaxX(),m,E,O,a,s);A!=null&&(g.setCodeword(O,A),T=E,a=Math.min(a,A.getWidth()),s=Math.max(s,A.getWidth()))}}}return e.createDecoderResult(l)},e.merge=function(t,n){if(t==null&&n==null)return null;var r=e.getBarcodeMetadata(t,n);if(r==null)return null;var o=_w.merge(e.adjustBoundingBox(t),e.adjustBoundingBox(n));return new Sue(r,o)},e.adjustBoundingBox=function(t){var n,r;if(t==null)return null;var o=t.getRowHeights();if(o==null)return null;var i=e.getMax(o),a=0;try{for(var s=dc(o),l=s.next();!l.done;l=s.next()){var u=l.value;if(a+=i-u,u>0)break}}catch(h){n={error:h}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var c=t.getCodewords(),f=0;a>0&&c[f]==null;f++)a--;var d=0;for(f=o.length-1;f>=0&&(d+=i-o[f],!(o[f]>0));f--);for(f=c.length-1;d>0&&c[f]==null;f--)d--;return t.getBoundingBox().addMissingRows(a,d,t.isLeft())},e.getMax=function(t){var n,r,o=-1;try{for(var i=dc(t),a=i.next();!a.done;a=i.next()){var s=a.value;o=Math.max(o,s)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},e.getBarcodeMetadata=function(t,n){var r,o;return t==null||(r=t.getBarcodeMetadata())==null?n==null?null:n.getBarcodeMetadata():n==null||(o=n.getBarcodeMetadata())==null?r:r.getColumnCount()!==o.getColumnCount()&&r.getErrorCorrectionLevel()!==o.getErrorCorrectionLevel()&&r.getRowCount()!==o.getRowCount()?null:r},e.getRowIndicatorColumn=function(t,n,r,o,i,a){for(var s=new Y4(n,o),l=0;l<2;l++)for(var u=l===0?1:-1,c=Math.trunc(Math.trunc(r.getX())),f=Math.trunc(Math.trunc(r.getY()));f<=n.getMaxY()&&f>=n.getMinY();f+=u){var d=e.detectCodeword(t,0,t.getWidth(),o,c,f,i,a);d!=null&&(s.setCodeword(f,d),c=o?d.getStartX():d.getEndX())}return s},e.adjustCodewordCount=function(t,n){var r=n[0][1],o=r.getValue(),i=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-e.getNumberOfECCodeWords(t.getBarcodeECLevel());if(o.length===0){if(i<1||i>Xe.MAX_CODEWORDS_IN_BARCODE)throw Y.getNotFoundInstance();r.setValue(i)}else o[0]!==i&&r.setValue(i)},e.createDecoderResult=function(t){var n=e.createBarcodeMatrix(t);e.adjustCodewordCount(t,n);for(var r=new Array,o=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),i=[],a=new Array,s=0;s0;){for(var l=0;l=0){if(S>=a.length)continue;a[S][u].setValue(m.getValue())}}}}catch(b){o={error:b}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}u++}}catch(b){n={error:b}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return a},e.isValidBarcodeColumn=function(t,n){return n>=0&&n<=t.getBarcodeColumnCount()+1},e.getStartColumn=function(t,n,r,o){var i,a,s=o?1:-1,l=null;if(e.isValidBarcodeColumn(t,n-s)&&(l=t.getDetectionResultColumn(n-s).getCodeword(r)),l!=null)return o?l.getEndX():l.getStartX();if((l=t.getDetectionResultColumn(n).getCodewordNearby(r))!=null)return o?l.getStartX():l.getEndX();if(e.isValidBarcodeColumn(t,n-s)&&(l=t.getDetectionResultColumn(n-s).getCodewordNearby(r)),l!=null)return o?l.getEndX():l.getStartX();for(var u=0;e.isValidBarcodeColumn(t,n-s);){n-=s;try{for(var c=(i=void 0,dc(t.getDetectionResultColumn(n).getCodewords())),f=c.next();!f.done;f=c.next()){var d=f.value;if(d!=null)return(o?d.getEndX():d.getStartX())+s*u*(d.getEndX()-d.getStartX())}}catch(h){i={error:h}}finally{try{f&&!f.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}u++}return o?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},e.detectCodeword=function(t,n,r,o,i,a,s,l){i=e.adjustCodewordStartColumn(t,n,r,o,i,a);var u,c=e.getModuleBitCount(t,n,r,o,i,a);if(c==null)return null;var f=Qe.sum(c);if(o)u=i+f;else{for(var d=0;d=n)&&u=n:se.CODEWORD_SKEW_SIZE)return i;s+=l}l=-l,o=!o}return s},e.checkCodewordSkew=function(t,n,r){return n-e.CODEWORD_SKEW_SIZE<=t&&t<=r+e.CODEWORD_SKEW_SIZE},e.decodeCodewords=function(t,n,r){if(t.length===0)throw ae.getFormatInstance();var o=1<r/2+e.MAX_ERRORS||r<0||r>e.MAX_EC_CODEWORDS)throw hn.getChecksumInstance();return e.errorCorrection.decode(t,r,n)},e.verifyCodewordCount=function(t,n){if(t.length<4)throw ae.getFormatInstance();var r=t[0];if(r>t.length)throw ae.getFormatInstance();if(r===0){if(!(n>=1;return n},e.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},e.getCodewordBucketNumber_number=function(t){return e.getCodewordBucketNumber(e.getBitCountForCodeword(t))},e.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},e.toString=function(t){for(var n=new A_,r=0;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},I1=function(){function e(){}return e.prototype.decode=function(t,n){n===void 0&&(n=null);var r=e.decode(t,n,!1);if(r==null||r.length===0||r[0]==null)throw Y.getNotFoundInstance();return r[0]},e.prototype.decodeMultiple=function(t,n){n===void 0&&(n=null);try{return e.decode(t,n,!0)}catch(r){throw r instanceof ae||r instanceof hn?Y.getNotFoundInstance():r}},e.decode=function(t,n,r){var o,i,a=new Array,s=lue.detectMultiple(t,n,r);try{for(var l=Due(s.getPoints()),u=l.next();!u.done;u=l.next()){var c=u.value,f=Mue.decode(s.getBits(),c[4],c[5],c[6],c[7],e.getMinCodewordWidth(c),e.getMaxCodewordWidth(c)),d=new Nr(f.getText(),f.getRawBytes(),void 0,c,Te.PDF_417);d.putMetadata(Ln.ERROR_CORRECTION_LEVEL,f.getECLevel());var h=f.getOther();h!=null&&d.putMetadata(Ln.PDF417_EXTRA_METADATA,h),a.push(d)}}catch(p){o={error:p}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return a.map(function(p){return p})},e.getMaxWidth=function(t,n){return t==null||n==null?0:Math.trunc(Math.abs(t.getX()-n.getX()))},e.getMinWidth=function(t,n){return t==null||n==null?Dn.MAX_VALUE:Math.trunc(Math.abs(t.getX()-n.getX()))},e.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(e.getMaxWidth(t[0],t[4]),e.getMaxWidth(t[6],t[2])*Xe.MODULES_IN_CODEWORD/Xe.MODULES_IN_STOP_PATTERN),Math.max(e.getMaxWidth(t[1],t[5]),e.getMaxWidth(t[7],t[3])*Xe.MODULES_IN_CODEWORD/Xe.MODULES_IN_STOP_PATTERN)))},e.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(e.getMinWidth(t[0],t[4]),e.getMinWidth(t[6],t[2])*Xe.MODULES_IN_CODEWORD/Xe.MODULES_IN_STOP_PATTERN),Math.min(e.getMinWidth(t[1],t[5]),e.getMinWidth(t[7],t[3])*Xe.MODULES_IN_CODEWORD/Xe.MODULES_IN_STOP_PATTERN)))},e.prototype.reset=function(){},e}(),Lue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q4=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Lue(t,e),t.kind="ReaderException",t}(Lr),J4=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Xk=function(){function e(){}return e.prototype.decode=function(t,n){return this.setHints(n),this.decodeInternal(t)},e.prototype.decodeWithState=function(t){return this.readers!==null&&this.readers!==void 0||this.setHints(null),this.decodeInternal(t)},e.prototype.setHints=function(t){this.hints=t;var n=t!=null&&t.get(Et.TRY_HARDER)!==void 0,r=t==null?null:t.get(Et.POSSIBLE_FORMATS),o=new Array;if(r!=null){var i=r.some(function(a){return a===Te.UPC_A||a===Te.UPC_E||a===Te.EAN_13||a===Te.EAN_8||a===Te.CODABAR||a===Te.CODE_39||a===Te.CODE_93||a===Te.CODE_128||a===Te.ITF||a===Te.RSS_14||a===Te.RSS_EXPANDED});i&&!n&&o.push(new Ul(t)),r.includes(Te.QR_CODE)&&o.push(new T1),r.includes(Te.DATA_MATRIX)&&o.push(new P1),r.includes(Te.AZTEC)&&o.push(new O1),r.includes(Te.PDF_417)&&o.push(new I1),i&&n&&o.push(new Ul(t))}o.length===0&&(n||o.push(new Ul(t)),o.push(new T1),o.push(new P1),o.push(new O1),o.push(new I1),n&&o.push(new Ul(t))),this.readers=o},e.prototype.reset=function(){var t,n;if(this.readers!==null)try{for(var r=J4(this.readers),o=r.next();!o.done;o=r.next())o.value.reset()}catch(i){t={error:i}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.decodeInternal=function(t){var n,r;if(this.readers===null)throw new Q4("No readers where selected, nothing can be read.");try{for(var o=J4(this.readers),i=o.next();!i.done;i=o.next()){var a=i.value;try{return a.decode(t,this.hints)}catch(s){if(s instanceof Q4)continue}}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}throw new Y("No MultiFormat Readers were able to detect the code.")},e}(),Nue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){n===void 0&&(n=null),r===void 0&&(r=500);var o=new Xk;return o.setHints(n),e.call(this,o,r)||this}Nue(t,e),t.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)}})(Uu);var Bue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n){return n===void 0&&(n=500),e.call(this,new I1,n)||this}Bue(t,e)})(Uu);var e8,jue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n){return n===void 0&&(n=500),e.call(this,new T1,n)||this}jue(t,e)})(Uu),function(e){e[e.ERROR_CORRECTION=0]="ERROR_CORRECTION",e[e.CHARACTER_SET=1]="CHARACTER_SET",e[e.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",e[e.MIN_SIZE=3]="MIN_SIZE",e[e.MAX_SIZE=4]="MAX_SIZE",e[e.MARGIN=5]="MARGIN",e[e.PDF417_COMPACT=6]="PDF417_COMPACT",e[e.PDF417_COMPACTION=7]="PDF417_COMPACTION",e[e.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",e[e.AZTEC_LAYERS=9]="AZTEC_LAYERS",e[e.QR_VERSION=10]="QR_VERSION"}(e8||(e8={}));var Fue=function(){function e(){}return e.applyMaskPenaltyRule1=function(t){return e.applyMaskPenaltyRule1Internal(t,!0)+e.applyMaskPenaltyRule1Internal(t,!1)},e.applyMaskPenaltyRule2=function(t){for(var n=0,r=t.getArray(),o=t.getWidth(),i=t.getHeight(),a=0;a=5&&(r+=e.N1+(l-5)),l=1,u=f)}l>=5&&(r+=e.N1+(l-5))}return r},e.N1=3,e.N2=3,e.N3=40,e.N4=10,e}(),$ue=function(){function e(){this.maskPattern=-1}return e.prototype.getMode=function(){return this.mode},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getVersion=function(){return this.version},e.prototype.getMaskPattern=function(){return this.maskPattern},e.prototype.getMatrix=function(){return this.matrix},e.prototype.toString=function(){var t=new mt;return t.append(`<< `),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append(` ecLevel: `),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append(` version: `),t.append(this.version?this.version.toString():"null"),t.append(` @@ -450,22 +450,22 @@ Error generating stack: `+i.message+` `),t.append(this.matrix.toString())):t.append(` matrix: null `),t.append(`>> -`),t.toString()},e.prototype.setMode=function(t){this.mode=t},e.prototype.setECLevel=function(t){this.ecLevel=t},e.prototype.setVersion=function(t){this.version=t},e.prototype.setMaskPattern=function(t){this.maskPattern=t},e.prototype.setMatrix=function(t){this.matrix=t},e.isValidMaskPattern=function(t){return t>=0&&t0;){for(a===6&&(a-=1);s>=0&&s=r;)t^=n<=0)for(var l=0;l!==a;l++){var u=o[l];u>=0&&e.isEmpty(n.get(u,s))&&e.embedPositionAdjustmentPattern(u-2,s-2,n)}}},e.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),e.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),e.VERSION_INFO_POLY=7973,e.TYPE_INFO_POLY=1335,e.TYPE_INFO_MASK_PATTERN=21522,e})();(function(){Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),mr.UTF8.getName()})();var xue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r,o,i,a,s,l,u){var c=e.call(this,s,l)||this;if(c.yuvData=n,c.dataWidth=r,c.dataHeight=o,c.left=i,c.top=a,i+s>r||a+l>o)throw new Me("Crop rectangle does not fit within image data.");return u&&c.reverseHorizontal(s,l),c}xue(t,e),t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length>16&255,m=h>>7&510,_=255&h;f[d]=(p+m+_)/4&255}u.luminances=f}else u.luminances=n;if(i===void 0&&(u.dataWidth=r),a===void 0&&(u.dataHeight=o),s===void 0&&(u.left=0),l===void 0&&(u.top=0),u.left+r>u.dataWidth||u.top+o>u.dataHeight)throw new Me("Crop rectangle does not fit within image data.");return u}Oue(t,e),t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length"},t}(Pue),Iue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r,o){var i=e.call(this,n,0,0)||this;return i.binaryShiftStart=r,i.binaryShiftByteCount=o,i}Iue(t,e),t.prototype.appendTo=function(n,r){for(var o=0;o62?n.appendBits(this.binaryShiftByteCount-31,16):o===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(r[this.binaryShiftStart+o],8)},t.prototype.addBinaryShift=function(n,r){return new t(this,n,r)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}})(Dk);new Dk(null,0,0);var Rue=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(e){var t,n;try{for(var r=Rue(e),o=r.next();!o.done;o=r.next()){var i=o.value;Gr.fill(i,-1)}}catch(a){t={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}e[0][4]=0,e[1][4]=0,e[1][0]=28,e[3][4]=0,e[2][4]=0,e[2][0]=15})(Gr.createInt32Array(6,6)),function(e){var t=gn.getCharCode(" "),n=gn.getCharCode("."),r=gn.getCharCode(",");e[0][t]=1;for(var o=gn.getCharCode("Z"),i=gn.getCharCode("A"),a=i;a<=o;a++)e[0][a]=a-i+2;e[1][t]=1;var s=gn.getCharCode("z"),l=gn.getCharCode("a");for(a=l;a<=s;a++)e[1][a]=a-l+2;e[2][t]=1;var u=gn.getCharCode("9"),c=gn.getCharCode("0");for(a=c;a<=u;a++)e[2][a]=a-c+2;e[2][r]=12,e[2][n]=13;for(var f=["\0"," ","","","","","","","\x07","\b"," ",` -`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""],d=0;d","?","[","]","{","}"];for(d=0;d0&&(e[4][gn.getCharCode(h[d])]=d)}(Gr.createInt32Array(5,256));var kue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mue=function(e){function t(n){var r=e.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=t.makeBufferFromCanvasImageData(n),r}return kue(t,e),t.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var o=r.getImageData(0,0,n.width,n.height);return t.toGrayscaleBuffer(o.data,n.width,n.height)},t.toGrayscaleBuffer=function(n,r,o){for(var i=new Uint8ClampedArray(r*o),a=0,s=0,l=n.length;a>10,i[s]=u}return i},t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length0&&o[o.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Lue={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},Uu=function(){function e(t,n,r){n===void 0&&(n=new Map),r===void 0&&(r={}),this.reader=t,this.hints=n,this.options=Vl(Vl({},Lue),r)}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(t){this.hints.set(Et.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),e.addVideoSource=function(t,n){try{t.srcObject=n}catch{t.src=URL.createObjectURL(n)}},e.mediaStreamSetTorch=function(t,n){return Xt(this,void 0,void 0,function(){return qt(this,function(r){switch(r.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:n?"flash":"off",torch:!!n}]})];case 1:return r.sent(),[2]}})})},e.mediaStreamIsTorchCompatible=function(t){var n,r,o=t.getVideoTracks();try{for(var i=Oh(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(e.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.mediaStreamIsTorchCompatibleTrack=function(t){try{return"torch"in t.getCapabilities()}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},e.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},e.getMediaElement=function(t,n){var r=document.getElementById(t);if(!r)throw new Yt("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Yt("element with id '"+t+"' must be an "+n+" element");return r},e.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if(typeof t=="string")return e.getMediaElement(t,"video");if(!t&&typeof document<"u"){var n=document.createElement("video");return n.width=200,n.height=200,n}throw new Error("Couldn't get videoElement from videoSource!")},e.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if(typeof t=="string")return e.getMediaElement(t,"img");if(t===void 0){var n=document.createElement("img");return n.width=200,n.height=200,n}throw new Error("Couldn't get imageElement from imageSource!")},e.prepareVideoElement=function(t){var n=e.createVideoElement(t);return n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},e.isImageLoaded=function(t){return!!t.complete&&t.naturalWidth!==0},e.createBinaryBitmapFromCanvas=function(t){var n=new Mue(t),r=new _k(n);return new Sk(r)},e.drawImageOnCanvas=function(t,n){t.drawImage(n,0,0)},e.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimentions!")},e.createCaptureCanvas=function(t){if(!t)throw new Yt("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement("canvas"),r=e.getMediaElementDimensions(t),o=r.width,i=r.height;return n.style.width=o+"px",n.style.height=i+"px",n.width=o,n.height=i,n},e.tryPlayVideo=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:if(t!=null&&t.ended)return console.error("Trying to play video that has ended."),[2,!1];if(e.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn("It was not possible to play the video.",n),[2,!1];case 4:return[2]}})})},e.createCanvasFromMediaElement=function(t){var n=e.createCaptureCanvas(t),r=n.getContext("2d");if(!r)throw new Error("Couldn't find Canvas 2D Context.");return e.drawImageOnCanvas(r,t),n},e.createBinaryBitmapFromMediaElem=function(t){var n=e.createCanvasFromMediaElement(t);return e.createBinaryBitmapFromCanvas(n)},e.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},e.listVideoInputDevices=function(){return Xt(this,void 0,void 0,function(){var t,n,r,o,i,a,s,l,u,c,f,d;return qt(this,function(h){switch(h.label){case 0:if(!Lk())throw new Error("Can't enumerate devices, navigator is not present.");if(!Due())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=h.sent(),n=[];try{for(r=Oh(t),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,l=i.label||"Video device "+(n.length+1),u=i.groupId,c={deviceId:s,label:l,kind:a,groupId:u},n.push(c))}catch(p){f={error:p}}finally{try{o&&!o.done&&(d=r.return)&&d.call(r)}finally{if(f)throw f.error}}return[2,n]}})})},e.findDeviceById=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:return[4,e.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===t})]:[2]}})})},e.cleanVideoSource=function(t){if(t){try{t.srcObject=null}catch{t.src=""}t&&t.removeAttribute("src")}},e.playVideoOnLoadAsync=function(t,n){return Xt(this,void 0,void 0,function(){return qt(this,function(r){switch(r.label){case 0:return[4,e.tryPlayVideo(t)];case 1:return r.sent()?[2,!0]:[2,new Promise(function(o,i){var a=setTimeout(function(){e.isVideoPlaying(t)||(i(!1),t.removeEventListener("canplay",s))},n),s=function(){e.tryPlayVideo(t).then(function(l){clearTimeout(a),t.removeEventListener("canplay",s),o(l)})};t.addEventListener("canplay",s)})]}})})},e.attachStreamToVideo=function(t,n,r){return r===void 0&&(r=5e3),Xt(this,void 0,void 0,function(){var o;return qt(this,function(i){switch(i.label){case 0:return o=e.prepareVideoElement(n),e.addVideoSource(o,t),[4,e.playVideoOnLoadAsync(o,r)];case 1:return i.sent(),[2,o]}})})},e._waitImageLoad=function(t){return new Promise(function(n,r){var o=setTimeout(function(){e.isImageLoaded(t)||(t.removeEventListener("load",i),r())},1e4),i=function(){clearTimeout(o),t.removeEventListener("load",i),n()};t.addEventListener("load",i)})},e.checkCallbackFnOrThrow=function(t){if(!t)throw new Yt("`callbackFn` is a required parameter, you cannot capture results without it.")},e.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(n){return n.stop()}),t=void 0},e.prototype.decode=function(t){var n=e.createCanvasFromMediaElement(t);return this.decodeFromCanvas(n)},e.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},e.prototype.decodeFromCanvas=function(t){var n=e.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(n)},e.prototype.decodeFromImageElement=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:if(!t)throw new Yt("An image element must be provided.");return n=e.prepareImageElement(t),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}})})},e.prototype.decodeFromImageUrl=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:if(!t)throw new Yt("An URL must be provided.");(n=e.prepareImageElement()).src=t,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return e.destroyImageElement(n),[7];case 4:return[2]}})})},e.prototype.decodeFromConstraints=function(t,n,r){return Xt(this,void 0,void 0,function(){var o,i;return qt(this,function(a){switch(a.label){case 0:return e.checkCallbackFnOrThrow(r),[4,navigator.mediaDevices.getUserMedia(t)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,n,r)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),e.disposeMediaStream(o),i;case 5:return[2]}})})},e.prototype.decodeFromStream=function(t,n,r){return Xt(this,void 0,void 0,function(){var o,i,a,s,l,u,c,f,d,h,p=this;return qt(this,function(m){switch(m.label){case 0:return e.checkCallbackFnOrThrow(r),o=this.options.tryPlayVideoTimeout,[4,e.attachStreamToVideo(t,n,o)];case 1:return i=m.sent(),a=function(){var _,b;try{for(var g=Oh(t.getVideoTracks()),E=g.next();!E.done;E=g.next())E.value.stop()}catch(T){_={error:T}}finally{try{E&&!E.done&&(b=g.return)&&b.call(g)}finally{if(_)throw _.error}}t=void 0},s=function(){a(),e.cleanVideoSource(i)},l=this.scan(i,r,s),u=t.getVideoTracks(),c=Vl(Vl({},l),{stop:function(){l.stop()},streamVideoConstraintsApply:function(_,b){return Xt(this,void 0,void 0,function(){var g,E,T,O,A,C;return qt(this,function(y){switch(y.label){case 0:g=b?u.filter(b):u,y.label=1;case 1:y.trys.push([1,6,7,8]),E=Oh(g),T=E.next(),y.label=2;case 2:return T.done?[3,5]:[4,T.value.applyConstraints(_)];case 3:y.sent(),y.label=4;case 4:return T=E.next(),[3,2];case 5:return[3,8];case 6:return O=y.sent(),A={error:O},[3,8];case 7:try{T&&!T.done&&(C=E.return)&&C.call(E)}finally{if(A)throw A.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(_){return u.find(_).getConstraints()},streamVideoSettingsGet:function(_){return u.find(_).getSettings()},streamVideoCapabilitiesGet:function(_){return u.find(_).getCapabilities()}}),e.mediaStreamIsTorchCompatible(t)&&(f=u==null?void 0:u.find(function(_){return e.mediaStreamIsTorchCompatibleTrack(_)}),d=function(_){return Xt(p,void 0,void 0,function(){return qt(this,function(b){switch(b.label){case 0:return[4,e.mediaStreamSetTorch(f,_)];case 1:return b.sent(),[2]}})})},c.switchTorch=d,h=function(){l.stop(),d(!1)},c.stop=h),[2,c]}})})},e.prototype.decodeFromVideoDevice=function(t,n,r){return Xt(this,void 0,void 0,function(){var o;return qt(this,function(i){switch(i.label){case 0:return e.checkCallbackFnOrThrow(r),o={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},e.prototype.decodeFromVideoElement=function(t,n){return Xt(this,void 0,void 0,function(){var r,o;return qt(this,function(i){switch(i.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new Yt("A video element must be provided.");return r=e.prepareVideoElement(t),o=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,o)];case 1:return i.sent(),[2,this.scan(r,n)]}})})},e.prototype.decodeFromVideoUrl=function(t,n){return Xt(this,void 0,void 0,function(){var r,o,i;return qt(this,function(a){switch(a.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new Yt("An URL must be provided.");return(r=e.prepareVideoElement()).src=t,o=function(){e.cleanVideoSource(r)},i=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,i)];case 1:return a.sent(),[2,this.scan(r,n,o)]}})})},e.prototype.decodeOnceFromConstraints=function(t,n){return Xt(this,void 0,void 0,function(){var r;return qt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},e.prototype.decodeOnceFromStream=function(t,n){return Xt(this,void 0,void 0,function(){var r,o;return qt(this,function(i){switch(i.label){case 0:return r=!!n,[4,e.attachStreamToVideo(t,n)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return r||e.cleanVideoSource(o),[7];case 5:return[2]}})})},e.prototype.decodeOnceFromVideoDevice=function(t,n){return Xt(this,void 0,void 0,function(){var r;return qt(this,function(o){switch(o.label){case 0:return r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},e.prototype.decodeOnceFromVideoElement=function(t){return Xt(this,void 0,void 0,function(){var n,r;return qt(this,function(o){switch(o.label){case 0:if(!t)throw new Yt("A video element must be provided.");return n=e.prepareVideoElement(t),r=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,r)];case 1:return o.sent(),[4,this.scanOneResult(n)];case 2:return[2,o.sent()]}})})},e.prototype.decodeOnceFromVideoUrl=function(t){return Xt(this,void 0,void 0,function(){var n,r;return qt(this,function(o){switch(o.label){case 0:if(!t)throw new Yt("An URL must be provided.");(n=e.prepareVideoElement()).src=t,r=this.decodeOnceFromVideoElement(n),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,r];case 2:return[2,o.sent()];case 3:return e.cleanVideoSource(n),[7];case 4:return[2]}})})},e.prototype.scanOneResult=function(t,n,r,o){var i=this;return n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),new Promise(function(a,s){i.scan(t,function(l,u,c){if(l)return a(l),void c.stop();if(u){if(u instanceof Y&&n||u instanceof hn&&r||u instanceof ae&&o)return;c.stop(),s(u)}})})},e.prototype.scan=function(t,n,r){var o=this;e.checkCallbackFnOrThrow(n);var i=e.createCaptureCanvas(t),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,l=function(){a=void 0,i=void 0},u=!1,c={stop:function(){u=!0,clearTimeout(s),l(),r&&r()}},f=function(){if(!u)try{e.drawImageOnCanvas(a,t);var d=o.decodeFromCanvas(i);n(d,void 0,c),s=setTimeout(f,o.options.delayBetweenScanSuccess)}catch(h){if(n(void 0,h,c),h instanceof hn||h instanceof ae||h instanceof Y)return void(s=setTimeout(f,o.options.delayBetweenScanAttempts));l(),r&&r(h)}};return f(),c},e.prototype._decodeOnLoadImage=function(t){return Xt(this,void 0,void 0,function(){return qt(this,function(n){switch(n.label){case 0:return e.isImageLoaded(t)?[3,2]:[4,e._waitImageLoad(t)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(t)]}})})},e}(),Nue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new C1,n,r)||this}Nue(t,e)})(Uu);var Bue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new zl(n),n,r)||this}Bue(t,e)})(Uu);var jue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new O1,n,r)||this}jue(t,e)})(Uu);var Fue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){var o=this,i=new Mk;return i.setHints(n),(o=e.call(this,i,n,r)||this).reader=i,o}Fue(t,e),Object.defineProperty(t.prototype,"possibleFormats",{set:function(n){this.hints.set(Et.POSSIBLE_FORMATS,n),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)},t.prototype.setHints=function(n){this.hints=n,this.reader.setHints(this.hints)}})(Uu);var $ue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new P1,n,r)||this}$ue(t,e)})(Uu);var zue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uue=function(e){function t(n,r){return e.call(this,new A1,n,r)||this}return zue(t,e),t}(Uu),Ah=function(e,t,n){var r=typeof e===n;return r||console.warn('[ReactQrReader]: Expected "'.concat(t,'" to be a of type "').concat(n,'".')),r},Vue=function(e){var t=e.scanDelay,n=e.constraints,r=e.onResult,o=e.videoId,i=P.useRef(null);P.useEffect(function(){var a=new Uue(null,{delayBetweenScanAttempts:t});return!function(){var s=typeof navigator<"u"&&!!navigator.mediaDevices;return s||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),s}()&&Ah(r,"onResult","function")&&r(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),a),Ah(n,"constraints","object")&&a.decodeFromConstraints({video:n},o,function(s,l){Ah(r,"onResult","function")&&r(s,l,a)}).then(function(s){return i.current=s}).catch(function(s){Ah(r,"onResult","function")&&r(null,s,a)}),function(){var s;(s=i.current)===null||s===void 0||s.stop()}},[])},us=function(){return us=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{var v,x;return[S.keystore,S.keypairIsLoaded,S.keypair,((v=S==null?void 0:S.keypair)==null?void 0:v.publicKey)||"",((x=S==null?void 0:S.keypair)==null?void 0:x.privateKey)||""]}),[i,a]=P.useState(!1),[s,l]=P.useState(!1),[u,c]=P.useState(""),[f,d]=P.useState(""),[h,p]=P.useState(!1);P.useEffect(()=>{c(r)},[r]),P.useEffect(()=>{d(o)},[o]),P.useEffect(()=>{e==="nos2x"&&l(!1)},[e]);const m=(s||e==="localstore")&&e!=="nos2x",_=Vi(),[b,g]=P.useState(!1),E=()=>{const S=Iie();Z.getState().setKeyStore({keystore:"localstore",publicKey:S.publicKey,privateKey:S.privateKey})},T=async S=>{if(g(!0),window.nostr)try{const v=await window.nostr.getPublicKey();Z.getState().setKeyStore({keystore:"nos2x",publicKey:v,privateKey:""}),g(!1)}catch(v){console.error("Error loading public key:",v),g(!1)}else{console.log(`Nostr extention not ready, retry ${S}`);const v=S?S+1:1;if(v>2){_({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),g(!1);return}setTimeout(()=>T(v),1e3)}},O=S=>{const v=Qoe(S);let x,I;if(v){const k=S.split(":");if(I=Ts(k[1]),x=I.prefix,!I){_({title:"Invalid QR code",description:"QR code is not a valid nostr url.",status:"error",duration:5e3,isClosable:!0});return}}if(S.startsWith("npub")?(x="npub",I=Ts(S)):S.startsWith("nsec")&&(x="nsec",I=Ts(S)),x!=="npub"&&x!=="nsec"||!I){_({title:"Invalid QR code",description:"QR code is not a valid public or private key.",status:"error",duration:5e3,isClosable:!0});return}let R;for(const k of I.tlvItems)k.type===0&&(R=k.value);if(!R){_({title:"Invalid QR code",description:"QR code is not a valid public or private key.",status:"error",duration:5e3,isClosable:!0});return}if(x==="npub"){if(console.log("Setting public key from QR code",R),u===R)return;c(R),Z.getState().setKeyStore({keystore:"localstore",publicKey:R,privateKey:""}),_({title:"Public key loaded",description:"Public key loaded from QR code.",status:"success",duration:5e3,isClosable:!0})}else if(x==="nsec"){if(console.log("Setting private key from QR code",R),f===R)return;d(R);const k=Rie(R);Z.getState().setKeyStore({keystore:"localstore",publicKey:k,privateKey:R}),_({title:"Keys loaded",description:"Private and public key loaded from QR code.",status:"success",duration:5e3,isClosable:!0})}else console.log("Invalid prefix",x);p(!1)},A=()=>{if(u.length!==64){_({title:"Invalid public key",description:"Public key must be 64 characters long.",status:"error",duration:5e3,isClosable:!0});return}if(f!==""&&f.length!==64){_({title:"Invalid private key",description:"Private key must be 64 characters long.",status:"error",duration:5e3,isClosable:!0});return}u&&f&&(Z.getState().setKeyStore({keystore:"localstore",publicKey:u,privateKey:f}),l(!1))},C=()=>{Z.getState().resetKeyStore(),d(""),c(""),l(!1)},y=()=>{p(!h)};return w.jsxs(ve,{children:[w.jsx(jo,{size:"lg",children:"Account"}),t?w.jsxs(me,{fontWeight:"bold",children:["Keypair loaded from ",e,"."]}):w.jsxs(w.Fragment,{children:[w.jsx(me,{fontWeight:"bold",marginBottom:2,children:"Keypair is not loaded."}),w.jsx(me,{marginBottom:2,children:"If you generate a new keypair, it will be stored in the browser local store (insecure). Alternatively get nos2x for Chrome, or nos2x-fox for Firefox, and store your keys in the extention (less insecure)."})]}),h&&w.jsxs(w.Fragment,{children:[w.jsxs(ve,{marginBottom:2,children:[w.jsx(me,{marginBottom:2,children:"Take a picture of your public or private key."}),w.jsx(be,{onClick:y,children:"Close QR Reader"})]}),w.jsx(dw,{onResult:(S,v)=>{S&&O(S.toString()),v&&console.info(v)},constraints:{facingMode:"environment"}})]}),w.jsx(pt,{marginTop:4,children:!h&&(!e||e==="none")?w.jsxs(w.Fragment,{children:[w.jsx(be,{onClick:E,children:"New keypair"}),w.jsx(be,{onClick:()=>l(!0),children:"Enter keypair"}),w.jsx(be,{onClick:y,children:"Scan from QR"}),w.jsx(be,{isLoading:b,onClick:()=>T(),children:"Load from nos2x"})]}):w.jsx(be,{onClick:C,children:"Reset"})}),n&&w.jsxs(ve,{mt:4,children:[w.jsxs(Jn,{marginBottom:4,children:[w.jsx(In,{children:"Public key:"}),w.jsx(Ht,{type:"text",value:u,onChange:S=>c(S.target.value),isReadOnly:!0})]}),m&&w.jsxs(Jn,{marginBottom:4,children:[w.jsx(In,{children:"Private key:"}),w.jsxs(pt,{spacing:2,children:[w.jsx(Ht,{type:i?"text":"password",value:f,onChange:S=>d(S.target.value),isReadOnly:!s}),w.jsx(be,{size:"sm",onClick:()=>a(!i),children:i?"Hide":"Show"})]})]}),s&&w.jsx(be,{onClick:()=>A(),children:"Save"})]})]})}function Wue(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var T1=Wue(P),Gue=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},K4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Kue(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return T1.createElement("svg",Gue({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),T1.createElement("path",{d:"M2,21L23,12L2,3V10L17,12L2,14V21Z"}))},Xue=T1.memo?T1.memo(K4):K4,que=Xue;const Yue=Qe(que);function Zue(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var I1=Zue(P),Que=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},X4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Jue(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return I1.createElement("svg",Que({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),I1.createElement("path",{d:"M4,9H20V11H4V9M4,13H14V15H4V13Z"}))},ece=I1.memo?I1.memo(X4):X4,tce=ece;const nce=Qe(tce);function rce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var R1=rce(P),oce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},q4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=ice(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return R1.createElement("svg",oce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),R1.createElement("path",{d:"M4,5H20V7H4V5M4,9H20V11H4V9M4,13H20V15H4V13M4,17H14V19H4V17Z"}))},ace=R1.memo?R1.memo(q4):q4,sce=ace;const lce=Qe(sce);function uce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var k1=uce(P),cce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Y4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=fce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return k1.createElement("svg",cce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),k1.createElement("path",{d:"M10,9V5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9Z"}))},dce=k1.memo?k1.memo(Y4):Y4,hce=dce;const Nk=Qe(hce);function pce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var M1=pce(P),mce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Z4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=yce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return M1.createElement("svg",mce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),M1.createElement("path",{d:"M12,6C8.6,6 5.5,7.1 3,9L1.2,6.6C4.2,4.3 8,3 12,3C16,3 19.8,4.3 22.8,6.6L21,9C18.5,7.1 15.4,6 12,6M13,19C13,17.7 13.4,16.4 14.2,15.4C13.5,15.2 12.8,15 12,15C10.7,15 9.4,15.5 8.4,16.2L12,21L13,19.6C13,19.4 13,19.2 13,19M16.8,13.4C17.1,13.3 17.5,13.2 17.9,13.1L19.2,11.4C17.2,9.9 14.7,9 12,9C9.3,9 6.8,9.9 4.8,11.4L6.6,13.8C8.1,12.7 10,12 12,12C13.8,12 15.4,12.5 16.8,13.4M16.5,22.6L17.2,19.8L15,17.9L17.9,17.7L19,15L20.1,17.6L23,17.8L20.8,19.7L21.5,22.5L19,21.1L16.5,22.6Z"}))},gce=M1.memo?M1.memo(Z4):Z4,vce=gce;const wce=Qe(vce);function bce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var D1=bce(P),Sce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Q4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=_ce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return D1.createElement("svg",Sce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),D1.createElement("path",{d:"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z"}))},Ece=D1.memo?D1.memo(Q4):Q4,Cce=Ece;const Bk=Qe(Cce);function Vu(e,t){return e.length<=t?e:e?e.substring(0,t)+"...":"..."}function xce(e,t,n,r){switch(e){case"NewShortTextNote":return{event:Kie({text:t})};case"NewLongFormContent":return{event:Xie({text:t})};case"NewShortTextNoteResponse":return r.inResponseTo?{event:qie({text:t,inResponseTo:r.inResponseTo})}:{error:"Response requires inResponseTo"};case"NewRecommendRelay":return{event:Qie({relayUrl:n})};case"NewQuoteRepost":return r.inResponseTo?{event:ak({inResponseTo:r.inResponseTo,relayUrl:n})}:{error:"Quote repost requires inResponseTo"};default:return{error:"Invalid event type"}}}function Oce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var L1=Oce(P),Ace=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},J4=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Pce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return L1.createElement("svg",Ace({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),L1.createElement("path",{d:"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}))},Tce=L1.memo?L1.memo(J4):J4,Ice=Tce;const Jc=Qe(Ice);function Rce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var N1=Rce(P),kce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},e8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Mce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return N1.createElement("svg",kce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),N1.createElement("path",{d:"M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C8.13 19 5 15.87 5 12C5 8.13 8.13 5 12 5M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4Z"}))},Dce=N1.memo?N1.memo(e8):e8,Lce=Dce;const jk=Qe(Lce);function Nce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var B1=Nce(P),Bce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},t8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=jce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return B1.createElement("svg",Bce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),B1.createElement("path",{d:"M23,18V17.5A2.5,2.5 0 0,0 20.5,15A2.5,2.5 0 0,0 18,17.5V18A1,1 0 0,0 17,19V23A1,1 0 0,0 18,24H23A1,1 0 0,0 24,23V19A1,1 0 0,0 23,18M22,18H19V17.5A1.5,1.5 0 0,1 20.5,16A1.5,1.5 0 0,1 22,17.5V18M23,12L2,21V14L17,12L2,10V3L23,12Z"}))},Fce=B1.memo?B1.memo(t8):t8,$ce=Fce;const zce=Qe($ce);function Uce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var j1=Uce(P),Vce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},n8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Hce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return j1.createElement("svg",Vce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),j1.createElement("path",{d:"M2 3V10L17 12L2 14V21L23 12M22 15.5L18.5 19L16.5 17L15 18.5L18.5 22L23.5 17Z"}))},Wce=j1.memo?j1.memo(n8):n8,Gce=Wce;const Kce=Qe(Gce);function Fk({relays:e,onChange:t}){const n=(r,o)=>{t(r,o?"remove":"add")};return w.jsx(ve,{p:2,children:e.length===0?w.jsx(me,{children:"No relays found."}):e.map(r=>w.jsxs(pt,{mb:1,children:[w.jsx(Ge,{as:r.data.isReady?jk:Jc,color:r.data.isReady?"green.500":"red.500"}),w.jsx(me,{children:r.data.url}),w.jsx(qs,{}),w.jsx(Ge,{as:r.data.write?Kce:zce,color:r.data.write?"green.500":"red.500"}),w.jsx(NI,{isChecked:r.isAssigned,onChange:()=>n(r.data.url,r.isAssigned),isDisabled:r.data.write===!1})]},r.data.url))})}const $k=e=>{const[t,n]=Z(I=>[I.connected&&I.keystore!=="none",I.keypairIsLoaded]),[r,o]=P.useState(!1),[i,a]=P.useState([]),[s,l]=Z(I=>[I.keystore,I.keypair]),u=t||n?void 0:"Login and connect to send events.",[c,f]=P.useState(e.kind||"NewShortTextNote"),[d,h]=P.useState(""),p=[{label:"NewShortTextNote",icon:w.jsx(Ge,{as:nce}),disabled:e.isResponse||!1},{label:"NewLongFormContent",icon:w.jsx(Ge,{as:lce}),disabled:e.isResponse||!1},{label:"NewShortTextNoteResponse",icon:w.jsx(Ge,{as:Nk}),disabled:c!=="NewShortTextNoteResponse"},{label:"NewRecommendRelay",icon:w.jsx(Ge,{as:wce}),disabled:e.isResponse||!1},{label:"NewQuoteRepost",icon:w.jsx(Ge,{as:Bk}),disabled:c!=="NewQuoteRepost"}],m=Vi(),{isOpen:_,onOpen:b,onClose:g}=Wn(),[E,T]=P.useState([]),O=E.filter(I=>I.isAssigned).length,A=(I,R)=>{T(E.map(k=>k.data.url===I?{...k,isAssigned:R==="add"}:k))};P.useEffect(()=>{const I=e.relayUrls?e.relayUrls:void 0,R=I&&I.length>0?I[0]:"";Z.getState().getRelays().then(k=>{k&&T(k.map(M=>R===M.url&&M.write||M.isReady&&M.write?{data:M,isAssigned:!0}:{data:M,isAssigned:!1}))})},[]);const C=I=>{if(I.content==="")return{error:"Event content is required"};if(s&&s==="none")return{error:"Keystore is required"};if(!l)return{error:"Keypair is required"}},y=()=>{h(""),f("NewShortTextNote"),a([])},S=I=>{a([I]),m({title:"Error",description:I,status:"error",duration:5e3,isClosable:!0})},v=I=>{m({title:"Success",description:I,status:"success",duration:5e3,isClosable:!0})},x=async()=>{o(!0),a([]);const I=E.map(N=>N.data.url);if(I.length===0){S("Select at least one relay"),o(!1);return}const R=xce(c,d,I[0],e);if(R.error){S(R.error),o(!1);return}const k=R.event,M=C(k);if(M!=null&&M.error){S(M.error),o(!1);return}try{const N=await Z.getState().signAndSendEvent({event:k,relayUrls:I});N&&(v(`Event sent: ${Vu(k.content,20)}`),y(),o(!1),e.sendCallback&&e.sendCallback(N))}catch(N){let D="";N instanceof Error?D=N.message:D=N?N.toString():"Unknown error",S(D),o(!1);return}};return w.jsxs(ve,{width:"100%",children:[w.jsxs(Jn,{marginBottom:4,children:[w.jsx(In,{children:"Content"}),w.jsx(Ht,{type:"text",as:c==="NewLongFormContent"?QS:Ht,value:d,onChange:I=>h(I.target.value),placeholder:"Enter event content"})]}),w.jsx(pt,{marginBottom:4,children:p.map(I=>w.jsx(um,{variant:"outline","aria-label":I.label,icon:I.icon,onClick:()=>f(I.label),isActive:c===I.label,isDisabled:I.disabled},I.label))}),i.map((I,R)=>w.jsx(ve,{color:"red.500",children:I},R)),u&&w.jsx(ve,{color:"red.500",paddingBottom:2,children:u}),_&&w.jsx(Fk,{relays:E,onChange:A}),w.jsxs(cd,{children:[w.jsx(be,{type:"submit",variant:"solid",onClick:x,leftIcon:w.jsx(Ge,{as:Yue}),isDisabled:!t||O===0,isLoading:r,children:"Send"}),w.jsxs(be,{variant:"outline",onClick:_?g:b,children:["Select relays (",O,")"]})]})]})};function r8(e){const{isOpen:t,onOpen:n,onClose:r}=Wn(),o=()=>{r()};return w.jsxs(w.Fragment,{children:[w.jsx(be,{size:(e==null?void 0:e.buttonSize)||"md",onClick:n,children:"Post message"}),w.jsxs($r,{isOpen:t,onClose:r,children:[w.jsx(Vr,{}),w.jsxs(zr,{children:[w.jsx(Ur,{children:"Broadcast to the Network"}),w.jsx(Wr,{}),w.jsx(Hr,{children:w.jsx($k,{sendCallback:o})}),w.jsx(gd,{children:w.jsx(be,{colorScheme:"blue",mr:3,onClick:r,children:"Close"})})]})]})]})}const Xce=Object.keys(ar).map(e=>({name:e,value:ar[e]})),qce=e=>{const t=Xce.find(n=>n.value===e);return t?t.name:"Unknown"},Yce=e=>e.map(qce).join(", ");function Zce(){const[e,t]=P.useState([]),[n,r]=P.useState(null),{isOpen:o,onOpen:i,onClose:a}=Wn(),s=async()=>{const c=await Z.getState().getSubscriptions();c&&t(c)};P.useEffect(()=>{(async()=>{await s()})();const f=setInterval(s,3e3);return()=>clearInterval(f)},[]);const l=w.jsxs($r,{isOpen:o,onClose:a,size:"xl",children:[" ",w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[" ",w.jsx(Ur,{children:"Filters"}),w.jsx(Wr,{}),w.jsxs(Hr,{overflowY:"auto",children:[" ",w.jsx("pre",{children:n})]})]})]}),u=c=>{var d;const f=c.options&&c.options.view?c.options.view:"";return w.jsxs(ka,{children:[w.jsx(Nt,{children:c.type}),w.jsx(Nt,{children:w.jsx(l1,{label:c.relayUrl,children:c.relayUrl.substring(6)})}),w.jsx(Nt,{children:w.jsx(me,{fontSize:"sm",children:c.filters&&c.filters.kinds&&Yce(c.filters.kinds)})}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(JSON.stringify(c.filters,null,2)),i()},children:"Show"})}),w.jsx(Nt,{children:w.jsx(l1,{label:f,children:Vu(f,5)})}),w.jsx(Nt,{children:(d=c.options)==null?void 0:d.timeoutIn}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>Z.getState().unsubscribe([c.id]),children:"Unsubscribe"})})]},c.id)};return w.jsxs(ve,{children:[w.jsxs(bd,{variant:"simple",marginBottom:4,children:[w.jsx(pm,{children:w.jsxs(ka,{children:[w.jsx(Bt,{children:"Type"}),w.jsx(Bt,{children:"Relay"}),w.jsx(Bt,{children:"Kind"}),w.jsx(Bt,{children:"Filter"}),w.jsx(Bt,{children:"View"}),w.jsx(Bt,{children:"Timeout"}),w.jsx(Bt,{children:"Action"})]})}),w.jsx(mm,{children:e.map(c=>u(c))})]}),l]})}function Qce(){const[e,t]=P.useState([]),[n,r]=P.useState(null),[o,i]=P.useState(!1),{isOpen:a,onOpen:s,onClose:l}=Wn(),u=async()=>{await Z.getState().getRelays().then(p=>{p&&t(p)})};P.useEffect(()=>{u();const p=setInterval(u,2e3);return()=>clearInterval(p)},[]);const c=async p=>{i(!0);const m=!p.read;await Z.getState().updateRelay(p.url,{read:m}),await u(),i(!1)},f=async p=>{i(!0);const m=!p.write;await Z.getState().updateRelay(p.url,{write:m}),await u(),i(!1)},d=w.jsxs($r,{isOpen:a,onClose:l,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:"Relay"}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:n&&n.info&&w.jsx("pre",{children:w.jsx("code",{children:JSON.stringify(n.info,null,2)})})})]})]}),h=p=>w.jsxs(ka,{children:[w.jsx(Nt,{children:w.jsx(Ge,{as:p.isReady?jk:Jc,color:p.isReady?"green.500":"red.500"})}),w.jsx(Nt,{children:p.url}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(p),s()},children:"Show"})}),w.jsx(Nt,{children:w.jsx(W2,{isChecked:p.read,onChange:()=>c(p),isDisabled:o})}),w.jsx(Nt,{children:w.jsx(W2,{isChecked:p.write,onChange:()=>f(p),isDisabled:o})}),w.jsx(Nt,{children:p.error})]},p.url);return w.jsxs(ve,{children:[w.jsxs(bd,{variant:"simple",marginBottom:4,children:[w.jsx(pm,{children:w.jsxs(ka,{children:[w.jsx(Bt,{children:"Ready"}),w.jsx(Bt,{children:"Url"}),w.jsx(Bt,{children:"Info"}),w.jsx(Bt,{children:"Read"}),w.jsx(Bt,{children:"Write"}),w.jsx(Bt,{children:"Error"})]})}),w.jsx(mm,{children:e.map(p=>h(p))})]}),d]})}function Jce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var F1=Jce(P),efe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},o8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=tfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return F1.createElement("svg",efe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),F1.createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z"}))},nfe=F1.memo?F1.memo(o8):o8,rfe=nfe;const xg=Qe(rfe);function ofe(){const[e,t]=P.useState([]),[n,r]=P.useState(null),{isOpen:o,onOpen:i,onClose:a}=Wn(),s=async()=>{await Z.getState().getQueueItems().then(d=>{d&&t(d)})};P.useEffect(()=>{s();const d=setInterval(s,3e3);return()=>clearInterval(d)},[]);const l=d=>!!d.error,u=d=>d.error?d.error:"",c=w.jsxs($r,{isOpen:o,onClose:a,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:"Queue Item Detail"}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:n&&w.jsx("pre",{children:w.jsx("code",{children:JSON.stringify(n,null,2)})})})]})]}),f=d=>w.jsxs(ka,{children:[w.jsx(Nt,{children:d.relayUrl}),w.jsx(Nt,{children:w.jsx(l1,{label:d.event.id,children:Vu(d.event.id,5)})}),w.jsx(Nt,{children:w.jsxs(pt,{children:[d.pow?w.jsx(me,{children:d.pow}):w.jsx(me,{children:"0"}),w.jsx(me,{children:"/"}),w.jsx(Ge,{as:d.powDone?xg:Jc})]})}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(d),i()},children:"Show"})}),w.jsx(Nt,{children:w.jsx(Ge,{as:d.send?xg:Jc,marginRight:1})}),w.jsxs(Nt,{children:[w.jsx(Ge,{as:d.accepted?xg:Jc}),l(d)&&w.jsx(me,{color:"red.500",children:u(d)})]})]},`${d.event.id}_${d.relayUrl}`);return w.jsxs(ve,{children:[w.jsxs(bd,{variant:"simple",marginBottom:4,children:[w.jsx(pm,{children:w.jsxs(ka,{children:[w.jsx(Bt,{children:"Relay"}),w.jsx(Bt,{children:"Event ID"}),w.jsx(Bt,{children:"POW / Done"}),w.jsx(Bt,{children:"Info"}),w.jsx(Bt,{children:"Send"}),w.jsx(Bt,{children:"Accepted"})]})}),w.jsx(mm,{children:e.map(d=>({item:d}&&f(d)))})]}),c]})}function ife(){const{colorMode:e,toggleColorMode:t}=X0(),[n,r]=P.useState(0),[o]=Z(M=>[M.relayEvents]),[i,a]=P.useState(0),[s,l]=P.useState(0),[u,c]=P.useState(0),[f,d]=P.useState(0),[h,p]=P.useState(0),m=Vi(),_=async()=>{if(Z.getState().status==="loading")return;const M=await Z.getState().countUsers();M&&r(M);const N=await Z.getState().getSubscriptions({isActive:!0});N&&c(N.length);const D=await Z.getState().getRelays();D&&d(D.length);const L=await Z.getState().getQueueItems();L&&p(L.length);const j=await Z.getState().getAllUsersBlocked();j&&a(j.length)};P.useEffect(()=>{const M=setInterval(async()=>await _(),2e3);return()=>clearInterval(M)},[]);const b=async(M,N)=>{!M||!N||await Z.getState().relayAuth(M,N)};P.useEffect(()=>{const M=o.length;if(M>0){const N=M-s;if(N>0){l(M);const D=o.slice(-N);for(const L of D){let j="",F="",B=!0;if(L.data[0]===ml.NOTICE)j=L.data[1],F=`${L.meta.url}`;else if(L.data[0]===ml.OK)B=L.data[2],j=B?"Event accepted":"Event rejected",F=`${L.meta.url}`;else{if(L.data[0]===ml.EOSE)return;if(L.data[0]===ml.COUNT)j="Received count",F=`${L.meta.url} #${L.data[1]}: ${JSON.stringify(L.data[2])} events`;else if(L.data[0]===ml.AUTH){j="Authentication requested",F=`${L.meta.url}`;const U=Z.getState().keystore;!U||U==="none"?F+=" but no account is available to sign the challenge.":b(L.meta.url,L.data[1])}}F!==""&&m({title:j,position:"top-right",description:F,status:B?"info":"error",duration:5e3,isClosable:!0})}}}},[o]);const{isOpen:g,onOpen:E,onClose:T}=Wn(),O=w.jsxs($r,{isOpen:g,onClose:T,size:"xl",children:[" ",w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[" ",w.jsx(Ur,{children:w.jsx(jo,{size:"lg",children:"Subscriptions"})}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:w.jsx(Zce,{})})]})]}),{isOpen:A,onOpen:C,onClose:y}=Wn(),S=w.jsxs($r,{isOpen:A,onClose:y,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:w.jsx(jo,{size:"lg",children:"Relays"})}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:w.jsx(Qce,{})})]})]}),{isOpen:v,onOpen:x,onClose:I}=Wn(),R=w.jsxs($r,{isOpen:v,onClose:I,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:w.jsx(jo,{size:"lg",children:"Queue"})}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:w.jsx(ofe,{})})]})]}),[k]=yJ("(max-width: 600px)");return w.jsxs(ve,{position:"fixed",bottom:0,left:0,right:0,p:3,backgroundColor:"background",children:[k?w.jsxs(pt,{spacing:4,children:[w.jsxs(be,{variant:"outline",size:"sm",onClick:t,children:["Toggle ",e==="light"?"Dark":"Light"]}),w.jsx(r8,{buttonSize:"sm"}),w.jsxs(VS,{children:[w.jsx(WS,{as:be,size:"sm",children:"Actions"}),w.jsxs(HS,{children:[w.jsx(Qo,{children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Users:"}),w.jsx(me,{fontSize:"sm",children:n})]})}),w.jsx(Qo,{children:w.jsx(vn,{as:h1,to:"/blocked",children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Blocked Users:"}),w.jsx(me,{fontSize:"sm",children:i})]})})}),w.jsx(Qo,{children:w.jsx(vn,{onClick:A?y:C,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Relays:"}),w.jsx(me,{fontSize:"sm",children:f})]})})}),w.jsx(Qo,{children:w.jsx(vn,{onClick:v?I:x,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Queue:"}),w.jsx(me,{fontSize:"sm",children:h})]})})}),w.jsx(Qo,{children:w.jsx(vn,{onClick:g?T:E,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Subscriptions:"}),w.jsx(me,{fontSize:"sm",children:u})]})})}),w.jsx(Qo,{children:w.jsx(vn,{href:"https://github.com/franzos/nostr-ts",children:w.jsxs(me,{children:["NostrOP source (v","0.0.4",")"]})})})]})]})]}):w.jsx(pt,{spacing:4,children:w.jsxs(w.Fragment,{children:[w.jsxs(be,{variant:"outline",size:"sm",onClick:t,children:["Toggle ",e==="light"?"Dark":"Light"]}),w.jsx(r8,{buttonSize:"sm"}),w.jsx(qs,{}),w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Users:"}),w.jsx(me,{fontSize:"sm",children:n})]}),w.jsx(vn,{as:h1,to:"/blocked",children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Blocked Users:"}),w.jsx(me,{fontSize:"sm",children:i})]})}),w.jsx(vn,{onClick:A?y:C,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Relays:"}),w.jsx(me,{fontSize:"sm",children:f})]})}),w.jsx(vn,{onClick:v?I:x,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Queue:"}),w.jsx(me,{fontSize:"sm",children:h})]})}),w.jsx(vn,{onClick:g?T:E,children:w.jsxs(pt,{spacing:2,children:[w.jsx(me,{fontSize:"xs",children:"Subscriptions:"}),w.jsx(me,{fontSize:"sm",children:u})]})}),w.jsx(vn,{href:"https://github.com/franzos/nostr-ts",children:w.jsxs(me,{fontSize:"xs",children:["NostrOP v","0.0.4"]})})]})}),O,S,R]})}function dc({label:e,value:t,to:n,leftIcon:r}){return w.jsx(vn,{as:h1,to:n,w:"100%",padding:2,borderRadius:5,bg:"blackAlpha.50",border:"1px solid",borderColor:"whiteAlpha.100",_hover:{backgroundColor:"blackAlpha.400"},_activeLink:{backgroundColor:"blackAlpha.300"},children:w.jsxs(pt,{children:[r,w.jsx(me,{fontSize:"md",fontWeight:"bold",children:e}),t&&w.jsx(me,{fontSize:"md",children:t})]})})}function afe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var $1=afe(P),sfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},i8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=lfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return $1.createElement("svg",sfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),$1.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M3,13V18L3,20H10V18H5V13H3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M14,15H20V19H14V15Z"}))},ufe=$1.memo?$1.memo(i8):i8,cfe=ufe;const ffe=Qe(cfe);function dfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var z1=dfe(P),hfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},a8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=pfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return z1.createElement("svg",hfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),z1.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3.88,13.46L2.46,14.88L4.59,17L2.46,19.12L3.88,20.54L6,18.41L8.12,20.54L9.54,19.12L7.41,17L9.54,14.88L8.12,13.46L6,15.59L3.88,13.46M14,15H20V19H14V15Z"}))},mfe=z1.memo?z1.memo(a8):a8,yfe=mfe;const gfe=Qe(yfe);function vfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var U1=vfe(P),wfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},s8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=bfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return U1.createElement("svg",wfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),U1.createElement("path",{d:"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"}))},Sfe=U1.memo?U1.memo(s8):s8,_fe=Sfe;const Efe=Qe(_fe);function Cfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var V1=Cfe(P),xfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},l8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Ofe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return V1.createElement("svg",xfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),V1.createElement("path",{d:"M11 10V12H9V14H7V12H5.8C5.4 13.2 4.3 14 3 14C1.3 14 0 12.7 0 11S1.3 8 3 8C4.3 8 5.4 8.8 5.8 10H11M3 10C2.4 10 2 10.4 2 11S2.4 12 3 12 4 11.6 4 11 3.6 10 3 10M16 14C18.7 14 24 15.3 24 18V20H8V18C8 15.3 13.3 14 16 14M16 12C13.8 12 12 10.2 12 8S13.8 4 16 4 20 5.8 20 8 18.2 12 16 12Z"}))},Afe=V1.memo?V1.memo(l8):l8,Pfe=Afe;const Tfe=Qe(Pfe);function Ife(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var H1=Ife(P),Rfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},u8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=kfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return H1.createElement("svg",Rfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),H1.createElement("path",{d:"M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"}))},Mfe=H1.memo?H1.memo(u8):u8,Dfe=Mfe;const zk=Qe(Dfe);function Lfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var W1=Lfe(P),Nfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},c8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Bfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return W1.createElement("svg",Nfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),W1.createElement("path",{d:"M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z"}))},jfe=W1.memo?W1.memo(c8):c8,Ffe=jfe;const Uk=Qe(Ffe);function $fe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var G1=$fe(P),zfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},f8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Ufe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return G1.createElement("svg",zfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),G1.createElement("path",{d:"M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.09 20.21,11.09 20.42,11.3L21.7,12.58C21.91,12.79 21.91,13.14 21.7,13.35M12,18.94L18.06,12.88L20.11,14.93L14.06,21H12V18.94M12,14C7.58,14 4,15.79 4,18V20H10V18.11L14,14.11C13.34,14.03 12.67,14 12,14M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4Z"}))},Vfe=G1.memo?G1.memo(f8):f8,Hfe=Vfe;const Wfe=Qe(Hfe);function hp(e){return Object.entries(e).map(([t,{read:n,write:r}])=>({url:t,read:n,write:r}))}function Gfe({isOpen:e,onClose:t}){const[n,r]=P.useState(hp(ow)),[o,i]=P.useState(""),[a,s]=P.useState(!1),[l,u]=P.useState(!1),c=Vi(),f=async p=>{if(s(!0),window.nostr&&window.nostr.getRelays)try{const m=await window.nostr.getRelays();r(hp(m)),s(!1)}catch(m){console.error("Error loading relays:",m);let _="Unknown error";m instanceof Error&&(_=m.message),c({title:"Error loading relays",description:_,status:"error",duration:5e3,isClosable:!0}),s(!1)}else{console.log(`Nostr extention not ready, retry ${p}`);const m=p?p+1:1;if(m>2){c({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),s(!1);return}setTimeout(()=>f(m),1e3)}},d=()=>{r(hp(ow))};P.useEffect(()=>{const p=localStorage.getItem("nostr-client:relays");p&&r(JSON.parse(p))},[]);const h=async()=>{u(!0),localStorage.setItem("nostr-client:relays",JSON.stringify(n)),await Z.getState().connect(n),u(!1),t()};return w.jsxs($r,{isOpen:e,onClose:t,children:[w.jsx(Vr,{}),w.jsxs(zr,{children:[w.jsx(Ur,{children:"Connect to Relay(s)"}),w.jsx(Wr,{}),w.jsxs(Hr,{children:[w.jsxs(me,{children:["You can find a list of relays in the nostr-ts repository",w.jsx(vn,{marginLeft:1,href:"https://github.com/franzos/nostr-ts/blob/master/discovered-relays.json",isExternal:!0,color:"blue.500",children:"github.com/franzos/nostr-ts"}),",",w.jsx(vn,{marginLeft:1,marginRight:1,href:"https://nostr.info/relays/",isExternal:!0,color:"blue.500",children:"nostr.info"}),"and elsewhere."]}),w.jsx(As,{spacing:3,width:"100%",children:n&&n.map(p=>w.jsxs(B2,{width:"100%",alignItems:"center",py:2,children:[w.jsx(me,{flex:"1",marginLeft:"2",children:p.url}),w.jsx(be,{ml:"auto",onClick:()=>{const m=n.filter(_=>_.url!==p.url);r(m)},children:"Remove"})]},p.url))}),w.jsxs(B2,{direction:"row",alignItems:"center",pt:4,children:[w.jsx(Ht,{flex:"1",value:o,onChange:p=>i(p.target.value),placeholder:"Enter new relay URL"}),w.jsx(be,{ml:2,onClick:()=>{o.trim()!==""&&(r([...n,{url:o,read:!0,write:!0}]),i(""))},children:"Add"})]}),w.jsxs(cd,{children:[w.jsx(be,{isLoading:a,onClick:()=>f(),size:"xs",marginTop:2,children:"Load from nos2x"}),w.jsx(be,{isLoading:a,onClick:d,size:"xs",marginTop:2,children:"Reset"})]})]}),w.jsx(gd,{children:w.jsx(be,{variant:"outline",isDisabled:n.length===0,isLoading:l,onClick:h,children:"Connect"})})]})]})}const Vk="/nostr-ts/assets/logo-2c2a6c00.svg";function Kfe(){const[e,t,n]=Z(f=>{var d;return[f.connected,f.keystore,((d=f.keypair)==null?void 0:d.publicKey)||""]}),[r,o]=P.useState(0),{isOpen:i,onOpen:a,onClose:s}=Wn(),l=async()=>{if(!Z.getState().connected)return;const f=await Z.getState().getAllUsersFollowing();f&&o(f.length)},u=async()=>{await Z.getState().connect(hp(ow))};P.useEffect(()=>{const f=setInterval(l,1e3);return u(),()=>clearInterval(f)},[]);const c=w.jsxs(As,{align:"start",spacing:5,children:[w.jsx(dc,{label:"Home",to:"/",leftIcon:w.jsx(Ge,{as:Efe,marginRight:1})}),e&&w.jsxs(w.Fragment,{children:[w.jsx(dc,{label:"Following",value:r,to:"/following",leftIcon:w.jsx(Ge,{as:zk,marginRight:1})}),w.jsx(dc,{label:"Lists",to:"/lists",leftIcon:w.jsx(Ge,{as:Uk,marginRight:1})}),n&&n!==""&&w.jsx(dc,{label:"Profile",to:"/profile",leftIcon:w.jsx(Ge,{as:Wfe,marginRight:1})})]}),w.jsx(dc,{label:"Account",value:t,to:"/account",leftIcon:w.jsx(Ge,{as:Tfe,marginRight:1})}),e?w.jsxs(be,{w:"100%",variant:"outline",onClick:Z.getState().disconnect,children:[w.jsx(Ge,{as:gfe,marginRight:1}),"Disconnect"]}):w.jsx(be,{w:"100%",variant:"solid",onClick:a,leftIcon:w.jsx(Ge,{as:ffe}),children:"Connect to relay(s)"})]});return w.jsxs(w.Fragment,{children:[w.jsxs(I5,{maxW:"8xl",p:5,marginBottom:14,children:[w.jsxs(As,{spacing:5,align:"stretch",children:[w.jsx(As,{spacing:1,align:"start",children:w.jsx(ju,{height:"30px",src:Vk})}),w.jsxs(Fu,{templateColumns:["1fr","1fr 4fr"],gap:20,children:[c,w.jsx(ve,{children:w.jsx(xre,{})})]})]}),Gfe({isOpen:i,onOpen:a,onClose:s})]}),w.jsx(ife,{})]})}function Xfe({data:e,isOpen:t,onClose:n}){const r=`/e/${GR(d_.NoteIDs,[{type:0,value:e.event.id}])}`,o=e.eventRelayUrls?e.eventRelayUrls[0]:"Unknown (from local DB)";return w.jsxs($r,{isOpen:t,onClose:n,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:"Event"}),w.jsx(Wr,{}),w.jsxs(Hr,{overflowY:"auto",children:[w.jsxs(me,{children:["Link:"," ",w.jsx(vn,{as:$f,to:r,children:r})]}),w.jsxs(me,{children:["Relay: ",o]}),w.jsx(ve,{m:4,children:w.jsx("pre",{children:w.jsx("code",{children:JSON.stringify(e.event,null,2)})})})]})]})]})}function qfe({note:e,index:t}){const o=P.useRef(""),i=P.useRef([]),[a]=Z(f=>[f.connected]),[s]=Z(f=>[f.events[e]?f.events[e][0]:null]),[l,u]=P.useState(!1),c=async(f=0)=>{if(f>20){u(!0);return}await Z.getState().getEvent(o.current,{view:e,retryCount:f,relayUrls:i.current})||setTimeout(()=>c(f+1),1e3)};return P.useEffect(()=>{try{const f=Ts(e);for(const d of f.tlvItems)d.type===0?o.current=d.value:d.type===1&&i.current.push(d.value)}catch(f){console.error(f);return}e&&a&&(!t||t<=2)&&c()},[e,t,a]),w.jsx(ve,{p:1,m:1,children:s?w.jsx(Dm,{data:s,level:0}):l?w.jsxs(me,{fontSize:"sm",color:"gray.500",children:["Couldn't find ",e,"."]}):w.jsxs(me,{fontSize:"sm",color:"gray.500",children:["Loading ... ",e]})})}function Yfe({npub:e}){const[t]=Z(f=>[f.status]),n=P.useRef(null),[r,o]=P.useState(""),[i,a]=P.useState(""),[s,l]=P.useState(!1),u=f=>{const d=f.user.data;return d&&d.display_name?`@${d.display_name}`:""},c=async(f,d=0)=>{if(d>20){l(!1);return}const h=await Z.getState().getUser(f);h?(o(u(h)),l(!1)):(d===2&&await Z.getState().requestInformation({idsOrKeys:[f],source:"users"},{timeoutIn:1e4}),setTimeout(()=>c(f,d+1),1e3))};return P.useEffect(()=>{if(!(!e||!["online","offline"].includes(t)))try{const d=Ts(e).tlvItems.find(h=>h.type===0);d&&(n.current=d.value,a(`/p/${e}`),l(!0),c(n.current))}catch(f){console.error("Error decoding bech32:",f)}},[t,e]),w.jsx(w.Fragment,{children:e?w.jsx(vn,{as:h1,to:i,color:"gray.500",children:r===""||s?Vu(e,10):r}):w.jsx(w.Fragment,{children:"..."})})}function Zfe({text:e}){if(!e)return null;const t=/(https?:\/\/[^\s]+)/g,n=/(?:nostr:)?(note[0-9a-zA-Z]+|nevent[0-9a-zA-Z]+)/g,r=/(?:nostr:)?(npub[0-9a-zA-Z]+|nprofile[0-9a-zA-Z]+)/g,o=/#[a-zA-Z0-9]+/g,i=e.split(/(https?:\/\/[^\s]+|(?:nostr:)?note[0-9a-zA-Z]+|(?:nostr:)?npub[0-9a-zA-Z]+|(?:nostr:)?nprofile[0-9a-zA-Z]+|(?:nostr:)?nevent[0-9a-zA-Z]+|#[a-zA-Z0-9]+)/g);return w.jsx(w.Fragment,{children:i.map((a,s)=>{if(t.test(a))return w.jsx(vn,{color:"gray.500",href:a,target:"_blank",rel:"noopener noreferrer",children:Vu(a,40)},s);if(n.test(a)){const l=a.split(":").pop();return l&&w.jsx(qfe,{note:l,index:s},s)}if(r.test(a)){const l=a.split(":").pop();return w.jsx(Yfe,{npub:l},s)}return o.test(a)?w.jsx(vn,{as:$f,to:`/t/${encodeURIComponent(a.slice(1))}`,color:"gray.500",children:a},s):a})})}function Qfe({content:e}){return w.jsx(w.Fragment,{children:e&&e!==""&&w.jsx(ve,{overflowWrap:"break-word",wordBreak:"break-word",pl:2,pr:2,pt:1,pb:1,background:"blackAlpha.100",borderRadius:4,style:{overflowWrap:"anywhere"},children:w.jsx(Zfe,{text:e})})})}const w_=({text:e})=>{const t=e||"Just a sec ... Searching the Matrix.";return w.jsxs(ve,{textAlign:"center",children:[w.jsx(me,{children:t}),w.jsx(sm,{p:4,mt:2})]})};function Jfe({data:e,isOpen:t,sendCallback:n,level:r}){const o=`event-${e.event.id}_replies`,[i,a]=P.useState(!1),[s]=Z(u=>[u.events[`event-${e.event.id}_replies`]]),l=async()=>{a(!0);try{await Z.getState().getEventReplies(e.event.id,o,!0)}catch(u){console.error(u)}if(s&&s.length>0){await Z.getState().requestInformation({source:"events:related",idsOrKeys:[...s.map(c=>c.event.id)]},{timeoutIn:2e4,view:o,isLive:!0});let u=s.map(c=>c.event.pubkey);u=[...new Set(u)],await Z.getState().requestInformation({source:"users",idsOrKeys:[...u]},{timeoutIn:1e4,view:o,isLive:!0})}a(!1)};return P.useEffect(()=>{t&&l()},[t]),w.jsxs(w.Fragment,{children:[t&&w.jsx(ve,{padding:4,marginBottom:2,marginTop:2,background:"background",borderRadius:4,children:w.jsx($k,{isResponse:!0,inResponseTo:e.event,relayUrls:e.eventRelayUrls,kind:"NewShortTextNoteResponse",sendCallback:n})}),s&&t&&s.map(u=>{const c=u.user?u.user:{pubkey:u.event.pubkey};return w.jsx(ve,{marginLeft:10,mb:1,children:w.jsx(Dm,{data:u,level:r+1})},`${u.event.id}_${c.pubkey}_replies`)}),i&&t&&w.jsx(w_,{text:"Just a sec ... Loading replies."})]})}const ede=({contentWarning:e,setShowNSFWContent:t})=>w.jsxs(be,{size:"sm",width:"100%",overflowWrap:"break-word",wordBreak:"break-all",onClick:()=>t(!0),children:["Show content"," ",e&&e!==""?`(${e})`:"(NSFW)"]});function tde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var K1=tde(P),nde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},d8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=rde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return K1.createElement("svg",nde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),K1.createElement("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"}))},ode=K1.memo?K1.memo(d8):d8,ide=ode;const ade=Qe(ide);function sde(e){return e?Object.keys(e).filter(t=>t!=="+"&&t!=="-").reduce((t,n)=>(t[n]=e[n],t),{}):{}}const lde=e=>{const t=new Date,n=new Date(e*1e3),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3),i=Math.floor(o/60),a=Math.floor(i/60);return o<60?`${o} seconds ago`:i<60?`${i} minutes ago`:a<24?`${a} hours ago`:`${n.toLocaleDateString()} ${n.toLocaleTimeString()}`};function ude(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var X1=ude(P),cde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},h8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=fde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return X1.createElement("svg",cde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),X1.createElement("path",{d:"M17.06 11.57C17.65 10.88 18 10 18 9C18 7.14 16.73 5.57 15 5.13V3H13V5H11V3H9V5H6V7H8V17H6V19H9V21H11V19H13V21H15V19C17.21 19 19 17.21 19 15C19 13.55 18.22 12.27 17.06 11.57M10 7H14C15.1 7 16 7.9 16 9S15.1 11 14 11H10V7M15 17H10V13H15C16.1 13 17 13.9 17 15S16.1 17 15 17Z"}))},dde=X1.memo?X1.memo(h8):h8,hde=dde;const pde=Qe(hde);function mde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var q1=mde(P),yde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},p8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=gde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return q1.createElement("svg",yde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),q1.createElement("path",{d:"M19,15H23V3H19M15,3H6C5.17,3 4.46,3.5 4.16,4.22L1.14,11.27C1.05,11.5 1,11.74 1,12V14A2,2 0 0,0 3,16H9.31L8.36,20.57C8.34,20.67 8.33,20.77 8.33,20.88C8.33,21.3 8.5,21.67 8.77,21.94L9.83,23L16.41,16.41C16.78,16.05 17,15.55 17,15V5C17,3.89 16.1,3 15,3Z"}))},vde=q1.memo?q1.memo(p8):p8,wde=vde;const bde=Qe(wde);function Sde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Y1=Sde(P),_de=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},m8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Ede(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return Y1.createElement("svg",_de({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Y1.createElement("path",{d:"M23,10C23,8.89 22.1,8 21,8H14.68L15.64,3.43C15.66,3.33 15.67,3.22 15.67,3.11C15.67,2.7 15.5,2.32 15.23,2.05L14.17,1L7.59,7.58C7.22,7.95 7,8.45 7,9V19A2,2 0 0,0 9,21H18C18.83,21 19.54,20.5 19.84,19.78L22.86,12.73C22.95,12.5 23,12.26 23,12V10M1,21H5V9H1V21Z"}))},Cde=Y1.memo?Y1.memo(m8):m8,xde=Cde;const Ode=Qe(xde);function Ade({isReady:e,level:t,repliesCount:n,reactionsCount:r,repostCount:o,zapReceiptCount:i,zapReceiptAmount:a,isReplyOpen:s,onReplyOpen:l,onReplyClose:u,onAction:c}){return w.jsxs(pt,{children:[w.jsx(be,{size:"xs",variant:"outline",color:"gray.500",colorScheme:"blue",leftIcon:w.jsx(Ge,{as:Nk}),onClick:()=>s?u():l(),isDisabled:!e||t>=2,children:n}),w.jsx(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Upvote",leftIcon:w.jsx(Ge,{as:Ode}),onClick:()=>c("reaction","+"),isDisabled:!e,children:(r==null?void 0:r["+"])||0}),w.jsx(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Downvote",leftIcon:w.jsx(Ge,{as:bde}),onClick:()=>c("reaction","-"),isDisabled:!e,children:(r==null?void 0:r["-"])||0}),w.jsx(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Repost",leftIcon:w.jsx(Ge,{as:Bk}),onClick:()=>c("quote"),isDisabled:!e,children:o}),w.jsxs(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"ZAP",leftIcon:w.jsx(Ge,{as:pde}),onClick:()=>c("zap"),isDisabled:!e,children:[i," (",a,")"]})]})}const Pde=({isReady:e,createdAt:t,level:n,repliesCount:r,reactionsCount:o,repostCount:i,zapReceiptCount:a,zapReceiptAmount:s,isReplyOpen:l,onReplyOpen:u,onReplyClose:c,isInfoModalOpen:f,onInfoModalOpen:d,onInfoModalClose:h,onAction:p})=>{const m=sde(o);return w.jsx(rZ,{p:1,pl:2,pr:2,children:w.jsxs(As,{align:"stretch",children:[w.jsx(ve,{overflowWrap:"break-word",wordBreak:"break-word",children:m&&Object.keys(m).map(_=>w.jsxs(be,{size:"xs",variant:"outline","aria-label":"Repost",isDisabled:!0,m:.5,children:[_," ",m[_]]},_))}),w.jsx(ve,{children:w.jsxs(pt,{children:[w.jsx(Ade,{isReady:e,level:n,repliesCount:r,reactionsCount:o,repostCount:i,zapReceiptCount:a,zapReceiptAmount:s,isReplyOpen:l,onReplyOpen:u,onReplyClose:c,onAction:p}),w.jsx(qs,{}),w.jsx(me,{fontSize:12,color:"gray.500",children:lde(t)}),w.jsx(um,{"aria-label":"Event info",size:"xs",variant:"outline",color:"gray.500",icon:w.jsx(Ge,{as:ade}),onClick:()=>f?h():d()})]})})]})})};var Hk={},Wk={},dt={},Tde=function(t,n,r){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},i.type=n.type||"text/javascript",i.charset=n.charset||"utf8",i.async="async"in n?!!n.async:!0,i.src=t,n.attrs&&Ide(i,n.attrs),n.text&&(i.text=""+n.text);var a="onload"in i?y8:Rde;a(i,r),i.onload||y8(i,r),o.appendChild(i)};function Ide(e,t){for(var n in t)e.setAttribute(n,t[n])}function y8(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function Rde(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var kde=function(t){return Mde(t)&&!Dde(t)};function Mde(e){return!!e&&typeof e=="object"}function Dde(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Bde(e)}var Lde=typeof Symbol=="function"&&Symbol.for,Nde=Lde?Symbol.for("react.element"):60103;function Bde(e){return e.$$typeof===Nde}function jde(e){return Array.isArray(e)?[]:{}}function Vf(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Pu(jde(e),e,t):e}function Fde(e,t,n){return e.concat(t).map(function(r){return Vf(r,n)})}function $de(e,t){if(!t.customMerge)return Pu;var n=t.customMerge(e);return typeof n=="function"?n:Pu}function zde(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function g8(e){return Object.keys(e).concat(zde(e))}function Gk(e,t){try{return t in e}catch{return!1}}function Ude(e,t){return Gk(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function Vde(e,t,n){var r={};return n.isMergeableObject(e)&&g8(e).forEach(function(o){r[o]=Vf(e[o],n)}),g8(t).forEach(function(o){Ude(e,o)||(Gk(e,o)&&n.isMergeableObject(t[o])?r[o]=$de(o,n)(e[o],t[o],n):r[o]=Vf(t[o],n))}),r}function Pu(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Fde,n.isMergeableObject=n.isMergeableObject||kde,n.cloneUnlessOtherwiseSpecified=Vf;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):Vde(e,t,n):Vf(t,n)}Pu.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Pu(r,o,n)},{})};var Hde=Pu,Kk=Hde;Object.defineProperty(dt,"__esModule",{value:!0});dt.parseStartTime=nhe;dt.parseEndTime=rhe;dt.randomString=ohe;dt.queryString=ihe;dt.getSDK=ahe;dt.getConfig=she;dt.omit=lhe;dt.callPlayer=uhe;dt.isMediaStream=che;dt.isBlobUrl=fhe;dt.supportsWebKitPresentationMode=dhe;var Wde=Xk(Tde),Gde=Xk(Kk);function Xk(e){return e&&e.__esModule?e:{default:e}}function Kde(e,t){return Zde(e)||Yde(e,t)||qde(e,t)||Xde()}function Xde(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qde(e,t){if(e){if(typeof e=="string")return v8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v8(e,t)}}function v8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(o)throw i}}return n}}function Zde(e){if(Array.isArray(e))return e}var Qde=/[?&#](?:start|t)=([0-9hms]+)/,Jde=/[?&#]end=([0-9hms]+)/,hw=/(\d+)(h|m|s)/g,ehe=/^\d+$/;function qk(e,t){if(!(e instanceof Array)){var n=e.match(t);if(n){var r=n[1];if(r.match(hw))return the(r);if(ehe.test(r))return parseInt(r)}}}function the(e){for(var t=0,n=hw.exec(e);n!==null;){var r=n,o=Kde(r,3),i=o[1],a=o[2];a==="h"&&(t+=parseInt(i,10)*60*60),a==="m"&&(t+=parseInt(i,10)*60),a==="s"&&(t+=parseInt(i,10)),n=hw.exec(e)}return t}function nhe(e){return qk(e,Qde)}function rhe(e){return qk(e,Jde)}function ohe(){return Math.random().toString(36).substr(2,5)}function ihe(e){return Object.keys(e).map(function(t){return"".concat(t,"=").concat(e[t])}).join("&")}function Og(e){return window[e]?window[e]:window.exports&&window.exports[e]?window.exports[e]:window.module&&window.module.exports&&window.module.exports[e]?window.module.exports[e]:null}var dl={};function ahe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return!0},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Wde.default,i=Og(t);return i&&r(i)?Promise.resolve(i):new Promise(function(a,s){if(dl[e]){dl[e].push({resolve:a,reject:s});return}dl[e]=[{resolve:a,reject:s}];var l=function(f){dl[e].forEach(function(d){return d.resolve(f)})};if(n){var u=window[n];window[n]=function(){u&&u(),l(Og(t))}}o(e,function(c){c?(dl[e].forEach(function(f){return f.reject(c)}),dl[e]=null):n||l(Og(t))})})}function she(e,t){return(0,Gde.default)(t.config,e.config)}function lhe(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?r-1:0),i=1;i0&&arguments[0]!==void 0?arguments[0]:document.createElement("video"),t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.canPlay=xe.FLV_EXTENSIONS=xe.DASH_EXTENSIONS=xe.HLS_EXTENSIONS=xe.VIDEO_EXTENSIONS=xe.AUDIO_EXTENSIONS=xe.MATCH_URL_KALTURA=xe.MATCH_URL_VIDYARD=xe.MATCH_URL_MIXCLOUD=xe.MATCH_URL_DAILYMOTION=xe.MATCH_URL_TWITCH_CHANNEL=xe.MATCH_URL_TWITCH_VIDEO=xe.MATCH_URL_WISTIA=xe.MATCH_URL_STREAMABLE=xe.MATCH_URL_FACEBOOK_WATCH=xe.MATCH_URL_FACEBOOK=xe.MATCH_URL_VIMEO=xe.MATCH_URL_SOUNDCLOUD=xe.MATCH_URL_YOUTUBE=void 0;var w8=dt;function hhe(e,t){var n;if(typeof Symbol>"u"||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=phe(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,s;return{s:function(){n=e[Symbol.iterator]()},n:function(){var u=n.next();return i=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function phe(e,t){if(e){if(typeof e=="string")return b8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b8(e,t)}}function b8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nL.length)&&(j=L.length);for(var F=0,B=new Array(j);F"u"||!(Symbol.iterator in Object(L)))){var F=[],B=!0,U=!1,K=void 0;try{for(var W=L[Symbol.iterator](),Q;!(B=(Q=W.next()).done)&&(F.push(Q.value),!(j&&F.length===j));B=!0);}catch(X){U=!0,K=X}finally{try{!B&&W.return!=null&&W.return()}finally{if(U)throw K}}return F}}function p(L){if(Array.isArray(L))return L}function m(L,j){if(!(L instanceof j))throw new TypeError("Cannot call a class as a function")}function _(L,j){for(var F=0;F"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function y(L){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},y(L)}function S(L,j,F){return j in L?Object.defineProperty(L,j,{value:F,enumerable:!0,configurable:!0,writable:!0}):L[j]=F,L}var v="https://www.youtube.com/iframe_api",x="YT",I="onYouTubeIframeAPIReady",R=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,k=/user\/([a-zA-Z0-9_-]+)\/?/,M=/youtube-nocookie\.com/,N="https://www.youtube-nocookie.com",D=function(L){g(F,L);var j=T(F);function F(){var B;m(this,F);for(var U=arguments.length,K=new Array(U),W=0;W1&&arguments[1]!==void 0?arguments[1]:!1;this.callPlayer("seekTo",U),!K&&!this.props.playing&&this.pause()}},{key:"setVolume",value:function(U){this.callPlayer("setVolume",U*100)}},{key:"setPlaybackRate",value:function(U){this.callPlayer("setPlaybackRate",U)}},{key:"setLoop",value:function(U){this.callPlayer("setLoop",U)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var U=this.props.display,K={width:"100%",height:"100%",display:U};return n.default.createElement("div",{style:K},n.default.createElement("div",{ref:this.ref}))}}]),F}(n.Component);e.default=D,S(D,"displayName","YouTube"),S(D,"canPlay",o.canPlay.youtube)}(Ag)),Ag}var Pg={},_8;function vhe(){return _8||(_8=1,function(e){function t(C){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(S){return typeof S}:t=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},t(C)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return i=function(){return C},C}function a(C){if(C&&C.__esModule)return C;if(C===null||t(C)!=="object"&&typeof C!="function")return{default:C};var y=i();if(y&&y.has(C))return y.get(C);var S={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in C)if(Object.prototype.hasOwnProperty.call(C,x)){var I=v?Object.getOwnPropertyDescriptor(C,x):null;I&&(I.get||I.set)?Object.defineProperty(S,x,I):S[x]=C[x]}return S.default=C,y&&y.set(C,S),S}function s(C,y){var S=Object.keys(C);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(C);y&&(v=v.filter(function(x){return Object.getOwnPropertyDescriptor(C,x).enumerable})),S.push.apply(S,v)}return S}function l(C){for(var y=1;y"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(C){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},g(C)}function E(C,y,S){return y in C?Object.defineProperty(C,y,{value:S,enumerable:!0,configurable:!0,writable:!0}):C[y]=S,C}var T="https://w.soundcloud.com/player/api.js",O="SC",A=function(C){d(S,C);var y=p(S);function S(){var v;u(this,S);for(var x=arguments.length,I=new Array(x),R=0;R1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seekTo",x*1e3),I||this.pause()}},{key:"setVolume",value:function(x){this.callPlayer("setVolume",x*100)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var x=this.props.display,I={width:"100%",height:"100%",display:x};return n.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),style:I,frameBorder:0,allow:"autoplay"})}}]),S}(n.Component);e.default=A,E(A,"displayName","SoundCloud"),E(A,"canPlay",o.canPlay.soundcloud),E(A,"loopOnEnded",!0)}(Pg)),Pg}var Tg={},E8;function whe(){return E8||(E8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var S=i();if(S&&S.has(y))return S.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,S&&S.set(y,v),v}function s(y,S){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);S&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var S=1;S"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var T="https://player.vimeo.com/api/player.js",O="Vimeo",A=function(S){return S.replace("/manage/videos","")},C=function(y){d(v,y);var S=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"setMuted",value:function(I){this.callPlayer("setMuted",I)}},{key:"setLoop",value:function(I){this.callPlayer("setLoop",I)}},{key:"setPlaybackRate",value:function(I){this.callPlayer("setPlaybackRate",I)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var I=this.props.display,R={width:"100%",height:"100%",overflow:"hidden",display:I};return n.default.createElement("div",{key:this.props.url,ref:this.ref,style:R})}}]),v}(n.Component);e.default=C,E(C,"displayName","Vimeo"),E(C,"canPlay",o.canPlay.vimeo),E(C,"forceLoad",!0)}(Tg)),Tg}var Ig={},C8;function bhe(){return C8||(C8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var S=i();if(S&&S.has(y))return S.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,S&&S.set(y,v),v}function s(){return s=Object.assign||function(y){for(var S=1;S"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(y){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},b(y)}function g(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var E="https://connect.facebook.net/en_US/sdk.js",T="FB",O="fbAsyncInit",A="facebook-player-",C=function(y){f(v,y);var S=h(v);function v(){var x;l(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I=this.props.config.attributes,R={width:"100%",height:"100%"};return n.default.createElement("div",s({style:R,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"},I))}}]),v}(n.Component);e.default=C,g(C,"displayName","Facebook"),g(C,"canPlay",o.canPlay.facebook),g(C,"loopOnEnded",!0)}(Ig)),Ig}var Rg={},x8;function She(){return x8||(x8=1,function(e){function t(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(C){return typeof C}:t=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t(O)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return i=function(){return O},O}function a(O){if(O&&O.__esModule)return O;if(O===null||t(O)!=="object"&&typeof O!="function")return{default:O};var A=i();if(A&&A.has(O))return A.get(O);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in O)if(Object.prototype.hasOwnProperty.call(O,S)){var v=y?Object.getOwnPropertyDescriptor(O,S):null;v&&(v.get||v.set)?Object.defineProperty(C,S,v):C[S]=O[S]}return C.default=O,A&&A.set(O,C),C}function s(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}function l(O,A){for(var C=0;C"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _(O){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},_(O)}function b(O,A,C){return A in O?Object.defineProperty(O,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[A]=C,O}var g="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs",T=function(O){c(C,O);var A=d(C);function C(){var y;s(this,C);for(var S=arguments.length,v=new Array(S),x=0;x1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",S),v||this.pause()}},{key:"setVolume",value:function(S){this.callPlayer("setVolume",S*100)}},{key:"setLoop",value:function(S){this.callPlayer("setLoop",S)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var S=this.props.url.match(o.MATCH_URL_STREAMABLE)[1],v={width:"100%",height:"100%"};return n.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/".concat(S),frameBorder:"0",scrolling:"no",style:v,allow:"encrypted-media; autoplay; fullscreen;"})}}]),C}(n.Component);e.default=T,b(T,"displayName","Streamable"),b(T,"canPlay",o.canPlay.streamable)}(Rg)),Rg}var kg={},O8;function _he(){return O8||(O8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var S=i();if(S&&S.has(y))return S.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,S&&S.set(y,v),v}function s(y,S){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);S&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var S=1;S"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var T="https://fast.wistia.com/assets/external/E-v1.js",O="Wistia",A="wistia-player-",C=function(y){d(v,y);var S=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("time",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("volume",I)}},{key:"setPlaybackRate",value:function(I){this.callPlayer("playbackRate",I)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I=this.props.url,R=I&&I.match(o.MATCH_URL_WISTIA)[1],k="wistia_embed wistia_async_".concat(R),M={width:"100%",height:"100%"};return n.default.createElement("div",{id:this.playerID,key:R,className:k,style:M})}}]),v}(n.Component);e.default=C,E(C,"displayName","Wistia"),E(C,"canPlay",o.canPlay.wistia),E(C,"loopOnEnded",!0)}(kg)),kg}var Mg={},A8;function Ehe(){return A8||(A8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var S=i();if(S&&S.has(y))return S.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,S&&S.set(y,v),v}function s(y,S){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);S&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var S=1;S"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var T="https://player.twitch.tv/js/embed/v1.js",O="Twitch",A="twitch-player-",C=function(y){d(v,y);var S=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I={width:"100%",height:"100%"};return n.default.createElement("div",{style:I,id:this.playerID})}}]),v}(n.Component);e.default=C,E(C,"displayName","Twitch"),E(C,"canPlay",o.canPlay.twitch),E(C,"loopOnEnded",!0)}(Mg)),Mg}var Dg={},P8;function Che(){return P8||(P8=1,function(e){function t(k){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(N){return typeof N}:t=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},t(k)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var k=new WeakMap;return i=function(){return k},k}function a(k){if(k&&k.__esModule)return k;if(k===null||t(k)!=="object"&&typeof k!="function")return{default:k};var M=i();if(M&&M.has(k))return M.get(k);var N={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in k)if(Object.prototype.hasOwnProperty.call(k,L)){var j=D?Object.getOwnPropertyDescriptor(k,L):null;j&&(j.get||j.set)?Object.defineProperty(N,L,j):N[L]=k[L]}return N.default=k,M&&M.set(k,N),N}function s(k,M){var N=Object.keys(k);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(k);M&&(D=D.filter(function(L){return Object.getOwnPropertyDescriptor(k,L).enumerable})),N.push.apply(N,D)}return N}function l(k){for(var M=1;Mk.length)&&(M=k.length);for(var N=0,D=new Array(M);N"u"||!(Symbol.iterator in Object(k)))){var N=[],D=!0,L=!1,j=void 0;try{for(var F=k[Symbol.iterator](),B;!(D=(B=F.next()).done)&&(N.push(B.value),!(M&&N.length===M));D=!0);}catch(U){L=!0,j=U}finally{try{!D&&F.return!=null&&F.return()}finally{if(L)throw j}}return N}}function p(k){if(Array.isArray(k))return k}function m(k,M){if(!(k instanceof M))throw new TypeError("Cannot call a class as a function")}function _(k,M){for(var N=0;N"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function y(k){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(N){return N.__proto__||Object.getPrototypeOf(N)},y(k)}function S(k,M,N){return M in k?Object.defineProperty(k,M,{value:N,enumerable:!0,configurable:!0,writable:!0}):k[M]=N,k}var v="https://api.dmcdn.net/all.js",x="DM",I="dmAsyncInit",R=function(k){g(N,k);var M=T(N);function N(){var D;m(this,N);for(var L=arguments.length,j=new Array(L),F=0;F1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",L),j||this.pause()}},{key:"setVolume",value:function(L){this.callPlayer("setVolume",L)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var L=this.props.display,j={width:"100%",height:"100%",display:L};return n.default.createElement("div",{style:j},n.default.createElement("div",{ref:this.ref}))}}]),N}(n.Component);e.default=R,S(R,"displayName","DailyMotion"),S(R,"canPlay",o.canPlay.dailymotion),S(R,"loopOnEnded",!0)}(Dg)),Dg}var Lg={},T8;function xhe(){return T8||(T8=1,function(e){function t(C){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(S){return typeof S}:t=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},t(C)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return i=function(){return C},C}function a(C){if(C&&C.__esModule)return C;if(C===null||t(C)!=="object"&&typeof C!="function")return{default:C};var y=i();if(y&&y.has(C))return y.get(C);var S={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in C)if(Object.prototype.hasOwnProperty.call(C,x)){var I=v?Object.getOwnPropertyDescriptor(C,x):null;I&&(I.get||I.set)?Object.defineProperty(S,x,I):S[x]=C[x]}return S.default=C,y&&y.set(C,S),S}function s(C,y){var S=Object.keys(C);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(C);y&&(v=v.filter(function(x){return Object.getOwnPropertyDescriptor(C,x).enumerable})),S.push.apply(S,v)}return S}function l(C){for(var y=1;y"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(C){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},g(C)}function E(C,y,S){return y in C?Object.defineProperty(C,y,{value:S,enumerable:!0,configurable:!0,writable:!0}):C[y]=S,C}var T="https://widget.mixcloud.com/media/js/widgetApi.js",O="Mixcloud",A=function(C){d(S,C);var y=p(S);function S(){var v;u(this,S);for(var x=arguments.length,I=new Array(x),R=0;R1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",x),I||this.pause()}},{key:"setVolume",value:function(x){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var x=this.props,I=x.url,R=x.config,k=I.match(o.MATCH_URL_MIXCLOUD)[1],M={width:"100%",height:"100%"},N=(0,r.queryString)(l(l({},R.options),{},{feed:"/".concat(k,"/")}));return n.default.createElement("iframe",{key:k,ref:this.ref,style:M,src:"https://www.mixcloud.com/widget/iframe/?".concat(N),frameBorder:"0",allow:"autoplay"})}}]),S}(n.Component);e.default=A,E(A,"displayName","Mixcloud"),E(A,"canPlay",o.canPlay.mixcloud),E(A,"loopOnEnded",!0)}(Lg)),Lg}var Ng={},I8;function Ohe(){return I8||(I8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var S=i();if(S&&S.has(y))return S.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,S&&S.set(y,v),v}function s(y,S){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);S&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var S=1;S"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var T="https://play.vidyard.com/embed/v4.js",O="VidyardV4",A="onVidyardAPI",C=function(y){d(v,y);var S=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"setPlaybackRate",value:function(I){this.callPlayer("setPlaybackSpeed",I)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.callPlayer("currentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I=this.props.display,R={width:"100%",height:"100%",display:I};return n.default.createElement("div",{style:R},n.default.createElement("div",{ref:this.ref}))}}]),v}(n.Component);e.default=C,E(C,"displayName","Vidyard"),E(C,"canPlay",o.canPlay.vidyard)}(Ng)),Ng}var Bg={},R8;function Ahe(){return R8||(R8=1,function(e){function t(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(C){return typeof C}:t=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t(O)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return i=function(){return O},O}function a(O){if(O&&O.__esModule)return O;if(O===null||t(O)!=="object"&&typeof O!="function")return{default:O};var A=i();if(A&&A.has(O))return A.get(O);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in O)if(Object.prototype.hasOwnProperty.call(O,S)){var v=y?Object.getOwnPropertyDescriptor(O,S):null;v&&(v.get||v.set)?Object.defineProperty(C,S,v):C[S]=O[S]}return C.default=O,A&&A.set(O,C),C}function s(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}function l(O,A){for(var C=0;C"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _(O){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},_(O)}function b(O,A,C){return A in O?Object.defineProperty(O,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[A]=C,O}var g="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs",T=function(O){c(C,O);var A=d(C);function C(){var y;s(this,C);for(var S=arguments.length,v=new Array(S),x=0;x1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",S),v||this.pause()}},{key:"setVolume",value:function(S){this.callPlayer("setVolume",S)}},{key:"setLoop",value:function(S){this.callPlayer("setLoop",S)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var S={width:"100%",height:"100%"};return n.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:S,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}]),C}(n.Component);e.default=T,b(T,"displayName","Kaltura"),b(T,"canPlay",o.canPlay.kaltura)}(Bg)),Bg}var jg={},k8;function Phe(){return k8||(k8=1,function(e){function t(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(j){return typeof j}:t=function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},t(D)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=dt,o=xe;function i(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return i=function(){return D},D}function a(D){if(D&&D.__esModule)return D;if(D===null||t(D)!=="object"&&typeof D!="function")return{default:D};var L=i();if(L&&L.has(D))return L.get(D);var j={},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var B in D)if(Object.prototype.hasOwnProperty.call(D,B)){var U=F?Object.getOwnPropertyDescriptor(D,B):null;U&&(U.get||U.set)?Object.defineProperty(j,B,U):j[B]=D[B]}return j.default=D,L&&L.set(D,j),j}function s(){return s=Object.assign||function(D){for(var L=1;L"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(D){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(j){return j.__proto__||Object.getPrototypeOf(j)},b(D)}function g(D,L,j){return L in D?Object.defineProperty(D,L,{value:j,enumerable:!0,configurable:!0,writable:!0}):D[L]=j,D}var E=typeof navigator<"u",T=E&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,O=E&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||T)&&!window.MSStream,A=E&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,C="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",y="Hls",S="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",v="dashjs",x="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",I="flvjs",R=/www\.dropbox\.com\/.+/,k=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,M="https://videodelivery.net/{id}/manifest/video.m3u8",N=function(D){f(j,D);var L=h(j);function j(){var F;l(this,j);for(var B=arguments.length,U=new Array(B),K=0;K1&&arguments[1]!==void 0?arguments[1]:!0;this.player.currentTime=B,U||this.pause()}},{key:"setVolume",value:function(B){this.player.volume=B}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,r.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,r.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}},{key:"setPlaybackRate",value:function(B){try{this.player.playbackRate=B}catch(U){this.props.onError(U)}}},{key:"getDuration",value:function(){if(!this.player)return null;var B=this.player,U=B.duration,K=B.seekable;return U===1/0&&K.length>0?K.end(K.length-1):U}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var B=this.player.buffered;if(B.length===0)return 0;var U=B.end(B.length-1),K=this.getDuration();return U>K?K:U}},{key:"getSource",value:function(B){var U=this.shouldUseHLS(B),K=this.shouldUseDASH(B),W=this.shouldUseFLV(B);if(!(B instanceof Array||(0,r.isMediaStream)(B)||U||K||W))return R.test(B)?B.replace("www.dropbox.com","dl.dropboxusercontent.com"):B}},{key:"render",value:function(){var B=this.props,U=B.url,K=B.playing,W=B.loop,Q=B.controls,X=B.muted,J=B.config,te=B.width,le=B.height,ge=this.shouldUseAudio(this.props),se=ge?"audio":"video",ue={width:te==="auto"?te:"100%",height:le==="auto"?le:"100%"};return n.default.createElement(se,s({ref:this.ref,src:this.getSource(U),style:ue,preload:"auto",autoPlay:K||void 0,controls:Q,muted:X,loop:W},J.attributes),U instanceof Array&&U.map(this.renderSourceElement),J.tracks.map(this.renderTrack))}}]),j}(n.Component);e.default=N,g(N,"displayName","FilePlayer"),g(N,"canPlay",o.canPlay.file)}(jg)),jg}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=P,n=dt,r=xe;function o(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(c){return typeof c}:o=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(l)}function i(){if(typeof WeakMap!="function")return null;var l=new WeakMap;return i=function(){return l},l}function a(l){if(l&&l.__esModule)return l;if(l===null||o(l)!=="object"&&typeof l!="function")return{default:l};var u=i();if(u&&u.has(l))return u.get(l);var c={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in l)if(Object.prototype.hasOwnProperty.call(l,d)){var h=f?Object.getOwnPropertyDescriptor(l,d):null;h&&(h.get||h.set)?Object.defineProperty(c,d,h):c[d]=l[d]}return c.default=l,u&&u.set(l,c),c}var s=[{key:"youtube",name:"YouTube",canPlay:r.canPlay.youtube,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(ghe())})})},{key:"soundcloud",name:"SoundCloud",canPlay:r.canPlay.soundcloud,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(vhe())})})},{key:"vimeo",name:"Vimeo",canPlay:r.canPlay.vimeo,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(whe())})})},{key:"facebook",name:"Facebook",canPlay:r.canPlay.facebook,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(bhe())})})},{key:"streamable",name:"Streamable",canPlay:r.canPlay.streamable,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(She())})})},{key:"wistia",name:"Wistia",canPlay:r.canPlay.wistia,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(_he())})})},{key:"twitch",name:"Twitch",canPlay:r.canPlay.twitch,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Ehe())})})},{key:"dailymotion",name:"DailyMotion",canPlay:r.canPlay.dailymotion,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Che())})})},{key:"mixcloud",name:"Mixcloud",canPlay:r.canPlay.mixcloud,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(xhe())})})},{key:"vidyard",name:"Vidyard",canPlay:r.canPlay.vidyard,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Ohe())})})},{key:"kaltura",name:"Kaltura",canPlay:r.canPlay.kaltura,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Ahe())})})},{key:"file",name:"FilePlayer",canPlay:r.canPlay.file,canEnablePIP:function(u){return r.canPlay.file(u)&&(document.pictureInPictureEnabled||(0,n.supportsWebKitPresentationMode)())&&!r.AUDIO_EXTENSIONS.test(u)},lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Phe())})})}];e.default=s})(Wk);var Om={},M8=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function The(e,t){return!!(e===t||M8(e)&&M8(t))}function Ihe(e,t){if(e.length!==t.length)return!1;for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(C){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},E(C)}function T(C,y,S){return y in C?Object.defineProperty(C,y,{value:S,enumerable:!0,configurable:!0,writable:!0}):C[y]=S,C}var O=5e3,A=function(C){h(S,C);var y=m(S);function S(){var v;c(this,S);for(var x=arguments.length,I=new Array(x),R=0;R0&&x<1;if(M){var N=this.player.getDuration();if(!N){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(N*x,R);return}this.player.seekTo(x,R)}},{key:"render",value:function(){var x=this.props.activePlayer;return x?n.default.createElement(x,u({},this.props,{onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError})):null}}]),S}(n.Component);e.default=A,T(A,"displayName","Player"),T(A,"propTypes",o.propTypes),T(A,"defaultProps",o.defaultProps)})(c7);var $g={},L8;function Bhe(){return L8||(L8=1,function(e){function t(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(C){return typeof C}:t=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t(O)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(P);function r(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return r=function(){return O},O}function o(O){if(O&&O.__esModule)return O;if(O===null||t(O)!=="object"&&typeof O!="function")return{default:O};var A=r();if(A&&A.has(O))return A.get(O);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in O)if(Object.prototype.hasOwnProperty.call(O,S)){var v=y?Object.getOwnPropertyDescriptor(O,S):null;v&&(v.get||v.set)?Object.defineProperty(C,S,v):C[S]=O[S]}return C.default=O,A&&A.set(O,C),C}function i(O,A){var C=Object.keys(O);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(O);A&&(y=y.filter(function(S){return Object.getOwnPropertyDescriptor(O,S).enumerable})),C.push.apply(C,y)}return C}function a(O){for(var A=1;A"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function _(O){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},_(O)}function b(O,A,C){return A in O?Object.defineProperty(O,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[A]=C,O}var g="64px",E={},T=function(O){c(C,O);var A=d(C);function C(){var y;s(this,C);for(var S=arguments.length,v=new Array(S),x=0;xe.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Q1(e){return Q1=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Q1(e)}function Vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f7(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return f7=function(){return e},e}function d7(e){if(e&&e.__esModule)return e;if(e===null||ef(e)!=="object"&&typeof e!="function")return{default:e};var t=f7();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}var Zhe=(0,cs.lazy)(function(){return Promise.resolve().then(function(){return d7(Bhe())})}),Qhe=typeof window<"u"&&window.document,Jhe=typeof fo<"u"&&fo.window&&fo.window.document,epe=Object.keys(Tc.propTypes),tpe=Qhe||Jhe?cs.Suspense:function(){return null},pc=[],npe=function(t,n){var r,o;return o=r=function(i){Khe(s,i);var a=Xhe(s);function s(){var l;Whe(this,s);for(var u=arguments.length,c=new Array(u),f=0;f0&&arguments[0]!==void 0?arguments[0]:"player";return l.player?l.player.getInternalPlayer(d):null}),Vt(Un(l),"seekTo",function(d,h,p){if(!l.player)return null;l.player.seekTo(d,h,p)}),Vt(Un(l),"handleReady",function(){l.props.onReady(Un(l))}),Vt(Un(l),"getActivePlayer",(0,zg.default)(function(d){for(var h=0,p=[].concat(pc,Ug(t));h=t||C<0||f&&y>=i}function b(){var A=Vg();if(_(A))return g(A);s=setTimeout(b,m(A))}function g(A){return s=void 0,d&&r?h(A):(r=o=void 0,a)}function E(){s!==void 0&&clearTimeout(s),u=0,r=l=o=s=void 0}function T(){return s===void 0?a:g(Vg())}function O(){var A=Vg(),C=_(A);if(r=arguments,o=this,l=A,C){if(s===void 0)return p(l);if(f)return s=setTimeout(b,t),h(l)}return s===void 0&&(s=setTimeout(b,t)),a}return O.cancel=E,O.flush=T,O}function gw(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function vpe(e){return!!e&&typeof e=="object"}function wpe(e){return typeof e=="symbol"||vpe(e)&&ppe.call(e)==ope}function U8(e){if(typeof e=="number")return e;if(wpe(e))return z8;if(gw(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=gw(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ipe,"");var n=spe.test(e);return n||lpe.test(e)?upe(e.slice(2),n?2:8):ape.test(e)?z8:+e}var bpe=gpe,y7={exports:{}};/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],o=0;o0?1:0):0};ce.lazySlidesOnLeft=v7;var w7=function(t){return t.centerMode?Math.floor((t.slidesToShow-1)/2)+1+(parseInt(t.centerPadding)>0?1:0):t.slidesToShow};ce.lazySlidesOnRight=w7;var J1=function(t){return t&&t.offsetWidth||0};ce.getWidth=J1;var O_=function(t){return t&&t.offsetHeight||0};ce.getHeight=O_;var A_=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r,o,i,a;return r=t.startX-t.curX,o=t.startY-t.curY,i=Math.atan2(o,r),a=Math.round(i*180/Math.PI),a<0&&(a=360-Math.abs(a)),a<=45&&a>=0||a<=360&&a>=315?"left":a>=135&&a<=225?"right":n===!0?a>=35&&a<=135?"up":"down":"vertical"};ce.getSwipeDirection=A_;var P_=function(t){var n=!0;return t.infinite||(t.centerMode&&t.currentSlide>=t.slideCount-1||t.slideCount<=t.slidesToShow||t.currentSlide>=t.slideCount-t.slidesToShow)&&(n=!1),n};ce.canGoNext=P_;var xpe=function(t,n){var r={};return n.forEach(function(o){return r[o]=t[o]}),r};ce.extractObject=xpe;var Ope=function(t){var n=Spe.default.Children.count(t.children),r=t.listRef,o=Math.ceil(J1(r)),i=t.trackRef&&t.trackRef.node,a=Math.ceil(J1(i)),s;if(t.vertical)s=o;else{var l=t.centerMode&&parseInt(t.centerPadding)*2;typeof t.centerPadding=="string"&&t.centerPadding.slice(-1)==="%"&&(l*=o/100),s=Math.ceil((o-l)/t.slidesToShow)}var u=r&&O_(r.querySelector('[data-index="0"]')),c=u*t.slidesToShow,f=t.currentSlide===void 0?t.initialSlide:t.currentSlide;t.rtl&&t.currentSlide===void 0&&(f=n-1-t.initialSlide);var d=t.lazyLoadedList||[],h=E_(Ot(Ot({},t),{},{currentSlide:f,lazyLoadedList:d}));d=d.concat(h);var p={slideCount:n,slideWidth:s,listWidth:o,trackWidth:a,currentSlide:f,slideHeight:u,listHeight:c,lazyLoadedList:d};return t.autoplaying===null&&t.autoplay&&(p.autoplaying="playing"),p};ce.initializedState=Ope;var Ape=function(t){var n=t.waitForAnimate,r=t.animating,o=t.fade,i=t.infinite,a=t.index,s=t.slideCount,l=t.lazyLoad,u=t.currentSlide,c=t.centerMode,f=t.slidesToScroll,d=t.slidesToShow,h=t.useCSS,p=t.lazyLoadedList;if(n&&r)return{};var m=a,_,b,g,E={},T={},O=i?a:g7(a,0,s-1);if(o){if(!i&&(a<0||a>=s))return{};a<0?m=a+s:a>=s&&(m=a-s),l&&p.indexOf(m)<0&&(p=p.concat(m)),E={animating:!0,currentSlide:m,lazyLoadedList:p,targetSlide:m},T={animating:!1,targetSlide:m}}else _=m,m<0?(_=m+s,i?s%f!==0&&(_=s-s%f):_=0):!P_(t)&&m>u?m=_=u:c&&m>=s?(m=i?s:s-1,_=i?0:s-1):m>=s&&(_=m-s,i?s%f!==0&&(_=0):_=s-d),!i&&m+d>=s&&(_=s-d),b=Wf(Ot(Ot({},t),{},{slideIndex:m})),g=Wf(Ot(Ot({},t),{},{slideIndex:_})),i||(b===g&&(m=_),b=g),l&&(p=p.concat(E_(Ot(Ot({},t),{},{currentSlide:m})))),h?(E={animating:!0,currentSlide:_,trackStyle:T_(Ot(Ot({},t),{},{left:b})),lazyLoadedList:p,targetSlide:O},T={animating:!1,currentSlide:_,trackStyle:Hf(Ot(Ot({},t),{},{left:g})),swipeLeft:null,targetSlide:O}):E={currentSlide:_,trackStyle:Hf(Ot(Ot({},t),{},{left:g})),lazyLoadedList:p,targetSlide:O};return{state:E,nextState:T}};ce.slideHandler=Ape;var Ppe=function(t,n){var r,o,i,a,s,l=t.slidesToScroll,u=t.slidesToShow,c=t.slideCount,f=t.currentSlide,d=t.targetSlide,h=t.lazyLoad,p=t.infinite;if(a=c%l!==0,r=a?0:(c-f)%l,n.message==="previous")i=r===0?l:u-r,s=f-i,h&&!p&&(o=f-i,s=o===-1?c-1:o),p||(s=d-l);else if(n.message==="next")i=r===0?l:r,s=f+i,h&&!p&&(s=(f+l)%c+r),p||(s=d+l);else if(n.message==="dots")s=n.index*n.slidesToScroll;else if(n.message==="children"){if(s=n.index,p){var m=E7(Ot(Ot({},t),{},{targetSlide:s}));s>n.currentSlide&&m==="left"?s=s-c:s10)return{scrolling:!0};s&&(g.swipeLength=S);var v=(l?-1:1)*(g.curX>g.startX?1:-1);s&&(v=g.curY>g.startY?1:-1);var x=Math.ceil(m/_),I=A_(n.touchObject,s),R=g.swipeLength;return b||(u===0&&(I==="right"||I==="down")||u+1>=x&&(I==="left"||I==="up")||!P_(n)&&(I==="left"||I==="up"))&&(R=g.swipeLength*c,f===!1&&d&&(d(I),C.edgeDragged=!0)),!h&&E&&(E(I),C.swiped=!0),i?A=y+R*(T/O)*v:l?A=y-R*v:A=y+R*v,s&&(A=y+R*v),C=Ot(Ot({},C),{},{touchObject:g,swipeLeft:A,trackStyle:Hf(Ot(Ot({},n),{},{left:A}))}),Math.abs(g.curX-g.startX)10&&(C.swiping=!0,Rs(t)),C}};ce.swipeMove=Rpe;var kpe=function(t,n){var r=n.dragging,o=n.swipe,i=n.touchObject,a=n.listWidth,s=n.touchThreshold,l=n.verticalSwiping,u=n.listHeight,c=n.swipeToSlide,f=n.scrolling,d=n.onSwipe,h=n.targetSlide,p=n.currentSlide,m=n.infinite;if(!r)return o&&Rs(t),{};var _=l?u/s:a/s,b=A_(i,l),g={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(f||!i.swipeLength)return g;if(i.swipeLength>_){Rs(t),d&&d(b);var E,T,O=m?p:h;switch(b){case"left":case"up":T=O+ww(n),E=c?vw(n,T):T,g.currentDirection=0;break;case"right":case"down":T=O-ww(n),E=c?vw(n,T):T,g.currentDirection=1;break;default:E=O}g.triggerSlideHandler=E}else{var A=Wf(n);g.trackStyle=T_(Ot(Ot({},n),{},{left:A}))}return g};ce.swipeEnd=kpe;var b7=function(t){for(var n=t.infinite?t.slideCount*2:t.slideCount,r=t.infinite?t.slidesToShow*-1:0,o=t.infinite?t.slidesToShow*-1:0,i=[];rr[r.length-1])n=r[r.length-1];else for(var i in r){if(nt.swipeLeft*-1)return r=l,!1}else if(l.offsetLeft-n+J1(l)/2>t.swipeLeft*-1)return r=l,!1;return!0}),!r)return 0;var a=t.rtl===!0?t.slideCount-t.currentSlide:t.currentSlide,s=Math.abs(r.dataset.index-a)||1;return s}else return t.slidesToScroll};ce.getSlideCount=ww;var Im=function(t,n){return n.reduce(function(r,o){return r&&t.hasOwnProperty(o)},!0)?null:console.error("Keys Missing:",t)};ce.checkSpecKeys=Im;var Hf=function(t){Im(t,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var n,r,o=t.slideCount+2*t.slidesToShow;t.vertical?r=o*t.slideHeight:n=_7(t)*t.slideWidth;var i={opacity:1,transition:"",WebkitTransition:""};if(t.useTransform){var a=t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",s=t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",l=t.vertical?"translateY("+t.left+"px)":"translateX("+t.left+"px)";i=Ot(Ot({},i),{},{WebkitTransform:a,transform:s,msTransform:l})}else t.vertical?i.top=t.left:i.left=t.left;return t.fade&&(i={opacity:1}),n&&(i.width=n),r&&(i.height=r),window&&!window.addEventListener&&window.attachEvent&&(t.vertical?i.marginTop=t.left+"px":i.marginLeft=t.left+"px"),i};ce.getTrackCSS=Hf;var T_=function(t){Im(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var n=Hf(t);return t.useTransform?(n.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,n.transition="transform "+t.speed+"ms "+t.cssEase):t.vertical?n.transition="top "+t.speed+"ms "+t.cssEase:n.transition="left "+t.speed+"ms "+t.cssEase,n};ce.getTrackAnimateCSS=T_;var Wf=function(t){if(t.unslick)return 0;Im(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var n=t.slideIndex,r=t.trackRef,o=t.infinite,i=t.centerMode,a=t.slideCount,s=t.slidesToShow,l=t.slidesToScroll,u=t.slideWidth,c=t.listWidth,f=t.variableWidth,d=t.slideHeight,h=t.fade,p=t.vertical,m=0,_,b,g=0;if(h||t.slideCount===1)return 0;var E=0;if(o?(E=-tf(t),a%l!==0&&n+l>a&&(E=-(n>a?s-(n-a):a%l)),i&&(E+=parseInt(s/2))):(a%l!==0&&n+l>a&&(E=s-a%l),i&&(E=parseInt(s/2))),m=E*u,g=E*d,p?_=n*d*-1+g:_=n*u*-1+m,f===!0){var T,O=r&&r.node;if(T=n+tf(t),b=O&&O.childNodes[T],_=b?b.offsetLeft*-1:0,i===!0){T=o?n+tf(t):n,b=O&&O.children[T],_=0;for(var A=0;At.currentSlide?t.targetSlide>t.currentSlide+C7(t)?"left":"right":t.targetSlide0&&(a+=1),o&&n%2===0&&(a+=1),a}return o?0:n-1};ce.slidesOnRight=C7;var x7=function(t){var n=t.slidesToShow,r=t.centerMode,o=t.rtl,i=t.centerPadding;if(r){var a=(n-1)/2+1;return parseInt(i)>0&&(a+=1),!o&&n%2===0&&(a+=1),a}return o?n-1:0};ce.slidesOnLeft=x7;var Mpe=function(){return!!(typeof window<"u"&&window.document&&window.document.createElement)};ce.canUseDOM=Mpe;var Rm={};function bw(e){"@babel/helpers - typeof";return bw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bw(e)}Object.defineProperty(Rm,"__esModule",{value:!0});Rm.Track=void 0;var aa=O7(P),Hg=O7(Tm),Wg=ce;function O7(e){return e&&e.__esModule?e:{default:e}}function Sw(){return Sw=Object.assign||function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e0(e){return e0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},e0(e)}function W8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t=t.slideCount,t.centerMode?(i=Math.floor(t.slidesToShow/2),r=(a-t.currentSlide)%t.slideCount===0,a>t.currentSlide-i-1&&a<=t.currentSlide+i&&(n=!0)):n=t.currentSlide<=a&&a=t.slideCount?s=t.targetSlide-t.slideCount:s=t.targetSlide;var l=a===s;return{"slick-slide":!0,"slick-active":n,"slick-center":r,"slick-cloned":o,"slick-current":l}},$pe=function(t){var n={};return(t.variableWidth===void 0||t.variableWidth===!1)&&(n.width=t.slideWidth),t.fade&&(n.position="relative",t.vertical?n.top=-t.index*parseInt(t.slideHeight):n.left=-t.index*parseInt(t.slideWidth),n.opacity=t.currentSlide===t.index?1:0,t.useCSS&&(n.transition="opacity "+t.speed+"ms "+t.cssEase+", visibility "+t.speed+"ms "+t.cssEase)),n},Kg=function(t,n){return t.key||n},zpe=function(t){var n,r=[],o=[],i=[],a=aa.default.Children.count(t.children),s=(0,Wg.lazyStartIndex)(t),l=(0,Wg.lazyEndIndex)(t);return aa.default.Children.forEach(t.children,function(u,c){var f,d={message:"children",index:c,slidesToScroll:t.slidesToScroll,currentSlide:t.currentSlide};!t.lazyLoad||t.lazyLoad&&t.lazyLoadedList.indexOf(c)>=0?f=u:f=aa.default.createElement("div",null);var h=$pe(hr(hr({},t),{},{index:c})),p=f.props.className||"",m=Gg(hr(hr({},t),{},{index:c}));if(r.push(aa.default.cloneElement(f,{key:"original"+Kg(f,c),"data-index":c,className:(0,Hg.default)(m,p),tabIndex:"-1","aria-hidden":!m["slick-active"],style:hr(hr({outline:"none"},f.props.style||{}),h),onClick:function(g){f.props&&f.props.onClick&&f.props.onClick(g),t.focusOnSelect&&t.focusOnSelect(d)}})),t.infinite&&t.fade===!1){var _=a-c;_<=(0,Wg.getPreClones)(t)&&a!==t.slidesToShow&&(n=-_,n>=s&&(f=u),m=Gg(hr(hr({},t),{},{index:n})),o.push(aa.default.cloneElement(f,{key:"precloned"+Kg(f,n),"data-index":n,tabIndex:"-1",className:(0,Hg.default)(m,p),"aria-hidden":!m["slick-active"],style:hr(hr({},f.props.style||{}),h),onClick:function(g){f.props&&f.props.onClick&&f.props.onClick(g),t.focusOnSelect&&t.focusOnSelect(d)}}))),a!==t.slidesToShow&&(n=a+c,n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function t0(e){return t0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},t0(e)}var Jpe=function(t){var n;return t.infinite?n=Math.ceil(t.slideCount/t.slidesToScroll):n=Math.ceil((t.slideCount-t.slidesToShow)/t.slidesToScroll)+1,n},e1e=function(e){Xpe(n,e);var t=qpe(n);function n(){return Gpe(this,n),t.apply(this,arguments)}return Kpe(n,[{key:"clickHandler",value:function(o,i){i.preventDefault(),this.props.clickHandler(o)}},{key:"render",value:function(){for(var o=this.props,i=o.onMouseEnter,a=o.onMouseOver,s=o.onMouseLeave,l=o.infinite,u=o.slidesToScroll,c=o.slidesToShow,f=o.slideCount,d=o.currentSlide,h=Jpe({slideCount:f,slidesToScroll:u,slidesToShow:c,infinite:l}),p={onMouseEnter:i,onMouseOver:a,onMouseLeave:s},m=[],_=0;_=T&&d<=g:d===T}),A={message:"dots",index:_,slidesToScroll:u,currentSlide:d},C=this.clickHandler.bind(this,A);m=m.concat(Ph.default.createElement("li",{key:_,className:O},Ph.default.cloneElement(this.props.customPaging(_),{onClick:C})))}return Ph.default.cloneElement(this.props.appendDots(m),Hpe({className:this.props.dotsClass},p))}}]),n}(Ph.default.PureComponent);km.Dots=e1e;var Tu={};function Aw(e){"@babel/helpers - typeof";return Aw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Aw(e)}Object.defineProperty(Tu,"__esModule",{value:!0});Tu.PrevArrow=Tu.NextArrow=void 0;var su=T7(P),P7=T7(Tm),t1e=ce;function T7(e){return e&&e.__esModule?e:{default:e}}function n0(){return n0=Object.assign||function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function o0(e){return o0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},o0(e)}var a1e=function(e){k7(n,e);var t=M7(n);function n(){return I7(this,n),t.apply(this,arguments)}return R7(n,[{key:"clickHandler",value:function(o,i){i&&i.preventDefault(),this.props.clickHandler(o,i)}},{key:"render",value:function(){var o={"slick-arrow":!0,"slick-prev":!0},i=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(this.props.currentSlide===0||this.props.slideCount<=this.props.slidesToShow)&&(o["slick-disabled"]=!0,i=null);var a={key:"0","data-role":"none",className:(0,P7.default)(o),style:{display:"block"},onClick:i},s={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},l;return this.props.prevArrow?l=su.default.cloneElement(this.props.prevArrow,r0(r0({},a),s)):l=su.default.createElement("button",n0({key:"0",type:"button"},a)," ","Previous"),l}}]),n}(su.default.PureComponent);Tu.PrevArrow=a1e;var s1e=function(e){k7(n,e);var t=M7(n);function n(){return I7(this,n),t.apply(this,arguments)}return R7(n,[{key:"clickHandler",value:function(o,i){i&&i.preventDefault(),this.props.clickHandler(o,i)}},{key:"render",value:function(){var o={"slick-arrow":!0,"slick-next":!0},i=this.clickHandler.bind(this,{message:"next"});(0,t1e.canGoNext)(this.props)||(o["slick-disabled"]=!0,i=null);var a={key:"1","data-role":"none",className:(0,P7.default)(o),style:{display:"block"},onClick:i},s={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},l;return this.props.nextArrow?l=su.default.cloneElement(this.props.nextArrow,r0(r0({},a),s)):l=su.default.createElement("button",n0({key:"1",type:"button"},a)," ","Next"),l}}]),n}(su.default.PureComponent);Tu.NextArrow=s1e;var D7=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!Tw||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),h1e?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Tw||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=d1e.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),L7=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof Iu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new _1e(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Iu(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new E1e(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),B7=typeof WeakMap<"u"?new WeakMap:new D7,j7=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=p1e.getInstance(),r=new C1e(t,n,this);B7.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){j7.prototype[e]=function(){var t;return(t=B7.get(this))[e].apply(t,arguments)}});var x1e=function(){return typeof i0.ResizeObserver<"u"?i0.ResizeObserver:j7}();const O1e=Object.freeze(Object.defineProperty({__proto__:null,default:x1e},Symbol.toStringTag,{value:"Module"})),A1e=M6(O1e);Object.defineProperty(Pm,"__esModule",{value:!0});Pm.InnerSlider=void 0;var Qn=Ad(P),P1e=Ad(m7),T1e=Ad(bpe),I1e=Ad(Tm),Mt=ce,R1e=Rm,k1e=km,Q8=Tu,M1e=Ad(A1e);function Ad(e){return e&&e.__esModule?e:{default:e}}function s0(e){"@babel/helpers - typeof";return s0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s0(e)}function l0(){return l0=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function L1e(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function J8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ae(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function u0(e){return u0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},u0(e)}function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var U1e=function(e){j1e(n,e);var t=F1e(n);function n(r){var o;N1e(this,n),o=t.call(this,r),Fe(je(o),"listRefHandler",function(a){return o.list=a}),Fe(je(o),"trackRefHandler",function(a){return o.track=a}),Fe(je(o),"adaptHeight",function(){if(o.props.adaptiveHeight&&o.list){var a=o.list.querySelector('[data-index="'.concat(o.state.currentSlide,'"]'));o.list.style.height=(0,Mt.getHeight)(a)+"px"}}),Fe(je(o),"componentDidMount",function(){if(o.props.onInit&&o.props.onInit(),o.props.lazyLoad){var a=(0,Mt.getOnDemandLazySlides)(Ae(Ae({},o.props),o.state));a.length>0&&(o.setState(function(l){return{lazyLoadedList:l.lazyLoadedList.concat(a)}}),o.props.onLazyLoad&&o.props.onLazyLoad(a))}var s=Ae({listRef:o.list,trackRef:o.track},o.props);o.updateState(s,!0,function(){o.adaptHeight(),o.props.autoplay&&o.autoPlay("update")}),o.props.lazyLoad==="progressive"&&(o.lazyLoadTimer=setInterval(o.progressiveLazyLoad,1e3)),o.ro=new M1e.default(function(){o.state.animating?(o.onWindowResized(!1),o.callbackTimers.push(setTimeout(function(){return o.onWindowResized()},o.props.speed))):o.onWindowResized()}),o.ro.observe(o.list),document.querySelectorAll&&Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"),function(l){l.onfocus=o.props.pauseOnFocus?o.onSlideFocus:null,l.onblur=o.props.pauseOnFocus?o.onSlideBlur:null}),window.addEventListener?window.addEventListener("resize",o.onWindowResized):window.attachEvent("onresize",o.onWindowResized)}),Fe(je(o),"componentWillUnmount",function(){o.animationEndCallback&&clearTimeout(o.animationEndCallback),o.lazyLoadTimer&&clearInterval(o.lazyLoadTimer),o.callbackTimers.length&&(o.callbackTimers.forEach(function(a){return clearTimeout(a)}),o.callbackTimers=[]),window.addEventListener?window.removeEventListener("resize",o.onWindowResized):window.detachEvent("onresize",o.onWindowResized),o.autoplayTimer&&clearInterval(o.autoplayTimer),o.ro.disconnect()}),Fe(je(o),"componentDidUpdate",function(a){if(o.checkImagesLoad(),o.props.onReInit&&o.props.onReInit(),o.props.lazyLoad){var s=(0,Mt.getOnDemandLazySlides)(Ae(Ae({},o.props),o.state));s.length>0&&(o.setState(function(c){return{lazyLoadedList:c.lazyLoadedList.concat(s)}}),o.props.onLazyLoad&&o.props.onLazyLoad(s))}o.adaptHeight();var l=Ae(Ae({listRef:o.list,trackRef:o.track},o.props),o.state),u=o.didPropsChange(a);u&&o.updateState(l,u,function(){o.state.currentSlide>=Qn.default.Children.count(o.props.children)&&o.changeSlide({message:"index",index:Qn.default.Children.count(o.props.children)-o.props.slidesToShow,currentSlide:o.state.currentSlide}),o.props.autoplay?o.autoPlay("update"):o.pause("paused")})}),Fe(je(o),"onWindowResized",function(a){o.debouncedResize&&o.debouncedResize.cancel(),o.debouncedResize=(0,T1e.default)(function(){return o.resizeWindow(a)},50),o.debouncedResize()}),Fe(je(o),"resizeWindow",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=!!(o.track&&o.track.node);if(s){var l=Ae(Ae({listRef:o.list,trackRef:o.track},o.props),o.state);o.updateState(l,a,function(){o.props.autoplay?o.autoPlay("update"):o.pause("paused")}),o.setState({animating:!1}),clearTimeout(o.animationEndCallback),delete o.animationEndCallback}}),Fe(je(o),"updateState",function(a,s,l){var u=(0,Mt.initializedState)(a);a=Ae(Ae(Ae({},a),u),{},{slideIndex:u.currentSlide});var c=(0,Mt.getTrackLeft)(a);a=Ae(Ae({},a),{},{left:c});var f=(0,Mt.getTrackCSS)(a);(s||Qn.default.Children.count(o.props.children)!==Qn.default.Children.count(a.children))&&(u.trackStyle=f),o.setState(u,l)}),Fe(je(o),"ssrInit",function(){if(o.props.variableWidth){var a=0,s=0,l=[],u=(0,Mt.getPreClones)(Ae(Ae(Ae({},o.props),o.state),{},{slideCount:o.props.children.length})),c=(0,Mt.getPostClones)(Ae(Ae(Ae({},o.props),o.state),{},{slideCount:o.props.children.length}));o.props.children.forEach(function(C){l.push(C.props.style.width),a+=C.props.style.width});for(var f=0;f=s&&o.onWindowResized()};if(!u.onclick)u.onclick=function(){return u.parentNode.focus()};else{var f=u.onclick;u.onclick=function(){f(),u.parentNode.focus()}}u.onload||(o.props.lazyLoad?u.onload=function(){o.adaptHeight(),o.callbackTimers.push(setTimeout(o.onWindowResized,o.props.speed))}:(u.onload=c,u.onerror=function(){c(),o.props.onLazyLoadError&&o.props.onLazyLoadError()}))})}),Fe(je(o),"progressiveLazyLoad",function(){for(var a=[],s=Ae(Ae({},o.props),o.state),l=o.state.currentSlide;l=-(0,Mt.getPreClones)(s);u--)if(o.state.lazyLoadedList.indexOf(u)<0){a.push(u);break}a.length>0?(o.setState(function(c){return{lazyLoadedList:c.lazyLoadedList.concat(a)}}),o.props.onLazyLoad&&o.props.onLazyLoad(a)):o.lazyLoadTimer&&(clearInterval(o.lazyLoadTimer),delete o.lazyLoadTimer)}),Fe(je(o),"slideHandler",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=o.props,u=l.asNavFor,c=l.beforeChange,f=l.onLazyLoad,d=l.speed,h=l.afterChange,p=o.state.currentSlide,m=(0,Mt.slideHandler)(Ae(Ae(Ae({index:a},o.props),o.state),{},{trackRef:o.track,useCSS:o.props.useCSS&&!s})),_=m.state,b=m.nextState;if(_){c&&c(p,_.currentSlide);var g=_.lazyLoadedList.filter(function(E){return o.state.lazyLoadedList.indexOf(E)<0});f&&g.length>0&&f(g),!o.props.waitForAnimate&&o.animationEndCallback&&(clearTimeout(o.animationEndCallback),h&&h(p),delete o.animationEndCallback),o.setState(_,function(){u&&o.asNavForIndex!==a&&(o.asNavForIndex=a,u.innerSlider.slideHandler(a)),b&&(o.animationEndCallback=setTimeout(function(){var E=b.animating,T=D1e(b,["animating"]);o.setState(T,function(){o.callbackTimers.push(setTimeout(function(){return o.setState({animating:E})},10)),h&&h(_.currentSlide),delete o.animationEndCallback})},d))})}}),Fe(je(o),"changeSlide",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=Ae(Ae({},o.props),o.state),u=(0,Mt.changeSlide)(l,a);if(!(u!==0&&!u)&&(s===!0?o.slideHandler(u,s):o.slideHandler(u),o.props.autoplay&&o.autoPlay("update"),o.props.focusOnSelect)){var c=o.list.querySelectorAll(".slick-current");c[0]&&c[0].focus()}}),Fe(je(o),"clickHandler",function(a){o.clickable===!1&&(a.stopPropagation(),a.preventDefault()),o.clickable=!0}),Fe(je(o),"keyHandler",function(a){var s=(0,Mt.keyHandler)(a,o.props.accessibility,o.props.rtl);s!==""&&o.changeSlide({message:s})}),Fe(je(o),"selectHandler",function(a){o.changeSlide(a)}),Fe(je(o),"disableBodyScroll",function(){var a=function(l){l=l||window.event,l.preventDefault&&l.preventDefault(),l.returnValue=!1};window.ontouchmove=a}),Fe(je(o),"enableBodyScroll",function(){window.ontouchmove=null}),Fe(je(o),"swipeStart",function(a){o.props.verticalSwiping&&o.disableBodyScroll();var s=(0,Mt.swipeStart)(a,o.props.swipe,o.props.draggable);s!==""&&o.setState(s)}),Fe(je(o),"swipeMove",function(a){var s=(0,Mt.swipeMove)(a,Ae(Ae(Ae({},o.props),o.state),{},{trackRef:o.track,listRef:o.list,slideIndex:o.state.currentSlide}));s&&(s.swiping&&(o.clickable=!1),o.setState(s))}),Fe(je(o),"swipeEnd",function(a){var s=(0,Mt.swipeEnd)(a,Ae(Ae(Ae({},o.props),o.state),{},{trackRef:o.track,listRef:o.list,slideIndex:o.state.currentSlide}));if(s){var l=s.triggerSlideHandler;delete s.triggerSlideHandler,o.setState(s),l!==void 0&&(o.slideHandler(l),o.props.verticalSwiping&&o.enableBodyScroll())}}),Fe(je(o),"touchEnd",function(a){o.swipeEnd(a),o.clickable=!0}),Fe(je(o),"slickPrev",function(){o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"previous"})},0))}),Fe(je(o),"slickNext",function(){o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"next"})},0))}),Fe(je(o),"slickGoTo",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(a=Number(a),isNaN(a))return"";o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"index",index:a,currentSlide:o.state.currentSlide},s)},0))}),Fe(je(o),"play",function(){var a;if(o.props.rtl)a=o.state.currentSlide-o.props.slidesToScroll;else if((0,Mt.canGoNext)(Ae(Ae({},o.props),o.state)))a=o.state.currentSlide+o.props.slidesToScroll;else return!1;o.slideHandler(a)}),Fe(je(o),"autoPlay",function(a){o.autoplayTimer&&clearInterval(o.autoplayTimer);var s=o.state.autoplaying;if(a==="update"){if(s==="hovered"||s==="focused"||s==="paused")return}else if(a==="leave"){if(s==="paused"||s==="focused")return}else if(a==="blur"&&(s==="paused"||s==="hovered"))return;o.autoplayTimer=setInterval(o.play,o.props.autoplaySpeed+50),o.setState({autoplaying:"playing"})}),Fe(je(o),"pause",function(a){o.autoplayTimer&&(clearInterval(o.autoplayTimer),o.autoplayTimer=null);var s=o.state.autoplaying;a==="paused"?o.setState({autoplaying:"paused"}):a==="focused"?(s==="hovered"||s==="playing")&&o.setState({autoplaying:"focused"}):s==="playing"&&o.setState({autoplaying:"hovered"})}),Fe(je(o),"onDotsOver",function(){return o.props.autoplay&&o.pause("hovered")}),Fe(je(o),"onDotsLeave",function(){return o.props.autoplay&&o.state.autoplaying==="hovered"&&o.autoPlay("leave")}),Fe(je(o),"onTrackOver",function(){return o.props.autoplay&&o.pause("hovered")}),Fe(je(o),"onTrackLeave",function(){return o.props.autoplay&&o.state.autoplaying==="hovered"&&o.autoPlay("leave")}),Fe(je(o),"onSlideFocus",function(){return o.props.autoplay&&o.pause("focused")}),Fe(je(o),"onSlideBlur",function(){return o.props.autoplay&&o.state.autoplaying==="focused"&&o.autoPlay("blur")}),Fe(je(o),"render",function(){var a=(0,I1e.default)("slick-slider",o.props.className,{"slick-vertical":o.props.vertical,"slick-initialized":!0}),s=Ae(Ae({},o.props),o.state),l=(0,Mt.extractObject)(s,["fade","cssEase","speed","infinite","centerMode","focusOnSelect","currentSlide","lazyLoad","lazyLoadedList","rtl","slideWidth","slideHeight","listHeight","vertical","slidesToShow","slidesToScroll","slideCount","trackStyle","variableWidth","unslick","centerPadding","targetSlide","useCSS"]),u=o.props.pauseOnHover;l=Ae(Ae({},l),{},{onMouseEnter:u?o.onTrackOver:null,onMouseLeave:u?o.onTrackLeave:null,onMouseOver:u?o.onTrackOver:null,focusOnSelect:o.props.focusOnSelect&&o.clickable?o.selectHandler:null});var c;if(o.props.dots===!0&&o.state.slideCount>=o.props.slidesToShow){var f=(0,Mt.extractObject)(s,["dotsClass","slideCount","slidesToShow","currentSlide","slidesToScroll","clickHandler","children","customPaging","infinite","appendDots"]),d=o.props.pauseOnDotsHover;f=Ae(Ae({},f),{},{clickHandler:o.changeSlide,onMouseEnter:d?o.onDotsLeave:null,onMouseOver:d?o.onDotsOver:null,onMouseLeave:d?o.onDotsLeave:null}),c=Qn.default.createElement(k1e.Dots,f)}var h,p,m=(0,Mt.extractObject)(s,["infinite","centerMode","currentSlide","slideCount","slidesToShow","prevArrow","nextArrow"]);m.clickHandler=o.changeSlide,o.props.arrows&&(h=Qn.default.createElement(Q8.PrevArrow,m),p=Qn.default.createElement(Q8.NextArrow,m));var _=null;o.props.vertical&&(_={height:o.state.listHeight});var b=null;o.props.vertical===!1?o.props.centerMode===!0&&(b={padding:"0px "+o.props.centerPadding}):o.props.centerMode===!0&&(b={padding:o.props.centerPadding+" 0px"});var g=Ae(Ae({},_),b),E=o.props.touchMove,T={className:"slick-list",style:g,onClick:o.clickHandler,onMouseDown:E?o.swipeStart:null,onMouseMove:o.state.dragging&&E?o.swipeMove:null,onMouseUp:E?o.swipeEnd:null,onMouseLeave:o.state.dragging&&E?o.swipeEnd:null,onTouchStart:E?o.swipeStart:null,onTouchMove:o.state.dragging&&E?o.swipeMove:null,onTouchEnd:E?o.touchEnd:null,onTouchCancel:o.state.dragging&&E?o.swipeEnd:null,onKeyDown:o.props.accessibility?o.keyHandler:null},O={className:a,dir:"ltr",style:o.props.style};return o.props.unslick&&(T={className:"slick-list"},O={className:a}),Qn.default.createElement("div",O,o.props.unslick?"":h,Qn.default.createElement("div",l0({ref:o.listRefHandler},T),Qn.default.createElement(R1e.Track,l0({ref:o.trackRefHandler},l),o.props.children)),o.props.unslick?"":p,o.props.unslick?"":c)}),o.list=null,o.track=null,o.state=Ae(Ae({},P1e.default),{},{currentSlide:o.props.initialSlide,slideCount:Qn.default.Children.count(o.props.children)}),o.callbackTimers=[],o.clickable=!0,o.debouncedResize=null;var i=o.ssrInit();return o.state=Ae(Ae({},o.state),i),o}return B1e(n,[{key:"didPropsChange",value:function(o){for(var i=!1,a=0,s=Object.keys(this.props);a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function T(y){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},T(y)}function O(y,S,v){return S in y?Object.defineProperty(y,S,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[S]=v,y}var A=(0,a.canUseDOM)()&&Q1e(),C=function(y){p(v,y);var S=_(v);function v(x){var I;return f(this,v),I=S.call(this,x),O(g(I),"innerSliderRefHandler",function(R){return I.innerSlider=R}),O(g(I),"slickPrev",function(){return I.innerSlider.slickPrev()}),O(g(I),"slickNext",function(){return I.innerSlider.slickNext()}),O(g(I),"slickGoTo",function(R){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return I.innerSlider.slickGoTo(R,k)}),O(g(I),"slickPause",function(){return I.innerSlider.pause("paused")}),O(g(I),"slickPlay",function(){return I.innerSlider.autoPlay("play")}),I.state={breakpoint:null},I._responsiveMediaHandlers=[],I}return h(v,[{key:"media",value:function(I,R){A.register(I,R),this._responsiveMediaHandlers.push({query:I,handler:R})}},{key:"componentDidMount",value:function(){var I=this;if(this.props.responsive){var R=this.props.responsive.map(function(M){return M.breakpoint});R.sort(function(M,N){return M-N}),R.forEach(function(M,N){var D;N===0?D=(0,o.default)({minWidth:0,maxWidth:M}):D=(0,o.default)({minWidth:R[N-1]+1,maxWidth:M}),(0,a.canUseDOM)()&&I.media(D,function(){I.setState({breakpoint:M})})});var k=(0,o.default)({minWidth:R.slice(-1)[0]});(0,a.canUseDOM)()&&this.media(k,function(){I.setState({breakpoint:null})})}}},{key:"componentWillUnmount",value:function(){this._responsiveMediaHandlers.forEach(function(I){A.unregister(I.query,I.handler)})}},{key:"render",value:function(){var I=this,R,k;this.state.breakpoint?(k=this.props.responsive.filter(function(W){return W.breakpoint===I.state.breakpoint}),R=k[0].settings==="unslick"?"unslick":c(c(c({},i.default),this.props),k[0].settings)):R=c(c({},i.default),this.props),R.centerMode&&(R.slidesToScroll>1,R.slidesToScroll=1),R.fade&&(R.slidesToShow>1,R.slidesToScroll>1,R.slidesToShow=1,R.slidesToScroll=1);var M=n.default.Children.toArray(this.props.children);M=M.filter(function(W){return typeof W=="string"?!!W.trim():!!W}),R.variableWidth&&(R.rows>1||R.slidesPerRow>1)&&(console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"),R.variableWidth=!1);for(var N=[],D=null,L=0;L=M.length));U+=1)B.push(n.default.cloneElement(M[U],{key:100*L+10*F+U,tabIndex:-1,style:{width:"".concat(100/R.slidesPerRow,"%"),display:"inline-block"}}));j.push(n.default.createElement("div",{key:10*L+F},B))}R.variableWidth?N.push(n.default.createElement("div",{key:L,style:{width:D}},j)):N.push(n.default.createElement("div",{key:L},j))}if(R==="unslick"){var K="regular slider "+(this.props.className||"");return n.default.createElement("div",{className:K},M)}else N.length<=R.slidesToShow&&(R.unslick=!0);return n.default.createElement(r.InnerSlider,l({style:this.props.style,ref:this.innerSliderRefHandler},R),N)}}]),v}(n.default.Component);e.default=C})(p7);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(p7);function n(o){return o&&o.__esModule?o:{default:o}}var r=t.default;e.default=r})(h7);const J1e=Qe(h7);function e0e({images:e}){const t={dots:!0,infinite:!0,speed:500,slidesToShow:1,slidesToScroll:1,adaptiveHeight:!0};return w.jsx(J1e,{...t,children:e.map((n,r)=>w.jsx(ve,{children:w.jsx(ju,{src:n})},r))})}const t0e=({src:e,alt:t})=>w.jsx(ju,{width:"100%",src:e,fallback:w.jsx(ve,{width:"100%",textAlign:"center",children:w.jsx(me,{children:"Image failed to load."})}),fallbackStrategy:"onError",alt:t}),n0e=({images:e})=>w.jsx(w.Fragment,{children:(e==null?void 0:e.length)===1?w.jsx(t0e,{src:e[0]}):w.jsx(e0e,{images:e})}),r0e=e=>{const[t,n]=P.useState(!1),r=new URL(e.url).hostname,o=$8.canPlay(e.url);return w.jsx(w.Fragment,{children:t?w.jsx(T5,{ratio:16/9,children:w.jsx($8,{url:e.url,controls:!0,width:"100%",height:"100%",fallback:w.jsx(ve,{width:"100%",textAlign:"center",children:w.jsx(me,{children:"Video failed to load."})}),fallbackStrategy:"onError"})}):w.jsx(be,{size:"sm",width:"100%",overflowWrap:"break-word",wordBreak:"break-all",onClick:()=>n(!0),isDisabled:!o,children:o?`Load video from ${r}`:"Cannot play this video."})})},o0e=({videos:e})=>w.jsx(w.Fragment,{children:e.map((t,n)=>w.jsx(r0e,{url:t},n))});function i0e({images:e,videos:t}){return w.jsxs(w.Fragment,{children:[e&&w.jsx(n0e,{images:e}),t&&w.jsx(o0e,{videos:t})]})}function a0e(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var c0=a0e(P),s0e=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},s6=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=l0e(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return c0.createElement("svg",s0e({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),c0.createElement("path",{d:"M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z"}))},u0e=c0.memo?c0.memo(s6):s6,c0e=u0e;const f0e=Qe(c0e);function d0e(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var f0=d0e(P),h0e=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},l6=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=p0e(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return f0.createElement("svg",h0e({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),f0.createElement("path",{d:"M10.5,12A1.5,1.5 0 0,1 12,10.5A1.5,1.5 0 0,1 13.5,12A1.5,1.5 0 0,1 12,13.5A1.5,1.5 0 0,1 10.5,12M10.5,16.5A1.5,1.5 0 0,1 12,15A1.5,1.5 0 0,1 13.5,16.5A1.5,1.5 0 0,1 12,18A1.5,1.5 0 0,1 10.5,16.5M10.5,7.5A1.5,1.5 0 0,1 12,6A1.5,1.5 0 0,1 13.5,7.5A1.5,1.5 0 0,1 12,9A1.5,1.5 0 0,1 10.5,7.5M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z"}))},m0e=f0.memo?f0.memo(l6):l6,y0e=m0e;const g0e=Qe(y0e);function v0e({pubkey:e,isOpen:t,onClose:n}){const[r,o]=P.useState([]),i=Vi(),a=async()=>{const l=await Z.getState().getAllLists(),u=(l==null?void 0:l.map(d=>({id:d.id,title:d.title,isAssigned:!1})))||[],c=await Z.getState().getListsWithUser(e),f=u.map(d=>({...d,isAssigned:!!(c!=null&&c.find(h=>h.id===d.id))}));o(f)};P.useEffect(()=>{t&&a()},[t]);const s=async(l,u)=>{try{u?(await Z.getState().removeUserFromList(l,e),i({title:"User removed from list",status:"success",duration:9e3,isClosable:!0})):(await Z.getState().addUserToList(l,e),i({title:"User added to list",status:"success",duration:9e3,isClosable:!0})),o(c=>c.map(f=>f.id===l?{...f,isAssigned:!u}:f))}catch(c){i({title:"Operation failed",description:c.message||"Something went wrong",status:"error",duration:9e3,isClosable:!0})}};return w.jsxs($r,{isOpen:t,onClose:n,children:[w.jsx(Vr,{}),w.jsxs(zr,{children:[w.jsx(Ur,{children:"Add or Remove from List"}),w.jsx(Wr,{}),w.jsx(Hr,{children:r.length===0?w.jsx(me,{children:"No lists found. Create one first."}):r.map(l=>w.jsxs(pt,{children:[w.jsx(me,{children:l.title}),w.jsx(be,{onClick:()=>s(l.id,l.isAssigned),children:l.isAssigned?"Remove from List":"Add to List"})]},l.id))}),w.jsx(gd,{children:w.jsx(be,{colorScheme:"blue",mr:3,onClick:n,children:"Close"})})]})]})}var z7={exports:{}};(function(e,t){(function(n,r){e.exports=r(P)})(fo,function(n){return function(r){var o={};function i(a){if(o[a])return o[a].exports;var s=o[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=o,i.d=function(a,s,l){i.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:l})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,s){if(1&s&&(a=i(a)),8&s||4&s&&typeof a=="object"&&a&&a.__esModule)return a;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:a}),2&s&&typeof a!="string")for(var u in a)i.d(l,u,(function(c){return a[c]}).bind(null,u));return l},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="/",i(i.s=1)}([function(r,o){r.exports=n},function(r,o,i){r.exports=i(2)},function(r,o,i){function a(S,v,x){return v in S?Object.defineProperty(S,v,{value:x,enumerable:!0,configurable:!0,writable:!0}):S[v]=x,S}function s(S,v){var x=Object.keys(S);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(S);v&&(I=I.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),x.push.apply(x,I)}return x}function l(S,v){if(S==null)return{};var x,I,R=function(M,N){if(M==null)return{};var D,L,j={},F=Object.keys(M);for(L=0;L=0||(j[D]=M[D]);return j}(S,v);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(S);for(I=0;I=0||Object.prototype.propertyIsEnumerable.call(S,x)&&(R[x]=S[x])}return R}i.r(o);var u=i(0),c=i.n(u),f=function(S){for(var v=0,x=0;x=128?"#000000":"#FFFFFF"),backgroundColor:m(M+13,R,N),wrapperTranslateX:j,wrapperTranslateY:B,wrapperRotate:p(M,360),wrapperScale:1+p(M,3)/10,isMouthOpen:h(M,2),isCircle:h(M,1),eyeSpread:p(M,5),mouthSpread:p(M,3),faceRotate:p(M,10,3),faceTranslateX:j>6?j/2:p(M,8,1),faceTranslateY:B>6?B/2:p(M,7,2)}}(S.name,S.colors),x=u.useId();return u.createElement("svg",{viewBox:"0 0 36 36",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:S.size,height:S.size},S.title&&u.createElement("title",null,S.name),u.createElement("mask",{id:x,maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36},u.createElement("rect",{width:36,height:36,rx:S.square?void 0:72,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(x,")")},u.createElement("rect",{width:36,height:36,fill:v.backgroundColor}),u.createElement("rect",{x:"0",y:"0",width:36,height:36,transform:"translate("+v.wrapperTranslateX+" "+v.wrapperTranslateY+") rotate("+v.wrapperRotate+" 18 18) scale("+v.wrapperScale+")",fill:v.wrapperColor,rx:v.isCircle?36:6}),u.createElement("g",{transform:"translate("+v.faceTranslateX+" "+v.faceTranslateY+") rotate("+v.faceRotate+" 18 18)"},v.isMouthOpen?u.createElement("path",{d:"M15 "+(19+v.mouthSpread)+"c2 1 4 1 6 0",stroke:v.faceColor,fill:"none",strokeLinecap:"round"}):u.createElement("path",{d:"M13,"+(19+v.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:v.faceColor}),u.createElement("rect",{x:14-v.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:v.faceColor}),u.createElement("rect",{x:20+v.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:v.faceColor}))))},T=function(S){var v=function(R,k){var M=f(R),N=k&&k.length;return Array.from({length:4},function(D,L){return m(M+L,k,N)})}(S.name,S.colors),x=S.name.replace(/\s/g,""),I=u.useId();return u.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:S.size,height:S.size},S.title&&u.createElement("title",null,S.name),u.createElement("mask",{id:I,maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},u.createElement("rect",{width:80,height:80,rx:S.square?void 0:160,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(I,")")},u.createElement("path",{fill:"url(#gradient_paint0_linear_"+x+")",d:"M0 0h80v40H0z"}),u.createElement("path",{fill:"url(#gradient_paint1_linear_"+x+")",d:"M0 40h80v40H0z"})),u.createElement("defs",null,u.createElement("linearGradient",{id:"gradient_paint0_linear_"+x,x1:40,y1:0,x2:40,y2:40,gradientUnits:"userSpaceOnUse"},u.createElement("stop",{stopColor:v[0]}),u.createElement("stop",{offset:1,stopColor:v[1]})),u.createElement("linearGradient",{id:"gradient_paint1_linear_"+x,x1:40,y1:40,x2:40,y2:80,gradientUnits:"userSpaceOnUse"},u.createElement("stop",{stopColor:v[2]}),u.createElement("stop",{offset:1,stopColor:v[3]}))))},O=function(S){var v=function(I,R){var k=f(I),M=R&&R.length;return Array.from({length:3},function(N,D){return{color:m(k+D,R,M),translateX:p(k*(D+1),8,1),translateY:p(k*(D+1),8,2),scale:1.2+p(k*(D+1),4)/10,rotate:p(k*(D+1),360,1)}})}(S.name,S.colors),x=u.useId();return u.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:S.size,height:S.size},S.title&&u.createElement("title",null,S.name),u.createElement("mask",{id:x,maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},u.createElement("rect",{width:80,height:80,rx:S.square?void 0:160,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(x,")")},u.createElement("rect",{width:80,height:80,fill:v[0].color}),u.createElement("path",{filter:"url(#prefix__filter0_f)",d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:v[1].color,transform:"translate("+v[1].translateX+" "+v[1].translateY+") rotate("+v[1].rotate+" 40 40) scale("+v[2].scale+")"}),u.createElement("path",{filter:"url(#prefix__filter0_f)",style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:v[2].color,transform:"translate("+v[2].translateX+" "+v[2].translateY+") rotate("+v[2].rotate+" 40 40) scale("+v[2].scale+")"})),u.createElement("defs",null,u.createElement("filter",{id:"prefix__filter0_f",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},u.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),u.createElement("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),u.createElement("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"}))))},A=["pixel","bauhaus","ring","beam","sunset","marble"],C={geometric:"beam",abstract:"bauhaus"},y=function(S){var v=S.variant,x=v===void 0?"marble":v,I=S.colors,R=I===void 0?["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]:I,k=S.name,M=k===void 0?"Clara Barton":k,N=S.square,D=N!==void 0&&N,L=S.title,j=L!==void 0&&L,F=S.size,B=function(U){for(var K=1;Kt.some(n=>e instanceof n);let u6,c6;function _0e(){return u6||(u6=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function E0e(){return c6||(c6=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const U7=new WeakMap,Rw=new WeakMap,V7=new WeakMap,Jg=new WeakMap,I_=new WeakMap;function C0e(e){const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{n(nf(e.result)),o()},a=()=>{r(e.error),o()};e.addEventListener("success",i),e.addEventListener("error",a)});return t.then(n=>{n instanceof IDBCursor&&U7.set(n,e)}).catch(()=>{}),I_.set(t,e),t}function x0e(e){if(Rw.has(e))return;const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",a),e.removeEventListener("abort",a)},i=()=>{n(),o()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",i),e.addEventListener("error",a),e.addEventListener("abort",a)});Rw.set(e,t)}let kw={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Rw.get(e);if(t==="objectStoreNames")return e.objectStoreNames||V7.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return nf(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function O0e(e){kw=e(kw)}function A0e(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(ev(this),t,...n);return V7.set(r,t.sort?t.sort():[t]),nf(r)}:E0e().includes(e)?function(...t){return e.apply(ev(this),t),nf(U7.get(this))}:function(...t){return nf(e.apply(ev(this),t))}}function P0e(e){return typeof e=="function"?A0e(e):(e instanceof IDBTransaction&&x0e(e),S0e(e,_0e())?new Proxy(e,kw):e)}function nf(e){if(e instanceof IDBRequest)return C0e(e);if(Jg.has(e))return Jg.get(e);const t=P0e(e);return t!==e&&(Jg.set(e,t),I_.set(t,e)),t}const ev=e=>I_.get(e),T0e=["get","getKey","getAll","getAllKeys","count"],I0e=["put","add","delete","clear"],tv=new Map;function f6(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(tv.get(t))return tv.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=I0e.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||T0e.includes(n)))return;const i=async function(a,...s){const l=this.transaction(a,o?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(s.shift())),(await Promise.all([u[n](...s),o&&l.done]))[0]};return tv.set(t,i),i}O0e(e=>({...e,get:(t,n,r)=>f6(t,n)||e.get(t,n,r),has:(t,n)=>!!f6(t,n)||e.has(t,n)}));async function nv(e,t){try{let n=await Promise.race([fetch(e,{headers:t}),new Promise((o,i)=>setTimeout(()=>i(new Error("Timeout")),5e3))]);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){throw new Error(`Error making request: ${n}`)}}var R0e=class extends rae{constructor(e){super(e)}async getZapCallbackInfo(e){const t=await nv(e);if(!Mie(t))throw new Error("Lnurl endpoint does not allow Nostr payments. Expected to find 'allowsNostr' in response.");return this.lightningZapInfo=t,console.log("LnurlEndpointResponse",this.lightningZapInfo),this.lightningZapInfo}async getLightningInvoice(e,t){const n=await nv(t);if(n&&n.status==="ERROR")throw new Error(`Error getting lightning invoice: ${n.reason}`);if(!Die(e,n))throw new Error("Lnurl invoice response is invalid or does not match your request.");return console.log("LnurlInvoiceResponse",n),n}async makeZapRequest(e,t){const n=this.getLud16Or06Url();if(n)try{this.hasZapInfo()||await this.getZapCallbackInfo(n.url);const r={...e,recipientPubkey:this.pubkey,lnurl:n.type==="lud16"?nk(this.getLud16()):this.getLud06()},o=Jie(r,this.lightningZapInfo.callback,t);return{...await this.getLightningInvoice(r,o.invoiceUrl),event:o.event}}catch(r){throw new Error(`Error making zap request: ${r}`)}else throw new Error("No lud16 or lud06 url found")}async makeNIP05Request(){const e=this.getNip05Url();if(e)try{return await nv(e)}catch(t){throw new Error(`Error making NIP05 request: ${t}`)}else throw new Error("No nip05 url found")}},k0e=Object.defineProperty,d0=Object.getOwnPropertySymbols,H7=Object.prototype.hasOwnProperty,W7=Object.prototype.propertyIsEnumerable,d6=(e,t,n)=>t in e?k0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M0e=(e,t)=>{for(var n in t||(t={}))H7.call(t,n)&&d6(e,n,t[n]);if(d0)for(var n of d0(t))W7.call(t,n)&&d6(e,n,t[n]);return e},D0e=(e,t)=>{var n={};for(var r in e)H7.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&d0)for(var r of d0(e))t.indexOf(r)<0&&W7.call(e,r)&&(n[r]=e[r]);return n};/** +`),t.toString()},e.prototype.setMode=function(t){this.mode=t},e.prototype.setECLevel=function(t){this.ecLevel=t},e.prototype.setVersion=function(t){this.version=t},e.prototype.setMaskPattern=function(t){this.maskPattern=t},e.prototype.setMatrix=function(t){this.matrix=t},e.isValidMaskPattern=function(t){return t>=0&&t0;){for(a===6&&(a-=1);s>=0&&s=r;)t^=n<=0)for(var l=0;l!==a;l++){var u=o[l];u>=0&&e.isEmpty(n.get(u,s))&&e.embedPositionAdjustmentPattern(u-2,s-2,n)}}},e.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),e.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),e.VERSION_INFO_POLY=7973,e.TYPE_INFO_POLY=1335,e.TYPE_INFO_MASK_PATTERN=21522,e})();(function(){Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),mr.UTF8.getName()})();var Vue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r,o,i,a,s,l,u){var c=e.call(this,s,l)||this;if(c.yuvData=n,c.dataWidth=r,c.dataHeight=o,c.left=i,c.top=a,i+s>r||a+l>o)throw new Me("Crop rectangle does not fit within image data.");return u&&c.reverseHorizontal(s,l),c}Vue(t,e),t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length>16&255,m=h>>7&510,S=255&h;f[d]=(p+m+S)/4&255}u.luminances=f}else u.luminances=n;if(i===void 0&&(u.dataWidth=r),a===void 0&&(u.dataHeight=o),s===void 0&&(u.left=0),l===void 0&&(u.top=0),u.left+r>u.dataWidth||u.top+o>u.dataHeight)throw new Me("Crop rectangle does not fit within image data.");return u}Uue(t,e),t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length"},t}(Wue),Kue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r,o){var i=e.call(this,n,0,0)||this;return i.binaryShiftStart=r,i.binaryShiftByteCount=o,i}Kue(t,e),t.prototype.appendTo=function(n,r){for(var o=0;o62?n.appendBits(this.binaryShiftByteCount-31,16):o===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(r[this.binaryShiftStart+o],8)},t.prototype.addBinaryShift=function(n,r){return new t(this,n,r)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}})(qk);new qk(null,0,0);var Xue=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(e){var t,n;try{for(var r=Xue(e),o=r.next();!o.done;o=r.next()){var i=o.value;Kr.fill(i,-1)}}catch(a){t={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}e[0][4]=0,e[1][4]=0,e[1][0]=28,e[3][4]=0,e[2][4]=0,e[2][0]=15})(Kr.createInt32Array(6,6)),function(e){var t=gn.getCharCode(" "),n=gn.getCharCode("."),r=gn.getCharCode(",");e[0][t]=1;for(var o=gn.getCharCode("Z"),i=gn.getCharCode("A"),a=i;a<=o;a++)e[0][a]=a-i+2;e[1][t]=1;var s=gn.getCharCode("z"),l=gn.getCharCode("a");for(a=l;a<=s;a++)e[1][a]=a-l+2;e[2][t]=1;var u=gn.getCharCode("9"),c=gn.getCharCode("0");for(a=c;a<=u;a++)e[2][a]=a-c+2;e[2][r]=12,e[2][n]=13;for(var f=["\0"," ","","","","","","","\x07","\b"," ",` +`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""],d=0;d","?","[","]","{","}"];for(d=0;d0&&(e[4][gn.getCharCode(h[d])]=d)}(Kr.createInt32Array(5,256));var que=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yue=function(e){function t(n){var r=e.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=t.makeBufferFromCanvasImageData(n),r}return que(t,e),t.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var o=r.getImageData(0,0,n.width,n.height);return t.toGrayscaleBuffer(o.data,n.width,n.height)},t.toGrayscaleBuffer=function(n,r,o){for(var i=new Uint8ClampedArray(r*o),a=0,s=0,l=n.length;a>10,i[s]=u}return i},t.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Me("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length0&&o[o.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Que={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},Hu=function(){function e(t,n,r){n===void 0&&(n=new Map),r===void 0&&(r={}),this.reader=t,this.hints=n,this.options=Wl(Wl({},Que),r)}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(t){this.hints.set(Et.POSSIBLE_FORMATS,t)},enumerable:!1,configurable:!0}),e.addVideoSource=function(t,n){try{t.srcObject=n}catch{t.src=URL.createObjectURL(n)}},e.mediaStreamSetTorch=function(t,n){return Xt(this,void 0,void 0,function(){return qt(this,function(r){switch(r.label){case 0:return[4,t.applyConstraints({advanced:[{fillLightMode:n?"flash":"off",torch:!!n}]})];case 1:return r.sent(),[2]}})})},e.mediaStreamIsTorchCompatible=function(t){var n,r,o=t.getVideoTracks();try{for(var i=Ph(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(e.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.mediaStreamIsTorchCompatibleTrack=function(t){try{return"torch"in t.getCapabilities()}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},e.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&t.readyState>2},e.getMediaElement=function(t,n){var r=document.getElementById(t);if(!r)throw new Yt("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Yt("element with id '"+t+"' must be an "+n+" element");return r},e.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if(typeof t=="string")return e.getMediaElement(t,"video");if(!t&&typeof document<"u"){var n=document.createElement("video");return n.width=200,n.height=200,n}throw new Error("Couldn't get videoElement from videoSource!")},e.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if(typeof t=="string")return e.getMediaElement(t,"img");if(t===void 0){var n=document.createElement("img");return n.width=200,n.height=200,n}throw new Error("Couldn't get imageElement from imageSource!")},e.prepareVideoElement=function(t){var n=e.createVideoElement(t);return n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},e.isImageLoaded=function(t){return!!t.complete&&t.naturalWidth!==0},e.createBinaryBitmapFromCanvas=function(t){var n=new Yue(t),r=new Bk(n);return new Nk(r)},e.drawImageOnCanvas=function(t,n){t.drawImage(n,0,0)},e.getMediaElementDimensions=function(t){if(t instanceof HTMLVideoElement)return{height:t.videoHeight,width:t.videoWidth};if(t instanceof HTMLImageElement)return{height:t.naturalHeight||t.height,width:t.naturalWidth||t.width};throw new Error("Couldn't find the Source's dimentions!")},e.createCaptureCanvas=function(t){if(!t)throw new Yt("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement("canvas"),r=e.getMediaElementDimensions(t),o=r.width,i=r.height;return n.style.width=o+"px",n.style.height=i+"px",n.width=o,n.height=i,n},e.tryPlayVideo=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:if(t!=null&&t.ended)return console.error("Trying to play video that has ended."),[2,!1];if(e.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn("It was not possible to play the video.",n),[2,!1];case 4:return[2]}})})},e.createCanvasFromMediaElement=function(t){var n=e.createCaptureCanvas(t),r=n.getContext("2d");if(!r)throw new Error("Couldn't find Canvas 2D Context.");return e.drawImageOnCanvas(r,t),n},e.createBinaryBitmapFromMediaElem=function(t){var n=e.createCanvasFromMediaElement(t);return e.createBinaryBitmapFromCanvas(n)},e.destroyImageElement=function(t){t.src="",t.removeAttribute("src"),t=void 0},e.listVideoInputDevices=function(){return Xt(this,void 0,void 0,function(){var t,n,r,o,i,a,s,l,u,c,f,d;return qt(this,function(h){switch(h.label){case 0:if(!Yk())throw new Error("Can't enumerate devices, navigator is not present.");if(!Zue())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=h.sent(),n=[];try{for(r=Ph(t),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,l=i.label||"Video device "+(n.length+1),u=i.groupId,c={deviceId:s,label:l,kind:a,groupId:u},n.push(c))}catch(p){f={error:p}}finally{try{o&&!o.done&&(d=r.return)&&d.call(r)}finally{if(f)throw f.error}}return[2,n]}})})},e.findDeviceById=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:return[4,e.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===t})]:[2]}})})},e.cleanVideoSource=function(t){if(t){try{t.srcObject=null}catch{t.src=""}t&&t.removeAttribute("src")}},e.playVideoOnLoadAsync=function(t,n){return Xt(this,void 0,void 0,function(){return qt(this,function(r){switch(r.label){case 0:return[4,e.tryPlayVideo(t)];case 1:return r.sent()?[2,!0]:[2,new Promise(function(o,i){var a=setTimeout(function(){e.isVideoPlaying(t)||(i(!1),t.removeEventListener("canplay",s))},n),s=function(){e.tryPlayVideo(t).then(function(l){clearTimeout(a),t.removeEventListener("canplay",s),o(l)})};t.addEventListener("canplay",s)})]}})})},e.attachStreamToVideo=function(t,n,r){return r===void 0&&(r=5e3),Xt(this,void 0,void 0,function(){var o;return qt(this,function(i){switch(i.label){case 0:return o=e.prepareVideoElement(n),e.addVideoSource(o,t),[4,e.playVideoOnLoadAsync(o,r)];case 1:return i.sent(),[2,o]}})})},e._waitImageLoad=function(t){return new Promise(function(n,r){var o=setTimeout(function(){e.isImageLoaded(t)||(t.removeEventListener("load",i),r())},1e4),i=function(){clearTimeout(o),t.removeEventListener("load",i),n()};t.addEventListener("load",i)})},e.checkCallbackFnOrThrow=function(t){if(!t)throw new Yt("`callbackFn` is a required parameter, you cannot capture results without it.")},e.disposeMediaStream=function(t){t.getVideoTracks().forEach(function(n){return n.stop()}),t=void 0},e.prototype.decode=function(t){var n=e.createCanvasFromMediaElement(t);return this.decodeFromCanvas(n)},e.prototype.decodeBitmap=function(t){return this.reader.decode(t,this.hints)},e.prototype.decodeFromCanvas=function(t){var n=e.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(n)},e.prototype.decodeFromImageElement=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:if(!t)throw new Yt("An image element must be provided.");return n=e.prepareImageElement(t),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}})})},e.prototype.decodeFromImageUrl=function(t){return Xt(this,void 0,void 0,function(){var n;return qt(this,function(r){switch(r.label){case 0:if(!t)throw new Yt("An URL must be provided.");(n=e.prepareImageElement()).src=t,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return e.destroyImageElement(n),[7];case 4:return[2]}})})},e.prototype.decodeFromConstraints=function(t,n,r){return Xt(this,void 0,void 0,function(){var o,i;return qt(this,function(a){switch(a.label){case 0:return e.checkCallbackFnOrThrow(r),[4,navigator.mediaDevices.getUserMedia(t)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,n,r)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),e.disposeMediaStream(o),i;case 5:return[2]}})})},e.prototype.decodeFromStream=function(t,n,r){return Xt(this,void 0,void 0,function(){var o,i,a,s,l,u,c,f,d,h,p=this;return qt(this,function(m){switch(m.label){case 0:return e.checkCallbackFnOrThrow(r),o=this.options.tryPlayVideoTimeout,[4,e.attachStreamToVideo(t,n,o)];case 1:return i=m.sent(),a=function(){var S,b;try{for(var g=Ph(t.getVideoTracks()),E=g.next();!E.done;E=g.next())E.value.stop()}catch(T){S={error:T}}finally{try{E&&!E.done&&(b=g.return)&&b.call(g)}finally{if(S)throw S.error}}t=void 0},s=function(){a(),e.cleanVideoSource(i)},l=this.scan(i,r,s),u=t.getVideoTracks(),c=Wl(Wl({},l),{stop:function(){l.stop()},streamVideoConstraintsApply:function(S,b){return Xt(this,void 0,void 0,function(){var g,E,T,O,A,C;return qt(this,function(y){switch(y.label){case 0:g=b?u.filter(b):u,y.label=1;case 1:y.trys.push([1,6,7,8]),E=Ph(g),T=E.next(),y.label=2;case 2:return T.done?[3,5]:[4,T.value.applyConstraints(S)];case 3:y.sent(),y.label=4;case 4:return T=E.next(),[3,2];case 5:return[3,8];case 6:return O=y.sent(),A={error:O},[3,8];case 7:try{T&&!T.done&&(C=E.return)&&C.call(E)}finally{if(A)throw A.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(S){return u.find(S).getConstraints()},streamVideoSettingsGet:function(S){return u.find(S).getSettings()},streamVideoCapabilitiesGet:function(S){return u.find(S).getCapabilities()}}),e.mediaStreamIsTorchCompatible(t)&&(f=u==null?void 0:u.find(function(S){return e.mediaStreamIsTorchCompatibleTrack(S)}),d=function(S){return Xt(p,void 0,void 0,function(){return qt(this,function(b){switch(b.label){case 0:return[4,e.mediaStreamSetTorch(f,S)];case 1:return b.sent(),[2]}})})},c.switchTorch=d,h=function(){l.stop(),d(!1)},c.stop=h),[2,c]}})})},e.prototype.decodeFromVideoDevice=function(t,n,r){return Xt(this,void 0,void 0,function(){var o;return qt(this,function(i){switch(i.label){case 0:return e.checkCallbackFnOrThrow(r),o={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},e.prototype.decodeFromVideoElement=function(t,n){return Xt(this,void 0,void 0,function(){var r,o;return qt(this,function(i){switch(i.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new Yt("A video element must be provided.");return r=e.prepareVideoElement(t),o=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,o)];case 1:return i.sent(),[2,this.scan(r,n)]}})})},e.prototype.decodeFromVideoUrl=function(t,n){return Xt(this,void 0,void 0,function(){var r,o,i;return qt(this,function(a){switch(a.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new Yt("An URL must be provided.");return(r=e.prepareVideoElement()).src=t,o=function(){e.cleanVideoSource(r)},i=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,i)];case 1:return a.sent(),[2,this.scan(r,n,o)]}})})},e.prototype.decodeOnceFromConstraints=function(t,n){return Xt(this,void 0,void 0,function(){var r;return qt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},e.prototype.decodeOnceFromStream=function(t,n){return Xt(this,void 0,void 0,function(){var r,o;return qt(this,function(i){switch(i.label){case 0:return r=!!n,[4,e.attachStreamToVideo(t,n)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return r||e.cleanVideoSource(o),[7];case 5:return[2]}})})},e.prototype.decodeOnceFromVideoDevice=function(t,n){return Xt(this,void 0,void 0,function(){var r;return qt(this,function(o){switch(o.label){case 0:return r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},e.prototype.decodeOnceFromVideoElement=function(t){return Xt(this,void 0,void 0,function(){var n,r;return qt(this,function(o){switch(o.label){case 0:if(!t)throw new Yt("A video element must be provided.");return n=e.prepareVideoElement(t),r=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,r)];case 1:return o.sent(),[4,this.scanOneResult(n)];case 2:return[2,o.sent()]}})})},e.prototype.decodeOnceFromVideoUrl=function(t){return Xt(this,void 0,void 0,function(){var n,r;return qt(this,function(o){switch(o.label){case 0:if(!t)throw new Yt("An URL must be provided.");(n=e.prepareVideoElement()).src=t,r=this.decodeOnceFromVideoElement(n),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,r];case 2:return[2,o.sent()];case 3:return e.cleanVideoSource(n),[7];case 4:return[2]}})})},e.prototype.scanOneResult=function(t,n,r,o){var i=this;return n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),new Promise(function(a,s){i.scan(t,function(l,u,c){if(l)return a(l),void c.stop();if(u){if(u instanceof Y&&n||u instanceof hn&&r||u instanceof ae&&o)return;c.stop(),s(u)}})})},e.prototype.scan=function(t,n,r){var o=this;e.checkCallbackFnOrThrow(n);var i=e.createCaptureCanvas(t),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,l=function(){a=void 0,i=void 0},u=!1,c={stop:function(){u=!0,clearTimeout(s),l(),r&&r()}},f=function(){if(!u)try{e.drawImageOnCanvas(a,t);var d=o.decodeFromCanvas(i);n(d,void 0,c),s=setTimeout(f,o.options.delayBetweenScanSuccess)}catch(h){if(n(void 0,h,c),h instanceof hn||h instanceof ae||h instanceof Y)return void(s=setTimeout(f,o.options.delayBetweenScanAttempts));l(),r&&r(h)}};return f(),c},e.prototype._decodeOnLoadImage=function(t){return Xt(this,void 0,void 0,function(){return qt(this,function(n){switch(n.label){case 0:return e.isImageLoaded(t)?[3,2]:[4,e._waitImageLoad(t)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(t)]}})})},e}(),Jue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new O1,n,r)||this}Jue(t,e)})(Hu);var ece=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new Ul(n),n,r)||this}ece(t,e)})(Hu);var tce=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new P1,n,r)||this}tce(t,e)})(Hu);var nce=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){var o=this,i=new Xk;return i.setHints(n),(o=e.call(this,i,n,r)||this).reader=i,o}nce(t,e),Object.defineProperty(t.prototype,"possibleFormats",{set:function(n){this.hints.set(Et.POSSIBLE_FORMATS,n),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)},t.prototype.setHints=function(n){this.hints=n,this.reader.setHints(this.hints)}})(Hu);var rce=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(n,r){return e.call(this,new I1,n,r)||this}rce(t,e)})(Hu);var oce=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ice=function(e){function t(n,r){return e.call(this,new T1,n,r)||this}return oce(t,e),t}(Hu),Th=function(e,t,n){var r=typeof e===n;return r||console.warn('[ReactQrReader]: Expected "'.concat(t,'" to be a of type "').concat(n,'".')),r},ace=function(e){var t=e.scanDelay,n=e.constraints,r=e.onResult,o=e.videoId,i=P.useRef(null);P.useEffect(function(){var a=new ice(null,{delayBetweenScanAttempts:t});return!function(){var s=typeof navigator<"u"&&!!navigator.mediaDevices;return s||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),s}()&&Th(r,"onResult","function")&&r(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),a),Th(n,"constraints","object")&&a.decodeFromConstraints({video:n},o,function(s,l){Th(r,"onResult","function")&&r(s,l,a)}).then(function(s){return i.current=s}).catch(function(s){Th(r,"onResult","function")&&r(null,s,a)}),function(){var s;(s=i.current)===null||s===void 0||s.stop()}},[])},ds=function(){return ds=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},n8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=uce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return R1.createElement("svg",lce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),R1.createElement("path",{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}))},cce=R1.memo?R1.memo(n8):n8,fce=cce;const dce=Fe(fce);function hce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var k1=hce(P),pce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},r8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=mce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return k1.createElement("svg",pce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),k1.createElement("path",{d:"M4,4H10V10H4V4M20,4V10H14V4H20M14,15H16V13H14V11H16V13H18V11H20V13H18V15H20V18H18V20H16V18H13V20H11V16H14V15M16,15V18H18V15H16M4,20V14H10V20H4M6,6V8H8V6H6M16,6V8H18V6H16M6,16V18H8V16H6M4,11H6V13H4V11M9,11H13V15H11V13H9V11M11,6H13V10H11V6M2,2V6H0V2A2,2 0 0,1 2,0H6V2H2M22,0A2,2 0 0,1 24,2V6H22V2H18V0H22M2,18V22H6V24H2A2,2 0 0,1 0,22V18H2M22,22V18H24V22A2,2 0 0,1 22,24H18V22H22Z"}))},yce=k1.memo?k1.memo(r8):r8,gce=yce;const vce=Fe(gce);function wce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var M1=wce(P),bce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},o8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Sce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return M1.createElement("svg",bce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),M1.createElement("path",{d:"M12.66 13.67C12.32 14 11.93 14.29 11.5 14.5V21L9.5 23L7.5 21L9.5 19.29L8 18L9.5 16.71L7.5 15V14.5C6 13.77 5 12.26 5 10.5C5 8 7 6 9.5 6C9.54 6 9.58 6 9.61 6C9.59 6.07 9.54 6.12 9.5 6.18C9.23 6.79 9.08 7.43 9.03 8.08C8.43 8.28 8 8.84 8 9.5C8 10.33 8.67 11 9.5 11C9.53 11 9.57 11 9.6 11C10.24 12.25 11.34 13.2 12.66 13.67M16 6C16 5.37 15.9 4.75 15.72 4.18C17.06 4.56 18.21 5.55 18.73 6.96C19.33 8.62 18.89 10.39 17.75 11.59L20 17.68L18.78 20.25L16.22 19.05L17.5 16.76L15.66 16.06L16.63 14.34L14.16 13.41L14 12.95C12.36 12.77 10.88 11.7 10.27 10.04C9.42 7.71 10.63 5.12 12.96 4.27C13.14 4.21 13.33 4.17 13.5 4.13C12.84 2.87 11.53 2 10 2C7.79 2 6 3.79 6 6C6 6.09 6 6.17 6.03 6.26C5.7 6.53 5.4 6.82 5.15 7.15C5.06 6.78 5 6.4 5 6C5 3.24 7.24 1 10 1S15 3.24 15 6C15 7.16 14.6 8.21 13.94 9.06C16.08 8.88 16 6 16 6M12.81 8.1C12.87 8.27 12.96 8.41 13.06 8.54C13.62 7.88 13.97 7.04 14 6.11C13.89 6.13 13.8 6.15 13.7 6.18C12.92 6.47 12.5 7.33 12.81 8.1Z"}))},_ce=M1.memo?M1.memo(o8):o8,Ece=_ce;const Cce=Fe(Ece);function xce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var D1=xce(P),Oce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},i8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Ace(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return D1.createElement("svg",Oce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),D1.createElement("path",{d:"M19 6V5A2 2 0 0 0 17 3H15A2 2 0 0 0 13 5V6H11V5A2 2 0 0 0 9 3H7A2 2 0 0 0 5 5V6H3V20H21V6M19 18H5V8H19Z"}))},Pce=D1.memo?D1.memo(i8):i8,Tce=Pce;const Ice=Fe(Tce);var Rce=Object.defineProperty,L1=Object.getOwnPropertySymbols,Zk=Object.prototype.hasOwnProperty,Qk=Object.prototype.propertyIsEnumerable,a8=(e,t,n)=>t in e?Rce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kce=(e,t)=>{for(var n in t||(t={}))Zk.call(t,n)&&a8(e,n,t[n]);if(L1)for(var n of L1(t))Qk.call(t,n)&&a8(e,n,t[n]);return e},Mce=(e,t)=>{var n={};for(var r in e)Zk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&L1)for(var r of L1(e))t.indexOf(r)<0&&Qk.call(e,r)&&(n[r]=e[r]);return n};/** * @license QR Code generator library (TypeScript) * Copyright (c) Project Nayuki. * SPDX-License-Identifier: MIT - */var Hs;(e=>{const t=class{constructor(l,u,c,f){if(this.version=l,this.errorCorrectionLevel=u,this.modules=[],this.isFunction=[],lt.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let d=[];for(let p=0;p7)throw new RangeError("Invalid value");let p,m;for(p=c;;p++){const E=t.getNumDataCodewords(p,u)*8,T=s.getTotalBits(l,p);if(T<=E){m=T;break}if(p>=f)throw new RangeError("Data too long")}for(const E of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])h&&m<=t.getNumDataCodewords(p,E)*8&&(u=E);let _=[];for(const E of l){r(E.mode.modeBits,4,_),r(E.numChars,E.mode.numCharCountBits(p),_);for(const T of E.getData())_.push(T)}i(_.length==m);const b=t.getNumDataCodewords(p,u)*8;i(_.length<=b),r(0,Math.min(4,b-_.length),_),r(0,(8-_.length%8)%8,_),i(_.length%8==0);for(let E=236;_.lengthg[T>>>3]|=E<<7-(T&7)),new t(p,u,g,d)}getModule(l,u){return 0<=l&&l>>9)*1335;const f=(u<<10|c)^21522;i(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,o(f,d));this.setFunctionModule(8,7,o(f,6)),this.setFunctionModule(8,8,o(f,7)),this.setFunctionModule(7,8,o(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,o(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,o(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,o(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let l=this.version;for(let c=0;c<12;c++)l=l<<1^(l>>>11)*7973;const u=this.version<<12|l;i(u>>>18==0);for(let c=0;c<18;c++){const f=o(u,c),d=this.size-11+c%3,h=Math.floor(c/3);this.setFunctionModule(d,h,f),this.setFunctionModule(h,d,f)}}drawFinderPattern(l,u){for(let c=-4;c<=4;c++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(c)),h=l+f,p=u+c;0<=h&&h{(E!=m-d||O>=p)&&g.push(T[E])});return i(g.length==h),g}drawCodewords(l){if(l.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let u=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let f=0;f>>3],7-(u&7)),u++)}}i(u==l.length*8)}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let u=0;u5&&l++):(this.finderPenaltyAddHistory(p,m),h||(l+=this.finderPenaltyCountPatterns(m)*t.PENALTY_N3),h=this.modules[d][_],p=1);l+=this.finderPenaltyTerminateAndCount(h,p,m)*t.PENALTY_N3}for(let d=0;d5&&l++):(this.finderPenaltyAddHistory(p,m),h||(l+=this.finderPenaltyCountPatterns(m)*t.PENALTY_N3),h=this.modules[_][d],p=1);l+=this.finderPenaltyTerminateAndCount(h,p,m)*t.PENALTY_N3}for(let d=0;dh+(p?1:0),u);const c=this.size*this.size,f=Math.ceil(Math.abs(u*20-c*10)/c)-1;return i(0<=f&&f<=9),l+=f*t.PENALTY_N4,i(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return[];{const l=Math.floor(this.version/7)+2,u=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2;let c=[6];for(let f=this.size-7;c.lengtht.MAX_VERSION)throw new RangeError("Version number out of range");let u=(16*l+128)*l+64;if(l>=2){const c=Math.floor(l/7)+2;u-=(25*c-10)*c-55,l>=7&&(u-=36)}return i(208<=u&&u<=29648),u}static getNumDataCodewords(l,u){return Math.floor(t.getNumRawDataModules(l)/8)-t.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l]*t.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let u=[];for(let f=0;f0);for(const f of l){const d=f^c.shift();c.push(0),u.forEach((h,p)=>c[p]^=t.reedSolomonMultiply(h,d))}return c}static reedSolomonMultiply(l,u){if(l>>>8||u>>>8)throw new RangeError("Byte out of range");let c=0;for(let f=7;f>=0;f--)c=c<<1^(c>>>7)*285,c^=(u>>>f&1)*l;return i(c>>>8==0),c}finderPenaltyCountPatterns(l){const u=l[1];i(u<=this.size*3);const c=u>0&&l[2]==u&&l[3]==u*3&&l[4]==u&&l[5]==u;return(c&&l[0]>=u*4&&l[6]>=u?1:0)+(c&&l[6]>=u*4&&l[0]>=u?1:0)}finderPenaltyTerminateAndCount(l,u,c){return l&&(this.finderPenaltyAddHistory(u,c),u=0),u+=this.size,this.finderPenaltyAddHistory(u,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(l,u){u[0]==0&&(l+=this.size),u.pop(),u.unshift(l)}};let n=t;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;function r(l,u,c){if(u<0||u>31||l>>>u)throw new RangeError("Value out of range");for(let f=u-1;f>=0;f--)c.push(l>>>f&1)}function o(l,u){return(l>>>u&1)!=0}function i(l){if(!l)throw new Error("Assertion error")}const a=class{constructor(l,u,c){if(this.mode=l,this.numChars=u,this.bitData=c,u<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(l){let u=[];for(const c of l)r(c,8,u);return new a(a.Mode.BYTE,l.length,u)}static makeNumeric(l){if(!a.isNumeric(l))throw new RangeError("String contains non-numeric characters");let u=[];for(let c=0;c=1<{(t=>{const n=class{constructor(o,i){this.ordinal=o,this.formatBits=i}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Hs||(Hs={}));(e=>{(t=>{const n=class{constructor(o,i){this.modeBits=o,this.numBitsCharCount=i}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Hs||(Hs={}));var Ic=Hs;/** + */var Ws;(e=>{const t=class{constructor(l,u,c,f){if(this.version=l,this.errorCorrectionLevel=u,this.modules=[],this.isFunction=[],lt.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let d=[];for(let p=0;p7)throw new RangeError("Invalid value");let p,m;for(p=c;;p++){const E=t.getNumDataCodewords(p,u)*8,T=s.getTotalBits(l,p);if(T<=E){m=T;break}if(p>=f)throw new RangeError("Data too long")}for(const E of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])h&&m<=t.getNumDataCodewords(p,E)*8&&(u=E);let S=[];for(const E of l){r(E.mode.modeBits,4,S),r(E.numChars,E.mode.numCharCountBits(p),S);for(const T of E.getData())S.push(T)}i(S.length==m);const b=t.getNumDataCodewords(p,u)*8;i(S.length<=b),r(0,Math.min(4,b-S.length),S),r(0,(8-S.length%8)%8,S),i(S.length%8==0);for(let E=236;S.lengthg[T>>>3]|=E<<7-(T&7)),new t(p,u,g,d)}getModule(l,u){return 0<=l&&l>>9)*1335;const f=(u<<10|c)^21522;i(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,o(f,d));this.setFunctionModule(8,7,o(f,6)),this.setFunctionModule(8,8,o(f,7)),this.setFunctionModule(7,8,o(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,o(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,o(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,o(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let l=this.version;for(let c=0;c<12;c++)l=l<<1^(l>>>11)*7973;const u=this.version<<12|l;i(u>>>18==0);for(let c=0;c<18;c++){const f=o(u,c),d=this.size-11+c%3,h=Math.floor(c/3);this.setFunctionModule(d,h,f),this.setFunctionModule(h,d,f)}}drawFinderPattern(l,u){for(let c=-4;c<=4;c++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(c)),h=l+f,p=u+c;0<=h&&h{(E!=m-d||O>=p)&&g.push(T[E])});return i(g.length==h),g}drawCodewords(l){if(l.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let u=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let f=0;f>>3],7-(u&7)),u++)}}i(u==l.length*8)}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let u=0;u5&&l++):(this.finderPenaltyAddHistory(p,m),h||(l+=this.finderPenaltyCountPatterns(m)*t.PENALTY_N3),h=this.modules[d][S],p=1);l+=this.finderPenaltyTerminateAndCount(h,p,m)*t.PENALTY_N3}for(let d=0;d5&&l++):(this.finderPenaltyAddHistory(p,m),h||(l+=this.finderPenaltyCountPatterns(m)*t.PENALTY_N3),h=this.modules[S][d],p=1);l+=this.finderPenaltyTerminateAndCount(h,p,m)*t.PENALTY_N3}for(let d=0;dh+(p?1:0),u);const c=this.size*this.size,f=Math.ceil(Math.abs(u*20-c*10)/c)-1;return i(0<=f&&f<=9),l+=f*t.PENALTY_N4,i(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return[];{const l=Math.floor(this.version/7)+2,u=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2;let c=[6];for(let f=this.size-7;c.lengtht.MAX_VERSION)throw new RangeError("Version number out of range");let u=(16*l+128)*l+64;if(l>=2){const c=Math.floor(l/7)+2;u-=(25*c-10)*c-55,l>=7&&(u-=36)}return i(208<=u&&u<=29648),u}static getNumDataCodewords(l,u){return Math.floor(t.getNumRawDataModules(l)/8)-t.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l]*t.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let u=[];for(let f=0;f0);for(const f of l){const d=f^c.shift();c.push(0),u.forEach((h,p)=>c[p]^=t.reedSolomonMultiply(h,d))}return c}static reedSolomonMultiply(l,u){if(l>>>8||u>>>8)throw new RangeError("Byte out of range");let c=0;for(let f=7;f>=0;f--)c=c<<1^(c>>>7)*285,c^=(u>>>f&1)*l;return i(c>>>8==0),c}finderPenaltyCountPatterns(l){const u=l[1];i(u<=this.size*3);const c=u>0&&l[2]==u&&l[3]==u*3&&l[4]==u&&l[5]==u;return(c&&l[0]>=u*4&&l[6]>=u?1:0)+(c&&l[6]>=u*4&&l[0]>=u?1:0)}finderPenaltyTerminateAndCount(l,u,c){return l&&(this.finderPenaltyAddHistory(u,c),u=0),u+=this.size,this.finderPenaltyAddHistory(u,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(l,u){u[0]==0&&(l+=this.size),u.pop(),u.unshift(l)}};let n=t;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;function r(l,u,c){if(u<0||u>31||l>>>u)throw new RangeError("Value out of range");for(let f=u-1;f>=0;f--)c.push(l>>>f&1)}function o(l,u){return(l>>>u&1)!=0}function i(l){if(!l)throw new Error("Assertion error")}const a=class{constructor(l,u,c){if(this.mode=l,this.numChars=u,this.bitData=c,u<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(l){let u=[];for(const c of l)r(c,8,u);return new a(a.Mode.BYTE,l.length,u)}static makeNumeric(l){if(!a.isNumeric(l))throw new RangeError("String contains non-numeric characters");let u=[];for(let c=0;c=1<{(t=>{const n=class{constructor(o,i){this.ordinal=o,this.formatBits=i}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Ws||(Ws={}));(e=>{(t=>{const n=class{constructor(o,i){this.modeBits=o,this.numBitsCharCount=i}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Ws||(Ws={}));var Ic=Ws;/** * @license qrcode.react * Copyright (c) Paul O'Shannessy * SPDX-License-Identifier: ISC - */var L0e={L:Ic.QrCode.Ecc.LOW,M:Ic.QrCode.Ecc.MEDIUM,Q:Ic.QrCode.Ecc.QUARTILE,H:Ic.QrCode.Ecc.HIGH},N0e=128,B0e="L",j0e="#FFFFFF",F0e="#000000",$0e=!1,G7=4,z0e=.1;function U0e(e,t=0){const n=[];return e.forEach(function(r,o){let i=null;r.forEach(function(a,s){if(!a&&i!==null){n.push(`M${i+t} ${o+t}h${s-i}v1H${i+t}z`),i=null;return}if(s===r.length-1){if(!a)return;i===null?n.push(`M${s+t},${o+t} h1v1H${s+t}z`):n.push(`M${i+t},${o+t} h${s+1-i}v1H${i+t}z`);return}a&&i===null&&(i=s)})}),n.join("")}function V0e(e,t){return e.slice().map((n,r)=>r=t.y+t.h?n:n.map((o,i)=>i=t.x+t.w?o:!1))}function H0e(e,t,n,r){if(r==null)return null;const o=n?G7:0,i=e.length+o*2,a=Math.floor(t*z0e),s=i/t,l=(r.width||a)*s,u=(r.height||a)*s,c=r.x==null?e.length/2-l/2:r.x*s,f=r.y==null?e.length/2-u/2:r.y*s;let d=null;if(r.excavate){let h=Math.floor(c),p=Math.floor(f),m=Math.ceil(l+c-h),_=Math.ceil(u+f-p);d={x:h,y:p,w:m,h:_}}return{x:c,y:f,h:u,w:l,excavation:d}}(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();function W0e(e){const t=e,{value:n,size:r=N0e,level:o=B0e,bgColor:i=j0e,fgColor:a=F0e,includeMargin:s=$0e,imageSettings:l}=t,u=D0e(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Ic.QrCode.encodeText(n,L0e[o]).getModules();const f=s?G7:0,d=c.length+f*2,h=H0e(c,r,s,l);let p=null;l!=null&&h!=null&&(h.excavation!=null&&(c=V0e(c,h.excavation)),p=ee.createElement("image",{xlinkHref:l.src,height:h.h,width:h.w,x:h.x+f,y:h.y+f,preserveAspectRatio:"none"}));const m=U0e(c,f);return ee.createElement("svg",M0e({height:r,width:r,viewBox:`0 0 ${d} ${d}`},u),ee.createElement("path",{fill:i,d:`M0,0 h${d}v${d}H0z`,shapeRendering:"crispEdges"}),ee.createElement("path",{fill:a,d:m,shapeRendering:"crispEdges"}),p)}const G0e=({user:e,relatedEvent:t,onConfirmPayment:n,relayUrl:r})=>{const[o,i]=P.useState(void 0),[a,s]=P.useState(!1),[l,u]=P.useState(!1),[c,f]=P.useState(0),[d,h]=P.useState(""),[p,m]=P.useState(""),_=Vi(),[b,g]=P.useState(void 0),E=async()=>{var N;if(!o)return;if(c<=0){_({title:"Error",description:"Please enter a valid amount",status:"error",duration:9e3,isClosable:!0});return}u(!0);const y=o;if(!y)return;const S=y==null?void 0:y.getLud16Or06Url();if(!S)return;if(!(y!=null&&y.hasZapInfo()))try{await(y==null?void 0:y.getZapCallbackInfo(S.url))}catch(D){console.error(D),_({title:"Error",description:`Could not get zap callback info: ${D.message}`,status:"error",duration:9e3,isClosable:!0}),u(!1);return}const v=S.type==="lud16"?nk(y.getLud16()):y.getLud06(),x={amount:c,relayUrls:r?[r]:[],recipientPubkey:y==null?void 0:y.pubkey,lnurl:v},I=sk(x),R=await Z.getState().signEvent(I),k=tk({callback:(N=y==null?void 0:y.lightningZapInfo)==null?void 0:N.callback,amount:x.amount,event:R.toURI(),lnurl:x.lnurl});let M;try{M=await y.getLightningInvoice(x,k)}catch(D){console.error(D),_({title:"Error",description:`Could not get lightning invoice: ${D.message}`,status:"error",duration:9e3,isClosable:!0}),u(!1);return}M&&M.pr&&g({pr:M.pr,event:R}),u(!1)},T=async()=>{if(!b)return;if(d===""||p===""){_({title:"Error",description:"Please fill in all fields",status:"error",duration:9e3,isClosable:!0});return}u(!0);const S=b.event.newZapReceipt({bolt11:d,description:p});t&&S.addEventTag({eventId:t.id}),await Z.getState().signAndSendEvent({event:S}),u(!1),_({title:"Success",description:"Payment confirmed. Keep stracking!",status:"success",duration:9e3,isClosable:!0}),n()};P.useEffect(()=>{const y=new R0e(e),S=y.getLud16Or06Url()!==void 0;i(y),s(S)},[e]);const O=w.jsx(w.Fragment,{children:!a&&w.jsx(me,{fontWeight:"bold",children:"The user does not have a supported ligning address."})}),A=w.jsx(w.Fragment,{children:a&&!b&&w.jsxs(As,{children:[w.jsx(me,{mb:2,children:"Request a ligning invoice, pay it with your ligtning wallet, and enter the bolt11 invoice receipt from your wallet in the next step."}),w.jsxs(C5,{children:[w.jsx(MS,{children:"Sats"}),w.jsx(Ht,{type:"number",value:c,onChange:y=>f(parseInt(y.target.value))})]}),w.jsx(be,{onClick:E,isLoading:l,width:"100%",children:"Get ₿ LN invoice"})]})}),C=w.jsx(w.Fragment,{children:b&&w.jsxs(w.Fragment,{children:[w.jsx(me,{mb:2,textAlign:"center",children:"Scan or copy the invoice to your lightning wallet."}),w.jsx(ve,{mb:2,width:"100%",children:w.jsx(W0e,{value:b.pr,width:"100%"})}),w.jsx(Ht,{type:"text",value:b.pr,onChange:()=>h(b.pr),mb:2}),w.jsx(In,{htmlFor:"bolt11",mt:2,children:"Bolt11"}),w.jsx(me,{mb:2,children:"Copy the bolt11 invoice receipt from your lightning wallet."}),w.jsx(Ht,{type:"text",value:d,onChange:y=>h(y.target.value),placeholder:"lnbc..."}),w.jsx(In,{htmlFor:"description",mt:2,children:"Description"}),w.jsx(Ht,{type:"text",value:p,onChange:y=>m(y.target.value),placeholder:"Keep stracking ...",mb:2}),w.jsx(be,{onClick:T,isLoading:l,children:"Confirm payment"})]})});return w.jsxs(ve,{children:[O,A,C]})},K7=({user:e,relatedEvent:t,isOpen:n,onClose:r})=>w.jsxs($r,{isOpen:n,onClose:r,children:[w.jsx(Vr,{}),w.jsxs(zr,{maxWidth:300,children:[w.jsx(Ur,{children:"Send sats (WIP)"}),w.jsx(Wr,{}),w.jsx(Hr,{children:w.jsx(G0e,{user:e,relatedEvent:t,onConfirmPayment:r})}),w.jsx(gd,{children:w.jsx(be,{variant:"outline",onClick:r,children:"Close"})})]})]});function $a({user:{pubkey:e,data:t},opts:{showAbout:n,showBanner:r,showFollowing:o,showBlock:i,showLud:a,relayUrls:s,isBlocked:l}}){const u=t&&t.name?t.name:"Anonymous",c=t&&t.display_name?t.display_name:u,f=t&&t.picture?t.picture:"",d=t&&t.banner?t.banner:void 0,h=t&&t.about?t.about:void 0,p=t&&t.lud06?t.lud06:void 0,m=t&&t.lud16?t.lud16:void 0,_=c===u,[b,g]=P.useState(""),[E,T]=P.useState(!1);P.useEffect(()=>{const I=GR(d_.PublicKeys,[{type:0,value:e}]);g(`/p/${I}`)},[e]);const O=async()=>{const I=await Z.getState().followingUser(e);T(I)},{isOpen:A,onOpen:C,onClose:y}=Wn(),{isOpen:S,onClose:v}=Wn(),x=({lud:I,name:R})=>w.jsxs(KS,{children:[w.jsx(GS,{children:w.jsx(be,{size:"xs",variant:"outline",color:"gray.500",children:R})}),w.jsxs(ZS,{children:[w.jsx(XS,{}),w.jsx(YS,{}),w.jsx(qS,{children:I&&w.jsx(me,{fontSize:12,children:I})})]})]});return w.jsxs(w.Fragment,{children:[r&&d&&w.jsx(ve,{marginBottom:2,children:w.jsx(ju,{src:d,alt:"banner"})}),w.jsxs(pt,{children:[w.jsx(ve,{children:w.jsx($f,{to:b,children:f===""?w.jsx(b0e,{size:24,name:e,variant:"marble",colors:["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]}):w.jsx(r1,{size:"xs",src:f})})}),w.jsx(ve,{overflowWrap:"anywhere",maxWidth:80,children:w.jsx($f,{to:b,children:w.jsx(me,{size:"sm",children:c})})}),w.jsx(ve,{overflowWrap:"anywhere",maxWidth:80,children:w.jsx(me,{fontSize:10,children:!_&&u})}),a&&w.jsxs(w.Fragment,{children:[p&&w.jsx(x,{lud:p,name:"LUD06"}),m&&w.jsx(x,{lud:m,name:"LUD16"})]}),w.jsx(qs,{}),w.jsxs(VS,{isLazy:!0,onOpen:O,children:[w.jsx(WS,{as:um,size:"xs",icon:w.jsx(Ge,{as:g0e}),children:"Actions"}),w.jsxs(HS,{children:[i&&w.jsx(Qo,{icon:w.jsx(Ge,{as:f0e}),onClick:()=>l?Z.getState().unblockUser(e):Z.getState().blockUser({pubkey:e,relayUrls:s}),children:l?"Unblock":"Block"}),w.jsx(Qo,{icon:w.jsx(Ge,{as:Uk}),onClick:C,children:"Lists"}),o&&w.jsx(Qo,{icon:w.jsx(Ge,{as:zk}),onClick:()=>E?Z.getState().unfollowUser(e):Z.getState().followUser({pubkey:e,relayUrls:s}),children:E?"Unfollow":"Follow"})]})]})]}),w.jsx(ve,{overflowWrap:"anywhere",mt:2,children:n&&h&&w.jsx(me,{fontSize:"sm",children:h})}),w.jsx(v0e,{pubkey:e,isOpen:A,onClose:y}),w.jsx(K7,{user:{pubkey:e,data:t},isOpen:S,onClose:v})]})}function Dm({data:e,level:t}){const[n]=Z(x=>[(x.status==="offline"||x.status==="online")&&x.keystore!=="none"]),[r,o]=P.useState(e.user?e.user:{pubkey:e.event.pubkey}),i=ZR(e.event.content),a=KR(e.event);let s;i!=null&&i.text&&!a?s=!0:a&&(s=!1);const l={isLoaded:!0,contentWarning:a,images:i.images,videos:i.videos,nurls:i.nurls,text:i.text},[u,c]=P.useState(s),f={showFollowing:!0,showBlock:!0,showLud:!0,relayUrls:e.eventRelayUrls},{isOpen:d,onOpen:h,onClose:p}=Wn(),{isOpen:m,onOpen:_,onClose:b}=Wn(),{isOpen:g,onOpen:E,onClose:T}=Wn(),O=Vi();P.useEffect(()=>{if(t===0){const x=e.user?e.user:{pubkey:e.event.pubkey};o(x)}},[e.user]),P.useEffect(()=>{const x=async()=>{const I=await Z.getState().getUser(e.event.pubkey);I&&o(I.user)};t>0&&x()},[e.event.pubkey]);const A=async()=>{if(!e.eventRelayUrls)return;const I=(await Z.getState().getRelays()||[]).find(R=>e.eventRelayUrls.includes(R.url));if(I&&I.write)return I},C=async x=>{console.log("replyCallback",x)},y=x=>{let I="";x instanceof Error?I=x.message:I="Unknown error",O({title:"Error",description:I,status:"error",duration:5e3,isClosable:!0})},S=x=>{O({title:"Success",description:`Event ${Vu(x,5)} submitted`,status:"success",duration:5e3,isClosable:!0})},v=async(x,I)=>{const R=await A();let k;switch(x){case"quote":k=ak({inResponseTo:e.event,relayUrl:R?R.url:void 0});break;case"reaction":if(!I)throw new Error("Reaction is required");k=Yie({text:I,inResponseTo:{id:e.event.id,pubkey:e.event.pubkey},relayUrl:R?R.url:void 0});break;case"zap":E();return;default:return}try{const M=await Z.getState().signAndSendEvent({event:k,relayUrls:R?[R.url]:void 0});M&&(S(M),setTimeout(()=>{Z.getState().requestInformation({source:"events",idsOrKeys:[M]},{timeoutIn:1e4})},1e3))}catch(M){y(M);return}};return w.jsxs(w.Fragment,{children:[w.jsxs(iZ,{children:[w.jsxs(oZ,{p:0,children:[u?w.jsx(i0e,{images:l.images,videos:l.videos}):w.jsx(ede,{contentWarning:l.contentWarning,setShowNSFWContent:c}),w.jsx(ve,{p:1,pl:2,children:w.jsx($a,{user:r,opts:f})})]}),u&&w.jsx(nZ,{p:0,children:w.jsx(sR,{isLoaded:l.isLoaded,children:w.jsx(Qfe,{content:l.text})})}),w.jsx(Pde,{isReady:n,level:t,createdAt:e.event.created_at,repliesCount:e.repliesCount,reactionsCount:e.reactionsCount,repostCount:e.repostsCount,zapReceiptCount:e.zapReceiptCount,zapReceiptAmount:e.zapReceiptAmount,isReplyOpen:m,onReplyOpen:_,onReplyClose:b,isInfoModalOpen:d,onInfoModalOpen:h,onInfoModalClose:p,onAction:v})]}),m&&w.jsx(Jfe,{data:e,isOpen:m,sendCallback:C,level:t}),w.jsx(Xfe,{data:e,isOpen:d,onClose:p}),w.jsx(K7,{user:r,relatedEvent:e.event,isOpen:g,onClose:T})]})}const Lm=0,za=1,Hu=2,X7=4;function q7(e,t){return n=>e(t(n))}function K0e(e,t){return t(e)}function Y7(e,t){return n=>e(t,n)}function h6(e,t){return()=>e(t)}function Nm(e,t){return t(e),e}function kt(...e){return e}function X0e(e){e()}function p6(e){return()=>e}function q0e(...e){return()=>{e.map(X0e)}}function R_(e){return e!==void 0}function Wu(){}function ft(e,t){return e(za,t)}function Be(e,t){e(Lm,t)}function k_(e){e(Hu)}function Nr(e){return e(X7)}function Se(e,t){return ft(e,Y7(t,Lm))}function $i(e,t){const n=e(za,r=>{n(),t(r)});return n}function Xe(){const e=[];return(t,n)=>{switch(t){case Hu:e.splice(0,e.length);return;case za:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case Lm:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function fe(e){let t=e;const n=Xe();return(r,o)=>{switch(r){case za:o(t);break;case Lm:t=o;break;case X7:return t}return n(r,o)}}function Y0e(e){let t,n;const r=()=>t&&t();return function(o,i){switch(o){case za:return i?n===i?void 0:(r(),n=i,t=ft(e,i),t):(r(),Wu);case Hu:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Kr(e){return Nm(Xe(),t=>Se(e,t))}function rr(e,t){return Nm(fe(t),n=>Se(e,n))}function Z0e(...e){return t=>e.reduceRight(K0e,t)}function re(e,...t){const n=Z0e(...t);return(r,o)=>{switch(r){case za:return ft(e,n(o));case Hu:k_(e);return}}}function Z7(e,t){return e===t}function Pt(e=Z7){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Le(e){return t=>n=>{e(n)&&t(n)}}function ye(e){return t=>q7(t,e)}function bi(e){return t=>()=>t(e)}function oi(e,t){return n=>r=>n(t=e(t,r))}function Ru(e){return t=>n=>{e>0?e--:t(n)}}function pa(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function m6(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function $e(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);ft(i,l=>{const u=n;n=n|s,t[a]=l,u!==o&&n===o&&r&&(r(),r=null)})}),i=>a=>{const s=()=>i([a].concat(t));n===o?s():r=s}}function y6(...e){return function(t,n){switch(t){case za:return q0e(...e.map(r=>ft(r,n)));case Hu:return;default:throw new Error(`unrecognized action ${t}`)}}}function De(e,t=Z7){return re(e,Pt(t))}function Sn(...e){const t=Xe(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);ft(i,l=>{n[a]=l,r=r|s,r===o&&Be(t,n)})}),function(i,a){switch(i){case za:return r===o&&a(n),ft(t,a);case Hu:return k_(t);default:throw new Error(`unrecognized action ${i}`)}}}function ut(e,t=[],{singleton:n}={singleton:!0}){return{id:Q0e(),constructor:e,dependencies:t,singleton:n}}const Q0e=()=>Symbol();function J0e(e){const t=new Map,n=({id:r,constructor:o,dependencies:i,singleton:a})=>{if(a&&t.has(r))return t.get(r);const s=o(i.map(l=>n(l)));return a&&t.set(r,s),s};return n(e)}function eme(e,t){const n={},r={};let o=0;const i=e.length;for(;o(_[b]=g=>{const E=m[t.methods[b]];Be(E,g)},_),{})}function c(m){return a.reduce((_,b)=>(_[b]=Y0e(m[t.events[b]]),_),{})}return{Component:ee.forwardRef((m,_)=>{const{children:b,...g}=m,[E]=ee.useState(()=>Nm(J0e(e),O=>l(O,g))),[T]=ee.useState(h6(c,E));return Th(()=>{for(const O of a)O in g&&ft(T[O],g[O]);return()=>{Object.values(T).map(k_)}},[g,T,E]),Th(()=>{l(E,g)}),ee.useImperativeHandle(_,p6(u(E))),ee.createElement(s.Provider,{value:E},n?ee.createElement(n,eme([...r,...o,...a],g),b):b)}),usePublisher:m=>ee.useCallback(Y7(Be,ee.useContext(s)[m]),[m]),useEmitterValue:m=>{const b=ee.useContext(s)[m],[g,E]=ee.useState(h6(Nr,b));return Th(()=>ft(b,T=>{T!==g&&E(p6(T))}),[b,g]),g},useEmitter:(m,_)=>{const g=ee.useContext(s)[m];Th(()=>ft(g,_),[_,g])}}}const tme=typeof document<"u"?ee.useLayoutEffect:ee.useEffect,nme=tme;var Xr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Xr||{});const rme={0:"debug",1:"log",2:"warn",3:"error"},ome=()=>typeof globalThis>"u"?window:globalThis,Ua=ut(()=>{const e=fe(3);return{log:fe((n,r,o=1)=>{var i;const a=(i=ome().VIRTUOSO_LOG_LEVEL)!=null?i:Nr(e);o>=a&&console[rme[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function M_(e,t=!0){const n=ee.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=ee.useMemo(()=>new ResizeObserver(i=>{const a=i[0].target;a.offsetParent!==null&&e(a)}),[e]);r=i=>{i&&t?(o.observe(i),n.current=i):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function Js(e,t=!0){return M_(e,t).callbackRef}function ime(e,t,n,r,o,i,a){const s=ee.useCallback(l=>{const u=ame(l.children,t,"offsetHeight",o);let c=l.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const f=c.lastElementChild.dataset.viewportType==="window",d=a?a.scrollTop:f?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,h=a?a.scrollHeight:f?document.documentElement.scrollHeight:c.scrollHeight,p=a?a.offsetHeight:f?window.innerHeight:c.offsetHeight;r({scrollTop:Math.max(d,0),scrollHeight:h,viewportHeight:p}),i==null||i(sme("row-gap",getComputedStyle(l).rowGap,o)),u!==null&&e(u)},[e,t,o,i,a,r]);return M_(s,n)}function ame(e,t,n,r){const o=e.length;if(o===0)return null;const i=[];for(let a=0;a{const d=f.target,h=d===window||d===document,p=h?window.pageYOffset||document.documentElement.scrollTop:d.scrollTop,m=h?document.documentElement.scrollHeight:d.scrollHeight,_=h?window.innerHeight:d.offsetHeight,b=()=>{e({scrollTop:Math.max(p,0),scrollHeight:m,viewportHeight:_})};f.suppressFlushSync?b():tB.flushSync(b),a.current!==null&&(p===a.current||p<=0||p===m-_)&&(a.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t]);ee.useEffect(()=>{const f=o||i.current;return r(o||i.current),l({target:f,suppressFlushSync:!0}),f.addEventListener("scroll",l,{passive:!0}),()=>{r(null),f.removeEventListener("scroll",l)}},[i,l,n,r,o]);function u(f){const d=i.current;if(!d||"offsetHeight"in d&&d.offsetHeight===0)return;const h=f.behavior==="smooth";let p,m,_;d===window?(m=Math.max(Ma(document.documentElement,"height"),document.documentElement.scrollHeight),p=window.innerHeight,_=document.documentElement.scrollTop):(m=d.scrollHeight,p=Ma(d,"height"),_=d.scrollTop);const b=m-p;if(f.top=Math.ceil(Math.max(Math.min(b,f.top),0)),J7(p,m)||f.top===_){e({scrollTop:_,scrollHeight:m,viewportHeight:p}),h&&t(!0);return}h?(a.current=f.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,a.current=null,t(!0)},1e3)):a.current=null,d.scrollTo(f)}function c(f){i.current.scrollBy(f)}return{scrollerRef:i,scrollByCallback:c,scrollToCallback:u}}const cr=ut(()=>{const e=Xe(),t=Xe(),n=fe(0),r=Xe(),o=fe(0),i=Xe(),a=Xe(),s=fe(0),l=fe(0),u=fe(0),c=fe(0),f=Xe(),d=Xe(),h=fe(!1);return Se(re(e,ye(({scrollTop:p})=>p)),t),Se(re(e,ye(({scrollHeight:p})=>p)),a),Se(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:i,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:c,scrollHeight:a,smoothScrollTargetReached:r,scrollTo:f,scrollBy:d,statefulScrollTop:o,deviation:n,scrollingInProgress:h}},[],{singleton:!0}),Gf={lvl:0};function t9(e,t,n,r=Gf,o=Gf){return{k:e,v:t,lvl:n,l:r,r:o}}function yt(e){return e===Gf}function lu(){return Gf}function Mw(e,t){if(yt(e))return Gf;const{k:n,l:r,r:o}=e;if(t===n){if(yt(r))return o;if(yt(o))return r;{const[i,a]=n9(r);return pp(dn(e,{k:i,v:a,l:r9(r)}))}}else return tt&&(s=s.concat(Dw(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(Dw(a,t,n))),s}function ws(e){return yt(e)?[]:[...ws(e.l),{k:e.k,v:e.v},...ws(e.r)]}function n9(e){return yt(e.r)?[e.k,e.v]:n9(e.r)}function r9(e){return yt(e.r)?e.l:pp(dn(e,{r:r9(e.r)}))}function dn(e,t){return t9(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function rv(e){return yt(e)||e.lvl>e.r.lvl}function g6(e){return Lw(i9(e))}function pp(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(rv(t))return i9(dn(e,{lvl:r-1}));if(!yt(t)&&!yt(t.r))return dn(t.r,{l:dn(t,{r:t.r.l}),r:dn(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(rv(e))return Lw(dn(e,{lvl:r-1}));if(!yt(n)&&!yt(n.l)){const o=n.l,i=rv(o)?n.lvl-1:n.lvl;return dn(o,{l:dn(e,{r:o.l,lvl:r-1}),r:Lw(dn(n,{l:o.r,lvl:i})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function Bm(e,t,n){if(yt(e))return[];const r=Uo(e,t)[0];return lme(Dw(e,r,n))}function o9(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const i=[];for(let a=1;a({index:t,value:n}))}function Lw(e){const{r:t,lvl:n}=e;return!yt(t)&&!yt(t.r)&&t.lvl===n&&t.r.lvl===n?dn(t,{l:dn(e,{r:t.l}),lvl:n+1}):e}function i9(e){const{l:t}=e;return!yt(t)&&t.lvl===e.lvl?dn(t,{r:dn(e,{l:t.r})}):e}function h0(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const i=Math.floor((r+o)/2),a=e[i],s=n(a,t);if(s===0)return i;if(s===-1){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function a9(e,t,n){return e[h0(e,t,n)]}function ume(e,t,n,r){const o=h0(e,t,r),i=h0(e,n,r,o);return e.slice(o,i+1)}const D_=ut(()=>({recalcInProgress:fe(!1)}),[],{singleton:!0});function cme(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function v6(e,t){let n=0,r=0;for(;n=c||o===d)&&(e=Mw(e,c)):(u=d!==o,l=!0),f>a&&a>=c&&d!==o&&(e=Dr(e,a+1,d));u&&(e=Dr(e,i,o))}return[e,n]}function dme(){return{offsetTree:[],sizeTree:lu(),groupOffsetTree:lu(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function L_({index:e},t){return t===e?0:t0&&(t=Math.max(t,a9(e,r,L_).offset)),o9(ume(e,t,n,hme),pme)}function Nw(e,t,n,r){let o=e,i=0,a=0,s=0,l=0;if(t!==0){l=h0(o,t-1,L_),s=o[l].offset;const c=Uo(n,t-1);i=c[0],a=c[1],o.length&&o[l].size===Uo(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:u,value:c}of Bm(n,t,1/0)){const f=u-i,d=f*a+s+f*r;o.push({offset:d,size:c,index:u}),i=u,s=d,a=c}return{offsetTree:o,lastIndex:i,lastOffset:s,lastSize:a}}function yme(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Xr.DEBUG);const i=e.sizeTree;let a=i,s=0;if(n.length>0&&yt(i)&&t.length===2){const d=t[0].size,h=t[1].size;a=n.reduce((p,m)=>Dr(Dr(p,m,d),m+1,h),a)}else[a,s]=fme(a,t);if(a===i)return e;const{offsetTree:l,lastIndex:u,lastSize:c,lastOffset:f}=Nw(e.offsetTree,s,a,o);return{sizeTree:a,offsetTree:l,lastIndex:u,lastOffset:f,lastSize:c,groupOffsetTree:n.reduce((d,h)=>Dr(d,h,Xf(h,l,o)),lu()),groupIndices:n}}function Xf(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:i}=a9(t,e,L_),a=e-o,s=i*a+(a-1)*n+r;return s>0?s+n:s}function gme(e){return typeof e.groupIndex<"u"}function s9(e,t,n){if(gme(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=l9(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function l9(e,t){if(!jm(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function jm(e){return!yt(e.groupOffsetTree)}function vme(e){return ws(e).map(({k:t,v:n},r,o)=>{const i=o[r+1],a=i?i.k-1:1/0;return{startIndex:t,endIndex:a,size:n}})}const wme={offsetHeight:"height",offsetWidth:"width"},mi=ut(([{log:e},{recalcInProgress:t}])=>{const n=Xe(),r=Xe(),o=rr(r,0),i=Xe(),a=Xe(),s=fe(0),l=fe([]),u=fe(void 0),c=fe(void 0),f=fe((O,A)=>Ma(O,wme[A])),d=fe(void 0),h=fe(0),p=dme(),m=rr(re(n,$e(l,e,h),oi(yme,p),Pt()),p),_=rr(re(l,Pt(),oi((O,A)=>({prev:O.current,current:A}),{prev:[],current:[]}),ye(({prev:O})=>O)),[]);Se(re(l,Le(O=>O.length>0),$e(m,h),ye(([O,A,C])=>{const y=O.reduce((S,v,x)=>Dr(S,v,Xf(v,A.offsetTree,C)||x),lu());return{...A,groupIndices:O,groupOffsetTree:y}})),m),Se(re(r,$e(m),Le(([O,{lastIndex:A}])=>O[{startIndex:O,endIndex:A,size:C}])),n),Se(u,c);const b=rr(re(u,ye(O=>O===void 0)),!0);Se(re(c,Le(O=>O!==void 0&&yt(Nr(m).sizeTree)),ye(O=>[{startIndex:0,endIndex:0,size:O}])),n);const g=Kr(re(n,$e(m),oi(({sizes:O},[A,C])=>({changed:C!==O,sizes:C}),{changed:!1,sizes:p}),ye(O=>O.changed)));ft(re(s,oi((O,A)=>({diff:O.prev-A,prev:A}),{diff:0,prev:0}),ye(O=>O.diff)),O=>{const{groupIndices:A}=Nr(m);if(O>0)Be(t,!0),Be(i,O+v6(O,A));else if(O<0){const C=Nr(_);C.length>0&&(O-=v6(-O,C)),Be(a,O)}}),ft(re(s,$e(e)),([O,A])=>{O<0&&A("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},Xr.ERROR)});const E=Kr(i);Se(re(i,$e(m),ye(([O,A])=>{const C=A.groupIndices.length>0,y=[],S=A.lastSize;if(C){const v=Kf(A.sizeTree,0);let x=0,I=0;for(;x{let L=M.ranges;return M.prevSize!==0&&(L=[...M.ranges,{startIndex:M.prevIndex,endIndex:N+O-1,size:M.prevSize}]),{ranges:L,prevIndex:N+O,prevSize:D}},{ranges:y,prevIndex:O,prevSize:0}).ranges}return ws(A.sizeTree).reduce((v,{k:x,v:I})=>({ranges:[...v.ranges,{startIndex:v.prevIndex,endIndex:x+O-1,size:v.prevSize}],prevIndex:x+O,prevSize:I}),{ranges:[],prevIndex:0,prevSize:S}).ranges})),n);const T=Kr(re(a,$e(m,h),ye(([O,{offsetTree:A},C])=>{const y=-O;return Xf(y,A,C)})));return Se(re(a,$e(m,h),ye(([O,A,C])=>{if(A.groupIndices.length>0){if(yt(A.sizeTree))return A;let S=lu();const v=Nr(_);let x=0,I=0,R=0;for(;x<-O;){R=v[I];const M=v[I+1]-R-1;I++,x+=M+1}if(S=ws(A.sizeTree).reduce((M,{k:N,v:D})=>Dr(M,Math.max(0,N+O),D),S),x!==-O){const M=Kf(A.sizeTree,R);S=Dr(S,0,M);const N=Uo(A.sizeTree,-O+1)[1];S=Dr(S,1,N)}return{...A,sizeTree:S,...Nw(A.offsetTree,0,S,C)}}else{const S=ws(A.sizeTree).reduce((v,{k:x,v:I})=>Dr(v,Math.max(0,x+O),I),lu());return{...A,sizeTree:S,...Nw(A.offsetTree,0,S,C)}}})),m),{data:d,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:i,shiftWith:a,shiftWithOffset:T,beforeUnshiftWith:E,firstItemIndex:s,gap:h,sizes:m,listRefresh:g,statefulTotalCount:o,trackItemSizes:b,itemSize:f}},kt(Ua,D_),{singleton:!0}),bme=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function u9(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!bme)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const Pd=ut(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:i,scrollTo:a,smoothScrollTargetReached:s,headerHeight:l,footerHeight:u,fixedHeaderHeight:c,fixedFooterHeight:f},{log:d}])=>{const h=Xe(),p=fe(0);let m=null,_=null,b=null;function g(){m&&(m(),m=null),b&&(b(),b=null),_&&(clearTimeout(_),_=null),Be(o,!1)}return Se(re(h,$e(e,i,t,p,l,u,d),$e(r,c,f),ye(([[E,T,O,A,C,y,S,v],x,I,R])=>{const k=u9(E),{align:M,behavior:N,offset:D}=k,L=A-1,j=s9(k,T,L);let F=Xf(j,T.offsetTree,x)+y;M==="end"?(F+=I+Uo(T.sizeTree,j)[1]-O+R,j===L&&(F+=S)):M==="center"?F+=(I+Uo(T.sizeTree,j)[1]-O+R)/2:F-=C,D&&(F+=D);const B=U=>{g(),U?(v("retrying to scroll to",{location:E},Xr.DEBUG),Be(h,E)):v("list did not change, scroll successful",{},Xr.DEBUG)};if(g(),N==="smooth"){let U=!1;b=ft(n,K=>{U=U||K}),m=$i(s,()=>{B(U)})}else m=$i(re(n,Sme(150)),B);return _=setTimeout(()=>{g()},1200),Be(o,!0),v("scrolling from index to",{index:j,top:F,behavior:N},Xr.DEBUG),{top:F,behavior:N}})),a),{scrollToIndex:h,topListHeight:p}},kt(mi,cr,Ua),{singleton:!0});function Sme(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const qf="up",rf="down",_me="none",Eme={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Cme=0,Td=ut(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:i}])=>{const a=fe(!1),s=fe(!0),l=Xe(),u=Xe(),c=fe(4),f=fe(Cme),d=rr(re(y6(re(De(t),Ru(1),bi(!0)),re(De(t),Ru(1),bi(!1),m6(100))),Pt()),!1),h=rr(re(y6(re(i,bi(!0)),re(i,bi(!1),m6(200))),Pt()),!1);Se(re(Sn(De(t),De(f)),ye(([g,E])=>g<=E),Pt()),s),Se(re(s,pa(50)),u);const p=Kr(re(Sn(e,De(n),De(r),De(o),De(c)),oi((g,[{scrollTop:E,scrollHeight:T},O,A,C,y])=>{const S=E+O-T>-y,v={viewportHeight:O,scrollTop:E,scrollHeight:T};if(S){let I,R;return E>g.state.scrollTop?(I="SCROLLED_DOWN",R=g.state.scrollTop-E):(I="SIZE_DECREASED",R=g.state.scrollTop-E||g.scrollTopDelta),{atBottom:!0,state:v,atBottomBecause:I,scrollTopDelta:R}}let x;return v.scrollHeight>g.state.scrollHeight?x="SIZE_INCREASED":Og&&g.atBottom===E.atBottom))),m=rr(re(e,oi((g,{scrollTop:E,scrollHeight:T,viewportHeight:O})=>{if(J7(g.scrollHeight,T))return{scrollTop:E,scrollHeight:T,jump:0,changed:!1};{const A=T-(E+O)<1;return g.scrollTop!==E&&A?{scrollHeight:T,scrollTop:E,jump:g.scrollTop-E,changed:!0}:{scrollHeight:T,scrollTop:E,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Le(g=>g.changed),ye(g=>g.jump)),0);Se(re(p,ye(g=>g.atBottom)),a),Se(re(a,pa(50)),l);const _=fe(rf);Se(re(e,ye(({scrollTop:g})=>g),Pt(),oi((g,E)=>Nr(h)?{direction:g.direction,prevScrollTop:E}:{direction:Eg.direction)),_),Se(re(e,pa(50),bi(_me)),_);const b=fe(0);return Se(re(d,Le(g=>!g),bi(0)),b),Se(re(t,pa(100),$e(d),Le(([g,E])=>!!E),oi(([g,E],[T])=>[E,T],[0,0]),ye(([g,E])=>E-g)),b),{isScrolling:d,isAtTop:s,isAtBottom:a,atBottomState:p,atTopStateChange:u,atBottomStateChange:l,scrollDirection:_,atBottomThreshold:c,atTopThreshold:f,scrollVelocity:b,lastJumpDueToItemResize:m}},kt(cr)),Va=ut(([{log:e}])=>{const t=fe(!1),n=Kr(re(t,Le(r=>r),Pt()));return ft(t,r=>{r&&Nr(e)("props updated",{},Xr.DEBUG)}),{propsReady:t,didMount:n}},kt(Ua),{singleton:!0});function N_(e,t){e==0?t():requestAnimationFrame(()=>N_(e-1,t))}function B_(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Id=ut(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o},{didMount:i}])=>{const a=fe(!0),s=fe(0),l=fe(!1);return Se(re(i,$e(s),Le(([u,c])=>!!c),bi(!1)),a),ft(re(Sn(t,i),$e(a,e,n,l),Le(([[,u],c,{sizeTree:f},d,h])=>u&&(!yt(f)||R_(d))&&!c&&!h),$e(s)),([,u])=>{Be(l,!0),N_(3,()=>{$i(r,()=>Be(a,!0)),Be(o,u)})}),{scrolledToInitialItem:a,initialTopMostItemIndex:s}},kt(mi,cr,Pd,Va),{singleton:!0});function w6(e){return e?e==="smooth"?"smooth":"auto":!1}const xme=(e,t)=>typeof e=="function"?w6(e(t)):t&&w6(e),Ome=ut(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:i},{propsReady:a,didMount:s},{log:l},{scrollingInProgress:u}])=>{const c=fe(!1),f=Xe();let d=null;function h(m){Be(o,{index:"LAST",align:"end",behavior:m})}ft(re(Sn(re(De(e),Ru(1)),s),$e(De(c),n,i,u),ye(([[m,_],b,g,E,T])=>{let O=_&&E,A="auto";return O&&(A=xme(b,g||T),O=O&&!!A),{totalCount:m,shouldFollow:O,followOutputBehavior:A}}),Le(({shouldFollow:m})=>m)),({totalCount:m,followOutputBehavior:_})=>{d&&(d(),d=null),d=$i(t,()=>{Nr(l)("following output to ",{totalCount:m},Xr.DEBUG),h(_),d=null})});function p(m){const _=$i(r,b=>{m&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!d&&(Nr(l)("scrolling to bottom due to increased size",{},Xr.DEBUG),h("auto"))});setTimeout(_,100)}return ft(re(Sn(De(c),e,a),Le(([m,,_])=>m&&_),oi(({value:m},[,_])=>({refreshed:m===_,value:_}),{refreshed:!1,value:0}),Le(({refreshed:m})=>m),$e(c,e)),([,m])=>{p(m!==!1)}),ft(f,()=>{p(Nr(c)!==!1)}),ft(Sn(De(c),r),([m,_])=>{m&&!_.atBottom&&_.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&h("auto")}),{followOutput:c,autoscrollToBottom:f}},kt(mi,Td,Pd,Id,Va,Ua,cr));function Ame(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const c9=ut(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const i=Xe(),a=Xe(),s=Kr(re(i,ye(Ame)));return Se(re(s,ye(l=>l.totalCount)),e),Se(re(s,ye(l=>l.groupIndices)),t),Se(re(Sn(r,n,o),Le(([l,u])=>jm(u)),ye(([l,u,c])=>Uo(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),Pt(),ye(l=>[l])),a),{groupCounts:i,topItemsIndexes:a}},kt(mi,cr));function Yf(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function f9(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const p0="top",m0="bottom",b6="none";function S6(e,t,n){return typeof e=="number"?n===qf&&t===p0||n===rf&&t===m0?e:0:n===qf?t===p0?e.main:e.reverse:t===m0?e.main:e.reverse}function _6(e,t){return typeof e=="number"?e:e[t]||0}const j_=ut(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const i=Xe(),a=fe(0),s=fe(0),l=fe(0),u=rr(re(Sn(De(e),De(t),De(r),De(i,Yf),De(l),De(a),De(o),De(n),De(s)),ye(([c,f,d,[h,p],m,_,b,g,E])=>{const T=c-g,O=_+b,A=Math.max(d-T,0);let C=b6;const y=_6(E,p0),S=_6(E,m0);return h-=g,h+=d+b,p+=d+b,p-=g,h>c+O-y&&(C=qf),pc!=null),Pt(Yf)),[0,0]);return{listBoundary:i,overscan:l,topListHeight:a,increaseViewportBy:s,visibleRange:u}},kt(cr),{singleton:!0});function Pme(e,t,n){if(jm(t)){const r=l9(e,t);return[{index:Uo(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const ov={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function E6(e,t,n){if(e.length===0)return[];if(!jm(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,o=e[e.length-1].index,i=[],a=Bm(t.groupOffsetTree,r,o);let s,l=0;for(const u of e){(!s||s.end0){u=e[0].offset;const m=e[e.length-1];c=m.offset+m.size}const f=n-l,d=s+f*a+(f-1)*r,h=u,p=d-c;return{items:E6(e,o,i),topItems:E6(t,o,i),topListHeight:t.reduce((m,_)=>_.size+m,0),offsetTop:u,offsetBottom:p,top:h,bottom:c,totalCount:n,firstItemIndex:i}}function d9(e,t,n,r,o,i){let a=0;if(n.groupIndices.length>0)for(const c of n.groupIndices){if(c-a>=e)break;a++}const s=e+a,l=B_(t,s),u=Array.from({length:s}).map((c,f)=>({index:f+l,size:0,offset:0,data:i[f+l]}));return mp(u,[],s,o,n,r)}const el=ut(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},i,{visibleRange:a,listBoundary:s,topListHeight:l},{scrolledToInitialItem:u,initialTopMostItemIndex:c},{topListHeight:f},d,{didMount:h},{recalcInProgress:p}])=>{const m=fe([]),_=fe(0),b=Xe();Se(i.topItemsIndexes,m);const g=rr(re(Sn(h,p,De(a,Yf),De(t),De(e),De(c),u,De(m),De(r),De(o),n),Le(([A,C,,y,,,,,,,S])=>{const v=S&&S.length!==y;return A&&!C&&!v}),ye(([,,[A,C],y,S,v,x,I,R,k,M])=>{const N=S,{sizeTree:D,offsetTree:L}=N,j=Nr(_);if(y===0)return{...ov,totalCount:y};if(A===0&&C===0)return j===0?{...ov,totalCount:y}:d9(j,v,S,R,k,M||[]);if(yt(D))return j>0?null:mp(Pme(B_(v,y),N,M),[],y,k,N,R);const F=[];if(I.length>0){const Q=I[0],X=I[I.length-1];let J=0;for(const te of Bm(D,Q,X)){const le=te.value,ge=Math.max(te.start,Q),se=Math.min(te.end,X);for(let ue=ge;ue<=se;ue++)F.push({index:ue,size:le,offset:J,data:M&&M[ue]}),J+=le}}if(!x)return mp([],F,y,k,N,R);const B=I.length>0?I[I.length-1]+1:0,U=mme(L,A,C,B);if(U.length===0)return null;const K=y-1,W=Nm([],Q=>{for(const X of U){const J=X.value;let te=J.offset,le=X.start;const ge=J.size;if(J.offset=C);ue++)Q.push({index:ue,size:ge,offset:te,data:M&&M[ue]}),te+=ge+k}});return mp(W,F,y,k,N,R)}),Le(A=>A!==null),Pt()),ov);Se(re(n,Le(R_),ye(A=>A==null?void 0:A.length)),t),Se(re(g,ye(A=>A.topListHeight)),f),Se(f,l),Se(re(g,ye(A=>[A.top,A.bottom])),s),Se(re(g,ye(A=>A.items)),b);const E=Kr(re(g,Le(({items:A})=>A.length>0),$e(t,n),Le(([{items:A},C])=>A[A.length-1].originalIndex===C-1),ye(([,A,C])=>[A-1,C]),Pt(Yf),ye(([A])=>A))),T=Kr(re(g,pa(200),Le(({items:A,topItems:C})=>A.length>0&&A[0].originalIndex===C.length),ye(({items:A})=>A[0].index),Pt())),O=Kr(re(g,Le(({items:A})=>A.length>0),ye(({items:A})=>{let C=0,y=A.length-1;for(;A[C].type==="group"&&CC;)y--;return{startIndex:A[C].index,endIndex:A[y].index}}),Pt(f9)));return{listState:g,topItemsIndexes:m,endReached:E,startReached:T,rangeChanged:O,itemsRendered:b,initialItemCount:_,...d}},kt(mi,c9,j_,Id,Pd,Td,Va,D_),{singleton:!0}),Tme=ut(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{initialItemCount:i,listState:a},{didMount:s}])=>(Se(re(s,$e(i),Le(([,l])=>l!==0),$e(o,e,t,r,n),ye(([[,l],u,c,f,d,h=[]])=>d9(l,u,c,f,d,h))),a),{}),kt(mi,Id,el,Va),{singleton:!0}),h9=ut(([{scrollVelocity:e}])=>{const t=fe(!1),n=Xe(),r=fe(!1);return Se(re(e,$e(r,t,n),Le(([o,i])=>!!i),ye(([o,i,a,s])=>{const{exit:l,enter:u}=i;if(a){if(l(o,s))return!1}else if(u(o,s))return!0;return a}),Pt()),t),ft(re(Sn(t,e,n),$e(r)),([[o,i,a],s])=>o&&s&&s.change&&s.change(i,a)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},kt(Td),{singleton:!0}),Ime=ut(([{topItemsIndexes:e}])=>{const t=fe(0);return Se(re(t,Le(n=>n>0),ye(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},kt(el)),p9=ut(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const i=Xe(),a=rr(re(Sn(e,r,t,n,o),ye(([s,l,u,c,f])=>s+l+u+c+f.offsetBottom+f.bottom)),0);return Se(De(a),i),{totalListHeight:a,totalListHeightChanged:i}},kt(cr,el),{singleton:!0});function m9(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Rme=m9(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),kme=ut(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:i,scrollDirection:a,lastJumpDueToItemResize:s},{listState:l},{beforeUnshiftWith:u,shiftWithOffset:c,sizes:f,gap:d},{log:h},{recalcInProgress:p}])=>{const m=Kr(re(l,$e(s),oi(([,b,g,E],[{items:T,totalCount:O,bottom:A,offsetBottom:C},y])=>{const S=A+C;let v=0;return g===O&&b.length>0&&T.length>0&&(T[0].originalIndex===0&&b[0].originalIndex===0||(v=S-E,v!==0&&(v+=y))),[v,T,O,S]},[0,[],0,0]),Le(([b])=>b!==0),$e(t,a,r,i,h,p),Le(([,b,g,E,,,T])=>!T&&!E&&b!==0&&g===qf),ye(([[b],,,,,g])=>(g("Upward scrolling compensation",{amount:b},Xr.DEBUG),b))));function _(b){b>0?(Be(e,{top:-b,behavior:"auto"}),Be(n,0)):(Be(n,0),Be(e,{top:-b,behavior:"auto"}))}return ft(re(m,$e(n,o)),([b,g,E])=>{E&&Rme()?Be(n,g-b):_(-b)}),ft(re(Sn(rr(o,!1),n,p),Le(([b,g,E])=>!b&&!E&&g!==0),ye(([b,g])=>g),pa(1)),_),Se(re(c,ye(b=>({top:-b}))),e),ft(re(u,$e(f,d),ye(([b,{lastSize:g,groupIndices:E,sizeTree:T},O])=>{function A(C){return C*(g+O)}if(E.length===0)return A(b);{let C=0;const y=Kf(T,0);let S=0,v=0;for(;Sb&&(C-=y,x=b-S+1),S+=x,C+=A(x),v++}return C}})),b=>{Be(n,b),requestAnimationFrame(()=>{Be(e,{top:b}),requestAnimationFrame(()=>{Be(n,0),Be(p,!1)})})}),{deviation:n}},kt(cr,Td,el,mi,Ua,D_)),Mme=ut(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=fe(0);return ft(re(e,$e(r),Le(([,o])=>o!==0),ye(([,o])=>({top:o}))),o=>{$i(re(n,Ru(1),Le(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{Be(t,o)})})}),{initialScrollTop:r}},kt(Va,cr,el),{singleton:!0}),Dme=ut(([{viewportHeight:e},{totalListHeight:t}])=>{const n=fe(!1),r=rr(re(Sn(n,e,t),Le(([o])=>o),ye(([,o,i])=>Math.max(0,o-i)),pa(0),Pt()),0);return{alignToBottom:n,paddingTopAddition:r}},kt(cr,p9),{singleton:!0}),F_=ut(([{scrollTo:e,scrollContainerState:t}])=>{const n=Xe(),r=Xe(),o=Xe(),i=fe(!1),a=fe(void 0);return Se(re(Sn(n,r),ye(([{viewportHeight:s,scrollTop:l,scrollHeight:u},{offsetTop:c}])=>({scrollTop:Math.max(0,l-c),scrollHeight:u,viewportHeight:s}))),t),Se(re(e,$e(r),ye(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),o),{useWindowScroll:i,customScrollParent:a,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},kt(cr)),Lme=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:i,...a}})=>er?{...a,behavior:o,align:i??"end"}:null,Nme=ut(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:i,fixedHeaderHeight:a,fixedFooterHeight:s,scrollingInProgress:l},{scrollToIndex:u}])=>{const c=Xe();return Se(re(c,$e(e,o,t,i,a,s,r),$e(n),ye(([[f,d,h,p,m,_,b,g],E])=>{const{done:T,behavior:O,align:A,calculateViewLocation:C=Lme,...y}=f,S=s9(f,d,p-1),v=Xf(S,d.offsetTree,E)+m+_,x=v+Uo(d.sizeTree,S)[1],I=g+_,R=g+h-b,k=C({itemTop:v,itemBottom:x,viewportTop:I,viewportBottom:R,locationParams:{behavior:O,align:A,...y}});return k?T&&$i(re(l,Le(M=>M===!1),Ru(Nr(l)?1:2)),T):T&&T(),k}),Le(f=>f!==null)),u),{scrollIntoView:c}},kt(mi,cr,Pd,el,Ua),{singleton:!0}),Bme=ut(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:s}])=>{const l=Xe(),u=fe(void 0),c=fe(null),f=fe(null);return Se(a,c),Se(s,f),ft(re(l,$e(e,n,i,c,f)),([d,h,p,m,_,b])=>{const g=vme(h.sizeTree);m&&_!==null&&b!==null&&(p=_.scrollTop-b.offsetTop),d({ranges:g,scrollTop:p})}),Se(re(u,Le(R_),ye(jme)),r),Se(re(o,$e(u),Le(([,d])=>d!==void 0),Pt(),ye(([,d])=>d.ranges)),t),{getState:l,restoreStateFrom:u}},kt(mi,cr,Id,Va,F_));function jme(e){return{offset:e.scrollTop,index:0,align:"start"}}const Fme=ut(([e,t,n,r,o,i,a,s,l,u])=>({...e,...t,...n,...r,...o,...i,...a,...s,...l,...u}),kt(j_,Tme,Va,h9,p9,Mme,Dme,F_,Nme,Ua)),$me=ut(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:i,data:a,firstItemIndex:s,groupIndices:l,statefulTotalCount:u,gap:c,sizes:f},{initialTopMostItemIndex:d,scrolledToInitialItem:h},p,m,_,{listState:b,topItemsIndexes:g,...E},{scrollToIndex:T},O,{topItemCount:A},{groupCounts:C},y])=>(Se(E.rangeChanged,y.scrollSeekRangeChanged),Se(re(y.windowViewportRect,ye(S=>S.visibleHeight)),p.viewportHeight),{totalCount:e,data:a,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:d,scrolledToInitialItem:h,topItemsIndexes:g,topItemCount:A,groupCounts:C,fixedItemHeight:n,defaultItemHeight:r,gap:c,..._,statefulTotalCount:u,listState:b,scrollToIndex:T,trackItemSizes:o,itemSize:i,groupIndices:l,...E,...y,...p,sizes:f,...m}),kt(mi,Id,cr,Bme,Ome,el,Pd,kme,Ime,c9,Fme)),iv="-webkit-sticky",C6="sticky",y9=m9(()=>{if(typeof document>"u")return C6;const e=document.createElement("div");return e.style.position=iv,e.style.position===iv?iv:C6});function g9(e,t){const n=ee.useRef(null),r=ee.useCallback(s=>{if(s===null||!s.offsetParent)return;const l=s.getBoundingClientRect(),u=l.width;let c,f;if(t){const d=t.getBoundingClientRect(),h=l.top-d.top;c=d.height-Math.max(0,h),f=h+t.scrollTop}else c=window.innerHeight-Math.max(0,l.top),f=l.top+window.pageYOffset;n.current={offsetTop:f,visibleHeight:c,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:o,ref:i}=M_(r),a=ee.useCallback(()=>{r(i.current)},[r,i]);return ee.useEffect(()=>{if(t){t.addEventListener("scroll",a);const s=new ResizeObserver(a);return s.observe(t),()=>{t.removeEventListener("scroll",a),s.unobserve(t)}}else return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),o}const v9=ee.createContext(void 0),w9=ee.createContext(void 0);function b9(e){return e}const zme=ut(()=>{const e=fe(l=>`Item ${l}`),t=fe(null),n=fe(l=>`Group ${l}`),r=fe({}),o=fe(b9),i=fe("div"),a=fe(Wu),s=(l,u=null)=>rr(re(r,ye(c=>c[l]),Pt()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:i,scrollerRef:a,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),Ume=ut(([e,t])=>({...e,...t}),kt($me,zme)),Vme=({height:e})=>ee.createElement("div",{style:{height:e}}),Hme={position:y9(),zIndex:1,overflowAnchor:"none"},Wme={overflowAnchor:"none"},x6=ee.memo(function({showTopList:t=!1}){const n=We("listState"),r=yo("sizeRanges"),o=We("useWindowScroll"),i=We("customScrollParent"),a=yo("windowScrollContainerState"),s=yo("scrollContainerState"),l=i||o?a:s,u=We("itemContent"),c=We("context"),f=We("groupContent"),d=We("trackItemSizes"),h=We("itemSize"),p=We("log"),m=yo("gap"),{callbackRef:_}=ime(r,h,d,t?Wu:l,p,m,i),[b,g]=ee.useState(0);$_("deviation",k=>{b!==k&&g(k)});const E=We("EmptyPlaceholder"),T=We("ScrollSeekPlaceholder")||Vme,O=We("ListComponent"),A=We("ItemComponent"),C=We("GroupComponent"),y=We("computeItemKey"),S=We("isSeeking"),v=We("groupIndices").length>0,x=We("paddingTopAddition"),I=We("scrolledToInitialItem"),R=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+x,paddingBottom:n.offsetBottom,marginTop:b,...I?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&E?ee.createElement(E,gr(E,c)):ee.createElement(O,{...gr(O,c),ref:_,style:R,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(k=>{const M=k.originalIndex,N=y(M+n.firstItemIndex,k.data,c);return S?ee.createElement(T,{...gr(T,c),key:N,index:k.index,height:k.size,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?ee.createElement(C,{...gr(C,c),key:N,"data-index":M,"data-known-size":k.size,"data-item-index":k.index,style:Hme},f(k.index,c)):ee.createElement(A,{...gr(A,c),key:N,"data-index":M,"data-known-size":k.size,"data-item-index":k.index,"data-item-group-index":k.groupIndex,item:k.data,style:Wme},v?u(k.index,k.groupIndex,k.data,c):u(k.index,k.data,c))}))}),Gme={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Fm={width:"100%",height:"100%",position:"absolute",top:0},Kme={width:"100%",position:y9(),top:0,zIndex:1};function gr(e,t){if(typeof e!="string")return{context:t}}const Xme=ee.memo(function(){const t=We("HeaderComponent"),n=yo("headerHeight"),r=We("headerFooterTag"),o=Js(a=>n(Ma(a,"height"))),i=We("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null}),qme=ee.memo(function(){const t=We("FooterComponent"),n=yo("footerHeight"),r=We("headerFooterTag"),o=Js(a=>n(Ma(a,"height"))),i=We("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null});function S9({usePublisher:e,useEmitter:t,useEmitterValue:n}){return ee.memo(function({style:i,children:a,...s}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),f=n("scrollerRef"),d=n("context"),{scrollerRef:h,scrollByCallback:p,scrollToCallback:m}=e9(l,c,u,f);return t("scrollTo",m),t("scrollBy",p),ee.createElement(u,{ref:h,style:{...Gme,...i},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...s,...gr(u,d)},a)})}function _9({usePublisher:e,useEmitter:t,useEmitterValue:n}){return ee.memo(function({style:i,children:a,...s}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),f=n("totalListHeight"),d=n("deviation"),h=n("customScrollParent"),p=n("context"),{scrollerRef:m,scrollByCallback:_,scrollToCallback:b}=e9(l,c,u,Wu,h);return nme(()=>(m.current=h||window,()=>{m.current=null}),[m,h]),t("windowScrollTo",b),t("scrollBy",_),ee.createElement(u,{style:{position:"relative",...i,...f!==0?{height:f+d}:{}},"data-virtuoso-scroller":!0,...s,...gr(u,p)},a)})}const Yme=({children:e})=>{const t=ee.useContext(v9),n=yo("viewportHeight"),r=yo("fixedItemHeight"),o=Js(q7(n,i=>Ma(i,"height")));return ee.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),ee.createElement("div",{style:Fm,ref:o,"data-viewport-type":"element"},e)},Zme=({children:e})=>{const t=ee.useContext(v9),n=yo("windowViewportRect"),r=yo("fixedItemHeight"),o=We("customScrollParent"),i=g9(n,o);return ee.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),ee.createElement("div",{ref:i,style:Fm,"data-viewport-type":"window"},e)},Qme=({children:e})=>{const t=We("TopItemListComponent"),n=We("headerHeight"),r={...Kme,marginTop:`${n}px`},o=We("context");return ee.createElement(t||"div",{style:r,context:o},e)},Jme=ee.memo(function(t){const n=We("useWindowScroll"),r=We("topItemsIndexes").length>0,o=We("customScrollParent"),i=o||n?nye:tye,a=o||n?Zme:Yme;return ee.createElement(i,{...t},r&&ee.createElement(Qme,null,ee.createElement(x6,{showTopList:!0})),ee.createElement(a,null,ee.createElement(Xme,null),ee.createElement(x6,null),ee.createElement(qme,null)))}),{Component:eye,usePublisher:yo,useEmitterValue:We,useEmitter:$_}=Q7(Ume,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Jme),tye=S9({usePublisher:yo,useEmitterValue:We,useEmitter:$_}),nye=_9({usePublisher:yo,useEmitterValue:We,useEmitter:$_}),rye=eye,O6={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},oye={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:A6,ceil:P6,floor:y0,min:av,max:of}=Math;function iye(e){return{...oye,items:e}}function T6(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const i=n===null?null:n[o+e];return{index:o+e,data:i}})}function aye(e,t){return e&&e.column===t.column&&e.row===t.row}function Ih(e,t){return e&&e.width===t.width&&e.height===t.height}const sye=ut(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:i,scrollTo:a,smoothScrollTargetReached:s,scrollContainerState:l,footerHeight:u,headerHeight:c},f,d,{propsReady:h,didMount:p},{windowViewportRect:m,useWindowScroll:_,customScrollParent:b,windowScrollContainerState:g,windowScrollTo:E},T])=>{const O=fe(0),A=fe(0),C=fe(O6),y=fe({height:0,width:0}),S=fe({height:0,width:0}),v=Xe(),x=Xe(),I=fe(0),R=fe(null),k=fe({row:0,column:0}),M=Xe(),N=Xe(),D=fe(!1),L=fe(0),j=fe(!0),F=fe(!1);ft(re(p,$e(L),Le(([X,J])=>!!J)),()=>{Be(j,!1),Be(A,0)}),ft(re(Sn(p,j,S,y,L,F),Le(([X,J,te,le,,ge])=>X&&!J&&te.height!==0&&le.height!==0&&!ge)),([,,,,X])=>{Be(F,!0),N_(1,()=>{Be(v,X)}),$i(re(r),()=>{Be(n,[0,0]),Be(j,!0)})}),Se(re(N,Le(X=>X!=null&&X.scrollTop>0),bi(0)),A),ft(re(p,$e(N),Le(([,X])=>X!=null)),([,X])=>{X&&(Be(y,X.viewport),Be(S,X==null?void 0:X.item),Be(k,X.gap),X.scrollTop>0&&(Be(D,!0),$i(re(r,Ru(1)),J=>{Be(D,!1)}),Be(a,{top:X.scrollTop})))}),Se(re(y,ye(({height:X})=>X)),o),Se(re(Sn(De(y,Ih),De(S,Ih),De(k,(X,J)=>X&&X.column===J.column&&X.row===J.row),De(r)),ye(([X,J,te,le])=>({viewport:X,item:J,gap:te,scrollTop:le}))),M),Se(re(Sn(De(O),t,De(k,aye),De(S,Ih),De(y,Ih),De(R),De(A),De(D),De(j),De(L)),Le(([,,,,,,,X])=>!X),ye(([X,[J,te],le,ge,se,ue,Ie,,gt,ie])=>{const{row:Ce,column:Ne}=le,{height:ze,width:fr}=ge,{width:Kt}=se;if(Ie===0&&(X===0||Kt===0))return O6;if(fr===0){const tl=B_(ie,X),kd=tl===0?Math.max(Ie-1,0):tl;return iye(T6(tl,kd,ue))}const Cn=E9(Kt,fr,Ne);let xn,zt;gt?J===0&&te===0&&Ie>0?(xn=0,zt=Ie-1):(xn=Cn*y0((J+Ce)/(ze+Ce)),zt=Cn*P6((te+Ce)/(ze+Ce))-1,zt=av(X-1,of(zt,Cn-1)),xn=av(zt,of(0,xn))):(xn=0,zt=-1);const Co=T6(xn,zt,ue),{top:Vo,bottom:Ha}=I6(se,le,ge,Co),Wa=P6(X/Cn),Rd=Wa*ze+(Wa-1)*Ce-Ha;return{items:Co,offsetTop:Vo,offsetBottom:Rd,top:Vo,bottom:Ha,itemHeight:ze,itemWidth:fr}})),C),Se(re(R,Le(X=>X!==null),ye(X=>X.length)),O),Se(re(Sn(y,S,C,k),Le(([X,J,{items:te}])=>te.length>0&&J.height!==0&&X.height!==0),ye(([X,J,{items:te},le])=>{const{top:ge,bottom:se}=I6(X,le,J,te);return[ge,se]}),Pt(Yf)),n);const B=fe(!1);Se(re(r,$e(B),ye(([X,J])=>J||X!==0)),B);const U=Kr(re(De(C),Le(({items:X})=>X.length>0),$e(O,B),Le(([{items:X},J,te])=>te&&X[X.length-1].index===J-1),ye(([,X])=>X-1),Pt())),K=Kr(re(De(C),Le(({items:X})=>X.length>0&&X[0].index===0),bi(0),Pt())),W=Kr(re(De(C),$e(D),Le(([{items:X},J])=>X.length>0&&!J),ye(([{items:X}])=>({startIndex:X[0].index,endIndex:X[X.length-1].index})),Pt(f9),pa(0)));Se(W,d.scrollSeekRangeChanged),Se(re(v,$e(y,S,O,k),ye(([X,J,te,le,ge])=>{const se=u9(X),{align:ue,behavior:Ie,offset:gt}=se;let ie=se.index;ie==="LAST"&&(ie=le-1),ie=of(0,ie,av(le-1,ie));let Ce=Bw(J,ge,te,ie);return ue==="end"?Ce=A6(Ce-J.height+te.height):ue==="center"&&(Ce=A6(Ce-J.height/2+te.height/2)),gt&&(Ce+=gt),{top:Ce,behavior:Ie}})),a);const Q=rr(re(C,ye(X=>X.offsetBottom+X.bottom)),0);return Se(re(m,ye(X=>({width:X.visibleWidth,height:X.visibleHeight}))),y),{data:R,totalCount:O,viewportDimensions:y,itemDimensions:S,scrollTop:r,scrollHeight:x,overscan:e,scrollBy:i,scrollTo:a,scrollToIndex:v,smoothScrollTargetReached:s,windowViewportRect:m,windowScrollTo:E,useWindowScroll:_,customScrollParent:b,windowScrollContainerState:g,deviation:I,scrollContainerState:l,footerHeight:u,headerHeight:c,initialItemCount:A,gap:k,restoreStateFrom:N,...d,initialTopMostItemIndex:L,gridState:C,totalListHeight:Q,...f,startReached:K,endReached:U,rangeChanged:W,stateChanged:M,propsReady:h,stateRestoreInProgress:D,...T}},kt(j_,cr,Td,h9,Va,F_,Ua));function I6(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const i=Bw(e,t,n,r[0].index),a=Bw(e,t,n,r[r.length-1].index)+o;return{top:i,bottom:a}}function Bw(e,t,n,r){const o=E9(e.width,n.width,t.column),i=y0(r/o),a=i*n.height+of(0,i-1)*t.row;return a>0?a+t.row:a}function E9(e,t,n){return of(1,y0((e+n)/(y0(t)+n)))}const lye=ut(()=>{const e=fe(u=>`Item ${u}`),t=fe({}),n=fe(null),r=fe("virtuoso-grid-item"),o=fe("virtuoso-grid-list"),i=fe(b9),a=fe("div"),s=fe(Wu),l=(u,c=null)=>rr(re(t,ye(f=>f[u]),Pt()),c);return{context:n,itemContent:e,components:t,computeItemKey:i,itemClassName:r,listClassName:o,headerFooterTag:a,scrollerRef:s,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),uye=ut(([e,t])=>({...e,...t}),kt(sye,lye)),cye=ee.memo(function(){const t=Dt("gridState"),n=Dt("listClassName"),r=Dt("itemClassName"),o=Dt("itemContent"),i=Dt("computeItemKey"),a=Dt("isSeeking"),s=Fo("scrollHeight"),l=Dt("ItemComponent"),u=Dt("ListComponent"),c=Dt("ScrollSeekPlaceholder"),f=Dt("context"),d=Fo("itemDimensions"),h=Fo("gap"),p=Dt("log"),m=Dt("stateRestoreInProgress"),_=Js(b=>{const g=b.parentElement.parentElement.scrollHeight;s(g);const E=b.firstChild;if(E){const{width:T,height:O}=E.getBoundingClientRect();d({width:T,height:O})}h({row:R6("row-gap",getComputedStyle(b).rowGap,p),column:R6("column-gap",getComputedStyle(b).columnGap,p)})});return m?null:ee.createElement(u,{ref:_,className:n,...gr(u,f),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(b=>{const g=i(b.index,b.data,f);return a?ee.createElement(c,{key:g,...gr(c,f),index:b.index,height:t.itemHeight,width:t.itemWidth}):ee.createElement(l,{...gr(l,f),className:r,"data-index":b.index,key:g},o(b.index,b.data,f))}))}),fye=ee.memo(function(){const t=Dt("HeaderComponent"),n=Fo("headerHeight"),r=Dt("headerFooterTag"),o=Js(a=>n(Ma(a,"height"))),i=Dt("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null}),dye=ee.memo(function(){const t=Dt("FooterComponent"),n=Fo("footerHeight"),r=Dt("headerFooterTag"),o=Js(a=>n(Ma(a,"height"))),i=Dt("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null}),hye=({children:e})=>{const t=ee.useContext(w9),n=Fo("itemDimensions"),r=Fo("viewportDimensions"),o=Js(i=>{r(i.getBoundingClientRect())});return ee.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),ee.createElement("div",{style:Fm,ref:o},e)},pye=({children:e})=>{const t=ee.useContext(w9),n=Fo("windowViewportRect"),r=Fo("itemDimensions"),o=Dt("customScrollParent"),i=g9(n,o);return ee.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),ee.createElement("div",{ref:i,style:Fm},e)},mye=ee.memo(function({...t}){const n=Dt("useWindowScroll"),r=Dt("customScrollParent"),o=r||n?gye:yye,i=r||n?pye:hye;return ee.createElement(o,{...t},ee.createElement(i,null,ee.createElement(fye,null),ee.createElement(cye,null),ee.createElement(dye,null)))}),{Component:jye,usePublisher:Fo,useEmitterValue:Dt,useEmitter:C9}=Q7(uye,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},mye),yye=S9({usePublisher:Fo,useEmitterValue:Dt,useEmitter:C9}),gye=_9({usePublisher:Fo,useEmitterValue:Dt,useEmitter:C9});function R6(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Xr.WARN),t==="normal"?0:parseInt(t??"0",10)}function z_({view:e,changingView:t}){const[n,r]=Z(s=>{var l;return[s.events[e]||[],((l=s.eventsNewer[e])==null?void 0:l.length)||0]}),o=P.useRef(Date.now()),i=async()=>{if(o.current>Date.now()-2e3||t===!0)return;o.current=Date.now();const s=Z.getState().nextQuery;s&&s.next&&s.next.reqCount&&s.next.reqCount>2&&Z.getState().events[e]&&Z.getState().events[e].length<10?await Z.getState().getEvents({token:s.token,query:{...s.next,filters:{...s.next.filters,until:Math.round(Date.now()/1e3),since:Math.round(Date.now()/1e3)-30*24*60*60}}},"replace"):await Z.getState().getEvents()};P.useEffect(()=>{Z.getState().nextQuery&&i()},[]);const a=()=>{Z.getState().mergeNewerEvents(e)};return w.jsxs(w.Fragment,{children:[r>0&&w.jsxs(be,{onClick:a,variant:"outline",colorScheme:"blue",size:"sm",mb:2,width:"100%",children:[r," new events"]}),w.jsx(rye,{useWindowScroll:!0,data:n,itemContent:(s,l)=>w.jsx(ve,{mb:2,children:w.jsx(Dm,{data:l,level:0},s)}),endReached:()=>{i()}})]})}function vye({showFollowing:e,showMentions:t,changeFeed:n}){const[r,o]=P.useState([]),[i,a]=P.useState("global"),s=async()=>{const c=await Z.getState().getAllLists();c&&o(c.map(f=>({id:f.id,title:f.title})))},l=()=>{o([])},u=c=>{a(c),n(c)};return P.useEffect(()=>(setTimeout(()=>{s()},100),l),[]),w.jsx(aR,{onChange:u,value:i,children:w.jsxs(fm,{direction:"row",children:[w.jsx(Oc,{value:"global",children:"Global"}),e&&w.jsx(Oc,{value:"following",children:"Following"}),t&&w.jsx(Oc,{value:"mentions",children:"Mentions"}),r&&r.length>0&&r.map(c=>w.jsx(Oc,{value:c.id,children:c.title},c.id))]})})}function sv(e){return new Fa({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT],until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-1728e5)/1e3),limit:e||15})}function jw(e,t){const n=new Fa({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT],authors:e,until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-6048e5)/1e3),limit:t||15});return t&&(n.limit=t),n}function wye(e,t){const n=new Fa({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT],"#t":e,until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-6048e5)/1e3),limit:t||15});return t&&(n.limit=t),n}function bye(e,t){const n=new Fa({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT,ar.REPOST],"#p":e});return t&&(n.limit=t),n}function Sye(){const[e,t,n]=Z(c=>[c.status,c.keypairIsLoaded,c.keypair]),r=P.useRef(!1),o=P.useRef(sv()),[i,a]=P.useState("global"),s=P.useRef(!1),l=async()=>{r.current||(r.current=!0,o.current=sv(),a("global"),await Z.getState().getEvents({token:i,query:{direction:"OLDER",filters:o.current,stickyInterval:!0,isLive:!0}}),r.current=!0)};P.useEffect(()=>(["online","offline"].includes(Z.getState().status)&&l(),()=>{Z.getState().unsubscribeByToken(i)}),[]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&l()},[e]);const u=async c=>{if(s.current=!0,await Z.getState().unsubscribeByToken(i),a(c),c==="global")o.current=sv();else if(c==="following"){const f=await Z.getState().getAllUsersFollowing();f&&(o.current=jw(f==null?void 0:f.map(d=>d.user.pubkey)))}else if(c==="mentions")o.current=bye([n.publicKey]);else{const f=await Z.getState().getList(c);if(f&&f.userPubkeys)o.current=jw(f.userPubkeys);else{console.error("List not found."),s.current=!1;return}}await Z.getState().getEvents({token:c,query:{filters:o.current,stickyInterval:!0,isLive:!0}}),s.current=!1};return w.jsxs(ve,{children:[w.jsx(ve,{p:2,children:w.jsx(vye,{showFollowing:!0,showMentions:t,changeFeed:u})}),w.jsx(z_,{changingView:s.current,view:i})]})}function _ye(){const[e,t]=P.useState([]),[n,r]=P.useState(0),[o,i]=P.useState(!1),[a,s]=P.useState(!1),l=P.useRef(0),u=async()=>{await Z.getState().getPopularUsers().then(h=>{h&&h.length>0?(r(100),clearInterval(l.current),t(h)):n>90?(s(!0),clearInterval(l.current),i(!1)):r(p=>p+5)})},c=async()=>{t([]),r(0),l.current=setInterval(async()=>{await u()},2e3)};P.useEffect(()=>(c(),()=>{l.current&&clearInterval(l.current)}),[]);const f=async()=>{i(!0),await Z.getState().calculatePopular(),await c(),i(!1)},d=w.jsx(w.Fragment,{children:a?w.jsx(me,{fontSize:"sm",mb:2,children:"Looks like there are no events to work with yet. Try again after browsing a little longer."}):w.jsx(w.Fragment,{children:w.jsx(oR,{size:"xs",mb:2,hasStripe:!0,value:n})})});return w.jsxs(ve,{children:[w.jsxs(pt,{spacing:2,mb:4,children:[w.jsx(jo,{as:"h2",size:"md",marginBottom:4,children:"Hot right now"}),w.jsx(qs,{}),!o&&n===100?w.jsx(be,{onClick:f,size:"xs",marginBottom:2,children:"Refresh"}):w.jsx(be,{onClick:c,size:"xs",disabled:!0,marginBottom:2,children:"Calculating ..."})]}),e.length>0?e.map((h,p)=>w.jsx($a,{user:h.user,opts:{showAbout:!1,showBanner:!1,showFollowing:!0,showBlock:!1,relayUrls:[],isBlocked:!1}},p)):d]})}function Eye(){const[e]=Z(t=>[t.connected]);return w.jsxs(Fu,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsxs(ve,{children:[w.jsx(Sye,{}),!e&&w.jsx(ju,{src:Vk})]}),w.jsx(ve,{display:"flex",flexDirection:"column",children:w.jsx(ve,{mt:4,children:w.jsx(_ye,{})})})]})}function Cye(){const[e,t]=Z(f=>[f.keypair.publicKey,f.status]),[n,r]=P.useState([]),[o,i]=P.useState(0),[a,s]=P.useState(!1);P.useEffect(()=>{l();const f=setInterval(l,3e3);return()=>clearInterval(f)},[]),P.useEffect(()=>{a&&setTimeout(()=>{s(!1)},3e3)},[a]);const l=async()=>{await Z.getState().getAllUsersFollowing().then(f=>{f&&f.length>0&&r(f)}),e&&await Z.getState().lastContactsUpdate(e).then(f=>{f&&i(f)})},u=async()=>{s(!0),await Z.getState().subscribe({type:Cd.REQ,filters:new Fa({kinds:[ar.CONTACTS],authors:[e]}),options:{timeoutIn:1e4}})},c=async()=>{s(!0);const f=nae({contacts:n.map(d=>({key:d.user.pubkey,relayUrls:d.relayUrls}))});await Z.getState().signAndSendEvent({event:f})};return w.jsxs(ve,{children:[w.jsx(jo,{size:"lg",children:"Following"}),n.length>0?w.jsxs(w.Fragment,{children:[w.jsx(me,{maxWidth:"800px",children:"You may decide not to publish the people you follow, but you won't be able to access this list from other devices, and it will be lost if you clear your browser data. Note: Load overwrites local data."}),w.jsxs(pt,{mt:2,mb:2,children:[w.jsxs(cd,{children:[w.jsx(be,{onClick:u,isDisabled:!e||t!=="online",isLoading:a,children:"Load"}),w.jsx(be,{onClick:c,isDisabled:!e||t!=="online",isLoading:a,children:"Publish"})]}),w.jsxs(me,{children:["Last published:"," ",o?new Date(o*1e3).toLocaleString():"never"]})]}),n.map(f=>w.jsx(ve,{mb:"3",children:w.jsx($a,{user:f.user,opts:{showFollowing:!0,relayUrls:f.relayUrls}},f.user.pubkey)},f.user.pubkey))]}):w.jsxs(w.Fragment,{children:[w.jsx(me,{children:"Follow users to easily access their content. By default, this list is not public."}),w.jsx(ve,{pb:2,pt:2,children:w.jsx(be,{onClick:u,isDisabled:!e||t!=="online",isLoading:a,children:"Load followers"})}),w.jsx(me,{fontWeight:"bold",children:"You are not following anyone."})]})]})}function xye(){const[e]=Z(m=>[m.status]),t=P.useRef(void 0),n=P.useRef(null),r=P.useRef(null),[o,i]=P.useState(null),[a,s]=P.useState(!1),{npub:l}=t_(),u=`profile-${l}`,c=()=>t.current===l,f=async(m,_=0)=>{s(!0),await Z.getState().getUser(m).then(b=>{b?(i(b),s(!1),r.current&&clearTimeout(r.current)):r.current=setTimeout(async()=>{if(console.log(`Retrying to load user ${m} ...`),_===2)await Z.getState().requestInformation({idsOrKeys:[m],source:"users"},{timeoutIn:1e4});else if(_>20){s(!1),r.current&&clearTimeout(r.current);return}await f(m,_+1)},1e3)})},d=async m=>{await Z.getState().count(m)},h=async()=>{if(l)try{const m=Ts(l);let _;for(const b of m.tlvItems)if(b.type===0){_=b.value;break}if(!_)return;n.current=_,i(null),await f(_),await d(_)}catch(m){console.log(m);return}},p=async m=>{t.current=l,await Z.getState().getEvents({token:u,query:{direction:"OLDER",filters:jw([m]),stickyInterval:!0,isLive:!0}})};return P.useEffect(()=>()=>{r.current&&clearTimeout(r.current),Z.getState().unsubscribeByToken(u)},[]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&h()},[e,l]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&n.current&&!c()&&p(n.current)},[e,n.current]),w.jsxs(Fu,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsxs(ve,{children:[w.jsxs(ve,{mb:4,children:[a&&w.jsx(w_,{text:"Just a sec ... Searching the Matrix for the user."}),o&&w.jsx($a,{user:o.user,opts:{showAbout:!0,showBanner:!0,showFollowing:!0,relayUrls:o.relayUrls,showBlock:!0}})]}),w.jsx(z_,{view:u})]}),w.jsx(ve,{display:"flex",flexDirection:"column"})]})}function Oye({props:e}){const[t,n]=P.useState({name:"",display_name:"",picture:"",banner:"",nip05:"",website:"",about:"",image:"",lud16:"",lud06:""}),[r,o]=P.useState(""),[i,a]=P.useState(!1),s=P.useRef(!1),l=Vi(),{isOpen:u,onOpen:c,onClose:f}=Wn(),[d,h]=P.useState([]),p=d.filter(E=>E.isAssigned).length,m=(E,T)=>{h(d.map(O=>O.data.url===E?{...O,isAssigned:T==="add"}:O))};P.useEffect(()=>{e.metadata&&!s.current&&n(Object.assign(t,e.metadata))},[e.metadata]),P.useEffect(()=>{Z.getState().getRelays().then(E=>{E&&h(E.map(T=>T.isReady&&T.write?{data:T,isAssigned:!0}:{data:T,isAssigned:!1}))})},[]);const _=E=>{l({title:"Error",description:E,status:"error",duration:5e3,isClosable:!0})},b=async()=>{a(!0);const E=d.map(A=>A.data.url);if(E.length===0){_("Select at least one relay"),a(!1);return}const T={};for(const[A,C]of Object.entries(t))C&&C!==""&&(T[A]=C);const O=Zie({userMetadata:T,mastodonUrl:r});if(Object.keys(T).length===0){l({title:"No changes",description:"No changes to update.",status:"info",duration:5e3,isClosable:!0}),a(!1);return}try{await Z.getState().signAndSendEvent({event:O,relayUrls:E}),a(!1),await Z.getState().subscribe({type:Cd.REQ,filters:new Fa({authors:[e.pubkey],kinds:[ar.METADATA]}),options:{timeoutIn:1e4,view:"user-profile"}})}catch(A){console.error(A),a(!1)}},g=E=>{const{name:T,value:O}=E.target;n(A=>({...A,[T]:O})),s.current=!0};return w.jsxs(ve,{marginBottom:10,children:[w.jsxs(Jn,{id:"name",mb:4,children:[w.jsx(In,{children:"Name"}),w.jsx(Ht,{name:"name",value:t.name,onChange:g})]}),w.jsxs(Jn,{id:"display_name",mb:4,children:[w.jsx(In,{children:"Display Name"}),w.jsx(Ht,{name:"display_name",value:t.display_name||"",onChange:g})]}),w.jsxs(Jn,{id:"website",mb:4,children:[w.jsx(In,{children:"Website"}),w.jsx(Ht,{name:"website",value:t.website||"",onChange:g})]}),w.jsxs(Jn,{id:"about",mb:4,children:[w.jsx(In,{children:"About"}),w.jsx(QS,{name:"about",value:t.about||"",onChange:g})]}),w.jsxs(Jn,{id:"picture",mb:4,children:[w.jsx(In,{children:"Picture URL"}),w.jsx(Ht,{name:"picture",value:t.picture||"",onChange:g}),w.jsx(rs,{children:"URL for your profile picture."})]}),w.jsxs(Jn,{id:"banner",mb:4,children:[w.jsx(In,{children:"Banner URL"}),w.jsx(Ht,{name:"banner",value:t.banner||"",onChange:g}),w.jsx(rs,{children:"URL for your profile banner."})]}),w.jsxs(Jn,{id:"image",mb:4,children:[w.jsx(In,{children:"Image URL"}),w.jsx(Ht,{name:"image",value:t.image||"",onChange:g}),w.jsx(rs,{children:"URL for an additional image."})]}),w.jsxs(Jn,{id:"nip05",mb:4,children:[w.jsx(In,{children:"NIP05"}),w.jsx(Ht,{name:"nip05",value:t.nip05||"",onChange:g}),w.jsx(rs,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),w.jsxs(Jn,{id:"lud16",mb:4,children:[w.jsx(In,{children:"LUD16"}),w.jsx(Ht,{name:"lud16",value:t.lud16||"",onChange:g}),w.jsx(rs,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),w.jsxs(Jn,{id:"lud06",mb:4,children:[w.jsx(In,{children:"LUD06"}),w.jsx(Ht,{name:"lud06",value:t.lud06||"",onChange:g}),w.jsx(rs,{children:"bech32 encoded lnurl"})]}),w.jsxs(Jn,{id:"mastodonUrl",mb:4,children:[w.jsx(In,{children:"Mastodon URL"}),w.jsx(Ht,{name:"mastodonUrl",value:r,onChange:E=>o(E.target.value)})]}),u&&w.jsx(Fk,{relays:d,onChange:m}),w.jsxs(cd,{children:[w.jsx(be,{colorScheme:"blue",type:"submit",isLoading:i,onClick:b,children:"Send update"}),w.jsxs(be,{variant:"outline",onClick:u?f:c,children:["Select relays (",p,")"]}),w.jsx(be,{isDisabled:!s.current||p===0,onClick:()=>s.current=!1,children:"Reset"})]})]})}function Aye(){const[e,t]=Z(u=>{var c;return[((c=u.keypair)==null?void 0:c.publicKey)||"",u.connected]}),[n,r]=P.useState(null),[o,i]=P.useState([]),a=Vi(),s=async()=>{if(!e||e==="")return;const u=await Z.getState().getUser(e);u&&(r(u.user),i(u.relayUrls))},l=async()=>{if(!e||e===""){a({title:"Not found",description:"No user data found yet. Did you publish your profile to one of the connected relays?",status:"error",duration:5e3,isClosable:!0});return}await Z.getState().subscribe({type:Cd.REQ,filters:new Fa({authors:[e],kinds:[ar.METADATA]}),options:{timeoutIn:1e4,view:"user-profile"}}),a({title:"Refreshing ...",description:"Requesting information from the network.",status:"info",duration:5e3,isClosable:!0})};return P.useEffect(()=>{const u=setInterval(()=>{s()},1e3);return()=>{clearInterval(u)}},[]),w.jsxs(ve,{children:[n?w.jsx($a,{user:n,opts:{relayUrls:o}}):w.jsxs(w.Fragment,{children:[w.jsx(me,{children:'"No user data found yet. Did you publish your profile to one of the connected relays?".'}),t&&w.jsx(be,{onClick:l,children:"Try again"})]}),w.jsx(jo,{as:"h2",size:"lg",mb:4,mt:4,children:"Update your profile"}),w.jsx(Oye,{props:{pubkey:e,metadata:n==null?void 0:n.data}})]})}function Pye(){const[e,t]=P.useState([]),n=async()=>{await Z.getState().getAllUsersBlocked().then(r=>{r&&t(r)})};return P.useEffect(()=>{n();const r=setInterval(n,2e3);return()=>clearInterval(r)},[]),w.jsxs(ve,{children:[w.jsx(jo,{size:"lg",children:"Blocked"}),e.length>0?w.jsx(w.Fragment,{children:e.map(r=>w.jsx(ve,{mb:"3",children:w.jsx($a,{user:r.user,opts:{showFollowing:!1,showBlock:!0,relayUrls:r.relayUrls,isBlocked:!0}},r.user.pubkey)},r.user.pubkey))}):w.jsxs(w.Fragment,{children:[w.jsx(me,{children:"Block users to ignore their events. The information is stored in your browser and not shared with relays."}),w.jsx(me,{fontWeight:"bold",children:"You have not blocked anyone."})]})]})}function Tye({user:e,opts:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o,title:i,reaction:a,avatarSize:s}}){const l=e.data&&e.data.picture?e.data.picture:"";return w.jsx(w.Fragment,{children:w.jsxs(KS,{children:[w.jsx(GS,{children:a?w.jsxs(ve,{position:"relative",children:[w.jsx(r1,{size:s,src:l}),w.jsx(ve,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(255, 255, 255, 0.5)",borderRadius:10}),w.jsx(me,{position:"absolute",right:"0",bottom:"0",backgroundColor:"white",height:15,width:15,textAlign:"center",borderRadius:10,fontSize:12,children:a})]}):w.jsx(r1,{size:s,src:l})}),w.jsxs(ZS,{children:[w.jsx(XS,{}),w.jsx(YS,{}),w.jsx(nR,{children:i}),w.jsx(qS,{children:w.jsx($a,{user:e,opts:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o,title:i,reaction:a,avatarSize:s}})})]})]})})}function Iye(){const[e,t]=P.useState([]),[n,r]=P.useState(null),[o,i]=P.useState(""),[a,s]=P.useState(!1),{isOpen:l,onOpen:u,onClose:c}=Wn(),f=async()=>{await Z.getState().getAllLists().then(g=>{g&&t(g)})};P.useEffect(()=>{f();const g=setInterval(f,2e3);return()=>clearInterval(g)},[]);const d=async()=>{s(!0),await Z.getState().createList({title:o}),i(""),s(!1)},h=async g=>{s(!0),await Z.getState().deleteList(g),s(!1),await f()},p=async g=>{n&&(s(!0),await Z.getState().removeUserFromList(n.id,g),await f(),n.users&&r({...n,users:n.users.filter(E=>E.user.pubkey!==g)}),s(!1))},m=g=>w.jsx(ve,{children:(g==null?void 0:g.users)&&g.users.map(E=>w.jsx(Tye,{user:E.user,opts:{avatarSize:"sm",relayUrls:E.relayUrls}},E.user.pubkey))}),_=w.jsxs($r,{isOpen:l,onClose:c,size:"xl",children:[w.jsx(Vr,{}),w.jsxs(zr,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ur,{children:"List"}),w.jsx(Wr,{}),w.jsx(Hr,{overflowY:"auto",children:(n==null?void 0:n.users)&&n.users.map(g=>w.jsx(ve,{p:1,children:w.jsxs(pt,{children:[w.jsx($a,{user:g.user,opts:{avatarSize:"sm",relayUrls:g.relayUrls}},g.user.pubkey),w.jsx(qs,{}),w.jsx(be,{size:"sm",onClick:()=>p(g.user.pubkey),isLoading:a,children:"Remove"})]})},g.user.pubkey))})]})]}),b=g=>w.jsxs(ka,{children:[w.jsx(Nt,{children:g.title}),w.jsx(Nt,{children:m(g)}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(g),u()},children:"Edit"})}),w.jsx(Nt,{children:w.jsx(be,{size:"sm",onClick:()=>h(g.id),isLoading:a,children:"Delete"})})]},g.id);return w.jsxs(ve,{children:[w.jsx(jo,{size:"lg",children:"Lists"}),w.jsx(me,{children:"Lists make it easy to organize users."}),w.jsx(ve,{mt:2,mb:2,children:w.jsxs(pt,{children:[w.jsx(Ht,{value:o,onChange:g=>i(g.target.value),placeholder:"Friends"}),w.jsx(be,{size:"sm",onClick:d,isLoading:a,children:"Create list"})]})}),w.jsxs(bd,{variant:"simple",marginBottom:4,children:[w.jsx(pm,{children:w.jsxs(ka,{children:[w.jsx(Bt,{children:"Title"}),w.jsx(Bt,{children:"Users"}),w.jsx(Bt,{}),w.jsx(Bt,{})]})}),w.jsx(mm,{children:e.map(g=>b(g))})]}),_]})}function Rye(){const[e]=Z(d=>[d.connected]),t=P.useRef(!1),n=P.useRef(""),r=P.useRef([]),o=P.useRef(null),[i,a]=P.useState(!1),{note:s}=t_(),l=`event-${s}`,[u]=Z(d=>[d.events[l]?d.events[l][0]:null]),c=async(d=0)=>{await Z.getState().getEvent(n.current,{view:l,retryCount:d,relayUrls:r.current}).then(h=>{h||(console.log("Could not get event. Retrying..."),o.current=setTimeout(async()=>{if(d>20){a(!0),o.current&&clearTimeout(o.current);return}await c(d+1)},1e3))})},f=async d=>{if(!(!Z.getState().connected||t.current)){t.current=!0;try{const h=Ts(d);for(const p of h.tlvItems)if(p.type===0){n.current=p.value;break}else p.type===1&&r.current.push(p.value)}catch(h){console.log(h);return}await c()}};return P.useEffect(()=>(s&&f(s),()=>{o.current&&clearTimeout(o.current),Z.getState().unsubscribeByToken(l)}),[]),P.useEffect(()=>{e&&s&&f(s)},[e]),w.jsxs(Fu,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsx(ve,{children:u?w.jsx(ve,{mb:4,children:w.jsx(Dm,{data:u,level:0})}):w.jsx(w.Fragment,{children:i?w.jsx(jo,{as:"h2",size:"md",marginBottom:4,children:"It looks like the event is not available on any of the connected relays."}):w.jsx(w_,{text:"Just a sec ... Searching the Matrix for the event."})})}),w.jsx(ve,{display:"flex",flexDirection:"column"})]})}function kye(){const[e]=Z(s=>[s.status]),t=P.useRef(void 0),n=P.useRef(null),{tag:r}=t_(),o=`view-${r}`,i=()=>t.current===r,a=async s=>{t.current=r,await Z.getState().getEvents({token:o,query:{direction:"OLDER",filters:wye([s]),stickyInterval:!0,isLive:!0}})};return P.useEffect(()=>()=>{n.current&&clearTimeout(n.current),Z.getState().unsubscribeByToken(o)},[]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&r&&!i()&&a(r)},[e,r]),w.jsxs(Fu,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsx(ve,{children:w.jsx(z_,{view:o})}),w.jsx(ve,{display:"flex",flexDirection:"column"})]})}const Mye={initialColorMode:"dark",useSystemColorMode:!0},k6=lW({config:Mye,breakpoints:{sm:"500px"}}),Dye=async()=>{await Z.getState().init({maxEvents:bk})};Dye();K2.createRoot(document.getElementById("root")).render(w.jsxs(ee.StrictMode,{children:[w.jsx(pB,{initialColorMode:k6.config.initialColorMode}),w.jsx(AY,{theme:k6,children:w.jsx(Mre,{basename:"/nostr-ts/",children:w.jsx(Are,{children:w.jsxs(Po,{element:w.jsx(Kfe,{}),children:[w.jsx(Po,{path:"/",element:w.jsx(Eye,{})}),w.jsx(Po,{path:"/account",element:w.jsx(Hue,{})}),w.jsx(Po,{path:"/profile",element:w.jsx(Aye,{})}),w.jsx(Po,{path:"/following",element:w.jsx(Cye,{})}),w.jsx(Po,{path:"/blocked",element:w.jsx(Pye,{})}),w.jsx(Po,{path:"/lists",element:w.jsx(Iye,{})}),w.jsx(Po,{path:"/p/:npub",element:w.jsx(xye,{})}),w.jsx(Po,{path:"/e/:note",element:w.jsx(Rye,{})}),w.jsx(Po,{path:"/t/:tag",element:w.jsx(kye,{})})]})})})})]})); + */var Dce={L:Ic.QrCode.Ecc.LOW,M:Ic.QrCode.Ecc.MEDIUM,Q:Ic.QrCode.Ecc.QUARTILE,H:Ic.QrCode.Ecc.HIGH},Lce=128,Nce="L",Bce="#FFFFFF",jce="#000000",Fce=!1,Jk=4,$ce=.1;function zce(e,t=0){const n=[];return e.forEach(function(r,o){let i=null;r.forEach(function(a,s){if(!a&&i!==null){n.push(`M${i+t} ${o+t}h${s-i}v1H${i+t}z`),i=null;return}if(s===r.length-1){if(!a)return;i===null?n.push(`M${s+t},${o+t} h1v1H${s+t}z`):n.push(`M${i+t},${o+t} h${s+1-i}v1H${i+t}z`);return}a&&i===null&&(i=s)})}),n.join("")}function Vce(e,t){return e.slice().map((n,r)=>r=t.y+t.h?n:n.map((o,i)=>i=t.x+t.w?o:!1))}function Uce(e,t,n,r){if(r==null)return null;const o=n?Jk:0,i=e.length+o*2,a=Math.floor(t*$ce),s=i/t,l=(r.width||a)*s,u=(r.height||a)*s,c=r.x==null?e.length/2-l/2:r.x*s,f=r.y==null?e.length/2-u/2:r.y*s;let d=null;if(r.excavate){let h=Math.floor(c),p=Math.floor(f),m=Math.ceil(l+c-h),S=Math.ceil(u+f-p);d={x:h,y:p,w:m,h:S}}return{x:c,y:f,h:u,w:l,excavation:d}}(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})();function e7(e){const t=e,{value:n,size:r=Lce,level:o=Nce,bgColor:i=Bce,fgColor:a=jce,includeMargin:s=Fce,imageSettings:l}=t,u=Mce(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Ic.QrCode.encodeText(n,Dce[o]).getModules();const f=s?Jk:0,d=c.length+f*2,h=Uce(c,r,s,l);let p=null;l!=null&&h!=null&&(h.excavation!=null&&(c=Vce(c,h.excavation)),p=ee.createElement("image",{xlinkHref:l.src,height:h.h,width:h.w,x:h.x+f,y:h.y+f,preserveAspectRatio:"none"}));const m=zce(c,f);return ee.createElement("svg",kce({height:r,width:r,viewBox:`0 0 ${d} ${d}`},u),ee.createElement("path",{fill:i,d:`M0,0 h${d}v${d}H0z`,shapeRendering:"crispEdges"}),ee.createElement("path",{fill:a,d:m,shapeRendering:"crispEdges"}),p)}function Hce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var N1=Hce(P),Wce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},s8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Gce(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return N1.createElement("svg",Wce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),N1.createElement("path",{d:"M3,11H5V13H3V11M11,5H13V9H11V5M9,11H13V15H11V13H9V11M15,11H17V13H19V11H21V13H19V15H21V19H19V21H17V19H13V21H11V17H15V15H17V13H15V11M19,19V15H17V19H19M15,3H21V9H15V3M17,5V7H19V5H17M3,3H9V9H3V3M5,5V7H7V5H5M3,15H9V21H3V15M5,17V19H7V17H5Z"}))},Kce=N1.memo?N1.memo(s8):s8,Xce=Kce;const qce=Fe(Xce),Yce=[{kind:Mi.PublicKeys,label:"Public Key"},{kind:Mi.PrivateKeys,label:"Private Key"},{kind:Mi.Profile,label:"Profile"}];function Cw({kind:e,value:t,size:n}){var u;const{isOpen:r,onOpen:o,onClose:i}=jn(),a=((u=Yce.find(c=>c.kind===e))==null?void 0:u.label)||"Unknown",l=S_(e,[{type:0,value:t}]);return w.jsxs(w.Fragment,{children:[w.jsx(dd,{icon:w.jsx(Ne,{as:qce}),onClick:r?i:o,"aria-label":"QR",size:n||"md"}),w.jsxs(xr,{isOpen:r,onClose:i,children:[w.jsx(Pr,{}),w.jsxs(Or,{width:380,children:[w.jsx(Ar,{children:a}),w.jsx(Ir,{}),w.jsxs(Tr,{children:[w.jsx(e7,{value:l,size:330}),w.jsx(Lt,{value:l,mt:2,isReadOnly:!0})]})]})]})]})}function Zce(){const[e,t,n,r,o]=Z(v=>{var x,I;return[v.keystore,v.keypairIsLoaded,v.keypair,((x=v==null?void 0:v.keypair)==null?void 0:x.publicKey)||"",((I=v==null?void 0:v.keypair)==null?void 0:I.privateKey)||""]}),[i,a]=P.useState(!1),[s,l]=P.useState(!1),[u,c]=P.useState(""),[f,d]=P.useState(""),[h,p]=P.useState(!1);P.useEffect(()=>{c(r)},[r]),P.useEffect(()=>{d(o)},[o]),P.useEffect(()=>{e==="nos2x"&&l(!1)},[e]);const m=s||r!=="",S=(s||e==="localstore")&&e!=="nos2x",b=Ho(),[g,E]=P.useState(!1),T=()=>{const v=Kie();Z.getState().setKeyStore({keystore:"localstore",publicKey:v.publicKey,privateKey:v.privateKey})},O=async v=>{if(E(!0),window.nostr)try{const x=await window.nostr.getPublicKey();Z.getState().setKeyStore({keystore:"nos2x",publicKey:x,privateKey:""}),E(!1)}catch(x){console.error("Error loading public key:",x),E(!1)}else{console.log(`Nostr extention not ready, retry ${v}`);const x=v?v+1:1;if(x>2){b({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),E(!1);return}setTimeout(()=>O(x),1e3)}},A=v=>{const x=mie(v);let I,R;if(x){const M=v.split(":");if(R=Rs(M[1]),I=R.prefix,!R){b({title:"Invalid QR code",description:"QR code is not a valid nostr url.",status:"error",duration:5e3,isClosable:!0});return}}if(v.startsWith("npub")?(I="npub",R=Rs(v)):v.startsWith("nsec")&&(I="nsec",R=Rs(v)),I!=="npub"&&I!=="nsec"||!R){b({title:"Invalid QR code",description:"QR code is not a valid public or private key.",status:"error",duration:5e3,isClosable:!0});return}let k;for(const M of R.tlvItems)M.type===0&&(k=M.value);if(!k){b({title:"Invalid QR code",description:"QR code is not a valid public or private key.",status:"error",duration:5e3,isClosable:!0});return}if(I==="npub")c(k),Z.getState().setKeyStore({keystore:"localstore",publicKey:k,privateKey:""}),b({title:"Public key loaded",description:"Public key loaded from QR code.",status:"success",duration:5e3,isClosable:!0});else if(I==="nsec"){if(console.log("Setting private key from QR code",k),f===k)return;d(k);const M=Xie(k);Z.getState().setKeyStore({keystore:"localstore",publicKey:M,privateKey:k}),b({title:"Keys loaded",description:"Private and public key loaded from QR code.",status:"success",duration:5e3,isClosable:!0})}else console.log("Invalid prefix",I);p(!1)},C=()=>{if(u.length!==64){b({title:"Invalid public key",description:"Public key must be 64 characters long.",status:"error",duration:5e3,isClosable:!0});return}if(f!==""&&f.length!==64){b({title:"Invalid private key",description:"Private key must be 64 characters long.",status:"error",duration:5e3,isClosable:!0});return}u&&f&&(Z.getState().setKeyStore({keystore:"localstore",publicKey:u,privateKey:f}),l(!1))},y=()=>{Z.getState().resetKeyStore(),d(""),c(""),l(!1)},_=()=>{p(!h)};return w.jsxs(ve,{children:[w.jsx(Fo,{size:"lg",children:"Account"}),t?w.jsxs(pe,{fontWeight:"bold",children:["Keypair loaded from ",e,"."]}):w.jsxs(w.Fragment,{children:[w.jsx(pe,{fontWeight:"bold",marginBottom:2,children:"Keypair is not loaded."}),w.jsx(pe,{marginBottom:2,children:"To post to Nostr, and respond to other users, you need to authenticate yourself."})]}),h&&w.jsxs(w.Fragment,{children:[w.jsxs(ve,{marginBottom:2,children:[w.jsx(pe,{marginBottom:2,children:"To post, scan your private key. Otherwise the public key is enough."}),w.jsx(be,{onClick:_,children:"Close QR Reader"})]}),w.jsx(Ew,{onResult:(v,x)=>{v&&A(v.toString()),x&&console.info(x)},constraints:{facingMode:"environment"}})]}),w.jsx(ft,{marginTop:4,children:!h&&(!e||e==="none")?w.jsxs(Aa,{children:[w.jsx(be,{leftIcon:w.jsx(Ne,{as:dce}),onClick:T,width:"100%",children:"New Account"}),w.jsx(pe,{children:"Have an account?"}),w.jsx(be,{leftIcon:w.jsx(Ne,{as:Cce}),onClick:()=>l(!0),width:"100%",children:"Enter Keypair"}),w.jsx(be,{leftIcon:w.jsx(Ne,{as:vce}),onClick:_,width:"100%",children:"Scan QR"}),w.jsx(be,{leftIcon:w.jsx(Ne,{as:Ice}),isLoading:g,onClick:()=>O(),width:"100%",children:"From Extention"})]}):w.jsx(be,{onClick:y,children:"Reset"})}),n&&w.jsxs(ve,{mt:4,children:[m&&w.jsx(w.Fragment,{children:w.jsxs(Jn,{marginBottom:4,children:[w.jsx(In,{children:"Public key:"}),w.jsxs(ft,{spacing:2,children:[w.jsx(Lt,{type:"text",value:u,onChange:v=>c(v.target.value),isReadOnly:!0}),w.jsx(Cw,{kind:Mi.PublicKeys,value:u})]})]})}),S&&w.jsxs(Jn,{marginBottom:4,children:[w.jsx(In,{children:"Private key:"}),w.jsxs(ft,{spacing:2,children:[w.jsx(Lt,{type:i?"text":"password",value:f,onChange:v=>d(v.target.value),isReadOnly:!s}),w.jsx(be,{onClick:()=>a(!i),children:i?"Hide":"Show"}),w.jsx(Cw,{kind:Mi.PrivateKeys,value:f})]})]}),s&&w.jsx(be,{onClick:()=>C(),children:"Save"})]})]})}function Qce(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var B1=Qce(P),Jce=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},l8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=efe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return B1.createElement("svg",Jce({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),B1.createElement("path",{d:"M2,21L23,12L2,3V10L17,12L2,14V21Z"}))},tfe=B1.memo?B1.memo(l8):l8,nfe=tfe;const rfe=Fe(nfe);function ofe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var j1=ofe(P),ife=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},u8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=afe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return j1.createElement("svg",ife({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),j1.createElement("path",{d:"M4,9H20V11H4V9M4,13H14V15H4V13Z"}))},sfe=j1.memo?j1.memo(u8):u8,lfe=sfe;const ufe=Fe(lfe);function cfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var F1=cfe(P),ffe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},c8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=dfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return F1.createElement("svg",ffe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),F1.createElement("path",{d:"M4,5H20V7H4V5M4,9H20V11H4V9M4,13H20V15H4V13M4,17H14V19H4V17Z"}))},hfe=F1.memo?F1.memo(c8):c8,pfe=hfe;const mfe=Fe(pfe);function yfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var $1=yfe(P),gfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},f8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=vfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return $1.createElement("svg",gfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),$1.createElement("path",{d:"M10,9V5L3,12L10,19V14.9C15,14.9 18.5,16.5 21,20C20,15 17,10 10,9Z"}))},wfe=$1.memo?$1.memo(f8):f8,bfe=wfe;const t7=Fe(bfe);function Sfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var z1=Sfe(P),_fe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},d8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Efe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return z1.createElement("svg",_fe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),z1.createElement("path",{d:"M12,6C8.6,6 5.5,7.1 3,9L1.2,6.6C4.2,4.3 8,3 12,3C16,3 19.8,4.3 22.8,6.6L21,9C18.5,7.1 15.4,6 12,6M13,19C13,17.7 13.4,16.4 14.2,15.4C13.5,15.2 12.8,15 12,15C10.7,15 9.4,15.5 8.4,16.2L12,21L13,19.6C13,19.4 13,19.2 13,19M16.8,13.4C17.1,13.3 17.5,13.2 17.9,13.1L19.2,11.4C17.2,9.9 14.7,9 12,9C9.3,9 6.8,9.9 4.8,11.4L6.6,13.8C8.1,12.7 10,12 12,12C13.8,12 15.4,12.5 16.8,13.4M16.5,22.6L17.2,19.8L15,17.9L17.9,17.7L19,15L20.1,17.6L23,17.8L20.8,19.7L21.5,22.5L19,21.1L16.5,22.6Z"}))},Cfe=z1.memo?z1.memo(d8):d8,xfe=Cfe;const Ofe=Fe(xfe);function Afe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var V1=Afe(P),Pfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},h8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Tfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return V1.createElement("svg",Pfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),V1.createElement("path",{d:"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z"}))},Ife=V1.memo?V1.memo(h8):h8,Rfe=Ife;const n7=Fe(Rfe);function Va(e,t){return e.length<=t?e:e?e.substring(0,t)+"...":"..."}function kfe(e,t,n,r){switch(e){case"NewShortTextNote":return{event:cae({text:t})};case"NewLongFormContent":return{event:fae({text:t})};case"NewShortTextNoteResponse":return r.inResponseTo?{event:dae({text:t,inResponseTo:r.inResponseTo})}:{error:"Response requires inResponseTo"};case"NewRecommendRelay":return{event:mae({relayUrl:n})};case"NewQuoteRepost":return r.inResponseTo?{event:Sk({inResponseTo:r.inResponseTo,relayUrl:n})}:{error:"Quote repost requires inResponseTo"};default:return{error:"Invalid event type"}}}function Mfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var U1=Mfe(P),Dfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},p8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Lfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return U1.createElement("svg",Dfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),U1.createElement("path",{d:"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}))},Nfe=U1.memo?U1.memo(p8):p8,Bfe=Nfe;const ef=Fe(Bfe);function jfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var H1=jfe(P),Ffe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},m8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=$fe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return H1.createElement("svg",Ffe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),H1.createElement("path",{d:"M12 5C15.87 5 19 8.13 19 12C19 15.87 15.87 19 12 19C8.13 19 5 15.87 5 12C5 8.13 8.13 5 12 5M12 2C17.5 2 22 6.5 22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2M12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12C20 7.58 16.42 4 12 4Z"}))},zfe=H1.memo?H1.memo(m8):m8,Vfe=zfe;const r7=Fe(Vfe);function Ufe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var W1=Ufe(P),Hfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},y8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Wfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return W1.createElement("svg",Hfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),W1.createElement("path",{d:"M23,18V17.5A2.5,2.5 0 0,0 20.5,15A2.5,2.5 0 0,0 18,17.5V18A1,1 0 0,0 17,19V23A1,1 0 0,0 18,24H23A1,1 0 0,0 24,23V19A1,1 0 0,0 23,18M22,18H19V17.5A1.5,1.5 0 0,1 20.5,16A1.5,1.5 0 0,1 22,17.5V18M23,12L2,21V14L17,12L2,10V3L23,12Z"}))},Gfe=W1.memo?W1.memo(y8):y8,Kfe=Gfe;const Xfe=Fe(Kfe);function qfe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var G1=qfe(P),Yfe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},g8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Zfe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return G1.createElement("svg",Yfe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),G1.createElement("path",{d:"M2 3V10L17 12L2 14V21L23 12M22 15.5L18.5 19L16.5 17L15 18.5L18.5 22L23.5 17Z"}))},Qfe=G1.memo?G1.memo(g8):g8,Jfe=Qfe;const ede=Fe(Jfe);function o7({relays:e,onChange:t}){const n=(r,o)=>{t(r,o?"remove":"add")};return w.jsx(ve,{p:2,children:e.length===0?w.jsx(pe,{children:"No relays found."}):e.map(r=>w.jsxs(ft,{mb:1,children:[w.jsx(Ne,{as:r.data.isReady?r7:ef,color:r.data.isReady?"green.500":"red.500"}),w.jsx(pe,{children:r.data.url}),w.jsx(Zs,{}),w.jsx(Ne,{as:r.data.write?ede:Xfe,color:r.data.write?"green.500":"red.500"}),w.jsx(QI,{isChecked:r.isAssigned,onChange:()=>n(r.data.url,r.isAssigned),isDisabled:r.data.write===!1})]},r.data.url))})}const i7=e=>{const[t,n]=Z(I=>[I.connected&&I.keystore!=="none",I.keypairIsLoaded]),[r,o]=P.useState(!1),[i,a]=P.useState([]),[s,l]=Z(I=>[I.keystore,I.keypair]),u=t||n?void 0:"Login and connect to send events.",[c,f]=P.useState(e.kind||"NewShortTextNote"),[d,h]=P.useState(""),p=[{label:"NewShortTextNote",icon:w.jsx(Ne,{as:ufe}),disabled:e.isResponse||!1},{label:"NewLongFormContent",icon:w.jsx(Ne,{as:mfe}),disabled:e.isResponse||!1},{label:"NewShortTextNoteResponse",icon:w.jsx(Ne,{as:t7}),disabled:c!=="NewShortTextNoteResponse"},{label:"NewRecommendRelay",icon:w.jsx(Ne,{as:Ofe}),disabled:e.isResponse||!1},{label:"NewQuoteRepost",icon:w.jsx(Ne,{as:n7}),disabled:c!=="NewQuoteRepost"}],m=Ho(),{isOpen:S,onOpen:b,onClose:g}=jn(),[E,T]=P.useState([]),O=E.filter(I=>I.isAssigned).length,A=(I,R)=>{T(E.map(k=>k.data.url===I?{...k,isAssigned:R==="add"}:k))};P.useEffect(()=>{const I=e.relayUrls?e.relayUrls:void 0,R=I&&I.length>0?I[0]:"";Z.getState().getRelays().then(k=>{k&&T(k.map(M=>R===M.url&&M.write||M.isReady&&M.write?{data:M,isAssigned:!0}:{data:M,isAssigned:!1}))})},[]);const C=I=>{if(I.content==="")return{error:"Event content is required"};if(s&&s==="none")return{error:"Keystore is required"};if(!l)return{error:"Keypair is required"}},y=()=>{h(""),f("NewShortTextNote"),a([])},_=I=>{a([I]),m({title:"Error",description:I,status:"error",duration:5e3,isClosable:!0})},v=I=>{m({title:"Success",description:I,status:"success",duration:5e3,isClosable:!0})},x=async()=>{o(!0),a([]);const I=E.map(N=>N.data.url);if(I.length===0){_("Select at least one relay"),o(!1);return}const R=kfe(c,d,I[0],e);if(R.error){_(R.error),o(!1);return}const k=R.event,M=C(k);if(M!=null&&M.error){_(M.error),o(!1);return}try{const N=await Z.getState().signAndSendEvent({event:k,relayUrls:I});N&&(v(`Event sent: ${Va(k.content,20)}`),y(),o(!1),e.sendCallback&&e.sendCallback(N))}catch(N){let D="";N instanceof Error?D=N.message:D=N?N.toString():"Unknown error",_(D),o(!1);return}};return w.jsxs(ve,{width:"100%",children:[w.jsxs(Jn,{marginBottom:4,children:[w.jsx(In,{children:"Content"}),w.jsx(Lt,{type:"text",as:c==="NewLongFormContent"?s_:Lt,value:d,onChange:I=>h(I.target.value),placeholder:"Enter event content"})]}),w.jsx(ft,{marginBottom:4,children:p.map(I=>w.jsx(dd,{variant:"outline","aria-label":I.label,icon:I.icon,onClick:()=>f(I.label),isActive:c===I.label,isDisabled:I.disabled},I.label))}),i.map((I,R)=>w.jsx(ve,{color:"red.500",children:I},R)),u&&w.jsx(ve,{color:"red.500",paddingBottom:2,children:u}),S&&w.jsx(o7,{relays:E,onChange:A}),w.jsxs(fd,{children:[w.jsx(be,{type:"submit",variant:"solid",onClick:x,leftIcon:w.jsx(Ne,{as:rfe}),isDisabled:!t||O===0,isLoading:r,children:"Send"}),w.jsxs(be,{variant:"outline",onClick:S?g:b,children:["Select relays (",O,")"]})]})]})};function v8(e){const{isOpen:t,onOpen:n,onClose:r}=jn(),o=()=>{r()};return w.jsxs(w.Fragment,{children:[w.jsx(be,{size:(e==null?void 0:e.buttonSize)||"md",onClick:n,children:"Post message"}),w.jsxs(xr,{isOpen:t,onClose:r,children:[w.jsx(Pr,{}),w.jsxs(Or,{children:[w.jsx(Ar,{children:"Broadcast to the Network"}),w.jsx(Ir,{}),w.jsx(Tr,{children:w.jsx(i7,{sendCallback:o})}),w.jsx(wd,{children:w.jsx(be,{colorScheme:"blue",mr:3,onClick:r,children:"Close"})})]})]})]})}const tde=Object.keys(ar).map(e=>({name:e,value:ar[e]})),nde=e=>{const t=tde.find(n=>n.value===e);return t?t.name:"Unknown"},rde=e=>e.map(nde).join(", ");function ode(){const[e,t]=P.useState([]),[n,r]=P.useState(null),{isOpen:o,onOpen:i,onClose:a}=jn(),s=async()=>{const c=await Z.getState().getSubscriptions();c&&t(c)};P.useEffect(()=>{(async()=>{await s()})();const f=setInterval(s,3e3);return()=>clearInterval(f)},[]);const l=w.jsxs(xr,{isOpen:o,onClose:a,size:"xl",children:[" ",w.jsx(Pr,{}),w.jsxs(Or,{maxHeight:"80vh",maxWidth:"80vw",children:[" ",w.jsx(Ar,{children:"Filters"}),w.jsx(Ir,{}),w.jsxs(Tr,{overflowY:"auto",children:[" ",w.jsx("pre",{children:n})]})]})]}),u=c=>{var d;const f=c.options&&c.options.view?c.options.view:"";return w.jsxs(Da,{children:[w.jsx(Bt,{children:c.type}),w.jsx(Bt,{children:w.jsx(c1,{label:c.relayUrl,children:c.relayUrl.substring(6)})}),w.jsx(Bt,{children:w.jsx(pe,{fontSize:"sm",children:c.filters&&c.filters.kinds&&rde(c.filters.kinds)})}),w.jsx(Bt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(JSON.stringify(c.filters,null,2)),i()},children:"Show"})}),w.jsx(Bt,{children:w.jsx(c1,{label:f,children:Va(f,5)})}),w.jsx(Bt,{children:(d=c.options)==null?void 0:d.timeoutIn}),w.jsx(Bt,{children:w.jsx(be,{size:"sm",onClick:()=>Z.getState().unsubscribe([c.id]),children:"Unsubscribe"})})]},c.id)};return w.jsxs(ve,{children:[w.jsxs(_d,{variant:"simple",marginBottom:4,children:[w.jsx(xm,{children:w.jsxs(Da,{children:[w.jsx(jt,{children:"Type"}),w.jsx(jt,{children:"Relay"}),w.jsx(jt,{children:"Kind"}),w.jsx(jt,{children:"Filter"}),w.jsx(jt,{children:"View"}),w.jsx(jt,{children:"Timeout"}),w.jsx(jt,{children:"Action"})]})}),w.jsx(Om,{children:e.map(c=>u(c))})]}),l]})}function ide(){const[e,t]=P.useState([]),[n,r]=P.useState(null),[o,i]=P.useState(!1),{isOpen:a,onOpen:s,onClose:l}=jn(),u=async()=>{await Z.getState().getRelays().then(p=>{p&&t(p)})};P.useEffect(()=>{u();const p=setInterval(u,2e3);return()=>clearInterval(p)},[]);const c=async p=>{i(!0);const m=!p.read;await Z.getState().updateRelay(p.url,{read:m}),await u(),i(!1)},f=async p=>{i(!0);const m=!p.write;await Z.getState().updateRelay(p.url,{write:m}),await u(),i(!1)},d=w.jsxs(xr,{isOpen:a,onClose:l,size:"xl",children:[w.jsx(Pr,{}),w.jsxs(Or,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ar,{children:"Relay"}),w.jsx(Ir,{}),w.jsx(Tr,{overflowY:"auto",children:n&&n.info&&w.jsx("pre",{children:w.jsx("code",{children:JSON.stringify(n.info,null,2)})})})]})]}),h=p=>w.jsxs(Da,{children:[w.jsx(Bt,{children:w.jsx(Ne,{as:p.isReady?r7:ef,color:p.isReady?"green.500":"red.500"})}),w.jsx(Bt,{children:p.url}),w.jsx(Bt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(p),s()},children:"Show"})}),w.jsx(Bt,{children:w.jsx(nw,{isChecked:p.read,onChange:()=>c(p),isDisabled:o})}),w.jsx(Bt,{children:w.jsx(nw,{isChecked:p.write,onChange:()=>f(p),isDisabled:o})}),w.jsx(Bt,{children:p.error})]},p.url);return w.jsxs(ve,{children:[w.jsxs(_d,{variant:"simple",marginBottom:4,children:[w.jsx(xm,{children:w.jsxs(Da,{children:[w.jsx(jt,{children:"Ready"}),w.jsx(jt,{children:"Url"}),w.jsx(jt,{children:"Info"}),w.jsx(jt,{children:"Read"}),w.jsx(jt,{children:"Write"}),w.jsx(jt,{children:"Error"})]})}),w.jsx(Om,{children:e.map(p=>h(p))})]}),d]})}function ade(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var K1=ade(P),sde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},w8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=lde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return K1.createElement("svg",sde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),K1.createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z"}))},ude=K1.memo?K1.memo(w8):w8,cde=ude;const Ng=Fe(cde);function fde(){const[e,t]=P.useState([]),[n,r]=P.useState(null),{isOpen:o,onOpen:i,onClose:a}=jn(),s=async()=>{await Z.getState().getQueueItems().then(d=>{d&&t(d)})};P.useEffect(()=>{s();const d=setInterval(s,3e3);return()=>clearInterval(d)},[]);const l=d=>!!d.error,u=d=>d.error?d.error:"",c=w.jsxs(xr,{isOpen:o,onClose:a,size:"xl",children:[w.jsx(Pr,{}),w.jsxs(Or,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ar,{children:"Queue Item Detail"}),w.jsx(Ir,{}),w.jsx(Tr,{overflowY:"auto",children:n&&w.jsx("pre",{children:w.jsx("code",{children:JSON.stringify(n,null,2)})})})]})]}),f=d=>w.jsxs(Da,{children:[w.jsx(Bt,{children:d.relayUrl}),w.jsx(Bt,{children:w.jsx(c1,{label:d.event.id,children:Va(d.event.id,5)})}),w.jsx(Bt,{children:w.jsxs(ft,{children:[d.pow?w.jsx(pe,{children:d.pow}):w.jsx(pe,{children:"0"}),w.jsx(pe,{children:"/"}),w.jsx(Ne,{as:d.powDone?Ng:ef})]})}),w.jsx(Bt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(d),i()},children:"Show"})}),w.jsx(Bt,{children:w.jsx(Ne,{as:d.send?Ng:ef,marginRight:1})}),w.jsxs(Bt,{children:[w.jsx(Ne,{as:d.accepted?Ng:ef}),l(d)&&w.jsx(pe,{color:"red.500",children:u(d)})]})]},`${d.event.id}_${d.relayUrl}`);return w.jsxs(ve,{children:[w.jsxs(_d,{variant:"simple",marginBottom:4,children:[w.jsx(xm,{children:w.jsxs(Da,{children:[w.jsx(jt,{children:"Relay"}),w.jsx(jt,{children:"Event ID"}),w.jsx(jt,{children:"POW / Done"}),w.jsx(jt,{children:"Info"}),w.jsx(jt,{children:"Send"}),w.jsx(jt,{children:"Accepted"})]})}),w.jsx(Om,{children:e.map(d=>({item:d}&&f(d)))})]}),c]})}function dde(){const{colorMode:e,toggleColorMode:t}=rm(),[n,r]=P.useState(0),[o]=Z(M=>[M.relayEvents]),[i,a]=P.useState(0),[s,l]=P.useState(0),[u,c]=P.useState(0),[f,d]=P.useState(0),[h,p]=P.useState(0),m=Ho(),S=async()=>{if(Z.getState().status==="loading")return;const M=await Z.getState().countUsers();M&&r(M);const N=await Z.getState().getSubscriptions({isActive:!0});N&&c(N.length);const D=await Z.getState().getRelays();D&&d(D.length);const L=await Z.getState().getQueueItems();L&&p(L.length);const j=await Z.getState().getAllUsersBlocked();j&&a(j.length)};P.useEffect(()=>{const M=setInterval(async()=>await S(),2e3);return()=>clearInterval(M)},[]);const b=async(M,N)=>{!M||!N||await Z.getState().relayAuth(M,N)};P.useEffect(()=>{const M=o.length;if(M>0){const N=M-s;if(N>0){l(M);const D=o.slice(-N);for(const L of D){let j="",F="",B=!0;if(L.data[0]===gl.NOTICE)j=L.data[1],F=`${L.meta.url}`;else if(L.data[0]===gl.OK)B=L.data[2],j=B?"Event accepted":"Event rejected",F=`${L.meta.url}`;else{if(L.data[0]===gl.EOSE)return;if(L.data[0]===gl.COUNT)j="Received count",F=`${L.meta.url} #${L.data[1]}: ${JSON.stringify(L.data[2])} events`;else if(L.data[0]===gl.AUTH){j="Authentication requested",F=`${L.meta.url}`;const V=Z.getState().keystore;!V||V==="none"?F+=" but no account is available to sign the challenge.":b(L.meta.url,L.data[1])}}F!==""&&m({title:j,position:"top-right",description:F,status:B?"info":"error",duration:5e3,isClosable:!0})}}}},[o]);const{isOpen:g,onOpen:E,onClose:T}=jn(),O=w.jsxs(xr,{isOpen:g,onClose:T,size:"xl",children:[" ",w.jsx(Pr,{}),w.jsxs(Or,{maxHeight:"80vh",maxWidth:"80vw",children:[" ",w.jsx(Ar,{children:w.jsx(Fo,{size:"lg",children:"Subscriptions"})}),w.jsx(Ir,{}),w.jsx(Tr,{overflowY:"auto",children:w.jsx(ode,{})})]})]}),{isOpen:A,onOpen:C,onClose:y}=jn(),_=w.jsxs(xr,{isOpen:A,onClose:y,size:"xl",children:[w.jsx(Pr,{}),w.jsxs(Or,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ar,{children:w.jsx(Fo,{size:"lg",children:"Relays"})}),w.jsx(Ir,{}),w.jsx(Tr,{overflowY:"auto",children:w.jsx(ide,{})})]})]}),{isOpen:v,onOpen:x,onClose:I}=jn(),R=w.jsxs(xr,{isOpen:v,onClose:I,size:"xl",children:[w.jsx(Pr,{}),w.jsxs(Or,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ar,{children:w.jsx(Fo,{size:"lg",children:"Queue"})}),w.jsx(Ir,{}),w.jsx(Tr,{overflowY:"auto",children:w.jsx(fde,{})})]})]}),[k]=MJ("(max-width: 600px)");return w.jsxs(ve,{position:"fixed",bottom:0,left:0,right:0,p:3,backgroundColor:"background",children:[k?w.jsxs(ft,{spacing:4,children:[w.jsxs(be,{variant:"outline",size:"sm",onClick:t,children:["Toggle ",e==="light"?"Dark":"Light"]}),w.jsx(v8,{buttonSize:"sm"}),w.jsxs(Sm,{children:[w.jsx(Em,{as:be,size:"sm",children:"Actions"}),w.jsxs(_m,{children:[w.jsx($r,{children:w.jsxs(ft,{spacing:2,children:[w.jsx(pe,{fontSize:"xs",children:"Users:"}),w.jsx(pe,{fontSize:"sm",children:n})]})}),w.jsx($r,{children:w.jsx(vn,{as:m1,to:"/blocked",children:w.jsxs(ft,{spacing:2,children:[w.jsx(pe,{fontSize:"xs",children:"Blocked Users:"}),w.jsx(pe,{fontSize:"sm",children:i})]})})}),w.jsx($r,{children:w.jsx(vn,{onClick:A?y:C,children:w.jsxs(ft,{spacing:2,children:[w.jsx(pe,{fontSize:"xs",children:"Relays:"}),w.jsx(pe,{fontSize:"sm",children:f})]})})}),w.jsx($r,{children:w.jsx(vn,{onClick:v?I:x,children:w.jsxs(ft,{spacing:2,children:[w.jsx(pe,{fontSize:"xs",children:"Queue:"}),w.jsx(pe,{fontSize:"sm",children:h})]})})}),w.jsx($r,{children:w.jsx(vn,{onClick:g?T:E,children:w.jsxs(ft,{spacing:2,children:[w.jsx(pe,{fontSize:"xs",children:"Subscriptions:"}),w.jsx(pe,{fontSize:"sm",children:u})]})})}),w.jsx($r,{children:w.jsx(vn,{href:"https://github.com/franzos/nostr-ts",children:w.jsxs(pe,{children:["NostrOP source (v","0.0.4",")"]})})})]})]})]}):w.jsx(ft,{spacing:4,children:w.jsxs(w.Fragment,{children:[w.jsxs(be,{variant:"outline",size:"sm",onClick:t,children:["Toggle ",e==="light"?"Dark":"Light"]}),w.jsx(v8,{buttonSize:"sm"}),w.jsx(Zs,{}),w.jsxs(ft,{spacing:2,children:[w.jsx(pe,{fontSize:"xs",children:"Users:"}),w.jsx(pe,{fontSize:"sm",children:n})]}),w.jsx(vn,{as:m1,to:"/blocked",children:w.jsxs(ft,{spacing:2,children:[w.jsx(pe,{fontSize:"xs",children:"Blocked Users:"}),w.jsx(pe,{fontSize:"sm",children:i})]})}),w.jsx(vn,{onClick:A?y:C,children:w.jsxs(ft,{spacing:2,children:[w.jsx(pe,{fontSize:"xs",children:"Relays:"}),w.jsx(pe,{fontSize:"sm",children:f})]})}),w.jsx(vn,{onClick:v?I:x,children:w.jsxs(ft,{spacing:2,children:[w.jsx(pe,{fontSize:"xs",children:"Queue:"}),w.jsx(pe,{fontSize:"sm",children:h})]})}),w.jsx(vn,{onClick:g?T:E,children:w.jsxs(ft,{spacing:2,children:[w.jsx(pe,{fontSize:"xs",children:"Subscriptions:"}),w.jsx(pe,{fontSize:"sm",children:u})]})}),w.jsx(vn,{href:"https://github.com/franzos/nostr-ts",children:w.jsxs(pe,{fontSize:"xs",children:["NostrOP v","0.0.4"]})})]})}),O,_,R]})}function hc({label:e,value:t,to:n,leftIcon:r}){return w.jsx(vn,{as:m1,to:n,w:"100%",padding:2,borderRadius:5,bg:"blackAlpha.50",border:"1px solid",borderColor:"whiteAlpha.100",_hover:{backgroundColor:"blackAlpha.400"},_activeLink:{backgroundColor:"blackAlpha.300"},children:w.jsxs(ft,{children:[r,w.jsx(pe,{fontSize:"md",fontWeight:"bold",children:e}),t&&w.jsx(pe,{fontSize:"md",children:t})]})})}function hde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var X1=hde(P),pde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},b8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=mde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return X1.createElement("svg",pde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),X1.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M3,13V18L3,20H10V18H5V13H3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M14,15H20V19H14V15Z"}))},yde=X1.memo?X1.memo(b8):b8,gde=yde;const vde=Fe(gde);function wde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var q1=wde(P),bde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},S8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Sde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return q1.createElement("svg",bde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),q1.createElement("path",{d:"M4,1C2.89,1 2,1.89 2,3V7C2,8.11 2.89,9 4,9H1V11H13V9H10C11.11,9 12,8.11 12,7V3C12,1.89 11.11,1 10,1H4M4,3H10V7H4V3M14,13C12.89,13 12,13.89 12,15V19C12,20.11 12.89,21 14,21H11V23H23V21H20C21.11,21 22,20.11 22,19V15C22,13.89 21.11,13 20,13H14M3.88,13.46L2.46,14.88L4.59,17L2.46,19.12L3.88,20.54L6,18.41L8.12,20.54L9.54,19.12L7.41,17L9.54,14.88L8.12,13.46L6,15.59L3.88,13.46M14,15H20V19H14V15Z"}))},_de=q1.memo?q1.memo(S8):S8,Ede=_de;const Cde=Fe(Ede);function xde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Y1=xde(P),Ode=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},_8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Ade(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return Y1.createElement("svg",Ode({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Y1.createElement("path",{d:"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"}))},Pde=Y1.memo?Y1.memo(_8):_8,Tde=Pde;const Ide=Fe(Tde);function Rde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Z1=Rde(P),kde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},E8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Mde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return Z1.createElement("svg",kde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Z1.createElement("path",{d:"M11 10V12H9V14H7V12H5.8C5.4 13.2 4.3 14 3 14C1.3 14 0 12.7 0 11S1.3 8 3 8C4.3 8 5.4 8.8 5.8 10H11M3 10C2.4 10 2 10.4 2 11S2.4 12 3 12 4 11.6 4 11 3.6 10 3 10M16 14C18.7 14 24 15.3 24 18V20H8V18C8 15.3 13.3 14 16 14M16 12C13.8 12 12 10.2 12 8S13.8 4 16 4 20 5.8 20 8 18.2 12 16 12Z"}))},Dde=Z1.memo?Z1.memo(E8):E8,Lde=Dde;const Nde=Fe(Lde);function Bde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Q1=Bde(P),jde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},C8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Fde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return Q1.createElement("svg",jde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),Q1.createElement("path",{d:"M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z"}))},$de=Q1.memo?Q1.memo(C8):C8,zde=$de;const a7=Fe(zde);function Vde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var J1=Vde(P),Ude=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},x8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Hde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return J1.createElement("svg",Ude({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),J1.createElement("path",{d:"M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z"}))},Wde=J1.memo?J1.memo(x8):x8,Gde=Wde;const s7=Fe(Gde);function Kde(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var e0=Kde(P),Xde=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},O8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=qde(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return e0.createElement("svg",Xde({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),e0.createElement("path",{d:"M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.09 20.21,11.09 20.42,11.3L21.7,12.58C21.91,12.79 21.91,13.14 21.7,13.35M12,18.94L18.06,12.88L20.11,14.93L14.06,21H12V18.94M12,14C7.58,14 4,15.79 4,18V20H10V18.11L14,14.11C13.34,14.03 12.67,14 12,14M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4Z"}))},Yde=e0.memo?e0.memo(O8):O8,Zde=Yde;const Qde=Fe(Zde);function mp(e){return Object.entries(e).map(([t,{read:n,write:r}])=>({url:t,read:n,write:r}))}function Jde({isOpen:e,onClose:t}){const[n,r]=P.useState(mp(mw)),[o,i]=P.useState(""),[a,s]=P.useState(!1),[l,u]=P.useState(!1),c=Ho(),f=async p=>{if(s(!0),window.nostr&&window.nostr.getRelays)try{const m=await window.nostr.getRelays();r(mp(m)),s(!1)}catch(m){console.error("Error loading relays:",m);let S="Unknown error";m instanceof Error&&(S=m.message),c({title:"Error loading relays",description:S,status:"error",duration:5e3,isClosable:!0}),s(!1)}else{console.log(`Nostr extention not ready, retry ${p}`);const m=p?p+1:1;if(m>2){c({title:"Error loading relays",description:"nos2x extention not available or ready.",status:"error",duration:5e3,isClosable:!0}),s(!1);return}setTimeout(()=>f(m),1e3)}},d=()=>{r(mp(mw))};P.useEffect(()=>{const p=localStorage.getItem("nostr-client:relays");p&&r(JSON.parse(p))},[]);const h=async()=>{u(!0),localStorage.setItem("nostr-client:relays",JSON.stringify(n)),await Z.getState().connect(n),u(!1),t()};return w.jsxs(xr,{isOpen:e,onClose:t,children:[w.jsx(Pr,{}),w.jsxs(Or,{children:[w.jsx(Ar,{children:"Connect to Relay(s)"}),w.jsx(Ir,{}),w.jsxs(Tr,{children:[w.jsxs(pe,{children:["You can find a list of relays in the nostr-ts repository",w.jsx(vn,{marginLeft:1,href:"https://github.com/franzos/nostr-ts/blob/master/discovered-relays.json",isExternal:!0,color:"blue.500",children:"github.com/franzos/nostr-ts"}),",",w.jsx(vn,{marginLeft:1,marginRight:1,href:"https://nostr.info/relays/",isExternal:!0,color:"blue.500",children:"nostr.info"}),"and elsewhere."]}),w.jsx(Aa,{spacing:3,width:"100%",children:n&&n.map(p=>w.jsxs(X2,{width:"100%",alignItems:"center",py:2,children:[w.jsx(pe,{flex:"1",marginLeft:"2",children:p.url}),w.jsx(be,{ml:"auto",onClick:()=>{const m=n.filter(S=>S.url!==p.url);r(m)},children:"Remove"})]},p.url))}),w.jsxs(X2,{direction:"row",alignItems:"center",pt:4,children:[w.jsx(Lt,{flex:"1",value:o,onChange:p=>i(p.target.value),placeholder:"Enter new relay URL"}),w.jsx(be,{ml:2,onClick:()=>{o.trim()!==""&&(r([...n,{url:o,read:!0,write:!0}]),i(""))},children:"Add"})]}),w.jsxs(fd,{children:[w.jsx(be,{isLoading:a,onClick:()=>f(),size:"xs",marginTop:2,children:"Load from nos2x"}),w.jsx(be,{isLoading:a,onClick:d,size:"xs",marginTop:2,children:"Reset"})]})]}),w.jsx(wd,{children:w.jsx(be,{variant:"outline",isDisabled:n.length===0,isLoading:l,onClick:h,children:"Connect"})})]})]})}const l7="/nostr-ts/assets/logo-2c2a6c00.svg";function ehe(){const[e,t,n]=Z(f=>{var d;return[f.connected,f.keystore,((d=f.keypair)==null?void 0:d.publicKey)||""]}),[r,o]=P.useState(0),{isOpen:i,onOpen:a,onClose:s}=jn(),l=async()=>{if(!Z.getState().connected)return;const f=await Z.getState().getAllUsersFollowing();f&&o(f.length)},u=async()=>{await Z.getState().connect(mp(mw))};P.useEffect(()=>{const f=setInterval(l,1e3);return u(),()=>clearInterval(f)},[]);const c=w.jsxs(Aa,{align:"start",spacing:5,children:[w.jsx(hc,{label:"Home",to:"/",leftIcon:w.jsx(Ne,{as:Ide,marginRight:1})}),e&&w.jsxs(w.Fragment,{children:[w.jsx(hc,{label:"Following",value:r,to:"/following",leftIcon:w.jsx(Ne,{as:a7,marginRight:1})}),w.jsx(hc,{label:"Lists",to:"/lists",leftIcon:w.jsx(Ne,{as:s7,marginRight:1})}),n&&n!==""&&w.jsx(hc,{label:"Profile",to:"/profile",leftIcon:w.jsx(Ne,{as:Qde,marginRight:1})})]}),w.jsx(hc,{label:"Account",value:t,to:"/account",leftIcon:w.jsx(Ne,{as:Nde,marginRight:1})}),e?w.jsxs(be,{w:"100%",variant:"outline",onClick:Z.getState().disconnect,children:[w.jsx(Ne,{as:Cde,marginRight:1}),"Disconnect"]}):w.jsx(be,{w:"100%",variant:"solid",onClick:a,leftIcon:w.jsx(Ne,{as:vde}),children:"Connect to relay(s)"})]});return w.jsxs(w.Fragment,{children:[w.jsxs(G5,{maxW:"8xl",p:5,marginBottom:14,children:[w.jsxs(Aa,{spacing:5,align:"stretch",children:[w.jsx(Aa,{spacing:1,align:"start",children:w.jsx($u,{height:"30px",src:l7})}),w.jsxs(zu,{templateColumns:["1fr","1fr 4fr"],gap:20,children:[c,w.jsx(ve,{children:w.jsx(Vre,{})})]})]}),Jde({isOpen:i,onOpen:a,onClose:s})]}),w.jsx(dde,{})]})}function the({data:e,nEventString:t,isOpen:n,onClose:r}){const o=`${window.location.origin}/e/${t}`,i=e.eventRelayUrls?e.eventRelayUrls[0]:"Unknown (from local DB)";return w.jsxs(xr,{isOpen:n,onClose:r,size:"xl",children:[w.jsx(Pr,{}),w.jsxs(Or,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ar,{children:"Event"}),w.jsx(Ir,{}),w.jsxs(Tr,{overflowY:"auto",children:[w.jsxs(pe,{children:["Link:"," ",w.jsx(vn,{as:zf,to:o,children:o})]}),w.jsxs(pe,{children:["Relay: ",i]}),w.jsx(ve,{m:4,children:w.jsx("pre",{children:w.jsx("code",{children:JSON.stringify(e.event,null,2)})})})]})]})]})}function nhe({note:e,index:t}){const o=P.useRef(""),i=P.useRef([]),[a]=Z(f=>[f.connected]),[s]=Z(f=>[f.events[e]?f.events[e][0]:null]),[l,u]=P.useState(!1),c=async(f=0)=>{if(f>20){u(!0);return}await Z.getState().getEvent(o.current,{view:e,retryCount:f,relayUrls:i.current})||setTimeout(()=>c(f+1),1e3)};return P.useEffect(()=>{try{const f=Rs(e);for(const d of f.tlvItems)d.type===0?o.current=d.value:d.type===1&&i.current.push(d.value)}catch(f){console.error(f);return}e&&a&&(!t||t<=2)&&c()},[e,t,a]),w.jsx(ve,{p:1,m:1,children:s?w.jsx(Wm,{data:s,level:0}):l?w.jsxs(pe,{fontSize:"sm",color:"gray.500",children:["Couldn't find ",e,"."]}):w.jsxs(pe,{fontSize:"sm",color:"gray.500",children:["Loading ... ",e]})})}function rhe({npub:e}){const[t]=Z(f=>[f.status]),n=P.useRef(null),[r,o]=P.useState(""),[i,a]=P.useState(""),[s,l]=P.useState(!1),u=f=>{const d=f.user.data;return d&&d.display_name?`@${d.display_name}`:""},c=async(f,d=0)=>{if(d>20){l(!1);return}const h=await Z.getState().getUser(f);h?(o(u(h)),l(!1)):(d===2&&await Z.getState().requestInformation({idsOrKeys:[f],source:"users"},{timeoutIn:1e4}),setTimeout(()=>c(f,d+1),1e3))};return P.useEffect(()=>{if(!(!e||!["online","offline"].includes(t)))try{const d=Rs(e).tlvItems.find(h=>h.type===0);d&&(n.current=d.value,a(`/p/${e}`),l(!0),c(n.current))}catch(f){console.error("Error decoding bech32:",f)}},[t,e]),w.jsx(w.Fragment,{children:e?w.jsx(vn,{as:m1,to:i,color:"gray.500",children:r===""||s?Va(e,10):r}):w.jsx(w.Fragment,{children:"..."})})}function ohe({text:e}){if(!e)return null;const t=/(https?:\/\/[^\s]+)/g,n=/(?:nostr:)?(note[0-9a-zA-Z]+|nevent[0-9a-zA-Z]+)/g,r=/(?:nostr:)?(npub[0-9a-zA-Z]+|nprofile[0-9a-zA-Z]+)/g,o=/#[a-zA-Z0-9]+/g,i=e.split(/(https?:\/\/[^\s]+|(?:nostr:)?note[0-9a-zA-Z]+|(?:nostr:)?npub[0-9a-zA-Z]+|(?:nostr:)?nprofile[0-9a-zA-Z]+|(?:nostr:)?nevent[0-9a-zA-Z]+|#[a-zA-Z0-9]+)/g);return w.jsx(w.Fragment,{children:i.map((a,s)=>{if(t.test(a))return w.jsx(vn,{color:"gray.500",href:a,target:"_blank",rel:"noopener noreferrer",children:Va(a,40)},s);if(n.test(a)){const l=a.split(":").pop();return l&&w.jsx(nhe,{note:l,index:s},s)}if(r.test(a)){const l=a.split(":").pop();return w.jsx(rhe,{npub:l},s)}return o.test(a)?w.jsx(vn,{as:zf,to:`/t/${encodeURIComponent(a.slice(1))}`,color:"gray.500",children:a},s):a})})}function ihe({content:e}){return w.jsx(w.Fragment,{children:e&&e!==""&&w.jsx(ve,{overflowWrap:"break-word",wordBreak:"break-word",pl:2,pr:2,pt:1,pb:1,background:"blackAlpha.100",borderRadius:4,style:{overflowWrap:"anywhere"},children:w.jsx(ohe,{text:e})})})}const P_=({text:e})=>{const t=e||"Just a sec ... Searching the Matrix.";return w.jsxs(ve,{textAlign:"center",children:[w.jsx(pe,{children:t}),w.jsx(ym,{p:4,mt:2})]})};function ahe({data:e,isOpen:t,sendCallback:n,level:r}){const o=`event-${e.event.id}_replies`,[i,a]=P.useState(!1),[s]=Z(u=>[u.events[`event-${e.event.id}_replies`]]),l=async()=>{a(!0);try{await Z.getState().getEventReplies(e.event.id,o,!0)}catch(u){console.error(u)}if(s&&s.length>0){await Z.getState().requestInformation({source:"events:related",idsOrKeys:[...s.map(c=>c.event.id)]},{timeoutIn:2e4,view:o,isLive:!0});let u=s.map(c=>c.event.pubkey);u=[...new Set(u)],await Z.getState().requestInformation({source:"users",idsOrKeys:[...u]},{timeoutIn:1e4,view:o,isLive:!0})}a(!1)};return P.useEffect(()=>{t&&l()},[t]),w.jsxs(w.Fragment,{children:[t&&w.jsx(ve,{padding:4,marginBottom:2,marginTop:2,background:"background",borderRadius:4,children:w.jsx(i7,{isResponse:!0,inResponseTo:e.event,relayUrls:e.eventRelayUrls,kind:"NewShortTextNoteResponse",sendCallback:n})}),s&&t&&s.map(u=>{const c=u.user?u.user:{pubkey:u.event.pubkey};return w.jsx(ve,{marginLeft:10,mb:1,children:w.jsx(Wm,{data:u,level:r+1})},`${u.event.id}_${c.pubkey}_replies`)}),i&&t&&w.jsx(P_,{text:"Just a sec ... Loading replies."})]})}const she=({contentWarning:e,setShowNSFWContent:t})=>w.jsxs(be,{size:"sm",width:"100%",overflowWrap:"break-word",wordBreak:"break-all",onClick:()=>t(!0),children:["Show content"," ",e&&e!==""?`(${e})`:"(NSFW)"]});function lhe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var t0=lhe(P),uhe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},A8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=che(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return t0.createElement("svg",uhe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),t0.createElement("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"}))},fhe=t0.memo?t0.memo(A8):A8,dhe=fhe;const hhe=Fe(dhe);function phe(e){return e?Object.keys(e).filter(t=>t!=="+"&&t!=="-").reduce((t,n)=>(t[n]=e[n],t),{}):{}}const mhe=e=>{const t=new Date,n=new Date(e*1e3),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3),i=Math.floor(o/60),a=Math.floor(i/60);return o<60?`${o} seconds ago`:i<60?`${i} minutes ago`:a<24?`${a} hours ago`:`${n.toLocaleDateString()} ${n.toLocaleTimeString()}`};function yhe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var n0=yhe(P),ghe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},P8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=vhe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return n0.createElement("svg",ghe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),n0.createElement("path",{d:"M17.06 11.57C17.65 10.88 18 10 18 9C18 7.14 16.73 5.57 15 5.13V3H13V5H11V3H9V5H6V7H8V17H6V19H9V21H11V19H13V21H15V19C17.21 19 19 17.21 19 15C19 13.55 18.22 12.27 17.06 11.57M10 7H14C15.1 7 16 7.9 16 9S15.1 11 14 11H10V7M15 17H10V13H15C16.1 13 17 13.9 17 15S16.1 17 15 17Z"}))},whe=n0.memo?n0.memo(P8):P8,bhe=whe;const She=Fe(bhe);function _he(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var r0=_he(P),Ehe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},T8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Che(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return r0.createElement("svg",Ehe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),r0.createElement("path",{d:"M19,15H23V3H19M15,3H6C5.17,3 4.46,3.5 4.16,4.22L1.14,11.27C1.05,11.5 1,11.74 1,12V14A2,2 0 0,0 3,16H9.31L8.36,20.57C8.34,20.67 8.33,20.77 8.33,20.88C8.33,21.3 8.5,21.67 8.77,21.94L9.83,23L16.41,16.41C16.78,16.05 17,15.55 17,15V5C17,3.89 16.1,3 15,3Z"}))},xhe=r0.memo?r0.memo(T8):T8,Ohe=xhe;const Ahe=Fe(Ohe);function Phe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var o0=Phe(P),The=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},I8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Ihe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return o0.createElement("svg",The({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),o0.createElement("path",{d:"M23,10C23,8.89 22.1,8 21,8H14.68L15.64,3.43C15.66,3.33 15.67,3.22 15.67,3.11C15.67,2.7 15.5,2.32 15.23,2.05L14.17,1L7.59,7.58C7.22,7.95 7,8.45 7,9V19A2,2 0 0,0 9,21H18C18.83,21 19.54,20.5 19.84,19.78L22.86,12.73C22.95,12.5 23,12.26 23,12V10M1,21H5V9H1V21Z"}))},Rhe=o0.memo?o0.memo(I8):I8,khe=Rhe;const Mhe=Fe(khe);function Dhe({isReady:e,level:t,repliesCount:n,reactionsCount:r,repostCount:o,zapReceiptCount:i,zapReceiptAmount:a,isReplyOpen:s,onReplyOpen:l,onReplyClose:u,onAction:c}){return w.jsxs(ft,{children:[w.jsx(be,{size:"xs",variant:"outline",color:"gray.500",colorScheme:"blue",leftIcon:w.jsx(Ne,{as:t7}),onClick:()=>s?u():l(),isDisabled:!e||t>=2,children:n}),w.jsx(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Upvote",leftIcon:w.jsx(Ne,{as:Mhe}),onClick:()=>c("reaction","+"),isDisabled:!e,children:(r==null?void 0:r["+"])||0}),w.jsx(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Downvote",leftIcon:w.jsx(Ne,{as:Ahe}),onClick:()=>c("reaction","-"),isDisabled:!e,children:(r==null?void 0:r["-"])||0}),w.jsx(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"Repost",leftIcon:w.jsx(Ne,{as:n7}),onClick:()=>c("quote"),isDisabled:!e,children:o}),w.jsxs(be,{size:"xs",variant:"outline",color:"gray.500","aria-label":"ZAP",leftIcon:w.jsx(Ne,{as:She}),onClick:()=>c("zap"),isDisabled:!e,children:[i," (",a,")"]})]})}function Lhe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var i0=Lhe(P),Nhe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},R8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Bhe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return i0.createElement("svg",Nhe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),i0.createElement("path",{d:"M5,3H7V5H5V10A2,2 0 0,1 3,12A2,2 0 0,1 5,14V19H7V21H5C3.93,20.73 3,20.1 3,19V15A2,2 0 0,0 1,13H0V11H1A2,2 0 0,0 3,9V5A2,2 0 0,1 5,3M19,3A2,2 0 0,1 21,5V9A2,2 0 0,0 23,11H24V13H23A2,2 0 0,0 21,15V19A2,2 0 0,1 19,21H17V19H19V14A2,2 0 0,1 21,12A2,2 0 0,1 19,10V5H17V3H19M12,15A1,1 0 0,1 13,16A1,1 0 0,1 12,17A1,1 0 0,1 11,16A1,1 0 0,1 12,15M8,15A1,1 0 0,1 9,16A1,1 0 0,1 8,17A1,1 0 0,1 7,16A1,1 0 0,1 8,15M16,15A1,1 0 0,1 17,16A1,1 0 0,1 16,17A1,1 0 0,1 15,16A1,1 0 0,1 16,15Z"}))},jhe=i0.memo?i0.memo(R8):R8,Fhe=jhe;const $he=Fe(Fhe);function zhe(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var a0=zhe(P),Vhe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},k8=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Uhe(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return a0.createElement("svg",Vhe({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),a0.createElement("path",{d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"}))},Hhe=a0.memo?a0.memo(k8):k8,Whe=Hhe;const u7=Fe(Whe),Ghe=({isReady:e,level:t,nEventString:n,createdAt:r,repliesCount:o,reactionsCount:i,repostCount:a,zapReceiptCount:s,zapReceiptAmount:l,isReplyOpen:u,onReplyOpen:c,onReplyClose:f,isInfoModalOpen:d,onInfoModalOpen:h,onInfoModalClose:p,onAction:m})=>{const S=Ho(),b=phe(i),g=()=>{const E=`${window.location.origin}/#/e/${n}`;navigator.clipboard.writeText(E),S({description:`Copied ${Va(E,40)} to clipboard`,status:"success",duration:5e3,isClosable:!0})};return w.jsx(bZ,{p:1,pl:2,pr:2,children:w.jsxs(Aa,{align:"stretch",children:[w.jsx(ve,{overflowWrap:"break-word",wordBreak:"break-word",children:b&&Object.keys(b).map(E=>w.jsxs(be,{size:"xs",variant:"outline","aria-label":"Repost",isDisabled:!0,m:.5,children:[E," ",b[E]]},E))}),w.jsx(ve,{children:w.jsxs(ft,{children:[w.jsx(Dhe,{isReady:e,level:t,repliesCount:o,reactionsCount:i,repostCount:a,zapReceiptCount:s,zapReceiptAmount:l,isReplyOpen:u,onReplyOpen:c,onReplyClose:f,onAction:m}),w.jsx(Zs,{}),w.jsx(pe,{fontSize:12,color:"gray.500",children:mhe(r)}),w.jsxs(Sm,{children:[w.jsx(Em,{as:dd,size:"xs",variant:"outline",color:"gray.500",icon:w.jsx(Ne,{as:hhe})}),w.jsxs(_m,{children:[w.jsx($r,{icon:w.jsx(Ne,{as:u7}),onClick:g,children:"Copy direct event link"}),w.jsx($r,{icon:w.jsx(Ne,{as:$he}),onClick:()=>d?p():h(),children:"Event JSON"})]})]})]})})]})})};var c7={},f7={},ht={},Khe=function(t,n,r){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},i.type=n.type||"text/javascript",i.charset=n.charset||"utf8",i.async="async"in n?!!n.async:!0,i.src=t,n.attrs&&Xhe(i,n.attrs),n.text&&(i.text=""+n.text);var a="onload"in i?M8:qhe;a(i,r),i.onload||M8(i,r),o.appendChild(i)};function Xhe(e,t){for(var n in t)e.setAttribute(n,t[n])}function M8(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function qhe(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var Yhe=function(t){return Zhe(t)&&!Qhe(t)};function Zhe(e){return!!e&&typeof e=="object"}function Qhe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||tpe(e)}var Jhe=typeof Symbol=="function"&&Symbol.for,epe=Jhe?Symbol.for("react.element"):60103;function tpe(e){return e.$$typeof===epe}function npe(e){return Array.isArray(e)?[]:{}}function Hf(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Iu(npe(e),e,t):e}function rpe(e,t,n){return e.concat(t).map(function(r){return Hf(r,n)})}function ope(e,t){if(!t.customMerge)return Iu;var n=t.customMerge(e);return typeof n=="function"?n:Iu}function ipe(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function D8(e){return Object.keys(e).concat(ipe(e))}function d7(e,t){try{return t in e}catch{return!1}}function ape(e,t){return d7(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function spe(e,t,n){var r={};return n.isMergeableObject(e)&&D8(e).forEach(function(o){r[o]=Hf(e[o],n)}),D8(t).forEach(function(o){ape(e,o)||(d7(e,o)&&n.isMergeableObject(t[o])?r[o]=ope(o,n)(e[o],t[o],n):r[o]=Hf(t[o],n))}),r}function Iu(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||rpe,n.isMergeableObject=n.isMergeableObject||Yhe,n.cloneUnlessOtherwiseSpecified=Hf;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):spe(e,t,n):Hf(t,n)}Iu.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Iu(r,o,n)},{})};var lpe=Iu,h7=lpe;Object.defineProperty(ht,"__esModule",{value:!0});ht.parseStartTime=bpe;ht.parseEndTime=Spe;ht.randomString=_pe;ht.queryString=Epe;ht.getSDK=Cpe;ht.getConfig=xpe;ht.omit=Ope;ht.callPlayer=Ape;ht.isMediaStream=Ppe;ht.isBlobUrl=Tpe;ht.supportsWebKitPresentationMode=Ipe;var upe=p7(Khe),cpe=p7(h7);function p7(e){return e&&e.__esModule?e:{default:e}}function fpe(e,t){return mpe(e)||ppe(e,t)||hpe(e,t)||dpe()}function dpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hpe(e,t){if(e){if(typeof e=="string")return L8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L8(e,t)}}function L8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(o)throw i}}return n}}function mpe(e){if(Array.isArray(e))return e}var ype=/[?&#](?:start|t)=([0-9hms]+)/,gpe=/[?&#]end=([0-9hms]+)/,xw=/(\d+)(h|m|s)/g,vpe=/^\d+$/;function m7(e,t){if(!(e instanceof Array)){var n=e.match(t);if(n){var r=n[1];if(r.match(xw))return wpe(r);if(vpe.test(r))return parseInt(r)}}}function wpe(e){for(var t=0,n=xw.exec(e);n!==null;){var r=n,o=fpe(r,3),i=o[1],a=o[2];a==="h"&&(t+=parseInt(i,10)*60*60),a==="m"&&(t+=parseInt(i,10)*60),a==="s"&&(t+=parseInt(i,10)),n=xw.exec(e)}return t}function bpe(e){return m7(e,ype)}function Spe(e){return m7(e,gpe)}function _pe(){return Math.random().toString(36).substr(2,5)}function Epe(e){return Object.keys(e).map(function(t){return"".concat(t,"=").concat(e[t])}).join("&")}function Bg(e){return window[e]?window[e]:window.exports&&window.exports[e]?window.exports[e]:window.module&&window.module.exports&&window.module.exports[e]?window.module.exports[e]:null}var pl={};function Cpe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return!0},o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:upe.default,i=Bg(t);return i&&r(i)?Promise.resolve(i):new Promise(function(a,s){if(pl[e]){pl[e].push({resolve:a,reject:s});return}pl[e]=[{resolve:a,reject:s}];var l=function(f){pl[e].forEach(function(d){return d.resolve(f)})};if(n){var u=window[n];window[n]=function(){u&&u(),l(Bg(t))}}o(e,function(c){c?(pl[e].forEach(function(f){return f.reject(c)}),pl[e]=null):n||l(Bg(t))})})}function xpe(e,t){return(0,cpe.default)(t.config,e.config)}function Ope(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?r-1:0),i=1;i0&&arguments[0]!==void 0?arguments[0]:document.createElement("video"),t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.canPlay=xe.FLV_EXTENSIONS=xe.DASH_EXTENSIONS=xe.HLS_EXTENSIONS=xe.VIDEO_EXTENSIONS=xe.AUDIO_EXTENSIONS=xe.MATCH_URL_KALTURA=xe.MATCH_URL_VIDYARD=xe.MATCH_URL_MIXCLOUD=xe.MATCH_URL_DAILYMOTION=xe.MATCH_URL_TWITCH_CHANNEL=xe.MATCH_URL_TWITCH_VIDEO=xe.MATCH_URL_WISTIA=xe.MATCH_URL_STREAMABLE=xe.MATCH_URL_FACEBOOK_WATCH=xe.MATCH_URL_FACEBOOK=xe.MATCH_URL_VIMEO=xe.MATCH_URL_SOUNDCLOUD=xe.MATCH_URL_YOUTUBE=void 0;var N8=ht;function Rpe(e,t){var n;if(typeof Symbol>"u"||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=kpe(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,s;return{s:function(){n=e[Symbol.iterator]()},n:function(){var u=n.next();return i=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function kpe(e,t){if(e){if(typeof e=="string")return B8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B8(e,t)}}function B8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nL.length)&&(j=L.length);for(var F=0,B=new Array(j);F"u"||!(Symbol.iterator in Object(L)))){var F=[],B=!0,V=!1,K=void 0;try{for(var W=L[Symbol.iterator](),Q;!(B=(Q=W.next()).done)&&(F.push(Q.value),!(j&&F.length===j));B=!0);}catch(X){V=!0,K=X}finally{try{!B&&W.return!=null&&W.return()}finally{if(V)throw K}}return F}}function p(L){if(Array.isArray(L))return L}function m(L,j){if(!(L instanceof j))throw new TypeError("Cannot call a class as a function")}function S(L,j){for(var F=0;F"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function y(L){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},y(L)}function _(L,j,F){return j in L?Object.defineProperty(L,j,{value:F,enumerable:!0,configurable:!0,writable:!0}):L[j]=F,L}var v="https://www.youtube.com/iframe_api",x="YT",I="onYouTubeIframeAPIReady",R=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,k=/user\/([a-zA-Z0-9_-]+)\/?/,M=/youtube-nocookie\.com/,N="https://www.youtube-nocookie.com",D=function(L){g(F,L);var j=T(F);function F(){var B;m(this,F);for(var V=arguments.length,K=new Array(V),W=0;W1&&arguments[1]!==void 0?arguments[1]:!1;this.callPlayer("seekTo",V),!K&&!this.props.playing&&this.pause()}},{key:"setVolume",value:function(V){this.callPlayer("setVolume",V*100)}},{key:"setPlaybackRate",value:function(V){this.callPlayer("setPlaybackRate",V)}},{key:"setLoop",value:function(V){this.callPlayer("setLoop",V)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var V=this.props.display,K={width:"100%",height:"100%",display:V};return n.default.createElement("div",{style:K},n.default.createElement("div",{ref:this.ref}))}}]),F}(n.Component);e.default=D,_(D,"displayName","YouTube"),_(D,"canPlay",o.canPlay.youtube)}(jg)),jg}var Fg={},F8;function Npe(){return F8||(F8=1,function(e){function t(C){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(_){return typeof _}:t=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},t(C)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return i=function(){return C},C}function a(C){if(C&&C.__esModule)return C;if(C===null||t(C)!=="object"&&typeof C!="function")return{default:C};var y=i();if(y&&y.has(C))return y.get(C);var _={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in C)if(Object.prototype.hasOwnProperty.call(C,x)){var I=v?Object.getOwnPropertyDescriptor(C,x):null;I&&(I.get||I.set)?Object.defineProperty(_,x,I):_[x]=C[x]}return _.default=C,y&&y.set(C,_),_}function s(C,y){var _=Object.keys(C);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(C);y&&(v=v.filter(function(x){return Object.getOwnPropertyDescriptor(C,x).enumerable})),_.push.apply(_,v)}return _}function l(C){for(var y=1;y"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(C){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},g(C)}function E(C,y,_){return y in C?Object.defineProperty(C,y,{value:_,enumerable:!0,configurable:!0,writable:!0}):C[y]=_,C}var T="https://w.soundcloud.com/player/api.js",O="SC",A=function(C){d(_,C);var y=p(_);function _(){var v;u(this,_);for(var x=arguments.length,I=new Array(x),R=0;R1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seekTo",x*1e3),I||this.pause()}},{key:"setVolume",value:function(x){this.callPlayer("setVolume",x*100)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var x=this.props.display,I={width:"100%",height:"100%",display:x};return n.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),style:I,frameBorder:0,allow:"autoplay"})}}]),_}(n.Component);e.default=A,E(A,"displayName","SoundCloud"),E(A,"canPlay",o.canPlay.soundcloud),E(A,"loopOnEnded",!0)}(Fg)),Fg}var $g={},$8;function Bpe(){return $8||($8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var _=i();if(_&&_.has(y))return _.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,_&&_.set(y,v),v}function s(y,_){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);_&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var _=1;_"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,_,v){return _ in y?Object.defineProperty(y,_,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[_]=v,y}var T="https://player.vimeo.com/api/player.js",O="Vimeo",A=function(_){return _.replace("/manage/videos","")},C=function(y){d(v,y);var _=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"setMuted",value:function(I){this.callPlayer("setMuted",I)}},{key:"setLoop",value:function(I){this.callPlayer("setLoop",I)}},{key:"setPlaybackRate",value:function(I){this.callPlayer("setPlaybackRate",I)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var I=this.props.display,R={width:"100%",height:"100%",overflow:"hidden",display:I};return n.default.createElement("div",{key:this.props.url,ref:this.ref,style:R})}}]),v}(n.Component);e.default=C,E(C,"displayName","Vimeo"),E(C,"canPlay",o.canPlay.vimeo),E(C,"forceLoad",!0)}($g)),$g}var zg={},z8;function jpe(){return z8||(z8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var _=i();if(_&&_.has(y))return _.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,_&&_.set(y,v),v}function s(){return s=Object.assign||function(y){for(var _=1;_"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(y){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},b(y)}function g(y,_,v){return _ in y?Object.defineProperty(y,_,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[_]=v,y}var E="https://connect.facebook.net/en_US/sdk.js",T="FB",O="fbAsyncInit",A="facebook-player-",C=function(y){f(v,y);var _=h(v);function v(){var x;l(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I=this.props.config.attributes,R={width:"100%",height:"100%"};return n.default.createElement("div",s({style:R,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"},I))}}]),v}(n.Component);e.default=C,g(C,"displayName","Facebook"),g(C,"canPlay",o.canPlay.facebook),g(C,"loopOnEnded",!0)}(zg)),zg}var Vg={},V8;function Fpe(){return V8||(V8=1,function(e){function t(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(C){return typeof C}:t=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t(O)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return i=function(){return O},O}function a(O){if(O&&O.__esModule)return O;if(O===null||t(O)!=="object"&&typeof O!="function")return{default:O};var A=i();if(A&&A.has(O))return A.get(O);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _ in O)if(Object.prototype.hasOwnProperty.call(O,_)){var v=y?Object.getOwnPropertyDescriptor(O,_):null;v&&(v.get||v.set)?Object.defineProperty(C,_,v):C[_]=O[_]}return C.default=O,A&&A.set(O,C),C}function s(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}function l(O,A){for(var C=0;C"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(O){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},S(O)}function b(O,A,C){return A in O?Object.defineProperty(O,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[A]=C,O}var g="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs",T=function(O){c(C,O);var A=d(C);function C(){var y;s(this,C);for(var _=arguments.length,v=new Array(_),x=0;x<_;x++)v[x]=arguments[x];return y=A.call.apply(A,[this].concat(v)),b(p(y),"callPlayer",r.callPlayer),b(p(y),"duration",null),b(p(y),"currentTime",null),b(p(y),"secondsLoaded",null),b(p(y),"mute",function(){y.callPlayer("mute")}),b(p(y),"unmute",function(){y.callPlayer("unmute")}),b(p(y),"ref",function(I){y.iframe=I}),y}return u(C,[{key:"componentDidMount",value:function(){this.props.onMount&&this.props.onMount(this)}},{key:"load",value:function(_){var v=this;(0,r.getSDK)(g,E).then(function(x){v.iframe&&(v.player=new x.Player(v.iframe),v.player.setLoop(v.props.loop),v.player.on("ready",v.props.onReady),v.player.on("play",v.props.onPlay),v.player.on("pause",v.props.onPause),v.player.on("seeked",v.props.onSeek),v.player.on("ended",v.props.onEnded),v.player.on("error",v.props.onError),v.player.on("timeupdate",function(I){var R=I.duration,k=I.seconds;v.duration=R,v.currentTime=k}),v.player.on("buffered",function(I){var R=I.percent;v.duration&&(v.secondsLoaded=v.duration*R)}),v.props.muted&&v.player.mute())},this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(_){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",_),v||this.pause()}},{key:"setVolume",value:function(_){this.callPlayer("setVolume",_*100)}},{key:"setLoop",value:function(_){this.callPlayer("setLoop",_)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var _=this.props.url.match(o.MATCH_URL_STREAMABLE)[1],v={width:"100%",height:"100%"};return n.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/".concat(_),frameBorder:"0",scrolling:"no",style:v,allow:"encrypted-media; autoplay; fullscreen;"})}}]),C}(n.Component);e.default=T,b(T,"displayName","Streamable"),b(T,"canPlay",o.canPlay.streamable)}(Vg)),Vg}var Ug={},U8;function $pe(){return U8||(U8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var _=i();if(_&&_.has(y))return _.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,_&&_.set(y,v),v}function s(y,_){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);_&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var _=1;_"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,_,v){return _ in y?Object.defineProperty(y,_,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[_]=v,y}var T="https://fast.wistia.com/assets/external/E-v1.js",O="Wistia",A="wistia-player-",C=function(y){d(v,y);var _=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("time",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("volume",I)}},{key:"setPlaybackRate",value:function(I){this.callPlayer("playbackRate",I)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I=this.props.url,R=I&&I.match(o.MATCH_URL_WISTIA)[1],k="wistia_embed wistia_async_".concat(R),M={width:"100%",height:"100%"};return n.default.createElement("div",{id:this.playerID,key:R,className:k,style:M})}}]),v}(n.Component);e.default=C,E(C,"displayName","Wistia"),E(C,"canPlay",o.canPlay.wistia),E(C,"loopOnEnded",!0)}(Ug)),Ug}var Hg={},H8;function zpe(){return H8||(H8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var _=i();if(_&&_.has(y))return _.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,_&&_.set(y,v),v}function s(y,_){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);_&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var _=1;_"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,_,v){return _ in y?Object.defineProperty(y,_,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[_]=v,y}var T="https://player.twitch.tv/js/embed/v1.js",O="Twitch",A="twitch-player-",C=function(y){d(v,y);var _=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I={width:"100%",height:"100%"};return n.default.createElement("div",{style:I,id:this.playerID})}}]),v}(n.Component);e.default=C,E(C,"displayName","Twitch"),E(C,"canPlay",o.canPlay.twitch),E(C,"loopOnEnded",!0)}(Hg)),Hg}var Wg={},W8;function Vpe(){return W8||(W8=1,function(e){function t(k){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(N){return typeof N}:t=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},t(k)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var k=new WeakMap;return i=function(){return k},k}function a(k){if(k&&k.__esModule)return k;if(k===null||t(k)!=="object"&&typeof k!="function")return{default:k};var M=i();if(M&&M.has(k))return M.get(k);var N={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in k)if(Object.prototype.hasOwnProperty.call(k,L)){var j=D?Object.getOwnPropertyDescriptor(k,L):null;j&&(j.get||j.set)?Object.defineProperty(N,L,j):N[L]=k[L]}return N.default=k,M&&M.set(k,N),N}function s(k,M){var N=Object.keys(k);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(k);M&&(D=D.filter(function(L){return Object.getOwnPropertyDescriptor(k,L).enumerable})),N.push.apply(N,D)}return N}function l(k){for(var M=1;Mk.length)&&(M=k.length);for(var N=0,D=new Array(M);N"u"||!(Symbol.iterator in Object(k)))){var N=[],D=!0,L=!1,j=void 0;try{for(var F=k[Symbol.iterator](),B;!(D=(B=F.next()).done)&&(N.push(B.value),!(M&&N.length===M));D=!0);}catch(V){L=!0,j=V}finally{try{!D&&F.return!=null&&F.return()}finally{if(L)throw j}}return N}}function p(k){if(Array.isArray(k))return k}function m(k,M){if(!(k instanceof M))throw new TypeError("Cannot call a class as a function")}function S(k,M){for(var N=0;N"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function y(k){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(N){return N.__proto__||Object.getPrototypeOf(N)},y(k)}function _(k,M,N){return M in k?Object.defineProperty(k,M,{value:N,enumerable:!0,configurable:!0,writable:!0}):k[M]=N,k}var v="https://api.dmcdn.net/all.js",x="DM",I="dmAsyncInit",R=function(k){g(N,k);var M=T(N);function N(){var D;m(this,N);for(var L=arguments.length,j=new Array(L),F=0;F1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",L),j||this.pause()}},{key:"setVolume",value:function(L){this.callPlayer("setVolume",L)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var L=this.props.display,j={width:"100%",height:"100%",display:L};return n.default.createElement("div",{style:j},n.default.createElement("div",{ref:this.ref}))}}]),N}(n.Component);e.default=R,_(R,"displayName","DailyMotion"),_(R,"canPlay",o.canPlay.dailymotion),_(R,"loopOnEnded",!0)}(Wg)),Wg}var Gg={},G8;function Upe(){return G8||(G8=1,function(e){function t(C){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(_){return typeof _}:t=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},t(C)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return i=function(){return C},C}function a(C){if(C&&C.__esModule)return C;if(C===null||t(C)!=="object"&&typeof C!="function")return{default:C};var y=i();if(y&&y.has(C))return y.get(C);var _={},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in C)if(Object.prototype.hasOwnProperty.call(C,x)){var I=v?Object.getOwnPropertyDescriptor(C,x):null;I&&(I.get||I.set)?Object.defineProperty(_,x,I):_[x]=C[x]}return _.default=C,y&&y.set(C,_),_}function s(C,y){var _=Object.keys(C);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(C);y&&(v=v.filter(function(x){return Object.getOwnPropertyDescriptor(C,x).enumerable})),_.push.apply(_,v)}return _}function l(C){for(var y=1;y"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(C){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},g(C)}function E(C,y,_){return y in C?Object.defineProperty(C,y,{value:_,enumerable:!0,configurable:!0,writable:!0}):C[y]=_,C}var T="https://widget.mixcloud.com/media/js/widgetApi.js",O="Mixcloud",A=function(C){d(_,C);var y=p(_);function _(){var v;u(this,_);for(var x=arguments.length,I=new Array(x),R=0;R1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",x),I||this.pause()}},{key:"setVolume",value:function(x){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var x=this.props,I=x.url,R=x.config,k=I.match(o.MATCH_URL_MIXCLOUD)[1],M={width:"100%",height:"100%"},N=(0,r.queryString)(l(l({},R.options),{},{feed:"/".concat(k,"/")}));return n.default.createElement("iframe",{key:k,ref:this.ref,style:M,src:"https://www.mixcloud.com/widget/iframe/?".concat(N),frameBorder:"0",allow:"autoplay"})}}]),_}(n.Component);e.default=A,E(A,"displayName","Mixcloud"),E(A,"canPlay",o.canPlay.mixcloud),E(A,"loopOnEnded",!0)}(Gg)),Gg}var Kg={},K8;function Hpe(){return K8||(K8=1,function(e){function t(y){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(v){return typeof v}:t=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var y=new WeakMap;return i=function(){return y},y}function a(y){if(y&&y.__esModule)return y;if(y===null||t(y)!=="object"&&typeof y!="function")return{default:y};var _=i();if(_&&_.has(y))return _.get(y);var v={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in y)if(Object.prototype.hasOwnProperty.call(y,I)){var R=x?Object.getOwnPropertyDescriptor(y,I):null;R&&(R.get||R.set)?Object.defineProperty(v,I,R):v[I]=y[I]}return v.default=y,_&&_.set(y,v),v}function s(y,_){var v=Object.keys(y);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(y);_&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(y,I).enumerable})),v.push.apply(v,x)}return v}function l(y){for(var _=1;_"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function g(y){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},g(y)}function E(y,_,v){return _ in y?Object.defineProperty(y,_,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[_]=v,y}var T="https://play.vidyard.com/embed/v4.js",O="VidyardV4",A="onVidyardAPI",C=function(y){d(v,y);var _=p(v);function v(){var x;u(this,v);for(var I=arguments.length,R=new Array(I),k=0;k1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("seek",I),R||this.pause()}},{key:"setVolume",value:function(I){this.callPlayer("setVolume",I)}},{key:"setPlaybackRate",value:function(I){this.callPlayer("setPlaybackSpeed",I)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.callPlayer("currentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var I=this.props.display,R={width:"100%",height:"100%",display:I};return n.default.createElement("div",{style:R},n.default.createElement("div",{ref:this.ref}))}}]),v}(n.Component);e.default=C,E(C,"displayName","Vidyard"),E(C,"canPlay",o.canPlay.vidyard)}(Kg)),Kg}var Xg={},X8;function Wpe(){return X8||(X8=1,function(e){function t(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(C){return typeof C}:t=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t(O)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return i=function(){return O},O}function a(O){if(O&&O.__esModule)return O;if(O===null||t(O)!=="object"&&typeof O!="function")return{default:O};var A=i();if(A&&A.has(O))return A.get(O);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _ in O)if(Object.prototype.hasOwnProperty.call(O,_)){var v=y?Object.getOwnPropertyDescriptor(O,_):null;v&&(v.get||v.set)?Object.defineProperty(C,_,v):C[_]=O[_]}return C.default=O,A&&A.set(O,C),C}function s(O,A){if(!(O instanceof A))throw new TypeError("Cannot call a class as a function")}function l(O,A){for(var C=0;C"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(O){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},S(O)}function b(O,A,C){return A in O?Object.defineProperty(O,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[A]=C,O}var g="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs",T=function(O){c(C,O);var A=d(C);function C(){var y;s(this,C);for(var _=arguments.length,v=new Array(_),x=0;x<_;x++)v[x]=arguments[x];return y=A.call.apply(A,[this].concat(v)),b(p(y),"callPlayer",r.callPlayer),b(p(y),"duration",null),b(p(y),"currentTime",null),b(p(y),"secondsLoaded",null),b(p(y),"mute",function(){y.callPlayer("mute")}),b(p(y),"unmute",function(){y.callPlayer("unmute")}),b(p(y),"ref",function(I){y.iframe=I}),y}return u(C,[{key:"componentDidMount",value:function(){this.props.onMount&&this.props.onMount(this)}},{key:"load",value:function(_){var v=this;(0,r.getSDK)(g,E).then(function(x){v.iframe&&(v.player=new x.Player(v.iframe),v.player.on("ready",function(){setTimeout(function(){v.player.isReady=!0,v.player.setLoop(v.props.loop),v.props.muted&&v.player.mute(),v.addListeners(v.player,v.props),v.props.onReady()},500)}))},this.props.onError)}},{key:"addListeners",value:function(_,v){var x=this;_.on("play",v.onPlay),_.on("pause",v.onPause),_.on("ended",v.onEnded),_.on("error",v.onError),_.on("timeupdate",function(I){var R=I.duration,k=I.seconds;x.duration=R,x.currentTime=k})}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(_){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.callPlayer("setCurrentTime",_),v||this.pause()}},{key:"setVolume",value:function(_){this.callPlayer("setVolume",_)}},{key:"setLoop",value:function(_){this.callPlayer("setLoop",_)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var _={width:"100%",height:"100%"};return n.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:_,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}]),C}(n.Component);e.default=T,b(T,"displayName","Kaltura"),b(T,"canPlay",o.canPlay.kaltura)}(Xg)),Xg}var qg={},q8;function Gpe(){return q8||(q8=1,function(e){function t(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(j){return typeof j}:t=function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},t(D)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(P),r=ht,o=xe;function i(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return i=function(){return D},D}function a(D){if(D&&D.__esModule)return D;if(D===null||t(D)!=="object"&&typeof D!="function")return{default:D};var L=i();if(L&&L.has(D))return L.get(D);var j={},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var B in D)if(Object.prototype.hasOwnProperty.call(D,B)){var V=F?Object.getOwnPropertyDescriptor(D,B):null;V&&(V.get||V.set)?Object.defineProperty(j,B,V):j[B]=D[B]}return j.default=D,L&&L.set(D,j),j}function s(){return s=Object.assign||function(D){for(var L=1;L"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(D){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(j){return j.__proto__||Object.getPrototypeOf(j)},b(D)}function g(D,L,j){return L in D?Object.defineProperty(D,L,{value:j,enumerable:!0,configurable:!0,writable:!0}):D[L]=j,D}var E=typeof navigator<"u",T=E&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,O=E&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||T)&&!window.MSStream,A=E&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,C="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",y="Hls",_="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",v="dashjs",x="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",I="flvjs",R=/www\.dropbox\.com\/.+/,k=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,M="https://videodelivery.net/{id}/manifest/video.m3u8",N=function(D){f(j,D);var L=h(j);function j(){var F;l(this,j);for(var B=arguments.length,V=new Array(B),K=0;K1&&arguments[1]!==void 0?arguments[1]:!0;this.player.currentTime=B,V||this.pause()}},{key:"setVolume",value:function(B){this.player.volume=B}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,r.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,r.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}},{key:"setPlaybackRate",value:function(B){try{this.player.playbackRate=B}catch(V){this.props.onError(V)}}},{key:"getDuration",value:function(){if(!this.player)return null;var B=this.player,V=B.duration,K=B.seekable;return V===1/0&&K.length>0?K.end(K.length-1):V}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var B=this.player.buffered;if(B.length===0)return 0;var V=B.end(B.length-1),K=this.getDuration();return V>K?K:V}},{key:"getSource",value:function(B){var V=this.shouldUseHLS(B),K=this.shouldUseDASH(B),W=this.shouldUseFLV(B);if(!(B instanceof Array||(0,r.isMediaStream)(B)||V||K||W))return R.test(B)?B.replace("www.dropbox.com","dl.dropboxusercontent.com"):B}},{key:"render",value:function(){var B=this.props,V=B.url,K=B.playing,W=B.loop,Q=B.controls,X=B.muted,J=B.config,te=B.width,le=B.height,ge=this.shouldUseAudio(this.props),se=ge?"audio":"video",ue={width:te==="auto"?te:"100%",height:le==="auto"?le:"100%"};return n.default.createElement(se,s({ref:this.ref,src:this.getSource(V),style:ue,preload:"auto",autoPlay:K||void 0,controls:Q,muted:X,loop:W},J.attributes),V instanceof Array&&V.map(this.renderSourceElement),J.tracks.map(this.renderTrack))}}]),j}(n.Component);e.default=N,g(N,"displayName","FilePlayer"),g(N,"canPlay",o.canPlay.file)}(qg)),qg}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=P,n=ht,r=xe;function o(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(c){return typeof c}:o=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(l)}function i(){if(typeof WeakMap!="function")return null;var l=new WeakMap;return i=function(){return l},l}function a(l){if(l&&l.__esModule)return l;if(l===null||o(l)!=="object"&&typeof l!="function")return{default:l};var u=i();if(u&&u.has(l))return u.get(l);var c={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in l)if(Object.prototype.hasOwnProperty.call(l,d)){var h=f?Object.getOwnPropertyDescriptor(l,d):null;h&&(h.get||h.set)?Object.defineProperty(c,d,h):c[d]=l[d]}return c.default=l,u&&u.set(l,c),c}var s=[{key:"youtube",name:"YouTube",canPlay:r.canPlay.youtube,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Lpe())})})},{key:"soundcloud",name:"SoundCloud",canPlay:r.canPlay.soundcloud,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Npe())})})},{key:"vimeo",name:"Vimeo",canPlay:r.canPlay.vimeo,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Bpe())})})},{key:"facebook",name:"Facebook",canPlay:r.canPlay.facebook,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(jpe())})})},{key:"streamable",name:"Streamable",canPlay:r.canPlay.streamable,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Fpe())})})},{key:"wistia",name:"Wistia",canPlay:r.canPlay.wistia,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a($pe())})})},{key:"twitch",name:"Twitch",canPlay:r.canPlay.twitch,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(zpe())})})},{key:"dailymotion",name:"DailyMotion",canPlay:r.canPlay.dailymotion,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Vpe())})})},{key:"mixcloud",name:"Mixcloud",canPlay:r.canPlay.mixcloud,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Upe())})})},{key:"vidyard",name:"Vidyard",canPlay:r.canPlay.vidyard,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Hpe())})})},{key:"kaltura",name:"Kaltura",canPlay:r.canPlay.kaltura,lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Wpe())})})},{key:"file",name:"FilePlayer",canPlay:r.canPlay.file,canEnablePIP:function(u){return r.canPlay.file(u)&&(document.pictureInPictureEnabled||(0,n.supportsWebKitPresentationMode)())&&!r.AUDIO_EXTENSIONS.test(u)},lazyPlayer:(0,t.lazy)(function(){return Promise.resolve().then(function(){return a(Gpe())})})}];e.default=s})(f7);var Bm={},Y8=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Kpe(e,t){return!!(e===t||Y8(e)&&Y8(t))}function Xpe(e,t){if(e.length!==t.length)return!1;for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(C){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(_){return _.__proto__||Object.getPrototypeOf(_)},E(C)}function T(C,y,_){return y in C?Object.defineProperty(C,y,{value:_,enumerable:!0,configurable:!0,writable:!0}):C[y]=_,C}var O=5e3,A=function(C){h(_,C);var y=m(_);function _(){var v;c(this,_);for(var x=arguments.length,I=new Array(x),R=0;R0&&x<1;if(M){var N=this.player.getDuration();if(!N){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(N*x,R);return}this.player.seekTo(x,R)}},{key:"render",value:function(){var x=this.props.activePlayer;return x?n.default.createElement(x,u({},this.props,{onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError})):null}}]),_}(n.Component);e.default=A,T(A,"displayName","Player"),T(A,"propTypes",o.propTypes),T(A,"defaultProps",o.defaultProps)})(I7);var Zg={},Q8;function t1e(){return Q8||(Q8=1,function(e){function t(O){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(C){return typeof C}:t=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t(O)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(P);function r(){if(typeof WeakMap!="function")return null;var O=new WeakMap;return r=function(){return O},O}function o(O){if(O&&O.__esModule)return O;if(O===null||t(O)!=="object"&&typeof O!="function")return{default:O};var A=r();if(A&&A.has(O))return A.get(O);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _ in O)if(Object.prototype.hasOwnProperty.call(O,_)){var v=y?Object.getOwnPropertyDescriptor(O,_):null;v&&(v.get||v.set)?Object.defineProperty(C,_,v):C[_]=O[_]}return C.default=O,A&&A.set(O,C),C}function i(O,A){var C=Object.keys(O);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(O);A&&(y=y.filter(function(_){return Object.getOwnPropertyDescriptor(O,_).enumerable})),C.push.apply(C,y)}return C}function a(O){for(var A=1;A"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function S(O){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},S(O)}function b(O,A,C){return A in O?Object.defineProperty(O,A,{value:C,enumerable:!0,configurable:!0,writable:!0}):O[A]=C,O}var g="64px",E={},T=function(O){c(C,O);var A=d(C);function C(){var y;s(this,C);for(var _=arguments.length,v=new Array(_),x=0;x<_;x++)v[x]=arguments[x];return y=A.call.apply(A,[this].concat(v)),b(p(y),"mounted",!1),b(p(y),"state",{image:null}),b(p(y),"handleKeyPress",function(I){(I.key==="Enter"||I.key===" ")&&y.props.onClick()}),y}return u(C,[{key:"componentDidMount",value:function(){this.mounted=!0,this.fetchImage(this.props)}},{key:"componentDidUpdate",value:function(_){var v=this.props,x=v.url,I=v.light;(_.url!==x||_.light!==I)&&this.fetchImage(this.props)}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"fetchImage",value:function(_){var v=this,x=_.url,I=_.light,R=_.oEmbedUrl;if(!n.default.isValidElement(I)){if(typeof I=="string"){this.setState({image:I});return}if(E[x]){this.setState({image:E[x]});return}return this.setState({image:null}),window.fetch(R.replace("{url}",x)).then(function(k){return k.json()}).then(function(k){if(k.thumbnail_url&&v.mounted){var M=k.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");v.setState({image:M}),E[x]=M}})}}},{key:"render",value:function(){var _=this.props,v=_.light,x=_.onClick,I=_.playIcon,R=_.previewTabIndex,k=this.state.image,M=n.default.isValidElement(v),N={display:"flex",alignItems:"center",justifyContent:"center"},D={preview:a({width:"100%",height:"100%",backgroundImage:k&&!M?"url(".concat(k,")"):void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer"},N),shadow:a({background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:g,width:g,height:g,position:M?"absolute":void 0},N),playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},L=n.default.createElement("div",{style:D.shadow,className:"react-player__shadow"},n.default.createElement("div",{style:D.playIcon,className:"react-player__play-icon"}));return n.default.createElement("div",{style:D.preview,className:"react-player__preview",onClick:x,tabIndex:R,onKeyPress:this.handleKeyPress},M?v:null,I||L)}}]),C}(n.Component);e.default=T}(Zg)),Zg}Object.defineProperty(Bm,"__esModule",{value:!0});Bm.createReactPlayer=void 0;var hs=k7(P),n1e=jm(h7),Qg=jm(Zpe),J8=jm(lS),Rc=Gs,r1e=ht,o1e=jm(I7);function jm(e){return e&&e.__esModule?e:{default:e}}function tf(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tf=function(n){return typeof n}:tf=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},tf(e)}function e6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function t6(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function l0(e){return l0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},l0(e)}function Ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R7(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return R7=function(){return e},e}function k7(e){if(e&&e.__esModule)return e;if(e===null||tf(e)!=="object"&&typeof e!="function")return{default:e};var t=R7();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}var m1e=(0,hs.lazy)(function(){return Promise.resolve().then(function(){return k7(t1e())})}),y1e=typeof window<"u"&&window.document,g1e=typeof ho<"u"&&ho.window&&ho.window.document,v1e=Object.keys(Rc.propTypes),w1e=y1e||g1e?hs.Suspense:function(){return null},mc=[],b1e=function(t,n){var r,o;return o=r=function(i){f1e(s,i);var a=d1e(s);function s(){var l;u1e(this,s);for(var u=arguments.length,c=new Array(u),f=0;f0&&arguments[0]!==void 0?arguments[0]:"player";return l.player?l.player.getInternalPlayer(d):null}),Ht(Un(l),"seekTo",function(d,h,p){if(!l.player)return null;l.player.seekTo(d,h,p)}),Ht(Un(l),"handleReady",function(){l.props.onReady(Un(l))}),Ht(Un(l),"getActivePlayer",(0,Qg.default)(function(d){for(var h=0,p=[].concat(mc,Jg(t));h=t||C<0||f&&y>=i}function b(){var A=ev();if(S(A))return g(A);s=setTimeout(b,m(A))}function g(A){return s=void 0,d&&r?h(A):(r=o=void 0,a)}function E(){s!==void 0&&clearTimeout(s),u=0,r=l=o=s=void 0}function T(){return s===void 0?a:g(ev())}function O(){var A=ev(),C=S(A);if(r=arguments,o=this,l=A,C){if(s===void 0)return p(l);if(f)return s=setTimeout(b,t),h(l)}return s===void 0&&(s=setTimeout(b,t)),a}return O.cancel=E,O.flush=T,O}function Tw(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function N1e(e){return!!e&&typeof e=="object"}function B1e(e){return typeof e=="symbol"||N1e(e)&&k1e.call(e)==_1e}function i6(e){if(typeof e=="number")return e;if(B1e(e))return o6;if(Tw(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Tw(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(E1e,"");var n=x1e.test(e);return n||O1e.test(e)?A1e(e.slice(2),n?2:8):C1e.test(e)?o6:+e}var j1e=L1e,N7={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],o=0;o0?1:0):0};ce.lazySlidesOnLeft=j7;var F7=function(t){return t.centerMode?Math.floor((t.slidesToShow-1)/2)+1+(parseInt(t.centerPadding)>0?1:0):t.slidesToShow};ce.lazySlidesOnRight=F7;var u0=function(t){return t&&t.offsetWidth||0};ce.getWidth=u0;var L_=function(t){return t&&t.offsetHeight||0};ce.getHeight=L_;var N_=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r,o,i,a;return r=t.startX-t.curX,o=t.startY-t.curY,i=Math.atan2(o,r),a=Math.round(i*180/Math.PI),a<0&&(a=360-Math.abs(a)),a<=45&&a>=0||a<=360&&a>=315?"left":a>=135&&a<=225?"right":n===!0?a>=35&&a<=135?"up":"down":"vertical"};ce.getSwipeDirection=N_;var B_=function(t){var n=!0;return t.infinite||(t.centerMode&&t.currentSlide>=t.slideCount-1||t.slideCount<=t.slidesToShow||t.currentSlide>=t.slideCount-t.slidesToShow)&&(n=!1),n};ce.canGoNext=B_;var U1e=function(t,n){var r={};return n.forEach(function(o){return r[o]=t[o]}),r};ce.extractObject=U1e;var H1e=function(t){var n=F1e.default.Children.count(t.children),r=t.listRef,o=Math.ceil(u0(r)),i=t.trackRef&&t.trackRef.node,a=Math.ceil(u0(i)),s;if(t.vertical)s=o;else{var l=t.centerMode&&parseInt(t.centerPadding)*2;typeof t.centerPadding=="string"&&t.centerPadding.slice(-1)==="%"&&(l*=o/100),s=Math.ceil((o-l)/t.slidesToShow)}var u=r&&L_(r.querySelector('[data-index="0"]')),c=u*t.slidesToShow,f=t.currentSlide===void 0?t.initialSlide:t.currentSlide;t.rtl&&t.currentSlide===void 0&&(f=n-1-t.initialSlide);var d=t.lazyLoadedList||[],h=k_(Ot(Ot({},t),{},{currentSlide:f,lazyLoadedList:d}));d=d.concat(h);var p={slideCount:n,slideWidth:s,listWidth:o,trackWidth:a,currentSlide:f,slideHeight:u,listHeight:c,lazyLoadedList:d};return t.autoplaying===null&&t.autoplay&&(p.autoplaying="playing"),p};ce.initializedState=H1e;var W1e=function(t){var n=t.waitForAnimate,r=t.animating,o=t.fade,i=t.infinite,a=t.index,s=t.slideCount,l=t.lazyLoad,u=t.currentSlide,c=t.centerMode,f=t.slidesToScroll,d=t.slidesToShow,h=t.useCSS,p=t.lazyLoadedList;if(n&&r)return{};var m=a,S,b,g,E={},T={},O=i?a:B7(a,0,s-1);if(o){if(!i&&(a<0||a>=s))return{};a<0?m=a+s:a>=s&&(m=a-s),l&&p.indexOf(m)<0&&(p=p.concat(m)),E={animating:!0,currentSlide:m,lazyLoadedList:p,targetSlide:m},T={animating:!1,targetSlide:m}}else S=m,m<0?(S=m+s,i?s%f!==0&&(S=s-s%f):S=0):!B_(t)&&m>u?m=S=u:c&&m>=s?(m=i?s:s-1,S=i?0:s-1):m>=s&&(S=m-s,i?s%f!==0&&(S=0):S=s-d),!i&&m+d>=s&&(S=s-d),b=Gf(Ot(Ot({},t),{},{slideIndex:m})),g=Gf(Ot(Ot({},t),{},{slideIndex:S})),i||(b===g&&(m=S),b=g),l&&(p=p.concat(k_(Ot(Ot({},t),{},{currentSlide:m})))),h?(E={animating:!0,currentSlide:S,trackStyle:j_(Ot(Ot({},t),{},{left:b})),lazyLoadedList:p,targetSlide:O},T={animating:!1,currentSlide:S,trackStyle:Wf(Ot(Ot({},t),{},{left:g})),swipeLeft:null,targetSlide:O}):E={currentSlide:S,trackStyle:Wf(Ot(Ot({},t),{},{left:g})),lazyLoadedList:p,targetSlide:O};return{state:E,nextState:T}};ce.slideHandler=W1e;var G1e=function(t,n){var r,o,i,a,s,l=t.slidesToScroll,u=t.slidesToShow,c=t.slideCount,f=t.currentSlide,d=t.targetSlide,h=t.lazyLoad,p=t.infinite;if(a=c%l!==0,r=a?0:(c-f)%l,n.message==="previous")i=r===0?l:u-r,s=f-i,h&&!p&&(o=f-i,s=o===-1?c-1:o),p||(s=d-l);else if(n.message==="next")i=r===0?l:r,s=f+i,h&&!p&&(s=(f+l)%c+r),p||(s=d+l);else if(n.message==="dots")s=n.index*n.slidesToScroll;else if(n.message==="children"){if(s=n.index,p){var m=U7(Ot(Ot({},t),{},{targetSlide:s}));s>n.currentSlide&&m==="left"?s=s-c:s10)return{scrolling:!0};s&&(g.swipeLength=_);var v=(l?-1:1)*(g.curX>g.startX?1:-1);s&&(v=g.curY>g.startY?1:-1);var x=Math.ceil(m/S),I=N_(n.touchObject,s),R=g.swipeLength;return b||(u===0&&(I==="right"||I==="down")||u+1>=x&&(I==="left"||I==="up")||!B_(n)&&(I==="left"||I==="up"))&&(R=g.swipeLength*c,f===!1&&d&&(d(I),C.edgeDragged=!0)),!h&&E&&(E(I),C.swiped=!0),i?A=y+R*(T/O)*v:l?A=y-R*v:A=y+R*v,s&&(A=y+R*v),C=Ot(Ot({},C),{},{touchObject:g,swipeLeft:A,trackStyle:Wf(Ot(Ot({},n),{},{left:A}))}),Math.abs(g.curX-g.startX)10&&(C.swiping=!0,Ms(t)),C}};ce.swipeMove=q1e;var Y1e=function(t,n){var r=n.dragging,o=n.swipe,i=n.touchObject,a=n.listWidth,s=n.touchThreshold,l=n.verticalSwiping,u=n.listHeight,c=n.swipeToSlide,f=n.scrolling,d=n.onSwipe,h=n.targetSlide,p=n.currentSlide,m=n.infinite;if(!r)return o&&Ms(t),{};var S=l?u/s:a/s,b=N_(i,l),g={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(f||!i.swipeLength)return g;if(i.swipeLength>S){Ms(t),d&&d(b);var E,T,O=m?p:h;switch(b){case"left":case"up":T=O+Rw(n),E=c?Iw(n,T):T,g.currentDirection=0;break;case"right":case"down":T=O-Rw(n),E=c?Iw(n,T):T,g.currentDirection=1;break;default:E=O}g.triggerSlideHandler=E}else{var A=Gf(n);g.trackStyle=j_(Ot(Ot({},n),{},{left:A}))}return g};ce.swipeEnd=Y1e;var $7=function(t){for(var n=t.infinite?t.slideCount*2:t.slideCount,r=t.infinite?t.slidesToShow*-1:0,o=t.infinite?t.slidesToShow*-1:0,i=[];rr[r.length-1])n=r[r.length-1];else for(var i in r){if(nt.swipeLeft*-1)return r=l,!1}else if(l.offsetLeft-n+u0(l)/2>t.swipeLeft*-1)return r=l,!1;return!0}),!r)return 0;var a=t.rtl===!0?t.slideCount-t.currentSlide:t.currentSlide,s=Math.abs(r.dataset.index-a)||1;return s}else return t.slidesToScroll};ce.getSlideCount=Rw;var zm=function(t,n){return n.reduce(function(r,o){return r&&t.hasOwnProperty(o)},!0)?null:console.error("Keys Missing:",t)};ce.checkSpecKeys=zm;var Wf=function(t){zm(t,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var n,r,o=t.slideCount+2*t.slidesToShow;t.vertical?r=o*t.slideHeight:n=V7(t)*t.slideWidth;var i={opacity:1,transition:"",WebkitTransition:""};if(t.useTransform){var a=t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",s=t.vertical?"translate3d(0px, "+t.left+"px, 0px)":"translate3d("+t.left+"px, 0px, 0px)",l=t.vertical?"translateY("+t.left+"px)":"translateX("+t.left+"px)";i=Ot(Ot({},i),{},{WebkitTransform:a,transform:s,msTransform:l})}else t.vertical?i.top=t.left:i.left=t.left;return t.fade&&(i={opacity:1}),n&&(i.width=n),r&&(i.height=r),window&&!window.addEventListener&&window.attachEvent&&(t.vertical?i.marginTop=t.left+"px":i.marginLeft=t.left+"px"),i};ce.getTrackCSS=Wf;var j_=function(t){zm(t,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var n=Wf(t);return t.useTransform?(n.WebkitTransition="-webkit-transform "+t.speed+"ms "+t.cssEase,n.transition="transform "+t.speed+"ms "+t.cssEase):t.vertical?n.transition="top "+t.speed+"ms "+t.cssEase:n.transition="left "+t.speed+"ms "+t.cssEase,n};ce.getTrackAnimateCSS=j_;var Gf=function(t){if(t.unslick)return 0;zm(t,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var n=t.slideIndex,r=t.trackRef,o=t.infinite,i=t.centerMode,a=t.slideCount,s=t.slidesToShow,l=t.slidesToScroll,u=t.slideWidth,c=t.listWidth,f=t.variableWidth,d=t.slideHeight,h=t.fade,p=t.vertical,m=0,S,b,g=0;if(h||t.slideCount===1)return 0;var E=0;if(o?(E=-nf(t),a%l!==0&&n+l>a&&(E=-(n>a?s-(n-a):a%l)),i&&(E+=parseInt(s/2))):(a%l!==0&&n+l>a&&(E=s-a%l),i&&(E=parseInt(s/2))),m=E*u,g=E*d,p?S=n*d*-1+g:S=n*u*-1+m,f===!0){var T,O=r&&r.node;if(T=n+nf(t),b=O&&O.childNodes[T],S=b?b.offsetLeft*-1:0,i===!0){T=o?n+nf(t):n,b=O&&O.children[T],S=0;for(var A=0;At.currentSlide?t.targetSlide>t.currentSlide+H7(t)?"left":"right":t.targetSlide0&&(a+=1),o&&n%2===0&&(a+=1),a}return o?0:n-1};ce.slidesOnRight=H7;var W7=function(t){var n=t.slidesToShow,r=t.centerMode,o=t.rtl,i=t.centerPadding;if(r){var a=(n-1)/2+1;return parseInt(i)>0&&(a+=1),!o&&n%2===0&&(a+=1),a}return o?n-1:0};ce.slidesOnLeft=W7;var Z1e=function(){return!!(typeof window<"u"&&window.document&&window.document.createElement)};ce.canUseDOM=Z1e;var Vm={};function kw(e){"@babel/helpers - typeof";return kw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kw(e)}Object.defineProperty(Vm,"__esModule",{value:!0});Vm.Track=void 0;var sa=G7(P),tv=G7($m),nv=ce;function G7(e){return e&&e.__esModule?e:{default:e}}function Mw(){return Mw=Object.assign||function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function c0(e){return c0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},c0(e)}function l6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t=t.slideCount,t.centerMode?(i=Math.floor(t.slidesToShow/2),r=(a-t.currentSlide)%t.slideCount===0,a>t.currentSlide-i-1&&a<=t.currentSlide+i&&(n=!0)):n=t.currentSlide<=a&&a=t.slideCount?s=t.targetSlide-t.slideCount:s=t.targetSlide;var l=a===s;return{"slick-slide":!0,"slick-active":n,"slick-center":r,"slick-cloned":o,"slick-current":l}},o0e=function(t){var n={};return(t.variableWidth===void 0||t.variableWidth===!1)&&(n.width=t.slideWidth),t.fade&&(n.position="relative",t.vertical?n.top=-t.index*parseInt(t.slideHeight):n.left=-t.index*parseInt(t.slideWidth),n.opacity=t.currentSlide===t.index?1:0,t.useCSS&&(n.transition="opacity "+t.speed+"ms "+t.cssEase+", visibility "+t.speed+"ms "+t.cssEase)),n},ov=function(t,n){return t.key||n},i0e=function(t){var n,r=[],o=[],i=[],a=sa.default.Children.count(t.children),s=(0,nv.lazyStartIndex)(t),l=(0,nv.lazyEndIndex)(t);return sa.default.Children.forEach(t.children,function(u,c){var f,d={message:"children",index:c,slidesToScroll:t.slidesToScroll,currentSlide:t.currentSlide};!t.lazyLoad||t.lazyLoad&&t.lazyLoadedList.indexOf(c)>=0?f=u:f=sa.default.createElement("div",null);var h=o0e(hr(hr({},t),{},{index:c})),p=f.props.className||"",m=rv(hr(hr({},t),{},{index:c}));if(r.push(sa.default.cloneElement(f,{key:"original"+ov(f,c),"data-index":c,className:(0,tv.default)(m,p),tabIndex:"-1","aria-hidden":!m["slick-active"],style:hr(hr({outline:"none"},f.props.style||{}),h),onClick:function(g){f.props&&f.props.onClick&&f.props.onClick(g),t.focusOnSelect&&t.focusOnSelect(d)}})),t.infinite&&t.fade===!1){var S=a-c;S<=(0,nv.getPreClones)(t)&&a!==t.slidesToShow&&(n=-S,n>=s&&(f=u),m=rv(hr(hr({},t),{},{index:n})),o.push(sa.default.cloneElement(f,{key:"precloned"+ov(f,n),"data-index":n,tabIndex:"-1",className:(0,tv.default)(m,p),"aria-hidden":!m["slick-active"],style:hr(hr({},f.props.style||{}),h),onClick:function(g){f.props&&f.props.onClick&&f.props.onClick(g),t.focusOnSelect&&t.focusOnSelect(d)}}))),a!==t.slidesToShow&&(n=a+c,n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function f0(e){return f0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},f0(e)}var g0e=function(t){var n;return t.infinite?n=Math.ceil(t.slideCount/t.slidesToScroll):n=Math.ceil((t.slideCount-t.slidesToShow)/t.slidesToScroll)+1,n},v0e=function(e){d0e(n,e);var t=h0e(n);function n(){return c0e(this,n),t.apply(this,arguments)}return f0e(n,[{key:"clickHandler",value:function(o,i){i.preventDefault(),this.props.clickHandler(o)}},{key:"render",value:function(){for(var o=this.props,i=o.onMouseEnter,a=o.onMouseOver,s=o.onMouseLeave,l=o.infinite,u=o.slidesToScroll,c=o.slidesToShow,f=o.slideCount,d=o.currentSlide,h=g0e({slideCount:f,slidesToScroll:u,slidesToShow:c,infinite:l}),p={onMouseEnter:i,onMouseOver:a,onMouseLeave:s},m=[],S=0;S=T&&d<=g:d===T}),A={message:"dots",index:S,slidesToScroll:u,currentSlide:d},C=this.clickHandler.bind(this,A);m=m.concat(Ih.default.createElement("li",{key:S,className:O},Ih.default.cloneElement(this.props.customPaging(S),{onClick:C})))}return Ih.default.cloneElement(this.props.appendDots(m),l0e({className:this.props.dotsClass},p))}}]),n}(Ih.default.PureComponent);Um.Dots=v0e;var Ru={};function Fw(e){"@babel/helpers - typeof";return Fw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fw(e)}Object.defineProperty(Ru,"__esModule",{value:!0});Ru.PrevArrow=Ru.NextArrow=void 0;var uu=q7(P),X7=q7($m),w0e=ce;function q7(e){return e&&e.__esModule?e:{default:e}}function d0(){return d0=Object.assign||function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function p0(e){return p0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},p0(e)}var C0e=function(e){Q7(n,e);var t=J7(n);function n(){return Y7(this,n),t.apply(this,arguments)}return Z7(n,[{key:"clickHandler",value:function(o,i){i&&i.preventDefault(),this.props.clickHandler(o,i)}},{key:"render",value:function(){var o={"slick-arrow":!0,"slick-prev":!0},i=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(this.props.currentSlide===0||this.props.slideCount<=this.props.slidesToShow)&&(o["slick-disabled"]=!0,i=null);var a={key:"0","data-role":"none",className:(0,X7.default)(o),style:{display:"block"},onClick:i},s={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},l;return this.props.prevArrow?l=uu.default.cloneElement(this.props.prevArrow,h0(h0({},a),s)):l=uu.default.createElement("button",d0({key:"0",type:"button"},a)," ","Previous"),l}}]),n}(uu.default.PureComponent);Ru.PrevArrow=C0e;var x0e=function(e){Q7(n,e);var t=J7(n);function n(){return Y7(this,n),t.apply(this,arguments)}return Z7(n,[{key:"clickHandler",value:function(o,i){i&&i.preventDefault(),this.props.clickHandler(o,i)}},{key:"render",value:function(){var o={"slick-arrow":!0,"slick-next":!0},i=this.clickHandler.bind(this,{message:"next"});(0,w0e.canGoNext)(this.props)||(o["slick-disabled"]=!0,i=null);var a={key:"1","data-role":"none",className:(0,X7.default)(o),style:{display:"block"},onClick:i},s={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},l;return this.props.nextArrow?l=uu.default.cloneElement(this.props.nextArrow,h0(h0({},a),s)):l=uu.default.createElement("button",d0({key:"1",type:"button"},a)," ","Next"),l}}]),n}(uu.default.PureComponent);Ru.NextArrow=x0e;var e9=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!zw||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),R0e?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!zw||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=I0e.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),t9=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof ku(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new $0e(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ku(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new z0e(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),r9=typeof WeakMap<"u"?new WeakMap:new e9,o9=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=k0e.getInstance(),r=new V0e(t,n,this);r9.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){o9.prototype[e]=function(){var t;return(t=r9.get(this))[e].apply(t,arguments)}});var U0e=function(){return typeof m0.ResizeObserver<"u"?m0.ResizeObserver:o9}();const H0e=Object.freeze(Object.defineProperty({__proto__:null,default:U0e},Symbol.toStringTag,{value:"Module"})),W0e=q6(H0e);Object.defineProperty(Fm,"__esModule",{value:!0});Fm.InnerSlider=void 0;var Qn=Td(P),G0e=Td(L7),K0e=Td(j1e),X0e=Td($m),Mt=ce,q0e=Vm,Y0e=Um,m6=Ru,Z0e=Td(W0e);function Td(e){return e&&e.__esModule?e:{default:e}}function g0(e){"@babel/helpers - typeof";return g0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g0(e)}function v0(){return v0=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function J0e(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function y6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ae(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function w0(e){return w0=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},w0(e)}function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ame=function(e){nme(n,e);var t=rme(n);function n(r){var o;eme(this,n),o=t.call(this,r),ze($e(o),"listRefHandler",function(a){return o.list=a}),ze($e(o),"trackRefHandler",function(a){return o.track=a}),ze($e(o),"adaptHeight",function(){if(o.props.adaptiveHeight&&o.list){var a=o.list.querySelector('[data-index="'.concat(o.state.currentSlide,'"]'));o.list.style.height=(0,Mt.getHeight)(a)+"px"}}),ze($e(o),"componentDidMount",function(){if(o.props.onInit&&o.props.onInit(),o.props.lazyLoad){var a=(0,Mt.getOnDemandLazySlides)(Ae(Ae({},o.props),o.state));a.length>0&&(o.setState(function(l){return{lazyLoadedList:l.lazyLoadedList.concat(a)}}),o.props.onLazyLoad&&o.props.onLazyLoad(a))}var s=Ae({listRef:o.list,trackRef:o.track},o.props);o.updateState(s,!0,function(){o.adaptHeight(),o.props.autoplay&&o.autoPlay("update")}),o.props.lazyLoad==="progressive"&&(o.lazyLoadTimer=setInterval(o.progressiveLazyLoad,1e3)),o.ro=new Z0e.default(function(){o.state.animating?(o.onWindowResized(!1),o.callbackTimers.push(setTimeout(function(){return o.onWindowResized()},o.props.speed))):o.onWindowResized()}),o.ro.observe(o.list),document.querySelectorAll&&Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"),function(l){l.onfocus=o.props.pauseOnFocus?o.onSlideFocus:null,l.onblur=o.props.pauseOnFocus?o.onSlideBlur:null}),window.addEventListener?window.addEventListener("resize",o.onWindowResized):window.attachEvent("onresize",o.onWindowResized)}),ze($e(o),"componentWillUnmount",function(){o.animationEndCallback&&clearTimeout(o.animationEndCallback),o.lazyLoadTimer&&clearInterval(o.lazyLoadTimer),o.callbackTimers.length&&(o.callbackTimers.forEach(function(a){return clearTimeout(a)}),o.callbackTimers=[]),window.addEventListener?window.removeEventListener("resize",o.onWindowResized):window.detachEvent("onresize",o.onWindowResized),o.autoplayTimer&&clearInterval(o.autoplayTimer),o.ro.disconnect()}),ze($e(o),"componentDidUpdate",function(a){if(o.checkImagesLoad(),o.props.onReInit&&o.props.onReInit(),o.props.lazyLoad){var s=(0,Mt.getOnDemandLazySlides)(Ae(Ae({},o.props),o.state));s.length>0&&(o.setState(function(c){return{lazyLoadedList:c.lazyLoadedList.concat(s)}}),o.props.onLazyLoad&&o.props.onLazyLoad(s))}o.adaptHeight();var l=Ae(Ae({listRef:o.list,trackRef:o.track},o.props),o.state),u=o.didPropsChange(a);u&&o.updateState(l,u,function(){o.state.currentSlide>=Qn.default.Children.count(o.props.children)&&o.changeSlide({message:"index",index:Qn.default.Children.count(o.props.children)-o.props.slidesToShow,currentSlide:o.state.currentSlide}),o.props.autoplay?o.autoPlay("update"):o.pause("paused")})}),ze($e(o),"onWindowResized",function(a){o.debouncedResize&&o.debouncedResize.cancel(),o.debouncedResize=(0,K0e.default)(function(){return o.resizeWindow(a)},50),o.debouncedResize()}),ze($e(o),"resizeWindow",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=!!(o.track&&o.track.node);if(s){var l=Ae(Ae({listRef:o.list,trackRef:o.track},o.props),o.state);o.updateState(l,a,function(){o.props.autoplay?o.autoPlay("update"):o.pause("paused")}),o.setState({animating:!1}),clearTimeout(o.animationEndCallback),delete o.animationEndCallback}}),ze($e(o),"updateState",function(a,s,l){var u=(0,Mt.initializedState)(a);a=Ae(Ae(Ae({},a),u),{},{slideIndex:u.currentSlide});var c=(0,Mt.getTrackLeft)(a);a=Ae(Ae({},a),{},{left:c});var f=(0,Mt.getTrackCSS)(a);(s||Qn.default.Children.count(o.props.children)!==Qn.default.Children.count(a.children))&&(u.trackStyle=f),o.setState(u,l)}),ze($e(o),"ssrInit",function(){if(o.props.variableWidth){var a=0,s=0,l=[],u=(0,Mt.getPreClones)(Ae(Ae(Ae({},o.props),o.state),{},{slideCount:o.props.children.length})),c=(0,Mt.getPostClones)(Ae(Ae(Ae({},o.props),o.state),{},{slideCount:o.props.children.length}));o.props.children.forEach(function(C){l.push(C.props.style.width),a+=C.props.style.width});for(var f=0;f=s&&o.onWindowResized()};if(!u.onclick)u.onclick=function(){return u.parentNode.focus()};else{var f=u.onclick;u.onclick=function(){f(),u.parentNode.focus()}}u.onload||(o.props.lazyLoad?u.onload=function(){o.adaptHeight(),o.callbackTimers.push(setTimeout(o.onWindowResized,o.props.speed))}:(u.onload=c,u.onerror=function(){c(),o.props.onLazyLoadError&&o.props.onLazyLoadError()}))})}),ze($e(o),"progressiveLazyLoad",function(){for(var a=[],s=Ae(Ae({},o.props),o.state),l=o.state.currentSlide;l=-(0,Mt.getPreClones)(s);u--)if(o.state.lazyLoadedList.indexOf(u)<0){a.push(u);break}a.length>0?(o.setState(function(c){return{lazyLoadedList:c.lazyLoadedList.concat(a)}}),o.props.onLazyLoad&&o.props.onLazyLoad(a)):o.lazyLoadTimer&&(clearInterval(o.lazyLoadTimer),delete o.lazyLoadTimer)}),ze($e(o),"slideHandler",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=o.props,u=l.asNavFor,c=l.beforeChange,f=l.onLazyLoad,d=l.speed,h=l.afterChange,p=o.state.currentSlide,m=(0,Mt.slideHandler)(Ae(Ae(Ae({index:a},o.props),o.state),{},{trackRef:o.track,useCSS:o.props.useCSS&&!s})),S=m.state,b=m.nextState;if(S){c&&c(p,S.currentSlide);var g=S.lazyLoadedList.filter(function(E){return o.state.lazyLoadedList.indexOf(E)<0});f&&g.length>0&&f(g),!o.props.waitForAnimate&&o.animationEndCallback&&(clearTimeout(o.animationEndCallback),h&&h(p),delete o.animationEndCallback),o.setState(S,function(){u&&o.asNavForIndex!==a&&(o.asNavForIndex=a,u.innerSlider.slideHandler(a)),b&&(o.animationEndCallback=setTimeout(function(){var E=b.animating,T=Q0e(b,["animating"]);o.setState(T,function(){o.callbackTimers.push(setTimeout(function(){return o.setState({animating:E})},10)),h&&h(S.currentSlide),delete o.animationEndCallback})},d))})}}),ze($e(o),"changeSlide",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=Ae(Ae({},o.props),o.state),u=(0,Mt.changeSlide)(l,a);if(!(u!==0&&!u)&&(s===!0?o.slideHandler(u,s):o.slideHandler(u),o.props.autoplay&&o.autoPlay("update"),o.props.focusOnSelect)){var c=o.list.querySelectorAll(".slick-current");c[0]&&c[0].focus()}}),ze($e(o),"clickHandler",function(a){o.clickable===!1&&(a.stopPropagation(),a.preventDefault()),o.clickable=!0}),ze($e(o),"keyHandler",function(a){var s=(0,Mt.keyHandler)(a,o.props.accessibility,o.props.rtl);s!==""&&o.changeSlide({message:s})}),ze($e(o),"selectHandler",function(a){o.changeSlide(a)}),ze($e(o),"disableBodyScroll",function(){var a=function(l){l=l||window.event,l.preventDefault&&l.preventDefault(),l.returnValue=!1};window.ontouchmove=a}),ze($e(o),"enableBodyScroll",function(){window.ontouchmove=null}),ze($e(o),"swipeStart",function(a){o.props.verticalSwiping&&o.disableBodyScroll();var s=(0,Mt.swipeStart)(a,o.props.swipe,o.props.draggable);s!==""&&o.setState(s)}),ze($e(o),"swipeMove",function(a){var s=(0,Mt.swipeMove)(a,Ae(Ae(Ae({},o.props),o.state),{},{trackRef:o.track,listRef:o.list,slideIndex:o.state.currentSlide}));s&&(s.swiping&&(o.clickable=!1),o.setState(s))}),ze($e(o),"swipeEnd",function(a){var s=(0,Mt.swipeEnd)(a,Ae(Ae(Ae({},o.props),o.state),{},{trackRef:o.track,listRef:o.list,slideIndex:o.state.currentSlide}));if(s){var l=s.triggerSlideHandler;delete s.triggerSlideHandler,o.setState(s),l!==void 0&&(o.slideHandler(l),o.props.verticalSwiping&&o.enableBodyScroll())}}),ze($e(o),"touchEnd",function(a){o.swipeEnd(a),o.clickable=!0}),ze($e(o),"slickPrev",function(){o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"previous"})},0))}),ze($e(o),"slickNext",function(){o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"next"})},0))}),ze($e(o),"slickGoTo",function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(a=Number(a),isNaN(a))return"";o.callbackTimers.push(setTimeout(function(){return o.changeSlide({message:"index",index:a,currentSlide:o.state.currentSlide},s)},0))}),ze($e(o),"play",function(){var a;if(o.props.rtl)a=o.state.currentSlide-o.props.slidesToScroll;else if((0,Mt.canGoNext)(Ae(Ae({},o.props),o.state)))a=o.state.currentSlide+o.props.slidesToScroll;else return!1;o.slideHandler(a)}),ze($e(o),"autoPlay",function(a){o.autoplayTimer&&clearInterval(o.autoplayTimer);var s=o.state.autoplaying;if(a==="update"){if(s==="hovered"||s==="focused"||s==="paused")return}else if(a==="leave"){if(s==="paused"||s==="focused")return}else if(a==="blur"&&(s==="paused"||s==="hovered"))return;o.autoplayTimer=setInterval(o.play,o.props.autoplaySpeed+50),o.setState({autoplaying:"playing"})}),ze($e(o),"pause",function(a){o.autoplayTimer&&(clearInterval(o.autoplayTimer),o.autoplayTimer=null);var s=o.state.autoplaying;a==="paused"?o.setState({autoplaying:"paused"}):a==="focused"?(s==="hovered"||s==="playing")&&o.setState({autoplaying:"focused"}):s==="playing"&&o.setState({autoplaying:"hovered"})}),ze($e(o),"onDotsOver",function(){return o.props.autoplay&&o.pause("hovered")}),ze($e(o),"onDotsLeave",function(){return o.props.autoplay&&o.state.autoplaying==="hovered"&&o.autoPlay("leave")}),ze($e(o),"onTrackOver",function(){return o.props.autoplay&&o.pause("hovered")}),ze($e(o),"onTrackLeave",function(){return o.props.autoplay&&o.state.autoplaying==="hovered"&&o.autoPlay("leave")}),ze($e(o),"onSlideFocus",function(){return o.props.autoplay&&o.pause("focused")}),ze($e(o),"onSlideBlur",function(){return o.props.autoplay&&o.state.autoplaying==="focused"&&o.autoPlay("blur")}),ze($e(o),"render",function(){var a=(0,X0e.default)("slick-slider",o.props.className,{"slick-vertical":o.props.vertical,"slick-initialized":!0}),s=Ae(Ae({},o.props),o.state),l=(0,Mt.extractObject)(s,["fade","cssEase","speed","infinite","centerMode","focusOnSelect","currentSlide","lazyLoad","lazyLoadedList","rtl","slideWidth","slideHeight","listHeight","vertical","slidesToShow","slidesToScroll","slideCount","trackStyle","variableWidth","unslick","centerPadding","targetSlide","useCSS"]),u=o.props.pauseOnHover;l=Ae(Ae({},l),{},{onMouseEnter:u?o.onTrackOver:null,onMouseLeave:u?o.onTrackLeave:null,onMouseOver:u?o.onTrackOver:null,focusOnSelect:o.props.focusOnSelect&&o.clickable?o.selectHandler:null});var c;if(o.props.dots===!0&&o.state.slideCount>=o.props.slidesToShow){var f=(0,Mt.extractObject)(s,["dotsClass","slideCount","slidesToShow","currentSlide","slidesToScroll","clickHandler","children","customPaging","infinite","appendDots"]),d=o.props.pauseOnDotsHover;f=Ae(Ae({},f),{},{clickHandler:o.changeSlide,onMouseEnter:d?o.onDotsLeave:null,onMouseOver:d?o.onDotsOver:null,onMouseLeave:d?o.onDotsLeave:null}),c=Qn.default.createElement(Y0e.Dots,f)}var h,p,m=(0,Mt.extractObject)(s,["infinite","centerMode","currentSlide","slideCount","slidesToShow","prevArrow","nextArrow"]);m.clickHandler=o.changeSlide,o.props.arrows&&(h=Qn.default.createElement(m6.PrevArrow,m),p=Qn.default.createElement(m6.NextArrow,m));var S=null;o.props.vertical&&(S={height:o.state.listHeight});var b=null;o.props.vertical===!1?o.props.centerMode===!0&&(b={padding:"0px "+o.props.centerPadding}):o.props.centerMode===!0&&(b={padding:o.props.centerPadding+" 0px"});var g=Ae(Ae({},S),b),E=o.props.touchMove,T={className:"slick-list",style:g,onClick:o.clickHandler,onMouseDown:E?o.swipeStart:null,onMouseMove:o.state.dragging&&E?o.swipeMove:null,onMouseUp:E?o.swipeEnd:null,onMouseLeave:o.state.dragging&&E?o.swipeEnd:null,onTouchStart:E?o.swipeStart:null,onTouchMove:o.state.dragging&&E?o.swipeMove:null,onTouchEnd:E?o.touchEnd:null,onTouchCancel:o.state.dragging&&E?o.swipeEnd:null,onKeyDown:o.props.accessibility?o.keyHandler:null},O={className:a,dir:"ltr",style:o.props.style};return o.props.unslick&&(T={className:"slick-list"},O={className:a}),Qn.default.createElement("div",O,o.props.unslick?"":h,Qn.default.createElement("div",v0({ref:o.listRefHandler},T),Qn.default.createElement(q0e.Track,v0({ref:o.trackRefHandler},l),o.props.children)),o.props.unslick?"":p,o.props.unslick?"":c)}),o.list=null,o.track=null,o.state=Ae(Ae({},G0e.default),{},{currentSlide:o.props.initialSlide,slideCount:Qn.default.Children.count(o.props.children)}),o.callbackTimers=[],o.clickable=!0,o.debouncedResize=null;var i=o.ssrInit();return o.state=Ae(Ae({},o.state),i),o}return tme(n,[{key:"didPropsChange",value:function(o){for(var i=!1,a=0,s=Object.keys(this.props);a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function T(y){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},T(y)}function O(y,_,v){return _ in y?Object.defineProperty(y,_,{value:v,enumerable:!0,configurable:!0,writable:!0}):y[_]=v,y}var A=(0,a.canUseDOM)()&&yme(),C=function(y){p(v,y);var _=S(v);function v(x){var I;return f(this,v),I=_.call(this,x),O(g(I),"innerSliderRefHandler",function(R){return I.innerSlider=R}),O(g(I),"slickPrev",function(){return I.innerSlider.slickPrev()}),O(g(I),"slickNext",function(){return I.innerSlider.slickNext()}),O(g(I),"slickGoTo",function(R){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return I.innerSlider.slickGoTo(R,k)}),O(g(I),"slickPause",function(){return I.innerSlider.pause("paused")}),O(g(I),"slickPlay",function(){return I.innerSlider.autoPlay("play")}),I.state={breakpoint:null},I._responsiveMediaHandlers=[],I}return h(v,[{key:"media",value:function(I,R){A.register(I,R),this._responsiveMediaHandlers.push({query:I,handler:R})}},{key:"componentDidMount",value:function(){var I=this;if(this.props.responsive){var R=this.props.responsive.map(function(M){return M.breakpoint});R.sort(function(M,N){return M-N}),R.forEach(function(M,N){var D;N===0?D=(0,o.default)({minWidth:0,maxWidth:M}):D=(0,o.default)({minWidth:R[N-1]+1,maxWidth:M}),(0,a.canUseDOM)()&&I.media(D,function(){I.setState({breakpoint:M})})});var k=(0,o.default)({minWidth:R.slice(-1)[0]});(0,a.canUseDOM)()&&this.media(k,function(){I.setState({breakpoint:null})})}}},{key:"componentWillUnmount",value:function(){this._responsiveMediaHandlers.forEach(function(I){A.unregister(I.query,I.handler)})}},{key:"render",value:function(){var I=this,R,k;this.state.breakpoint?(k=this.props.responsive.filter(function(W){return W.breakpoint===I.state.breakpoint}),R=k[0].settings==="unslick"?"unslick":c(c(c({},i.default),this.props),k[0].settings)):R=c(c({},i.default),this.props),R.centerMode&&(R.slidesToScroll>1,R.slidesToScroll=1),R.fade&&(R.slidesToShow>1,R.slidesToScroll>1,R.slidesToShow=1,R.slidesToScroll=1);var M=n.default.Children.toArray(this.props.children);M=M.filter(function(W){return typeof W=="string"?!!W.trim():!!W}),R.variableWidth&&(R.rows>1||R.slidesPerRow>1)&&(console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"),R.variableWidth=!1);for(var N=[],D=null,L=0;L=M.length));V+=1)B.push(n.default.cloneElement(M[V],{key:100*L+10*F+V,tabIndex:-1,style:{width:"".concat(100/R.slidesPerRow,"%"),display:"inline-block"}}));j.push(n.default.createElement("div",{key:10*L+F},B))}R.variableWidth?N.push(n.default.createElement("div",{key:L,style:{width:D}},j)):N.push(n.default.createElement("div",{key:L},j))}if(R==="unslick"){var K="regular slider "+(this.props.className||"");return n.default.createElement("div",{className:K},M)}else N.length<=R.slidesToShow&&(R.unslick=!0);return n.default.createElement(r.InnerSlider,l({style:this.props.style,ref:this.innerSliderRefHandler},R),N)}}]),v}(n.default.Component);e.default=C})(D7);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(D7);function n(o){return o&&o.__esModule?o:{default:o}}var r=t.default;e.default=r})(M7);const gme=Fe(M7);function vme({images:e}){const t={dots:!0,infinite:!0,speed:500,slidesToShow:1,slidesToScroll:1,adaptiveHeight:!0};return w.jsx(gme,{...t,children:e.map((n,r)=>w.jsx(ve,{children:w.jsx($u,{src:n})},r))})}const wme=({src:e,alt:t})=>w.jsx($u,{width:"100%",src:e,fallback:w.jsx(ve,{width:"100%",textAlign:"center",children:w.jsx(pe,{children:"Image failed to load."})}),fallbackStrategy:"onError",alt:t}),bme=({images:e})=>w.jsx(w.Fragment,{children:(e==null?void 0:e.length)===1?w.jsx(wme,{src:e[0]}):w.jsx(vme,{images:e})}),Sme=e=>{const[t,n]=P.useState(!1),r=new URL(e.url).hostname,o=r6.canPlay(e.url);return w.jsx(w.Fragment,{children:t?w.jsx(W5,{ratio:16/9,children:w.jsx(r6,{url:e.url,controls:!0,width:"100%",height:"100%",fallback:w.jsx(ve,{width:"100%",textAlign:"center",children:w.jsx(pe,{children:"Video failed to load."})}),fallbackStrategy:"onError"})}):w.jsx(be,{size:"sm",width:"100%",overflowWrap:"break-word",wordBreak:"break-all",onClick:()=>n(!0),isDisabled:!o,children:o?`Load video from ${r}`:"Cannot play this video."})})},_me=({videos:e})=>w.jsx(w.Fragment,{children:e.map((t,n)=>w.jsx(Sme,{url:t},n))});function Eme({images:e,videos:t}){return w.jsxs(w.Fragment,{children:[e&&w.jsx(bme,{images:e}),t&&w.jsx(_me,{videos:t})]})}function Cme(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var b0=Cme(P),xme=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},C6=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=Ome(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return b0.createElement("svg",xme({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),b0.createElement("path",{d:"M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z"}))},Ame=b0.memo?b0.memo(C6):C6,Pme=Ame;const Tme=Fe(Pme);function Ime(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var S0=Ime(P),Rme=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},x6=function(t){var n=t.color,r=n===void 0?"currentColor":n,o=t.size,i=o===void 0?24:o;t.children;var a=kme(t,["color","size","children"]),s="mdi-icon "+(a.className||"");return S0.createElement("svg",Rme({},a,{className:s,width:i,height:i,fill:r,viewBox:"0 0 24 24"}),S0.createElement("path",{d:"M10.5,12A1.5,1.5 0 0,1 12,10.5A1.5,1.5 0 0,1 13.5,12A1.5,1.5 0 0,1 12,13.5A1.5,1.5 0 0,1 10.5,12M10.5,16.5A1.5,1.5 0 0,1 12,15A1.5,1.5 0 0,1 13.5,16.5A1.5,1.5 0 0,1 12,18A1.5,1.5 0 0,1 10.5,16.5M10.5,7.5A1.5,1.5 0 0,1 12,6A1.5,1.5 0 0,1 13.5,7.5A1.5,1.5 0 0,1 12,9A1.5,1.5 0 0,1 10.5,7.5M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z"}))},Mme=S0.memo?S0.memo(x6):x6,Dme=Mme;const Lme=Fe(Dme);function Nme({pubkey:e,isOpen:t,onClose:n}){const[r,o]=P.useState([]),i=Ho(),a=async()=>{const l=await Z.getState().getAllLists(),u=(l==null?void 0:l.map(d=>({id:d.id,title:d.title,isAssigned:!1})))||[],c=await Z.getState().getListsWithUser(e),f=u.map(d=>({...d,isAssigned:!!(c!=null&&c.find(h=>h.id===d.id))}));o(f)};P.useEffect(()=>{t&&a()},[t]);const s=async(l,u)=>{try{u?(await Z.getState().removeUserFromList(l,e),i({title:"User removed from list",status:"success",duration:9e3,isClosable:!0})):(await Z.getState().addUserToList(l,e),i({title:"User added to list",status:"success",duration:9e3,isClosable:!0})),o(c=>c.map(f=>f.id===l?{...f,isAssigned:!u}:f))}catch(c){i({title:"Operation failed",description:c.message||"Something went wrong",status:"error",duration:9e3,isClosable:!0})}};return w.jsxs(xr,{isOpen:t,onClose:n,children:[w.jsx(Pr,{}),w.jsxs(Or,{children:[w.jsx(Ar,{children:"Add or Remove from List"}),w.jsx(Ir,{}),w.jsx(Tr,{children:r.length===0?w.jsx(pe,{children:"No lists found. Create one first."}):r.map(l=>w.jsxs(ft,{children:[w.jsx(pe,{children:l.title}),w.jsx(be,{onClick:()=>s(l.id,l.isAssigned),children:l.isAssigned?"Remove from List":"Add to List"})]},l.id))}),w.jsx(wd,{children:w.jsx(be,{colorScheme:"blue",mr:3,onClick:n,children:"Close"})})]})]})}var s9={exports:{}};(function(e,t){(function(n,r){e.exports=r(P)})(ho,function(n){return function(r){var o={};function i(a){if(o[a])return o[a].exports;var s=o[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=o,i.d=function(a,s,l){i.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:l})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,s){if(1&s&&(a=i(a)),8&s||4&s&&typeof a=="object"&&a&&a.__esModule)return a;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:a}),2&s&&typeof a!="string")for(var u in a)i.d(l,u,(function(c){return a[c]}).bind(null,u));return l},i.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(s,"a",s),s},i.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},i.p="/",i(i.s=1)}([function(r,o){r.exports=n},function(r,o,i){r.exports=i(2)},function(r,o,i){function a(_,v,x){return v in _?Object.defineProperty(_,v,{value:x,enumerable:!0,configurable:!0,writable:!0}):_[v]=x,_}function s(_,v){var x=Object.keys(_);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(_);v&&(I=I.filter(function(R){return Object.getOwnPropertyDescriptor(_,R).enumerable})),x.push.apply(x,I)}return x}function l(_,v){if(_==null)return{};var x,I,R=function(M,N){if(M==null)return{};var D,L,j={},F=Object.keys(M);for(L=0;L=0||(j[D]=M[D]);return j}(_,v);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(_);for(I=0;I=0||Object.prototype.propertyIsEnumerable.call(_,x)&&(R[x]=_[x])}return R}i.r(o);var u=i(0),c=i.n(u),f=function(_){for(var v=0,x=0;x<_.length;x++)v=(v<<5)-v+_.charCodeAt(x),v&=v;return Math.abs(v)},d=function(_,v){return Math.floor(_/Math.pow(10,v)%10)},h=function(_,v){return!(d(_,v)%2)},p=function(_,v,x){var I=_%v;return x&&d(_,x)%2===0?-I:I},m=function(_,v,x){return v[_%x]},S=function(_){var v=function(I,R){var k=f(I),M=R&&R.length;return Array.from({length:4},function(N,D){return{color:m(k+D,R,M),translateX:p(k*(D+1),40-(D+17),1),translateY:p(k*(D+1),40-(D+17),2),rotate:p(k*(D+1),360),isSquare:h(k,2)}})}(_.name,_.colors),x=u.useId();return u.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:_.size,height:_.size},_.title&&u.createElement("title",null,_.name),u.createElement("mask",{id:x,maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},u.createElement("rect",{width:80,height:80,rx:_.square?void 0:160,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(x,")")},u.createElement("rect",{width:80,height:80,fill:v[0].color}),u.createElement("rect",{x:10,y:30,width:80,height:v[1].isSquare?80:10,fill:v[1].color,transform:"translate("+v[1].translateX+" "+v[1].translateY+") rotate("+v[1].rotate+" 40 40)"}),u.createElement("circle",{cx:40,cy:40,fill:v[2].color,r:16,transform:"translate("+v[2].translateX+" "+v[2].translateY+")"}),u.createElement("line",{x1:0,y1:40,x2:80,y2:40,strokeWidth:2,stroke:v[3].color,transform:"translate("+v[3].translateX+" "+v[3].translateY+") rotate("+v[3].rotate+" 40 40)"})))},b=function(_){var v=function(I,R){var k=f(R),M=I&&I.length,N=Array.from({length:5},function(L,j){return m(k+j,I,M)}),D=[];return D[0]=N[0],D[1]=N[1],D[2]=N[1],D[3]=N[2],D[4]=N[2],D[5]=N[3],D[6]=N[3],D[7]=N[0],D[8]=N[4],D}(_.colors,_.name),x=c.a.useId();return c.a.createElement("svg",{viewBox:"0 0 90 90",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:_.size,height:_.size},_.title&&c.a.createElement("title",null,_.name),c.a.createElement("mask",{id:x,maskUnits:"userSpaceOnUse",x:0,y:0,width:90,height:90},c.a.createElement("rect",{width:90,height:90,rx:_.square?void 0:180,fill:"#FFFFFF"})),c.a.createElement("g",{mask:"url(#".concat(x,")")},c.a.createElement("path",{d:"M0 0h90v45H0z",fill:v[0]}),c.a.createElement("path",{d:"M0 45h90v45H0z",fill:v[1]}),c.a.createElement("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:v[2]}),c.a.createElement("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:v[3]}),c.a.createElement("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:v[4]}),c.a.createElement("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:v[5]}),c.a.createElement("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:v[6]}),c.a.createElement("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:v[7]}),c.a.createElement("circle",{cx:45,cy:45,r:23,fill:v[8]})))},g=function(_){var v=function(I,R){var k=f(I),M=R&&R.length;return Array.from({length:64},function(N,D){return m(k%(D+1),R,M)})}(_.name,_.colors),x=u.useId();return u.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:_.size,height:_.size},_.title&&u.createElement("title",null,_.name),u.createElement("mask",{id:x,"mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},u.createElement("rect",{width:80,height:80,rx:_.square?void 0:160,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(x,")")},u.createElement("rect",{width:10,height:10,fill:v[0]}),u.createElement("rect",{x:20,width:10,height:10,fill:v[1]}),u.createElement("rect",{x:40,width:10,height:10,fill:v[2]}),u.createElement("rect",{x:60,width:10,height:10,fill:v[3]}),u.createElement("rect",{x:10,width:10,height:10,fill:v[4]}),u.createElement("rect",{x:30,width:10,height:10,fill:v[5]}),u.createElement("rect",{x:50,width:10,height:10,fill:v[6]}),u.createElement("rect",{x:70,width:10,height:10,fill:v[7]}),u.createElement("rect",{y:10,width:10,height:10,fill:v[8]}),u.createElement("rect",{y:20,width:10,height:10,fill:v[9]}),u.createElement("rect",{y:30,width:10,height:10,fill:v[10]}),u.createElement("rect",{y:40,width:10,height:10,fill:v[11]}),u.createElement("rect",{y:50,width:10,height:10,fill:v[12]}),u.createElement("rect",{y:60,width:10,height:10,fill:v[13]}),u.createElement("rect",{y:70,width:10,height:10,fill:v[14]}),u.createElement("rect",{x:20,y:10,width:10,height:10,fill:v[15]}),u.createElement("rect",{x:20,y:20,width:10,height:10,fill:v[16]}),u.createElement("rect",{x:20,y:30,width:10,height:10,fill:v[17]}),u.createElement("rect",{x:20,y:40,width:10,height:10,fill:v[18]}),u.createElement("rect",{x:20,y:50,width:10,height:10,fill:v[19]}),u.createElement("rect",{x:20,y:60,width:10,height:10,fill:v[20]}),u.createElement("rect",{x:20,y:70,width:10,height:10,fill:v[21]}),u.createElement("rect",{x:40,y:10,width:10,height:10,fill:v[22]}),u.createElement("rect",{x:40,y:20,width:10,height:10,fill:v[23]}),u.createElement("rect",{x:40,y:30,width:10,height:10,fill:v[24]}),u.createElement("rect",{x:40,y:40,width:10,height:10,fill:v[25]}),u.createElement("rect",{x:40,y:50,width:10,height:10,fill:v[26]}),u.createElement("rect",{x:40,y:60,width:10,height:10,fill:v[27]}),u.createElement("rect",{x:40,y:70,width:10,height:10,fill:v[28]}),u.createElement("rect",{x:60,y:10,width:10,height:10,fill:v[29]}),u.createElement("rect",{x:60,y:20,width:10,height:10,fill:v[30]}),u.createElement("rect",{x:60,y:30,width:10,height:10,fill:v[31]}),u.createElement("rect",{x:60,y:40,width:10,height:10,fill:v[32]}),u.createElement("rect",{x:60,y:50,width:10,height:10,fill:v[33]}),u.createElement("rect",{x:60,y:60,width:10,height:10,fill:v[34]}),u.createElement("rect",{x:60,y:70,width:10,height:10,fill:v[35]}),u.createElement("rect",{x:10,y:10,width:10,height:10,fill:v[36]}),u.createElement("rect",{x:10,y:20,width:10,height:10,fill:v[37]}),u.createElement("rect",{x:10,y:30,width:10,height:10,fill:v[38]}),u.createElement("rect",{x:10,y:40,width:10,height:10,fill:v[39]}),u.createElement("rect",{x:10,y:50,width:10,height:10,fill:v[40]}),u.createElement("rect",{x:10,y:60,width:10,height:10,fill:v[41]}),u.createElement("rect",{x:10,y:70,width:10,height:10,fill:v[42]}),u.createElement("rect",{x:30,y:10,width:10,height:10,fill:v[43]}),u.createElement("rect",{x:30,y:20,width:10,height:10,fill:v[44]}),u.createElement("rect",{x:30,y:30,width:10,height:10,fill:v[45]}),u.createElement("rect",{x:30,y:40,width:10,height:10,fill:v[46]}),u.createElement("rect",{x:30,y:50,width:10,height:10,fill:v[47]}),u.createElement("rect",{x:30,y:60,width:10,height:10,fill:v[48]}),u.createElement("rect",{x:30,y:70,width:10,height:10,fill:v[49]}),u.createElement("rect",{x:50,y:10,width:10,height:10,fill:v[50]}),u.createElement("rect",{x:50,y:20,width:10,height:10,fill:v[51]}),u.createElement("rect",{x:50,y:30,width:10,height:10,fill:v[52]}),u.createElement("rect",{x:50,y:40,width:10,height:10,fill:v[53]}),u.createElement("rect",{x:50,y:50,width:10,height:10,fill:v[54]}),u.createElement("rect",{x:50,y:60,width:10,height:10,fill:v[55]}),u.createElement("rect",{x:50,y:70,width:10,height:10,fill:v[56]}),u.createElement("rect",{x:70,y:10,width:10,height:10,fill:v[57]}),u.createElement("rect",{x:70,y:20,width:10,height:10,fill:v[58]}),u.createElement("rect",{x:70,y:30,width:10,height:10,fill:v[59]}),u.createElement("rect",{x:70,y:40,width:10,height:10,fill:v[60]}),u.createElement("rect",{x:70,y:50,width:10,height:10,fill:v[61]}),u.createElement("rect",{x:70,y:60,width:10,height:10,fill:v[62]}),u.createElement("rect",{x:70,y:70,width:10,height:10,fill:v[63]})))},E=function(_){var v=function(I,R){var k,M=f(I),N=R&&R.length,D=m(M,R,N),L=p(M,10,1),j=L<5?L+4:L,F=p(M,10,2),B=F<5?F+4:F;return{wrapperColor:D,faceColor:(k=D,k.slice(0,1)==="#"&&(k=k.slice(1)),(299*parseInt(k.substr(0,2),16)+587*parseInt(k.substr(2,2),16)+114*parseInt(k.substr(4,2),16))/1e3>=128?"#000000":"#FFFFFF"),backgroundColor:m(M+13,R,N),wrapperTranslateX:j,wrapperTranslateY:B,wrapperRotate:p(M,360),wrapperScale:1+p(M,3)/10,isMouthOpen:h(M,2),isCircle:h(M,1),eyeSpread:p(M,5),mouthSpread:p(M,3),faceRotate:p(M,10,3),faceTranslateX:j>6?j/2:p(M,8,1),faceTranslateY:B>6?B/2:p(M,7,2)}}(_.name,_.colors),x=u.useId();return u.createElement("svg",{viewBox:"0 0 36 36",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:_.size,height:_.size},_.title&&u.createElement("title",null,_.name),u.createElement("mask",{id:x,maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36},u.createElement("rect",{width:36,height:36,rx:_.square?void 0:72,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(x,")")},u.createElement("rect",{width:36,height:36,fill:v.backgroundColor}),u.createElement("rect",{x:"0",y:"0",width:36,height:36,transform:"translate("+v.wrapperTranslateX+" "+v.wrapperTranslateY+") rotate("+v.wrapperRotate+" 18 18) scale("+v.wrapperScale+")",fill:v.wrapperColor,rx:v.isCircle?36:6}),u.createElement("g",{transform:"translate("+v.faceTranslateX+" "+v.faceTranslateY+") rotate("+v.faceRotate+" 18 18)"},v.isMouthOpen?u.createElement("path",{d:"M15 "+(19+v.mouthSpread)+"c2 1 4 1 6 0",stroke:v.faceColor,fill:"none",strokeLinecap:"round"}):u.createElement("path",{d:"M13,"+(19+v.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:v.faceColor}),u.createElement("rect",{x:14-v.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:v.faceColor}),u.createElement("rect",{x:20+v.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:v.faceColor}))))},T=function(_){var v=function(R,k){var M=f(R),N=k&&k.length;return Array.from({length:4},function(D,L){return m(M+L,k,N)})}(_.name,_.colors),x=_.name.replace(/\s/g,""),I=u.useId();return u.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:_.size,height:_.size},_.title&&u.createElement("title",null,_.name),u.createElement("mask",{id:I,maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},u.createElement("rect",{width:80,height:80,rx:_.square?void 0:160,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(I,")")},u.createElement("path",{fill:"url(#gradient_paint0_linear_"+x+")",d:"M0 0h80v40H0z"}),u.createElement("path",{fill:"url(#gradient_paint1_linear_"+x+")",d:"M0 40h80v40H0z"})),u.createElement("defs",null,u.createElement("linearGradient",{id:"gradient_paint0_linear_"+x,x1:40,y1:0,x2:40,y2:40,gradientUnits:"userSpaceOnUse"},u.createElement("stop",{stopColor:v[0]}),u.createElement("stop",{offset:1,stopColor:v[1]})),u.createElement("linearGradient",{id:"gradient_paint1_linear_"+x,x1:40,y1:40,x2:40,y2:80,gradientUnits:"userSpaceOnUse"},u.createElement("stop",{stopColor:v[2]}),u.createElement("stop",{offset:1,stopColor:v[3]}))))},O=function(_){var v=function(I,R){var k=f(I),M=R&&R.length;return Array.from({length:3},function(N,D){return{color:m(k+D,R,M),translateX:p(k*(D+1),8,1),translateY:p(k*(D+1),8,2),scale:1.2+p(k*(D+1),4)/10,rotate:p(k*(D+1),360,1)}})}(_.name,_.colors),x=u.useId();return u.createElement("svg",{viewBox:"0 0 80 80",fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:_.size,height:_.size},_.title&&u.createElement("title",null,_.name),u.createElement("mask",{id:x,maskUnits:"userSpaceOnUse",x:0,y:0,width:80,height:80},u.createElement("rect",{width:80,height:80,rx:_.square?void 0:160,fill:"#FFFFFF"})),u.createElement("g",{mask:"url(#".concat(x,")")},u.createElement("rect",{width:80,height:80,fill:v[0].color}),u.createElement("path",{filter:"url(#prefix__filter0_f)",d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:v[1].color,transform:"translate("+v[1].translateX+" "+v[1].translateY+") rotate("+v[1].rotate+" 40 40) scale("+v[2].scale+")"}),u.createElement("path",{filter:"url(#prefix__filter0_f)",style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:v[2].color,transform:"translate("+v[2].translateX+" "+v[2].translateY+") rotate("+v[2].rotate+" 40 40) scale("+v[2].scale+")"})),u.createElement("defs",null,u.createElement("filter",{id:"prefix__filter0_f",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},u.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),u.createElement("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),u.createElement("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"}))))},A=["pixel","bauhaus","ring","beam","sunset","marble"],C={geometric:"beam",abstract:"bauhaus"},y=function(_){var v=_.variant,x=v===void 0?"marble":v,I=_.colors,R=I===void 0?["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]:I,k=_.name,M=k===void 0?"Clara Barton":k,N=_.square,D=N!==void 0&&N,L=_.title,j=L!==void 0&&L,F=_.size,B=function(V){for(var K=1;Kt.some(n=>e instanceof n);let O6,A6;function $me(){return O6||(O6=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function zme(){return A6||(A6=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const l9=new WeakMap,Uw=new WeakMap,u9=new WeakMap,cv=new WeakMap,F_=new WeakMap;function Vme(e){const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{n(rf(e.result)),o()},a=()=>{r(e.error),o()};e.addEventListener("success",i),e.addEventListener("error",a)});return t.then(n=>{n instanceof IDBCursor&&l9.set(n,e)}).catch(()=>{}),F_.set(t,e),t}function Ume(e){if(Uw.has(e))return;const t=new Promise((n,r)=>{const o=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",a),e.removeEventListener("abort",a)},i=()=>{n(),o()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",i),e.addEventListener("error",a),e.addEventListener("abort",a)});Uw.set(e,t)}let Hw={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Uw.get(e);if(t==="objectStoreNames")return e.objectStoreNames||u9.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return rf(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function Hme(e){Hw=e(Hw)}function Wme(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(fv(this),t,...n);return u9.set(r,t.sort?t.sort():[t]),rf(r)}:zme().includes(e)?function(...t){return e.apply(fv(this),t),rf(l9.get(this))}:function(...t){return rf(e.apply(fv(this),t))}}function Gme(e){return typeof e=="function"?Wme(e):(e instanceof IDBTransaction&&Ume(e),Fme(e,$me())?new Proxy(e,Hw):e)}function rf(e){if(e instanceof IDBRequest)return Vme(e);if(cv.has(e))return cv.get(e);const t=Gme(e);return t!==e&&(cv.set(e,t),F_.set(t,e)),t}const fv=e=>F_.get(e),Kme=["get","getKey","getAll","getAllKeys","count"],Xme=["put","add","delete","clear"],dv=new Map;function P6(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(dv.get(t))return dv.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=Xme.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(o||Kme.includes(n)))return;const i=async function(a,...s){const l=this.transaction(a,o?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(s.shift())),(await Promise.all([u[n](...s),o&&l.done]))[0]};return dv.set(t,i),i}Hme(e=>({...e,get:(t,n,r)=>P6(t,n)||e.get(t,n,r),has:(t,n)=>!!P6(t,n)||e.has(t,n)}));async function hv(e,t){try{let n=await Promise.race([fetch(e,{headers:t}),new Promise((o,i)=>setTimeout(()=>i(new Error("Timeout")),5e3))]);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return await n.json()}catch(n){throw new Error(`Error making request: ${n}`)}}var qme=class extends bae{constructor(e){super(e)}async getZapCallbackInfo(e){const t=await hv(e);if(!Yie(t))throw new Error("Lnurl endpoint does not allow Nostr payments. Expected to find 'allowsNostr' in response.");return this.lightningZapInfo=t,console.log("LnurlEndpointResponse",this.lightningZapInfo),this.lightningZapInfo}async getLightningInvoice(e,t){const n=await hv(t);if(n&&n.status==="ERROR")throw new Error(`Error getting lightning invoice: ${n.reason}`);if(!Zie(e,n))throw new Error("Lnurl invoice response is invalid or does not match your request.");return console.log("LnurlInvoiceResponse",n),n}async makeZapRequest(e,t){const n=this.getLud16Or06Url();if(n)try{this.hasZapInfo()||await this.getZapCallbackInfo(n.url);const r={...e,recipientPubkey:this.pubkey,lnurl:n.type==="lud16"?gk(this.getLud16()):this.getLud06()},o=yae(r,this.lightningZapInfo.callback,t);return{...await this.getLightningInvoice(r,o.invoiceUrl),event:o.event}}catch(r){throw new Error(`Error making zap request: ${r}`)}else throw new Error("No lud16 or lud06 url found")}async makeNIP05Request(){const e=this.getNip05Url();if(e)try{return await hv(e)}catch(t){throw new Error(`Error making NIP05 request: ${t}`)}else throw new Error("No nip05 url found")}};const Yme=({user:e,relatedEvent:t,onConfirmPayment:n,relayUrl:r})=>{const[o,i]=P.useState(void 0),[a,s]=P.useState(!1),[l,u]=P.useState(!1),[c,f]=P.useState(0),[d,h]=P.useState(""),[p,m]=P.useState(""),S=Ho(),[b,g]=P.useState(void 0),E=async()=>{var N;if(!o)return;if(c<=0){S({title:"Error",description:"Please enter a valid amount",status:"error",duration:9e3,isClosable:!0});return}u(!0);const y=o;if(!y)return;const _=y==null?void 0:y.getLud16Or06Url();if(!_)return;if(!(y!=null&&y.hasZapInfo()))try{await(y==null?void 0:y.getZapCallbackInfo(_.url))}catch(D){console.error(D),S({title:"Error",description:`Could not get zap callback info: ${D.message}`,status:"error",duration:9e3,isClosable:!0}),u(!1);return}const v=_.type==="lud16"?gk(y.getLud16()):y.getLud06(),x={amount:c,relayUrls:r?[r]:[],recipientPubkey:y==null?void 0:y.pubkey,lnurl:v},I=_k(x),R=await Z.getState().signEvent(I),k=yk({callback:(N=y==null?void 0:y.lightningZapInfo)==null?void 0:N.callback,amount:x.amount,event:R.toURI(),lnurl:x.lnurl});let M;try{M=await y.getLightningInvoice(x,k)}catch(D){console.error(D),S({title:"Error",description:`Could not get lightning invoice: ${D.message}`,status:"error",duration:9e3,isClosable:!0}),u(!1);return}M&&M.pr&&g({pr:M.pr,event:R}),u(!1)},T=async()=>{if(!b)return;if(d===""||p===""){S({title:"Error",description:"Please fill in all fields",status:"error",duration:9e3,isClosable:!0});return}u(!0);const _=b.event.newZapReceipt({bolt11:d,description:p});t&&_.addEventTag({eventId:t.id}),await Z.getState().signAndSendEvent({event:_}),u(!1),S({title:"Success",description:"Payment confirmed. Keep stracking!",status:"success",duration:9e3,isClosable:!0}),n()};P.useEffect(()=>{const y=new qme(e),_=y.getLud16Or06Url()!==void 0;i(y),s(_)},[e]);const O=w.jsx(w.Fragment,{children:!a&&w.jsx(pe,{fontWeight:"bold",children:"The user does not have a supported ligning address."})}),A=w.jsx(w.Fragment,{children:a&&!b&&w.jsxs(Aa,{children:[w.jsx(pe,{mb:2,children:"Request a ligning invoice, pay it with your ligtning wallet, and enter the bolt11 invoice receipt from your wallet in the next step."}),w.jsxs($5,{children:[w.jsx(WS,{children:"Sats"}),w.jsx(Lt,{type:"number",value:c,onChange:y=>f(parseInt(y.target.value))})]}),w.jsx(be,{onClick:E,isLoading:l,width:"100%",children:"Get ₿ LN invoice"})]})}),C=w.jsx(w.Fragment,{children:b&&w.jsxs(w.Fragment,{children:[w.jsx(pe,{mb:2,textAlign:"center",children:"Scan or copy the invoice to your lightning wallet."}),w.jsx(ve,{mb:2,width:"100%",children:w.jsx(e7,{value:b.pr,width:"100%"})}),w.jsx(Lt,{type:"text",value:b.pr,onChange:()=>h(b.pr),mb:2}),w.jsx(In,{htmlFor:"bolt11",mt:2,children:"Bolt11"}),w.jsx(pe,{mb:2,children:"Copy the bolt11 invoice receipt from your lightning wallet."}),w.jsx(Lt,{type:"text",value:d,onChange:y=>h(y.target.value),placeholder:"lnbc..."}),w.jsx(In,{htmlFor:"description",mt:2,children:"Description"}),w.jsx(Lt,{type:"text",value:p,onChange:y=>m(y.target.value),placeholder:"Keep stracking ...",mb:2}),w.jsx(be,{onClick:T,isLoading:l,children:"Confirm payment"})]})});return w.jsxs(ve,{children:[O,A,C]})},c9=({user:e,relatedEvent:t,isOpen:n,onClose:r})=>w.jsxs(xr,{isOpen:n,onClose:r,children:[w.jsx(Pr,{}),w.jsxs(Or,{maxWidth:300,children:[w.jsx(Ar,{children:"Send sats (WIP)"}),w.jsx(Ir,{}),w.jsx(Tr,{children:w.jsx(Yme,{user:e,relatedEvent:t,onConfirmPayment:r})}),w.jsx(wd,{children:w.jsx(be,{variant:"outline",onClick:r,children:"Close"})})]})]});function Ua({user:{pubkey:e,data:t},opts:{showAbout:n,showBanner:r,showFollowing:o,showBlock:i,showLud:a,relayUrls:s,isBlocked:l}}){const u=Ho(),c=t&&t.name?t.name:"Anonymous",f=t&&t.display_name?t.display_name:c,d=t&&t.picture?t.picture:"",h=t&&t.banner?t.banner:void 0,p=t&&t.about?t.about:void 0,m=t&&t.lud06?t.lud06:void 0,S=t&&t.lud16?t.lud16:void 0,b=f===c,[g,E]=P.useState(""),[T,O]=P.useState(!1);P.useEffect(()=>{const k=S_(Mi.PublicKeys,[{type:0,value:e}]);E(`/p/${k}`)},[e]);const A=()=>{const k=`${window.location.origin}/#${g}`;navigator.clipboard.writeText(k),u({description:`Copied ${Va(k,40)} to clipboard`,status:"success",duration:5e3,isClosable:!0})},C=async()=>{const k=await Z.getState().followingUser(e);O(k)},{isOpen:y,onOpen:_,onClose:v}=jn(),{isOpen:x,onClose:I}=jn(),R=({lud:k,name:M})=>w.jsxs(n_,{children:[w.jsx(t_,{children:w.jsx(be,{size:"xs",variant:"outline",color:"gray.500",children:M})}),w.jsxs(a_,{children:[w.jsx(r_,{}),w.jsx(i_,{}),w.jsx(o_,{children:k&&w.jsx(pe,{fontSize:12,children:k})})]})]});return w.jsxs(w.Fragment,{children:[r&&h&&w.jsx(ve,{marginBottom:2,children:w.jsx($u,{src:h,alt:"banner"})}),w.jsxs(ft,{children:[w.jsx(ve,{children:w.jsx(zf,{to:g,children:d===""?w.jsx(jme,{size:24,name:e,variant:"marble",colors:["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"]}):w.jsx(i1,{size:"xs",src:d})})}),w.jsx(ve,{overflowWrap:"anywhere",maxWidth:80,children:w.jsx(zf,{to:g,children:w.jsx(pe,{size:"sm",children:f})})}),w.jsx(ve,{overflowWrap:"anywhere",maxWidth:80,children:w.jsx(pe,{fontSize:10,children:!b&&c})}),a&&w.jsxs(w.Fragment,{children:[m&&w.jsx(R,{lud:m,name:"LUD06"}),S&&w.jsx(R,{lud:S,name:"LUD16"})]}),w.jsx(Zs,{}),w.jsx(Cw,{kind:Mi.Profile,value:e,size:"xs"}),w.jsxs(Sm,{isLazy:!0,onOpen:C,children:[w.jsx(Em,{as:dd,size:"xs",variant:"outline",color:"gray.500",icon:w.jsx(Ne,{as:Lme}),children:"Actions"}),w.jsxs(_m,{children:[i&&w.jsx($r,{icon:w.jsx(Ne,{as:Tme}),onClick:()=>l?Z.getState().unblockUser(e):Z.getState().blockUser({pubkey:e,relayUrls:s}),children:l?"Unblock":"Block"}),w.jsx($r,{icon:w.jsx(Ne,{as:s7}),onClick:_,children:"Lists"}),o&&w.jsx($r,{icon:w.jsx(Ne,{as:a7}),onClick:()=>T?Z.getState().unfollowUser(e):Z.getState().followUser({pubkey:e,relayUrls:s}),children:T?"Unfollow":"Follow"}),w.jsx($r,{icon:w.jsx(Ne,{as:u7}),onClick:A,children:"Copy direct profile link"})]})]})]}),w.jsx(ve,{overflowWrap:"anywhere",mt:2,children:n&&p&&w.jsx(pe,{fontSize:"sm",children:p})}),w.jsx(Nme,{pubkey:e,isOpen:y,onClose:v}),w.jsx(c9,{user:{pubkey:e,data:t},isOpen:x,onClose:I})]})}function Wm({data:e,level:t}){const[n]=Z(I=>[(I.status==="offline"||I.status==="online")&&I.keystore!=="none"]),[r,o]=P.useState(e.user?e.user:{pubkey:e.event.pubkey}),i=dk(e.event.content),a=lk(e.event),s=S_(Mi.Event,[{type:0,value:e.event.id}]);let l;i!=null&&i.text&&!a?l=!0:a&&(l=!1);const u={isLoaded:!0,contentWarning:a,images:i.images,videos:i.videos,nurls:i.nurls,text:i.text},[c,f]=P.useState(l),d={showFollowing:!0,showBlock:!0,showLud:!0,relayUrls:e.eventRelayUrls},{isOpen:h,onOpen:p,onClose:m}=jn(),{isOpen:S,onOpen:b,onClose:g}=jn(),{isOpen:E,onOpen:T,onClose:O}=jn(),A=Ho();P.useEffect(()=>{if(t===0){const I=e.user?e.user:{pubkey:e.event.pubkey};o(I)}},[e.user]),P.useEffect(()=>{const I=async()=>{const R=await Z.getState().getUser(e.event.pubkey);R&&o(R.user)};t>0&&I()},[e.event.pubkey]);const C=async()=>{if(!e.eventRelayUrls)return;const R=(await Z.getState().getRelays()||[]).find(k=>e.eventRelayUrls.includes(k.url));if(R&&R.write)return R},y=async I=>{console.log("replyCallback",I)},_=I=>{let R="";I instanceof Error?R=I.message:R="Unknown error",A({title:"Error",description:R,status:"error",duration:5e3,isClosable:!0})},v=I=>{A({title:"Success",description:`Event ${Va(I,5)} submitted`,status:"success",duration:5e3,isClosable:!0})},x=async(I,R)=>{const k=await C();let M;switch(I){case"quote":M=Sk({inResponseTo:e.event,relayUrl:k?k.url:void 0});break;case"reaction":if(!R)throw new Error("Reaction is required");M=hae({text:R,inResponseTo:{id:e.event.id,pubkey:e.event.pubkey},relayUrl:k?k.url:void 0});break;case"zap":T();return;default:return}try{const N=await Z.getState().signAndSendEvent({event:M,relayUrls:k?[k.url]:void 0});N&&(v(N),setTimeout(()=>{Z.getState().requestInformation({source:"events",idsOrKeys:[N]},{timeoutIn:1e4})},1e3))}catch(N){_(N);return}};return w.jsxs(w.Fragment,{children:[w.jsxs(_Z,{children:[w.jsxs(SZ,{p:0,children:[c?w.jsx(Eme,{images:u.images,videos:u.videos}):w.jsx(she,{contentWarning:u.contentWarning,setShowNSFWContent:f}),w.jsx(ve,{p:1,pl:2,children:w.jsx(Ua,{user:r,opts:d})})]}),c&&w.jsx(wZ,{p:0,children:w.jsx(ER,{isLoaded:u.isLoaded,children:w.jsx(ihe,{content:u.text})})}),w.jsx(Ghe,{isReady:n,level:t,nEventString:s,createdAt:e.event.created_at,repliesCount:e.repliesCount,reactionsCount:e.reactionsCount,repostCount:e.repostsCount,zapReceiptCount:e.zapReceiptCount,zapReceiptAmount:e.zapReceiptAmount,isReplyOpen:S,onReplyOpen:b,onReplyClose:g,isInfoModalOpen:h,onInfoModalOpen:p,onInfoModalClose:m,onAction:x})]}),S&&w.jsx(ahe,{data:e,isOpen:S,sendCallback:y,level:t}),w.jsx(the,{data:e,nEventString:s,isOpen:h,onClose:m}),w.jsx(c9,{user:r,relatedEvent:e.event,isOpen:E,onClose:O})]})}const Gm=0,Ha=1,Wu=2,f9=4;function d9(e,t){return n=>e(t(n))}function Zme(e,t){return t(e)}function h9(e,t){return n=>e(t,n)}function T6(e,t){return()=>e(t)}function Km(e,t){return t(e),e}function kt(...e){return e}function Qme(e){e()}function I6(e){return()=>e}function Jme(...e){return()=>{e.map(Qme)}}function $_(e){return e!==void 0}function Gu(){}function dt(e,t){return e(Ha,t)}function je(e,t){e(Gm,t)}function z_(e){e(Wu)}function Ur(e){return e(f9)}function Se(e,t){return dt(e,h9(t,Gm))}function Vi(e,t){const n=e(Ha,r=>{n(),t(r)});return n}function qe(){const e=[];return(t,n)=>{switch(t){case Wu:e.splice(0,e.length);return;case Ha:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case Gm:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function fe(e){let t=e;const n=qe();return(r,o)=>{switch(r){case Ha:o(t);break;case Gm:t=o;break;case f9:return t}return n(r,o)}}function eye(e){let t,n;const r=()=>t&&t();return function(o,i){switch(o){case Ha:return i?n===i?void 0:(r(),n=i,t=dt(e,i),t):(r(),Gu);case Wu:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Xr(e){return Km(qe(),t=>Se(e,t))}function rr(e,t){return Km(fe(t),n=>Se(e,n))}function tye(...e){return t=>e.reduceRight(Zme,t)}function re(e,...t){const n=tye(...t);return(r,o)=>{switch(r){case Ha:return dt(e,n(o));case Wu:z_(e);return}}}function p9(e,t){return e===t}function Pt(e=p9){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Le(e){return t=>n=>{e(n)&&t(n)}}function ye(e){return t=>d9(t,e)}function Si(e){return t=>()=>t(e)}function ii(e,t){return n=>r=>n(t=e(t,r))}function Mu(e){return t=>n=>{e>0?e--:t(n)}}function ma(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function R6(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Ve(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);dt(i,l=>{const u=n;n=n|s,t[a]=l,u!==o&&n===o&&r&&(r(),r=null)})}),i=>a=>{const s=()=>i([a].concat(t));n===o?s():r=s}}function k6(...e){return function(t,n){switch(t){case Ha:return Jme(...e.map(r=>dt(r,n)));case Wu:return;default:throw new Error(`unrecognized action ${t}`)}}}function De(e,t=p9){return re(e,Pt(t))}function Sn(...e){const t=qe(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((i,a)=>{const s=Math.pow(2,a);dt(i,l=>{n[a]=l,r=r|s,r===o&&je(t,n)})}),function(i,a){switch(i){case Ha:return r===o&&a(n),dt(t,a);case Wu:return z_(t);default:throw new Error(`unrecognized action ${i}`)}}}function ut(e,t=[],{singleton:n}={singleton:!0}){return{id:nye(),constructor:e,dependencies:t,singleton:n}}const nye=()=>Symbol();function rye(e){const t=new Map,n=({id:r,constructor:o,dependencies:i,singleton:a})=>{if(a&&t.has(r))return t.get(r);const s=o(i.map(l=>n(l)));return a&&t.set(r,s),s};return n(e)}function oye(e,t){const n={},r={};let o=0;const i=e.length;for(;o(S[b]=g=>{const E=m[t.methods[b]];je(E,g)},S),{})}function c(m){return a.reduce((S,b)=>(S[b]=eye(m[t.events[b]]),S),{})}return{Component:ee.forwardRef((m,S)=>{const{children:b,...g}=m,[E]=ee.useState(()=>Km(rye(e),O=>l(O,g))),[T]=ee.useState(T6(c,E));return Rh(()=>{for(const O of a)O in g&&dt(T[O],g[O]);return()=>{Object.values(T).map(z_)}},[g,T,E]),Rh(()=>{l(E,g)}),ee.useImperativeHandle(S,I6(u(E))),ee.createElement(s.Provider,{value:E},n?ee.createElement(n,oye([...r,...o,...a],g),b):b)}),usePublisher:m=>ee.useCallback(h9(je,ee.useContext(s)[m]),[m]),useEmitterValue:m=>{const b=ee.useContext(s)[m],[g,E]=ee.useState(T6(Ur,b));return Rh(()=>dt(b,T=>{T!==g&&E(I6(T))}),[b,g]),g},useEmitter:(m,S)=>{const g=ee.useContext(s)[m];Rh(()=>dt(g,S),[S,g])}}}const iye=typeof document<"u"?ee.useLayoutEffect:ee.useEffect,aye=iye;var qr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(qr||{});const sye={0:"debug",1:"log",2:"warn",3:"error"},lye=()=>typeof globalThis>"u"?window:globalThis,Wa=ut(()=>{const e=fe(3);return{log:fe((n,r,o=1)=>{var i;const a=(i=lye().VIRTUOSO_LOG_LEVEL)!=null?i:Ur(e);o>=a&&console[sye[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function V_(e,t=!0){const n=ee.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=ee.useMemo(()=>new ResizeObserver(i=>{const a=i[0].target;a.offsetParent!==null&&e(a)}),[e]);r=i=>{i&&t?(o.observe(i),n.current=i):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function tl(e,t=!0){return V_(e,t).callbackRef}function uye(e,t,n,r,o,i,a){const s=ee.useCallback(l=>{const u=cye(l.children,t,"offsetHeight",o);let c=l.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const f=c.lastElementChild.dataset.viewportType==="window",d=a?a.scrollTop:f?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,h=a?a.scrollHeight:f?document.documentElement.scrollHeight:c.scrollHeight,p=a?a.offsetHeight:f?window.innerHeight:c.offsetHeight;r({scrollTop:Math.max(d,0),scrollHeight:h,viewportHeight:p}),i==null||i(fye("row-gap",getComputedStyle(l).rowGap,o)),u!==null&&e(u)},[e,t,o,i,a,r]);return V_(s,n)}function cye(e,t,n,r){const o=e.length;if(o===0)return null;const i=[];for(let a=0;a{const d=f.target,h=d===window||d===document,p=h?window.pageYOffset||document.documentElement.scrollTop:d.scrollTop,m=h?document.documentElement.scrollHeight:d.scrollHeight,S=h?window.innerHeight:d.offsetHeight,b=()=>{e({scrollTop:Math.max(p,0),scrollHeight:m,viewportHeight:S})};f.suppressFlushSync?b():vB.flushSync(b),a.current!==null&&(p===a.current||p<=0||p===m-S)&&(a.current=null,t(!0),s.current&&(clearTimeout(s.current),s.current=null))},[e,t]);ee.useEffect(()=>{const f=o||i.current;return r(o||i.current),l({target:f,suppressFlushSync:!0}),f.addEventListener("scroll",l,{passive:!0}),()=>{r(null),f.removeEventListener("scroll",l)}},[i,l,n,r,o]);function u(f){const d=i.current;if(!d||"offsetHeight"in d&&d.offsetHeight===0)return;const h=f.behavior==="smooth";let p,m,S;d===window?(m=Math.max(La(document.documentElement,"height"),document.documentElement.scrollHeight),p=window.innerHeight,S=document.documentElement.scrollTop):(m=d.scrollHeight,p=La(d,"height"),S=d.scrollTop);const b=m-p;if(f.top=Math.ceil(Math.max(Math.min(b,f.top),0)),y9(p,m)||f.top===S){e({scrollTop:S,scrollHeight:m,viewportHeight:p}),h&&t(!0);return}h?(a.current=f.top,s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,a.current=null,t(!0)},1e3)):a.current=null,d.scrollTo(f)}function c(f){i.current.scrollBy(f)}return{scrollerRef:i,scrollByCallback:c,scrollToCallback:u}}const cr=ut(()=>{const e=qe(),t=qe(),n=fe(0),r=qe(),o=fe(0),i=qe(),a=qe(),s=fe(0),l=fe(0),u=fe(0),c=fe(0),f=qe(),d=qe(),h=fe(!1);return Se(re(e,ye(({scrollTop:p})=>p)),t),Se(re(e,ye(({scrollHeight:p})=>p)),a),Se(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:i,headerHeight:s,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:c,scrollHeight:a,smoothScrollTargetReached:r,scrollTo:f,scrollBy:d,statefulScrollTop:o,deviation:n,scrollingInProgress:h}},[],{singleton:!0}),Kf={lvl:0};function v9(e,t,n,r=Kf,o=Kf){return{k:e,v:t,lvl:n,l:r,r:o}}function yt(e){return e===Kf}function cu(){return Kf}function Ww(e,t){if(yt(e))return Kf;const{k:n,l:r,r:o}=e;if(t===n){if(yt(r))return o;if(yt(o))return r;{const[i,a]=w9(r);return yp(dn(e,{k:i,v:a,l:b9(r)}))}}else return tt&&(s=s.concat(Gw(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(Gw(a,t,n))),s}function _s(e){return yt(e)?[]:[..._s(e.l),{k:e.k,v:e.v},..._s(e.r)]}function w9(e){return yt(e.r)?[e.k,e.v]:w9(e.r)}function b9(e){return yt(e.r)?e.l:yp(dn(e,{r:b9(e.r)}))}function dn(e,t){return v9(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function pv(e){return yt(e)||e.lvl>e.r.lvl}function M6(e){return Kw(_9(e))}function yp(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(pv(t))return _9(dn(e,{lvl:r-1}));if(!yt(t)&&!yt(t.r))return dn(t.r,{l:dn(t,{r:t.r.l}),r:dn(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(pv(e))return Kw(dn(e,{lvl:r-1}));if(!yt(n)&&!yt(n.l)){const o=n.l,i=pv(o)?n.lvl-1:n.lvl;return dn(o,{l:dn(e,{r:o.l,lvl:r-1}),r:Kw(dn(n,{l:o.r,lvl:i})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function Xm(e,t,n){if(yt(e))return[];const r=Uo(e,t)[0];return dye(Gw(e,r,n))}function S9(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const i=[];for(let a=1;a({index:t,value:n}))}function Kw(e){const{r:t,lvl:n}=e;return!yt(t)&&!yt(t.r)&&t.lvl===n&&t.r.lvl===n?dn(t,{l:dn(e,{r:t.l}),lvl:n+1}):e}function _9(e){const{l:t}=e;return!yt(t)&&t.lvl===e.lvl?dn(t,{r:dn(e,{l:t.r})}):e}function _0(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const i=Math.floor((r+o)/2),a=e[i],s=n(a,t);if(s===0)return i;if(s===-1){if(o-r<2)return i-1;o=i-1}else{if(o===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function E9(e,t,n){return e[_0(e,t,n)]}function hye(e,t,n,r){const o=_0(e,t,r),i=_0(e,n,r,o);return e.slice(o,i+1)}const U_=ut(()=>({recalcInProgress:fe(!1)}),[],{singleton:!0});function pye(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function D6(e,t){let n=0,r=0;for(;n=c||o===d)&&(e=Ww(e,c)):(u=d!==o,l=!0),f>a&&a>=c&&d!==o&&(e=zr(e,a+1,d));u&&(e=zr(e,i,o))}return[e,n]}function yye(){return{offsetTree:[],sizeTree:cu(),groupOffsetTree:cu(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function H_({index:e},t){return t===e?0:t0&&(t=Math.max(t,E9(e,r,H_).offset)),S9(hye(e,t,n,gye),vye)}function Xw(e,t,n,r){let o=e,i=0,a=0,s=0,l=0;if(t!==0){l=_0(o,t-1,H_),s=o[l].offset;const c=Uo(n,t-1);i=c[0],a=c[1],o.length&&o[l].size===Uo(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:u,value:c}of Xm(n,t,1/0)){const f=u-i,d=f*a+s+f*r;o.push({offset:d,size:c,index:u}),i=u,s=d,a=c}return{offsetTree:o,lastIndex:i,lastOffset:s,lastSize:a}}function bye(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,qr.DEBUG);const i=e.sizeTree;let a=i,s=0;if(n.length>0&&yt(i)&&t.length===2){const d=t[0].size,h=t[1].size;a=n.reduce((p,m)=>zr(zr(p,m,d),m+1,h),a)}else[a,s]=mye(a,t);if(a===i)return e;const{offsetTree:l,lastIndex:u,lastSize:c,lastOffset:f}=Xw(e.offsetTree,s,a,o);return{sizeTree:a,offsetTree:l,lastIndex:u,lastOffset:f,lastSize:c,groupOffsetTree:n.reduce((d,h)=>zr(d,h,qf(h,l,o)),cu()),groupIndices:n}}function qf(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:i}=E9(t,e,H_),a=e-o,s=i*a+(a-1)*n+r;return s>0?s+n:s}function Sye(e){return typeof e.groupIndex<"u"}function C9(e,t,n){if(Sye(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=x9(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function x9(e,t){if(!qm(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function qm(e){return!yt(e.groupOffsetTree)}function _ye(e){return _s(e).map(({k:t,v:n},r,o)=>{const i=o[r+1],a=i?i.k-1:1/0;return{startIndex:t,endIndex:a,size:n}})}const Eye={offsetHeight:"height",offsetWidth:"width"},yi=ut(([{log:e},{recalcInProgress:t}])=>{const n=qe(),r=qe(),o=rr(r,0),i=qe(),a=qe(),s=fe(0),l=fe([]),u=fe(void 0),c=fe(void 0),f=fe((O,A)=>La(O,Eye[A])),d=fe(void 0),h=fe(0),p=yye(),m=rr(re(n,Ve(l,e,h),ii(bye,p),Pt()),p),S=rr(re(l,Pt(),ii((O,A)=>({prev:O.current,current:A}),{prev:[],current:[]}),ye(({prev:O})=>O)),[]);Se(re(l,Le(O=>O.length>0),Ve(m,h),ye(([O,A,C])=>{const y=O.reduce((_,v,x)=>zr(_,v,qf(v,A.offsetTree,C)||x),cu());return{...A,groupIndices:O,groupOffsetTree:y}})),m),Se(re(r,Ve(m),Le(([O,{lastIndex:A}])=>O[{startIndex:O,endIndex:A,size:C}])),n),Se(u,c);const b=rr(re(u,ye(O=>O===void 0)),!0);Se(re(c,Le(O=>O!==void 0&&yt(Ur(m).sizeTree)),ye(O=>[{startIndex:0,endIndex:0,size:O}])),n);const g=Xr(re(n,Ve(m),ii(({sizes:O},[A,C])=>({changed:C!==O,sizes:C}),{changed:!1,sizes:p}),ye(O=>O.changed)));dt(re(s,ii((O,A)=>({diff:O.prev-A,prev:A}),{diff:0,prev:0}),ye(O=>O.diff)),O=>{const{groupIndices:A}=Ur(m);if(O>0)je(t,!0),je(i,O+D6(O,A));else if(O<0){const C=Ur(S);C.length>0&&(O-=D6(-O,C)),je(a,O)}}),dt(re(s,Ve(e)),([O,A])=>{O<0&&A("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},qr.ERROR)});const E=Xr(i);Se(re(i,Ve(m),ye(([O,A])=>{const C=A.groupIndices.length>0,y=[],_=A.lastSize;if(C){const v=Xf(A.sizeTree,0);let x=0,I=0;for(;x{let L=M.ranges;return M.prevSize!==0&&(L=[...M.ranges,{startIndex:M.prevIndex,endIndex:N+O-1,size:M.prevSize}]),{ranges:L,prevIndex:N+O,prevSize:D}},{ranges:y,prevIndex:O,prevSize:0}).ranges}return _s(A.sizeTree).reduce((v,{k:x,v:I})=>({ranges:[...v.ranges,{startIndex:v.prevIndex,endIndex:x+O-1,size:v.prevSize}],prevIndex:x+O,prevSize:I}),{ranges:[],prevIndex:0,prevSize:_}).ranges})),n);const T=Xr(re(a,Ve(m,h),ye(([O,{offsetTree:A},C])=>{const y=-O;return qf(y,A,C)})));return Se(re(a,Ve(m,h),ye(([O,A,C])=>{if(A.groupIndices.length>0){if(yt(A.sizeTree))return A;let _=cu();const v=Ur(S);let x=0,I=0,R=0;for(;x<-O;){R=v[I];const M=v[I+1]-R-1;I++,x+=M+1}if(_=_s(A.sizeTree).reduce((M,{k:N,v:D})=>zr(M,Math.max(0,N+O),D),_),x!==-O){const M=Xf(A.sizeTree,R);_=zr(_,0,M);const N=Uo(A.sizeTree,-O+1)[1];_=zr(_,1,N)}return{...A,sizeTree:_,...Xw(A.offsetTree,0,_,C)}}else{const _=_s(A.sizeTree).reduce((v,{k:x,v:I})=>zr(v,Math.max(0,x+O),I),cu());return{...A,sizeTree:_,...Xw(A.offsetTree,0,_,C)}}})),m),{data:d,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:c,fixedItemSize:u,unshiftWith:i,shiftWith:a,shiftWithOffset:T,beforeUnshiftWith:E,firstItemIndex:s,gap:h,sizes:m,listRefresh:g,statefulTotalCount:o,trackItemSizes:b,itemSize:f}},kt(Wa,U_),{singleton:!0}),Cye=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function O9(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Cye)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const Id=ut(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:i,scrollTo:a,smoothScrollTargetReached:s,headerHeight:l,footerHeight:u,fixedHeaderHeight:c,fixedFooterHeight:f},{log:d}])=>{const h=qe(),p=fe(0);let m=null,S=null,b=null;function g(){m&&(m(),m=null),b&&(b(),b=null),S&&(clearTimeout(S),S=null),je(o,!1)}return Se(re(h,Ve(e,i,t,p,l,u,d),Ve(r,c,f),ye(([[E,T,O,A,C,y,_,v],x,I,R])=>{const k=O9(E),{align:M,behavior:N,offset:D}=k,L=A-1,j=C9(k,T,L);let F=qf(j,T.offsetTree,x)+y;M==="end"?(F+=I+Uo(T.sizeTree,j)[1]-O+R,j===L&&(F+=_)):M==="center"?F+=(I+Uo(T.sizeTree,j)[1]-O+R)/2:F-=C,D&&(F+=D);const B=V=>{g(),V?(v("retrying to scroll to",{location:E},qr.DEBUG),je(h,E)):v("list did not change, scroll successful",{},qr.DEBUG)};if(g(),N==="smooth"){let V=!1;b=dt(n,K=>{V=V||K}),m=Vi(s,()=>{B(V)})}else m=Vi(re(n,xye(150)),B);return S=setTimeout(()=>{g()},1200),je(o,!0),v("scrolling from index to",{index:j,top:F,behavior:N},qr.DEBUG),{top:F,behavior:N}})),a),{scrollToIndex:h,topListHeight:p}},kt(yi,cr,Wa),{singleton:!0});function xye(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const Yf="up",of="down",Oye="none",Aye={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Pye=0,Rd=ut(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:i}])=>{const a=fe(!1),s=fe(!0),l=qe(),u=qe(),c=fe(4),f=fe(Pye),d=rr(re(k6(re(De(t),Mu(1),Si(!0)),re(De(t),Mu(1),Si(!1),R6(100))),Pt()),!1),h=rr(re(k6(re(i,Si(!0)),re(i,Si(!1),R6(200))),Pt()),!1);Se(re(Sn(De(t),De(f)),ye(([g,E])=>g<=E),Pt()),s),Se(re(s,ma(50)),u);const p=Xr(re(Sn(e,De(n),De(r),De(o),De(c)),ii((g,[{scrollTop:E,scrollHeight:T},O,A,C,y])=>{const _=E+O-T>-y,v={viewportHeight:O,scrollTop:E,scrollHeight:T};if(_){let I,R;return E>g.state.scrollTop?(I="SCROLLED_DOWN",R=g.state.scrollTop-E):(I="SIZE_DECREASED",R=g.state.scrollTop-E||g.scrollTopDelta),{atBottom:!0,state:v,atBottomBecause:I,scrollTopDelta:R}}let x;return v.scrollHeight>g.state.scrollHeight?x="SIZE_INCREASED":Og&&g.atBottom===E.atBottom))),m=rr(re(e,ii((g,{scrollTop:E,scrollHeight:T,viewportHeight:O})=>{if(y9(g.scrollHeight,T))return{scrollTop:E,scrollHeight:T,jump:0,changed:!1};{const A=T-(E+O)<1;return g.scrollTop!==E&&A?{scrollHeight:T,scrollTop:E,jump:g.scrollTop-E,changed:!0}:{scrollHeight:T,scrollTop:E,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Le(g=>g.changed),ye(g=>g.jump)),0);Se(re(p,ye(g=>g.atBottom)),a),Se(re(a,ma(50)),l);const S=fe(of);Se(re(e,ye(({scrollTop:g})=>g),Pt(),ii((g,E)=>Ur(h)?{direction:g.direction,prevScrollTop:E}:{direction:Eg.direction)),S),Se(re(e,ma(50),Si(Oye)),S);const b=fe(0);return Se(re(d,Le(g=>!g),Si(0)),b),Se(re(t,ma(100),Ve(d),Le(([g,E])=>!!E),ii(([g,E],[T])=>[E,T],[0,0]),ye(([g,E])=>E-g)),b),{isScrolling:d,isAtTop:s,isAtBottom:a,atBottomState:p,atTopStateChange:u,atBottomStateChange:l,scrollDirection:S,atBottomThreshold:c,atTopThreshold:f,scrollVelocity:b,lastJumpDueToItemResize:m}},kt(cr)),Ga=ut(([{log:e}])=>{const t=fe(!1),n=Xr(re(t,Le(r=>r),Pt()));return dt(t,r=>{r&&Ur(e)("props updated",{},qr.DEBUG)}),{propsReady:t,didMount:n}},kt(Wa),{singleton:!0});function W_(e,t){e==0?t():requestAnimationFrame(()=>W_(e-1,t))}function G_(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const kd=ut(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o},{didMount:i}])=>{const a=fe(!0),s=fe(0),l=fe(!1);return Se(re(i,Ve(s),Le(([u,c])=>!!c),Si(!1)),a),dt(re(Sn(t,i),Ve(a,e,n,l),Le(([[,u],c,{sizeTree:f},d,h])=>u&&(!yt(f)||$_(d))&&!c&&!h),Ve(s)),([,u])=>{je(l,!0),W_(3,()=>{Vi(r,()=>je(a,!0)),je(o,u)})}),{scrolledToInitialItem:a,initialTopMostItemIndex:s}},kt(yi,cr,Id,Ga),{singleton:!0});function L6(e){return e?e==="smooth"?"smooth":"auto":!1}const Tye=(e,t)=>typeof e=="function"?L6(e(t)):t&&L6(e),Iye=ut(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:i},{propsReady:a,didMount:s},{log:l},{scrollingInProgress:u}])=>{const c=fe(!1),f=qe();let d=null;function h(m){je(o,{index:"LAST",align:"end",behavior:m})}dt(re(Sn(re(De(e),Mu(1)),s),Ve(De(c),n,i,u),ye(([[m,S],b,g,E,T])=>{let O=S&&E,A="auto";return O&&(A=Tye(b,g||T),O=O&&!!A),{totalCount:m,shouldFollow:O,followOutputBehavior:A}}),Le(({shouldFollow:m})=>m)),({totalCount:m,followOutputBehavior:S})=>{d&&(d(),d=null),d=Vi(t,()=>{Ur(l)("following output to ",{totalCount:m},qr.DEBUG),h(S),d=null})});function p(m){const S=Vi(r,b=>{m&&!b.atBottom&&b.notAtBottomBecause==="SIZE_INCREASED"&&!d&&(Ur(l)("scrolling to bottom due to increased size",{},qr.DEBUG),h("auto"))});setTimeout(S,100)}return dt(re(Sn(De(c),e,a),Le(([m,,S])=>m&&S),ii(({value:m},[,S])=>({refreshed:m===S,value:S}),{refreshed:!1,value:0}),Le(({refreshed:m})=>m),Ve(c,e)),([,m])=>{p(m!==!1)}),dt(f,()=>{p(Ur(c)!==!1)}),dt(Sn(De(c),r),([m,S])=>{m&&!S.atBottom&&S.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&h("auto")}),{followOutput:c,autoscrollToBottom:f}},kt(yi,Rd,Id,kd,Ga,Wa,cr));function Rye(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const A9=ut(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const i=qe(),a=qe(),s=Xr(re(i,ye(Rye)));return Se(re(s,ye(l=>l.totalCount)),e),Se(re(s,ye(l=>l.groupIndices)),t),Se(re(Sn(r,n,o),Le(([l,u])=>qm(u)),ye(([l,u,c])=>Uo(u.groupOffsetTree,Math.max(l-c,0),"v")[0]),Pt(),ye(l=>[l])),a),{groupCounts:i,topItemsIndexes:a}},kt(yi,cr));function Zf(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function P9(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const E0="top",C0="bottom",N6="none";function B6(e,t,n){return typeof e=="number"?n===Yf&&t===E0||n===of&&t===C0?e:0:n===Yf?t===E0?e.main:e.reverse:t===C0?e.main:e.reverse}function j6(e,t){return typeof e=="number"?e:e[t]||0}const K_=ut(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const i=qe(),a=fe(0),s=fe(0),l=fe(0),u=rr(re(Sn(De(e),De(t),De(r),De(i,Zf),De(l),De(a),De(o),De(n),De(s)),ye(([c,f,d,[h,p],m,S,b,g,E])=>{const T=c-g,O=S+b,A=Math.max(d-T,0);let C=N6;const y=j6(E,E0),_=j6(E,C0);return h-=g,h+=d+b,p+=d+b,p-=g,h>c+O-y&&(C=Yf),pc!=null),Pt(Zf)),[0,0]);return{listBoundary:i,overscan:l,topListHeight:a,increaseViewportBy:s,visibleRange:u}},kt(cr),{singleton:!0});function kye(e,t,n){if(qm(t)){const r=x9(e,t);return[{index:Uo(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const mv={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function F6(e,t,n){if(e.length===0)return[];if(!qm(t))return e.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const r=e[0].index,o=e[e.length-1].index,i=[],a=Xm(t.groupOffsetTree,r,o);let s,l=0;for(const u of e){(!s||s.end0){u=e[0].offset;const m=e[e.length-1];c=m.offset+m.size}const f=n-l,d=s+f*a+(f-1)*r,h=u,p=d-c;return{items:F6(e,o,i),topItems:F6(t,o,i),topListHeight:t.reduce((m,S)=>S.size+m,0),offsetTop:u,offsetBottom:p,top:h,bottom:c,totalCount:n,firstItemIndex:i}}function T9(e,t,n,r,o,i){let a=0;if(n.groupIndices.length>0)for(const c of n.groupIndices){if(c-a>=e)break;a++}const s=e+a,l=G_(t,s),u=Array.from({length:s}).map((c,f)=>({index:f+l,size:0,offset:0,data:i[f+l]}));return gp(u,[],s,o,n,r)}const nl=ut(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},i,{visibleRange:a,listBoundary:s,topListHeight:l},{scrolledToInitialItem:u,initialTopMostItemIndex:c},{topListHeight:f},d,{didMount:h},{recalcInProgress:p}])=>{const m=fe([]),S=fe(0),b=qe();Se(i.topItemsIndexes,m);const g=rr(re(Sn(h,p,De(a,Zf),De(t),De(e),De(c),u,De(m),De(r),De(o),n),Le(([A,C,,y,,,,,,,_])=>{const v=_&&_.length!==y;return A&&!C&&!v}),ye(([,,[A,C],y,_,v,x,I,R,k,M])=>{const N=_,{sizeTree:D,offsetTree:L}=N,j=Ur(S);if(y===0)return{...mv,totalCount:y};if(A===0&&C===0)return j===0?{...mv,totalCount:y}:T9(j,v,_,R,k,M||[]);if(yt(D))return j>0?null:gp(kye(G_(v,y),N,M),[],y,k,N,R);const F=[];if(I.length>0){const Q=I[0],X=I[I.length-1];let J=0;for(const te of Xm(D,Q,X)){const le=te.value,ge=Math.max(te.start,Q),se=Math.min(te.end,X);for(let ue=ge;ue<=se;ue++)F.push({index:ue,size:le,offset:J,data:M&&M[ue]}),J+=le}}if(!x)return gp([],F,y,k,N,R);const B=I.length>0?I[I.length-1]+1:0,V=wye(L,A,C,B);if(V.length===0)return null;const K=y-1,W=Km([],Q=>{for(const X of V){const J=X.value;let te=J.offset,le=X.start;const ge=J.size;if(J.offset=C);ue++)Q.push({index:ue,size:ge,offset:te,data:M&&M[ue]}),te+=ge+k}});return gp(W,F,y,k,N,R)}),Le(A=>A!==null),Pt()),mv);Se(re(n,Le($_),ye(A=>A==null?void 0:A.length)),t),Se(re(g,ye(A=>A.topListHeight)),f),Se(f,l),Se(re(g,ye(A=>[A.top,A.bottom])),s),Se(re(g,ye(A=>A.items)),b);const E=Xr(re(g,Le(({items:A})=>A.length>0),Ve(t,n),Le(([{items:A},C])=>A[A.length-1].originalIndex===C-1),ye(([,A,C])=>[A-1,C]),Pt(Zf),ye(([A])=>A))),T=Xr(re(g,ma(200),Le(({items:A,topItems:C})=>A.length>0&&A[0].originalIndex===C.length),ye(({items:A})=>A[0].index),Pt())),O=Xr(re(g,Le(({items:A})=>A.length>0),ye(({items:A})=>{let C=0,y=A.length-1;for(;A[C].type==="group"&&CC;)y--;return{startIndex:A[C].index,endIndex:A[y].index}}),Pt(P9)));return{listState:g,topItemsIndexes:m,endReached:E,startReached:T,rangeChanged:O,itemsRendered:b,initialItemCount:S,...d}},kt(yi,A9,K_,kd,Id,Rd,Ga,U_),{singleton:!0}),Mye=ut(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{initialItemCount:i,listState:a},{didMount:s}])=>(Se(re(s,Ve(i),Le(([,l])=>l!==0),Ve(o,e,t,r,n),ye(([[,l],u,c,f,d,h=[]])=>T9(l,u,c,f,d,h))),a),{}),kt(yi,kd,nl,Ga),{singleton:!0}),I9=ut(([{scrollVelocity:e}])=>{const t=fe(!1),n=qe(),r=fe(!1);return Se(re(e,Ve(r,t,n),Le(([o,i])=>!!i),ye(([o,i,a,s])=>{const{exit:l,enter:u}=i;if(a){if(l(o,s))return!1}else if(u(o,s))return!0;return a}),Pt()),t),dt(re(Sn(t,e,n),Ve(r)),([[o,i,a],s])=>o&&s&&s.change&&s.change(i,a)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},kt(Rd),{singleton:!0}),Dye=ut(([{topItemsIndexes:e}])=>{const t=fe(0);return Se(re(t,Le(n=>n>0),ye(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},kt(nl)),R9=ut(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const i=qe(),a=rr(re(Sn(e,r,t,n,o),ye(([s,l,u,c,f])=>s+l+u+c+f.offsetBottom+f.bottom)),0);return Se(De(a),i),{totalListHeight:a,totalListHeightChanged:i}},kt(cr,nl),{singleton:!0});function k9(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Lye=k9(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Nye=ut(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:i,scrollDirection:a,lastJumpDueToItemResize:s},{listState:l},{beforeUnshiftWith:u,shiftWithOffset:c,sizes:f,gap:d},{log:h},{recalcInProgress:p}])=>{const m=Xr(re(l,Ve(s),ii(([,b,g,E],[{items:T,totalCount:O,bottom:A,offsetBottom:C},y])=>{const _=A+C;let v=0;return g===O&&b.length>0&&T.length>0&&(T[0].originalIndex===0&&b[0].originalIndex===0||(v=_-E,v!==0&&(v+=y))),[v,T,O,_]},[0,[],0,0]),Le(([b])=>b!==0),Ve(t,a,r,i,h,p),Le(([,b,g,E,,,T])=>!T&&!E&&b!==0&&g===Yf),ye(([[b],,,,,g])=>(g("Upward scrolling compensation",{amount:b},qr.DEBUG),b))));function S(b){b>0?(je(e,{top:-b,behavior:"auto"}),je(n,0)):(je(n,0),je(e,{top:-b,behavior:"auto"}))}return dt(re(m,Ve(n,o)),([b,g,E])=>{E&&Lye()?je(n,g-b):S(-b)}),dt(re(Sn(rr(o,!1),n,p),Le(([b,g,E])=>!b&&!E&&g!==0),ye(([b,g])=>g),ma(1)),S),Se(re(c,ye(b=>({top:-b}))),e),dt(re(u,Ve(f,d),ye(([b,{lastSize:g,groupIndices:E,sizeTree:T},O])=>{function A(C){return C*(g+O)}if(E.length===0)return A(b);{let C=0;const y=Xf(T,0);let _=0,v=0;for(;_b&&(C-=y,x=b-_+1),_+=x,C+=A(x),v++}return C}})),b=>{je(n,b),requestAnimationFrame(()=>{je(e,{top:b}),requestAnimationFrame(()=>{je(n,0),je(p,!1)})})}),{deviation:n}},kt(cr,Rd,nl,yi,Wa,U_)),Bye=ut(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=fe(0);return dt(re(e,Ve(r),Le(([,o])=>o!==0),ye(([,o])=>({top:o}))),o=>{Vi(re(n,Mu(1),Le(i=>i.items.length>1)),()=>{requestAnimationFrame(()=>{je(t,o)})})}),{initialScrollTop:r}},kt(Ga,cr,nl),{singleton:!0}),jye=ut(([{viewportHeight:e},{totalListHeight:t}])=>{const n=fe(!1),r=rr(re(Sn(n,e,t),Le(([o])=>o),ye(([,o,i])=>Math.max(0,o-i)),ma(0),Pt()),0);return{alignToBottom:n,paddingTopAddition:r}},kt(cr,R9),{singleton:!0}),X_=ut(([{scrollTo:e,scrollContainerState:t}])=>{const n=qe(),r=qe(),o=qe(),i=fe(!1),a=fe(void 0);return Se(re(Sn(n,r),ye(([{viewportHeight:s,scrollTop:l,scrollHeight:u},{offsetTop:c}])=>({scrollTop:Math.max(0,l-c),scrollHeight:u,viewportHeight:s}))),t),Se(re(e,Ve(r),ye(([s,{offsetTop:l}])=>({...s,top:s.top+l}))),o),{useWindowScroll:i,customScrollParent:a,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},kt(cr)),Fye=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:i,...a}})=>er?{...a,behavior:o,align:i??"end"}:null,$ye=ut(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:i,fixedHeaderHeight:a,fixedFooterHeight:s,scrollingInProgress:l},{scrollToIndex:u}])=>{const c=qe();return Se(re(c,Ve(e,o,t,i,a,s,r),Ve(n),ye(([[f,d,h,p,m,S,b,g],E])=>{const{done:T,behavior:O,align:A,calculateViewLocation:C=Fye,...y}=f,_=C9(f,d,p-1),v=qf(_,d.offsetTree,E)+m+S,x=v+Uo(d.sizeTree,_)[1],I=g+S,R=g+h-b,k=C({itemTop:v,itemBottom:x,viewportTop:I,viewportBottom:R,locationParams:{behavior:O,align:A,...y}});return k?T&&Vi(re(l,Le(M=>M===!1),Mu(Ur(l)?1:2)),T):T&&T(),k}),Le(f=>f!==null)),u),{scrollIntoView:c}},kt(yi,cr,Id,nl,Wa),{singleton:!0}),zye=ut(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:s}])=>{const l=qe(),u=fe(void 0),c=fe(null),f=fe(null);return Se(a,c),Se(s,f),dt(re(l,Ve(e,n,i,c,f)),([d,h,p,m,S,b])=>{const g=_ye(h.sizeTree);m&&S!==null&&b!==null&&(p=S.scrollTop-b.offsetTop),d({ranges:g,scrollTop:p})}),Se(re(u,Le($_),ye(Vye)),r),Se(re(o,Ve(u),Le(([,d])=>d!==void 0),Pt(),ye(([,d])=>d.ranges)),t),{getState:l,restoreStateFrom:u}},kt(yi,cr,kd,Ga,X_));function Vye(e){return{offset:e.scrollTop,index:0,align:"start"}}const Uye=ut(([e,t,n,r,o,i,a,s,l,u])=>({...e,...t,...n,...r,...o,...i,...a,...s,...l,...u}),kt(K_,Mye,Ga,I9,R9,Bye,jye,X_,$ye,Wa)),Hye=ut(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:i,data:a,firstItemIndex:s,groupIndices:l,statefulTotalCount:u,gap:c,sizes:f},{initialTopMostItemIndex:d,scrolledToInitialItem:h},p,m,S,{listState:b,topItemsIndexes:g,...E},{scrollToIndex:T},O,{topItemCount:A},{groupCounts:C},y])=>(Se(E.rangeChanged,y.scrollSeekRangeChanged),Se(re(y.windowViewportRect,ye(_=>_.visibleHeight)),p.viewportHeight),{totalCount:e,data:a,firstItemIndex:s,sizeRanges:t,initialTopMostItemIndex:d,scrolledToInitialItem:h,topItemsIndexes:g,topItemCount:A,groupCounts:C,fixedItemHeight:n,defaultItemHeight:r,gap:c,...S,statefulTotalCount:u,listState:b,scrollToIndex:T,trackItemSizes:o,itemSize:i,groupIndices:l,...E,...y,...p,sizes:f,...m}),kt(yi,kd,cr,zye,Iye,nl,Id,Nye,Dye,A9,Uye)),yv="-webkit-sticky",$6="sticky",M9=k9(()=>{if(typeof document>"u")return $6;const e=document.createElement("div");return e.style.position=yv,e.style.position===yv?yv:$6});function D9(e,t){const n=ee.useRef(null),r=ee.useCallback(s=>{if(s===null||!s.offsetParent)return;const l=s.getBoundingClientRect(),u=l.width;let c,f;if(t){const d=t.getBoundingClientRect(),h=l.top-d.top;c=d.height-Math.max(0,h),f=h+t.scrollTop}else c=window.innerHeight-Math.max(0,l.top),f=l.top+window.pageYOffset;n.current={offsetTop:f,visibleHeight:c,visibleWidth:u},e(n.current)},[e,t]),{callbackRef:o,ref:i}=V_(r),a=ee.useCallback(()=>{r(i.current)},[r,i]);return ee.useEffect(()=>{if(t){t.addEventListener("scroll",a);const s=new ResizeObserver(a);return s.observe(t),()=>{t.removeEventListener("scroll",a),s.unobserve(t)}}else return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),o}const L9=ee.createContext(void 0),N9=ee.createContext(void 0);function B9(e){return e}const Wye=ut(()=>{const e=fe(l=>`Item ${l}`),t=fe(null),n=fe(l=>`Group ${l}`),r=fe({}),o=fe(B9),i=fe("div"),a=fe(Gu),s=(l,u=null)=>rr(re(r,ye(c=>c[l]),Pt()),u);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:i,scrollerRef:a,FooterComponent:s("Footer"),HeaderComponent:s("Header"),TopItemListComponent:s("TopItemList"),ListComponent:s("List","div"),ItemComponent:s("Item","div"),GroupComponent:s("Group","div"),ScrollerComponent:s("Scroller","div"),EmptyPlaceholder:s("EmptyPlaceholder"),ScrollSeekPlaceholder:s("ScrollSeekPlaceholder")}}),Gye=ut(([e,t])=>({...e,...t}),kt(Hye,Wye)),Kye=({height:e})=>ee.createElement("div",{style:{height:e}}),Xye={position:M9(),zIndex:1,overflowAnchor:"none"},qye={overflowAnchor:"none"},z6=ee.memo(function({showTopList:t=!1}){const n=Ke("listState"),r=go("sizeRanges"),o=Ke("useWindowScroll"),i=Ke("customScrollParent"),a=go("windowScrollContainerState"),s=go("scrollContainerState"),l=i||o?a:s,u=Ke("itemContent"),c=Ke("context"),f=Ke("groupContent"),d=Ke("trackItemSizes"),h=Ke("itemSize"),p=Ke("log"),m=go("gap"),{callbackRef:S}=uye(r,h,d,t?Gu:l,p,m,i),[b,g]=ee.useState(0);q_("deviation",k=>{b!==k&&g(k)});const E=Ke("EmptyPlaceholder"),T=Ke("ScrollSeekPlaceholder")||Kye,O=Ke("ListComponent"),A=Ke("ItemComponent"),C=Ke("GroupComponent"),y=Ke("computeItemKey"),_=Ke("isSeeking"),v=Ke("groupIndices").length>0,x=Ke("paddingTopAddition"),I=Ke("scrolledToInitialItem"),R=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+x,paddingBottom:n.offsetBottom,marginTop:b,...I?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&E?ee.createElement(E,gr(E,c)):ee.createElement(O,{...gr(O,c),ref:S,style:R,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(k=>{const M=k.originalIndex,N=y(M+n.firstItemIndex,k.data,c);return _?ee.createElement(T,{...gr(T,c),key:N,index:k.index,height:k.size,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?ee.createElement(C,{...gr(C,c),key:N,"data-index":M,"data-known-size":k.size,"data-item-index":k.index,style:Xye},f(k.index,c)):ee.createElement(A,{...gr(A,c),key:N,"data-index":M,"data-known-size":k.size,"data-item-index":k.index,"data-item-group-index":k.groupIndex,item:k.data,style:qye},v?u(k.index,k.groupIndex,k.data,c):u(k.index,k.data,c))}))}),Yye={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Ym={width:"100%",height:"100%",position:"absolute",top:0},Zye={width:"100%",position:M9(),top:0,zIndex:1};function gr(e,t){if(typeof e!="string")return{context:t}}const Qye=ee.memo(function(){const t=Ke("HeaderComponent"),n=go("headerHeight"),r=Ke("headerFooterTag"),o=tl(a=>n(La(a,"height"))),i=Ke("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null}),Jye=ee.memo(function(){const t=Ke("FooterComponent"),n=go("footerHeight"),r=Ke("headerFooterTag"),o=tl(a=>n(La(a,"height"))),i=Ke("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null});function j9({usePublisher:e,useEmitter:t,useEmitterValue:n}){return ee.memo(function({style:i,children:a,...s}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),f=n("scrollerRef"),d=n("context"),{scrollerRef:h,scrollByCallback:p,scrollToCallback:m}=g9(l,c,u,f);return t("scrollTo",m),t("scrollBy",p),ee.createElement(u,{ref:h,style:{...Yye,...i},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...s,...gr(u,d)},a)})}function F9({usePublisher:e,useEmitter:t,useEmitterValue:n}){return ee.memo(function({style:i,children:a,...s}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),c=e("smoothScrollTargetReached"),f=n("totalListHeight"),d=n("deviation"),h=n("customScrollParent"),p=n("context"),{scrollerRef:m,scrollByCallback:S,scrollToCallback:b}=g9(l,c,u,Gu,h);return aye(()=>(m.current=h||window,()=>{m.current=null}),[m,h]),t("windowScrollTo",b),t("scrollBy",S),ee.createElement(u,{style:{position:"relative",...i,...f!==0?{height:f+d}:{}},"data-virtuoso-scroller":!0,...s,...gr(u,p)},a)})}const ege=({children:e})=>{const t=ee.useContext(L9),n=go("viewportHeight"),r=go("fixedItemHeight"),o=tl(d9(n,i=>La(i,"height")));return ee.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),ee.createElement("div",{style:Ym,ref:o,"data-viewport-type":"element"},e)},tge=({children:e})=>{const t=ee.useContext(L9),n=go("windowViewportRect"),r=go("fixedItemHeight"),o=Ke("customScrollParent"),i=D9(n,o);return ee.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),ee.createElement("div",{ref:i,style:Ym,"data-viewport-type":"window"},e)},nge=({children:e})=>{const t=Ke("TopItemListComponent"),n=Ke("headerHeight"),r={...Zye,marginTop:`${n}px`},o=Ke("context");return ee.createElement(t||"div",{style:r,context:o},e)},rge=ee.memo(function(t){const n=Ke("useWindowScroll"),r=Ke("topItemsIndexes").length>0,o=Ke("customScrollParent"),i=o||n?age:ige,a=o||n?tge:ege;return ee.createElement(i,{...t},r&&ee.createElement(nge,null,ee.createElement(z6,{showTopList:!0})),ee.createElement(a,null,ee.createElement(Qye,null),ee.createElement(z6,null),ee.createElement(Jye,null)))}),{Component:oge,usePublisher:go,useEmitterValue:Ke,useEmitter:q_}=m9(Gye,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},rge),ige=j9({usePublisher:go,useEmitterValue:Ke,useEmitter:q_}),age=F9({usePublisher:go,useEmitterValue:Ke,useEmitter:q_}),sge=oge,V6={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},lge={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:U6,ceil:H6,floor:x0,min:gv,max:af}=Math;function uge(e){return{...lge,items:e}}function W6(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const i=n===null?null:n[o+e];return{index:o+e,data:i}})}function cge(e,t){return e&&e.column===t.column&&e.row===t.row}function kh(e,t){return e&&e.width===t.width&&e.height===t.height}const fge=ut(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:i,scrollTo:a,smoothScrollTargetReached:s,scrollContainerState:l,footerHeight:u,headerHeight:c},f,d,{propsReady:h,didMount:p},{windowViewportRect:m,useWindowScroll:S,customScrollParent:b,windowScrollContainerState:g,windowScrollTo:E},T])=>{const O=fe(0),A=fe(0),C=fe(V6),y=fe({height:0,width:0}),_=fe({height:0,width:0}),v=qe(),x=qe(),I=fe(0),R=fe(null),k=fe({row:0,column:0}),M=qe(),N=qe(),D=fe(!1),L=fe(0),j=fe(!0),F=fe(!1);dt(re(p,Ve(L),Le(([X,J])=>!!J)),()=>{je(j,!1),je(A,0)}),dt(re(Sn(p,j,_,y,L,F),Le(([X,J,te,le,,ge])=>X&&!J&&te.height!==0&&le.height!==0&&!ge)),([,,,,X])=>{je(F,!0),W_(1,()=>{je(v,X)}),Vi(re(r),()=>{je(n,[0,0]),je(j,!0)})}),Se(re(N,Le(X=>X!=null&&X.scrollTop>0),Si(0)),A),dt(re(p,Ve(N),Le(([,X])=>X!=null)),([,X])=>{X&&(je(y,X.viewport),je(_,X==null?void 0:X.item),je(k,X.gap),X.scrollTop>0&&(je(D,!0),Vi(re(r,Mu(1)),J=>{je(D,!1)}),je(a,{top:X.scrollTop})))}),Se(re(y,ye(({height:X})=>X)),o),Se(re(Sn(De(y,kh),De(_,kh),De(k,(X,J)=>X&&X.column===J.column&&X.row===J.row),De(r)),ye(([X,J,te,le])=>({viewport:X,item:J,gap:te,scrollTop:le}))),M),Se(re(Sn(De(O),t,De(k,cge),De(_,kh),De(y,kh),De(R),De(A),De(D),De(j),De(L)),Le(([,,,,,,,X])=>!X),ye(([X,[J,te],le,ge,se,ue,Ie,,gt,ie])=>{const{row:Ce,column:Be}=le,{height:Ue,width:fr}=ge,{width:Kt}=se;if(Ie===0&&(X===0||Kt===0))return V6;if(fr===0){const rl=G_(ie,X),Dd=rl===0?Math.max(Ie-1,0):rl;return uge(W6(rl,Dd,ue))}const Cn=$9(Kt,fr,Be);let xn,Vt;gt?J===0&&te===0&&Ie>0?(xn=0,Vt=Ie-1):(xn=Cn*x0((J+Ce)/(Ue+Ce)),Vt=Cn*H6((te+Ce)/(Ue+Ce))-1,Vt=gv(X-1,af(Vt,Cn-1)),xn=gv(Vt,af(0,xn))):(xn=0,Vt=-1);const xo=W6(xn,Vt,ue),{top:Wo,bottom:Ka}=G6(se,le,ge,xo),Xa=H6(X/Cn),Md=Xa*Ue+(Xa-1)*Ce-Ka;return{items:xo,offsetTop:Wo,offsetBottom:Md,top:Wo,bottom:Ka,itemHeight:Ue,itemWidth:fr}})),C),Se(re(R,Le(X=>X!==null),ye(X=>X.length)),O),Se(re(Sn(y,_,C,k),Le(([X,J,{items:te}])=>te.length>0&&J.height!==0&&X.height!==0),ye(([X,J,{items:te},le])=>{const{top:ge,bottom:se}=G6(X,le,J,te);return[ge,se]}),Pt(Zf)),n);const B=fe(!1);Se(re(r,Ve(B),ye(([X,J])=>J||X!==0)),B);const V=Xr(re(De(C),Le(({items:X})=>X.length>0),Ve(O,B),Le(([{items:X},J,te])=>te&&X[X.length-1].index===J-1),ye(([,X])=>X-1),Pt())),K=Xr(re(De(C),Le(({items:X})=>X.length>0&&X[0].index===0),Si(0),Pt())),W=Xr(re(De(C),Ve(D),Le(([{items:X},J])=>X.length>0&&!J),ye(([{items:X}])=>({startIndex:X[0].index,endIndex:X[X.length-1].index})),Pt(P9),ma(0)));Se(W,d.scrollSeekRangeChanged),Se(re(v,Ve(y,_,O,k),ye(([X,J,te,le,ge])=>{const se=O9(X),{align:ue,behavior:Ie,offset:gt}=se;let ie=se.index;ie==="LAST"&&(ie=le-1),ie=af(0,ie,gv(le-1,ie));let Ce=qw(J,ge,te,ie);return ue==="end"?Ce=U6(Ce-J.height+te.height):ue==="center"&&(Ce=U6(Ce-J.height/2+te.height/2)),gt&&(Ce+=gt),{top:Ce,behavior:Ie}})),a);const Q=rr(re(C,ye(X=>X.offsetBottom+X.bottom)),0);return Se(re(m,ye(X=>({width:X.visibleWidth,height:X.visibleHeight}))),y),{data:R,totalCount:O,viewportDimensions:y,itemDimensions:_,scrollTop:r,scrollHeight:x,overscan:e,scrollBy:i,scrollTo:a,scrollToIndex:v,smoothScrollTargetReached:s,windowViewportRect:m,windowScrollTo:E,useWindowScroll:S,customScrollParent:b,windowScrollContainerState:g,deviation:I,scrollContainerState:l,footerHeight:u,headerHeight:c,initialItemCount:A,gap:k,restoreStateFrom:N,...d,initialTopMostItemIndex:L,gridState:C,totalListHeight:Q,...f,startReached:K,endReached:V,rangeChanged:W,stateChanged:M,propsReady:h,stateRestoreInProgress:D,...T}},kt(K_,cr,Rd,I9,Ga,X_,Wa));function G6(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const i=qw(e,t,n,r[0].index),a=qw(e,t,n,r[r.length-1].index)+o;return{top:i,bottom:a}}function qw(e,t,n,r){const o=$9(e.width,n.width,t.column),i=x0(r/o),a=i*n.height+af(0,i-1)*t.row;return a>0?a+t.row:a}function $9(e,t,n){return af(1,x0((e+n)/(x0(t)+n)))}const dge=ut(()=>{const e=fe(u=>`Item ${u}`),t=fe({}),n=fe(null),r=fe("virtuoso-grid-item"),o=fe("virtuoso-grid-list"),i=fe(B9),a=fe("div"),s=fe(Gu),l=(u,c=null)=>rr(re(t,ye(f=>f[u]),Pt()),c);return{context:n,itemContent:e,components:t,computeItemKey:i,itemClassName:r,listClassName:o,headerFooterTag:a,scrollerRef:s,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),hge=ut(([e,t])=>({...e,...t}),kt(fge,dge)),pge=ee.memo(function(){const t=Dt("gridState"),n=Dt("listClassName"),r=Dt("itemClassName"),o=Dt("itemContent"),i=Dt("computeItemKey"),a=Dt("isSeeking"),s=$o("scrollHeight"),l=Dt("ItemComponent"),u=Dt("ListComponent"),c=Dt("ScrollSeekPlaceholder"),f=Dt("context"),d=$o("itemDimensions"),h=$o("gap"),p=Dt("log"),m=Dt("stateRestoreInProgress"),S=tl(b=>{const g=b.parentElement.parentElement.scrollHeight;s(g);const E=b.firstChild;if(E){const{width:T,height:O}=E.getBoundingClientRect();d({width:T,height:O})}h({row:K6("row-gap",getComputedStyle(b).rowGap,p),column:K6("column-gap",getComputedStyle(b).columnGap,p)})});return m?null:ee.createElement(u,{ref:S,className:n,...gr(u,f),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(b=>{const g=i(b.index,b.data,f);return a?ee.createElement(c,{key:g,...gr(c,f),index:b.index,height:t.itemHeight,width:t.itemWidth}):ee.createElement(l,{...gr(l,f),className:r,"data-index":b.index,key:g},o(b.index,b.data,f))}))}),mge=ee.memo(function(){const t=Dt("HeaderComponent"),n=$o("headerHeight"),r=Dt("headerFooterTag"),o=tl(a=>n(La(a,"height"))),i=Dt("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null}),yge=ee.memo(function(){const t=Dt("FooterComponent"),n=$o("footerHeight"),r=Dt("headerFooterTag"),o=tl(a=>n(La(a,"height"))),i=Dt("context");return t?ee.createElement(r,{ref:o},ee.createElement(t,gr(t,i))):null}),gge=({children:e})=>{const t=ee.useContext(N9),n=$o("itemDimensions"),r=$o("viewportDimensions"),o=tl(i=>{r(i.getBoundingClientRect())});return ee.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),ee.createElement("div",{style:Ym,ref:o},e)},vge=({children:e})=>{const t=ee.useContext(N9),n=$o("windowViewportRect"),r=$o("itemDimensions"),o=Dt("customScrollParent"),i=D9(n,o);return ee.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),ee.createElement("div",{ref:i,style:Ym},e)},wge=ee.memo(function({...t}){const n=Dt("useWindowScroll"),r=Dt("customScrollParent"),o=r||n?Sge:bge,i=r||n?vge:gge;return ee.createElement(o,{...t},ee.createElement(i,null,ee.createElement(mge,null),ee.createElement(pge,null),ee.createElement(yge,null)))}),{Component:Vge,usePublisher:$o,useEmitterValue:Dt,useEmitter:z9}=m9(hge,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},wge),bge=j9({usePublisher:$o,useEmitterValue:Dt,useEmitter:z9}),Sge=F9({usePublisher:$o,useEmitterValue:Dt,useEmitter:z9});function K6(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,qr.WARN),t==="normal"?0:parseInt(t??"0",10)}function Y_({view:e,changingView:t}){const[n,r]=Z(s=>{var l;return[s.events[e]||[],((l=s.eventsNewer[e])==null?void 0:l.length)||0]}),o=P.useRef(Date.now()),i=async()=>{if(o.current>Date.now()-2e3||t===!0)return;o.current=Date.now();const s=Z.getState().nextQuery;s&&s.next&&s.next.reqCount&&s.next.reqCount>2&&Z.getState().events[e]&&Z.getState().events[e].length<10?await Z.getState().getEvents({token:s.token,query:{...s.next,filters:{...s.next.filters,until:Math.round(Date.now()/1e3),since:Math.round(Date.now()/1e3)-30*24*60*60}}},"replace"):await Z.getState().getEvents()};P.useEffect(()=>{Z.getState().nextQuery&&i()},[]);const a=()=>{Z.getState().mergeNewerEvents(e)};return w.jsxs(w.Fragment,{children:[r>0&&w.jsxs(be,{onClick:a,variant:"outline",colorScheme:"blue",size:"sm",mb:2,width:"100%",children:[r," new events"]}),w.jsx(sge,{useWindowScroll:!0,data:n,itemContent:(s,l)=>w.jsx(ve,{mb:2,children:w.jsx(Wm,{data:l,level:0},s)}),endReached:()=>{i()}})]})}function _ge({showFollowing:e,showMentions:t,changeFeed:n}){const[r,o]=P.useState([]),[i,a]=P.useState("global"),s=async()=>{const c=await Z.getState().getAllLists();c&&o(c.map(f=>({id:f.id,title:f.title})))},l=()=>{o([])},u=c=>{a(c),n(c)};return P.useEffect(()=>(setTimeout(()=>{s()},100),l),[]),w.jsx(_R,{onChange:u,value:i,children:w.jsxs(wm,{direction:"row",children:[w.jsx(Ac,{value:"global",children:"Global"}),e&&w.jsx(Ac,{value:"following",children:"Following"}),t&&w.jsx(Ac,{value:"mentions",children:"Mentions"}),r&&r.length>0&&r.map(c=>w.jsx(Ac,{value:c.id,children:c.title},c.id))]})})}function vv(e){return new za({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT],until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-1728e5)/1e3),limit:e||15})}function Yw(e,t){const n=new za({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT],authors:e,until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-6048e5)/1e3),limit:t||15});return t&&(n.limit=t),n}function Ege(e,t){const n=new za({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT],"#t":e,until:Math.round(Date.now()/1e3),since:Math.round((Date.now()-6048e5)/1e3),limit:t||15});return t&&(n.limit=t),n}function Cge(e,t){const n=new za({kinds:[ar.SHORT_TEXT_NOTE,ar.LONG_FORM_CONTENT,ar.REPOST],"#p":e});return t&&(n.limit=t),n}function xge(){const[e,t,n]=Z(c=>[c.status,c.keypairIsLoaded,c.keypair]),r=P.useRef(!1),o=P.useRef(vv()),[i,a]=P.useState("global"),s=P.useRef(!1),l=async()=>{r.current||(r.current=!0,o.current=vv(),a("global"),await Z.getState().getEvents({token:i,query:{direction:"OLDER",filters:o.current,stickyInterval:!0,isLive:!0}}),r.current=!0)};P.useEffect(()=>(["online","offline"].includes(Z.getState().status)&&l(),()=>{Z.getState().unsubscribeByToken(i)}),[]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&l()},[e]);const u=async c=>{if(s.current=!0,await Z.getState().unsubscribeByToken(i),a(c),c==="global")o.current=vv();else if(c==="following"){const f=await Z.getState().getAllUsersFollowing();f&&(o.current=Yw(f==null?void 0:f.map(d=>d.user.pubkey)))}else if(c==="mentions")o.current=Cge([n.publicKey]);else{const f=await Z.getState().getList(c);if(f&&f.userPubkeys)o.current=Yw(f.userPubkeys);else{console.error("List not found."),s.current=!1;return}}await Z.getState().getEvents({token:c,query:{filters:o.current,stickyInterval:!0,isLive:!0}}),s.current=!1};return w.jsxs(ve,{children:[w.jsx(ve,{p:2,children:w.jsx(_ge,{showFollowing:!0,showMentions:t,changeFeed:u})}),w.jsx(Y_,{changingView:s.current,view:i})]})}function Oge(){const[e,t]=P.useState([]),[n,r]=P.useState(0),[o,i]=P.useState(!1),[a,s]=P.useState(!1),l=P.useRef(0),u=async()=>{await Z.getState().getPopularUsers().then(h=>{h&&h.length>0?(r(100),clearInterval(l.current),t(h)):n>90?(s(!0),clearInterval(l.current),i(!1)):r(p=>p+5)})},c=async()=>{t([]),r(0),l.current=setInterval(async()=>{await u()},2e3)};P.useEffect(()=>(c(),()=>{l.current&&clearInterval(l.current)}),[]);const f=async()=>{i(!0),await Z.getState().calculatePopular(),await c(),i(!1)},d=w.jsx(w.Fragment,{children:a?w.jsx(pe,{fontSize:"sm",mb:2,children:"Looks like there are no events to work with yet. Try again after browsing a little longer."}):w.jsx(w.Fragment,{children:w.jsx(bR,{size:"xs",mb:2,hasStripe:!0,value:n})})});return w.jsxs(ve,{children:[w.jsxs(ft,{spacing:2,mb:4,children:[w.jsx(Fo,{as:"h2",size:"md",marginBottom:4,children:"Hot right now"}),w.jsx(Zs,{}),!o&&n===100?w.jsx(be,{onClick:f,size:"xs",marginBottom:2,children:"Refresh"}):w.jsx(be,{onClick:c,size:"xs",disabled:!0,marginBottom:2,children:"Calculating ..."})]}),e.length>0?e.map((h,p)=>w.jsx(Ua,{user:h.user,opts:{showAbout:!1,showBanner:!1,showFollowing:!0,showBlock:!1,relayUrls:[],isBlocked:!1}},p)):d]})}function Age(){const[e]=Z(t=>[t.connected]);return w.jsxs(zu,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsxs(ve,{children:[w.jsx(xge,{}),!e&&w.jsx($u,{src:l7})]}),w.jsx(ve,{display:"flex",flexDirection:"column",children:w.jsx(ve,{mt:4,children:w.jsx(Oge,{})})})]})}function Pge(){const[e,t]=Z(f=>[f.keypair.publicKey,f.status]),[n,r]=P.useState([]),[o,i]=P.useState(0),[a,s]=P.useState(!1);P.useEffect(()=>{l();const f=setInterval(l,3e3);return()=>clearInterval(f)},[]),P.useEffect(()=>{a&&setTimeout(()=>{s(!1)},3e3)},[a]);const l=async()=>{await Z.getState().getAllUsersFollowing().then(f=>{f&&f.length>0&&r(f)}),e&&await Z.getState().lastContactsUpdate(e).then(f=>{f&&i(f)})},u=async()=>{s(!0),await Z.getState().subscribe({type:Od.REQ,filters:new za({kinds:[ar.CONTACTS],authors:[e]}),options:{timeoutIn:1e4}})},c=async()=>{s(!0);const f=wae({contacts:n.map(d=>({key:d.user.pubkey,relayUrls:d.relayUrls}))});await Z.getState().signAndSendEvent({event:f})};return w.jsxs(ve,{children:[w.jsx(Fo,{size:"lg",children:"Following"}),n.length>0?w.jsxs(w.Fragment,{children:[w.jsx(pe,{maxWidth:"800px",children:"You may decide not to publish the people you follow, but you won't be able to access this list from other devices, and it will be lost if you clear your browser data. Note: Load overwrites local data."}),w.jsxs(ft,{mt:2,mb:2,children:[w.jsxs(fd,{children:[w.jsx(be,{onClick:u,isDisabled:!e||t!=="online",isLoading:a,children:"Load"}),w.jsx(be,{onClick:c,isDisabled:!e||t!=="online",isLoading:a,children:"Publish"})]}),w.jsxs(pe,{children:["Last published:"," ",o?new Date(o*1e3).toLocaleString():"never"]})]}),n.map(f=>w.jsx(ve,{mb:"3",children:w.jsx(Ua,{user:f.user,opts:{showFollowing:!0,relayUrls:f.relayUrls}},f.user.pubkey)},f.user.pubkey))]}):w.jsxs(w.Fragment,{children:[w.jsx(pe,{children:"Follow users to easily access their content. By default, this list is not public."}),w.jsx(ve,{pb:2,pt:2,children:w.jsx(be,{onClick:u,isDisabled:!e||t!=="online",isLoading:a,children:"Load followers"})}),w.jsx(pe,{fontWeight:"bold",children:"You are not following anyone."})]})]})}function Tge(){const[e]=Z(m=>[m.status]),t=P.useRef(void 0),n=P.useRef(null),r=P.useRef(null),[o,i]=P.useState(null),[a,s]=P.useState(!1),{npub:l}=c_(),u=`profile-${l}`,c=()=>t.current===l,f=async(m,S=0)=>{s(!0),await Z.getState().getUser(m).then(b=>{b?(i(b),s(!1),r.current&&clearTimeout(r.current)):r.current=setTimeout(async()=>{if(console.log(`Retrying to load user ${m} ...`),S===2)await Z.getState().requestInformation({idsOrKeys:[m],source:"users"},{timeoutIn:1e4});else if(S>20){s(!1),r.current&&clearTimeout(r.current);return}await f(m,S+1)},1e3)})},d=async m=>{await Z.getState().count(m)},h=async()=>{if(l)try{const m=Rs(l);let S;for(const b of m.tlvItems)if(b.type===0){S=b.value;break}if(!S)return;n.current=S,i(null),await f(S),await d(S)}catch(m){console.log(m);return}},p=async m=>{t.current=l,await Z.getState().getEvents({token:u,query:{direction:"OLDER",filters:Yw([m]),stickyInterval:!0,isLive:!0}})};return P.useEffect(()=>()=>{r.current&&clearTimeout(r.current),Z.getState().unsubscribeByToken(u)},[]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&h()},[e,l]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&n.current&&!c()&&p(n.current)},[e,n.current]),w.jsxs(zu,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsxs(ve,{children:[w.jsxs(ve,{mb:4,children:[a&&w.jsx(P_,{text:"Just a sec ... Searching the Matrix for the user."}),o&&w.jsx(Ua,{user:o.user,opts:{showAbout:!0,showBanner:!0,showFollowing:!0,relayUrls:o.relayUrls,showBlock:!0}})]}),w.jsx(Y_,{view:u})]}),w.jsx(ve,{display:"flex",flexDirection:"column"})]})}function Ige({props:e}){const[t,n]=P.useState({name:"",display_name:"",picture:"",banner:"",nip05:"",website:"",about:"",image:"",lud16:"",lud06:""}),[r,o]=P.useState(""),[i,a]=P.useState(!1),s=P.useRef(!1),l=Ho(),{isOpen:u,onOpen:c,onClose:f}=jn(),[d,h]=P.useState([]),p=d.filter(E=>E.isAssigned).length,m=(E,T)=>{h(d.map(O=>O.data.url===E?{...O,isAssigned:T==="add"}:O))};P.useEffect(()=>{e.metadata&&!s.current&&n(Object.assign(t,e.metadata))},[e.metadata]),P.useEffect(()=>{Z.getState().getRelays().then(E=>{E&&h(E.map(T=>T.isReady&&T.write?{data:T,isAssigned:!0}:{data:T,isAssigned:!1}))})},[]);const S=E=>{l({title:"Error",description:E,status:"error",duration:5e3,isClosable:!0})},b=async()=>{a(!0);const E=d.map(A=>A.data.url);if(E.length===0){S("Select at least one relay"),a(!1);return}const T={};for(const[A,C]of Object.entries(t))C&&C!==""&&(T[A]=C);const O=pae({userMetadata:T,mastodonUrl:r});if(Object.keys(T).length===0){l({title:"No changes",description:"No changes to update.",status:"info",duration:5e3,isClosable:!0}),a(!1);return}try{await Z.getState().signAndSendEvent({event:O,relayUrls:E}),a(!1),await Z.getState().subscribe({type:Od.REQ,filters:new za({authors:[e.pubkey],kinds:[ar.METADATA]}),options:{timeoutIn:1e4,view:"user-profile"}})}catch(A){console.error(A),a(!1)}},g=E=>{const{name:T,value:O}=E.target;n(A=>({...A,[T]:O})),s.current=!0};return w.jsxs(ve,{marginBottom:10,children:[w.jsxs(Jn,{id:"name",mb:4,children:[w.jsx(In,{children:"Name"}),w.jsx(Lt,{name:"name",value:t.name,onChange:g})]}),w.jsxs(Jn,{id:"display_name",mb:4,children:[w.jsx(In,{children:"Display Name"}),w.jsx(Lt,{name:"display_name",value:t.display_name||"",onChange:g})]}),w.jsxs(Jn,{id:"website",mb:4,children:[w.jsx(In,{children:"Website"}),w.jsx(Lt,{name:"website",value:t.website||"",onChange:g})]}),w.jsxs(Jn,{id:"about",mb:4,children:[w.jsx(In,{children:"About"}),w.jsx(s_,{name:"about",value:t.about||"",onChange:g})]}),w.jsxs(Jn,{id:"picture",mb:4,children:[w.jsx(In,{children:"Picture URL"}),w.jsx(Lt,{name:"picture",value:t.picture||"",onChange:g}),w.jsx(as,{children:"URL for your profile picture."})]}),w.jsxs(Jn,{id:"banner",mb:4,children:[w.jsx(In,{children:"Banner URL"}),w.jsx(Lt,{name:"banner",value:t.banner||"",onChange:g}),w.jsx(as,{children:"URL for your profile banner."})]}),w.jsxs(Jn,{id:"image",mb:4,children:[w.jsx(In,{children:"Image URL"}),w.jsx(Lt,{name:"image",value:t.image||"",onChange:g}),w.jsx(as,{children:"URL for an additional image."})]}),w.jsxs(Jn,{id:"nip05",mb:4,children:[w.jsx(In,{children:"NIP05"}),w.jsx(Lt,{name:"nip05",value:t.nip05||"",onChange:g}),w.jsx(as,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),w.jsxs(Jn,{id:"lud16",mb:4,children:[w.jsx(In,{children:"LUD16"}),w.jsx(Lt,{name:"lud16",value:t.lud16||"",onChange:g}),w.jsx(as,{children:"Static internet identifier. For ex. username@somewallet.com"})]}),w.jsxs(Jn,{id:"lud06",mb:4,children:[w.jsx(In,{children:"LUD06"}),w.jsx(Lt,{name:"lud06",value:t.lud06||"",onChange:g}),w.jsx(as,{children:"bech32 encoded lnurl"})]}),w.jsxs(Jn,{id:"mastodonUrl",mb:4,children:[w.jsx(In,{children:"Mastodon URL"}),w.jsx(Lt,{name:"mastodonUrl",value:r,onChange:E=>o(E.target.value)})]}),u&&w.jsx(o7,{relays:d,onChange:m}),w.jsxs(fd,{children:[w.jsx(be,{colorScheme:"blue",type:"submit",isLoading:i,onClick:b,children:"Send update"}),w.jsxs(be,{variant:"outline",onClick:u?f:c,children:["Select relays (",p,")"]}),w.jsx(be,{isDisabled:!s.current||p===0,onClick:()=>s.current=!1,children:"Reset"})]})]})}function Rge(){const[e,t]=Z(u=>{var c;return[((c=u.keypair)==null?void 0:c.publicKey)||"",u.connected]}),[n,r]=P.useState(null),[o,i]=P.useState([]),a=Ho(),s=async()=>{if(!e||e==="")return;const u=await Z.getState().getUser(e);u&&(r(u.user),i(u.relayUrls))},l=async()=>{if(!e||e===""){a({title:"Not found",description:"No user data found yet. Did you publish your profile to one of the connected relays?",status:"error",duration:5e3,isClosable:!0});return}await Z.getState().subscribe({type:Od.REQ,filters:new za({authors:[e],kinds:[ar.METADATA]}),options:{timeoutIn:1e4,view:"user-profile"}}),a({title:"Refreshing ...",description:"Requesting information from the network.",status:"info",duration:5e3,isClosable:!0})};return P.useEffect(()=>{const u=setInterval(()=>{s()},1e3);return()=>{clearInterval(u)}},[]),w.jsxs(ve,{children:[n?w.jsx(Ua,{user:n,opts:{relayUrls:o}}):w.jsxs(w.Fragment,{children:[w.jsx(pe,{children:'"No user data found yet. Did you publish your profile to one of the connected relays?".'}),t&&w.jsx(be,{onClick:l,children:"Try again"})]}),w.jsx(Fo,{as:"h2",size:"lg",mb:4,mt:4,children:"Update your profile"}),w.jsx(Ige,{props:{pubkey:e,metadata:n==null?void 0:n.data}})]})}function kge(){const[e,t]=P.useState([]),n=async()=>{await Z.getState().getAllUsersBlocked().then(r=>{r&&t(r)})};return P.useEffect(()=>{n();const r=setInterval(n,2e3);return()=>clearInterval(r)},[]),w.jsxs(ve,{children:[w.jsx(Fo,{size:"lg",children:"Blocked"}),e.length>0?w.jsx(w.Fragment,{children:e.map(r=>w.jsx(ve,{mb:"3",children:w.jsx(Ua,{user:r.user,opts:{showFollowing:!1,showBlock:!0,relayUrls:r.relayUrls,isBlocked:!0}},r.user.pubkey)},r.user.pubkey))}):w.jsxs(w.Fragment,{children:[w.jsx(pe,{children:"Block users to ignore their events. The information is stored in your browser and not shared with relays."}),w.jsx(pe,{fontWeight:"bold",children:"You have not blocked anyone."})]})]})}function Mge({user:e,opts:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o,title:i,reaction:a,avatarSize:s}}){const l=e.data&&e.data.picture?e.data.picture:"";return w.jsx(w.Fragment,{children:w.jsxs(n_,{children:[w.jsx(t_,{children:a?w.jsxs(ve,{position:"relative",children:[w.jsx(i1,{size:s,src:l}),w.jsx(ve,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(255, 255, 255, 0.5)",borderRadius:10}),w.jsx(pe,{position:"absolute",right:"0",bottom:"0",backgroundColor:"white",height:15,width:15,textAlign:"center",borderRadius:10,fontSize:12,children:a})]}):w.jsx(i1,{size:s,src:l})}),w.jsxs(a_,{children:[w.jsx(r_,{}),w.jsx(i_,{}),w.jsx(vR,{children:i}),w.jsx(o_,{children:w.jsx(Ua,{user:e,opts:{showAbout:t,showBanner:n,showFollowing:r,relayUrls:o,title:i,reaction:a,avatarSize:s}})})]})]})})}function Dge(){const[e,t]=P.useState([]),[n,r]=P.useState(null),[o,i]=P.useState(""),[a,s]=P.useState(!1),{isOpen:l,onOpen:u,onClose:c}=jn(),f=async()=>{await Z.getState().getAllLists().then(g=>{g&&t(g)})};P.useEffect(()=>{f();const g=setInterval(f,2e3);return()=>clearInterval(g)},[]);const d=async()=>{s(!0),await Z.getState().createList({title:o}),i(""),s(!1)},h=async g=>{s(!0),await Z.getState().deleteList(g),s(!1),await f()},p=async g=>{n&&(s(!0),await Z.getState().removeUserFromList(n.id,g),await f(),n.users&&r({...n,users:n.users.filter(E=>E.user.pubkey!==g)}),s(!1))},m=g=>w.jsx(ve,{children:(g==null?void 0:g.users)&&g.users.map(E=>w.jsx(Mge,{user:E.user,opts:{avatarSize:"sm",relayUrls:E.relayUrls}},E.user.pubkey))}),S=w.jsxs(xr,{isOpen:l,onClose:c,size:"xl",children:[w.jsx(Pr,{}),w.jsxs(Or,{maxHeight:"80vh",maxWidth:"80vw",children:[w.jsx(Ar,{children:"List"}),w.jsx(Ir,{}),w.jsx(Tr,{overflowY:"auto",children:(n==null?void 0:n.users)&&n.users.map(g=>w.jsx(ve,{p:1,children:w.jsxs(ft,{children:[w.jsx(Ua,{user:g.user,opts:{avatarSize:"sm",relayUrls:g.relayUrls}},g.user.pubkey),w.jsx(Zs,{}),w.jsx(be,{size:"sm",onClick:()=>p(g.user.pubkey),isLoading:a,children:"Remove"})]})},g.user.pubkey))})]})]}),b=g=>w.jsxs(Da,{children:[w.jsx(Bt,{children:g.title}),w.jsx(Bt,{children:m(g)}),w.jsx(Bt,{children:w.jsx(be,{size:"sm",onClick:()=>{r(g),u()},children:"Edit"})}),w.jsx(Bt,{children:w.jsx(be,{size:"sm",onClick:()=>h(g.id),isLoading:a,children:"Delete"})})]},g.id);return w.jsxs(ve,{children:[w.jsx(Fo,{size:"lg",children:"Lists"}),w.jsx(pe,{children:"Lists make it easy to organize users."}),w.jsx(ve,{mt:2,mb:2,children:w.jsxs(ft,{children:[w.jsx(Lt,{value:o,onChange:g=>i(g.target.value),placeholder:"Friends"}),w.jsx(be,{size:"sm",onClick:d,isLoading:a,children:"Create list"})]})}),w.jsxs(_d,{variant:"simple",marginBottom:4,children:[w.jsx(xm,{children:w.jsxs(Da,{children:[w.jsx(jt,{children:"Title"}),w.jsx(jt,{children:"Users"}),w.jsx(jt,{}),w.jsx(jt,{})]})}),w.jsx(Om,{children:e.map(g=>b(g))})]}),S]})}function Lge(){const[e]=Z(d=>[d.connected]),t=P.useRef(!1),n=P.useRef(""),r=P.useRef([]),o=P.useRef(null),[i,a]=P.useState(!1),{note:s}=c_(),l=`event-${s}`,[u]=Z(d=>[d.events[l]?d.events[l][0]:null]),c=async(d=0)=>{await Z.getState().getEvent(n.current,{view:l,retryCount:d,relayUrls:r.current}).then(h=>{h||(console.log("Could not get event. Retrying..."),o.current=setTimeout(async()=>{if(d>20){a(!0),o.current&&clearTimeout(o.current);return}await c(d+1)},1e3))})},f=async d=>{if(!(!Z.getState().connected||t.current)){t.current=!0;try{const h=Rs(d);for(const p of h.tlvItems)if(p.type===0){n.current=p.value;break}else p.type===1&&r.current.push(p.value)}catch(h){console.log(h);return}await c()}};return P.useEffect(()=>(s&&f(s),()=>{o.current&&clearTimeout(o.current),Z.getState().unsubscribeByToken(l)}),[]),P.useEffect(()=>{e&&s&&f(s)},[e]),w.jsxs(zu,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsx(ve,{children:u?w.jsx(ve,{mb:4,children:w.jsx(Wm,{data:u,level:0})}):w.jsx(w.Fragment,{children:i?w.jsx(Fo,{as:"h2",size:"md",marginBottom:4,children:"It looks like the event is not available on any of the connected relays."}):w.jsx(P_,{text:"Just a sec ... Searching the Matrix for the event."})})}),w.jsx(ve,{display:"flex",flexDirection:"column"})]})}function Nge(){const[e]=Z(s=>[s.status]),t=P.useRef(void 0),n=P.useRef(null),{tag:r}=c_(),o=`view-${r}`,i=()=>t.current===r,a=async s=>{t.current=r,await Z.getState().getEvents({token:o,query:{direction:"OLDER",filters:Ege([s]),stickyInterval:!0,isLive:!0}})};return P.useEffect(()=>()=>{n.current&&clearTimeout(n.current),Z.getState().unsubscribeByToken(o)},[]),P.useEffect(()=>{["online","offline"].includes(Z.getState().status)&&r&&!i()&&a(r)},[e,r]),w.jsxs(zu,{templateColumns:["1fr","2fr 1fr"],gap:20,children:[w.jsx(ve,{children:w.jsx(Y_,{view:o})}),w.jsx(ve,{display:"flex",flexDirection:"column"})]})}const Bge={initialColorMode:"dark",useSystemColorMode:!0},X6=xW({config:Bge,breakpoints:{sm:"500px"}}),jge=async()=>{await Z.getState().init({maxEvents:Lk})};jge();ow.createRoot(document.getElementById("root")).render(w.jsxs(ee.StrictMode,{children:[w.jsx(RB,{initialColorMode:X6.config.initialColorMode}),w.jsx(HY,{theme:X6,children:w.jsx(Yre,{basename:"/nostr-ts/",children:w.jsx(Hre,{children:w.jsxs(To,{element:w.jsx(ehe,{}),children:[w.jsx(To,{path:"/",element:w.jsx(Age,{})}),w.jsx(To,{path:"/account",element:w.jsx(Zce,{})}),w.jsx(To,{path:"/profile",element:w.jsx(Rge,{})}),w.jsx(To,{path:"/following",element:w.jsx(Pge,{})}),w.jsx(To,{path:"/blocked",element:w.jsx(kge,{})}),w.jsx(To,{path:"/lists",element:w.jsx(Dge,{})}),w.jsx(To,{path:"/p/:npub",element:w.jsx(Tge,{})}),w.jsx(To,{path:"/e/:note",element:w.jsx(Lge,{})}),w.jsx(To,{path:"/t/:tag",element:w.jsx(Nge,{})})]})})})})]})); diff --git a/index.html b/index.html index 03cf729..af632cb 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ NostrOP - + diff --git a/sw.js b/sw.js index 69a619f..f05cec6 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,i={};const s=(s,r)=>(s=new URL(s+".js",r).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(r,n)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let t={};const l=e=>s(e,o),d={module:{uri:o},exports:t,require:l};i[o]=Promise.all(r.map((e=>d[e]||l(e)))).then((e=>(n(...e),t)))}}define(["./workbox-99f5c7c2"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-534e67da.css",revision:null},{url:"assets/index-e3780f9c.js",revision:null},{url:"assets/pow-worker-3948d45b.js",revision:null},{url:"assets/worker-ef9cca43.js",revision:null},{url:"index.html",revision:"4669de0a77ef1cdfdfe1a9e6763d3735"},{url:"registerSW.js",revision:"72da3f9bb62b1890b879554c0bd77e27"},{url:"favicon.ico",revision:"83750d8612b9a4df99236629f37b04d7"},{url:"apple-touch-icon.png",revision:"95774594b729b50f85a69e6235e4a54f"},{url:"pwa-192x192.png",revision:"eb10b1f1cbc056c8edf67f26b9dd6f0a"},{url:"pwa-512x512.png",revision:"eb3d6288f970795a6f8b60198c62d36c"},{url:"manifest.webmanifest",revision:"80b57a076a6ed2222191d317528ba3ed"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,i={};const s=(s,r)=>(s=new URL(s+".js",r).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(r,n)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let t={};const l=e=>s(e,o),d={module:{uri:o},exports:t,require:l};i[o]=Promise.all(r.map((e=>d[e]||l(e)))).then((e=>(n(...e),t)))}}define(["./workbox-99f5c7c2"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-534e67da.css",revision:null},{url:"assets/index-811326dc.js",revision:null},{url:"assets/pow-worker-3948d45b.js",revision:null},{url:"assets/worker-ef9cca43.js",revision:null},{url:"index.html",revision:"62ead1ac72f83529f61513aaba25267e"},{url:"registerSW.js",revision:"72da3f9bb62b1890b879554c0bd77e27"},{url:"favicon.ico",revision:"83750d8612b9a4df99236629f37b04d7"},{url:"apple-touch-icon.png",revision:"95774594b729b50f85a69e6235e4a54f"},{url:"pwa-192x192.png",revision:"eb10b1f1cbc056c8edf67f26b9dd6f0a"},{url:"pwa-512x512.png",revision:"eb3d6288f970795a6f8b60198c62d36c"},{url:"manifest.webmanifest",revision:"80b57a076a6ed2222191d317528ba3ed"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));